Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Factory to get the `offset` for a line and columnbased `position` in the bound indices.
function positionToOffsetFactory(indices) { return positionToOffset /* Get the `offset` for a line and column-based * `position` in the bound indices. */ function positionToOffset(position) { var line = position && position.line var column = position && position.column if (!isNaN(line) && !isNaN(column) && line - 1 in indices) { return (indices[line - 2] || 0) + column - 1 || 0 } return -1 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function pointToOffsetFactory(indices) {\n return pointToOffset\n\n // Get the `offset` for a line and column-based `point` in the bound\n // indices.\n function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n // Get the line and column-based `position` for `offset` in the bound indices.\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n // Get the line and column-based `position` for `offset` in the bound indices.\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n // Get the line and column-based `position` for `offset` in the bound indices.\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n /* Get the line and column-based `position` for\n * `offset` in the bound indices. */\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPositionFactory(indices) {\n return offsetToPosition\n\n /* Get the line and column-based `position` for\n * `offset` in the bound indices. */\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "offsetAt(position) {\n return (0, utils_1.offsetAt)(position, this.getText(), this.getLineOffsets());\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "offset_from_position(position) {\n const offset = Offset.zero();\n\n // We attempt to explore in each of the four directions in turn.\n // These four loops could be simplified, but have been left as-is to aid readability.\n\n if (position.x > 0) {\n for (let col = 0; col < Math.floor(position.x); ++col) {\n offset.left += this.cell_size(this.cell_width, col);\n }\n offset.left\n += this.cell_size(this.cell_width, Math.floor(position.x)) * (position.x % 1);\n }\n if (position.x < 0) {\n for (let col = -1; col >= position.x; --col) {\n offset.left -= this.cell_size(this.cell_width, col);\n }\n offset.left\n += this.cell_size(this.cell_width, Math.floor(position.x)) * (position.x % 1);\n }\n\n if (position.y > 0) {\n for (let row = 0; row < Math.floor(position.y); ++row) {\n offset.top += this.cell_size(this.cell_height, row);\n }\n offset.top\n += this.cell_size(this.cell_height, Math.floor(position.y)) * (position.y % 1);\n }\n if (position.y < 0) {\n for (let row = -1; row >= position.y; --row) {\n offset.top -= this.cell_size(this.cell_height, row);\n }\n offset.top\n += this.cell_size(this.cell_height, Math.floor(position.y)) * (position.y % 1);\n }\n\n return offset;\n }", "function offsetToPointFactory(indices) {\n return offsetToPoint\n\n // Get the line and column-based `point` for `offset` in the bound indices.\n function offsetToPoint(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function computeOffset(position, data) {\n let line = position.line;\n let column = position.column + 1;\n for (let i = 0; i < data.length; i++) {\n if (line > 1) {\n /* not yet on the correct line */\n if (data[i] === \"\\n\") {\n line--;\n }\n }\n else if (column > 1) {\n /* not yet on the correct column */\n column--;\n }\n else {\n /* line/column found, return current position */\n return i;\n }\n }\n /* istanbul ignore next: should never reach this line unless espree passes bad\n * positions, no sane way to test */\n throw new Error(\"Failed to compute location offset from position\");\n}", "function xyOffsetIndex(i, x, y, w, h) {\n var index = i + x + y * w;\n var absx = (i % w) + x;\n if (absx < 0 && index < 0 || absx >= w && index >= w * h) {\n return i - x - y * w;\n }\n if (absx < 0 || absx >= w) { // if off the left.\n return i - x + y * w;\n }\n //var absy = index - (w * y)\n if (index < 0 || index >= w * h) { // if off top/bottom.\n return i + x - y * w;\n }\n return index;\n}", "positionAt(offset) {\n return (0, utils_1.positionAt)(offset, this.getText(), this.getLineOffsets());\n }", "function computeInOffsetByIndex(x, y, index) {\n var outx = x + 15;\n var outy = y + 47 + index * 20;\n\n return { x: outx, y: outy };\n}", "function offsetToPoint(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "position_from_offset(offset) {\n const [col, row] = this.col_row_from_offset(offset);\n return new Position(col, row);\n }", "function offsetToPoint(offset) {\n var index = -1\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n }\n\n return {}\n }", "function offsetToPoint(offset) {\n var index = -1\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n }\n\n return {}\n }", "function offsetToPoint(offset) {\n var index = -1;\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n }\n\n return {}\n }", "getLineAndColumnFromChunk(offset) {\r\n\t\t\t\tvar column, columnCompensation, compensation, lastLine, lineCount, previousLinesCompensation, ref, string;\r\n\t\t\t\tcompensation = this.getLocationDataCompensation(this.chunkOffset, this.chunkOffset + offset);\r\n\t\t\t\tif (offset === 0) {\r\n\t\t\t\t\treturn [this.chunkLine, this.chunkColumn + compensation, this.chunkOffset + compensation];\r\n\t\t\t\t}\r\n\t\t\t\tif (offset >= this.chunk.length) {\r\n\t\t\t\t\tstring = this.chunk;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstring = this.chunk.slice(0, +(offset - 1) + 1 || 9e9);\r\n\t\t\t\t}\r\n\t\t\t\tlineCount = count(string, '\\n');\r\n\t\t\t\tcolumn = this.chunkColumn;\r\n\t\t\t\tif (lineCount > 0) {\r\n\t\t\t\t\tref = string.split('\\n'), [lastLine] = slice.call(ref, -1);\r\n\t\t\t\t\tcolumn = lastLine.length;\r\n\t\t\t\t\tpreviousLinesCompensation = this.getLocationDataCompensation(this.chunkOffset, this.chunkOffset + offset - column);\r\n\t\t\t\t\tif (previousLinesCompensation < 0) {\r\n\t\t\t\t\t\t// Don't recompensate for initially inserted newline.\r\n\t\t\t\t\t\tpreviousLinesCompensation = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcolumnCompensation = this.getLocationDataCompensation(this.chunkOffset + offset + previousLinesCompensation - column, this.chunkOffset + offset + previousLinesCompensation);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcolumn += string.length;\r\n\t\t\t\t\tcolumnCompensation = compensation;\r\n\t\t\t\t}\r\n\t\t\t\treturn [this.chunkLine + lineCount, column + columnCompensation, this.chunkOffset + offset + compensation];\r\n\t\t\t}", "positionAt(offset) {\n const before = this.textDocument.slice(0, offset);\n const newLines = before.match(/\\n/g);\n const line = newLines ? newLines.length : 0;\n const preCharacters = before.match(/(\\n|^).*$/g);\n return new tokenizer_1.Position(line, preCharacters ? preCharacters[0].length : 0);\n }", "function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "function estimateCoords(cm, pos) {\r\n var left = 0, pos = clipPos(cm.doc, pos);\r\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\r\n var lineObj = getLine(cm.doc, pos.line);\r\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\r\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\r\n }", "function estimateCoords(cm, pos) {\n\t\t var left = 0, pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n }", "column(pos, bias = 1) {\n let { text, from } = this.lineAt(pos, bias);\n let result = this.countColumn(text, pos - from);\n let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;\n if (override > -1)\n result += override - this.countColumn(text, text.search(/\\S|$/));\n return result;\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "originalPositionFor(aArgs) {\n const needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column'),\n }\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n const sectionIndex = binarySearch.search(\n needle,\n this._sections,\n function (aNeedle, section) {\n const cmp =\n aNeedle.generatedLine - section.generatedOffset.generatedLine\n if (cmp) {\n return cmp\n }\n\n return aNeedle.generatedColumn - section.generatedOffset.generatedColumn\n }\n )\n const section = this._sections[sectionIndex]\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null,\n }\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),\n column:\n needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias,\n })\n }", "function posToIndex(pos) {\n var row = pos[0];\n var col = pos[1];\n return (row * 4) + col;\n}", "function estimateCoords(cm, pos) {\n\t\t var left = 0;\n\t\t pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height}\n\t\t }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}" ]
[ "0.72743964", "0.72743964", "0.72743964", "0.6972963", "0.65917194", "0.65917194", "0.65917194", "0.65787613", "0.65787613", "0.64917874", "0.63492453", "0.63492453", "0.63492453", "0.63492453", "0.63492453", "0.63478184", "0.6271752", "0.6181949", "0.6181949", "0.6181949", "0.6181949", "0.6181949", "0.61079186", "0.60231", "0.587864", "0.5875369", "0.58593285", "0.5824185", "0.5821329", "0.5805232", "0.5805232", "0.5789762", "0.57102454", "0.5700463", "0.5692921", "0.5671805", "0.5671805", "0.5671805", "0.5671805", "0.5671805", "0.5671805", "0.5671805", "0.5671805", "0.56566906", "0.56566906", "0.56426007", "0.56426007", "0.56382126", "0.56375796", "0.56295335", "0.56295335", "0.56295335", "0.5627582", "0.5627582", "0.5627582", "0.5627582", "0.5627582", "0.5627582", "0.5627582", "0.5627582", "0.5627582", "0.5627582", "0.5618788", "0.5618788", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.5615236", "0.56146586", "0.561437", "0.56133944", "0.56133944", "0.56011873", "0.56011873", "0.56011593", "0.55995107", "0.55957025", "0.5587797", "0.5587797", "0.5587797", "0.5587797", "0.5587797", "0.5587797", "0.5587797", "0.5587797", "0.5587797" ]
0.7171669
4
Get the `offset` for a line and columnbased `position` in the bound indices.
function positionToOffset(position) { var line = position && position.line var column = position && position.column if (!isNaN(line) && !isNaN(column) && line - 1 in indices) { return (indices[line - 2] || 0) + column - 1 || 0 } return -1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function computeOffset(position, data) {\n let line = position.line;\n let column = position.column + 1;\n for (let i = 0; i < data.length; i++) {\n if (line > 1) {\n /* not yet on the correct line */\n if (data[i] === \"\\n\") {\n line--;\n }\n }\n else if (column > 1) {\n /* not yet on the correct column */\n column--;\n }\n else {\n /* line/column found, return current position */\n return i;\n }\n }\n /* istanbul ignore next: should never reach this line unless espree passes bad\n * positions, no sane way to test */\n throw new Error(\"Failed to compute location offset from position\");\n}", "offset_from_position(position) {\n const offset = Offset.zero();\n\n // We attempt to explore in each of the four directions in turn.\n // These four loops could be simplified, but have been left as-is to aid readability.\n\n if (position.x > 0) {\n for (let col = 0; col < Math.floor(position.x); ++col) {\n offset.left += this.cell_size(this.cell_width, col);\n }\n offset.left\n += this.cell_size(this.cell_width, Math.floor(position.x)) * (position.x % 1);\n }\n if (position.x < 0) {\n for (let col = -1; col >= position.x; --col) {\n offset.left -= this.cell_size(this.cell_width, col);\n }\n offset.left\n += this.cell_size(this.cell_width, Math.floor(position.x)) * (position.x % 1);\n }\n\n if (position.y > 0) {\n for (let row = 0; row < Math.floor(position.y); ++row) {\n offset.top += this.cell_size(this.cell_height, row);\n }\n offset.top\n += this.cell_size(this.cell_height, Math.floor(position.y)) * (position.y % 1);\n }\n if (position.y < 0) {\n for (let row = -1; row >= position.y; --row) {\n offset.top -= this.cell_size(this.cell_height, row);\n }\n offset.top\n += this.cell_size(this.cell_height, Math.floor(position.y)) * (position.y % 1);\n }\n\n return offset;\n }", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n /* Get the `offset` for a line and column-based\n * `position` in the bound indices. */\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n /* Get the `offset` for a line and column-based\n * `position` in the bound indices. */\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "offsetAt(position) {\n return (0, utils_1.offsetAt)(position, this.getText(), this.getLineOffsets());\n }", "function pointToOffsetFactory(indices) {\n return pointToOffset\n\n // Get the `offset` for a line and column-based `point` in the bound\n // indices.\n function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}", "function xyOffsetIndex(i, x, y, w, h) {\n var index = i + x + y * w;\n var absx = (i % w) + x;\n if (absx < 0 && index < 0 || absx >= w && index >= w * h) {\n return i - x - y * w;\n }\n if (absx < 0 || absx >= w) { // if off the left.\n return i - x + y * w;\n }\n //var absy = index - (w * y)\n if (index < 0 || index >= w * h) { // if off top/bottom.\n return i + x - y * w;\n }\n return index;\n}", "column(pos, bias = 1) {\n let { text, from } = this.lineAt(pos, bias);\n let result = this.countColumn(text, pos - from);\n let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;\n if (override > -1)\n result += override - this.countColumn(text, text.search(/\\S|$/));\n return result;\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\r\n var left = 0, pos = clipPos(cm.doc, pos);\r\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\r\n var lineObj = getLine(cm.doc, pos.line);\r\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\r\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\r\n }", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n\t\t var left = 0, pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }", "function estimateCoords(cm, pos) {\r\n var left = 0;\r\n pos = clipPos(cm.doc, pos);\r\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\r\n var lineObj = getLine(cm.doc, pos.line);\r\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\r\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\r\n}", "function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}", "function estimateCoords(cm, pos) {\n\t\t var left = 0;\n\t\t pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height}\n\t\t }", "function posToIndex(pos) {\n var row = pos[0];\n var col = pos[1];\n return (row * 4) + col;\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line)\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight)\n if (right) { m.left = m.right; } else { m.right = m.left }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length\n sticky = \"before\"\n } else if (ch <= 0) {\n ch = 0\n sticky = \"after\"\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = (part.level % 2) != 0\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky)\n var other = bidiOther\n var val = getBidi(ch, partPos, sticky == \"before\")\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\") }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n var offset\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n offset = (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return offset > -1 && offset < indices[indices.length - 1] ? offset : -1\n }", "function pointToOffset(point) {\n var line = point && point.line\n var column = point && point.column\n var offset\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n offset = (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return offset > -1 && offset < indices[indices.length - 1] ? offset : -1\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = (part.level % 2) != 0;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function _cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n\n if (!preparedMeasure) {\n preparedMeasure = prepareMeasureForLine(cm, lineObj);\n }\n\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\n if (right) {\n m.left = m.right;\n } else {\n m.right = m.left;\n }\n\n return intoCoordSystem(cm, lineObj, m, context);\n }\n\n var order = getOrder(lineObj, cm.doc.direction),\n ch = pos.ch,\n sticky = pos.sticky;\n\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n\n if (!order) {\n return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\");\n }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos],\n right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert);\n }\n\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n\n if (other != null) {\n val.other = getBidi(ch, other, sticky != \"before\");\n }\n\n return val;\n } // Used to cheaply estimate the coordinates for a position. Used for" ]
[ "0.6477924", "0.6477924", "0.6477924", "0.64409935", "0.6405255", "0.63719386", "0.63719386", "0.63099563", "0.6148568", "0.6017814", "0.59841573", "0.59635794", "0.59635794", "0.59635794", "0.59635794", "0.59635794", "0.59635794", "0.59635794", "0.59635794", "0.5934817", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5926653", "0.5923213", "0.59205997", "0.59205997", "0.5905139", "0.5905139", "0.5905139", "0.5905139", "0.5905139", "0.5905139", "0.5905139", "0.5905139", "0.5905139", "0.5905139", "0.5905139", "0.59040666", "0.5902132", "0.5902132", "0.5902132", "0.5899012", "0.5899012", "0.5899012", "0.5899012", "0.5899012", "0.5888789", "0.5887633", "0.588031", "0.587541", "0.5847813", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.5827692", "0.58244735", "0.58244735", "0.58228225", "0.58228225", "0.58228225", "0.58228225", "0.58228225", "0.58228225", "0.58228225", "0.58228225", "0.58228225", "0.58228225", "0.58222604", "0.5807299" ]
0.68115723
3
Get indices of linebreaks in `value`.
function indices(value) { var result = [] var index = value.indexOf('\n') while (index !== -1) { result.push(index + 1) index = value.indexOf('\n', index + 1) } result.push(value.length + 1) return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineCount(value) {\n var count = 0;\n for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {\n var char = value_1[_i];\n if (char === '\\n') {\n count++;\n }\n }\n return count;\n}", "function computeLineStartsMap(text) {\n const result = [0];\n let pos = 0;\n while (pos < text.length) {\n const char = text.charCodeAt(pos++);\n // Handles the \"CRLF\" line break. In that case we peek the character\n // after the \"CR\" and check if it is a line feed.\n if (char === CR_CHAR) {\n if (text.charCodeAt(pos) === LF_CHAR) {\n pos++;\n }\n result.push(pos);\n }\n else if (char === LF_CHAR || char === LINE_SEP_CHAR || char === PARAGRAPH_CHAR) {\n result.push(pos);\n }\n }\n result.push(pos);\n return result;\n }", "get lineBreaks() { return 0; }", "get widgetLineBreaks() {\n return typeof this._content == \"number\" ? this._content : 0;\n }", "function getLineNumberTag(properties){\n for (let i = 0; i < properties.length; i++) {\n const element = properties[i];\n if(properties[i].attributeName === 'LineNumberTag'){\n return properties[i].displayValue;\n }\n }\n}", "function getLineNumber(pos, el){\n if (pos == null)\n return -1;\n //console.log(caretPos);\n\n var curr_line = 0;\n var text = \"\";\n if (el != undefined){\n text = el.value;\n }\n\n //go through, checking for a newline, adding one for each\n for (var i = 0; i < pos; i++){\n if (text[i] === \"\\n\"){\n curr_line++;\n }\n }\n return curr_line;\n}", "function calculateLineNumber(fiddleValue) {\n const lines = fiddleValue.split(/\\n/);\n let newLines = '';\n newLines = lines.map((line, index) => {\n const consReg = /(console\\.log\\()(.*)/;\n // separate console.log from original string and split it in to\n // \"console.log(\" and \")\"\n const clgLines = line.match(consReg);\n if (clgLines) {\n // Add line no: to console.log and join it with rest of the original line.\n // return line.slice(0, clgLines.index) + clgLines[1] + `'${index+1}: ' + ` +clgLines[2];\n return `${line.slice(0, clgLines.index) + clgLines[1]}'${index + 1}: ' + ${clgLines[2]}`;\n }\n return line;\n });\n return newLines.join('\\n');\n}", "find(value) {\n const matches = [];\n this._viewCells.forEach(cell => {\n const cellMatches = cell.startFind(value);\n if (cellMatches) {\n matches.push(cellMatches);\n }\n });\n return matches;\n }", "getLineNumberForIndex(index) {\n const code = this.tokens.code;\n while (this.lastIndex < index && this.lastIndex < code.length) {\n if (code[this.lastIndex] === \"\\n\") {\n this.lastLineNumber++;\n }\n this.lastIndex++;\n }\n return this.lastLineNumber;\n }", "findAll(value) {\n if(this.isEmpty()) return null;\n let indexes = []\n this.forEachNode( (currentNode, index) => {\n if(currentNode.value === value) return indexes.push(index);\n }, indexes)\n\n return indexes.length ? indexes : null;\n }", "function getClassId(val, breaks) {\n var i = 0;\n if (!utils.isValidNumber(val)) {\n return -1;\n }\n while (i < breaks.length && val >= breaks[i]) i++;\n return i;\n }", "function za(e){if(!e.options.lineNumbers)return!1;var t=e.doc,a=L(e.options,t.first+t.size-1),r=e.display;if(a.length!=r.lineNumChars){var f=r.measure.appendChild(n(\"div\",[n(\"div\",a)],\"CodeMirror-linenumber CodeMirror-gutter-elt\")),o=f.firstChild.offsetWidth,i=f.offsetWidth-o;return r.lineGutter.style.width=\"\",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-i)+1,r.lineNumWidth=r.lineNumInnerWidth+i,r.lineNumChars=r.lineNumInnerWidth?a.length:-1,r.lineGutter.style.width=r.lineNumWidth+\"px\",In(e),!0}return!1}", "function lineNumbers(config = {}) {\n return [\n lineNumberConfig.of(config),\n gutters(),\n lineNumberGutter\n ];\n}", "function getSectionRowCount(value) {\n let sectionRowCount = 0;\n if (Array.isArray(value)) {\n for (let row = 0; row < value.length; row++) {\n const rowData = value[row];\n if (rowData.lineType === constants.PDFDocumentLineType.SINGLE_COLUMN) {\n if (sectionRowCount % 1 !== 0) { // caters for when colums end unequal\n sectionRowCount += 0.5;\n }\n sectionRowCount++;\n } else {\n sectionRowCount += 0.5;\n }\n }\n if (sectionRowCount % 1 !== 0) { // caters for when colums end unequal\n sectionRowCount += 0.5;\n }\n // console.log(`Value's length ${value.length} customRow's value ${customRows}`);\n } else {\n // console.log(\"Value is not an Array as expected\")\n }\n return sectionRowCount;\n}", "function get_class(value) {\n for (var i = 1; i < classBreaks.length - 1; i++) { // breaks[0] = dataMin\n if (value <= classBreaks[i]) {\n return i;\n }\n }\n return classBreaks.length - 1;\n}", "getNextValidOffset(line, offset) {\n let count = 0;\n if (!line.paragraph.paragraphFormat.bidi) {\n for (let i = 0; i < line.children.length; i++) {\n let inline = line.children[i];\n if (inline.length === 0 || inline instanceof ListTextElementBox) {\n continue;\n }\n if (offset < count + inline.length) {\n if (inline instanceof TextElementBox || inline instanceof ImageElementBox\n || (inline instanceof FieldElementBox && HelperMethods.isLinkedFieldCharacter(inline))) {\n return (offset > count ? offset : count) + 1;\n }\n }\n count += inline.length;\n }\n }\n else {\n if (offset !== this.getLineLength(line)) {\n offset = line.getInlineForOffset(offset, false, undefined, false, false, true).index;\n }\n }\n return offset;\n }", "calculateLineIndex(startPosition){\n\t\tthis.lineIndex = startPosition + this.top;\n\t\tthis.lineCount = Math.ceil((this.title.length +this.value.length + this.titleSpacing) / process.stdout.columns);\n\t\treturn this.lineIndex + this.lineCount+ this.bottom;\n\t}", "calculateLineIndex(startPosition){\n\t\tthis.lineIndex = startPosition + this.top;\n\t\tthis.lineCount = Math.ceil((this.title.length +this.value.length + this.titleSpacing) / process.stdout.columns);\n\t\treturn this.lineIndex + this.lineCount+ this.bottom;\n\t}", "function injectLineNumbers(tokens, idx, options, env, slf) {\n var line;\n if (tokens[idx].map && tokens[idx].level === 0) {\n line = tokens[idx].map[0];\n tokens[idx].attrJoin('class', 'line');\n tokens[idx].attrSet('data-line', String(line));\n }\n return slf.renderToken(tokens, idx, options, env, slf);\n }", "function injectLineNumbers(tokens, idx, options, env, slf) {\n var line;\n if (tokens[idx].map && tokens[idx].level === 0) {\n line = tokens[idx].map[0];\n tokens[idx].attrJoin('class', 'line');\n tokens[idx].attrSet('data-line', String(line));\n }\n return slf.renderToken(tokens, idx, options, env, slf);\n }", "function indicesOf(array, value) {\n var indices = [];\n for (var i=0; i<array.length; i++) {\n if (array[i] == value) {\n indices.push(i);\n };\n };\n \n return indices;\n}", "function getValueLocator(Value) {\n return Value.slice(Value.lastIndexOf(\"value=\") + 7, Value.lastIndexOf(\"value=\") + 8);\n}", "function process_code_lines() {\r\n\tconst pre = document.getElementsByTagName('pre'),\r\n\tpl = pre.length;\r\n for (let i = 0; i < pl; i++) {\r\n pre[i].innerHTML = '<span class=\"line-number\"></span>' + pre[i].innerHTML + '<span class=\"cl\"></span>';\r\n let num = pre[i].innerHTML.split(/\\n/).length;\r\n for (let j = 0; j < num; j++) {\r\n let line_num = pre[i].getElementsByTagName('span')[0];\r\n line_num.innerHTML += '<span>' + (j + 1) + '</span>';\r\n }\r\n }\r\n}", "function formatLines(prefix, indent, value) {\n return value.split('\\n').map(function (line) {\n return formatFirstLine(prefix, indent, line);\n }).join('\\n');\n}", "function locator(value, fromIndex) {\n const index = value.indexOf(START, fromIndex);\n return index;\n}", "function getLineElementsAtPageOffset(offset) {\n\t\tconst lines = document.getElementsByClassName('code-line');\n\t\tconst position = offset - window.scrollY;\n\t\tlet previous = null;\n\t\tfor (const element of lines) {\n\t\t\tconst line = +element.getAttribute('data-line');\n\t\t\tif (isNaN(line)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst bounds = element.getBoundingClientRect();\n\t\t\tconst entry = { element, line };\n\t\t\tif (position < bounds.top) {\n\t\t\t\tif (previous && previous.fractional < 1) {\n\t\t\t\t\tprevious.line += previous.fractional;\n\t\t\t\t\treturn { previous };\n\t\t\t\t}\n\t\t\t\treturn { previous, next: entry };\n\t\t\t}\n\t\t\tentry.fractional = (position - bounds.top) / (bounds.height);\n\t\t\tprevious = entry;\n\t\t}\n\t\treturn { previous };\n\t}", "function linePos(area) { return lineBefore(area).length; }", "function findLine (content) {\n let index = 0;\n while (index < lines.length) {\n if (lines[index] == content)\n break;\n else index++;\n }\n return index;\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "valueReformattedForMultilines(value) {\n if (typeof(value)==\"string\") return(value.replace(/\\n/ig,\"<br/>\"));\n else return(value);\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n }", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "indexOf(value) {\n let node = this.head, i = 0;\n while (node) {\n if (node.value === value) return i;\n node = node.next;\n i++;\n }\n return -1;\n }", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t _whitespace.lineBreakG.lastIndex = cur;\n\t var match = _whitespace.lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t _whitespace.lineBreakG.lastIndex = cur;\n\t var match = _whitespace.lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "function readLViewValue(value) {\n while (Array.isArray(value)) {\n // This check is not quite right, as it does not take into account `StylingContext`\n // This is why it is in debug, not in util.ts\n if (value.length >= HEADER_OFFSET - 1)\n return value;\n value = value[HOST];\n }\n return null;\n}", "function startOfLinePrecedingIndexWithOnlySpaces(source: string, index: number): ?number {\n for (let i = index - 1; i >= 0; i--) {\n switch (source[i]) {\n case ' ':\n case '\\t':\n break;\n\n case '\\n':\n case '\\r':\n return i + 1;\n\n default:\n return null;\n }\n }\n\n return 0;\n}", "function allIndexesOf (array, value) {\n return ;\n}", "function visualLineContinued(line) {\n var merged, lines;\n\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n\n return lines;\n } // Get the line number of the start of the visual line that the", "function realLength(value) {\n var length = value.indexOf('\\n')\n return width(length === -1 ? value : value.slice(0, length))\n}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\n\t\t\treturn result;\n\n\t\t}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\n\t\t\treturn result;\n\n\t\t}", "function binarySearchIndices( value ) {\n\n function binarySearch( start, end ) {\n\n // return closest larger index\n // if exact number is not found\n\n if ( end < start )\n return start;\n\n var mid = start + Math.floor( ( end - start ) / 2 );\n\n if ( cumulativeAreas[ mid ] > value ) {\n\n return binarySearch( start, mid - 1 );\n\n } else if ( cumulativeAreas[ mid ] < value ) {\n\n return binarySearch( mid + 1, end );\n\n } else {\n\n return mid;\n\n }\n\n }\n\n var result = binarySearch( 0, cumulativeAreas.length - 1 )\n return result;\n\n }", "function lineColumnToIndex(lineColumn, text) {\n let index = 0;\n for (let i = 0; i < lineColumn.line - 1; ++i) {\n index = text.indexOf(\"\\n\", index) + 1;\n if (index === -1) {\n return -1;\n }\n }\n return index + lineColumn.column;\n}", "function getLineBreak(taggedText, spaceWidth, start, maxWidth) {\n\t\t\t//console.info('getLineBreak(taggedText, spaceWidth, %s, %s);', start, maxWidth);\n\t\t\tlet i, width = 0;\n\t\t\tfor(i = start; i < taggedText.length; i++) {\n\t\t\t\twidth += taggedText[i].w;\n\t\t\t\t//console.log(i, width, maxWidth, taggedText[i]);\n\t\t\t\tif(taggedText[i].br) {\n\t\t\t\t\tif(width > maxWidth) {\n\t\t\t\t\t\t//console.log(i, width, maxWidth, width > maxWidth);\n\t\t\t\t\t\tdo {i--;} while(i > 0 && taggedText[i].br === false);\n\t\t\t\t\t\t//console.log(i);\n\t\t\t\t\t\t//console.log('return i > i=', i);\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t\twidth += spaceWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//console.log('return i-1 > i=', i);\n\t\t\treturn i-1;\n\t\t}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\t{ return start; }\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\n\t\t\treturn result;\n\n\t\t}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\t{ return start; }\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\n\t\t\treturn result;\n\n\t\t}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 )\n\t\t\treturn result;\n\n\t\t}", "function injectLineNumbers(tokens, idx, options, env, slf) {\n var line, endLine, listLine;\n if (tokens[idx].map && tokens[idx].level === 0) {\n line = tokens[idx].map[0];\n endLine = tokens[idx].map[1];\n listLine = [];\n for (var i = line; i < endLine; i++) {\n listLine.push(i);\n }\n tokens[idx].attrJoin(\"class\", exports.PREVIEW_PARAGRAPH_PREFIX + String(line)\n + ' ' + exports.PREVIEW_LINE_CLASS + ' ' + listLine.join(' '));\n tokens[idx].attrJoin(\"data_line_start\", \"\" + String(line));\n tokens[idx].attrJoin(\"data_line_end\", \"\" + String(endLine - 1));\n tokens[idx].attrJoin(\"data_line\", \"\" + String([line, endLine]));\n tokens[idx].attrJoin(\"count_line\", \"\" + String(endLine - line));\n }\n return slf.renderToken(tokens, idx, options, env, slf);\n}", "function search_start_pos(value) {\n var N = height / $p.config.GRIDY; // target grid N\n\n var y = Infinity,\n y$ = value,\n count = 0;\n\n while (y > 0) {\n y = Math.floor(math.log(y$) * self.A + self.B);\n y$ *= self.$_mult;\n if (count++ > N * 3) return 0; // Prevents deadloops\n }\n\n return y$;\n }", "function locator(value, fromIndex) {\n var index = value.indexOf(START, fromIndex);\n return index;\n}", "function getLineText(lineNum){\n var lines = $(\"#work_markup\").val().split(/\\r\\n|\\r|\\n/);\n return lines[lineNum];\n\n}", "function code_line(code, line) {\n return code.findIndex(l => l.line === line)\n}", "function get_class_extended(value, breaks) {\n //console.log(breaks.length);\n for (var i = 1; i < breaks.length - 1; i++) { // breaks[0] = dataMin\n if (value <= breaks[i]) {\n return i;\n }\n }\n return breaks.length - 1;\n}", "lineNumber() {\n\t for (let field of _sweetSpec2.default.getDescendant(this.type).getAttributes()) {\n\t if (typeof this[field.attrName] && this[field.attrName].lineNumber === 'function') {\n\t return this[field.attrName].lineNumber();\n\t }\n\t }\n\t }", "function binarySearchIndices( value ) {\r\n\r\n\t\t\tfunction binarySearch( start, end ) {\r\n\r\n\t\t\t\t// return closest larger index\r\n\t\t\t\t// if exact number is not found\r\n\r\n\t\t\t\tif ( end < start )\r\n\t\t\t\t\treturn start;\r\n\r\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\r\n\r\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\r\n\r\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\r\n\r\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\r\n\r\n\t\t\t\t\treturn binarySearch( mid + 1, end );\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\treturn mid;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 )\r\n\t\t\treturn result;\r\n\r\n\t\t}", "function binarySearchIndices( value ) {\r\n\r\n\t\tfunction binarySearch( start, end ) {\r\n\r\n\t\t\t// return closest larger index\r\n\t\t\t// if exact number is not found\r\n\r\n\t\t\tif ( end < start )\r\n\t\t\t\treturn start;\r\n\r\n\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\r\n\r\n\t\t\tif ( cumulativeAreas[ mid ] > value ) {\r\n\r\n\t\t\t\treturn binarySearch( start, mid - 1 );\r\n\r\n\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\r\n\r\n\t\t\t\treturn binarySearch( mid + 1, end );\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\treturn mid;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\r\n\t\treturn result;\r\n\r\n\t}", "function dotindex(value) {\n var match = EXPRESSION_LAST_DOT.exec(value)\n\n return match ? match.index + 1 : value.length\n}", "function split_linebreaks(s) {\n\t //return s.split(/\\x0d\\x0a|\\x0a/);\n\t\n\t s = s.replace(acorn.allLineBreaks, '\\n');\n\t var out = [],\n\t idx = s.indexOf(\"\\n\");\n\t while (idx !== -1) {\n\t out.push(s.substring(0, idx));\n\t s = s.substring(idx + 1);\n\t idx = s.indexOf(\"\\n\");\n\t }\n\t if (s.length) {\n\t out.push(s);\n\t }\n\t return out;\n\t }", "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "function getRange() {\n\t if (__.nullValueSeparator == 'bottom') {\n\t return [h() + 1 - __.nullValueSeparatorPadding.bottom - __.nullValueSeparatorPadding.top, 1];\n\t } else if (__.nullValueSeparator == 'top') {\n\t return [h() + 1, 1 + __.nullValueSeparatorPadding.bottom + __.nullValueSeparatorPadding.top];\n\t }\n\t return [h() + 1, 1];\n\t }", "function split_linebreaks(s) {\n\t //return s.split(/\\x0d\\x0a|\\x0a/);\n\n\t s = s.replace(acorn.allLineBreaks, '\\n');\n\t var out = [],\n\t idx = s.indexOf(\"\\n\");\n\t while (idx !== -1) {\n\t out.push(s.substring(0, idx));\n\t s = s.substring(idx + 1);\n\t idx = s.indexOf(\"\\n\");\n\t }\n\t if (s.length) {\n\t out.push(s);\n\t }\n\t return out;\n\t }", "function lineValues(rowOrColumnElements) {\n let lineArray = []\n\n for (let i = 0; i < rowOrColumnElements.length; i++) {\n lineArray.push(rowOrColumnElements[i].innerText)\n }\n\n return lineArray // gives the values of each Row and Column as an array\n}", "function editable_ret(value, settings) {\n var lines = value.split('\\n'),\n retval = [];\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n if (settings.name == \"editable_text\") {\n // Since this is for text boxes, we're going to apply\n // blockquote replacement. Greentext, mostly.\n line = line.replace(/^\\>(.+)/, '<span class=\"quote\">&gt;$1</span>');\n }\n retval.push(line);\n }\n return retval.join(\"<br>\");\n }", "function applyLineNumbers( i, tbody ){\n var i, cells,\n rows = tbody.getElementsByTagName('tr'),\n nrow = rows.length,\n data = tbody.getAttribute('data-diff').split(/\\D+/),\n xmin = data[0], xmax = data[1], \n ymin = data[2], ymax = data[3]\n ;\n /*function lpad( n, max ){\n var str = String( n ),\n len = String(max).length;\n while( str.length < len ){\n str = '\\xA0'+str;\n }\n return str;\n }*/\n function apply( td, num, max ){\n if( num <= max ){\n $('<span></span>').text( String(num) ).prependTo( td );\n }\n }\n for( i = 0; i < nrow; i++ ){\n cells = rows[i].getElementsByTagName('td');\n apply( cells[0], xmin++, xmax );\n apply( cells[2], ymin++, ymax );\n }\n }", "function buildArrayOnIndex(value){\n\tif(value.toString().includes(\" \"))\n\t\treturn value.split(\" \");\n\telse\n\t\treturn [value];\n}", "function findSpanFromSeparator(node, forward) {\n forward = forward || true\n let nodes = []\n\n if (node.nodeType == Node.TEXT_NODE) {\n node = forward ? node.nextSibling : node.previousSibling\n\n if (forward) {\n for(let n = node; n; n = forward ? n.nextSibling : n.previousSibling) {\n if (n.key == node.key) {\n nodes.push(n)\n } else {\n break // Just find neighbors\n }\n }\n } \n }\n\n return nodes\n}", "indexOfValue(value) {\n for (let i = 0; i < this.length; i++) {\n if (this.data[i] === value) {\n return i;\n }\n }\n return -1;\n }", "getPrecedingValidLine(model, lineNumber, indentRulesSupport) {\r\n let languageID = model.getLanguageIdAtPosition(lineNumber, 0);\r\n if (lineNumber > 1) {\r\n let lastLineNumber;\r\n let resultLineNumber = -1;\r\n for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) {\r\n if (model.getLanguageIdAtPosition(lastLineNumber, 0) !== languageID) {\r\n return resultLineNumber;\r\n }\r\n let text = model.getLineContent(lastLineNumber);\r\n if (indentRulesSupport.shouldIgnore(text) || /^\\s+$/.test(text) || text === '') {\r\n resultLineNumber = lastLineNumber;\r\n continue;\r\n }\r\n return lastLineNumber;\r\n }\r\n }\r\n return -1;\r\n }", "function getLineNumberForPosition(xmlData, index) {\n var lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return lines.length;\n}", "function getLineNumberForPosition(xmlData, index) {\n var lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return lines.length;\n}", "function getLineNumberForPosition(xmlData, index) {\n var lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return lines.length;\n}", "function getLineNumberForPosition(xmlData, index) {\n var lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return lines.length;\n}", "function getLineNumberForPosition(xmlData, index) {\n var lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return lines.length;\n}", "getLines(content: string): string[] {\n return content.split('\\n');\n }" ]
[ "0.6593344", "0.5705357", "0.54353976", "0.534493", "0.52009326", "0.5176218", "0.50794375", "0.5011325", "0.49926913", "0.4962433", "0.49470544", "0.49330306", "0.4925403", "0.48779956", "0.48668548", "0.48626712", "0.4852999", "0.4852999", "0.48362988", "0.48362988", "0.48360565", "0.48257038", "0.4825693", "0.48220813", "0.4810903", "0.4803995", "0.48026645", "0.47997656", "0.47879186", "0.47879186", "0.47844297", "0.47844297", "0.47789687", "0.47706583", "0.47629425", "0.47629425", "0.47629425", "0.47629425", "0.47629425", "0.47629425", "0.47629425", "0.47629425", "0.47629425", "0.47629425", "0.47623712", "0.4761598", "0.4761598", "0.47580236", "0.47580236", "0.47559655", "0.47559655", "0.47473124", "0.47429812", "0.47404048", "0.47280616", "0.47257388", "0.4725336", "0.4725336", "0.47194615", "0.47183776", "0.47147846", "0.47080374", "0.47080374", "0.4705391", "0.47048163", "0.46922517", "0.4674706", "0.46711612", "0.46663812", "0.46617338", "0.4659862", "0.46489722", "0.46379572", "0.463008", "0.46296737", "0.46267983", "0.46267983", "0.46267983", "0.46267983", "0.46267983", "0.46243912", "0.46213338", "0.46136844", "0.4611545", "0.46086833", "0.46081543", "0.46021742", "0.45938632", "0.4586724", "0.45812213", "0.45812213", "0.45812213", "0.45812213", "0.45812213", "0.4581167" ]
0.8064472
4
Factory to deescape a value, based on a list at `key` in `ctx`.
function factory(ctx, key) { return unescape; /* De-escape a string using the expression at `key` * in `ctx`. */ function unescape(value) { var prev = 0; var index = value.indexOf('\\'); var escape = ctx[key]; var queue = []; var character; while (index !== -1) { queue.push(value.slice(prev, index)); prev = index + 1; character = value.charAt(prev); /* If the following character is not a valid escape, * add the slash. */ if (!character || escape.indexOf(character) === -1) { queue.push('\\'); } index = value.indexOf('\\', prev); } queue.push(value.slice(prev)); return queue.join(''); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory(ctx, key) {\n return unescape\n\n // De-escape a string using the expression at `key` in `ctx`.\n function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }\n}", "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "function reviver(key, value){\n \n if (typeof value === \"string\"){\n var str = value.replace(/---/g, \" \");\n return str;\n }\n return value\n }", "function fix( key, escape, json ) {\n\t\t\treturn key.parseOP( /(.*?)(\\$)(.*)/, key => escapeId(key), (lhs,rhs,op) => {\n\t\t\t\tif (lhs) {\n\t\t\t\t\tjsons.push( json );\n\t\t\t\t\t\n\t\t\t\t\tvar \n\t\t\t\t\t\tkeys = rhs.split(\",\"),\n\t\t\t\t\t\tidx = [];\n\t\t\t\t\t\n\t\t\t\t\tkeys.forEach( (key,n) => { \n\t\t\t\t\t\tif ( key )\n\t\t\t\t\t\t\tidx.push( escape( n ? key : op+key) );\n\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\treturn idx.length \n\t\t\t\t\t\t? `json_extract(${escapeId(lhs)}, ${idx.join(\",\")} )`\n\t\t\t\t\t\t: escapeId(lhs);\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t\treturn escapeId(rhs);\n\t\t\t});\n\t\t}", "function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }", "function dequote (value, escapeChar, dequotedChars) {\n let output = ''\n for (let i = 0; i < value.length; i++) {\n if (value[i] === escapeChar) {\n i++\n if (dequotedChars[value[i]] || value[i] === escapeChar) {\n output += dequotedChars[value[i]] || escapeChar\n } else {\n throw new InvalidOperationError(`The quoted character '${value[i]}' was not recognised.`)\n }\n } else {\n output += value[i]\n }\n }\n return output\n}", "function eval_with_input(expr, ctx) {\n\n // if not string, just return eval(expr)\n if (typeof expr != 'string') {\n return eval(expr, ctx)\n }\n\n // substitute variable\n let regex = new RegExp('\\\\$(' + REGEX_VAR + ')', 'g');\n expr = expr.replace(regex, 'ctx.$1')\n\n // substitute key\n expr = expr.replace(new RegExp('\\\\@(' + REGEX_VAR + ')', 'g'), 'ctx.$1' + KEY_SUFFIX)\n\n // substitute nested keys\n while (expr.match(new RegExp('\\\\@(ctx\\\\.' + REGEX_VAR + '(' + KEY_SUFFIX + ')+)', 'g'))) {\n expr = expr.replace(new RegExp('\\\\@(ctx\\\\.' + REGEX_VAR + '(' + KEY_SUFFIX + ')+)', 'g'), '$1' + KEY_SUFFIX)\n }\n\n // we have a valid JavaScript expression here, replace MemberExpression with CallExpression\n let ast_tree = esprima.parse(expr).body[0]\n let converted_tree = traverse_with_obj_path(ast_tree)\n let converted_expr = escodegen.generate(converted_tree)\n\n // console.log(`eval(${expr}), ${ctx}`)\n let r = eval(converted_expr, ctx)\n //console.log(`eval(${expr}) => ${r}`)\n return r\n}", "function unquote(value) {\n return (value.\n replace(/&lt;/g, \"<\").\n replace(/&gt;/g, \">\").\n replace(/&amp;/g, \"&\"));\n}", "function createEscaper(map) {\r\n\t\t\tvar escaper = function(match) {\r\n\t\t\t\treturn map[match];\r\n\t\t\t};\r\n\t\t\t// Regexes for identifying a key that needs to be escaped\r\n\t\t\tvar source = '(?:' + utils.keys(map).join('|') + ')';\r\n\t\t\tvar testRegexp = new RegExp(source);\r\n\t\t\tvar replaceRegexp = new RegExp(source, 'g');\r\n\t\t\treturn function(string) {\r\n\t\t\t\tstring = string === null ? '' : '' + string;\r\n\t\t\t\treturn testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\r\n\t\t\t};\r\n\t\t}", "function decodeValue(value) {\n if (value == null) {\n return null;\n }\n return value.replace(decodeLookupRegex, (m) => decodeMap[m] || \"\");\n}", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function transform(list, labelKey, valueKey, separator) {\n if (!list) return []\n\n return list.map((item, index) => {\n const name = []\n if (isArray(labelKey)) {\n labelKey.forEach((key) => {\n name.push(get(item, key))\n })\n } else if (isNil(labelKey)) {\n name.push(item)\n } else {\n name.push(get(item, labelKey))\n }\n\n let value\n if (isNil(valueKey)) {\n value = item\n } else if (isArray(valueKey)) {\n for (let i = 0; i < valueKey.length; i += 1) {\n const val = get(item, valueKey[i])\n if (val !== undefined) {\n value = val\n // stop loop jika value ada\n break\n }\n }\n } else {\n value = get(item, valueKey)\n }\n\n const label = isFunction(separator)\n ? // @ts-ignore\n separator(name.length <= 1 ? name[0] : name, item, index)\n : // @ts-ignore\n name.join(separator || ' - ')\n return {\n label,\n original: item,\n value,\n key: value,\n }\n })\n}", "static reviver(key, value) {\n return key === \"\" ? Event.fromJSON(value) : value;\n }", "function replacer(key, value) {\n if (Buffer.isBuffer(value))\n return \"buffer/\" + value.toString('hex')\n else\n return value\n}", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }", "function encodeExpression(code, ctx) {\n return expression$2(['item', '_'], code, ctx);\n }", "function reviver(_key, value) {\n // NaN and undefined are not JSON.parseable, but we want to preserve this information\n if (value === NAN_VALUE) {\n return NaN;\n }\n if (value === UNDEFINED_VALUE) {\n return undefined;\n }\n return value;\n}", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function _unescape_Value(obj, script, dotName, outer)\n\t\t{\n\t\t\t/*\n\t\t\tvar msg = '';\n\t\t\tvar value = script.substr(dotName.length+1);\t//value after '='\n\t\t\tvalue.replace(/(\\$(.+?)?\\.(.*))/, function(all, dotName, subkey, key)\n\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t//if value is $...\n\t\t\t\tvar o = subkey ? subkey.ov(obj) : obj;\n\t\t\t\tif (o instanceof Object && key in o)\t\n\t\t\t\t\treturn;\t\t\t\n\t\t\t\tmsg = _unescape_invalid(script, dotName, outer);\t//source dotName undefined\n\t\t\t});\t\n\t\t\tif (msg) return msg;\n\t\t\t*/\t\t\t\t\t\t\t\t\t\t\t\t//1st replace all \";#\" with dotName [RegExp]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//e.g. --> $.1=/xyz/;$.1.lastIndex=3\n\t\t\tscript = script.replace(/;#/g, ';' + dotName);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//then change number's -- e.g. $.1 --> $[1]\n\t\t\tscript = script.replace(/\\.(\\d+)(?=([.=]|$))/g, '[$1]');\t\n\t\t\tscript = script.replace(/\\$/g, 'obj');\t\t\t//and finally change $ --> obj\n\t\t\t\n\t\t\treturn _unescape_eval('replace value', script, dotName, outer);\n\t\t}", "function encodeExpression(code, ctx) {\n return expression(['item', '_'], code, ctx);\n}", "function encodeExpression(code, ctx) {\n return expression(['item', '_'], code, ctx);\n}", "function createContext(depList) {\n var depListStr = depList.toString();\n var depNames = depListStr\n .slice(depListStr.indexOf('[') + 1, depListStr.lastIndexOf(']'))\n .replace(/\\s/g, '')\n .split(',');\n var depValues = depList();\n var out = '';\n var reg = {};\n var dat = {};\n var ab = [];\n for (var i = 0; i < depValues.length; ++i) {\n var key = depNames[i], value = depValues[i];\n var parts = key\n .replace(/\\\\/, '')\n .match(/^(.*?)(?=(\\.|\\[|$))|\\[(.*?)\\]|(\\.(.*?))(?=(\\.|\\[|$))/g);\n var v = encoder[typeof value](value, reg, ab);\n if (typeof v == 'string') {\n var pfx = 'self.' + parts[0];\n var chain = pfx;\n for (var i_1 = 1; i_1 < parts.length; ++i_1) {\n chain = chainWrap(parts[i_1], chain, pfx);\n pfx += parts[i_1];\n }\n out += chain + \"=\" + v + \";\";\n }\n else {\n // TODO: overwrite instead of assign\n var obj = dat;\n for (var i_2 = 0; i_2 < parts.length - 1; ++i_2) {\n obj = obj[parts[i_2]] = {};\n }\n obj[parts[parts.length - 1]] = v;\n }\n }\n return [out, dat, ab, reg];\n}", "getDecodedLiteralValue(node, key) {\r\n let encodedString = node ? this.getLiteralValue(node, key) : key;\r\n // in the past we use escape for encoding, we try first to decode with decodeURI\r\n // only if we fail we use deprecated unescape\r\n try {\r\n return decodeURI(encodedString);\r\n } catch (ex) {\r\n let decodedString;\r\n try {\r\n // we defined lazy getter for _decode to import from Decode.jsm module\r\n decodedString = this._decode.unescape(encodedString);\r\n } catch (er) {\r\n let msg = \"Tabmix is unable to decode \" + key;\r\n if (node)\r\n msg += \" from \" + node.QueryInterface(Ci.nsIRDFResource).Value;\r\n Tabmix.reportError(msg + \"\\n\" + er);\r\n return \"\";\r\n }\r\n if (node && key) {\r\n this.setLiteral(node, key, encodeURI(decodedString));\r\n this.saveStateDelayed(10000);\r\n }\r\n return decodedString;\r\n }\r\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "function encodeExpression(code, ctx) {\n return expression(['item', '_'], code, ctx);\n }", "function c(key, value, func, enclose){\n\tif(func && value) value = func.apply(null, [value]);\n\tif(value == undefined || value === '') return;\n\tif(enclose) return key + \":'\" + value+\"'\";\n\treturn key + ':' + value;\n}", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "function factory(ctx) {\n decoder.raw = decodeRaw\n\n return decoder\n\n // Normalize `position` to add an `indent`.\n function normalize(position) {\n var offsets = ctx.offset\n var line = position.line\n var result = []\n\n while (++line) {\n if (!(line in offsets)) {\n break\n }\n\n result.push((offsets[line] || 0) + 1)\n }\n\n return {start: position, indent: result}\n }\n\n // Decode `value` (at `position`) into text-nodes.\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }\n\n // Decode `value` (at `position`) into a string.\n function decodeRaw(value, position, options) {\n return entities(\n value,\n xtend(options, {position: normalize(position), warning: handleWarning})\n )\n }\n\n // Handle a warning.\n // See <https://github.com/wooorm/parse-entities> for the warnings.\n function handleWarning(reason, position, code) {\n if (code !== 3) {\n ctx.file.message(reason, position)\n }\n }\n}", "function key_value(key) {\n return Evaluator.key_value(key);\n}", "function resolve(value, ctx) {\n return type_3.isFunction(value) ? value(ctx) : value;\n }", "decodeParam(value, key){\n\n let decodeParamString = function(searchString) {\n if(key === 'search') {\n // Don't include 'search:' in the search tag\n return decodeURIComponent(`${searchString}`);\n }\n else {\n key = key.toString().replace(/__icontains_DEFAULT/g, \"\");\n key = key.toString().replace(/__search_DEFAULT/g, \"\");\n let split = key.split('__');\n let decodedParam = searchString;\n let exclude = false;\n if(key.startsWith('not__')) {\n exclude = true;\n split = split.splice(1, split.length);\n }\n if(key.endsWith('__gt')) {\n decodedParam = '>' + decodedParam;\n split = split.splice(0, split.length-1);\n }\n else if(key.endsWith('__lt')) {\n decodedParam = '<' + decodedParam;\n split = split.splice(0, split.length-1);\n }\n else if(key.endsWith('__gte')) {\n decodedParam = '>=' + decodedParam;\n split = split.splice(0, split.length-1);\n }\n else if(key.endsWith('__lte')) {\n decodedParam = '<=' + decodedParam;\n split = split.splice(0, split.length-1);\n }\n\n let uriDecodedParam = decodeURIComponent(decodedParam);\n\n return exclude ? `-${split.join('.')}:${uriDecodedParam}` : `${split.join('.')}:${uriDecodedParam}`;\n }\n };\n\n if (Array.isArray(value)){\n value = _.uniq(_.flattenDeep(value));\n return _.map(value, (item) => {\n return decodeParamString(item);\n });\n }\n else {\n return decodeParamString(value);\n }\n }", "function cleanValue(key, value) {\n if (key == LIEU) {\n return cleanCity(value)\n .then(cityCleaned => {\n return [{\n key: VILLE,\n value: cityCleaned\n }]\n })\n } else if (key == LOCALISATION) {\n return cleanLocalisation(value)\n } else if (key == CONTRAT) {\n if (value.includes(\"CDI\")) {\n value = \"CDI\";\n }\n if (value.includes(\"CDD\")) {\n value = \"CDD\";\n }\n if (value.includes(\"Contrat d'apprentissage\")) {\n value = \"Contrat d'apprentissage\";\n }\n if (value.includes(\"Stage conventionné\")) {\n value = \"Stage\";\n }\n if (value.includes(\"Contrat de professionnalisation\")) {\n value = \"Contrat de professionnalisation\";\n }\n } else if (key == POSTE) {\n value = value.replace(\" H/F\", \"\").replace(\"(H/F)\", \"\");\n }\n\n const valuesCleaned = [{\n key: SHORT_KEY[key],\n value: value\n }]\n\n return new Promise((resolve, reject) => {\n resolve(valuesCleaned);\n });\n\n}", "static reviver(key, value) {\n if ((typeof value == 'string') || (typeof value == 'object' && typeof value.start == 'string' && typeof value.end == 'string')) {\n return new Calends(value, 'tai64', 'tai64narux');\n }\n\n return value;\n }", "decode(key) {\n /*\n * Ignore when initial value is not defined or null\n */\n const value = this.cookies[key];\n if (value === null || value === undefined) {\n return null;\n }\n /*\n * Reference to the cache object. Mainly done to avoid typos,\n * since this object is referenced a handful of times inside\n * this method.\n */\n const cacheObject = this.cachedCookies.plainCookies;\n /*\n * Return from cache, when already parsed\n */\n if (cacheObject[key] !== undefined) {\n return cacheObject[key];\n }\n /*\n * Attempt to unpack and cache it for future. The value is only\n * when value it is not null.\n */\n const parsed = PlainCookie.canUnpack(value) ? PlainCookie.unpack(value) : null;\n if (parsed !== null) {\n cacheObject[key] = parsed;\n }\n return parsed;\n }", "function unflattenKeylistIntoAnswers(propValArray, value) {\n var answer = answers;\n for (var i = 0, n = propValArray.length - 1; i < n; ++i) {\n // lazy initialize an empty object for the current key if needed\n answer = answer[propValArray[i]] || (answer[propValArray[i]] = []);\n }\n // set the final one to the value\n answer[propValArray[n]] = value;\n }", "function SanitizeCtx(ctx) {\n var r = {};\n for (var key in ctx) {\n if (!key.startsWith('_')) {\n r[key] = ctx[key];\n }\n }\n return r;\n}", "function getDecryptedValue(value, referrer){\n if(value && isEncryptedData(value)) return decryptData(value, referrer);\n else return value;\n}", "function removeInternalValuesFromJSON(key, value)\n{\n switch (key)\n {\n case \"source\":\n case \"target\":\n return value.id; // don't include the whole node object, only the id\n\n case \"index\":\n case \"distance\":\n case \"r\":\n case \"vx\":\n case \"vy\":\n case \"fx\":\n case \"fy\":\n case \"labelwidth\":\n return undefined; // ignore\n\n default:\n return value;\n }\n}", "function replacer(key, value) {\n if (typeof value === 'function') {\n return String(value);\n }\n return value;\n }", "function reviver(key, value) {\n if (typeof value === \"string\") {\n return new Date(value);\n }\n\n return value;\n }", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }\n}", "function removeValueQuery(key, value) {\n\tarray = urlParams.getAll(key).filter((el) => el != value);\n\turlParams.delete(key);\n\tarray.forEach((el) => {\n\t\turlParams.append(key, el.replaceAll(' ', '-'));\n\t});\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "updateContext (state, { key, value }) {\n if (value) {\n Vue.set(state.context, key, {...state.context[key], ...value})\n } else {\n Vue.delete(state.context, key)\n }\n }", "function CleanQueryStringValue(key){\n\tvar thing = new String(Request.Querystring(key));\n if(HasValue(thing)) {\n\n\t\tif (thing.indexOf(',') > 0) {\n\t\t\tvar Idarr = thing.split(\",\");\n\t\t\treturn Idarr[0];\n\t\t}else{\n\t\t\treturn thing;\n\t\t}\n\t}\n\treturn thing;\n}", "function deObfuscateOnce(\n input,\n key,\n prime,\n offset,\n idx,\n out\n){\n out = '';\n idx = input.length;\n while(idx--){\n out += String.fromCharCode(\n ((input.charCodeAt(idx) - offset + idx) * key) % prime + offset\n );\n }\n return out;\n}", "function replace(key, value) {\n if (key === 'results' || key === 'result') {\n return undefined;\n }\n return value;\n}", "function substitute(val) {\n if (typeof val == 'string') {\n val = val.replace(/\\$\\{(.*?)\\}/g, (match, name) => {\n const rep = replacement(name);\n // If there's no replacement available, keep the placeholder.\n return (rep === null) ? match : rep;\n });\n }\n else if (Array.isArray(val))\n val = val.map((x) => substitute(x));\n else if (typeof val == 'object') {\n // Substitute values but not keys, so we don't deal with collisions.\n const result = {};\n for (let [k, v] of Object.entries(val))\n result[k] = substitute(v);\n val = result;\n }\n return val;\n}", "decrypt(key) {\n /*\n * Ignore when initial value is not defined or null\n */\n const value = this.cookies[key];\n if (value === null || value === undefined) {\n return null;\n }\n /*\n * Reference to the cache object. Mainly done to avoid typos,\n * since this object is referenced a handful of times inside\n * this method.\n */\n const cacheObject = this.cachedCookies.encryptedCookies;\n /*\n * Return from cache, when already parsed\n */\n if (cacheObject[key] !== undefined) {\n return cacheObject[key];\n }\n /*\n * Attempt to unpack and cache it for future. The value is only\n * when value it is not null.\n */\n const parsed = EncryptedCookie.canUnpack(value)\n ? EncryptedCookie.unpack(key, value, this.encryption)\n : null;\n if (parsed !== null) {\n cacheObject[key] = parsed;\n }\n return parsed;\n }", "_unescape(item) {\n try {\n return item.replace(escapeSequence, function (sequence, unicode4, unicode8, escapedChar) {\n var charCode;\n\n if (unicode4) {\n charCode = parseInt(unicode4, 16);\n if (isNaN(charCode)) throw new Error(); // can never happen (regex), but helps performance\n\n return fromCharCode(charCode);\n } else if (unicode8) {\n charCode = parseInt(unicode8, 16);\n if (isNaN(charCode)) throw new Error(); // can never happen (regex), but helps performance\n\n if (charCode <= 0xFFFF) return fromCharCode(charCode);\n return fromCharCode(0xD800 + (charCode -= 0x10000) / 0x400, 0xDC00 + (charCode & 0x3FF));\n } else {\n var replacement = escapeReplacements[escapedChar];\n if (!replacement) throw new Error();\n return replacement;\n }\n });\n } catch (error) {\n return null;\n }\n }", "processTokens(template,item) {\n var processed = template;\n template.match(/\\%\\%[^\\%]*\\%\\%/g).forEach(function(token) {\n var key = token.replaceAll('%%','');\n processed = processed.replaceAll(token,item.values[key]);\n });\n \n return processed;\n }", "removeNullsFromContext(inKey){\n const { keyContext } = this.state;\n return removeNulls(object.deepClone(keyContext[inKey]));\n }", "_unescape(item) {\n let invalid = false;\n const replaced = item.replace(escapeSequence, (sequence, unicode4, unicode8, escapedChar) => {\n // 4-digit unicode character\n if (typeof unicode4 === 'string') return String.fromCharCode(Number.parseInt(unicode4, 16));\n // 8-digit unicode character\n if (typeof unicode8 === 'string') {\n let charCode = Number.parseInt(unicode8, 16);\n return charCode <= 0xFFFF ? String.fromCharCode(Number.parseInt(unicode8, 16)) : String.fromCharCode(0xD800 + ((charCode -= 0x10000) >> 10), 0xDC00 + (charCode & 0x3FF));\n }\n // fixed escape sequence\n if (escapedChar in escapeReplacements) return escapeReplacements[escapedChar];\n // invalid escape sequence\n invalid = true;\n return '';\n });\n return invalid ? null : replaced;\n }", "filter (owner, key, val) {\n /* Look for the replacement function */\n if (val === undefined) return;\n\n if (val.toUSON !== undefined) val = val.toUSON.call (val, key);\n else if (val.toJSON !== undefined) val = val.toJSON.call (val, key);\n\n /* Replace the value */\n if (this.replacer === null) return val;\n\n if (Array.isArray (this.replacer)) {\n if (this.replacer.indexOf (key) === -1) {\n return;\n }\n } else {\n val = this.replacer.call (owner, key, val);\n }\n\n return val;\n}", "function replaceValue(strings, key, replacement) {\n var regexp = new RegExp('(\"' + key + '\\\\s*\"\\\\s*:\\\\s*)\".*\"', \"g\");\n // $1 consists of \"key: \", see the regexp abobe\n replacement = \"$1\" + replacement;\n strings = strings.replace(regexp, replacement);\n return strings;\n }", "function escape(key, val) {\n if (typeof(val) != \"string\") {\n return val;\n }\n\n return val\n .replace(/[\\']/g, '')\n .replace(/[\\\"]/g, '')\n .replace(/[\\\\]/g, '')\n .replace(/[\\/]/g, ' ')\n .replace(/[\\b]/g, '')\n .replace(/[\\f]/g, '')\n .replace(/[Í]/g, '')\n .replace(/[\\n]/g, ' ')\n .replace(/[\\r]/g, ' ')\n .replace(/[\\t]/g, ' ')\n .replace(/[-]/g, '')\n // .replace(/[\\']/g, '')\n // .replace(/[\\\"]/g, '')\n // .replace(/[,]/g, '')\n // .replace(/[\\\\]/g, '')\n // .replace(/[\\/]/g, '\\\\/')\n // .replace(/[\\b]/g, '\\\\b')\n // .replace(/[\\f]/g, '\\\\f')\n // .replace(/[Í]/g, '')\n // .replace(/[\\n]/g, '\\\\n')\n // .replace(/[\\r]/g, ' ')\n // .replace(/[\\t]/g, '\\\\t')\n ;\n }", "function jsonFilter(key, value) {\n if (typeof value === \"function\") {\n return value.toString();\n }\n return value;\n}", "function jsonFilter(key, value) {\n if (typeof value === \"function\") {\n return value.toString();\n }\n return value;\n}", "function replace_nested(name, key){\n if(/\\d+/.exec(key)){\n // If key is numeric, search in positional\n // arguments\n return _b_.tuple.__getitem__($.$args,\n parseInt(key))\n }else{\n // Else try in keyword arguments\n return _b_.dict.__getitem__($.$kw, key)\n }\n }", "function unescape(value) {\n return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {\n return htmlEscapes[character];\n }) : value;\n}", "function extractAndConvert(obj, key) {\n return \"Value: \" + obj[key];\n}", "function factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}", "function factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}", "function factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}", "function factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}", "function factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}", "function factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}", "function unquote(value) {\n\t if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') {\n\t return value.substring(1, value.length - 1);\n\t }\n\t return value;\n\t }", "function deeplyStripKey(input, keyToStrip) {var _context21;var predicate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {return true;};\n if (_babel_runtime_corejs3_helpers_typeof__WEBPACK_IMPORTED_MODULE_2___default()(input) !== \"object\" || _babel_runtime_corejs3_core_js_stable_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(input) || input === null || !keyToStrip) {\n return input;\n }\n\n var obj = _babel_runtime_corejs3_core_js_stable_object_assign__WEBPACK_IMPORTED_MODULE_13___default()({}, input);\n\n _babel_runtime_corejs3_core_js_stable_instance_for_each__WEBPACK_IMPORTED_MODULE_8___default()(_context21 = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(obj)).call(_context21, function (k) {\n if (k === keyToStrip && predicate(obj[k], k)) {\n delete obj[k];\n return;\n }\n obj[k] = deeplyStripKey(obj[k], keyToStrip, predicate);\n });\n\n return obj;\n}" ]
[ "0.72508484", "0.53620976", "0.53620976", "0.53620976", "0.53620976", "0.53620976", "0.53620976", "0.5162921", "0.50055116", "0.49855182", "0.4866783", "0.47823897", "0.46672222", "0.46518078", "0.46498412", "0.4647973", "0.4647973", "0.4647973", "0.4647973", "0.4647973", "0.4647973", "0.4647973", "0.4647973", "0.4647973", "0.4604723", "0.4539417", "0.45233163", "0.44916472", "0.44722027", "0.44584236", "0.4455474", "0.4455474", "0.4455474", "0.4455474", "0.4455474", "0.4455474", "0.44531316", "0.44300467", "0.44300467", "0.44271034", "0.44100612", "0.43699345", "0.43598795", "0.43576825", "0.43484408", "0.43484408", "0.43484408", "0.43484408", "0.43484408", "0.43368024", "0.43306413", "0.4306103", "0.43054345", "0.42638734", "0.42621458", "0.42547888", "0.42495543", "0.42480513", "0.42348978", "0.4209896", "0.42023733", "0.42009604", "0.4168667", "0.4168667", "0.4157103", "0.4153763", "0.4153763", "0.4153763", "0.4153763", "0.41483256", "0.41371638", "0.41366535", "0.41350865", "0.41270503", "0.4125146", "0.41168588", "0.4106459", "0.4078174", "0.40513045", "0.40416318", "0.40403405", "0.40383056", "0.40308395", "0.40308395", "0.40271845", "0.40269008", "0.4025686", "0.4018582", "0.4018582", "0.4018582", "0.4018582", "0.4018582", "0.4018582", "0.4016071", "0.40125036" ]
0.73270625
4
Deescape a string using the expression at `key` in `ctx`.
function unescape(value) { var prev = 0; var index = value.indexOf('\\'); var escape = ctx[key]; var queue = []; var character; while (index !== -1) { queue.push(value.slice(prev, index)); prev = index + 1; character = value.charAt(prev); /* If the following character is not a valid escape, * add the slash. */ if (!character || escape.indexOf(character) === -1) { queue.push('\\'); } index = value.indexOf('\\', prev); } queue.push(value.slice(prev)); return queue.join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory(ctx, key) {\n return unescape\n\n // De-escape a string using the expression at `key` in `ctx`.\n function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }\n}", "function factory(ctx, key) {\n return unescape;\n\n /* De-escape a string using the expression at `key`\n * in `ctx`. */\n function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }\n}", "function factory(ctx, key) {\n return unescape;\n\n /* De-escape a string using the expression at `key`\n * in `ctx`. */\n function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }\n}", "function factory(ctx, key) {\n return unescape;\n\n /* De-escape a string using the expression at `key`\n * in `ctx`. */\n function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }\n}", "function factory(ctx, key) {\n return unescape;\n\n /* De-escape a string using the expression at `key`\n * in `ctx`. */\n function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }\n}", "function factory(ctx, key) {\n return unescape;\n\n /* De-escape a string using the expression at `key`\n * in `ctx`. */\n function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }\n}", "function factory(ctx, key) {\n return unescape;\n\n /* De-escape a string using the expression at `key`\n * in `ctx`. */\n function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }\n}", "function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }", "function fix( key, escape, json ) {\n\t\t\treturn key.parseOP( /(.*?)(\\$)(.*)/, key => escapeId(key), (lhs,rhs,op) => {\n\t\t\t\tif (lhs) {\n\t\t\t\t\tjsons.push( json );\n\t\t\t\t\t\n\t\t\t\t\tvar \n\t\t\t\t\t\tkeys = rhs.split(\",\"),\n\t\t\t\t\t\tidx = [];\n\t\t\t\t\t\n\t\t\t\t\tkeys.forEach( (key,n) => { \n\t\t\t\t\t\tif ( key )\n\t\t\t\t\t\t\tidx.push( escape( n ? key : op+key) );\n\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\treturn idx.length \n\t\t\t\t\t\t? `json_extract(${escapeId(lhs)}, ${idx.join(\",\")} )`\n\t\t\t\t\t\t: escapeId(lhs);\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t\treturn escapeId(rhs);\n\t\t\t});\n\t\t}", "function dequote (value, escapeChar, dequotedChars) {\n let output = ''\n for (let i = 0; i < value.length; i++) {\n if (value[i] === escapeChar) {\n i++\n if (dequotedChars[value[i]] || value[i] === escapeChar) {\n output += dequotedChars[value[i]] || escapeChar\n } else {\n throw new InvalidOperationError(`The quoted character '${value[i]}' was not recognised.`)\n }\n } else {\n output += value[i]\n }\n }\n return output\n}", "function eval_with_input(expr, ctx) {\n\n // if not string, just return eval(expr)\n if (typeof expr != 'string') {\n return eval(expr, ctx)\n }\n\n // substitute variable\n let regex = new RegExp('\\\\$(' + REGEX_VAR + ')', 'g');\n expr = expr.replace(regex, 'ctx.$1')\n\n // substitute key\n expr = expr.replace(new RegExp('\\\\@(' + REGEX_VAR + ')', 'g'), 'ctx.$1' + KEY_SUFFIX)\n\n // substitute nested keys\n while (expr.match(new RegExp('\\\\@(ctx\\\\.' + REGEX_VAR + '(' + KEY_SUFFIX + ')+)', 'g'))) {\n expr = expr.replace(new RegExp('\\\\@(ctx\\\\.' + REGEX_VAR + '(' + KEY_SUFFIX + ')+)', 'g'), '$1' + KEY_SUFFIX)\n }\n\n // we have a valid JavaScript expression here, replace MemberExpression with CallExpression\n let ast_tree = esprima.parse(expr).body[0]\n let converted_tree = traverse_with_obj_path(ast_tree)\n let converted_expr = escodegen.generate(converted_tree)\n\n // console.log(`eval(${expr}), ${ctx}`)\n let r = eval(converted_expr, ctx)\n //console.log(`eval(${expr}) => ${r}`)\n return r\n}", "function decipher(string){\n\n}", "function default_escape_fn(str, key) {\n // The replace regex matches the `render_escape` mapping object.\n // If the template:\n // ```html\n // <div>{foobar}</div>\n // ```\n // was given as the `str` parameter then the returned\n // value would read:\n // ```html\n // &lt;div&gt;{foobar}&lt;/div&gt;\n // ```\n return str == undefined ? '' : (str+'').replace(/[&\\\"<>]/g, function(char) {\n return render_escape[char];\n });\n}", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "decodeKey(key) {\n return decodeURIComponent(key);\n }", "function unescape(code) {\r\n return code.replace(unescaper, function(match, escape) {\r\n return escapes[escape];\r\n });\r\n}", "function unquote(value) {\n return (value.\n replace(/&lt;/g, \"<\").\n replace(/&gt;/g, \">\").\n replace(/&amp;/g, \"&\"));\n}", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n }", "function createEscaper(map) {\r\n\t\t\tvar escaper = function(match) {\r\n\t\t\t\treturn map[match];\r\n\t\t\t};\r\n\t\t\t// Regexes for identifying a key that needs to be escaped\r\n\t\t\tvar source = '(?:' + utils.keys(map).join('|') + ')';\r\n\t\t\tvar testRegexp = new RegExp(source);\r\n\t\t\tvar replaceRegexp = new RegExp(source, 'g');\r\n\t\t\treturn function(string) {\r\n\t\t\t\tstring = string === null ? '' : '' + string;\r\n\t\t\t\treturn testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\r\n\t\t\t};\r\n\t\t}", "function unescape(token) {\n return token.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n}", "function reviver(key, value){\n \n if (typeof value === \"string\"){\n var str = value.replace(/---/g, \" \");\n return str;\n }\n return value\n }", "function escape(key, val) {\n if (typeof(val) != \"string\") {\n return val;\n }\n\n return val\n .replace(/[\\']/g, '')\n .replace(/[\\\"]/g, '')\n .replace(/[\\\\]/g, '')\n .replace(/[\\/]/g, ' ')\n .replace(/[\\b]/g, '')\n .replace(/[\\f]/g, '')\n .replace(/[Í]/g, '')\n .replace(/[\\n]/g, ' ')\n .replace(/[\\r]/g, ' ')\n .replace(/[\\t]/g, ' ')\n .replace(/[-]/g, '')\n // .replace(/[\\']/g, '')\n // .replace(/[\\\"]/g, '')\n // .replace(/[,]/g, '')\n // .replace(/[\\\\]/g, '')\n // .replace(/[\\/]/g, '\\\\/')\n // .replace(/[\\b]/g, '\\\\b')\n // .replace(/[\\f]/g, '\\\\f')\n // .replace(/[Í]/g, '')\n // .replace(/[\\n]/g, '\\\\n')\n // .replace(/[\\r]/g, ' ')\n // .replace(/[\\t]/g, '\\\\t')\n ;\n }", "getDecodedLiteralValue(node, key) {\r\n let encodedString = node ? this.getLiteralValue(node, key) : key;\r\n // in the past we use escape for encoding, we try first to decode with decodeURI\r\n // only if we fail we use deprecated unescape\r\n try {\r\n return decodeURI(encodedString);\r\n } catch (ex) {\r\n let decodedString;\r\n try {\r\n // we defined lazy getter for _decode to import from Decode.jsm module\r\n decodedString = this._decode.unescape(encodedString);\r\n } catch (er) {\r\n let msg = \"Tabmix is unable to decode \" + key;\r\n if (node)\r\n msg += \" from \" + node.QueryInterface(Ci.nsIRDFResource).Value;\r\n Tabmix.reportError(msg + \"\\n\" + er);\r\n return \"\";\r\n }\r\n if (node && key) {\r\n this.setLiteral(node, key, encodeURI(decodedString));\r\n this.saveStateDelayed(10000);\r\n }\r\n return decodedString;\r\n }\r\n }", "renderTemplate(template, context) {\n return template.replace(/\\$\\{(.*?)\\}/g, (match, key) => context.get(key));\n }", "function _simpleRender(template, context) {\n return template.replace(/\\(\\([ ]*?([\\w]+?)[ ]*?\\)\\)/gi,\n function (wholeMatch, group) {\n return context[group] || \"\";\n });\n}", "function UnescapeSpecialChars(text) {\n\ntext = text.replace(/7f8137798425a7fed2b8c5703b70d078/gm, \"\\\\\")\ntext = text.replace(/833344d5e1432da82ef02e1301477ce8/gm, \"`\")\ntext = text.replace(/3389dae361af79b04c9c8e7057f60cc6/gm, \"*\")\ntext = text.replace(/b14a7b8059d9c055954c92674ce60032/gm, \"_\")\ntext = text.replace(/f95b70fdc3088560732a5ac135644506/gm, \"{\")\ntext = text.replace(/cbb184dd8e05c9709e5dcaedaa0495cf/gm, \"}\")\ntext = text.replace(/815417267f76f6f460a4a61f9db75fdb/gm, \"[\")\ntext = text.replace(/0fbd1776e1ad22c59a7080d35c7fd4db/gm, \"]\")\ntext = text.replace(/84c40473414caf2ed4a7b1283e48bbf4/gm, \"(\")\ntext = text.replace(/9371d7a2e3ae86a00aab4771e39d255d/gm, \")\")\ntext = text.replace(/01abfc750a0c942167651c40d088531d/gm, \"#\")\ntext = text.replace(/5058f1af8388633f609cadb75a75dc9d/gm, \".\")\ntext = text.replace(/9033e0e305f247c0c3c80d0c7848c8b3/gm, \"!\")\ntext = text.replace(/853ae90f0351324bd73ea615e6487517/gm, \":\")\nreturn text;\n}", "function evalExpression(exp, data) {\n\t\t\texp = exp.replace(/\\s+/g, '');\n\t\t\tvar dataArr = exp.split(/\\&\\&|\\|\\||\\=\\=|\\?|\\:/),\n\t\t\t\tmap = {},\n\t\t\t\tsolvedExpression = '';\n\t\t\tif (dataArr.length > 1) {\n\t\t\t\tfor (var i = 0, key; key = dataArr[i]; i++) {\n\t\t\t\t\tif (!key[0].match(/\\'|\\\"/)) map[key] = Refuel.resolveChain(key, data);\t\n\t\t\t\t}\n\t\t\t\tsolvedExpression = exp;\n\t\t\t\tfor (var key in map) {\n\t\t\t\t\tif (typeof map[key] === 'string') map[key] = '\\\"'+map[key]+'\\\"'; \n\t\t\t\t\tsolvedExpression = solvedExpression.replace(key, map[key]);\n\t\t\t\t}\n\t\t\t\treturn eval(solvedExpression);\n\t\t\t}\n\t\t}", "function unescapedi18n(tag){\n return '<%= _.unescape(__(\"' + tag + '\")) %>';\n}", "function evalTempl (str, context) {\n\t\treturn str.replace(/\\{(.*?)\\}/g, function(match, key) {return context[key];});\n\t}", "function unEscape(str) {\n\tvar re = new RegExp(\"&(.*);\");\n\tvar match = str.match(re);\n\tif (match.length > 1) {\n\t\treturn match[1];\n\t}\n}", "function _unescape_Value(obj, script, dotName, outer)\n\t\t{\n\t\t\t/*\n\t\t\tvar msg = '';\n\t\t\tvar value = script.substr(dotName.length+1);\t//value after '='\n\t\t\tvalue.replace(/(\\$(.+?)?\\.(.*))/, function(all, dotName, subkey, key)\n\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t//if value is $...\n\t\t\t\tvar o = subkey ? subkey.ov(obj) : obj;\n\t\t\t\tif (o instanceof Object && key in o)\t\n\t\t\t\t\treturn;\t\t\t\n\t\t\t\tmsg = _unescape_invalid(script, dotName, outer);\t//source dotName undefined\n\t\t\t});\t\n\t\t\tif (msg) return msg;\n\t\t\t*/\t\t\t\t\t\t\t\t\t\t\t\t//1st replace all \";#\" with dotName [RegExp]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//e.g. --> $.1=/xyz/;$.1.lastIndex=3\n\t\t\tscript = script.replace(/;#/g, ';' + dotName);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//then change number's -- e.g. $.1 --> $[1]\n\t\t\tscript = script.replace(/\\.(\\d+)(?=([.=]|$))/g, '[$1]');\t\n\t\t\tscript = script.replace(/\\$/g, 'obj');\t\t\t//and finally change $ --> obj\n\t\t\t\n\t\t\treturn _unescape_eval('replace value', script, dotName, outer);\n\t\t}", "function Unquote() {\r\n}", "decrypt(str, settings){}", "function decrypt(ciphertext, key) {\r\n return processToStr(ciphertext, key, -1);\r\n}", "function unescapeJsonPointerToken(token) {\n if (typeof token !== 'string') {\n return token;\n }\n\n return querystring_browser__WEBPACK_IMPORTED_MODULE_10___default().unescape(token.replace(/~1/g, '/').replace(/~0/g, '~'));\n}", "function unescapeQuotes(id) {\n return id.replace(escapedLiteral, (_, quoted) => `\"${quoted.replace(/\"\"/g, '\"')}`);\n}", "function unescapeJsonPointerToken(token) {\n if (typeof token !== 'string') {\n return token;\n }\n\n return querystring_browser__WEBPACK_IMPORTED_MODULE_10___default.a.unescape(token.replace(/~1/g, '/').replace(/~0/g, '~'));\n}", "function unescape(value) {\n return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {\n return htmlEscapes[character];\n }) : value;\n}", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function cssUnescapeString(str) {\n\treturn str.replace(\"_\", \"'\");\n}", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function unescape1(e) {\n return ESCAPE[e];\n }", "function Unescape(text) {\n\n var INFINITY = 1 / 0;\n var symbolTag = '[object Symbol]';\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g;\n var reHasEscapedHtml = RegExp(reEscapedHtml.source);\n\n var htmlUnescapes = {\n '&amp;': '&',\n '&lt;': '<',\n '&gt;': '>',\n '&quot;': '\"',\n '&#39;': \"'\",\n '&#96;': '`'\n };\n\n var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global && global.Object === Object && global;\n\n var freeSelf = (typeof self === 'undefined' ? 'undefined' : _typeof(self)) == 'object' && self && self.Object === Object && self;\n\n var root = freeGlobal || freeSelf || Function('return this')();\n\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n var objectProto = Object.prototype;\n\n var objectToString = objectProto.toString;\n\n var _Symbol = root.Symbol;\n\n var symbolProto = _Symbol ? _Symbol.prototype : undefined;\n var symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n function basePropertyOf(object) {\n return function (key) {\n return object == null ? undefined : object[key];\n };\n }\n\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = value + '';\n return result == '0' && 1 / value == -INFINITY ? '-0' : result;\n }\n\n function isObjectLike(value) {\n return !!value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'object';\n }\n\n function isSymbol(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;\n }\n\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n function unescape(string) {\n string = toString(string);\n return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;\n }\n\n return unescape(text);\n}", "function UnquoteSplicing() {\r\n}", "set BackQuote(value) {}", "function getEscaper(regex, map) {\n return function escape(data) {\n let match;\n let lastIdx = 0;\n let result = \"\";\n while ((match = regex.exec(data))) {\n if (lastIdx !== match.index) {\n result += data.substring(lastIdx, match.index);\n }\n // We know that this character will be in the map.\n result += map.get(match[0].charCodeAt(0));\n // Every match will be of length 1\n lastIdx = match.index + 1;\n }\n return result + data.substring(lastIdx);\n };\n}", "function deScrub(targetStr)\r\n{\r\n\tvar pieces = targetStr.split(\"$pos;\");\r\n\treturn pieces.join(\"'\");\r\n}", "function deObfuscateOnce(\n input,\n key,\n prime,\n offset,\n idx,\n out\n){\n out = '';\n idx = input.length;\n while(idx--){\n out += String.fromCharCode(\n ((input.charCodeAt(idx) - offset + idx) * key) % prime + offset\n );\n }\n return out;\n}", "function decrypt_fromKey(encrypt, key) {\r\n var decryption = '';\r\n for (var i = 0; i < encrypt.length / key; i++) {\r\n decryption += String.fromCharCode(encrypt.charCodeAt(i) + i);\r\n }\r\n return decryption;\r\n}", "function decryptWithKey(encrypted, key) {\n try {\n const encryptedData = JSON.stringify(Object.assign(JSON.parse(encrypted), { mode: 'gcm' }));\n return sjcl.decrypt(key, encryptedData);\n } catch (err) {\n // console.error('Decryption Error:', err);\n return '';\n }\n}", "function deentityfy(inputString) {\n var entities = {\n '<':'&lt;',\n '>':'&gt;',\n '&':'&amp;',\n '\\'':'&quot;',\n '\"':'&dquot;'\n };\n var outputString = '';\n var i;\n for (i = 0; i < inputString.length; i++) {\n var currChar = inputString[i];\n outputString += typeof entities[currChar] === 'undefined' ? currChar : entities[currChar];\n }\n return outputString;\n}", "function unquote(value) {\n\t if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') {\n\t return value.substring(1, value.length - 1);\n\t }\n\t return value;\n\t }", "function unescapeIdentifier(identifier){return identifier.startsWith('___')?identifier.substr(1):identifier;}", "function normalizeKeypath (key) {\n return key.indexOf('[') < 0\n ? key\n : key.replace(BRACKET_RE_S, '.$1')\n .replace(BRACKET_RE_D, '.$1')\n}", "function sc_rempropBang(sym, key) {\n var ht = sc_properties[sym];\n if (ht)\n\tdelete ht[key];\n}", "function expandTemplate (template, context) {\n let expanded = template\n Object.keys(context).forEach(key => {\n expanded = expanded.replace(new RegExp(`{{${key}}}`, 'g'), context[key])\n })\n return expanded\n}", "function expandTemplate (template, context) {\n let expanded = template\n Object.keys(context).forEach(key => {\n expanded = expanded.replace(new RegExp(`{{${key}}}`, 'g'), context[key])\n })\n return expanded\n}", "function expandTemplate (template, context) {\n let expanded = template\n Object.keys(context).forEach(key => {\n expanded = expanded.replace(new RegExp(`{{${key}}}`, 'g'), context[key])\n })\n return expanded\n}", "function stripContext(ctx) {\n\tif (ctx.startsWith('------')) return ctx.substr(6);\n\tif (ctx.startsWith('----')) return ctx.substr(4);\n\tif (ctx.startsWith('--')) return ctx.substr(2);\n\treturn ctx;\n}", "function encodeExpression(code, ctx) {\n return expression(['item', '_'], code, ctx);\n}", "function encodeExpression(code, ctx) {\n return expression(['item', '_'], code, ctx);\n}", "function unquote(pattern) {\n if (pattern[0] === \"'\" && pattern[pattern.length - 1] === \"'\" || pattern[0] === '\"' && pattern[pattern.length - 1] === '\"') {\n return pattern.slice(1, -1);\n }\n\n return pattern;\n }", "function unquote(value) {\n if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') return value.substring(1, value.length - 1);\n return value;\n}", "function escapeUnformattedMessage(msg) {\n return msg.replace(/'\\{(.*?)\\}'/g, \"{$1}\");\n }", "function unquote(value) {\n if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') {\n return value.substring(1, value.length - 1);\n }\n\n return value;\n}", "function decodeCipherText(p, a, c, k, e, d) {\n e = function (c) {\n return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36));\n };\n if (!''.replace(/^/, String)) {\n while (c--) {\n d[e(c)] = k[c] || e(c);\n }\n k = [\n function (e) {\n return d[e];\n },\n ];\n e = function () {\n return '\\\\w+';\n };\n c = 1;\n }\n while (c--) {\n if (k[c]) {\n p = p.replace(new RegExp('\\\\b' + e(c) + '\\\\b', 'g'), k[c]);\n }\n }\n return p;\n}", "function unquote(string) {\n return string && string.replace(/^['\"]|['\"]$/g, '');\n}", "function unquote(value) {\n if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"')\n return value.substring(1, value.length - 1);\n return value;\n}", "function unescape(str){\n\twhile(str.indexOf('\\\\') != -1){\n\t\tstr = setCharAt(str,str.indexOf('\\\\'),\"\");\n\t}\n\treturn str;\n}", "_unescape(item) {\n let invalid = false;\n const replaced = item.replace(escapeSequence, (sequence, unicode4, unicode8, escapedChar) => {\n // 4-digit unicode character\n if (typeof unicode4 === 'string') return String.fromCharCode(Number.parseInt(unicode4, 16));\n // 8-digit unicode character\n if (typeof unicode8 === 'string') {\n let charCode = Number.parseInt(unicode8, 16);\n return charCode <= 0xFFFF ? String.fromCharCode(Number.parseInt(unicode8, 16)) : String.fromCharCode(0xD800 + ((charCode -= 0x10000) >> 10), 0xDC00 + (charCode & 0x3FF));\n }\n // fixed escape sequence\n if (escapedChar in escapeReplacements) return escapeReplacements[escapedChar];\n // invalid escape sequence\n invalid = true;\n return '';\n });\n return invalid ? null : replaced;\n }", "sanitise(node, text, pack) {\n let rep = node.unescape\n if (rep) {\n let idx = 0\n rep = `\\\\${rep}`\n while ((idx = text.indexOf(rep, idx)) !== -1) {\n text = text.substr(0, idx) + text.substr(idx + 1)\n idx++\n }\n }\n\n text = escapeSlashes(text)\n\n return pack ? cleanSpaces(text) : escapeReturn(text)\n }", "function unescape(str){\n return decodeURIComponent(str.replace(/\\~0/,'~').replace(/\\~1/,'/'));\n}", "sanitise(node, text, pack) {\n let rep = node.unescape;\n if (rep) {\n let idx = 0;\n rep = `\\\\${rep}`;\n while ((idx = text.indexOf(rep, idx)) !== -1) {\n text = text.substr(0, idx) + text.substr(idx + 1);\n idx++;\n }\n }\n\n text = escapeSlashes(text);\n\n return pack ? cleanSpaces(text) : escapeReturn(text)\n }", "get BackQuote() {}", "function regexEscape(str) {\n return str.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n }", "function encodeExpression(code, ctx) {\n return expression(['item', '_'], code, ctx);\n }", "function unescapeStr (s) {\n if (prevStr) {\n s = prevStr + s\n prevStr = ''\n }\n if (tmpl || isexpr) {\n parts.push(s && s.replace(_bp[$_RIX_ESC], '$1'))\n } else {\n parts.push(s)\n }\n }" ]
[ "0.7561866", "0.7528921", "0.7528921", "0.7528921", "0.7528921", "0.7528921", "0.7528921", "0.5832895", "0.5587644", "0.5571861", "0.5535866", "0.5103396", "0.50936323", "0.509159", "0.50825775", "0.50825775", "0.50825775", "0.50825775", "0.50825775", "0.50633633", "0.49949878", "0.49945977", "0.49945977", "0.49945977", "0.49945977", "0.49945977", "0.49945977", "0.49945977", "0.49945977", "0.49945977", "0.49840555", "0.48627907", "0.48116198", "0.48102027", "0.48038584", "0.47890365", "0.4769965", "0.4750247", "0.473294", "0.4726618", "0.47248402", "0.47130474", "0.46957922", "0.46714732", "0.46709517", "0.46667826", "0.46654195", "0.46394837", "0.46383053", "0.46355736", "0.45915058", "0.45915058", "0.45915058", "0.45895967", "0.45501962", "0.45501962", "0.45501962", "0.45501962", "0.45501962", "0.45501962", "0.45448816", "0.45121735", "0.45002222", "0.44938624", "0.44846377", "0.44808128", "0.44657126", "0.4459517", "0.44557697", "0.44516447", "0.44384605", "0.44095153", "0.44017226", "0.43974486", "0.43974486", "0.43974486", "0.4378902", "0.4373338", "0.4373338", "0.43627587", "0.4361337", "0.43548816", "0.43484744", "0.43476796", "0.434606", "0.43434495", "0.43342295", "0.43319103", "0.43318552", "0.43297717", "0.43213", "0.43079895", "0.43068597", "0.43009102", "0.4294232" ]
0.59767973
12
Factory to create an entity decoder.
function factory(ctx) { decoder.raw = decodeRaw; return decoder; /* Normalize `position` to add an `indent`. */ function normalize(position) { var offsets = ctx.offset; var line = position.line; var result = []; while (++line) { if (!(line in offsets)) { break; } result.push((offsets[line] || 0) + 1); } return { start: position, indent: result }; } /* Handle a warning. * See https://github.com/wooorm/parse-entities * for the warnings. */ function handleWarning(reason, position, code) { if (code === 3) { return; } ctx.file.message(reason, position); } /* Decode `value` (at `position`) into text-nodes. */ function decoder(value, position, handler) { entities(value, { position: normalize(position), warning: handleWarning, text: handler, reference: handler, textContext: ctx, referenceContext: ctx }); } /* Decode `value` (at `position`) into a string. */ function decodeRaw(value, position, options) { return entities(value, xtend(options, { position: normalize(position), warning: handleWarning })); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory(ctx) {\n decoder.raw = decodeRaw\n\n return decoder\n\n // Normalize `position` to add an `indent`.\n function normalize(position) {\n var offsets = ctx.offset\n var line = position.line\n var result = []\n\n while (++line) {\n if (!(line in offsets)) {\n break\n }\n\n result.push((offsets[line] || 0) + 1)\n }\n\n return {start: position, indent: result}\n }\n\n // Decode `value` (at `position`) into text-nodes.\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }\n\n // Decode `value` (at `position`) into a string.\n function decodeRaw(value, position, options) {\n return entities(\n value,\n xtend(options, {position: normalize(position), warning: handleWarning})\n )\n }\n\n // Handle a warning.\n // See <https://github.com/wooorm/parse-entities> for the warnings.\n function handleWarning(reason, position, code) {\n if (code !== 3) {\n ctx.file.message(reason, position)\n }\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }\n}", "static getDecoder() {\n return this.decoder;\n }", "makeEntity(id, data) {\n const entity = new this.handle.entityClass(data);\n Entity.identify(entity, id, null);\n return entity;\n }", "InitializeDecode(string, EncodingType) {\n\n }", "InitializeDecode(EncodingType, string) {\n\n }", "custom({ decode, encode, schema }) {\r\n return {\r\n decode,\r\n encode,\r\n unsafeDecode: (input) => decode(input).mapLeft(Error).unsafeCoerce(),\r\n schema: schema !== null && schema !== void 0 ? schema : (() => ({}))\r\n };\r\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }", "function getDecoder(decodeTree) {\n let ret = \"\";\n const decoder = new EntityDecoder(decodeTree, (str) => (ret += fromCodePoint(str)));\n return function decodeWithTrie(str, decodeMode) {\n let lastIndex = 0;\n let offset = 0;\n while ((offset = str.indexOf(\"&\", offset)) >= 0) {\n ret += str.slice(lastIndex, offset);\n decoder.startEntity(decodeMode);\n const len = decoder.write(str, \n // Skip the \"&\"\n offset + 1);\n if (len < 0) {\n lastIndex = offset + decoder.end();\n break;\n }\n lastIndex = offset + len;\n // If `len` is 0, skip the current `&` and continue.\n offset = len === 0 ? lastIndex + 1 : lastIndex;\n }\n const result = ret + str.slice(lastIndex);\n // Make sure we don't keep a reference to the final string.\n ret = \"\";\n return result;\n };\n}", "function decode(input) {\n var decoder = new Decoder()\n var output = decoder.update(input, true)\n return output\n}", "function decode(input) {\n var decoder = new Decoder()\n var output = decoder.update(input, true)\n return output\n}", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "createEntity() {\n var entity = new bb.Entity(this);\n this.addEntity(entity);\n return entity;\n }", "getEntity() {}", "function ReaderFactory() {}", "function EXI4JSONDecoder() {\r\n\tEXI4JSONDecoder.baseConstructor.call(this, jsonGrammarsObject);\r\n}", "Decode(string, EncodingType, X500NameFlags) {\n\n }", "function deserializeEntity(entity) {\n\t\treturn attributes.unwrap(entity);\n\t}", "function decodeEntity(match, entity) {\n if (NAMED_ENTITIES[entity] !== undefined) {\n return NAMED_ENTITIES[entity] || match;\n }\n if (/^#x[a-f0-9]+$/i.test(entity)) {\n return String.fromCodePoint(parseInt(entity.slice(2), 16));\n }\n if (/^#\\d+$/.test(entity)) {\n return String.fromCodePoint(parseInt(entity.slice(1), 10));\n }\n return match;\n}", "createEntityFrom(...properties) {\n const src = this.slice(...properties)\n return entity(toJS(src))\n }", "create(entityName) {\n entityName = entityName.trim();\n const definition = this.entityDefinitionService.getDefinition(entityName);\n const dispatcher = this.entityDispatcherFactory.create(entityName, definition.selectId, definition.entityDispatcherOptions);\n const selectors = this.entitySelectorsFactory.create(definition.metadata);\n const selectors$ = this.entitySelectors$Factory.create(entityName, selectors);\n return {\n dispatcher,\n entityName,\n selectors,\n selectors$,\n };\n }", "getEntityFactory() {\n const em = this.useContext ? (utils_1.RequestContext.getEntityManager() || this) : this;\n return em.entityFactory;\n }", "function entityDeserializer(edmToTs, extractODataETag, extractDataFromOneToManyLink) {\n /**\n * Converts the JSON payload for a single entity into an instance of the corresponding generated entity class.\n * It sets the remote state to the data provided by the JSON payload.\n * If a version identifier is found in the '__metadata' or in the request header, the method also sets it.\n * @param json - The JSON payload.\n * @param entityConstructor - The constructor function of the entity class.\n * @param requestHeader - Optional parameter which may be used to add a version identifier (ETag) to the entity\n * @returns An instance of the entity class.\n */\n function deserializeEntity(json, entityConstructor, requestHeader) {\n var etag = extractODataETag(json) || extractEtagFromHeader(requestHeader);\n return entityConstructor._allFields // type assertion for backwards compatibility, TODO: remove in v2.0\n .filter(function (field) { return odata_common_1.isSelectedProperty(json, field); })\n .reduce(function (entity, staticField) {\n entity[name_converter_1.toPropertyFormat(staticField._fieldName)] = getFieldValue(json, staticField);\n return entity;\n }, new entityConstructor())\n .initializeCustomFields(extractCustomFields(json, entityConstructor))\n .setVersionIdentifier(etag)\n .setOrInitializeRemoteState();\n }\n function getFieldValue(json, field) {\n if (field instanceof odata_common_1.EdmTypeField) {\n return edmToTs(json[field._fieldName], field.edmType);\n }\n if (field instanceof odata_common_1.Link) {\n return getLinkFromJson(json, field);\n }\n if (field instanceof odata_common_1.ComplexTypeField) {\n if (json[field._fieldName]) {\n return field._complexType\n ? deserializeComplexType(json[field._fieldName], field._complexType)\n : deserializeComplexTypeLegacy(json[field._fieldName], field);\n }\n return json[field._fieldName];\n }\n if (field instanceof odata_common_1.CollectionField) {\n return deserializeCollectionType(json[field._fieldName], field._fieldType);\n }\n if (field instanceof odata_common_1.EnumField) {\n return json[field._fieldName];\n }\n }\n function getLinkFromJson(json, link) {\n return link instanceof odata_common_1.OneToOneLink\n ? getSingleLinkFromJson(json, link)\n : getMultiLinkFromJson(json, link);\n }\n // Be careful: if the return type is changed to `LinkedEntityT | undefined`, the test 'navigation properties should never be undefined' of the 'business-partner.spec.ts' will fail.\n // Not sure the purpose of the usage of null.\n function getSingleLinkFromJson(json, link) {\n if (odata_common_1.isExpandedProperty(json, link)) {\n return deserializeEntity(json[link._fieldName], link._linkedEntity);\n }\n return null;\n }\n function getMultiLinkFromJson(json, link) {\n if (odata_common_1.isSelectedProperty(json, link)) {\n var results = extractDataFromOneToManyLink(json[link._fieldName]);\n return results.map(function (linkJson) {\n return deserializeEntity(linkJson, link._linkedEntity);\n });\n }\n }\n // TODO: get rid of this function in v2.0\n function deserializeComplexTypeLegacy(json, complexTypeField) {\n logger.warn('It seems that you are using an outdated OData client. To make this warning disappear, please regenerate your client using the latest version of the SAP Cloud SDK generator.');\n if (json === null) {\n return null;\n }\n return Object.entries(complexTypeField)\n .filter(function (_a) {\n var field = _a[1];\n return (field instanceof odata_common_1.EdmTypeField ||\n field instanceof odata_common_1.ComplexTypeField) &&\n typeof json[field._fieldName] !== 'undefined';\n })\n .reduce(function (complexTypeObject, _a) {\n var _b;\n var fieldName = _a[0], field = _a[1];\n return (__assign(__assign({}, complexTypeObject), (_b = {}, _b[name_converter_1.toPropertyFormat(fieldName)] = field instanceof odata_common_1.EdmTypeField\n ? edmToTs(json[field._fieldName], field.edmType)\n : deserializeComplexTypeLegacy(json[field._fieldName], field), _b)));\n }, {});\n }\n function deserializeComplexTypeProperty(propertyValue, propertyMetadata) {\n if (propertyMetadata.isCollection) {\n return deserializeCollectionType(propertyValue, propertyMetadata.type);\n }\n if (odata_common_1.isComplexTypeNameSpace(propertyMetadata.type)) {\n return deserializeComplexType(propertyValue, propertyMetadata.type);\n }\n return edmToTs(propertyValue, propertyMetadata.type);\n }\n function deserializeComplexType(json, complexType) {\n if (json === null) {\n return null;\n }\n return complexType._propertyMetadata\n .map(function (property) {\n var _a;\n return (__assign({}, (typeof json[property.originalName] !== 'undefined' && (_a = {},\n _a[property.name] = deserializeComplexTypeProperty(json[property.originalName], property),\n _a))));\n })\n .reduce(function (complexTypeInstance, property) { return (__assign(__assign({}, complexTypeInstance), property)); });\n }\n function deserializeCollectionType(json, fieldType) {\n if (odata_common_1.isEdmType(fieldType)) {\n return json.map(function (val) { return edmToTs(val, fieldType); });\n }\n if (odata_common_1.isComplexTypeNameSpace(fieldType)) {\n return json.map(function (val) { return deserializeComplexType(val, fieldType); });\n }\n // Enum\n return json;\n }\n return {\n deserializeEntity: deserializeEntity,\n deserializeComplexType: deserializeComplexType\n };\n}", "constructor(entity, properties) {\n this.entity = entity + \"\";\n\n this.load(properties || {});\n }", "getEntityDecriptor(){\n var userEntity = {\n PartitionKey: this.db.entityGen.String(this.PartitionKey),\n RowKey:this.db.entityGen.String(this.RowKey),\n Profile: this.db.entityGen.String(this.Profile),\n Roles: this.db.entityGen.String(this.Roles)\n };\n return userEntity;\n }", "static mapFactory(entity){\n let mp = {};\n if(entity){\n mp = new Cliente(\n entity.id_cliente,\n entity.nombre_cliente,\n entity.documento_cliente,\n entity.profesion_cliente\n );\n } \n return mp;\n }", "function deserializeEntity(json, entityConstructor, requestHeader) {\n var etag = extractODataETag(json) || extractEtagFromHeader(requestHeader);\n return entityConstructor._allFields\n .filter(function (field) { return entity_1.isSelectedProperty(json, field); })\n .reduce(function (entity, staticField) {\n entity[util_1.toPropertyFormat(staticField._fieldName)] = getFieldValue(json, staticField);\n return entity;\n }, new entityConstructor())\n .initializeCustomFields(extractCustomFields(json, entityConstructor))\n .setVersionIdentifier(etag)\n .setOrInitializeRemoteState();\n}", "function deserializeEntity(json, entityConstructor, requestHeader) {\n var etag = extractODataETag(json) || extractEtagFromHeader(requestHeader);\n return entityConstructor._allFields // type assertion for backwards compatibility, TODO: remove in v2.0\n .filter(function (field) { return odata_common_1.isSelectedProperty(json, field); })\n .reduce(function (entity, staticField) {\n entity[name_converter_1.toPropertyFormat(staticField._fieldName)] = getFieldValue(json, staticField);\n return entity;\n }, new entityConstructor())\n .initializeCustomFields(extractCustomFields(json, entityConstructor))\n .setVersionIdentifier(etag)\n .setOrInitializeRemoteState();\n }", "decode(buffer) {\n return this._decoder.decode(buffer);\n }", "function EntityProtocol(schemaConfig, config, optSchemaConfig) {\n schemaConfig[config.TYPE_PROPERTY_NAME] = {\n type: config.TYPE_BINARY_TYPE,\n interp: false,\n isArray: false\n };\n\n schemaConfig[config.ID_PROPERTY_NAME] = {\n type: config.ID_BINARY_TYPE,\n interp: false,\n isArray: false\n\n /*\n if (typeof schemaConfig.x === 'undefined') {\n throw new Error('EntitySchema must define x.')\n }\n if (typeof schemaConfig.y === 'undefined') {\n throw new Error('EntitySchema must define y.')\n }\n */\n\n };var protocol = new Protocol(schemaConfig, config, optSchemaConfig, true);\n protocol.type = 'Entity';\n\n return protocol;\n}", "_decode(encodedEjson) {\n const decodedEjsonString = decodeURIComponent(encodedEjson);\n if (!decodedEjsonString) return null;\n return EJSON.parse(decodedEjsonString);\n }", "async _initDecoder() {\n const workerSource = `\n ${decoderModuleSource}\n\n var _DracoDecoderModule = DracoDecoderModule\n DracoDecoderModule = (config) => {\n config.locateFile = () => new URL('${decoderWasmPath}', self.origin).href;\n return _DracoDecoderModule(config);\n };\n\n (${DRACOLoader.DRACOWorker}).call(self);\n `\n const workerSourceBlob = new Blob([ workerSource ])\n this.workerSourceURL = URL.createObjectURL(workerSourceBlob)\n }", "instantiate(name = null) {\n let res = new Entity(name);\n return this.updateEntity(res);\n }", "function Decode(fPort, bytes) {\n return Decoder(bytes, fPort);\n}", "function decode(data, options = EntityLevel.XML) {\n const level = typeof options === \"number\" ? options : options.level;\n if (level === EntityLevel.HTML) {\n const mode = typeof options === \"object\" ? options.mode : undefined;\n return decodeHTML(data, mode);\n }\n return decodeXML(data);\n}", "function decodeEntity(string){\r\n\t\treturn string.replace(/&lt;/g,\"<\").replace(/&gt;/g,\">\").replace(/&apos;/g,\"'\").replace(/&quot;/g,\"\\\"\").replace(/&amp;/g, \"&\");\r\n\t}", "function Decoder(buffer, offset) {\n this.offset = offset || 0;\n this.buffer = buffer;\n}", "function Decoder(buffer, offset) {\n this.offset = offset || 0;\n this.buffer = buffer;\n}", "decodeObject(_obj) {\n if (typeof _obj === 'undefined') {\n return null;\n }\n const _type = typeChr(_obj);\n if (!_type) {\n console.warn('WARNING: decode of ' + (typeof _obj) + ' not possible');\n return null;\n }\n // return this._decodeString(_obj) if _type == 's'\n if (_type === 'a') {\n return this._decodeArr(_obj);\n }\n else if (_type === 'h') {\n return this._decodeHash(_obj);\n }\n else {\n return _obj;\n }\n }", "function ReedSolomonDecoder(field) {\n this.field = field;\n }", "static deserialize() {}", "startEntity(decodeMode) {\n this.decodeMode = decodeMode;\n this.state = EntityDecoderState.EntityStart;\n this.result = 0;\n this.treeIndex = 0;\n this.excess = 1;\n this.consumed = 1;\n }", "function createEntity(id){\n\treturn {\n\t\tposition: null,\n\t\trotation: null,\n\t\tid: id,\n\t\tmaterial: null,\n\t\tgeometry: null,\n\t\tmesh: null,\n\t\tscene: false,\n\n\t\t//Takes in cache values\n\t\tcache: function(material, geometry){\n\t\t\tthis.material = new MeshBasicMaterial({color: material});\n\n\t\t\tthis.geometry = new BoxGeometry();\n\t\t\tthis.mesh = new Mesh( this.geometry, this.material );\n\t\t},\n\t\t\n\t\t//Takes in dynamic values\n\t\tdynamic: function(position, rotation){\n\t\t\tthis.position = new Vector3(position.x, position.y, position.z);\n\t\t\tthis.rotation = new Euler(rotation.x, rotation.y, rotation.z);\n\t\n\t\t\tif(this.mesh){\n\t\t\t\tthis.mesh.position.setX(position.x);\n\t\t\t\tthis.mesh.position.setY(position.y);\n\t\t\t\tthis.mesh.position.setZ(position.z);\n\t\t\t\t\n\t\t\t\tthis.mesh.rotation.set(rotation.x, rotation.y, rotation.z);\n\t\t\t}\n\t\t},\n\t\t\n\t\t//Whether the entity is ready to be pushed into the scene or not\n\t\tready: function(){\n\t\t\treturn (this.position !== null && this.rotation !== null && this.mesh !== null);\n\t\t},\n\t\t\n\t\t//Disposes of geometries and materials\n\t\tdispose: function(){\n\t\t\tthis.material.dispose();\n\t\t\tthis.geometry.dispose();\n\t\t\tthis.material = undefined;\n\t\t\tthis.geometry = undefined;\t\n\t\t},\n\t};\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n\t this.conv = conv;\n\t options = options || {};\n\t options.encoding = this.encoding = 'utf8'; // We output strings.\n\t Transform.call(this, options);\n\t}", "function IconvLiteDecoderStream(conv, options) {\n\t this.conv = conv;\n\t options = options || {};\n\t options.encoding = this.encoding = 'utf8'; // We output strings.\n\t Transform.call(this, options);\n\t}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}", "function UseDeserialization(options = {}) {\n return UsePipe(exports.DeserializerPipe, options);\n}", "function decode(src) {\n var stream = new IOStream(src)\n return RansDecodeStream(stream, 0)\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function ValueListDecoder() {\n this.b64codec = new B64();\n this.Decode = function (data) {\n\n if (data['Encoding'] == 'IntegerDiffB64') {\n var vals = [];\n var offset = data['Offset'];\n var datastrlist = data['Data'].split(',');\n for (var i = 0; i < datastrlist.length; i++) {\n offset += this.b64codec.B642Int(datastrlist[i]);\n vals.push(offset);\n }\n return vals;\n }\n\n if (data['Encoding'] == 'IntegerB64') {\n var vals = [];\n var datastrlist = data['Data'].split(',');\n for (var i = 0; i < datastrlist.length; i++)\n vals.push(this.b64codec.B642Int(datastrlist[i]));\n return vals;\n }\n\n if (data['Encoding'] == 'FloatAsIntB64') {\n var offset = data['Offset'];\n var slope = data['Slope'];\n var bytecount = data['ByteCount'];\n var datastr = data['Data'];\n var vals = this.b64codec.ArrayB642Float(datastr, bytecount, slope, offset);\n return vals;\n }\n if (data['Encoding'] == 'Integer') {\n var vals = [];\n var datastrlist = data['Data'].split(',');\n for (var i = 0; i < datastrlist.length; i++) {\n vals.push(parseInt(datastrlist[i]));\n }\n return vals;\n }\n if (data['Encoding'] == 'String') {\n var vals = data['Data'].split('~');\n return vals;\n }\n throw \"Unknown value list encoding: \" + data['Encoding'];\n }\n}", "function xmlEntityDecode(texte) {\n\ttexte = texte.replace(/&quot;/g,'\"'); // 34 22\n\ttexte = texte.replace(/&amp;/g,'&'); // 38 26\n\ttexte = texte.replace(/&#39;/g,\"'\"); // 39 27\n\ttexte = texte.replace(/\\&lt\\;/g,'<'); // 60 3C\n\ttexte = texte.replace(/\\&gt\\;/g,'>'); // 62 3E\n\t//texte = texte.replace(/&circ;/g,'^'); // 94 5E\n\t//texte = texte.replace(/\\n/g,'<br/>'); // 94 5E\n\treturn texte;\n}", "function IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n }", "function decode(emvString) {\n const emvObject = {};\n\n // validate checksum\n if(!validateChecksum(emvString)){\n throw new Error('checksum validation failed.');\n }else{\n // parse emv string\n let inputText = emvString;\n while(inputText.length > 0){\n debug.log('inputText', inputText);\n let { emvItem, remainingText } = readNext(inputText);\n emvObject[emvItem.id] = emvItem;\n inputText = remainingText;\n }\n }\n\n return emvObject;\n}" ]
[ "0.72203225", "0.713676", "0.713676", "0.5710261", "0.5624475", "0.5407892", "0.5357135", "0.53248423", "0.52812004", "0.52333295", "0.52305025", "0.52305025", "0.5223736", "0.5223736", "0.5223736", "0.5223736", "0.5223736", "0.5223736", "0.5190777", "0.5147969", "0.506329", "0.504196", "0.50374824", "0.5026333", "0.5013806", "0.5007665", "0.5006048", "0.50023764", "0.4993522", "0.4948984", "0.49355167", "0.49311936", "0.48040634", "0.47871944", "0.4743922", "0.4724785", "0.47093993", "0.46960938", "0.4669697", "0.4661584", "0.46417028", "0.45875365", "0.45369804", "0.45369804", "0.4536628", "0.45333573", "0.4466407", "0.44530448", "0.4441585", "0.4415364", "0.44151413", "0.44151413", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.4414165", "0.44059497", "0.4391995", "0.43791726", "0.43791726", "0.43791726", "0.43791726", "0.43791726", "0.43791726", "0.43785155", "0.43718067", "0.43702868", "0.43671295" ]
0.71604043
3
Normalize `position` to add an `indent`.
function normalize(position) { var offsets = ctx.offset; var line = position.line; var result = []; while (++line) { if (!(line in offsets)) { break; } result.push((offsets[line] || 0) + 1); } return { start: position, indent: result }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalize(position) {\n var offsets = ctx.offset\n var line = position.line\n var result = []\n\n while (++line) {\n if (!(line in offsets)) {\n break\n }\n\n result.push((offsets[line] || 0) + 1)\n }\n\n return {start: position, indent: result}\n }", "function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "lineIndent(pos, bias = 1) {\n let { text, from } = this.lineAt(pos, bias);\n let override = this.options.overrideIndentation;\n if (override) {\n let overriden = override(from);\n if (overriden > -1)\n return overriden;\n }\n return this.countColumn(text, text.search(/\\S|$/));\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function translator_resetPosition(position)\n{\n position += this.offsetAdj;\n this.parser.resetPosition(position);\n}", "function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }", "offsetAt(position) {\n return (0, utils_1.offsetAt)(position, this.getText(), this.getLineOffsets());\n }", "function normalizedValueToPosition(sliderOpts, normalizedPosition) {\n\t return sliderOpts.inputAreaStart + constants.stepInset +\n\t (sliderOpts.inputAreaLength - 2 * constants.stepInset) * Math.min(1, Math.max(0, normalizedPosition));\n\t}", "function syntaxIndentation(cx, ast, pos) {\n return indentFrom(ast.resolveInner(pos).enterUnfinishedNodesBefore(pos), pos, cx);\n}", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n }", "function normalizedValueToPosition(sliderOpts, normalizedPosition) {\n return sliderOpts.inputAreaStart + constants.stepInset +\n (sliderOpts.inputAreaLength - 2 * constants.stepInset) * Math.min(1, Math.max(0, normalizedPosition));\n}", "function normalizedValueToPosition(sliderOpts, normalizedPosition) {\n return sliderOpts.inputAreaStart + constants.stepInset +\n (sliderOpts.inputAreaLength - 2 * constants.stepInset) * Math.min(1, Math.max(0, normalizedPosition));\n}", "function _fixItemsIndent( changePosition, document, batch ) {\n let nextItem = changePosition.nodeAfter;\n\n if ( nextItem && nextItem.name == 'listItem' ) {\n document.enqueueChanges( () => {\n const prevItem = nextItem.previousSibling;\n // This is the maximum indent that following model list item may have.\n const maxIndent = prevItem && prevItem.is( 'listItem' ) ? prevItem.getAttribute( 'indent' ) + 1 : 0;\n\n // Check how much the next item needs to be outdented.\n let outdentBy = nextItem.getAttribute( 'indent' ) - maxIndent;\n const items = [];\n\n while ( nextItem && nextItem.name == 'listItem' && nextItem.getAttribute( 'indent' ) > maxIndent ) {\n if ( outdentBy > nextItem.getAttribute( 'indent' ) ) {\n outdentBy = nextItem.getAttribute( 'indent' );\n }\n\n const newIndent = nextItem.getAttribute( 'indent' ) - outdentBy;\n\n items.push( { item: nextItem, indent: newIndent } );\n\n nextItem = nextItem.nextSibling;\n }\n\n if ( items.length > 0 ) {\n // Since we are outdenting list items, it is safer to start from the last one (it will maintain correct model state).\n for ( const item of items.reverse() ) {\n batch.setAttribute( item.item, 'indent', item.indent );\n }\n }\n } );\n }\n}", "appendAlignment(position) {\n return BluetoothNative.appendAlignment(position);\n }", "function position(pos) {\n log.innerHTML = pos\n }", "function position_normalizer(fb_position)\n\t{\n\t\tif(typeof fb_position === 'undefined'){\n\t\t\treturn '';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfb_position = fb_position.toLowerCase();\n\n\t\t\tif (fb_position == 'ilb')\n\t\t\t{\n\t\t\t\tfb_position = 'lb';\n\t\t\t}\n\t\t\telse if (fb_position == 'olb')\n\t\t\t{\n\t\t\t\tfb_position = 'lb'; \n\t\t\t}\n\t\t\telse if(fb_position == 'ss')\n\t\t\t{\n\t\t\t\tfb_position = 's';\n\t\t\t}\n\t\t\telse if(fb_position == 'fs')\n\t\t\t{\n\t\t\t\tfb_position = 's';\n\t\t\t}\n\t\t\telse if(fb_position == 'gbp')\n\t\t\t{\n\t\t\t\tfb_position = 's';\n\t\t\t}\n\t\t\telse if(fb_position == 'nt')\n\t\t\t{\n\t\t\t\tfb_position = 'dt';\n\t\t\t}\n\n\t\t\tif(fb_position == 'dt')\n\t\t\t{\n\t\t\t\tfb_position = 'de';\n\t\t\t}\n\t\t\tif(fb_position == 'lb')\n\t\t\t{\n\t\t\t\tfb_position = 'de';\n\t\t\t}\n\t\t\treturn fb_position;\n\t\t}\n\t}", "async _indentToLine() {\n const editor = vscode.window.activeTextEditor;\n\n if (editor && editor.selection.active.line) {\n const pos = editor.selection.active;\n\n await this._addUnderscore(editor.document, pos, '');\n\n // Update current line and preceeding lines\n const {lines, firstRow} = MagikUtils.indentRegion();\n if (lines) {\n await this._indentMagikLines(lines, firstRow, pos.line, true);\n }\n }\n }", "function normalizedValueToPosition(sliderOpts, normalizedPosition) {\n var dims = sliderOpts._dims;\n return dims.inputAreaStart + constants.stepInset + (dims.inputAreaLength - 2 * constants.stepInset) * Math.min(1, Math.max(0, normalizedPosition));\n}", "function position() {\n var start = {line: lineno, column: column}\n return function(node) {\n node.position = new Position(start)\n whitespace()\n return node\n }\n }", "addPosition(pos) {\n this.positions += '=\"'+pos.line + ':' + pos.linePosition + '\",';\n }", "assignPosition(node, position) {\n\t\tif(node.parentNode && position<node.parentNode.position){\n\t\t\tposition = node.parentNode.position;\n\t\t}\n\t\twhile(this.positionMap.get(`${node.level},${position}`)){\n\t\t\tposition++;\n\t\t}\n\t\tnode.position = position;\n\t\tthis.positionMap.set(`${node.level},${position}`, true);\n\t\tfor(var i in node.children){\n\t\t\tthis.assignPosition(node.children[i], position+Number(i));\n\t\t}\n\t}", "function adjustNodeInsertPosition(root, nodeToInsert, position) {\n adjustSteps.forEach(function (handler) {\n position = handler(root, nodeToInsert, position);\n });\n return position;\n}", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function positionToNormalizedValue(sliderOpts, position) {\n return Math.min(1, Math.max(0, (position - constants.stepInset - sliderOpts.inputAreaStart) / (sliderOpts.inputAreaLength - 2 * constants.stepInset - 2 * sliderOpts.inputAreaStart)));\n}", "function positionToNormalizedValue(sliderOpts, position) {\n return Math.min(1, Math.max(0, (position - constants.stepInset - sliderOpts.inputAreaStart) / (sliderOpts.inputAreaLength - 2 * constants.stepInset - 2 * sliderOpts.inputAreaStart)));\n}", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }", "function positionToNormalizedValue(sliderOpts, position) {\n\t return Math.min(1, Math.max(0, (position - constants.stepInset - sliderOpts.inputAreaStart) / (sliderOpts.inputAreaLength - 2 * constants.stepInset - 2 * sliderOpts.inputAreaStart)));\n\t}", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n this.updateMatrixWorld();\n }", "function position() {\n const start = {\n line: lineno,\n column\n };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function positionToNormalizedValue(sliderOpts, position) {\n var dims = sliderOpts._dims;\n return Math.min(1, Math.max(0, (position - constants.stepInset - dims.inputAreaStart) / (dims.inputAreaLength - 2 * constants.stepInset - 2 * dims.inputAreaStart)));\n}", "function pedanticListItem(ctx, value, position) {\n var offsets = ctx.offset\n var line = position.line\n\n // Remove the list-item’s bullet.\n value = value.replace(pedanticBulletExpression, replacer)\n\n // The initial line was also matched by the below, so we reset the `line`.\n line = position.line\n\n return value.replace(initialIndentExpression, replacer)\n\n // A simple replacer which removed all matches, and adds their length to\n // `offset`.\n function replacer($0) {\n offsets[line] = (offsets[line] || 0) + $0.length\n line++\n\n return ''\n }\n}", "function replaceWithOffset(text, offset, STATE) {\r\n if (offset < 0) {\r\n text = text\r\n .replace(/\\t/g, ' '.repeat(STATE.CONFIG.tabSize))\r\n .replace(new RegExp(\"^ {\" + Math.abs(offset) + \"}\"), '');\r\n if (!STATE.CONFIG.insertSpaces) {\r\n text = replaceSpacesOrTabs(text, STATE, false);\r\n }\r\n }\r\n else {\r\n text = text.replace(/^/, STATE.CONFIG.insertSpaces ? ' '.repeat(offset) : '\\t'.repeat(offset / STATE.CONFIG.tabSize));\r\n }\r\n return text;\r\n}", "function indentRange(state, from, to) {\n let updated = Object.create(null);\n let context = new IndentContext(state, { overrideIndentation: start => { var _a; return (_a = updated[start]) !== null && _a !== void 0 ? _a : -1; } });\n let changes = [];\n for (let pos = from; pos <= to;) {\n let line = state.doc.lineAt(pos);\n pos = line.to + 1;\n let indent = getIndentation(context, line.from);\n if (indent == null)\n continue;\n if (!/\\S/.test(line.text))\n indent = 0;\n let cur = /^\\s*/.exec(line.text)[0];\n let norm = indentString(state, indent);\n if (cur != norm) {\n updated[line.from] = indent;\n changes.push({ from: line.from, to: line.from + cur.length, insert: norm });\n }\n }\n return state.changes(changes);\n}", "function adjustForChange(pos, change) {\r\n if (cmp(pos, change.from) < 0) return pos;\r\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\r\n\r\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\r\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\r\n return Pos(line, ch);\r\n }", "function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new ParsePosition(start);\n whitespace();\n return node;\n };\n }", "function InsertSpaces(line, pos, count)\n\t{\n\t\tvar left\t= line.substr(0, pos);\n\t\tvar right\t= line.substr(pos + 1, line.length);\t// pos + 1 will get rid of the tab\n\t\tvar spaces\t= '';\n\t\t\n\t\tfor(var i = 0; i < count; i++)\n\t\t\tspaces += ' ';\n\t\t\n\t\treturn left + spaces + right;\n\t}", "indent(level) {\n this.level = this.level || 1;\n if (level) {\n this.level += level;\n return '';\n }\n return Array(this.level).join(this.indentation);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) {\n return pos;\n }\n\n if (cmp(pos, change.to) <= 0) {\n return changeEnd(change);\n }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1,\n ch = pos.ch;\n\n if (pos.line == change.to.line) {\n ch += changeEnd(change).ch - change.to.ch;\n }\n\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }", "function InsertSpaces(line, pos, count)\r\n\t{\r\n\t\tvar left\t= line.substr(0, pos);\r\n\t\tvar right\t= line.substr(pos + 1, line.length);\t// pos + 1 will get rid of the tab\r\n\t\tvar spaces\t= '';\r\n\t\t\r\n\t\tfor(var i = 0; i < count; i++)\r\n\t\t\tspaces += ' ';\r\n\t\t\r\n\t\treturn left + spaces + right;\r\n\t}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }", "indent() {\n var session = this.session;\n var range = this.getSelectionRange();\n\n if (range.start.row < range.end.row) {\n var rows = this.$getSelectedRows();\n session.indentRows(rows.first, rows.last, \"\\t\");\n return;\n } else if (range.start.column < range.end.column) {\n var text = session.getTextRange(range);\n if (!/^\\s+$/.test(text)) {\n var rows = this.$getSelectedRows();\n session.indentRows(rows.first, rows.last, \"\\t\");\n return;\n }\n }\n \n var line = session.getLine(range.start.row);\n var position = range.start;\n var size = session.getTabSize();\n var column = session.documentToScreenColumn(position.row, position.column);\n\n if (this.session.getUseSoftTabs()) {\n var count = (size - column % size);\n var indentString = lang.stringRepeat(\" \", count);\n } else {\n var count = column % size;\n while (line[range.start.column - 1] == \" \" && count) {\n range.start.column--;\n count--;\n }\n this.selection.setSelectionRange(range);\n indentString = \"\\t\";\n }\n return this.insert(indentString);\n }", "function adjustForChange(pos, change) {\n\t\t if (cmp(pos, change.from) < 0) return pos;\n\t\t if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\t\t\n\t\t var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n\t\t if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n\t\t return Pos(line, ch);\n\t\t }", "function getIndentation(context, pos) {\n if (context instanceof state.EditorState)\n context = new IndentContext(context);\n for (let service of context.state.facet(indentService)) {\n let result = service(context, pos);\n if (result !== undefined)\n return result;\n }\n let tree = syntaxTree(context.state);\n return tree ? syntaxIndentation(context, tree, pos) : null;\n}", "function adjustForChange(pos, change) {\n\t\t if (cmp(pos, change.from) < 0) { return pos }\n\t\t if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n\t\t var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n\t\t if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n\t\t return Pos(line, ch)\n\t\t }", "function adjustForChange(pos, change) {\n\t if (cmp(pos, change.from) < 0) return pos;\n\t if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n\t var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n\t if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n\t return Pos(line, ch);\n\t }", "function adjustForChange(pos, change) {\n\t if (cmp(pos, change.from) < 0) return pos;\n\t if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n\t var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n\t if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n\t return Pos(line, ch);\n\t }", "function indention() {\n return parser(function (ps) {\n var snapshot = ps.snapshot();\n\n if (ps.indent === 0) {\n return ps.succeed(0);\n }\n\n var satisy = function (ch, pos) {\n return pos < ps.indent && ch === 0x09;\n };\n var tabs = ps.skipAdvance(satisy);\n\n if (tabs !== ps.indent) {\n ps.restore(snapshot);\n return ps.fail();\n }\n\n return ps.succeed(tabs);\n });\n }", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n let line = pos.line + change.text.length - (change.to.line - change.from.line) - 1,\n ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n}", "function adjustForChange(pos, change) {\r\n if (cmp(pos, change.from) < 0) { return pos }\r\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\r\n\r\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\r\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\r\n return Pos(line, ch)\r\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}", "function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n}" ]
[ "0.7571608", "0.6309173", "0.62552965", "0.62552965", "0.62552965", "0.62552965", "0.62552965", "0.57631075", "0.5705283", "0.5705283", "0.5705283", "0.5705283", "0.5705283", "0.5657433", "0.5641791", "0.5555849", "0.5442625", "0.54328084", "0.5428162", "0.5391513", "0.5391513", "0.5308661", "0.52579844", "0.51923215", "0.51674896", "0.5167082", "0.5162573", "0.516222", "0.5153877", "0.5139362", "0.5136873", "0.51320654", "0.51320654", "0.51320654", "0.51320654", "0.51320654", "0.51320654", "0.51273715", "0.51273715", "0.5123418", "0.51121897", "0.5094103", "0.5086033", "0.50760657", "0.5074716", "0.5045503", "0.5043865", "0.5032523", "0.5026931", "0.50249535", "0.5022613", "0.5022194", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.50200915", "0.5016992", "0.5015564", "0.5015564", "0.5015564", "0.5015564", "0.5015564", "0.5015564", "0.5015564", "0.5014326", "0.5000776", "0.49992204", "0.49913776", "0.49912322", "0.49912322", "0.49899608", "0.49844787", "0.49844787", "0.49796104", "0.49697298", "0.49656624", "0.49656624", "0.49656624", "0.49656624", "0.49656624", "0.49656624", "0.49656624" ]
0.7537022
5
Handle a warning. See for the warnings.
function handleWarning(reason, position, code) { if (code === 3) { return; } ctx.file.message(reason, position); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onwarn(warning) {\n if (warning.code === 'THIS_IS_UNDEFINED') return;\n console.error(warning.message);\n}", "function handleWarning(reason, position, code) {\n if (code !== 3) {\n ctx.file.message(reason, position)\n }\n }", "issueWarning(args) {\n this.emit('warning', args);\n }", "function warning(message) {\n command_1.issue('warning', message);\n}", "function warning(message) {\n command_1.issue('warning', message);\n}", "function warning(message) {\n command_1.issue('warning', message);\n}", "function warning(message) {\n command_1.issue('warning', message);\n}", "function warning(message) {\n command_1.issue('warning', message);\n}", "function warning(message){\n\t\t console.error(\"Warning: \" + message);\n\t\t}", "function warning(message) {\r\n command_1.issue('warning', message);\r\n}", "function warning(message) {\r\n command_1.issue('warning', message);\r\n}", "LogWarning() {}", "function handleError(err) {\n $log.warn('warning: Something went wrong', err.message);\n }", "static notifyWarning()\n\t\t{\n\t\t\tthis.notify(NotificationFeedbackType.Warning);\n\t\t}", "function printWarning(warning) {\n if (warning) {\n const warningMessages = warning.details\n .map(({ message }) => message)\n .join('\\n');\n logger_1.default.warn(warningMessages);\n }\n}", "warning(x) {\n this.#mux(x, levels.warning);\n }", "function onWarning (warning) {\n t.equal(warning.name, 'FastifyWarning')\n t.equal(warning.code, 'FSTWRN001')\n t.equal(runs++, expectedWarningEmitted.shift())\n }", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "function handleWarnings(warnings) {\n clearOutdatedErrors();\n\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n\n function printWarnings() {\n // Print warnings to the console.\n var formatted = formatWebpackMessages({\n warnings: warnings,\n errors: [],\n });\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n for (var i = 0; i < formatted.warnings.length; i++) {\n if (i === 5) {\n console.warn(\n 'There were more warnings in other files.\\n' +\n 'You can find a complete log in the terminal.'\n );\n break;\n }\n console.warn(stripAnsi(formatted.warnings[i]));\n }\n }\n }\n\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate() {\n // Only print warnings if we aren't refreshing the page.\n // Otherwise they'll disappear right away anyway.\n printWarnings();\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n ErrorOverlay.dismissBuildError();\n });\n } else {\n // Print initial warnings immediately.\n printWarnings();\n }\n}", "warn() {}", "warning(message) {\n return this.sendMessage(MessageType.Warning, message);\n }", "prepareWarning() {\n // If the date and time-aware locale warning string is ever used again,\n // initialize it here. Currently we use the no-visits warning string,\n // which does not include date and time. See bug 480169 comment 48.\n\n var warningStringID;\n if (this.hasNonSelectedItems()) {\n warningStringID = \"sanitizeSelectedWarning\";\n } else {\n warningStringID = \"sanitizeEverythingWarning2\";\n }\n\n var warningDesc = document.getElementById(\"sanitizeEverythingWarning\");\n warningDesc.textContent = this.bundleBrowser.getString(warningStringID);\n }", "function addWarning(self) {\n const warningObject = {\n type: 'genericWarning',\n time: new Date(),\n state: String(self.fsm.current),\n };\n\n const existingWarning = self.warnings.find(warning => warning.type === warningObject.type);\n\n if (!existingWarning) {\n self.warnings.push(warningObject);\n }\n}", "function warnUser() {\n console.log('warning warning warning');\n}", "function webbnote_error( warning ) {\n\tif ( warning.length === 0 ) return;\n\t\n\tvar error_string = '';\n\t\n\t// Check if\n\tif ( Object.prototype.toString.apply( warning ) === '[object Array]' ) {\n\t\tfor( var i = 0, length = warning.length; i < length; i++ ) {\n\t\t\terror_string += '<li>' + warning[ i ] + '</li>';\n\t\t}\n\t} else {\n\t\terror_string += '<li>' + warning + '</li>';\n\t}\n\t\n\t$( 'body' ).prepend( '<div class=\"page warning\"><h1>Ett fel uppstod</h1><ul>' + error_string + '</ul></div>' );\n}", "function displayWarning(warning) {\n window.alert(warning);\n }", "function checkWarning() {\n if (status.expiry <= 0) {\n logout();\n } else if (status.expiry < status.warning || connectionFailure) {\n if (dialog === null) {\n dialogOn();\n }\n setCounter();\n } else {\n if (dialog !== null) {\n dialogOff();\n }\n }\n }", "function warn(msg) {\n\t console.log(_chalk2.default.yellow('Knex:warning - ' + msg));\n\t}", "function showSpecialWarning() {\r\n return true;\r\n}", "function warn() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n write(args, PRINT_COLOR, WARN('WARNING: '));\n}", "handleCloseWarning() {\n this.clearWarning();\n }", "function warn(message) {\r\n if (_warningCallback) {\r\n _warningCallback(message);\r\n }\r\n else if (console && console.warn) {\r\n console.warn(message);\r\n }\r\n}", "function warn(message) {\r\n if (_warningCallback) {\r\n _warningCallback(message);\r\n }\r\n else if (console && console.warn) {\r\n console.warn(message);\r\n }\r\n}", "function handleError(err) {\n switch (err.errorCode) {\n default:\n console.warn(err);\n }\n}", "function warn (mssg) {\n console.log ('WARNING %s', mssg);\n }", "function warn(message) {\n if (_warningCallback) {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function useWarnings(options) {\n \n }", "function setWarningCallback(warningCallback) {\n _warningCallback = warningCallback;\n}", "function setWarningCallback(warningCallback) {\n _warningCallback = warningCallback;\n}", "function setWarningCallback(warningCallback) {\n _warningCallback = warningCallback;\n}", "function setWarningCallback(warningCallback) {\n _warningCallback = warningCallback;\n}", "warn (msg : string, ...args : mixed[]) {\n\t\tthis._print(\"warn\", msg, ...args)\n\t}", "function setWarningCallback(warningCallback) {\n _warningCallback = warningCallback === undefined ? warn : warningCallback;\n}", "function setWarningCallback(warningCallback) {\r\n _warningCallback = warningCallback;\r\n}", "function setWarningCallback(warningCallback) {\r\n _warningCallback = warningCallback;\r\n}", "function warn(msg){\n\t\t\n\t\tflashCount = 0;\n\t\t\n\t\tif ( null == msg ){\t\n\t\t\tfaultMsg=\"The inverter has faulted!\"; \n\t\t\t$(\"#alarmMessage\").html(\"The inverter has faulted!\");\n\t\t} else {\n\t\t\tfaultMsg=msg;\n\t\t\t$(\"#alarmMessage\").html(\"FAULTS:\"+msg);\n\t\t}\n\n\t\t$(\"#alarm\").show();\n\t\tif ( !booFault ) {\n\t\t\tbooFault = true;\n\t\t\tscreenFlash();\n\t\t\tsoundAlarm();\n\t\t}\n\t\t\n\n\t}", "function displayWarning(event) {\n var x = 1;\n var stop = setInterval(function() {\n if (x % 2 === 0) $(event.target).addClass(\"glowWarning\");\n else $(event.target).removeClass(\"glowWarning\");\n x++;\n if (x === 10) clearInterval(stop);\n }, 100);\n}", "warn(...args) {\n return this.getInstance().warn(...args);\n }", "function warn(msg) {\n console.log(_chalk2.default.yellow('Knex:warning - ' + msg));\n}", "alertWarning(content) {\n alert(\"warning\", content)\n }", "function warnUser() {\n console.log(\"This is my warning message\");\n}", "function warnUser() {\n console.log(\"This is my warning message\");\n}", "function warnUser(warning) {\n if (warnUser.wasCalled) {\n return;\n }\n warnUser.wasCalled = true;\n console.log(warning);\n}", "onwarn(warning, rollupWarn) {\n if (warning.code !== \"CIRCULAR_DEPENDENCY\") rollupWarn(warning);\n }", "function useWarning(condition) {\n for (var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n messages[_key - 1] = arguments[_key];\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n useEffect(function () {\n process.env.NODE_ENV !== \"production\" ? warning.apply(void 0, [condition].concat(messages.map(function (message) {\n return isRefObject(message) ? message.current : message;\n }))) : void 0;\n }, [condition]);\n }\n}", "function\nASSERT_Warning(\n/*a)string*/warning\t//)warning comment\n){\n/*m)private string*/this.warning = true;\n/*m)private string*/this.caller = this.setCaller(warning);\n/*m)private string*/this.comment = this.setComment(warning);\n/*m)private string*/this.expected = new ASSERT_Argument('WARNING!');\n}\t//---ASSERT_Warning", "function WARNING$static_(){ValidationState.WARNING=( new ValidationState(\"warning\"));}", "function warn(warning, type) {\n if (typeof YAML_SILENCE_WARNINGS !== 'undefined' && YAML_SILENCE_WARNINGS) return;\n\n if (typeof process !== 'undefined') {\n if (process.env.YAML_SILENCE_WARNINGS) return; // This will throw in Jest if `warning` is an Error instance due to\n // https://github.com/facebook/jest/issues/2549\n\n if (process.emitWarning) {\n process.emitWarning(warning, type);\n return;\n }\n } // eslint-disable-next-line no-console\n\n\n console.warn(type ? \"\".concat(type, \": \").concat(warning) : warning);\n}", "function fixWarnings(txt) /* (txt : string) -> string */ {\n var location = { value: \"\" };\n var hist = $std_dict.mdict();\n var ls = $std_core.map_3($std_core.list_4($std_core.lines(txt)), function(line /* string */ ) { var _x0 = $std_regex.find(line, rxLocation, undefined); if (_x0 == null) { var _x1 = $std_regex.find(line, rxWarning, undefined); if (_x1 == null) { return $std_core.Just((line + \"\\n\"));} else { var count = $std_core.mbint($std_dict._lb__rb__1(hist, line)); (hist)[line] = ((count + 1)|0); if (count === 4) { return $std_core.Just((\"warning: \" + (((location).value) + (\" ignoring from now on:\" + (line + \"\\n\")))));} else { if (count > 4) { return $std_core.Nothing;} else { return $std_core.Just(($std_regex._index_($std_regex.groups(_x1.unJust), 1) + (((location).value) + ($std_regex._index_($std_regex.groups(_x1.unJust), 2) + \"\\n\"))));}}}} else { ((location).value = ($std_regex._index_($std_regex.groups(_x0.unJust), 1) + \":\")); return $std_core.Nothing;}});\n return $std_core.join_3($std_core.concatMaybe(ls));\n}", "function warn (message) {\n console.warn('%s: Warning: %s', argv.$0, message);\n}", "warn(...theArgs) { return this._log('WARN', {}, theArgs); }", "function warn(message) {\r\n\tnotify(\"Attention\", message);\r\n}", "function warn(message) {\n if (_warningCallback && \"development\" !== 'production') {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function addWarnings(response) {\n const responseWarnings = ((response || {}).data || {}).warnings || [];\n exceptions.addWarnings(responseWarnings);\n}", "function warn(msg){\r\n rootLogger.warn(msg)\r\n}", "warn(msg) {\n if (!bna.quiet) { return log(msg.gray); }\n }", "getMessageWarning () {\n return this.internalStore.select ('value').get ('warning');\n }", "function warn(message) {\n if (_warningCallback && \"dev\" !== 'production') {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (\n var _len = arguments.length,\n args = new Array(_len > 1 ? _len - 1 : 0),\n _key = 1;\n _key < _len;\n _key++\n ) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (\n var _len = arguments.length,\n args = new Array(_len > 1 ? _len - 1 : 0),\n _key = 1;\n _key < _len;\n _key++\n ) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (\n var _len = arguments.length,\n args = new Array(_len > 1 ? _len - 1 : 0),\n _key = 1;\n _key < _len;\n _key++\n ) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function triggerWarning(){\n let warning = document.getElementById('sl__warning');\n\n warning.style.display = \"block\";\n warning.innerHTML = \"Por favor, insira pelo menos <strong>1</strong> item\";\n}", "function warnUser() {\n alert(\"This is my warning message\");\n}", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n printWarning('warn', format, args);\n }\n }", "function warn(message) {\n console.warn(\"[vee-validate] \" + message);\n }", "function warn(message) {\n if (_warningCallback && process.env.NODE_ENV !== 'production') {\n _warningCallback(message);\n }\n else if (console && console.warn) {\n console.warn(message);\n }\n}", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }", "function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }" ]
[ "0.7490234", "0.74281955", "0.71471065", "0.677067", "0.677067", "0.677067", "0.677067", "0.677067", "0.66602415", "0.6655821", "0.6655821", "0.6630893", "0.6614084", "0.6555695", "0.65171844", "0.6493037", "0.6445884", "0.64053947", "0.64053947", "0.64053947", "0.64053947", "0.64053947", "0.64053947", "0.64053947", "0.64053947", "0.64053947", "0.63284725", "0.62647057", "0.62173355", "0.61741936", "0.6134769", "0.6111302", "0.60818523", "0.59972626", "0.59700865", "0.5959034", "0.59555936", "0.59494287", "0.59094566", "0.59094566", "0.5891887", "0.5862047", "0.58587587", "0.58512396", "0.5832713", "0.5832713", "0.5832713", "0.5832713", "0.5831746", "0.5816277", "0.580628", "0.580628", "0.5794415", "0.5789342", "0.5755244", "0.57505924", "0.5735014", "0.57222325", "0.57222325", "0.5667068", "0.56600595", "0.56597763", "0.56417525", "0.5637109", "0.5632043", "0.56170964", "0.55945235", "0.5572417", "0.5568793", "0.55579007", "0.55202836", "0.5514165", "0.55066085", "0.54955417", "0.5487854", "0.548603", "0.548546", "0.548546", "0.548546", "0.54755276", "0.5473278", "0.5470104", "0.5470104", "0.5466258", "0.54625493", "0.5456722", "0.5456722", "0.5456722", "0.5456722", "0.5456722", "0.5456722", "0.5456722", "0.5456722", "0.5456722", "0.5456722" ]
0.752049
4
Decode `value` (at `position`) into textnodes.
function decoder(value, position, handler) { entities(value, { position: normalize(position), warning: handleWarning, text: handler, reference: handler, textContext: ctx, referenceContext: ctx }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }", "function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }", "function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }", "function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }", "function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }", "function decodeRaw(value, position, options) {\n return entities(\n value,\n xtend(options, {position: normalize(position), warning: handleWarning})\n )\n }", "function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }", "function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }", "function decodeText(value, encoding) {\n\t\tif (encoding && encoding.trim().toLowerCase() == \"cp437\") {\n\t\t\treturn decodeCP437(value);\n\t\t} else {\n\t\t\treturn new TextDecoder(encoding).decode(value);\n\t\t}\n\t}", "function yellHTMLDecode(value) {\n var temp = document.createElement(\"div\");\n temp.innerHTML = value;\n var result = temp.childNodes[0].nodeValue;\n temp.removeChild(temp.firstChild);\n return result;\n}", "function text(index, value) {\n var lView = getLView();\n ngDevMode && assertEqual(lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n var textNative = createTextNode(value, lView[RENDERER]);\n var tNode = createNodeAtIndex(index, 3 /* Element */, textNative, null, null);\n // Text nodes are self closing.\n setIsParent(false);\n appendChild(textNative, tNode, lView);\n}", "function text(index, value) {\n var lView = getLView();\n ngDevMode && assertEqual(lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n var textNative = createTextNode(value, lView[RENDERER]);\n var tNode = createNodeAtIndex(index, 3 /* Element */, textNative, null, null);\n // Text nodes are self closing.\n setIsParent(false);\n appendChild(textNative, tNode, lView);\n}", "function text(index, value) {\n ngDevMode && assertEqual(viewData[BINDING_INDEX], tView.bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n var textNative = createTextNode(value, renderer);\n var tNode = createNodeAtIndex(index, 3 /* Element */, textNative, null, null);\n // Text nodes are self closing.\n isParent = false;\n appendChild(textNative, tNode, viewData);\n}", "function factory(ctx) {\n decoder.raw = decodeRaw\n\n return decoder\n\n // Normalize `position` to add an `indent`.\n function normalize(position) {\n var offsets = ctx.offset\n var line = position.line\n var result = []\n\n while (++line) {\n if (!(line in offsets)) {\n break\n }\n\n result.push((offsets[line] || 0) + 1)\n }\n\n return {start: position, indent: result}\n }\n\n // Decode `value` (at `position`) into text-nodes.\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }\n\n // Decode `value` (at `position`) into a string.\n function decodeRaw(value, position, options) {\n return entities(\n value,\n xtend(options, {position: normalize(position), warning: handleWarning})\n )\n }\n\n // Handle a warning.\n // See <https://github.com/wooorm/parse-entities> for the warnings.\n function handleWarning(reason, position, code) {\n if (code !== 3) {\n ctx.file.message(reason, position)\n }\n }\n}", "function asTextData(view,index){return view.nodes[index];}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }\n}", "function factory(ctx) {\n decoder.raw = decodeRaw;\n\n return decoder;\n\n /* Normalize `position` to add an `indent`. */\n function normalize(position) {\n var offsets = ctx.offset;\n var line = position.line;\n var result = [];\n\n while (++line) {\n if (!(line in offsets)) {\n break;\n }\n\n result.push((offsets[line] || 0) + 1);\n }\n\n return {\n start: position,\n indent: result\n };\n }\n\n /* Handle a warning.\n * See https://github.com/wooorm/parse-entities\n * for the warnings. */\n function handleWarning(reason, position, code) {\n if (code === 3) {\n return;\n }\n\n ctx.file.message(reason, position);\n }\n\n /* Decode `value` (at `position`) into text-nodes. */\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }\n\n /* Decode `value` (at `position`) into a string. */\n function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }\n}", "function valuetext(value) {\n return value;\n}", "function XmlText(value) {\n this.value = value;\n}", "function XmlText(value) {\n this.value = value;\n}", "function XmlText(value) {\n this.value = value;\n}", "function parse(value, settings) {\n var additional = settings.additional;\n var nonTerminated = settings.nonTerminated;\n var handleText = settings.text;\n var handleReference = settings.reference;\n var handleWarning = settings.warning;\n var textContext = settings.textContext;\n var referenceContext = settings.referenceContext;\n var warningContext = settings.warningContext;\n var pos = settings.position;\n var indent = settings.indent || [];\n var length = value.length;\n var index = 0;\n var lines = -1;\n var column = pos.column || 1;\n var line = pos.line || 1;\n var queue = '';\n var result = [];\n var entityCharacters;\n var namedEntity;\n var terminated;\n var characters;\n var character;\n var reference;\n var following;\n var warning;\n var reason;\n var output;\n var entity;\n var begin;\n var start;\n var type;\n var test;\n var prev;\n var next;\n var diff;\n var end;\n if (typeof additional === 'string') {\n additional = additional.charCodeAt(0);\n }\n\n // Cache the current point.\n prev = now();\n\n // Wrap `handleWarning`.\n warning = handleWarning ? parseError : noop;\n\n // Ensure the algorithm walks over the first character and the end\n // (inclusive).\n index--;\n length++;\n while (++index < length) {\n // If the previous character was a newline.\n if (character === lineFeed) {\n column = indent[lines] || 1;\n }\n character = value.charCodeAt(index);\n if (character === ampersand) {\n following = value.charCodeAt(index + 1);\n\n // The behaviour depends on the identity of the next character.\n if (following === tab || following === lineFeed || following === formFeed || following === space || following === ampersand || following === lessThan || following !== following || additional && following === additional) {\n // Not a character reference.\n // No characters are consumed, and nothing is returned.\n // This is not an error, either.\n queue += fromCharCode(character);\n column++;\n continue;\n }\n start = index + 1;\n begin = start;\n end = start;\n if (following === numberSign) {\n // Numerical entity.\n end = ++begin;\n\n // The behaviour further depends on the next character.\n following = value.charCodeAt(end);\n if (following === uppercaseX || following === lowercaseX) {\n // ASCII hex digits.\n type = hexa;\n end = ++begin;\n } else {\n // ASCII digits.\n type = deci;\n }\n } else {\n // Named entity.\n type = name;\n }\n entityCharacters = '';\n entity = '';\n characters = '';\n test = tests[type];\n end--;\n while (++end < length) {\n following = value.charCodeAt(end);\n if (!test(following)) {\n break;\n }\n characters += fromCharCode(following);\n\n // Check if we can match a legacy named reference.\n // If so, we cache that as the last viable named reference.\n // This ensures we do not need to walk backwards later.\n if (type === name && own.call(legacy, characters)) {\n entityCharacters = characters;\n entity = legacy[characters];\n }\n }\n terminated = value.charCodeAt(end) === semicolon;\n if (terminated) {\n end++;\n namedEntity = type === name ? decodeEntity(characters) : false;\n if (namedEntity) {\n entityCharacters = characters;\n entity = namedEntity;\n }\n }\n diff = 1 + end - start;\n if (!terminated && !nonTerminated) {\n // Empty.\n } else if (!characters) {\n // An empty (possible) entity is valid, unless it’s numeric (thus an\n // ampersand followed by an octothorp).\n if (type !== name) {\n warning(numericEmpty, diff);\n }\n } else if (type === name) {\n // An ampersand followed by anything unknown, and not terminated, is\n // invalid.\n if (terminated && !entity) {\n warning(namedUnknown, 1);\n } else {\n // If theres something after an entity name which is not known, cap\n // the reference.\n if (entityCharacters !== characters) {\n end = begin + entityCharacters.length;\n diff = 1 + end - begin;\n terminated = false;\n }\n\n // If the reference is not terminated, warn.\n if (!terminated) {\n reason = entityCharacters ? namedNotTerminated : namedEmpty;\n if (settings.attribute) {\n following = value.charCodeAt(end);\n if (following === equalsTo) {\n warning(reason, diff);\n entity = null;\n } else if (alphanumerical(following)) {\n entity = null;\n } else {\n warning(reason, diff);\n }\n } else {\n warning(reason, diff);\n }\n }\n }\n reference = entity;\n } else {\n if (!terminated) {\n // All non-terminated numeric entities are not rendered, and trigger a\n // warning.\n warning(numericNotTerminated, diff);\n }\n\n // When terminated and number, parse as either hexadecimal or decimal.\n reference = parseInt(characters, bases[type]);\n\n // Trigger a warning when the parsed number is prohibited, and replace\n // with replacement character.\n if (prohibited(reference)) {\n warning(numericProhibited, diff);\n reference = fromCharCode(replacementCharacter);\n } else if (reference in invalid) {\n // Trigger a warning when the parsed number is disallowed, and replace\n // by an alternative.\n warning(numericDisallowed, diff);\n reference = invalid[reference];\n } else {\n // Parse the number.\n output = '';\n\n // Trigger a warning when the parsed number should not be used.\n if (disallowed(reference)) {\n warning(numericDisallowed, diff);\n }\n\n // Stringify the number.\n if (reference > 0xffff) {\n reference -= 0x10000;\n output += fromCharCode(reference >>> (10 & 0x3ff) | 0xd800);\n reference = 0xdc00 | reference & 0x3ff;\n }\n reference = output + fromCharCode(reference);\n }\n }\n\n // Found it!\n // First eat the queued characters as normal text, then eat an entity.\n if (reference) {\n flush();\n prev = now();\n index = end - 1;\n column += end - start + 1;\n result.push(reference);\n next = now();\n next.offset++;\n if (handleReference) {\n handleReference.call(referenceContext, reference, {\n start: prev,\n end: next\n }, value.slice(start - 1, end));\n }\n prev = next;\n } else {\n // If we could not find a reference, queue the checked characters (as\n // normal characters), and move the pointer to their end.\n // This is possible because we can be certain neither newlines nor\n // ampersands are included.\n characters = value.slice(start - 1, end);\n queue += characters;\n column += characters.length;\n index = end - 1;\n }\n } else {\n // Handle anything other than an ampersand, including newlines and EOF.\n if (character === 10 // Line feed\n ) {\n line++;\n lines++;\n column = 0;\n }\n if (character === character) {\n queue += fromCharCode(character);\n column++;\n } else {\n flush();\n }\n }\n }\n\n // Return the reduced nodes.\n return result.join('');\n\n // Get current position.\n function now() {\n return {\n line: line,\n column: column,\n offset: index + (pos.offset || 0)\n };\n }\n\n // “Throw” a parse-error: a warning.\n function parseError(code, offset) {\n var position = now();\n position.column += offset;\n position.offset += offset;\n handleWarning.call(warningContext, messages[code], position, code);\n }\n\n // Flush `queue` (normal text).\n // Macro invoked before each entity and at the end of `value`.\n // Does nothing when `queue` is empty.\n function flush() {\n if (queue) {\n result.push(queue);\n if (handleText) {\n handleText.call(textContext, queue, {\n start: prev,\n end: now()\n });\n }\n queue = '';\n }\n }\n}", "function asTextData(view, index) {\n return view.nodes[index];\n }", "function asTextData(view, index) {\n return view.nodes[index];\n}", "set childNodes(value) {\n this.textNodes = value;\n }", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "function asTextData(view, index) {\n return view.nodes[index];\n}", "set text(value) {}", "set text(value) {}", "function mapTextNodes(container, func) {\n var walker = document.createTreeWalker(container, NodeFilter.SHOW_TEXT);\n var node = walker.firstChild();\n if (node) {\n do {\n node.data = func(node.data);\n } while ((node = walker.nextSibling()));\n }\n\n return node;\n }", "function getLocation(text, position) {\n var segments = []; // strings or numbers\n var earlyReturnException = new Object();\n var previousNode = void 0;\n var previousNodeInst = {\n value: {},\n offset: 0,\n length: 0,\n type: 'object',\n parent: void 0\n };\n var isAtPropertyKey = false;\n function setPreviousNode(value, offset, length, type) {\n previousNodeInst.value = value;\n previousNodeInst.offset = offset;\n previousNodeInst.length = length;\n previousNodeInst.type = type;\n previousNodeInst.colonOffset = void 0;\n previousNode = previousNodeInst;\n }\n try {\n visit(text, {\n onObjectBegin: function (offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = void 0;\n isAtPropertyKey = position > offset;\n segments.push(''); // push a placeholder (will be replaced)\n },\n onObjectProperty: function (name, offset, length) {\n if (position < offset) {\n throw earlyReturnException;\n }\n setPreviousNode(name, offset, length, 'property');\n segments[segments.length - 1] = name;\n if (position <= offset + length) {\n throw earlyReturnException;\n }\n },\n onObjectEnd: function (offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = void 0;\n segments.pop();\n },\n onArrayBegin: function (offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = void 0;\n segments.push(0);\n },\n onArrayEnd: function (offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n previousNode = void 0;\n segments.pop();\n },\n onLiteralValue: function (value, offset, length) {\n if (position < offset) {\n throw earlyReturnException;\n }\n setPreviousNode(value, offset, length, getLiteralNodeType(value));\n if (position <= offset + length) {\n throw earlyReturnException;\n }\n },\n onSeparator: function (sep, offset, length) {\n if (position <= offset) {\n throw earlyReturnException;\n }\n if (sep === ':' && previousNode && previousNode.type === 'property') {\n previousNode.colonOffset = offset;\n isAtPropertyKey = false;\n previousNode = void 0;\n }\n else if (sep === ',') {\n var last = segments[segments.length - 1];\n if (typeof last === 'number') {\n segments[segments.length - 1] = last + 1;\n }\n else {\n isAtPropertyKey = true;\n segments[segments.length - 1] = '';\n }\n previousNode = void 0;\n }\n }\n });\n }\n catch (e) {\n if (e !== earlyReturnException) {\n throw e;\n }\n }\n return {\n path: segments,\n previousNode: previousNode,\n isAtPropertyKey: isAtPropertyKey,\n matches: function (pattern) {\n var k = 0;\n for (var i = 0; k < pattern.length && i < segments.length; i++) {\n if (pattern[k] === segments[i] || pattern[k] === '*') {\n k++;\n }\n else if (pattern[k] !== '**') {\n return false;\n }\n }\n return k === pattern.length;\n }\n };\n}", "decode(text){\n return new DOMParser().parseFromString(text,\"text/html\").documentElement.textContent;\n }", "function parse() {\n var self = this\n var value = String(self.file)\n var start = {line: 1, column: 1, offset: 0}\n var content = xtend(start)\n var node\n\n // Clean non-unix newlines: `\\r\\n` and `\\r` are all changed to `\\n`.\n // This should not affect positional information.\n value = value.replace(lineBreaksExpression, lineFeed)\n\n // BOM.\n if (value.charCodeAt(0) === 0xfeff) {\n value = value.slice(1)\n\n content.column++\n content.offset++\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {start: start, end: self.eof || xtend(start)}\n }\n\n if (!self.options.position) {\n removePosition(node, true)\n }\n\n return node\n}", "function parse(value, settings) {\n var additional = settings.additional\n var nonTerminated = settings.nonTerminated\n var handleText = settings.text\n var handleReference = settings.reference\n var handleWarning = settings.warning\n var textContext = settings.textContext\n var referenceContext = settings.referenceContext\n var warningContext = settings.warningContext\n var pos = settings.position\n var indent = settings.indent || []\n var length = value.length\n var index = 0\n var lines = -1\n var column = pos.column || 1\n var line = pos.line || 1\n var queue = ''\n var result = []\n var entityCharacters\n var namedEntity\n var terminated\n var characters\n var character\n var reference\n var following\n var warning\n var reason\n var output\n var entity\n var begin\n var start\n var type\n var test\n var prev\n var next\n var diff\n var end\n\n if (typeof additional === 'string') {\n additional = additional.charCodeAt(0)\n }\n\n // Cache the current point.\n prev = now()\n\n // Wrap `handleWarning`.\n warning = handleWarning ? parseError : noop\n\n // Ensure the algorithm walks over the first character and the end (inclusive).\n index--\n length++\n\n while (++index < length) {\n // If the previous character was a newline.\n if (character === lineFeed) {\n column = indent[lines] || 1\n }\n\n character = value.charCodeAt(index)\n\n if (character === ampersand) {\n following = value.charCodeAt(index + 1)\n\n // The behaviour depends on the identity of the next character.\n if (\n following === tab ||\n following === lineFeed ||\n following === formFeed ||\n following === space ||\n following === ampersand ||\n following === lessThan ||\n following !== following ||\n (additional && following === additional)\n ) {\n // Not a character reference.\n // No characters are consumed, and nothing is returned.\n // This is not an error, either.\n queue += fromCharCode(character)\n column++\n\n continue\n }\n\n start = index + 1\n begin = start\n end = start\n\n if (following === numberSign) {\n // Numerical entity.\n end = ++begin\n\n // The behaviour further depends on the next character.\n following = value.charCodeAt(end)\n\n if (following === uppercaseX || following === lowercaseX) {\n // ASCII hex digits.\n type = hexa\n end = ++begin\n } else {\n // ASCII digits.\n type = deci\n }\n } else {\n // Named entity.\n type = name\n }\n\n entityCharacters = ''\n entity = ''\n characters = ''\n test = tests[type]\n end--\n\n while (++end < length) {\n following = value.charCodeAt(end)\n\n if (!test(following)) {\n break\n }\n\n characters += fromCharCode(following)\n\n // Check if we can match a legacy named reference.\n // If so, we cache that as the last viable named reference.\n // This ensures we do not need to walk backwards later.\n if (type === name && own.call(legacy, characters)) {\n entityCharacters = characters\n entity = legacy[characters]\n }\n }\n\n terminated = value.charCodeAt(end) === semicolon\n\n if (terminated) {\n end++\n\n namedEntity = type === name ? decodeEntity(characters) : false\n\n if (namedEntity) {\n entityCharacters = characters\n entity = namedEntity\n }\n }\n\n diff = 1 + end - start\n\n if (!terminated && !nonTerminated) {\n // Empty.\n } else if (!characters) {\n // An empty (possible) entity is valid, unless it’s numeric (thus an\n // ampersand followed by an octothorp).\n if (type !== name) {\n warning(numericEmpty, diff)\n }\n } else if (type === name) {\n // An ampersand followed by anything unknown, and not terminated, is\n // invalid.\n if (terminated && !entity) {\n warning(namedUnknown, 1)\n } else {\n // If theres something after an entity name which is not known, cap\n // the reference.\n if (entityCharacters !== characters) {\n end = begin + entityCharacters.length\n diff = 1 + end - begin\n terminated = false\n }\n\n // If the reference is not terminated, warn.\n if (!terminated) {\n reason = entityCharacters ? namedNotTerminated : namedEmpty\n\n if (settings.attribute) {\n following = value.charCodeAt(end)\n\n if (following === equalsTo) {\n warning(reason, diff)\n entity = null\n } else if (alphanumerical(following)) {\n entity = null\n } else {\n warning(reason, diff)\n }\n } else {\n warning(reason, diff)\n }\n }\n }\n\n reference = entity\n } else {\n if (!terminated) {\n // All non-terminated numeric entities are not rendered, and trigger a\n // warning.\n warning(numericNotTerminated, diff)\n }\n\n // When terminated and number, parse as either hexadecimal or decimal.\n reference = parseInt(characters, bases[type])\n\n // Trigger a warning when the parsed number is prohibited, and replace\n // with replacement character.\n if (prohibited(reference)) {\n warning(numericProhibited, diff)\n reference = fromCharCode(replacementCharacter)\n } else if (reference in invalid) {\n // Trigger a warning when the parsed number is disallowed, and replace\n // by an alternative.\n warning(numericDisallowed, diff)\n reference = invalid[reference]\n } else {\n // Parse the number.\n output = ''\n\n // Trigger a warning when the parsed number should not be used.\n if (disallowed(reference)) {\n warning(numericDisallowed, diff)\n }\n\n // Stringify the number.\n if (reference > 0xffff) {\n reference -= 0x10000\n output += fromCharCode((reference >>> (10 & 0x3ff)) | 0xd800)\n reference = 0xdc00 | (reference & 0x3ff)\n }\n\n reference = output + fromCharCode(reference)\n }\n }\n\n // Found it!\n // First eat the queued characters as normal text, then eat an entity.\n if (reference) {\n flush()\n\n prev = now()\n index = end - 1\n column += end - start + 1\n result.push(reference)\n next = now()\n next.offset++\n\n if (handleReference) {\n handleReference.call(\n referenceContext,\n reference,\n {start: prev, end: next},\n value.slice(start - 1, end)\n )\n }\n\n prev = next\n } else {\n // If we could not find a reference, queue the checked characters (as\n // normal characters), and move the pointer to their end.\n // This is possible because we can be certain neither newlines nor\n // ampersands are included.\n characters = value.slice(start - 1, end)\n queue += characters\n column += characters.length\n index = end - 1\n }\n } else {\n // Handle anything other than an ampersand, including newlines and EOF.\n if (\n character === 10 // Line feed\n ) {\n line++\n lines++\n column = 0\n }\n\n if (character === character) {\n queue += fromCharCode(character)\n column++\n } else {\n flush()\n }\n }\n }\n\n // Return the reduced nodes, and any possible warnings.\n return result.join('')\n\n // Get current position.\n function now() {\n return {\n line: line,\n column: column,\n offset: index + (pos.offset || 0)\n }\n }\n\n // “Throw” a parse-error: a warning.\n function parseError(code, offset) {\n var position = now()\n\n position.column += offset\n position.offset += offset\n\n handleWarning.call(warningContext, messages[code], position, code)\n }\n\n // Flush `queue` (normal text).\n // Macro invoked before each entity and at the end of `value`.\n // Does nothing when `queue` is empty.\n function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }\n}", "function parse(value, settings) {\n var additional = settings.additional\n var nonTerminated = settings.nonTerminated\n var handleText = settings.text\n var handleReference = settings.reference\n var handleWarning = settings.warning\n var textContext = settings.textContext\n var referenceContext = settings.referenceContext\n var warningContext = settings.warningContext\n var pos = settings.position\n var indent = settings.indent || []\n var length = value.length\n var index = 0\n var lines = -1\n var column = pos.column || 1\n var line = pos.line || 1\n var queue = ''\n var result = []\n var entityCharacters\n var namedEntity\n var terminated\n var characters\n var character\n var reference\n var following\n var warning\n var reason\n var output\n var entity\n var begin\n var start\n var type\n var test\n var prev\n var next\n var diff\n var end\n\n if (typeof additional === 'string') {\n additional = additional.charCodeAt(0)\n }\n\n // Cache the current point.\n prev = now()\n\n // Wrap `handleWarning`.\n warning = handleWarning ? parseError : noop\n\n // Ensure the algorithm walks over the first character and the end (inclusive).\n index--\n length++\n\n while (++index < length) {\n // If the previous character was a newline.\n if (character === lineFeed) {\n column = indent[lines] || 1\n }\n\n character = value.charCodeAt(index)\n\n if (character === ampersand) {\n following = value.charCodeAt(index + 1)\n\n // The behaviour depends on the identity of the next character.\n if (\n following === tab ||\n following === lineFeed ||\n following === formFeed ||\n following === space ||\n following === ampersand ||\n following === lessThan ||\n following !== following ||\n (additional && following === additional)\n ) {\n // Not a character reference.\n // No characters are consumed, and nothing is returned.\n // This is not an error, either.\n queue += fromCharCode(character)\n column++\n\n continue\n }\n\n start = index + 1\n begin = start\n end = start\n\n if (following === numberSign) {\n // Numerical entity.\n end = ++begin\n\n // The behaviour further depends on the next character.\n following = value.charCodeAt(end)\n\n if (following === uppercaseX || following === lowercaseX) {\n // ASCII hex digits.\n type = hexa\n end = ++begin\n } else {\n // ASCII digits.\n type = deci\n }\n } else {\n // Named entity.\n type = name\n }\n\n entityCharacters = ''\n entity = ''\n characters = ''\n test = tests[type]\n end--\n\n while (++end < length) {\n following = value.charCodeAt(end)\n\n if (!test(following)) {\n break\n }\n\n characters += fromCharCode(following)\n\n // Check if we can match a legacy named reference.\n // If so, we cache that as the last viable named reference.\n // This ensures we do not need to walk backwards later.\n if (type === name && own.call(legacy, characters)) {\n entityCharacters = characters\n entity = legacy[characters]\n }\n }\n\n terminated = value.charCodeAt(end) === semicolon\n\n if (terminated) {\n end++\n\n namedEntity = type === name ? decodeEntity(characters) : false\n\n if (namedEntity) {\n entityCharacters = characters\n entity = namedEntity\n }\n }\n\n diff = 1 + end - start\n\n if (!terminated && !nonTerminated) {\n // Empty.\n } else if (!characters) {\n // An empty (possible) entity is valid, unless it’s numeric (thus an\n // ampersand followed by an octothorp).\n if (type !== name) {\n warning(numericEmpty, diff)\n }\n } else if (type === name) {\n // An ampersand followed by anything unknown, and not terminated, is\n // invalid.\n if (terminated && !entity) {\n warning(namedUnknown, 1)\n } else {\n // If theres something after an entity name which is not known, cap\n // the reference.\n if (entityCharacters !== characters) {\n end = begin + entityCharacters.length\n diff = 1 + end - begin\n terminated = false\n }\n\n // If the reference is not terminated, warn.\n if (!terminated) {\n reason = entityCharacters ? namedNotTerminated : namedEmpty\n\n if (settings.attribute) {\n following = value.charCodeAt(end)\n\n if (following === equalsTo) {\n warning(reason, diff)\n entity = null\n } else if (alphanumerical(following)) {\n entity = null\n } else {\n warning(reason, diff)\n }\n } else {\n warning(reason, diff)\n }\n }\n }\n\n reference = entity\n } else {\n if (!terminated) {\n // All non-terminated numeric entities are not rendered, and trigger a\n // warning.\n warning(numericNotTerminated, diff)\n }\n\n // When terminated and number, parse as either hexadecimal or decimal.\n reference = parseInt(characters, bases[type])\n\n // Trigger a warning when the parsed number is prohibited, and replace\n // with replacement character.\n if (prohibited(reference)) {\n warning(numericProhibited, diff)\n reference = fromCharCode(replacementCharacter)\n } else if (reference in invalid) {\n // Trigger a warning when the parsed number is disallowed, and replace\n // by an alternative.\n warning(numericDisallowed, diff)\n reference = invalid[reference]\n } else {\n // Parse the number.\n output = ''\n\n // Trigger a warning when the parsed number should not be used.\n if (disallowed(reference)) {\n warning(numericDisallowed, diff)\n }\n\n // Stringify the number.\n if (reference > 0xffff) {\n reference -= 0x10000\n output += fromCharCode((reference >>> (10 & 0x3ff)) | 0xd800)\n reference = 0xdc00 | (reference & 0x3ff)\n }\n\n reference = output + fromCharCode(reference)\n }\n }\n\n // Found it!\n // First eat the queued characters as normal text, then eat an entity.\n if (reference) {\n flush()\n\n prev = now()\n index = end - 1\n column += end - start + 1\n result.push(reference)\n next = now()\n next.offset++\n\n if (handleReference) {\n handleReference.call(\n referenceContext,\n reference,\n {start: prev, end: next},\n value.slice(start - 1, end)\n )\n }\n\n prev = next\n } else {\n // If we could not find a reference, queue the checked characters (as\n // normal characters), and move the pointer to their end.\n // This is possible because we can be certain neither newlines nor\n // ampersands are included.\n characters = value.slice(start - 1, end)\n queue += characters\n column += characters.length\n index = end - 1\n }\n } else {\n // Handle anything other than an ampersand, including newlines and EOF.\n if (\n character === 10 // Line feed\n ) {\n line++\n lines++\n column = 0\n }\n\n if (character === character) {\n queue += fromCharCode(character)\n column++\n } else {\n flush()\n }\n }\n }\n\n // Return the reduced nodes, and any possible warnings.\n return result.join('')\n\n // Get current position.\n function now() {\n return {\n line: line,\n column: column,\n offset: index + (pos.offset || 0)\n }\n }\n\n // “Throw” a parse-error: a warning.\n function parseError(code, offset) {\n var position = now()\n\n position.column += offset\n position.offset += offset\n\n handleWarning.call(warningContext, messages[code], position, code)\n }\n\n // Flush `queue` (normal text).\n // Macro invoked before each entity and at the end of `value`.\n // Does nothing when `queue` is empty.\n function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }\n}", "function parse(value, settings) {\n var additional = settings.additional\n var nonTerminated = settings.nonTerminated\n var handleText = settings.text\n var handleReference = settings.reference\n var handleWarning = settings.warning\n var textContext = settings.textContext\n var referenceContext = settings.referenceContext\n var warningContext = settings.warningContext\n var pos = settings.position\n var indent = settings.indent || []\n var length = value.length\n var index = 0\n var lines = -1\n var column = pos.column || 1\n var line = pos.line || 1\n var queue = ''\n var result = []\n var entityCharacters\n var namedEntity\n var terminated\n var characters\n var character\n var reference\n var following\n var warning\n var reason\n var output\n var entity\n var begin\n var start\n var type\n var test\n var prev\n var next\n var diff\n var end\n\n if (typeof additional === 'string') {\n additional = additional.charCodeAt(0)\n }\n\n // Cache the current point.\n prev = now()\n\n // Wrap `handleWarning`.\n warning = handleWarning ? parseError : noop\n\n // Ensure the algorithm walks over the first character and the end\n // (inclusive).\n index--\n length++\n\n while (++index < length) {\n // If the previous character was a newline.\n if (character === lineFeed) {\n column = indent[lines] || 1\n }\n\n character = value.charCodeAt(index)\n\n if (character === ampersand) {\n following = value.charCodeAt(index + 1)\n\n // The behaviour depends on the identity of the next character.\n if (\n following === tab ||\n following === lineFeed ||\n following === formFeed ||\n following === space ||\n following === ampersand ||\n following === lessThan ||\n following !== following ||\n (additional && following === additional)\n ) {\n // Not a character reference.\n // No characters are consumed, and nothing is returned.\n // This is not an error, either.\n queue += fromCharCode(character)\n column++\n\n continue\n }\n\n start = index + 1\n begin = start\n end = start\n\n if (following === numberSign) {\n // Numerical entity.\n end = ++begin\n\n // The behaviour further depends on the next character.\n following = value.charCodeAt(end)\n\n if (following === uppercaseX || following === lowercaseX) {\n // ASCII hex digits.\n type = hexa\n end = ++begin\n } else {\n // ASCII digits.\n type = deci\n }\n } else {\n // Named entity.\n type = name\n }\n\n entityCharacters = ''\n entity = ''\n characters = ''\n test = tests[type]\n end--\n\n while (++end < length) {\n following = value.charCodeAt(end)\n\n if (!test(following)) {\n break\n }\n\n characters += fromCharCode(following)\n\n // Check if we can match a legacy named reference.\n // If so, we cache that as the last viable named reference.\n // This ensures we do not need to walk backwards later.\n if (type === name && own.call(legacy, characters)) {\n entityCharacters = characters\n entity = legacy[characters]\n }\n }\n\n terminated = value.charCodeAt(end) === semicolon\n\n if (terminated) {\n end++\n\n namedEntity = type === name ? decodeEntity(characters) : false\n\n if (namedEntity) {\n entityCharacters = characters\n entity = namedEntity\n }\n }\n\n diff = 1 + end - start\n\n if (!terminated && !nonTerminated) {\n // Empty.\n } else if (!characters) {\n // An empty (possible) entity is valid, unless it’s numeric (thus an\n // ampersand followed by an octothorp).\n if (type !== name) {\n warning(numericEmpty, diff)\n }\n } else if (type === name) {\n // An ampersand followed by anything unknown, and not terminated, is\n // invalid.\n if (terminated && !entity) {\n warning(namedUnknown, 1)\n } else {\n // If theres something after an entity name which is not known, cap\n // the reference.\n if (entityCharacters !== characters) {\n end = begin + entityCharacters.length\n diff = 1 + end - begin\n terminated = false\n }\n\n // If the reference is not terminated, warn.\n if (!terminated) {\n reason = entityCharacters ? namedNotTerminated : namedEmpty\n\n if (settings.attribute) {\n following = value.charCodeAt(end)\n\n if (following === equalsTo) {\n warning(reason, diff)\n entity = null\n } else if (alphanumerical(following)) {\n entity = null\n } else {\n warning(reason, diff)\n }\n } else {\n warning(reason, diff)\n }\n }\n }\n\n reference = entity\n } else {\n if (!terminated) {\n // All non-terminated numeric entities are not rendered, and trigger a\n // warning.\n warning(numericNotTerminated, diff)\n }\n\n // When terminated and number, parse as either hexadecimal or decimal.\n reference = parseInt(characters, bases[type])\n\n // Trigger a warning when the parsed number is prohibited, and replace\n // with replacement character.\n if (prohibited(reference)) {\n warning(numericProhibited, diff)\n reference = fromCharCode(replacementCharacter)\n } else if (reference in invalid) {\n // Trigger a warning when the parsed number is disallowed, and replace\n // by an alternative.\n warning(numericDisallowed, diff)\n reference = invalid[reference]\n } else {\n // Parse the number.\n output = ''\n\n // Trigger a warning when the parsed number should not be used.\n if (disallowed(reference)) {\n warning(numericDisallowed, diff)\n }\n\n // Stringify the number.\n if (reference > 0xffff) {\n reference -= 0x10000\n output += fromCharCode((reference >>> (10 & 0x3ff)) | 0xd800)\n reference = 0xdc00 | (reference & 0x3ff)\n }\n\n reference = output + fromCharCode(reference)\n }\n }\n\n // Found it!\n // First eat the queued characters as normal text, then eat an entity.\n if (reference) {\n flush()\n\n prev = now()\n index = end - 1\n column += end - start + 1\n result.push(reference)\n next = now()\n next.offset++\n\n if (handleReference) {\n handleReference.call(\n referenceContext,\n reference,\n {start: prev, end: next},\n value.slice(start - 1, end)\n )\n }\n\n prev = next\n } else {\n // If we could not find a reference, queue the checked characters (as\n // normal characters), and move the pointer to their end.\n // This is possible because we can be certain neither newlines nor\n // ampersands are included.\n characters = value.slice(start - 1, end)\n queue += characters\n column += characters.length\n index = end - 1\n }\n } else {\n // Handle anything other than an ampersand, including newlines and EOF.\n if (\n character === 10 // Line feed\n ) {\n line++\n lines++\n column = 0\n }\n\n if (character === character) {\n queue += fromCharCode(character)\n column++\n } else {\n flush()\n }\n }\n }\n\n // Return the reduced nodes.\n return result.join('')\n\n // Get current position.\n function now() {\n return {\n line: line,\n column: column,\n offset: index + (pos.offset || 0)\n }\n }\n\n // “Throw” a parse-error: a warning.\n function parseError(code, offset) {\n var position = now()\n\n position.column += offset\n position.offset += offset\n\n handleWarning.call(warningContext, messages[code], position, code)\n }\n\n // Flush `queue` (normal text).\n // Macro invoked before each entity and at the end of `value`.\n // Does nothing when `queue` is empty.\n function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }\n}", "function parse(value, settings) {\n var additional = settings.additional\n var nonTerminated = settings.nonTerminated\n var handleText = settings.text\n var handleReference = settings.reference\n var handleWarning = settings.warning\n var textContext = settings.textContext\n var referenceContext = settings.referenceContext\n var warningContext = settings.warningContext\n var pos = settings.position\n var indent = settings.indent || []\n var length = value.length\n var index = 0\n var lines = -1\n var column = pos.column || 1\n var line = pos.line || 1\n var queue = ''\n var result = []\n var entityCharacters\n var namedEntity\n var terminated\n var characters\n var character\n var reference\n var following\n var warning\n var reason\n var output\n var entity\n var begin\n var start\n var type\n var test\n var prev\n var next\n var diff\n var end\n\n if (typeof additional === 'string') {\n additional = additional.charCodeAt(0)\n }\n\n // Cache the current point.\n prev = now()\n\n // Wrap `handleWarning`.\n warning = handleWarning ? parseError : noop\n\n // Ensure the algorithm walks over the first character and the end\n // (inclusive).\n index--\n length++\n\n while (++index < length) {\n // If the previous character was a newline.\n if (character === lineFeed) {\n column = indent[lines] || 1\n }\n\n character = value.charCodeAt(index)\n\n if (character === ampersand) {\n following = value.charCodeAt(index + 1)\n\n // The behaviour depends on the identity of the next character.\n if (\n following === tab ||\n following === lineFeed ||\n following === formFeed ||\n following === space ||\n following === ampersand ||\n following === lessThan ||\n following !== following ||\n (additional && following === additional)\n ) {\n // Not a character reference.\n // No characters are consumed, and nothing is returned.\n // This is not an error, either.\n queue += fromCharCode(character)\n column++\n\n continue\n }\n\n start = index + 1\n begin = start\n end = start\n\n if (following === numberSign) {\n // Numerical entity.\n end = ++begin\n\n // The behaviour further depends on the next character.\n following = value.charCodeAt(end)\n\n if (following === uppercaseX || following === lowercaseX) {\n // ASCII hex digits.\n type = hexa\n end = ++begin\n } else {\n // ASCII digits.\n type = deci\n }\n } else {\n // Named entity.\n type = name\n }\n\n entityCharacters = ''\n entity = ''\n characters = ''\n test = tests[type]\n end--\n\n while (++end < length) {\n following = value.charCodeAt(end)\n\n if (!test(following)) {\n break\n }\n\n characters += fromCharCode(following)\n\n // Check if we can match a legacy named reference.\n // If so, we cache that as the last viable named reference.\n // This ensures we do not need to walk backwards later.\n if (type === name && own.call(legacy, characters)) {\n entityCharacters = characters\n entity = legacy[characters]\n }\n }\n\n terminated = value.charCodeAt(end) === semicolon\n\n if (terminated) {\n end++\n\n namedEntity = type === name ? decodeEntity(characters) : false\n\n if (namedEntity) {\n entityCharacters = characters\n entity = namedEntity\n }\n }\n\n diff = 1 + end - start\n\n if (!terminated && !nonTerminated) {\n // Empty.\n } else if (!characters) {\n // An empty (possible) entity is valid, unless it’s numeric (thus an\n // ampersand followed by an octothorp).\n if (type !== name) {\n warning(numericEmpty, diff)\n }\n } else if (type === name) {\n // An ampersand followed by anything unknown, and not terminated, is\n // invalid.\n if (terminated && !entity) {\n warning(namedUnknown, 1)\n } else {\n // If theres something after an entity name which is not known, cap\n // the reference.\n if (entityCharacters !== characters) {\n end = begin + entityCharacters.length\n diff = 1 + end - begin\n terminated = false\n }\n\n // If the reference is not terminated, warn.\n if (!terminated) {\n reason = entityCharacters ? namedNotTerminated : namedEmpty\n\n if (settings.attribute) {\n following = value.charCodeAt(end)\n\n if (following === equalsTo) {\n warning(reason, diff)\n entity = null\n } else if (alphanumerical(following)) {\n entity = null\n } else {\n warning(reason, diff)\n }\n } else {\n warning(reason, diff)\n }\n }\n }\n\n reference = entity\n } else {\n if (!terminated) {\n // All non-terminated numeric entities are not rendered, and trigger a\n // warning.\n warning(numericNotTerminated, diff)\n }\n\n // When terminated and number, parse as either hexadecimal or decimal.\n reference = parseInt(characters, bases[type])\n\n // Trigger a warning when the parsed number is prohibited, and replace\n // with replacement character.\n if (prohibited(reference)) {\n warning(numericProhibited, diff)\n reference = fromCharCode(replacementCharacter)\n } else if (reference in invalid) {\n // Trigger a warning when the parsed number is disallowed, and replace\n // by an alternative.\n warning(numericDisallowed, diff)\n reference = invalid[reference]\n } else {\n // Parse the number.\n output = ''\n\n // Trigger a warning when the parsed number should not be used.\n if (disallowed(reference)) {\n warning(numericDisallowed, diff)\n }\n\n // Stringify the number.\n if (reference > 0xffff) {\n reference -= 0x10000\n output += fromCharCode((reference >>> (10 & 0x3ff)) | 0xd800)\n reference = 0xdc00 | (reference & 0x3ff)\n }\n\n reference = output + fromCharCode(reference)\n }\n }\n\n // Found it!\n // First eat the queued characters as normal text, then eat an entity.\n if (reference) {\n flush()\n\n prev = now()\n index = end - 1\n column += end - start + 1\n result.push(reference)\n next = now()\n next.offset++\n\n if (handleReference) {\n handleReference.call(\n referenceContext,\n reference,\n {start: prev, end: next},\n value.slice(start - 1, end)\n )\n }\n\n prev = next\n } else {\n // If we could not find a reference, queue the checked characters (as\n // normal characters), and move the pointer to their end.\n // This is possible because we can be certain neither newlines nor\n // ampersands are included.\n characters = value.slice(start - 1, end)\n queue += characters\n column += characters.length\n index = end - 1\n }\n } else {\n // Handle anything other than an ampersand, including newlines and EOF.\n if (\n character === 10 // Line feed\n ) {\n line++\n lines++\n column = 0\n }\n\n if (character === character) {\n queue += fromCharCode(character)\n column++\n } else {\n flush()\n }\n }\n }\n\n // Return the reduced nodes.\n return result.join('')\n\n // Get current position.\n function now() {\n return {\n line: line,\n column: column,\n offset: index + (pos.offset || 0)\n }\n }\n\n // “Throw” a parse-error: a warning.\n function parseError(code, offset) {\n var position = now()\n\n position.column += offset\n position.offset += offset\n\n handleWarning.call(warningContext, messages[code], position, code)\n }\n\n // Flush `queue` (normal text).\n // Macro invoked before each entity and at the end of `value`.\n // Does nothing when `queue` is empty.\n function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }\n}", "text(text2, marks) {\n let type = this.nodes.text;\n return new TextNode(type, type.defaultAttrs, text2, Mark$1.setFrom(marks));\n }", "function transformTextNodes(node) {\n node.childNodes.forEach((n)=>{\n console.log(n);\n if(n.nodeName === \"#text\"){\n console.log(n.nodeValue);\n n.nodeValue = n.nodeValue.split(\" \")\n .map((text)=>{\n if (!text.trim()) return text;\n // console.log(\"text =\" + text);\n if(text[text.length-1] == '\\n'){\n tmp = text.substr(0,text.length-1);\n return MATCH_LIST[tmp]?`${MATCH_LIST[tmp]}\\n`:text;\n }else{\n tmp = text;\n return MATCH_LIST[tmp]?`${MATCH_LIST[tmp]}`:text;\n }\n })\n .join(\" \");\n // console.log(node);\n }else{\n transformTextNodes(n);\n }\n })\n}", "function handleValue(value) {\n // when the value is an empty string reset the sprite position and remove the existing articles, if any\n if (!value) {\n svg.setAttribute('viewBox', '0 0 21 31');\n section.innerHTML = '';\n } else {\n // else create a regex out of the string and find filter the data array according to a possible match\n const possibleMatch = value;\n const regexPossibleMatch = new RegExp(possibleMatch, 'i');\n const matches = data.filter(({ name }) => regexPossibleMatch.test(name));\n // call the function to display the matches and highlight the matching value\n displayMatches(possibleMatch, matches);\n }\n}", "function text(index,value){var lView=getLView();ngDevMode&&assertEqual(lView[BINDING_INDEX],lView[TVIEW].bindingStartIndex,'text nodes should be created before any bindings');ngDevMode&&ngDevMode.rendererCreateTextNode++;var textNative=createTextNode(value,lView[RENDERER]);var tNode=createNodeAtIndex(index,3/* Element */,textNative,null,null);// Text nodes are self closing.\nsetIsParent(false);appendChild(textNative,tNode,lView);}", "function decodeValue (value, options) {\n return getValueEncoder(options).decode(value)\n}", "function decodeValue (value, options) {\n return getValueEncoder(options).decode(value)\n}", "nodeAt(pos) {\n for (let node = this; ; ) {\n let { index, offset } = node.content.findIndex(pos);\n node = node.maybeChild(index);\n if (!node)\n return null;\n if (offset == pos || node.isText)\n return node;\n pos -= offset + 1;\n }\n }", "text(node) {\n let oldValue;\n const textContent = value => {\n if (oldValue !== value) {\n oldValue = value;\n const type = typeof value;\n if (type === 'object' && value) {\n if ('text' in value) {\n textContent(String(value.text));\n } else if ('any' in value) {\n textContent(value.any);\n } else if ('html' in value) {\n textContent([].concat(value.html).join(''));\n } else if ('length' in value) {\n textContent(slice.call(value).join(''));\n }\n } else if (type === 'function') {\n textContent(value(node));\n } else {\n node.textContent = value == null ? '' : value;\n }\n }\n };\n return textContent;\n }", "toText() {\n let m = this\n let res = m.map(val => {\n if (val.has('#TextValue')) {\n return val\n }\n let obj = parse(val)\n if (obj.num === null) {\n return val\n }\n let fmt = val.has('#Ordinal') ? 'TextOrdinal' : 'TextCardinal'\n let str = format(obj, fmt)\n val.replaceWith(str, { tags: true })\n val.tag('TextValue')\n return val\n })\n return new Numbers(res.document, res.pointer)\n }", "get textContent() {\n return this.isLeaf && this.type.spec.leafText ? this.type.spec.leafText(this) : this.textBetween(0, this.content.size, \"\");\n }", "function fromNodeOffset(node, offset) {\n if (node.nodeType === 3) {\n return text(node, offset);\n }\n\n if (offset === node.childNodes.length) {\n return end(node);\n }\n\n assert(offset >= 0 && offset < node.childNodes.length,\n 'invalid offset for', node, offset);\n\n return before(node.childNodes[offset]);\n}", "getNodeValue() {}", "function hasTextValue(value) {\n return function (node) {\n return util_1.getTextContent(node) === value;\n };\n}", "function convertFromText(c) {\n c.t = 'text0';\n var o = {p: c.p.pop()};\n if (c.si != null) o.i = c.si;\n if (c.sd != null) o.d = c.sd;\n c.o = [o];\n}", "function valueToNode(value) {\n\t // undefined\n\t if (value === undefined) {\n\t return t.identifier(\"undefined\");\n\t }\n\n\t // null, booleans, strings, numbers, regexs\n\t if (value === true || value === false || value === null || _lodashLangIsString2[\"default\"](value) || _lodashLangIsNumber2[\"default\"](value) || _lodashLangIsRegExp2[\"default\"](value)) {\n\t return t.literal(value);\n\t }\n\n\t // array\n\t if (Array.isArray(value)) {\n\t return t.arrayExpression(value.map(t.valueToNode));\n\t }\n\n\t // object\n\t if (_lodashLangIsPlainObject2[\"default\"](value)) {\n\t var props = [];\n\t for (var key in value) {\n\t var nodeKey;\n\t if (t.isValidIdentifier(key)) {\n\t nodeKey = t.identifier(key);\n\t } else {\n\t nodeKey = t.literal(key);\n\t }\n\t props.push(t.property(\"init\", nodeKey, t.valueToNode(value[key])));\n\t }\n\t return t.objectExpression(props);\n\t }\n\n\t throw new Error(\"don't know how to turn this value into a node\");\n\t}", "function valueToNode(value) {\n\t // undefined\n\t if (value === undefined) {\n\t return t.identifier(\"undefined\");\n\t }\n\n\t // null, booleans, strings, numbers, regexs\n\t if (value === true || value === false || value === null || _lodashLangIsString2[\"default\"](value) || _lodashLangIsNumber2[\"default\"](value) || _lodashLangIsRegExp2[\"default\"](value)) {\n\t return t.literal(value);\n\t }\n\n\t // array\n\t if (Array.isArray(value)) {\n\t return t.arrayExpression(value.map(t.valueToNode));\n\t }\n\n\t // object\n\t if (_lodashLangIsPlainObject2[\"default\"](value)) {\n\t var props = [];\n\t for (var key in value) {\n\t var nodeKey;\n\t if (t.isValidIdentifier(key)) {\n\t nodeKey = t.identifier(key);\n\t } else {\n\t nodeKey = t.literal(key);\n\t }\n\t props.push(t.property(\"init\", nodeKey, t.valueToNode(value[key])));\n\t }\n\t return t.objectExpression(props);\n\t }\n\n\t throw new Error(\"don't know how to turn this value into a node\");\n\t}", "get value(){\n return this.nodeValue;\n }", "get value(){\n return this.nodeValue;\n }", "nodeValue(e){\n var value = e.nodeName == '#text' ? e.data : e.innerHTML,\n value = value||'';\n\n return this.domPreparer.prepareTranslateHTML(value, e).trim();\n }", "StringValue(node) {\n return node.value;\n }", "function convertHtmlToText(value) {\n var d = document.createElement(\"div\");\n d.innerHTML = value;\n return d.innerText;\n}", "function valuetext(value) {\n return `${value}`;\n}", "function valueToNode(value) {\n // undefined\n if (value === undefined) {\n return t.identifier(\"undefined\");\n }\n\n // null, booleans, strings, numbers, regexs\n if (value === true || value === false || value === null || _lodashLangIsString2[\"default\"](value) || _lodashLangIsNumber2[\"default\"](value) || _lodashLangIsRegExp2[\"default\"](value)) {\n return t.literal(value);\n }\n\n // array\n if (Array.isArray(value)) {\n return t.arrayExpression(value.map(t.valueToNode));\n }\n\n // object\n if (_lodashLangIsPlainObject2[\"default\"](value)) {\n var props = [];\n for (var key in value) {\n var nodeKey;\n if (t.isValidIdentifier(key)) {\n nodeKey = t.identifier(key);\n } else {\n nodeKey = t.literal(key);\n }\n props.push(t.property(\"init\", nodeKey, t.valueToNode(value[key])));\n }\n return t.objectExpression(props);\n }\n\n throw new Error(\"don't know how to turn this value into a node\");\n}", "function at(position) {\n return value.charAt(position);\n }", "getTextPosition(hierarchicalIndex) {\n let textPosition = new TextPosition(this.owner);\n textPosition.setPositionForCurrentIndex(hierarchicalIndex);\n return textPosition;\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function TextNode(text) {\n this.text = text;\n}", "function TextNode(text) {\n this.text = text;\n}", "function decode(text) {\n const el = document.createElement(\"div\");\n el.innerHTML = text;\n text = el.innerText;\n return text;\n }", "renderText(selector, value) {\n\t\tdocument.querySelector(selector).textContent = value;\n\t}", "function parseTextData(context, length, mode) {\n\t const rawText = context.source.slice(0, length);\n\t advanceBy(context, length);\n\t if (mode === 2 /* RAWTEXT */ ||\n\t mode === 3 /* CDATA */ ||\n\t rawText.indexOf('&') === -1) {\n\t return rawText;\n\t }\n\t else {\n\t // DATA or RCDATA containing \"&\"\". Entity decoding required.\n\t return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n\t }\n\t}", "function htmlDecode(input){\n var e = document.createElement('span');\n e.innerHTML = input;\n return e.childNodes[0].nodeValue;\n}", "function parseTextData(context, length, mode) {\r\n const rawText = context.source.slice(0, length);\r\n advanceBy(context, length);\r\n if (mode === 2 /* RAWTEXT */ ||\r\n mode === 3 /* CDATA */ ||\r\n rawText.indexOf('&') === -1) {\r\n return rawText;\r\n }\r\n else {\r\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\r\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\r\n }\r\n}", "function parseTextData(context, length, mode) {\r\n const rawText = context.source.slice(0, length);\r\n advanceBy(context, length);\r\n if (mode === 2 /* RAWTEXT */ ||\r\n mode === 3 /* CDATA */ ||\r\n rawText.indexOf('&') === -1) {\r\n return rawText;\r\n }\r\n else {\r\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\r\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\r\n }\r\n}", "function decodeString(value) {\n var byteString = atob(value);\n var arr = new Uint8Array(byteString.length);\n for (var i = 0; i < byteString.length; i++) {\n arr[i] = byteString.charCodeAt(i);\n }\n return arr;\n }", "function text(textNode, offset) {\n return new Point(magic).moveToText(textNode, offset);\n}", "constructor(value){\n this.value = value;\n this.children = {};\n this.isWord = false;\n }", "function parseTextData(context, length, mode) {\n const rawText = context.source.slice(0, length);\n advanceBy(context, length);\n if (mode === 2 /* RAWTEXT */ ||\n mode === 3 /* CDATA */ ||\n rawText.indexOf('&') === -1) {\n return rawText;\n }\n else {\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n }\n}", "function parseTextData(context, length, mode) {\n const rawText = context.source.slice(0, length);\n advanceBy(context, length);\n if (mode === 2 /* RAWTEXT */ ||\n mode === 3 /* CDATA */ ||\n rawText.indexOf('&') === -1) {\n return rawText;\n }\n else {\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n }\n}", "function parseTextData(context, length, mode) {\n const rawText = context.source.slice(0, length);\n advanceBy(context, length);\n if (mode === 2 /* RAWTEXT */ ||\n mode === 3 /* CDATA */ ||\n rawText.indexOf('&') === -1) {\n return rawText;\n }\n else {\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n }\n}", "function parseTextData(context, length, mode) {\n const rawText = context.source.slice(0, length);\n advanceBy(context, length);\n if (mode === 2 /* RAWTEXT */ ||\n mode === 3 /* CDATA */ ||\n rawText.indexOf('&') === -1) {\n return rawText;\n }\n else {\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n }\n}", "function parseTextData(context, length, mode) {\n const rawText = context.source.slice(0, length);\n advanceBy(context, length);\n if (mode === 2 /* RAWTEXT */ ||\n mode === 3 /* CDATA */ ||\n rawText.indexOf('&') === -1) {\n return rawText;\n }\n else {\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n }\n}", "function parseTextData(context, length, mode) {\n const rawText = context.source.slice(0, length);\n advanceBy(context, length);\n if (mode === 2 /* RAWTEXT */ ||\n mode === 3 /* CDATA */ ||\n rawText.indexOf('&') === -1) {\n return rawText;\n }\n else {\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n }\n}", "function text(node, parent) {\n return this.encode(this.escape(node.value, node, parent), node);\n}" ]
[ "0.68272823", "0.6593941", "0.6593941", "0.6593941", "0.6593941", "0.65714216", "0.65416", "0.65416", "0.55718887", "0.55301964", "0.5365679", "0.5365679", "0.53418416", "0.5195671", "0.51646066", "0.51535314", "0.51535314", "0.51535314", "0.51535314", "0.51510835", "0.51510835", "0.5148742", "0.5133139", "0.5133139", "0.5133139", "0.5061293", "0.5051281", "0.5034891", "0.5024079", "0.5016718", "0.5016718", "0.5016718", "0.5016718", "0.5016718", "0.5016718", "0.5016718", "0.5016718", "0.5016718", "0.49537602", "0.49537602", "0.4940135", "0.4917868", "0.4906603", "0.4900642", "0.4899309", "0.4899309", "0.48963615", "0.48963615", "0.48931423", "0.4892404", "0.48675245", "0.4811341", "0.48037276", "0.48037276", "0.47735274", "0.47501817", "0.47440904", "0.47322255", "0.47213328", "0.47123867", "0.47093046", "0.46939933", "0.46609822", "0.46609822", "0.46602473", "0.46602473", "0.4646997", "0.46408206", "0.46280685", "0.46259847", "0.46242929", "0.4624135", "0.4613199", "0.4606227", "0.4606227", "0.4606227", "0.4606227", "0.4601995", "0.4601995", "0.46002772", "0.45920247", "0.45846745", "0.45700538", "0.45595643", "0.45595643", "0.4552049", "0.45502186", "0.4543661", "0.4542315", "0.4542315", "0.4542315", "0.4542315", "0.4542315", "0.4542315", "0.45338953" ]
0.68176234
5
Decode `value` (at `position`) into a string.
function decodeRaw(value, position, options) { return entities(value, xtend(options, { position: normalize(position), warning: handleWarning })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }", "function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }", "function decodeRaw(value, position, options) {\n return entities(\n value,\n xtend(options, {position: normalize(position), warning: handleWarning})\n )\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decodeValue (value, options) {\n return getValueEncoder(options).decode(value)\n}", "function decodeValue (value, options) {\n return getValueEncoder(options).decode(value)\n}", "function decodeValue(value) {\n if (value == null) {\n return null;\n }\n return value.replace(decodeLookupRegex, (m) => decodeMap[m] || \"\");\n}", "function at(position) {\n return value.charAt(position);\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "decodeValue(value) {\n return decodeURIComponent(value);\n }", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeStringToString(value) {\n return Buffer.from(value, \"base64\").toString();\n}", "function decodeString(value) {\n var byteString = atob(value);\n var arr = new Uint8Array(byteString.length);\n for (var i = 0; i < byteString.length; i++) {\n arr[i] = byteString.charCodeAt(i);\n }\n return arr;\n }", "function convert_value_to_string(value) {\n\t\tif (value > 10) {\n\t\t\tswitch (value) {\n\t\t\t\tcase 11:\n\t\t\t\treturn 'Jack';\n\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\treturn 'Queen';\n\t\t\t\tbreak;\n\t\t\t\tcase 13:\n\t\t\t\treturn 'King';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (value === 1) {\n\t\t\tswitch (value) {\n\t\t\t\tcase 1:\n\t\t\t\treturn 'Ace';\n\t\t\t}\n\t\t}\n\t\treturn value.toString();\n\t}", "function toString(value) {\r\n\tlet str = \"\";\r\n\tfor (a = 0; a < value.byteLength; a++) {\r\n\t\tstr += String.fromCharCode(value.getInt8(a));\r\n\t}\r\n\treturn str;\r\n}", "function convert_value_to_string(value) {\n\t\tif (value > 10) {\n\t\t\tswitch (value) {\n\t\t\t\tcase 11:\n\t\t\t\treturn 'Jack';\n\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\treturn 'Queen';\n\t\t\t\tbreak;\n\t\t\t\tcase 13:\n\t\t\t\treturn 'King';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn value.toString();\n\t}", "function convert_value_to_string(value) {\n\t\tif (value > 10) {\n\t\t\tswitch (value) {\n\t\t\t\tcase 11:\n\t\t\t\treturn 'Jack';\n\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\treturn 'Queen';\n\t\t\t\tbreak;\n\t\t\t\tcase 13:\n\t\t\t\treturn 'King';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn value.toString();\n\t}", "function stringRepresentation(value) {\n switch (value[0]) {\n case \"Num\": \n\treturn getNumValue(value);\n case \"Clo\":\n\treturn;\n }\n}", "function toggleAt(value, position){\n\tif (!value) { return ''; }\n\t\n\tvar index = value.length - position,\n\t\tnewChar = (value[index] == '0' ? '1' : '0'),\n\t\tnewValue = value.substring(0, index) + newChar + value.substring(index + 1);\t\n\treturn newValue;\n}", "function $value(value) {\n\t function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n\t function $replace(value) {\n\t var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n\t return replacement.length ? replacement[0] : value;\n\t }\n\t value = $replace(value);\n\t return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n\t }", "function decodeText(value, encoding) {\n\t\tif (encoding && encoding.trim().toLowerCase() == \"cp437\") {\n\t\t\treturn decodeCP437(value);\n\t\t} else {\n\t\t\treturn new TextDecoder(encoding).decode(value);\n\t\t}\n\t}", "function yellHTMLDecode(value) {\n var temp = document.createElement(\"div\");\n temp.innerHTML = value;\n var result = temp.childNodes[0].nodeValue;\n temp.removeChild(temp.firstChild);\n return result;\n}", "function decodeUrlValue(value) {\n try {\n return JSON.parse(value);\n } catch (e) {\n return value;\n }\n}", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function $value(value) {\n function hasReplaceVal(val) {\n return function (obj) {\n return obj.from === val;\n };\n }\n\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function (obj) {\n return obj.to;\n });\n return replacement.length ? replacement[0] : value;\n }\n\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function decode(value, length) {\n if (length === value.length && !decodable(value)) {\n return 0;\n }\n if (length === 0 || length === 1) {\n return 1;\n }\n var result = 0;\n if (parseInt(value[length - 1]) > 0) {\n result = decode(value, length - 1);\n }\n if (value[length - 2] === '1' ||\n (value[length - 2] === '2' && parseInt(value[length - 1]) < 7)) {\n result = result + decode(value, length - 2);\n }\n return result;\n}", "function toText(value) {\n if (hasValue(value) && !isString(value)) {\n if (isNumber(value)) {\n return castString(value);\n }\n else if (isObject(value)) {\n return value.toString();\n }\n }\n return value;\n}", "function packValue(value) {\n const result = memoizedMap.get(value);\n if (result == null) {\n if (value >= MIN_DICT_INDEX && value <= MAX_VERBATIM_INTEGER && Number.isInteger(value))\n return -value;\n \n memoize(value);\n \n if (typeof value === \"number\")\n return String(value);\n if (/^[0-9\\.]|^~/.test(value))\n return `~${value}`;\n return value;\n }\n return result;\n }", "function decodeString(s) {\n var index = 0\n return decodeHelper(s, index)\n}", "function deserializeValue(value) {\n try {\n return value\n ? value == 'true' ||\n (value == 'false'\n ? false\n : value == 'null'\n ? null\n : +value + '' == value\n ? +value\n : /^[\\[\\{]/.test(value)\n ? h.parseJSON(value)\n : value)\n : value;\n } catch (e) {\n return value;\n }\n }", "function mapFragment(p, isVal) {\n return decodeURIComponent(isVal | 0 ? p : p.replace('[]', ''));\n}", "function parseAsString(val, done) {\n if (!val && val!== 0) { return done(null, undefined); }\n done(null, String(val));\n}", "string() {\n let len = this.varint();\n this.throw_if_less_than(len);\n\n let utf8 = this.buffer.subarray(this.pos, this.pos + len);\n this.pos += len;\n let decoder = new TextDecoder(\"utf-8\");\n return decoder.decode(utf8);\n }", "function _toString(value)\n{\n if (typeof value == 'string')\n return value;\n var result = \"\";\n for (var i = 0; i < value.length; ++i)\n result += String.fromCharCode(value[i]);\n return result;\n}", "function toString(value) {\n\t switch (typeof value) {\n\t case 'number':\n\t return value + '';\n\t case 'string':\n\t return value;\n\t default:\n\t return JSON.stringify(value);\n\t }\n\t}", "function decryption(value) {\n var encryptedBytes = aesjs.utils.hex.toBytes(value);\n var aesCtr = new aesjs.ModeOfOperation.ctr(passKey, new aesjs.Counter(1));\n var decryptedBytes = aesCtr.decrypt(encryptedBytes);\n var decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes);\n return decryptedText;\n}", "function extract_string(mem, offset, len) {\n const buf = new Uint8Array(mem.buffer, offset, len);\n return str = new TextDecoder('utf8').decode(buf); \n}", "async readstr(pos) {\n\t\tlet readbytes = 1;\n\t\tlet p = await this.readbin(readbytes, pos, 'int8');\n\t\treturn this.readbin(p, pos + 1, 'str');\n\t}", "function castString(value) {\n if (typeof value === \"string\") {\n return value;\n }\n else if (typeof value === \"number\") {\n return \"\" + value;\n }\n else {\n throw new Error(\"Expected a string or number but got \" + getType(value));\n }\n}", "function _getFixedLengthValue(value, size) {\n\t\t\t//console.log(\"type=\"+typeof value+\", value=\"+JSON.stringify(value)+\", len=\"+value.length+\", size=\"+size);\n\t\t\tvar val = \"\" + value;\n\t\t\tvar res = val;\n\t\t\tif (typeof value === \"number\") {\n\t\t\t\t// right text align\n\t\t\t\tfor (var i = val.length; i < size; i++) {\n\t\t\t\t\tres = \" \" + res;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// left text align\n\t\t\t\tfor (var i = val.length; i < size; i++) {\n\t\t\t\t\tres += \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t}", "function caml_output_value_to_string (v, fl) {\n /* ignores flags... */\n return new MlStringFromArray (caml_output_val (v));\n}", "function parseValue(value) {\n value = decodeURIComponent(value);\n try {\n return JSON.parse(value);\n } catch(e) {\n return value;\n }\n }", "function decode(string){\n\n}", "function deserializeValue(value) {\n\t try {\n\t return value ? value == \"true\" || (value == \"false\" ? false : value == \"null\" ? null : +value + \"\" == value ? +value : /^[\\[\\{]/.test(value) ? $.parseJSON(value) : value) : value;\n\t } catch (e) {\n\t return value;\n\t }\n\t }", "getString() {\n let buf = new Uint8Array(this.buf).subarray(this.offset);\n\n\t\tlet byteArr = [];\n for (let byte of buf) {\n if (byte == 0)\n break;\n\n\t\t\tbyteArr.push(byte);\n }\n\t\tlet str = new TextDecoder(\"utf-8\").decode(new Uint8Array(byteArr));\n this.offset += byteArr.length+1;\n\n return str;\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function mountRawSequence ( value ) {\n var out = '';\n var isCep = validCepFormat( value );\n\n if ( isCep ) out = value.replace('-', '');\n\n return out;\n}", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n (value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value) : value\n } catch (e) {\n return value\n }\n }", "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "function valuetext(value) {\n return `${value}`;\n}", "emitNamedEntityData(result, valueLength, consumed) {\n const { decodeTree } = this;\n this.emitCodePoint(valueLength === 1\n ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH\n : decodeTree[result + 1], consumed);\n if (valueLength === 3) {\n // For multi-byte values, we need to emit the second byte.\n this.emitCodePoint(decodeTree[result + 2], consumed);\n }\n return consumed;\n }", "function parseItemValue(value) {\n\t\tparseItemValue.cache = parseItemValue.cache || {};\n\t\tif (value) {\n\t\t\tif (parseItemValue.cache[value]) {\n\t\t\t\treturn parseItemValue.cache[value];\n\t\t\t}\n\t\t\t\n\t\t\tvar val = parseInt(value);\n\t\t\tif (val) {\n\t\t\t\tvar copper = val % 10;\n\t\t\t\tvar silver = (val % 100 - copper) / 10;\n\t\t\t\tvar gold = (val - silver * 10 - copper) / 100;\n\t\t\t\t\n\t\t\t\tvar text = '';\n\t\t\t\tif (copper) {\n\t\t\t\t\ttext = '<span class=\"item-value-copper\">' + copper + '</span>';\n\t\t\t\t}\n\t\t\t\tif (silver) {\n\t\t\t\t\ttext = '<span class=\"item-value-silver\">' + silver + '</span> ' + text;\n\t\t\t\t}\n\t\t\t\tif (gold) {\n\t\t\t\t\ttext = '<span class=\"item-value-gold\">' + gold + '</span> ' + text;\n\t\t\t\t}\n\t\t\t\tparseItemValue.cache[value] = text;\n\t\t\t\treturn text;\n\t\t\t}\n\t\t}\t\n\t\treturn '';\n\t}", "function string(val) {\n return {value: val, type: 'string', size: Buffer.from(val, 'utf8').byteLength, unit: 8};\n}", "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "function deserializeValue( value ) {\n try {\n return value ? value == \"true\" || (value == \"false\" ? false : value == \"null\" ? null : +value + \"\" == value ? +value : /^[\\[\\{]/.test( value ) ? $.parseJSON( value ) : value) : value\n } catch ( e ) {\n return value\n }\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function displayValue(value) {\n if (typeof value === \"string\") {\n return quote(value);\n } else {\n return String(value);\n }\n}", "stringNT() {\n const end = this.buffer.indexOf(0, this.at);\n const out = this._utf8.decode(this.buffer.slice(this.at, end));\n this.at = end + 1;\n return out;\n }", "function getCookieVal(offset) {\n var endstr = document.cookie.indexOf(\";\", offset);\n if (endstr == -1) {\n endstr = document.cookie.length;\n }\n return unescape(document.cookie.substring(offset, endstr));\n }", "function toLua(value) {\n const json = JSON.stringify(value, null, 4);\n\n const s = json.replace(/\"(.+?)\":/g, '$1 =').replace(/-/g, '_');\n\n return s;\n}", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }", "function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }" ]
[ "0.6970498", "0.6970498", "0.67748314", "0.6491086", "0.6473212", "0.6473212", "0.6473212", "0.6473212", "0.6473212", "0.6473212", "0.6250951", "0.6250951", "0.611467", "0.60424435", "0.5989474", "0.5989474", "0.5989474", "0.5989474", "0.5969304", "0.5969304", "0.5969304", "0.5969304", "0.5969304", "0.58560187", "0.57369536", "0.57369536", "0.57369536", "0.57369536", "0.5730695", "0.5638682", "0.5483377", "0.5472342", "0.5472034", "0.5472034", "0.5438286", "0.5292884", "0.52711684", "0.5264242", "0.5261549", "0.52480257", "0.5242872", "0.5242872", "0.5242872", "0.5165201", "0.5141698", "0.5059449", "0.5021957", "0.49734858", "0.49682942", "0.49646813", "0.49615303", "0.4923272", "0.4910645", "0.49106017", "0.48455885", "0.48361322", "0.47924834", "0.47897026", "0.4786616", "0.47733775", "0.4770623", "0.47177398", "0.46924782", "0.46831354", "0.46791407", "0.46791407", "0.46791407", "0.46791407", "0.46791407", "0.46791407", "0.46791407", "0.46791407", "0.46791407", "0.46791407", "0.46791407", "0.46791407", "0.46791407", "0.4672064", "0.46652162", "0.46501803", "0.46422487", "0.4627394", "0.4621574", "0.46152258", "0.4607397", "0.4607397", "0.4607305", "0.45952848", "0.45950058", "0.45791194", "0.4564841", "0.45512232", "0.4548594", "0.4548594", "0.4548594", "0.4548594", "0.4548594" ]
0.690921
4
Check if the given character code, or the character code at the first character, is hexadecimal.
function hexadecimal(character) { var code = typeof character === 'string' ? character.charCodeAt(0) : character return ( (code >= 97 /* a */ && code <= 102) /* z */ || (code >= 65 /* A */ && code <= 70) /* Z */ || (code >= 48 /* A */ && code <= 57) /* Z */ ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isHexDigit(code) {\n return (\n isDigit(code) || // 0 .. 9\n (code >= 0x0041 && code <= 0x0046) || // A .. F\n (code >= 0x0061 && code <= 0x0066) // a .. f\n );\n}", "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 97 /* a */ && code <= 102 /* z */ || code >= 65 /* A */ && code <= 70 /* Z */ || code >= 48 /* A */ && code <= 57 /* Z */;\n}", "function isHexDigit(c){\r\n return /^[0-9A-Fa-f]$/.test(c);\r\n}", "function checkHex(code){\r\n\t\tvar result = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(code);\r\n\t\treturn result;\r\n\t}", "function isHex(num)\r\n{\r\n\treturn /^[0-9a-fA-f]+$/.test(num);\r\n}", "function isHex(s) {\n return /^0x[0-9a-f]+$/i.test(s);\n}", "function seemsHex(maybeHex) {\n return maybeHex.startsWith('0x');\n}", "function isHex(hex) {\n return HEX_REGEX.test(hex);\n}", "function charIsHexDigit(charCode)\n{\n return (\n (charCode >= 48 && charCode <= 57) || // 0-9\n (charCode >= 97 && charCode <= 122) || // a-z\n (charCode >= 64 && charCode <= 90) // A-Z\n );\n}", "function validHex(t) {\n for (var i = 0; i < t.length; i++) {\n var c = t.charAt(i);\n if (!((c >= 'a' && c <= 'f') || (c >= '0' && c <= '9'))) {\n return false;\n }\n }\n return true;\n}", "function check_hex(inp){\n\n var hexPatt = /^#[0-9A-F]{6}$/i; \n if(hexPatt.test(inp)){\n alert(\"Correct HEXCOLOR code\");\n }\n else{\n alert(\"Incorrect HEXCOLOR code\");\n }\n}", "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "isHex(input) {\n var _a;\n const hexRegEx = /(?:[0-9]|[a-f])/gimu;\n return ((_a = input.match(hexRegEx)) !== null && _a !== void 0 ? _a : []).length === input.length;\n }", "function validateHex(input) {\n return /^#[0-9A-F]{6}$/i.test(input.toUpperCase());\n}", "function checkIfHex(input) {\n const hexReg = /(^#[0-9A-Fa-f]{6}$)|(^#[0-9A-Fa-f]{3}$)/gi;\n if (hexReg.test(input.value)) {\n return true;\n }\n return false;\n}", "function isHex(val) {\n if (typeof val !== \"string\") val = val.toString(16)\n return (val.trim()[0] === \"#\" || (val.trim()[0] + val.trim()[1]) === \"0x\" || typeof val === \"number\") ?\n (val = val.replace(\"#\", \"\").replace(\"0x\", \"\"), (val.trim().length === 6 || val.trim().length === 8)) : false\n}", "function needsHexEscape(character) {\n\t return !((0x00020 <= character && character <= 0x00007E) ||\n\t (character === 0x00085) ||\n\t (0x000A0 <= character && character <= 0x00D7FF) ||\n\t (0x0E000 <= character && character <= 0x00FFFD) ||\n\t (0x10000 <= character && character <= 0x10FFFF));\n\t}", "function check_hex(){\n\n var hex=prompt(\"Enter HexCode: \");\n var hexPattern = /^#[0-9A-F]{6}$/i; //regex for hex code color match\n if(hexPattern.test(hex)){\n alert(\"Correct HEX code\");\n }\n else{\n alert(\"Incorrect HEX code\");\n }\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "function isHexaColor(sNum) {\n return (typeof sNum === \"string\") && sNum.length === 6\n && !isNaN(parseInt(sNum, 16));\n}", "function checkHex (str) {\n\t\tvar i, k;\n\t\tif (str.length%2) {\n\t\t\treturn convert(str);\n\t\t} else {\n\t\t\tk = false;\n\t\t\tfor (i=0;i<str.length;i+=2) {\n\t\t\t\tif (isNaN(parseInt(str.substr(i,1), 16))) { k = true; }\n\t\t\t\tif (isNaN(parseInt(str.substr(i+1,1), 16))) { k = true; }\n\t\t\t}\n\t\t\tif (k) { return convert(str); }\n\t\t\treturn str;\n\t\t}\n\t\tfunction convert (chars) {\n\t\t\tvar i, hex = \"\";\n\t\t\tfor (i=0;i<str.length;i++) {\n\t\t\t\thex += str.charCodeAt(i).toString(16);\n\t\t\t}\n\t\t\treturn hex;\n\t\t}\n\t\treturn hex;\n\t}", "function is_hexdigit(str)\n{\n\tif (str.length==0) return false;\n\tfor (var i=0;i < str.length;i++)\n\t{\n\t\tif (str.charAt(i) <= '9' && str.charAt(i) >= '0') continue;\n\t\tif (str.charAt(i) <= 'F' && str.charAt(i) >= 'A') continue;\n\t\tif (str.charAt(i) <= 'f' && str.charAt(i) >= 'a') continue;\n\t\treturn false;\n\t}\n\treturn true;\n}", "function isASCIIDigit(c) {\n return c >= 0x30 && c <= 0x39;\n}", "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n }", "function isValidHex(hex) {\n var isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex);\n return isOk;\n}", "function isValidHex(hex) {\n var isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex);\n return isOk;\n}", "function readHexDigit(code) {\n return code >= 0x0030 && code <= 0x0039 // 0-9\n ? code - 0x0030\n : code >= 0x0041 && code <= 0x0046 // A-F\n ? code - 0x0037\n : code >= 0x0061 && code <= 0x0066 // a-f\n ? code - 0x0057\n : -1;\n}", "function isChar(c) {\n return (c >= 0x0001 && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function isHexColor(color) {\n return string.regex(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/)(color)\n}", "function isChar (code) {\n\t// http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes\n\treturn code === 32 || (code > 46 && !(code >= 91 && code <= 123) && code !== 144 && code !== 145);\n}", "function isValidHexColor(t) {\n return item => {\n var hash = hashbow(item);\n t.is(typeof hash, 'string');\n t.is(hash.charAt(0), '#');\n t.is(hash.length, 7);\n };\n}", "function isValidHexColor(hexColor) {\n hexColor = hexColor.substr(1);\n var isValid = hexColor.length === 6\n && !isNaN(parseInt(hexColor, 16));\n\n return isValid;\n }", "function validHex(col) {\n if (col) {\n if (typeof col === 'string') {\n if (col[0] === '#') {\n if (col.length === 4 || col.length === 7) {\n for (var i = 1; i < col.length; i++) {\n var num = parseInt(col[i], 16);\n if (isNaN(num)) {\n return false;\n }\n }\n return true;\n }\n }\n }\n }\n return false;\n}", "function readHexChar (len) {\r\n const start = acornPos;\r\n let total = 0, lastCode = 0;\r\n for (let i = 0; i < len; ++i, ++acornPos) {\r\n let code = source.charCodeAt(acornPos), val;\r\n\r\n if (code === 95) {\r\n if (lastCode === 95 || i === 0) syntaxError();\r\n lastCode = code;\r\n continue;\r\n }\r\n\r\n if (code >= 97) val = code - 97 + 10; // a\r\n else if (code >= 65) val = code - 65 + 10; // A\r\n else if (code >= 48 && code <= 57) val = code - 48; // 0-9\r\n else break;\r\n if (val >= 16) break;\r\n lastCode = code;\r\n total = total * 16 + val;\r\n }\r\n\r\n if (lastCode === 95 || acornPos - start !== len) syntaxError();\r\n\r\n return total;\r\n }", "function validateHexadecimal(hex) {\n const hexNo = isValidStr(hex);\n if (!hexNo) return false;\n\n if (/[^0123456789abcdef]/g.test(hexNo)) return false;\n return hexNo;\n}", "function validateSingleChar(str) {\r\n if (str.length === 0) {\r\n return false;\r\n }\r\n var firstChar = str.charCodeAt(0);\r\n if (str.length === 1) {\r\n return (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD));\r\n }\r\n if (str.length !== 2) {\r\n return false;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(1);\r\n return ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF));\r\n}", "function testIsHexNumber(){\n\t\tvar StringUtils = LanguageModule.StringUtils;\n\t\tvar stringUtils = new StringUtils();\n\t\tvar encodings = stringUtils.stringEncodings;\n\t\t\n\t\t// Get the hex number\n\t\tvar hexSequenceTest1 = stringUtils.isHexNumber(\"abcdef\", encodings.ASCII);\n\t\tvar hexSequenceTest2 = stringUtils.isHexNumber(\"ABCDEF\", encodings.ASCII);\n\t\tvar hexSequenceTest3 = stringUtils.isHexNumber(\"0123456789\", encodings.ASCII);\n\t\tvar hexSequenceTest4 = stringUtils.isHexNumber(\"g\", encodings.ASCII);\n\t\tvar hexSequenceTest5 = stringUtils.isHexNumber(\"G\", encodings.ASCII);\n\t\texpect(hexSequenceTest1).to.eql(true);\n\t\texpect(hexSequenceTest2).to.eql(true);\n\t\texpect(hexSequenceTest3).to.eql(true);\n\t\texpect(hexSequenceTest4).to.eql(false);\n\t\texpect(hexSequenceTest5).to.eql(false);\n\t}", "function isHexString(value, length) {\n if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n\n if (length && value.length !== 2 + 2 * length) {\n return false;\n }\n\n return true;\n}", "async function checkHex(input, hexBool){\n console.log(\"HEX BOOL\" + hexBool);\n //console.log(input);\n //console.log(referer);\n let ORIGINALINPUT = input;\n try{\n if(typeof ORIGINALINPUT === \"string\"){\n //console.log(\"reached\");\n //Remove all non-needed characters\n //var ASCIIONLY = ORIGINALINPUT.replace(/[^\\x00-\\x7F]/g, \"\");\n //console.log(\"ASCIIONLY\" + ASCIIONLY);\n // Only Allow alpha numeric. A-F in accourandence with HEX, 0-9. Also removes the hash mark.\n var cleanedInput = ORIGINALINPUT.replace(/[^0-9A-Fa-f]/gi, \"\");\n console.log(\"cleanedInput\" + cleanedInput);\n\n //console.log(cleanedInput);\n // Check if the string is 7 characters\n if(cleanedInput.length==6 && ORIGINALINPUT[0] ===\"#\"){\n // console.log(\"correct length\");\n //check if first character is a pound symbke\n return [true, cleanedInput, hexBool];\n }\n else{\n return [false, '', false];\n }\n }\n else{\n return [false, '', false]; \n }\n return [false, '', false];\n }\n \n catch{\n return [false, '', false];\n }\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}", "function hexVal (c) {\n return (\n c < 58 ? c - 48 : // 0 - 9\n c < 71 ? c - 55 : // A - F\n c - 87 // a - f\n );\n}", "static getAHexCharacter() {\n const characters = [\n '0', '1', '2', '3',\n '4', '5', '6', '7',\n '8', '9', 'A', 'B',\n 'C', 'D', 'E', 'F',\n ];\n\n const randomNumber = this.generateRandomNumber(characters.length);\n\n return characters[randomNumber];\n }", "function isColorCode( fieldValue ) {\r\n\tvar checkOK = \"#0123456789ABCDEFabcdef\";\r\n\tvar checkStr = fieldValue;\r\n\tvar allValid = true;\r\n\tvar allNum = \"\";\r\n\r\n\tfor (i = 0; i < checkStr.length; i++)\r\n\t{\r\n\t\tch = checkStr.charAt(i);\r\n\r\n\t\tfor (j = 0; j < checkOK.length; j++)\r\n\t\t\tif (ch == checkOK.charAt(j))\r\n\t\t\t\tbreak;\r\n\r\n\t\tif (j == checkOK.length)\r\n\t\t{\r\n\t\t\tallValid = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif (ch != \",\")\r\n\t\t\tallNum += ch;\r\n\t}\r\n\r\n\t// now check length and that only first letter is # symbol\r\n\tif ( fieldValue.length != 7 || fieldValue.lastIndexOf( '#' ) != 0 )\r\n\t\tallValid = false;\r\n\r\n\treturn allValid;\r\n}", "function isHexadecimal(value) {\n return typeof value === 'string' && validator_lib_isHexadecimal__WEBPACK_IMPORTED_MODULE_1___default()(value);\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 : // 0-9\n a >= 65 && a <= 70 ? a - 55 : // A-F\n a >= 97 && a <= 102 ? a - 87 : // a-f\n -1;\n}", "function validateHex(input) {\n let $fieldset = $(input).parent('fieldset');\n $fieldset.removeClass(\"valid\");\n $fieldset.removeClass(\"invalid\");\n let inputText = input.val();\n if ((/^(#[A-Fa-f0-9]{6}|#[A-Fa-f0-9]{3}|transparent)$/i).test(inputText)) {\n $fieldset.addClass(\"valid\");\n return true;\n } else {\n $fieldset.addClass(\"invalid\");\n return false;\n }\n }", "function is32BitHex(testVal){\n\t\tvar testString = String(testVal).toLowerCase();\n\t\tif(testString.match(/^(0x)?[0-9a-f]{8}$/)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function isHexColor(value) {\n return typeof value === 'string' && validator_lib_isHexColor__WEBPACK_IMPORTED_MODULE_1___default()(value);\n}", "function validateChar(str) {\r\n for (var i = 0; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD)) {\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n return false;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n i++;\r\n continue;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}", "function isHexStrict(hex) {\n return /^(-)?[0-9a-f]*$/i.test(hex);\n}", "function char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n }", "function isValidColor(text) {\n return hexColorRegEx.test(text);\n}", "function in_hex() {\n let backend = entrada_selecionada();\n let s = NaN;\n do {\n s = parseInt(prompt(\"Insira uma word de quatro nibbles como 00A0 ou F0DA.\",\n \"0000\"), 16);\n } while (isNaN(s));\n backend.inserir(s);\n update_entrada();\n}", "function char2hex(a) {\n\t return a >= 48 && a <= 57 ? a - 48 // 0-9\n\t : a >= 65 && a <= 70 ? a - 55 // A-F\n\t : a >= 97 && a <= 102 ? a - 87 // a-f\n\t : -1;\n\t}", "function isNonAscii(code) {\n return code >= 0x0080;\n}", "function char2hex(a) {\n\t return a >= 48 && a <= 57 ? a - 48 : // 0-9\n\t a >= 65 && a <= 70 ? a - 55 : // A-F\n\t a >= 97 && a <= 102 ? a - 87 : // a-f\n\t -1;\n\t}", "function char2hex(a) {\n\t return a >= 48 && a <= 57 ? a - 48 : // 0-9\n\t a >= 65 && a <= 70 ? a - 55 : // A-F\n\t a >= 97 && a <= 102 ? a - 87 : // a-f\n\t -1;\n\t}", "function isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code < 91) return true;\n if (code < 97) return code === 95;\n if (code < 123) return true;\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}", "function isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code < 91) return true;\n if (code < 97) return code === 95;\n if (code < 123) return true;\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}", "function isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code < 91) return true;\n if (code < 97) return code === 95;\n if (code < 123) return true;\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}", "function isIdentifierChar(code) {\n\t if (code < 48) return code === 36;\n\t if (code < 58) return true;\n\t if (code < 65) return false;\n\t if (code < 91) return true;\n\t if (code < 97) return code === 95;\n\t if (code < 123) return true;\n\t if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n\t return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n\t}" ]
[ "0.7582988", "0.7505748", "0.75000715", "0.742736", "0.7207336", "0.7128968", "0.70687914", "0.7053852", "0.7018759", "0.7012731", "0.7010884", "0.7001609", "0.6998167", "0.6945509", "0.6937618", "0.6935108", "0.6926119", "0.6874406", "0.67849517", "0.67849517", "0.67849517", "0.67849517", "0.67849517", "0.67849517", "0.67849517", "0.67849517", "0.67715824", "0.6735017", "0.6729161", "0.6637937", "0.66325843", "0.65952253", "0.65952253", "0.6514074", "0.6512907", "0.64950895", "0.6466563", "0.6450543", "0.6414503", "0.63819855", "0.63071436", "0.62809855", "0.6263111", "0.6214364", "0.62029755", "0.61920214", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.6147374", "0.61254954", "0.61230934", "0.6110683", "0.6103895", "0.61036164", "0.61036164", "0.61036164", "0.61036164", "0.61036164", "0.61036164", "0.61036164", "0.6090796", "0.60822016", "0.6073118", "0.6056419", "0.6011491", "0.6010352", "0.59946287", "0.59718347", "0.59570557", "0.5946911", "0.5946026", "0.5946026", "0.5918839", "0.5918839", "0.5918839", "0.5884065" ]
0.7386119
8
Check if the given character code, or the character code at the first character, is alphanumerical.
function alphanumerical(character) { return alphabetical(character) || decimal(character) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_alphanum(str) {\n let curr_char\n for (let i = 0; i < str.length; i ++) {\n curr_char = str.charCodeAt(i)\n if (!(curr_char == 95 || curr_char == 46) &&\n !(curr_char > 47 && curr_char < 58) &&\n !(curr_char > 64 && curr_char < 91) &&\n !(curr_char > 96 && curr_char < 123)) {\n return false\n }\n }\n return true\n}", "function isAlnum_Original(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum_(char) {\n return char >= 'A' && char <= 'Z'\n || char >= 'a' && char <= 'z' \n || isDigit_(char);\n}", "function isAlphanumeric(string) {\n\treturn isAlphanumeric1(string, false);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' || char == '_' ||\n isDigit(char);\n}", "function isAlnum_(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit_(char);\n}", "function isAlphabet(x){\n var as = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n return (as.indexOf(x) != -1);\n}", "function isAlpha(c){\r\n return /^\\w$/.test(c) && /^\\D$/.test(c);\r\n}", "function isLetter(code) {\n return (\n (code >= 0x0061 && code <= 0x007a) || // A-Z\n (code >= 0x0041 && code <= 0x005a) // a-z\n );\n}", "function alphanumeric(str) {\n return str.match(/^[a-zA-Z0-9]*$/) !== null;\n}", "function isAlpha(aChar)\n{\n myCharCode = aChar.charCodeAt(0);\n \n if(((myCharCode > 64) && (myCharCode < 91)) ||\n ((myCharCode > 96) && (myCharCode < 123)))\n {\n return true;\n }\n \n return false;\n}", "function isLetterOrDigit(char) {\n return \"abcdefghijklmnopqrstuvwxyz0123456789\".indexOf(char) >= 0;\n }", "function isAlphaNumeric(char){\n let code = char.charCodeAt(0);\n if(!(code > 47 && code < 58) &&\n !(code > 64 && code < 91) &&\n !(code > 96 && code < 123)){\n return false;\n }\n return true;\n}", "function isAlphabetCharacter(letter) {\n return (letter.length === 1) && /[a-z]/i.test(letter);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlphaNum(c){\r\n return /^\\w$/.test(c);\r\n}", "function isAlpha(aChar) {\n myCharCode = aChar.charCodeAt(0);\n\n if (((myCharCode > 64) && (myCharCode < 91)) ||\n ((myCharCode > 96) && (myCharCode < 123))) {\n return true;\n }\n\n return false;\n}", "function isAlphaNumeric(char) {\n var code = char.charCodeAt(0);\n if (!(code > 47 && code < 58) && !(code > 64 && code < 91) && !(code > 96 && code < 123)) {\n return false;\n }\n return true;\n}", "function isChar (code) {\n\t// http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes\n\treturn code === 32 || (code > 46 && !(code >= 91 && code <= 123) && code !== 144 && code !== 145);\n}", "function isLetter(c) {\n\treturn isUppercase(c) || isLowercase(c) || c==32;\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' ||\n isDigit(char);\n}", "function isAlphaNumeric(char) {\n var code = char.charCodeAt(0);\n if (!(code > 47 && code < 58) &&\n !(code > 64 && code < 91) &&\n !(code > 96 && code < 123)) {\n return false\n }\n return true\n}", "function isLetter(code) {\n return isUppercaseLetter(code) || isLowercaseLetter(code);\n}", "function isDigitOrAlphabetChar(c) {\nreturn ((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z'));\n}", "function alphanumeric(alphane)\n{\n\tvar numaric = alphane;\n\tif(numaric=='')\n\t\treturn false;\n\t\n\tfor(var j=0; j<numaric.length; j++)\n\t{\n\t\t var alphaa = numaric.charAt(j);\n\t\t var hh = alphaa.charCodeAt(0);\n\t\t if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))\n\t\t {\n\t\t }\n\t\t else\n\t\t {\n //alert(\"Your Alpha Numeric Test Failed\");\n\t\t\t return false;\n\t\t }\n \t}\n //alert(\"Your Alpha Numeric Test Passed\");\n return true;\n}", "function areValidChars(char){\n for(var i=0; i<char.length; i++){\n if(alphabet.indexOf(char[i]) == -1 && char[i] != '_' && char[i] != '\\\\'){\n return char[i];\n }\n }\n return true;\n}", "function areCharsOrLetters(theString) {\n var regSpecialChar = /[`!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?~]/\n var isChar = regSpecialChar.test(theString)\n var isLetter = theString.match(/[a-z]/i)\n if (isChar != false && isLetter != null) {\n return true\n } else if (isLetter != null) {\n return true\n } else if (isChar != false) {\n return true\n } else {\n return false\n }\n}", "function isAlphaNumeric(char) {\n let code = char.charCodeAt(0);\n if ( !(code > 47 && code < 58) && // numeric(1-9)\n !(code > 64 && code < 91) && // uppercase alphabets(A-Z)\n !(code > 96 && code < 123)) { // lowercase alphabets(a-z)\n return false;\n }\n return true;\n}", "function isAlpha(text) {\n\t\tif (text.length === 1) {\n\t\t\tif (alphabet.indexOf(text) !== false)\n\t\t\t\treturn true;\n\t\t} return false;\n\t}", "function isAlphaNumeric(char) {\n let code = char.charCodeAt(0);\n if(!(code > 47 && code < 58) && //numeric (0-9)\n !(code > 64 && code < 91) && //upper alpha (A-Z)\n !(code > 96 && code < 123)) { //lower alpha (a-z)\n return false\n }\n return true\n}", "function isAlphabet(str) {\n var code, i, len;\n\n for (i = 0, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if (\n !(code > 64 && code < 91) && // upper alpha (A-Z)\n !(code > 96 && code < 123)\n ) {\n // lower alpha (a-z)\n return false;\n }\n }\n return true;\n}", "function isLetter(char) {\r\n return char.match(/[a-z]/i);\r\n}", "function isalphanumeric(str)\r\n{\r\n\tvar bReturn = true;\r\n\tvar valid=\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-\";\r\n\tvar invalidfirst = \"_-\";\r\n\tvar invalidlast = \"_-\";\r\n\tfor (var i=0; i<str.length; i++) \r\n\t{\r\n\t\tif ( i == 0 && (invalidfirst.indexOf(str.charAt(i)) > 0))\r\n\t\t{\r\n\t\t\tbReturn = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\telse if ( i == (str.length-1) && (invalidlast.indexOf(str.charAt(i)) > 0))\r\n\t\t{\r\n\t\t\tbReturn = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\telse if (valid.indexOf(str.charAt(i)) < 0)\r\n\t\t{\r\n\t\t\tbReturn = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn(bReturn);\r\n}", "function isAlphabeticString(string) {\n var isNotEmpty = !isEmpty(string);\n var doesNotContainDigits = !CONTAINS_DIGIT_REGEX.test(string);\n var doesNotContainInvalidChars = !/[\\{\\}\\(\\)_\\$#\"'@\\|!\\?\\+\\*%<>/]/.test(string);\n return isNotEmpty && doesNotContainDigits && doesNotContainInvalidChars;\n}", "function isLetter(char){\n\treturn char.match(/[a-z]/i);\n}", "function isAlnum(ch) {\n if ((ch >= \"a\" && ch <= \"z\") || (ch == \"&\") || (ch >= \"A\" && ch <= \"Z\") || (ch >= \"0\" && ch <=\"9\")) {\n return true;\n } else {\n return false;\n }\n}", "function isAsciiCodeAlphabet(charCode) {\n let isUpper = (charCode >= UPPER_A_CODE &&\n charCode <= UPPER_Z_CODE);\n\n let isLower = (charCode >= LOWER_A_CODE &&\n charCode <= LOWER_Z_CODE);\n\n return (isUpper || isLower);\n}", "function isAlphaNum(code) {\n return (code >= 0x30 /* 0 */ && code <= 0x39 /* 9 */) ||\n (code >= 0x41 /* A */ && code <= 0x5A /* Z */) ||\n (code >= 0x61 /* a */ && code <= 0x7A /* z */);\n}", "function isAlphaNum(code) {\n return (code >= 0x30 /* 0 */ && code <= 0x39 /* 9 */) ||\n (code >= 0x41 /* A */ && code <= 0x5A /* Z */) ||\n (code >= 0x61 /* a */ && code <= 0x7A /* z */);\n}", "function isAlphaNum(code) {\n return (code >= 0x30 /* 0 */ && code <= 0x39 /* 9 */) ||\n (code >= 0x41 /* A */ && code <= 0x5A /* Z */) ||\n (code >= 0x61 /* a */ && code <= 0x7A /* z */);\n }", "function isAlphanumeric(unsafeText) {\n var regex = /^[a-z0-9-_\\/&\\?=;]+$/i;\n return regex.test(unsafeText);\n}", "function isalpha(char) {\n return /^[A-Z]$/i.test(char);\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 97 && code <= 122 /* a-z */ || code >= 65 && code <= 90 /* A-Z */;\n}", "function isLetter(char) {\n const alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n return alphabet.includes(char);\n }", "function alphanumeric(str){\n var regex1 = /\\w/g\n var regex2 = /[^a-zA-Z0-9]/g\n if (str.match(regex2)){\n return false\n } \n else return regex1.test(str)\n \n \n }", "function sc_isCharAlphabetic(c)\n { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||\n\t sc_isCharOfClass(c.val, SC_UPPER_CLASS); }", "valid(c) { return Character.isAlphabetic(c) || c=='+'||c=='/' }", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(ch) {\n if (ch.match(/[a-zA-Z]/i)) {\n return true;\n } else {\n return false;\n }\n}", "function alphanumeric(inputtxt) {\n var letterNumber = /^[0-9a-zA-Z]+$/;\n if(inputtxt.match(letterNumber)){\n return true;\n } else { \n return false; \n }\n}", "function isNotAlphabets(str)\n{\n\tfor (var i = 0; i < str.length; i++)\n\t{\n\t\tvar ch = str.substring(i, i + 1);\n\t\tif((ch < \"a\" || \"z\" < ch) && (ch < \"A\" || \"Z\" < ch)) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function valid_alphabhet(alphabet) {\n var pola = new RegExp(/^[a-z A-Z]+$/);\n return pola.test(alphabet);\n }", "function isAlpha(characters) {\n return /^[A-Z ]*$/.test(characters);\n}", "function isLetter(str) {\r\n\tvar re = /[^a-zA-Z]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isLetter (c)\r\n{ return ( ((c >= \"a\") && (c <= \"z\")) || ((c >= \"A\") && (c <= \"Z\")) )\r\n}", "function isLetter (c)\r\n{ return ( ((c >= \"a\") && (c <= \"z\")) || ((c >= \"A\") && (c <= \"Z\")) )\r\n}", "function isLetterOrDigit (c)\r\n{ return (isLetter(c) || isDigit(c))\r\n}", "function isLetterOrDigit (c)\r\n{ return (isLetter(c) || isDigit(c))\r\n}", "function checkString( text ) {\n\tvar str= text.value.toString();\n\tvar len=str.length;\n\tvar check = true;\n\tvar err = \"\";\n\tfor(var i=0; i<len; i++)\n\t{\n\t\tif(! ( (str.charAt(i)>='a' && str.charAt(i)<='z') || (str.charAt(i)>='A' && str.charAt(i)<='Z') || str.charAt(i)==' ' ) )\n\t\t{\n\t\t\tcheck= false;\n\t\t}\n\t}\n\tif( check == false)\n\t{\n\t\t\terr=\"Only Alphabets Allowed\";\n\t\t} else {\n\t\t\terr=\"\";\n\t\t}\n\treturn err;\n}", "function isAlphanumeric (s)\r\n\r\n{ var i;\r\n\r\n if (isEmpty(s))\r\n if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;\r\n else return (isAlphanumeric.arguments[1] == true);\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-alphanumeric character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character is number or letter.\r\n var c = s.charAt(i);\r\n\r\n if (! (isLetter(c) || isDigit(c) ) )\r\n return false;\r\n }\r\n\r\n // All characters are numbers or letters.\r\n return true;\r\n}", "function isAlphanumeric (s)\r\n\r\n{ var i;\r\n\r\n if (isEmpty(s))\r\n if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;\r\n else return (isAlphanumeric.arguments[1] == true);\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-alphanumeric character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character is number or letter.\r\n var c = s.charAt(i);\r\n\r\n if (! (isLetter(c) || isDigit(c) ) )\r\n return false;\r\n }\r\n\r\n // All characters are numbers or letters.\r\n return true;\r\n}", "function isAlNum(str)\n {\n var letterNumber = /^[0-9a-zA-Z]+$/;\n if( str.match(letterNumber) )\n return true;\n return false;\n }", "function onlyLetters(input) {\n\tinput = input.toUpperCase();\n\tfor (var i = 0; i < input.length; i++) {\n\t\tif (input[i] > 'Z' || input[i] < 'A')\n\t\t\treturn false\n\t}\n\treturn true;\n}", "function isLowerCaseAlphaKey(charCode) {\n return (charCode >= 97 && charCode <= 122);\n }", "function isLetter(str) {\r\n\tif (str.length === 1 && str.match(/[a-z]/i)) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "function ValidateAlphanumeric(alphanumeric) {\n var myRegEx = /[^a-z\\d]/i;\n var isValid = !(myRegEx.test(alphanumeric));\n return isValid;\n}", "function isAlphaNumericCharacter(character) {\n var characterCode = character.charCodeAt(0);\n return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ ||\n (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ ||\n (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */);\n }", "function isAlpha (ch){\n return /^[A-Z]$/i.test(ch);\n }", "function isAlpha (ch){\n return /^[A-Z]$/i.test(ch);\n }", "function isValidalphanumeric(name) {\n var alphaExp = /^([a-zA-Z0-9 ]+)$/;\n if (name.match(alphaExp))\n return true;\n else\n return false;\n}", "function isAlphaNum(code) {\n\t return (code >= 0x30 /* 0 */ && code <= 0x39 /* 9 */) ||\n\t (code >= 0x41 /* A */ && code <= 0x5A /* Z */) ||\n\t (code >= 0x61 /* a */ && code <= 0x7A /* z */);\n\t}", "function alphanumerical(character) {\n return alphabetical(character) || decimal(character);\n}", "function isAlphabetic(string) {\n\treturn isAlphabetic1(string, true);\n}", "function isAlpha(str) {\n var code = void 0,\n i = void 0,\n len = void 0;\n for (i = 0, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if (!(code > 64 && code < 91) && // upper alpha (A-Z)\n !(code > 96 && code < 123)) {\n // lower alpha (a-z)\n return false;\n }\n }\n return true;\n}", "function containsOnlyLetters(input)\n{\n\treturn /^[a-zA-Z]/.test(input.replace(/\\s/g, ''));\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}", "function isLetterAndNumeric(str) {\r\n\tvar re = /[^a-zA-Z0-9-]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isLetters(input){\n for(let i = 0; i < input.length; i++){\n if(input.charAt(i) < 10){\n return false;\n break;\n }\n }\n }", "function isLetter(input){\n return /^[a-zA-Z()]*$/.test(input);\n}", "function isIdentifierChar(code) {\n\t if (code < 48) return code === 36;\n\t if (code < 58) return true;\n\t if (code < 65) return false;\n\t if (code < 91) return true;\n\t if (code < 97) return code === 95;\n\t if (code < 123) return true;\n\t if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n\t return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n\t}" ]
[ "0.8023756", "0.7737026", "0.75667596", "0.7555502", "0.75216365", "0.7503981", "0.7494961", "0.74834013", "0.74418956", "0.7439725", "0.7439123", "0.7418856", "0.7418002", "0.7370794", "0.736314", "0.7352303", "0.7349926", "0.7342892", "0.73375565", "0.73345226", "0.7322956", "0.7322956", "0.7322956", "0.7322956", "0.7322956", "0.7322956", "0.7322956", "0.7319244", "0.73118776", "0.73118025", "0.72746426", "0.7274622", "0.7263032", "0.72241384", "0.72179425", "0.7208976", "0.72056454", "0.7199048", "0.7196097", "0.7184437", "0.71785647", "0.7173594", "0.717314", "0.71628916", "0.71628916", "0.71325296", "0.7128614", "0.71249324", "0.7124837", "0.7118734", "0.7106405", "0.70890945", "0.7076631", "0.7073954", "0.7073954", "0.7070253", "0.7066245", "0.7063638", "0.7063609", "0.7060346", "0.7038545", "0.7035647", "0.7031041", "0.7031041", "0.7024457", "0.7024457", "0.70197207", "0.701785", "0.701785", "0.70075643", "0.7007103", "0.7006915", "0.699949", "0.69991046", "0.6985895", "0.6985629", "0.69804084", "0.69793206", "0.6965949", "0.6960414", "0.6956436", "0.6948051", "0.69475925", "0.69371605", "0.69371605", "0.69371605", "0.69371605", "0.69371605", "0.69371605", "0.69371605", "0.6931981", "0.69279444", "0.6904404", "0.690126" ]
0.6999279
79
Check whether a node is mergeable with adjacent nodes.
function mergeable(node) { var start; var end; if (node.type !== 'text' || !node.position) { return true; } start = node.position.start; end = node.position.end; /* Only merge nodes which occupy the same size as their * `value`. */ return start.line !== end.line || end.column - start.column === node.value.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeable(node) {\n var start\n var end\n\n if (node.type !== 'text' || !node.position) {\n return true\n }\n\n start = node.position.start\n end = node.position.end\n\n // Only merge nodes which occupy the same size as their `value`.\n return (\n start.line !== end.line || end.column - start.column === node.value.length\n )\n}", "_mergePossible( edge ) {\n\n\t\tconst polygon = edge.polygon;\n\t\tlet currentEdge = edge.twin;\n\n\t\tdo {\n\n\t\t\t// we can only use an edge to merge two regions if the adjacent region does not have any edges\n\t\t\t// apart from edge.twin already connected to the region.\n\n\t\t\tif ( currentEdge !== edge.twin && currentEdge.twin.polygon === polygon ) return false;\n\n\t\t\tcurrentEdge = currentEdge.next;\n\n\t\t} while ( edge.twin !== currentEdge );\n\n\t\treturn true;\n\n\t}", "isNodeOrChildOf(otherNode) {\n let current = this;\n while (current) {\n if (current === otherNode) {\n return true;\n }\n current = current.parent;\n }\n return false;\n }", "hasEdge(node1, node2) {\n const list = this.lists[node1];\n if (list == null) {\n return false;\n }\n // once we got the list of successors, we look for node2\n for (let i = 0; i < list.getSize(); i++) {\n if (list.get(i) === node2) {\n return true;\n }\n }\n }", "isMergeable(register) {\n if (this._registers.length === 0) {\n return true;\n }\n return this.address + this.nbRegisters === register.address;\n }", "function mayWorkFor(node1, node2) {\n if (!(node1 instanceof go.Node)) return false; // must be a Node\n if (node1 === node2) return false; // cannot work for yourself\n if (node2.isInTreeOf(node1)) return false; // cannot work for someone who works for you\n return true;\n }", "areCousins(node1, node2) {}", "function isAdjacent (a ,b) {\n\t\t\tif (b.index === a.index) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (b.adjacent.indexOf(a.index) !== -1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (a.adjacent.length >= a.edgesCount) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (b.adjacent.length >= b.edgesCount) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (var v=0, l=a.vertices.length; v<l; v++) {\n\t\t\t\tvar result = b.vertices.indexOf(a.vertices[v]);\n\n\t\t\t\tif (result >= 0) {\n\t\t\t\t\tif (b.vertices.indexOf(a.vertices[((v - 1) + l) % l]) !== -1) {\n\t\t\t\t\t\ta.adjacent.push(b.index);\n\t\t\t\t\t\tb.adjacent.push(a.index);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (b.vertices.indexOf(a.vertices[(v + 1) % l]) !== -1) {\n\t\t\t\t\t\ta.adjacent.push(b.index);\n\t\t\t\t\t\tb.adjacent.push(a.index);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "function isConnectedLink(node, link) {\n //link.source and link.target is invalid as it had been automatically replaced with real data.\n if (link.target.index == node.index || link.source.index == node.index)\n return true;\n return false;\n }", "isConnected(nodeA, nodeB) {\n return this.data.get(nodeA).includes(nodeB)\n }", "areCousins(node1, node2) {\n\n }", "areCousins(node1, node2) {\n\n }", "function ancestoryTest(node1, node2) {\n var tmp = node1;\n while (tmp) {\n if (tmp === node2) return true;\n tmp = tmp.parent;\n }\n tmp = node2;\n while (tmp) {\n if (tmp === node1) return true;\n tmp = tmp.parent;\n }\n return false;\n }", "canMergeCells() {\n if (this.selection.isEmpty || !this.selection.start.paragraph.isInsideTable || !this.selection.end.paragraph.isInsideTable) {\n return false;\n }\n let startPos = this.selection.start;\n let endPos = this.selection.end;\n if (!this.selection.isForward) {\n startPos = this.selection.end;\n endPos = this.selection.start;\n }\n let startCell = this.getOwnerCell(this.selection.isForward);\n let endCell = this.getOwnerCell(!this.selection.isForward);\n let containerCell = this.selection.getContainerCellOf(startCell, endCell);\n if (containerCell.ownerTable.contains(endCell)) {\n if (!this.selection.containsCell(containerCell, endCell)) {\n startCell = this.selection.getSelectedCell(startCell, containerCell);\n endCell = this.selection.getSelectedCell(endCell, containerCell);\n let rowSpan = 1;\n if (startCell.ownerRow === endCell.ownerRow) {\n let startCellIndex = startCell.ownerRow.childWidgets.indexOf(startCell);\n for (let i = startCellIndex; i <= startCell.ownerRow.childWidgets.indexOf(endCell); i++) {\n let cell = startCell.ownerRow.childWidgets[i];\n let prevCell = cell.previousWidget;\n if (i !== startCellIndex) {\n if (cell.cellFormat.rowSpan !== rowSpan) {\n return false;\n }\n if (!isNullOrUndefined(prevCell)\n && cell.columnIndex !== (prevCell.cellFormat.columnSpan + prevCell.columnIndex)) {\n return false;\n }\n }\n rowSpan = cell.cellFormat.rowSpan;\n }\n return true;\n }\n return this.canMergeSelectedCellsInTable(startCell.ownerTable, startCell, endCell);\n }\n }\n return false;\n }", "function isBalanced(node) {\n if (!node) return 0;\n\n var left = isBalanced(node.left);\n var right = isBalanced(node.right);\n\n if (left === false || right === false) {\n return false;\n } else if (Math.abs(left - right) > 1) {\n return false;\n } else {\n return Math.max(left, right) + 1;\n }\n}", "function isTreeEdge(tree,u,v){return tree.hasEdge(u,v)}", "addEdge(e){\n\t\tif (e.getEnd() !== undefined){\n\t\t\treturn true\n\t\t}\n\t\telse return false\n }", "addEdge(e){\n\t\tif (e.getEnd() !== undefined){\n\t\t\treturn true\n\t\t}\n\t\telse return false\n }", "canReplaceWith (node) {\n if (node.name !== this.name)\n return false\n\n // gather up all the deps of this node and that are only depended\n // upon by deps of this node. those ones don't count, since\n // they'll be replaced if this node is replaced anyway.\n const depSet = gatherDepSet([this], e => e.to !== this && e.valid)\n\n for (const edge of this.edgesIn) {\n // only care about edges that don't originate from this node\n if (!depSet.has(edge.from) && !edge.satisfiedBy(node))\n return false\n }\n\n return true\n }", "function hasNodeCollision(node1, node2)\n {\n if (node1.position.side != node2.position.side) return false;\n\n return Math.abs(node1.position.top - node2.position.top) < (nodeHeight);\n }", "validateNode(node) {\n // should never have parent or child pointers reference self\n if ([node.parent, node.left, node.right].indexOf(node.id) !== -1) {\n return false;\n }\n // validate height and balance\n let hl = (node.left) ? this.nodes[node.left].height : -1;\n let hr = (node.right) ? this.nodes[node.right].height : -1;\n let eh = 1 + Math.max(hl, hr);\n if (node.height !== eh) {\n return false;\n }\n if (node.balance !== hr - hl) {\n return false;\n }\n // verify any siblings parent back to self\n if (node.siblings.length > 0) {\n for (let sid of node.siblings) {\n if (this.nodes[sid].parent !== node.id)\n return false;\n }\n }\n // if there is a left child, verify it parents to self and recurse it\n if (node.left) {\n if (this.nodes[node.left].parent !== node.id) {\n return false;\n }\n if (!this.validateNode(this.nodes[node.left])) {\n return false;\n }\n }\n // if there is a right child, verify it parents to self and recurse it\n if (node.right) {\n if (this.nodes[node.right].parent !== node.id) {\n return false;\n }\n if (!this.validateNode(this.nodes[node.right])) {\n return false;\n }\n }\n return true;\n }", "function uunodehas(node, // @param Node: child node\r\n context) { // @param Node: context(parent) node\r\n // @return Boolean:\r\n for (var c = node; c && c !== context;) {\r\n c = c.parentNode;\r\n }\r\n return node !== context && c === context;\r\n}", "function checkConnectionBetweenProps( target1, target2, excludedNodes ) {\n\tconst { subNodes: subNodes1, prevNodeMap: prevNodeMap1 } = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( target1, excludedNodes.subNodes );\n\tconst { subNodes: subNodes2, prevNodeMap: prevNodeMap2 } = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( target2, excludedNodes.subNodes );\n\n\tfor ( const sharedNode of subNodes1 ) {\n\t\tif ( subNodes2.has( sharedNode ) ) {\n\t\t\tconst connection = [];\n\n\t\t\tconnection.push( sharedNode );\n\n\t\t\tlet node = prevNodeMap1.get( sharedNode );\n\n\t\t\twhile ( node && node !== target1 ) {\n\t\t\t\tconnection.push( node );\n\t\t\t\tnode = prevNodeMap1.get( node );\n\t\t\t}\n\n\t\t\tnode = prevNodeMap2.get( sharedNode );\n\n\t\t\twhile ( node && node !== target2 ) {\n\t\t\t\tconnection.unshift( node );\n\t\t\t\tnode = prevNodeMap2.get( node );\n\t\t\t}\n\n\t\t\tconsole.log( '--------' );\n\t\t\tconsole.log( { target1 } );\n\t\t\tconsole.log( { sharedNode } );\n\t\t\tconsole.log( { target2 } );\n\t\t\tconsole.log( { connection } );\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "function shouldReallyMerge(a, b) {\n return a.kind === b.kind && (a.kind !== 225 /* ModuleDeclaration */ || areSameModule(a, b));\n // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes.\n // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'!\n function areSameModule(a, b) {\n if (a.body.kind !== b.body.kind) {\n return false;\n }\n if (a.body.kind !== 225 /* ModuleDeclaration */) {\n return true;\n }\n return areSameModule(a.body, b.body);\n }\n }", "function isAncestor(relationship){\n return relationship.depth == relationship.distance;\n}", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _Object = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _Object.subNodes,\n prevNodeMap1 = _Object.prevNodeMap;\n\n var _Object2 = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _Object2.subNodes,\n prevNodeMap2 = _Object2.prevNodeMap;\n\n var _iterator471 = _createForOfIteratorHelper(subNodes1),\n _step471;\n\n try {\n for (_iterator471.s(); !(_step471 = _iterator471.n()).done;) {\n var sharedNode = _step471.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator471.e(err);\n } finally {\n _iterator471.f();\n }\n\n return false;\n }", "static isHoppable(root) {\n const { outEdges } = root; \n if (root.val === null) return true;\n if (outEdges.length === 0) return false;\n for(let i = 0; i < outEdges.length; i++) {\n const edge = outEdges[i];\n const { toVertex } = edge;\n if (Graph.isHoppable(toVertex) === true) {\n return true;\n }\n }\n return false;\n }", "conflictExists () {\n if (! this.nodes || this.nodes.length <= 1) {\n return false;\n }\n\n const alignments = {};\n\n for (let i = 0; i < this.nodes.length; i++) {\n const ti = this.nodes[i];\n\n if (! ti.active) {\n continue;\n }\n\n // If another faction exists, then conflict exists.\n if (! alignments[ti.alignment] && Object.keys(alignments).length >= 1) {\n return true;\n }\n\n alignments[ti.alignment] = true;\n }\n\n return false;\n }", "isSameNode(otherNode) {\n return this.unique === otherNode.unique;\n }", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _Object = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _Object.subNodes,\n prevNodeMap1 = _Object.prevNodeMap;\n\n var _Object2 = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _Object2.subNodes,\n prevNodeMap2 = _Object2.prevNodeMap;\n\n var _iterator504 = _createForOfIteratorHelper(subNodes1),\n _step504;\n\n try {\n for (_iterator504.s(); !(_step504 = _iterator504.n()).done;) {\n var sharedNode = _step504.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator504.e(err);\n } finally {\n _iterator504.f();\n }\n\n return false;\n }", "static edgeExists(n1, n2){\n \n if(edges.length == 0){\n return false;\n }else if(n1.localeCompare(n2) < 0){ //If p1 < p2\n for(var i = 0; i < edges.length; i++){\n if(String(edges[i]).localeCompare(n1 + n2) == 0){\n return true; \n }\n return false;\n }\n }else if(n1.localeCompare(n2)){ //If p1 > p2\n for(var i = 0; i < edges.length; i++){\n if(String(edges[i]).localeCompare(n2 + n1) == 0){\n return true; \n }\n return false;\n }\n }\n \n return true;\n }", "function isOverlap(element1, element2, direction) {\n if (direction === Direction.Right)\n return element2.y < element1.y + element1.height && element2.y + element2.height > element1.y;\n else if (direction === Direction.Down)\n return element2.x < element1.x + element1.width && element2.x + element2.width > element1.x;\n return false;\n}", "oppositeNode(node) {\n if (this.inputNode === node) {\n return this.outputNode;\n } else if (this.outputNode === node) {\n return this.inputNode;\n }\n\n return;\n }", "adjacent(from, to) {\n // Convert squares to numbers\n let rankFrom = parseInt(from[1]);\n let fileFrom = FILES.indexOf(from[0]);\n let rankTo = parseInt(to[1]);\n let fileTo = FILES.indexOf(to[0]);\n\n // Go through all possible neighbours and check for adjacency\n for (let i = rankFrom - 1; i <= rankFrom + 1; i++) {\n for (let j = fileFrom - 1; j <= fileFrom + 1; j++) {\n if (i === rankTo && j === fileTo) return true;\n }\n }\n // If we made it through the loops without returning, it's not adjacent\n return false;\n }", "function isConnected(a, b) {\r\n return linkedByIndex[a.index + \",\" + b.index] || linkedByIndex[b.index + \",\" + a.index] || a.index == b.index;\r\n }", "function is_ancestor(node, target)\n{\n while (target.parentNode) {\n target = target.parentNode;\n if (node == target)\n return true;\n }\n return false;\n}", "function isConnection() {\n return state.core.isConnection(state.nodes[_id].node);\n }", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _ref84 = (0, _getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _ref84.subNodes,\n prevNodeMap1 = _ref84.prevNodeMap;\n\n var _ref85 = (0, _getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _ref85.subNodes,\n prevNodeMap2 = _ref85.prevNodeMap;\n\n var _iterator471 = _createForOfIteratorHelper(subNodes1),\n _step471;\n\n try {\n for (_iterator471.s(); !(_step471 = _iterator471.n()).done;) {\n var sharedNode = _step471.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator471.e(err);\n } finally {\n _iterator471.f();\n }\n\n return false;\n }", "function isInGraph(node) {\n var n = node;\n while (n !== null && n.parentElement !== n) {\n if (n.tagName === 'svg') return true;\n n = n.parentElement;\n }\n return false;\n}", "checkIfEdgeExists(fromVertex, toVertex) {\n return (fromVertex.edges.includes(toVertex) && toVertex.edges.includes(fromVertex));\n }", "areNodesEqual(nodeA, nodeB) {\n if (!nodeA && !nodeB) return true;\n if ((!nodeA && nodeB) || (nodeA && !nodeB)) return false;\n return (\n nodeA.key === nodeB.key &&\n nodeA.value === nodeB.value &&\n nodeA.isActive === nodeB.isActive\n );\n }", "function areOverlapping(r1, r2) {\n\tif (inRange(r1.x, r2.x, r2.x + r2.w) && inRange(r1.y, r2.y, r2.y + r2.h)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\t\n}", "contains(target) {\n if (this.value === target) return true;\n if (this.value > target) {\n const leftNode = this.left;\n if (leftNode && leftNode.contains(target)) return true;\n } else {\n const rightNode = this.right;\n if (rightNode && rightNode.contains(target)) return true;\n }\n return false;\n }", "function is_subtree(root, root_r) {\n // the variables below will hold the values:\n // 4-30-10-6\n // 4-30-10-6-26-3-3\n var inord1 = in_order(root, []).join(\"-\");\n var inord2 = in_order(root_r, []).join(\"-\");\n\n // 10-4-30-6\n // 26-10-4-30-6-3-3\n var preord1 = pre_order(root, []).join(\"-\");\n var preord2 = pre_order(root_r, []).join(\"-\");\n\n // check if the left tree is contained with the right tree\n return inord2.indexOf(inord1) !== -1 && preord2.indexOf(preord1) !== -1;\n}", "function isConnected(a, b) {\n\t\t return linked[a.index + \", \" + b.index] || linked[b.index + \", \" + a.index];\n\t\t}", "_isNodeInList(node)\n {\n for(let ancestor of this.nodeList)\n {\n\n // nodeList can contain both DOM nodes and widgets (actors). If this is a widget,\n // see if the node is within the widget's tree.\n if(ancestor instanceof Actor)\n {\n for(let rootNode of ancestor.getRoots())\n if(helpers.html.isAbove(rootNode, node))\n return true;\n }\n else\n {\n // node is just a DOM node.\n if(helpers.html.isAbove(ancestor, node))\n return true;\n }\n }\n return false;\n }", "hasCycle() {\n const numOfNodes = this.nodes.size;\n const numOfEdges = this.getNumOfEdges();\n const numOfConnectedComponents = this.getNumOfConnectedComponents();\n return numOfEdges > numOfNodes - numOfConnectedComponents;\n }", "function merge_nodes(source_node_id, target_node_id, consequences) {\n if (consequences.status != null && consequences.status == 'ok') {\n merge_node(source_node_id, target_node_id);\n if (consequences.checkalign != null) {\n // Remove all prior checkmerge button groups\n $('[id*=\"nomerge\"]').parent().remove();\n // Remove all leftover temp relations\n $('.checkalign').remove();\n $.each(consequences.checkalign, function(index, node_ids) {\n var ids_text = node_ids[0] + '-' + node_ids[1];\n var merge_id = 'merge-' + ids_text;\n // Make a checkmerge button if there isn't one already, for this pair\n if ($('#' + merge_id).length == 0) {\n var temp_relation = draw_relation(node_ids[0], node_ids[1], {\n color: \"#89a02c\",\n class: \"checkalign\"\n });\n var sy = parseInt(temp_relation.children('path').attr('d').split('C')[0].split(',')[1]);\n var ey = parseInt(temp_relation.children('path').attr('d').split(' ')[2].split(',')[1]);\n var yC = ey + ((sy - ey) / 2);\n // TODO: compute xC to be always the same distance to the amplitude of the curve\n var xC = parseInt(temp_relation.children('path').attr('d').split(' ')[1].split(',')[0]);\n var svg = $('#svgenlargement').children('svg').svg('get');\n parent_g = svg.group($('#svgenlargement svg g'));\n var yes = svg.image(parent_g, xC, (yC - 8), 16, 16, merge_button_yes, {\n id: merge_id\n });\n var no = svg.image(parent_g, (xC + 20), (yC - 8), 16, 16, merge_button_no, {\n id: 'no' + merge_id\n });\n $(yes).hover(function() {\n $(this).addClass('draggable')\n // Indicate which nodes are active\n get_ellipse(node_ids[0]).attr('fill', '#9999ff');\n get_ellipse(node_ids[1]).attr('fill', '#9999ff');\n }, function() {\n $(this).removeClass('draggable');\n var colorme = $('#update_workspace_button').data('locked') ? color_active : color_inactive;\n colorme(get_ellipse(node_ids[0]));\n colorme(get_ellipse(node_ids[1]));\n });\n $(no).hover(function() {\n $(this).addClass('draggable')\n }, function() {\n $(this).removeClass('draggable')\n });\n $(yes).click(function(evt) {\n // node_ids[0] is the one that goes away\n merge_node(rid2node[node_ids[0]], rid2node[node_ids[1]]);\n temp_relation.remove();\n $(evt.target).parent().remove();\n // remove any suggestions that involve the removed node\n $('[id*=\"-' + node_ids[0] + '\"]').parent().remove();\n $('.checkalign[id*=\"' + rid2node[node_ids[0]] + '\"]').remove();\n //notify backend\n var ncpath = getTextURL('merge');\n var form_values = \"source=\" + node_ids[0] + \"&target=\" + node_ids[1] + \"&single=true\";\n $.post(ncpath, form_values);\n });\n $(no).click(function(evt) {\n temp_relation.remove();\n $(evt.target).parent().remove();\n });\n }\n });\n }\n }\n}", "function adjacent (object, other) {\n for (var exit in Rooms[object.position].exits) {\n if (other.position === Rooms[object.position].exits[exit]) {\n return exit;\n }\n }\n return false;\n}", "isNextTo(other) {\n const leftOrRight = (this.x === other.x - 1 || this.x === other.x + 1) && this.y === other.y;\n const upOrDown = (this.y === other.y - 1 || this.y === other.y + 1) && this.x === other.x;\n return leftOrRight || upOrDown;\n }", "function isAdjacent(x1, y1, x2, y2) {\n var dx = Math.abs(x1 - x2),\n dy = Math.abs(y1 - y2);\n\n return (dx + dy === 1);\n }", "function traverse(node, item, offset) {\n\t\tif(overlaps(node, item)) {\n\t\t\tif(iterate(siblingIndex.get(offset+1), item, offset+1)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tappend(node, item, offset);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function visit(g, node, stack, visited) {\n if (visited[node] == 2) {\n return true;\n } else if (visited[node] == 1) {\n return false;\n }\n visited[node] = 1;\n for (let neighbor of g[node]) {\n if (visit(g, neighbor, stack, visited) == false) {\n return false;\n }\n }\n stack.push(node);\n visited[node] = 2;\n return true;\n}", "collidedBy(obj) {\n if (obj.left > this.right ||\n obj.top > this.bottom ||\n obj.right < this.left ||\n obj.bottom < this.top)\n return false;\n \n return true;\n }", "function isNodeInDOM(node) {\n var ancestor = node;\n while (ancestor.parentNode) {\n ancestor = ancestor.parentNode;\n }\n // ancestor should be a document\n return !!ancestor.body;\n }", "function hasRoadConnection(x, y) {\n var road_connections = ['Road', 'Bridge', 'Settlement'];\n var tile = Game.terrain[x][y];\n var road = Game.roads[x][y];\n for (var i=0; i<road_connections.length; i++) {\n if (tile.has(road_connections[i]) || (road !== undefined && road !== null)) return true;\n }\n return false;\n }", "hasCycleFrom(start) {\n const stack = [{ node: start, visited: new Set([start]), lastVisited: null }];\n while (stack.length) {\n const current = stack.pop();\n for (let node of current.node.adjacent.values()) {\n if (current.lastVisited != node) {\n if (current.visited.has(node)) return true;\n else {\n const visited = new Set([...current.visited]);\n visited.add(node);\n stack.push({ node: node, visited: visited, lastVisited: current.node });\n }\n }\n }\n }\n return false;\n }", "isWhereMergeable(a, b) {\n for (let key in a) {\n let valueA = a[key];\n if (key in b) {\n let valueB = b[key];\n if (typeof valueA === 'object' && typeof valueB === 'object') {\n if (!this.isWhereMergeable(valueA, valueB)) {\n // console.log(valueA, valueB, key, false);\n return false;\n }\n } else {\n // console.log(valueA, valueB, key, false, 1);\n return false;\n }\n }\n }\n\n return true;\n }", "function isAdjacent (x1, y1, x2, y2) {\n var dx = Math.abs(x1 - x2),\n dy = Math.abs(y1 - y2);\n return (dx + dy === 1);\n }", "function isBalanced(node) {\n return isBalancedNode(node).balanced;\n}", "forEachNodeAndEdgeByStage(cb) {\n const nstages = this.nodeEdgeStages.length;\n let r;\n for (let s = 0; s < nstages; s++) {\n const stageNodes = this.nodeEdgeStages[s].nodes;\n const stageEdges = this.nodeEdgeStages[s].edges;\n for (let i = 0; i < stageNodes.length; i++) {\n r = cb(stageNodes[i], s, i);\n if (r === false) { return false; }\n }\n for (let i = 0; i < stageEdges.length; i++) {\n r = cb(stageEdges[i], s, i);\n if (r === false) { return false; }\n }\n }\n return r;\n }", "within(a, b) {\n\t\tconst min = this.displayPosition;\n\t\tconst max = new NPoint(min.x + this.nodeDiv.clientWidth, min.y + this.nodeDiv.clientHeight);\n\t\treturn (min.x >= a.x && max.x <= b.x && min.y >= a.y && max.y <= b.y);\n\t}", "within(a, b) {\n\t\tconst min = this.displayPosition;\n\t\tconst max = new NPoint(min.x + this.nodeDiv.clientWidth, min.y + this.nodeDiv.clientHeight);\n\t\treturn (min.x >= a.x && max.x <= b.x && min.y >= a.y && max.y <= b.y);\n\t}", "function isEquivalentPosition(node, off, targetNode, targetOff) {\n return targetNode ? (scanFor(node, off, targetNode, targetOff, -1) ||\n scanFor(node, off, targetNode, targetOff, 1)) : false;\n}", "isValidNode(node) {\n return this.validNodes.includes(node)\n }", "_isOverlap (segA, segB) {\n\t\tvar _isBefore = (segA.end >= segB.start && segA.start <= segB.end + 1);\n\t\tvar _isAfter = (segA.start <= segB.end + 1 && segA.end >= segB.start);\n\t\tvar _isSame = (segA === segB);\n\t\treturn ((_isBefore || _isAfter) && (!_isSame));\n\t}", "function isBlockwithChildren(event) {\n if (event.overlaped == true) {\n for (var key in overlappedEvents) {\n if (key == event._id) {\n var arr = overlappedEvents[key];\n if (arr !== undefined && arr != null && arr.length > 0) {\n return true;\n }\n }\n }\n }\n return false\n}", "function checkForCollision(element, nextElement) {\n //return true if collison found\n\n var overlapFlag = false;\n if (element.start >= nextElement.start && element.start <= nextElement.end || nextElement.start >= element.start && nextElement.start <= element.end) {\n overlapFlag = true;\n }\n if (element.end >= nextElement.start && element.end <= nextElement.end || nextElement.end >= element.start && nextElement.end <= element.end) {\n overlapFlag = true;\n }\n return overlapFlag;\n\n\n}", "function isChildOf(node1, node2) { // Node.prototype.isChildOf\n\twhile (node1.parentNode) {\n\t\tif (node1.parentNode == node2) return true;\n\t\tnode1 = node1.parentNode;\n\t}\n\treturn false;\n}", "function checkIfWeCanGoDeeper () {\n return trieRemainderPath.length > 0 && !isExternalLink(currentNode)\n }", "function isNestable(arr1, arr2) {\n let arr1Min = Math.min(...arr1),\n arr2Min = Math.min(...arr2),\n arr1Max = Math.max(...arr1),\n arr2Max = Math.max(...arr2)\n\n return arr1Min > arr2Min && arr1Max < arr2Max\n}", "function pathsHaveMet(nodeA, nodeB) {\n if (!nodeA.visitedBy || !nodeB.visitedBy) {\n return false\n }\n return nodeA.visitedBy !== nodeB.visitedBy\n}", "function isDescendant(relationship){\n return -relationship.depth == relationship.distance\n}", "_isOverlappingExisting(x, y, w, h) {\n if(!this._positions.length) return false;\n let over = false;\n this._positions.forEach((item) => {\n if (!(item.x > x + w ||\n item.x + item.width < x ||\n item.y > y + h ||\n item.y + item.height < y)) over = true;\n });\n\n return over;\n }", "function isAdjacent(tile_1,tile_2){\n\tvar i1 = tile_1.coord.x;\n\tvar j1 = tile_1.coord.y;\n\tvar\ti2 = tile_2.coord.x;\n\tvar j2 = tile_2.coord.y;\n\tif(i1==i2 && j1==j2+1)\n\t\treturn true;\n\telse if(i1==i2 && j1==j2-1)\n\t\treturn true;\n\telse if(j1==j2 && i1==i2+1)\n\t\treturn true;\n\telse if(j1==j2 && i1==i2-1)\n\t\treturn true;\n\telse if(i1==i2-1 && j1==j2-1)\n\t\treturn true;\n\telse if(i1==i2-1 && j1==j2+1)\n\t\treturn true;\n\telse if(i1==i2+1 && j1==j2-1)\n\t\treturn true;\n\telse if(i1==i2+1 && j1==j2+1)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function neighboring(a, b) {\n console.log(a);\n console.log(b);\n console.log(linkedByIndex);\n return linkedByIndex[a.id + \",\" + b.id] || linkedByIndex[b.id + \",\" + a.id] || a.id == b.id;\n}", "function areEqualNodes(node1, node2) {\n return node1.row === node2.row && node1.column === node2.column;\n}", "function isSuperBalanced(baseNode) {\n let maxHeight = 0, minHeight = 0;\n let currHeight = 0;\n // the stack also stores the height of each node\n const stack = [{node: baseNode, height: 0}];\n\n while (stack.length) {\n if (maxHeight - minHeight > 1) {return false;\n }\n const nodeObj = stack.pop();\n currHeight = nodeObj.height;\n const node = nodeObj.node;\n\n if (!node.left && !node.right) {\n if (currHeight > maxHeight) {\n maxHeight = currHeight;\n }\n if (currHeight < minHeight) {\n minHeight = currHeight;\n }\n } else {\n if (node.right) {stack.push({node: node.right, height: currHeight + 1});}\n if (node.left) {stack.push({node: node.left, height: currHeight + 1});}\n }\n }\n\n return (maxHeight - minHeight <= 1);\n}", "function overlap(b1, b2){\r\n if (dist(b1, b2) < b1.r + b2.r){\r\n return true;\r\n }\r\n return false;\r\n}", "connects(candidate, edge) {\n return ((candidate && edge) && (candidate.a.x == edge.a.x && candidate.a.y == edge.a.y ||\n candidate.a.x == edge.b.x && candidate.a.y == edge.b.y ||\n candidate.b.x == edge.a.x && candidate.b.y == edge.a.y ||\n candidate.b.x == edge.b.x && candidate.b.y == edge.b.y)) \n }", "contains(data) { \n if (this.data === data) {\n return true;\n } else if (this.comparator(this.data,data)) { \n // minor optimization, if this is not true then no child of this node\n // can contain the target data\n return this.getLeftChild().contains(data) || this.getRightChild().contains(data);\n } else {\n return false;\n }\n }", "function checkNeighbourNode(parent, node, mode){\n\tif((grid[node.x][node.y] > 0 && grid[node.x][node.y].group == 2) || grid[node.x][node.y] == -1){\n\t\treturn false;\n\t}\n\tvar distance;\n\tif(mode == 0){\n\t\tdistance = unitDistance;\n\t}else{\n\t\tdistance = diagDistance;\n\t\t// NO cutting corners of a wall if moving diagonally\n\t\tswitch(mode){\n\t\t\tcase 1:\n\t\t\t\tvar n1 = {\n\t\t\t\t\tx : node.x,\n\t\t\t\t\ty : node.y + 1\n\t\t\t\t}\n\t\t\t\tvar n2 = {\n\t\t\t\t\tx : node.x + 1,\n\t\t\t\t\ty : node.y\n\t\t\t\t}\n\t\t\t\tif(grid[n1.x][n1.y] != -1 || grid[n2.x][n2.y] != -1){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tvar n1 = {\n\t\t\t\t\tx : node.x - 1,\n\t\t\t\t\ty : node.y\n\t\t\t\t}\n\t\t\t\tvar n2 = {\n\t\t\t\t\tx : node.x,\n\t\t\t\t\ty : node.y + 1\n\t\t\t\t}\n\t\t\t\tif(grid[n1.x][n1.y] != -1 || grid[n2.x][n2.y] != -1){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tvar n1 = {\n\t\t\t\t\tx : node.x,\n\t\t\t\t\ty : node.y - 1\n\t\t\t\t}\n\t\t\t\tvar n2 = {\n\t\t\t\t\tx : node.x + 1,\n\t\t\t\t\ty : node.y\n\t\t\t\t}\n\t\t\t\tif(grid[n1.x][n1.y] != -1 || grid[n2.x][n2.y] != -1){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tvar n1 = {\n\t\t\t\t\tx : node.x - 1,\n\t\t\t\t\ty : node.y\n\t\t\t\t}\n\t\t\t\tvar n2 = {\n\t\t\t\t\tx : node.x,\n\t\t\t\t\ty : node.y - 1\n\t\t\t\t}\n\t\t\t\tif(grid[n1.x][n1.y] != -1 || grid[n2.x][n2.y] != -1){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tvar tempG = parent.g + distance;\n\tvar isInOpen = grid[node.x][node.y];\n\tif(isInOpen > 0 && isInOpen.group != 1){\t// if node is not in openSet\n\t\t// openSet.push(node);\n\t\tgrid[node.x][node.y].group = 1;\n\t\topenCounter++;\n\t\topenSetCoord.push(node);\n\t\tanimateNode(node, 1);\n\t}else if(tempG < isInOpen.g){\n\t\tgrid[node.x][node.y].g = tempG;\n\t\tgrid[node.x][node.y].parentX = parent.x;\n\t\tgrid[node.x][node.y].parentY = parent.y;\n\t}\n\treturn true;\n}", "function isNodeInView(node) {\n var yOffset = window.scrollY || window.pageYOffset,\n w = {\n top: yOffset,\n bottom : yOffset + window.innerHeight\n },\n bodyRect = document.body.getBoundingClientRect(),\n elemRect = node.getBoundingClientRect(),\n offset = elemRect.top - bodyRect.top + shrinkOffsetForViewDetection,\n nodeHeight = offset + node.offsetHeight - (shrinkOffsetForViewDetection * 2);\n return offset > w.top && offset < w.bottom || // is top frame in view\n nodeHeight > w.top && nodeHeight < w.bottom || // is bottom frame in view\n offset < w.top && nodeHeight > w.bottom; // is top frame above view and bottom frame below view\n}", "connected(n1, n2) {\n console.log(\"Testing connection between \" + n1 + ' and ' + n2);\n return (this.root(n1) == this.root(n2));\n }", "valid_connection(target) {\n return this.source.level < CONSTANTS.MAXIMUM_CELL_LEVEL &&\n // To allow `valid_connection` to be used to simply check whether the source is valid,\n // we ignore source–target compatibility if `target` is null.\n // We allow cells to be connected even if they do not have the same level. This is\n // because it's often useful when drawing diagrams, even if it may not always be\n // semantically valid.\n (target === null || target.level < CONSTANTS.MAXIMUM_CELL_LEVEL);\n }", "function doesOverlap(e1, e2) {\n if (e1.start > e2.start) {\n [e1, e2] = [e2, e1];\n }\n if (e1.end <= e2.start) {\n return false;\n }\n return true;\n}", "hasNeighbor(tile) {\n return Boolean(this.getAdjacentDirection(tile));\n }", "isAdjacent(tile){\n\t\tif(Math.abs(tile.pos - emptyTile.pos) === 1 || Math.abs(tile.pos - emptyTile.pos) === this.cols) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function isConnected(a, b) {\n let c1 = indexLink[a.index + \"|\" + b.index];\n let c2 = indexLink[b.index + \"|\" + a.index];\n return (c1 || c2);\n }", "function isAncestor(instA, instB) {\n\t !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t\n\t while (instB) {\n\t if (instB === instA) {\n\t return true;\n\t }\n\t instB = instB._nativeParent;\n\t }\n\t return false;\n\t}", "function isAncestor(instA, instB) {\n\t !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t\n\t while (instB) {\n\t if (instB === instA) {\n\t return true;\n\t }\n\t instB = instB._nativeParent;\n\t }\n\t return false;\n\t}", "function isAncestor(instA, instB) {\n\t !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t\n\t while (instB) {\n\t if (instB === instA) {\n\t return true;\n\t }\n\t instB = instB._nativeParent;\n\t }\n\t return false;\n\t}", "function isTreeEdge(tree, u, v) {\n return tree.hasEdge(u, v);\n}", "function isTreeEdge(tree, u, v) {\n return tree.hasEdge(u, v);\n}", "function isTreeEdge(tree, u, v) {\n return tree.hasEdge(u, v);\n}" ]
[ "0.7134994", "0.62617314", "0.6231172", "0.6230404", "0.61173457", "0.60287595", "0.58044505", "0.5802731", "0.5750507", "0.5740649", "0.56971484", "0.56971484", "0.5686166", "0.56212604", "0.5617487", "0.55912936", "0.5573064", "0.5573064", "0.55617875", "0.55531865", "0.55510986", "0.5528595", "0.5523812", "0.551274", "0.55121475", "0.547608", "0.5461864", "0.54296863", "0.5424424", "0.540629", "0.5399424", "0.5399322", "0.5385513", "0.53829974", "0.5369213", "0.53624475", "0.53352845", "0.5333626", "0.5328534", "0.53205615", "0.5311604", "0.5311212", "0.5304526", "0.5292266", "0.5291116", "0.5277193", "0.5269084", "0.52688074", "0.5259868", "0.52588207", "0.52455485", "0.5241908", "0.52237535", "0.5222", "0.52100515", "0.52025276", "0.5195323", "0.5194386", "0.5193847", "0.51846826", "0.5182083", "0.51746505", "0.51746505", "0.51648295", "0.51643014", "0.51638013", "0.5163722", "0.5163505", "0.5162046", "0.5157769", "0.5157568", "0.51387084", "0.5136931", "0.51357704", "0.513534", "0.51316893", "0.51316124", "0.5125375", "0.51145285", "0.5107981", "0.5104302", "0.51033396", "0.5101975", "0.50938386", "0.50850946", "0.50761425", "0.5072021", "0.5063234", "0.5056435", "0.5047969", "0.5047969", "0.5047969", "0.50439805", "0.50439805", "0.50439805" ]
0.7072907
5
Merge two text nodes: `node` into `prev`.
function mergeText(prev, node) { prev.value += node.value; return prev; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeText(previous, node) {\n previous.value += node.value\n\n return previous\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(previous, node) {\n if (this.options.commonmark || this.options.gfm) {\n return node\n }\n\n previous.children = previous.children.concat(node.children)\n\n return previous\n}", "set prev(node) {\n this._prev = Node.sanitizeNode(node, true);\n }", "function mergeTwoNodes(node1, node2) {\n node1.innerHTML = node1.innerHTML + node2.innerHTML\n return node1\n}", "function diffText(prev, next) {\n if (prev === undefined || next === undefined) return null;\n var offsets = getDiffOffsets(prev, next);\n if (offsets == null) return null;\n var insertText = sliceText(next, offsets);\n var removeText = sliceText(prev, offsets);\n return {\n start: offsets.start,\n end: prev.length - offsets.end,\n insertText,\n removeText\n };\n}", "function emitTagAndPreviousTextNode() {\n var textBeforeTag = html.slice(currentDataIdx, currentTag.idx);\n if (textBeforeTag) {\n // the html tag was the first element in the html string, or two \n // tags next to each other, in which case we should not emit a text \n // node\n onText(textBeforeTag, currentDataIdx);\n }\n if (currentTag.type === 'comment') {\n onComment(currentTag.idx);\n }\n else if (currentTag.type === 'doctype') {\n onDoctype(currentTag.idx);\n }\n else {\n if (currentTag.isOpening) {\n onOpenTag(currentTag.name, currentTag.idx);\n }\n if (currentTag.isClosing) { // note: self-closing tags will emit both opening and closing\n onCloseTag(currentTag.name, currentTag.idx);\n }\n }\n // Since we just emitted a tag, reset to the data state for the next char\n resetToDataState();\n currentDataIdx = charIdx + 1;\n }", "function emitTagAndPreviousTextNode() {\n var textBeforeTag = html.slice(currentDataIdx, currentTag.idx);\n if (textBeforeTag) {\n // the html tag was the first element in the html string, or two \n // tags next to each other, in which case we should not emit a text \n // node\n onText(textBeforeTag, currentDataIdx);\n }\n if (currentTag.type === 'comment') {\n onComment(currentTag.idx);\n }\n else if (currentTag.type === 'doctype') {\n onDoctype(currentTag.idx);\n }\n else {\n if (currentTag.isOpening) {\n onOpenTag(currentTag.name, currentTag.idx);\n }\n if (currentTag.isClosing) { // note: self-closing tags will emit both opening and closing\n onCloseTag(currentTag.name, currentTag.idx);\n }\n }\n // Since we just emitted a tag, reset to the data state for the next char\n resetToDataState();\n currentDataIdx = charIdx + 1;\n }", "function diffText (previous, current, el) {\n\t if (current !== previous) el.data = current\n\t return el\n\t }", "function diffText (previous, current, el) {\n if (current.data !== previous.data) el.data = current.data\n return el\n }", "function prev(n){\n while((n = n.previousSibling) && n.nodeType != 1);\n return n;\n }", "function mergeTextNodes(data, coupleData, mode) {\n var prev = data.node;\n var next = data.node;\n var tagsMerged = mode === 'both' ? true : false;\n var remove = [];\n\n while (true) {\n prev = prev.previousSibling;\n if (!prev || prev.nodeType !== Node.TEXT_NODE) break;\n\n if (prev === coupleData.node) {\n tagsMerged = true;\n data.index += prev.nodeValue.length;\n data.node.nodeValue = prev.nodeValue + data.node.nodeValue;\n coupleData.node = data.node;\n } else if (prev.nodeValue.trim().length) {\n break;\n }\n\n remove.push(prev);\n }\n\n while (true) {\n next = next.nextSibling;\n if (!next || next.nodeType !== Node.TEXT_NODE) break;\n\n if (next === coupleData.node) {\n tagsMerged = true;\n coupleData.index += data.node.nodeValue.length;\n data.node.nodeValue = data.node.nodeValue + next.nodeValue;\n coupleData.node = data.node;\n } else if (next.nodeValue.trim().length) {\n break;\n }\n\n remove.push(next);\n }\n\n var parent = data.node.parentElement;\n for (var i = 0; i < remove.length; i++) {\n parent.removeChild(remove[i]);\n }\n\n return tagsMerged;\n}", "function prevNode(node) {\n if (!node) return null;\n if (node.previousSibling) {\n return previousDeep(node.previousSibling);\n }\n return node.parentNode;\n}", "function getRealPreviousSibling(node) {\n var prevSibling = node;\n do {\n prevSibling = prevSibling.previousSibling;\n } while (prevSibling && isEmptyTextNode(prevSibling));\n return prevSibling;\n}", "function GetPreviousTextNode(pNode) {\n\tvar lPreviuosSibling = false;\n\tvar lParent = pNode;\n\twhile(lParent){\n\t\tlPreviuosSibling = lParent.previousSibling;\n\t\twhile(lPreviuosSibling){\n\t\t\tif(lPreviuosSibling.nodeType == 3)\n\t\t\t\treturn lPreviuosSibling;\n\t\t\tif(lPreviuosSibling.nodeType == 1){\n\t\t\t\tvar lTextNode = GetLastTextNodeDescendant(lPreviuosSibling);\n\t\t\t\tif(lTextNode)\n\t\t\t\t\treturn lTextNode;\n\t\t\t}\n\t\t\tlPreviuosSibling = lPreviuosSibling.previousSibling;\n\t\t}\n\t\tlParent = lParent.parentNode;\n\t}\n\treturn false;\n}", "addText(text) {\n let nodes = this.top().content, last = nodes[nodes.length - 1]\n let node = this.schema.text(text, this.marks), merged\n if (last && (merged = maybeMerge(last, node))) nodes[nodes.length - 1] = merged\n else nodes.push(node)\n }", "function previousSibling(node) {\n var node = node.previousSibling;\n try {\n while(node.data) node = node.previousSibling;\n } catch(e) {}\n return node;\n}", "function prev(node) {\r\n var prev_node;\r\n\r\n assert(isElement(node), 'pklib.dom.prev: @node is not HTMLElement');\r\n\r\n while (true) {\r\n prev_node = node.previousSibling;\r\n if (prev_node !== undefined && prev_node !== null && prev_node.nodeType !== node_types.ELEMENT_NODE) {\r\n node = prev_node;\r\n } else {\r\n break;\r\n }\r\n }\r\n return prev_node;\r\n }", "replace(from, to, text) {\n let parts = [];\n this.decompose(0, from, parts, 2 /* Open.To */);\n if (text.length)\n text.decompose(0, text.length, parts, 1 /* Open.From */ | 2 /* Open.To */);\n this.decompose(to, this.length, parts, 1 /* Open.From */);\n return TextNode.from(parts, this.length - (to - from) + text.length);\n }", "function findPreviousText(node, offset, preTextToOriginWord) {\n let context = \"\";\n if (node instanceof Text) {\n context = node.textContent.trim();\n } else {\n context = node.innerText;\n }\n const previousDividerIndex = findLast(context.substring(0, offset), dividers);\n if (previousDividerIndex !== -1) {\n return context.substring(previousDividerIndex + 1, offset) + preTextToOriginWord;\n }\n \n const parentNode = node.parentNode;\n if (parentNode instanceof HTMLElement) {\n return \"\";\n }\n const parentOffset = calcOffset(node, parentNode);\n return findPreviousText(parentNode, parentOffset, preTextToOriginWord + context.substring(0, offset));\n}", "function concatTextNode(string, textNode){\n \t\treturn string.concat(textNode.textContent);\n \t}", "function insert_before(n1,n2){\r\n\tvar before = get_prev(n1);\r\n\tif(is_empty_node(before)){\r\n\t\tset_previous(n1,n2);\r\n\t\tset_next(n2,n1);\r\n\t\tset_previous(n2,empty_node);\r\n\t}else{\r\n\t\tset_next(before,n2);\r\n\t\tset_previous(n2,before);\r\n\t\tset_next(n2,n1);\r\n\t\tset_previous(n1,n2);\r\n\r\n\t}\r\n}", "function mergeTokens(a, b) {\n\ta.text += ' ' + b.text;\n\ta.normalised += ' ' + b.normalised;\n\ta.pos_reason += '|' + b.pos_reason;\n\ta.start = a.start || b.start;\n\ta.noun_capital = a.noun_capital || b.noun_capital;\n\ta.punctuated = a.punctuated || b.punctuated;\n\ta.end = a.end || b.end;\n\treturn a;\n}", "function getPreviousSibling(startBrother) {\n\tendBrother = startBrother.previousSibling;\n\twhile(endBrother.nodeType != 1) endBrother = endBrother.previousSibling;\n\treturn endBrother;\n}", "function addText(node, text) {\n node.appendChild(document.createTextNode(text));\n return node.lastChild;\n}", "prepend(value) {\n let node = new Node(value);\n node.next = this.root;\n\n this.root.prev = node;\n this.root = node;\n }", "function previousDeep(node) {\n if (!node) return null;\n while (node.childNodes.length) {\n node = node.lastChild;\n }\n return node;\n}", "function replaceNodeByText(node, text){\n\n node.parentNode.replaceChild( document.createTextNode(text), node );\n\n}", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling}", "function prepend(elem,prev){var parent=elem.parent;if(parent){var childs=parent.children;childs.splice(childs.lastIndexOf(elem),0,prev);}if(elem.prev){elem.prev.next=prev;}prev.parent=parent;prev.prev=elem.prev;prev.next=elem;elem.prev=prev;}", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling;}", "function setNodeText(node, text) {\n while (node.lastChild) {\n node.removeChild(node.lastChild);\n }\n\n node.appendChild(node.ownerDocument.createTextNode(text));\n}", "function removeSiblings(node) {\n if (!node || node.nodeType != Node.TEXT_NODE) return;\n removeSiblings(node.previousSibling);\n node.remove();\n }", "function diffNode (path, entityId, prev, next, el) {\n // Type changed. This could be from element->text, text->ComponentA,\n // ComponentA->ComponentB etc. But NOT div->span. These are the same type\n // (ElementNode) but different tag name.\n if (prev.type !== next.type) return replaceElement(entityId, path, el, next)\n\n switch (next.type) {\n case 'text': return diffText(prev, next, el)\n case 'element': return diffElement(path, entityId, prev, next, el)\n case 'component': return diffComponent(path, entityId, prev, next, el)\n }\n }", "function update($, node) {\n if (node.type !== \"#\") {\n throw Error(\"Invalid update for a text node\");\n }\n if (node.text !== $.text) {\n $.text = node.text;\n $.domNode.nodeValue = $.text;\n }\n}", "function linkNodes(node1, node2) {\n\tnode1.next = node2;\n\tnode2.prev = node1; \n}", "insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}", "oppositeNode(node) {\n if (this.inputNode === node) {\n return this.outputNode;\n } else if (this.outputNode === node) {\n return this.inputNode;\n }\n\n return;\n }", "function appendText(text, node) {\n\tnode.appendChild(document.createTextNode(text));\n}", "function prepend(elem, prev) {\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.lastIndexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n }", "function endText(node) {\r\n if (!node.firstElementChild) {\r\n return node.innerHTML;\r\n } else {\r\n return endText(node.firstElementChild);\r\n }\r\n}", "function transformTextNodes(node) {\n node.childNodes.forEach((n)=>{\n console.log(n);\n if(n.nodeName === \"#text\"){\n console.log(n.nodeValue);\n n.nodeValue = n.nodeValue.split(\" \")\n .map((text)=>{\n if (!text.trim()) return text;\n // console.log(\"text =\" + text);\n if(text[text.length-1] == '\\n'){\n tmp = text.substr(0,text.length-1);\n return MATCH_LIST[tmp]?`${MATCH_LIST[tmp]}\\n`:text;\n }else{\n tmp = text;\n return MATCH_LIST[tmp]?`${MATCH_LIST[tmp]}`:text;\n }\n })\n .join(\" \");\n // console.log(node);\n }else{\n transformTextNodes(n);\n }\n })\n}", "function result_element_prepend(parent, child, next)\n{\n if(next == null)\n result_element_append(parent, child);\n else\n if(parent != null && child != null)\n {\n // insert child node before the next node:\n for(var i = 0; i < parent.content.length; i++)\n {\n if(parent.content[i] == next)\n {\n parent.content.splice(i, 0, child);\n return;\n }\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n\t // skip the tag name and attribute hash\n\t var i = extract_attr( jsonml ) ? 2 : 1;\n\n\t while ( i < jsonml.length ) {\n\t // if it's a string check the next item too\n\t if ( typeof jsonml[ i ] === \"string\" ) {\n\t if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n\t // merge the second string into the first and remove it\n\t jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n\t }\n\t else {\n\t ++i;\n\t }\n\t }\n\t // if it's not a string recurse\n\t else {\n\t merge_text_nodes( jsonml[ i ] );\n\t ++i;\n\t }\n\t }\n\t}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function modText(textNode) {\n textNode.nodeValue = findReplace(textNode.nodeValue);\n console.log(textNode);\n}", "function prepend(elem, prev) {\n removeElement(prev);\n const { parent } = elem;\n if (parent) {\n const childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n\n if (elem.prev) {\n elem.prev.next = prev;\n }\n\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}", "function removeLeadingNewline(node) {\n if (node.nodeType !== 3 || node.nodeName !== '#text') {\n return;\n }\n\n node.nodeValue = node.nodeValue.replace(/^\\n/, '');\n }", "function atText(node) {\n var elem = node.cloneNode(true);\n for (var i = elem.childNodes.length - 1; i >= 0; i--) {\n if (elem.childNodes[i].tagName) elem.removeChild(elem.childNodes[i]);\n }\n return elem['innerText' in elem ? 'innerText' : 'textContent'];\n }", "function insertNewLine(newLine, doc, pre, lineNum, lines, node, offset){\r\n//debug('inserting:')\r\n//debug(newLine+'nl');\r\n //if the node is the PRE node, with a BR node immediately ahead of it,\r\n //then the offset is really the number\r\n //of nodes down from the top we are, not a location in text\r\n //The line is blank - just insert new text.\r\n if(node.nodeName=='PRE' && node.childNodes[offset].nodeName=='BR' && node.childNodes[offset-1].nodeName=='BR'){\r\n //debug('the node is a pre');\r\n //debug(offset);\r\n //debug(offset-1);\r\n //debug(node.childNodes);\r\n //debug(node.childNodes[offset]);\r\n //debug(node.childNodes[offset-1]);\r\n var newTextNode = doc.createTextNode(newLine);\r\n //var newTextNode = doc.createTextNode(\"foo\");\r\n var newBR = doc.createElement('BR');\r\n //debug('pre - new text node');\r\n //debug(newTextNode);\r\n //debug(pre);\r\n //debug('offset');\r\n \r\n var o=pre.childNodes[offset];\r\n //debug(o);\r\n if(o.nextSibling){\r\n //debug('pre - has next sibling:');\r\n //debug(o.nextSibling);\r\n pre.insertBefore(newTextNode, o.nextSibling);\r\n }else{\r\n //this seems to work\r\n //debug('pre - append child');\r\n //debug(pre.childNodes);\r\n pre.insertBefore(newTextNode, o);\r\n }\r\n //debug('done inserting for pre');\r\n }else{\r\n // if the node is the end-of-line kind of PRE, then we just have to turn it\r\n // into a real node.\r\n// if (node.nodeName == 'PRE' && node.childNodes[offset].nodeName == 'BR' &&\r\n// node.childNodes[offset-1].nodeName != 'BR'){\r\n// debug('the node IS AN END-OF-LINE pre'); \r\n// }\r\n\r\n //the node and offset are normal, we can just reference the lines.\r\n //debug('the node is not a pre');\r\n var newBR = doc.createElement('BR');\r\n var newTextNode=doc.createTextNode(newLine);\r\n \r\n //debug('notpre - new text node');\r\n //debug(newTextNode);\r\n //debug(lines[lineNum]);\r\n //debug(lines[lineNum][0]);\r\n //debug(node);\r\n if(lineNum>0){ \r\n //for every line EXCEPT the first line, you need to reinsert a BR\r\n //for the first line, no BR is needed, it just starts on a #text node.\r\n //debug('insert br');\r\n pre.insertBefore(newBR, lines[lineNum][0]);\r\n }\r\n //debug('1 insert before');\r\n //debug(newTextNode.data+'end');\r\n pre.insertBefore(newTextNode, lines[lineNum][0]);\r\n //debug('2 insert before');\r\n for(n in lines[lineNum]){\r\n //debug('remove '+n);\r\n pre.removeChild(lines[lineNum][n]);\r\n }\r\n }\r\n\r\n}", "function xWalkTreeRev( oNode, fnVisit, skip, data )\r\n{\r\n var r=null;\r\n if(oNode){if(oNode.nodeType==1&&oNode!=skip){r=fnVisit(oNode,data);if(r)return r;}\r\n for(var c=oNode.lastChild;c;c=c.previousSibling){if(c!=skip)r=xWalkTreeRev(c,fnVisit,skip,data);if(r)return r;}}\r\n return r;\r\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}", "function setText(node, text) {\n if (node.hasChildNodes() && node.firstChild.nodeType == Node.TEXT_NODE) {\n node.firstChild.nodeValue = text;\n } else {\n addText(node, text);\n }\n}", "function prevElementSibling(elem) {\n let { prev } = elem;\n while (prev !== null && !node_isTag(prev))\n ({ prev } = prev);\n return prev;\n}", "reverseNode(node, prev) {\n var newNode = new Node(node.element, prev);\n if (node.next) {\n return this.reverseNode(node.next, newNode);\n } else {\n return newNode;\n }\n }", "function setTextContent(node, text) {\n node[0].children[0].data = text;\n}", "function TextNode(text) {\n this.text = text;\n}", "function TextNode(text) {\n this.text = text;\n}", "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "function injectAfter(parentNode, referenceNode, node) {\n let beforeNode;\n if (node.parentNode === parentNode &&\n node.previousSibling === referenceNode) {\n return;\n }\n if (referenceNode == null) {\n // node is supposed to be first.\n beforeNode = parentNode.firstChild;\n } else {\n // node is supposed to be after referenceNode.\n beforeNode = referenceNode.nextSibling;\n }\n if (beforeNode && beforeNode.previousSibling !== node) {\n // Cases where `node === beforeNode` should get filtered out by earlier\n // checks and the behavior isn't well-defined.\n invariant(\n node !== beforeNode,\n 'ReactART: Can not insert node before itself'\n );\n node.injectBefore(beforeNode);\n } else if (node.parentNode !== parentNode) {\n node.inject(parentNode);\n }\n}", "function et2_insertLinkText(_text, _node, _target)\n{\n\tif(!_node)\n\t{\n\t\tegw.debug(\"warn\", \"et2_insertLinkText called without node\", _text, _node, _target);\n\t\treturn;\n\t}\n\n\t// Clear the node\n\tfor (var i = _node.childNodes.length - 1; i >= 0; i--)\n\t{\n\t\t_node.removeChild(_node.childNodes[i]);\n\t}\n\n\tfor (var i = 0; i < _text.length; i++)\n\t{\n\t\tvar s = _text[i];\n\n\t\tif (typeof s == \"string\" || typeof s == \"number\")\n\t\t{\n\t\t\t// Include line breaks\n\t\t\tvar lines = s.split ? s.split('\\n') : [s];\n\n\t\t\t// Insert the lines\n\t\t\tfor (var j = 0; j < lines.length; j++)\n\t\t\t{\n\t\t\t\t_node.appendChild(document.createTextNode(lines[j]));\n\n\t\t\t\tif (j < lines.length - 1)\n\t\t\t\t{\n\t\t\t\t\t_node.appendChild(document.createElement(\"br\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(s.text)\t// no need to generate a link, if there is no content in it\n\t\t{\n\t\t\tif(!s.href)\n\t\t\t{\n\t\t\t\tegw.debug(\"warn\", \"et2_activateLinks gave bad data\", s, _node, _target);\n\t\t\t\ts.href = \"\";\n\t\t\t}\n\t\t\tvar a = $j(document.createElement(\"a\"))\n\t\t\t\t.attr(\"href\", s.href)\n\t\t\t\t.text(s.text);\n\n\t\t\tif (typeof _target != \"undefined\" && _target && _target != \"_self\" && s.href.substr(0, 7) != \"mailto:\")\n\t\t\t{\n\t\t\t\ta.attr(\"target\", _target);\n\t\t\t}\n\t\t\t// open mailto links depending on preferences in mail app\n\t\t\tif (s.href.substr(0, 7) == \"mailto:\" &&\n\t\t\t\t(egw.user('apps').mail || egw.user('apps').felamimail) &&\n\t\t\t\tegw.preference('force_mailto','addressbook') != '1')\n\t\t\t{\n\t\t\t\ta.click(function(event){\n\t\t\t\t\tegw.open_link(this.href);\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\ta.appendTo(_node);\n\t\t}\n\t}\n}", "function merge(target, source) {\n target.additionalNodes = target.additionalNodes || [];\n target.additionalNodes.push(source.node);\n if (source.additionalNodes) {\n (_a = target.additionalNodes).push.apply(_a, source.additionalNodes);\n }\n target.children = ts.concatenate(target.children, source.children);\n if (target.children) {\n mergeChildren(target.children);\n sortChildren(target.children);\n }\n var _a;\n }", "merge(data) {\n this.data = { text: this.data.text + data.text }\n }", "getPreviousTextInline(inline) {\n if (inline.previousNode instanceof TextElementBox) {\n return inline.previousNode;\n }\n if (inline.previousNode instanceof FieldElementBox && HelperMethods.isLinkedFieldCharacter(inline.previousNode)) {\n if (inline.previousNode.fieldType === 0 || inline.previousNode.fieldType === 1) {\n return inline.previousNode;\n }\n return inline.previousNode.fieldBegin;\n }\n if (!isNullOrUndefined(inline.previousNode)) {\n return this.getPreviousTextInline((inline.previousNode));\n }\n return undefined;\n }", "function xPrevSib(e,t)\r\n{\r\n var s = e ? e.previousSibling : null;\r\n if (t) while(s && s.nodeName != t) {s=s.previousSibling;}\r\n else while(s && s.nodeType != 1) {s=s.previousSibling;}\r\n return s;\r\n}", "prepend(data) {\n console.log(\"prepend\", data);\n const node = new Node(data);\n if (this.head === null) {\n return (this.head = null);\n }\n node.next = this.head;\n this.head = node;\n }", "function _wrapMatchesInNode(textNode) {\n var parentNode = textNode.parentNode,\n tempElement = _getTempElement(parentNode.ownerDocument);\n\n // We need to insert an empty/temporary <span /> to fix IE quirks\n // Elsewise IE would strip white space in the beginning\n tempElement.innerHTML = \"<span></span>\" + _convertUrlsToLinks(textNode.data);\n tempElement.removeChild(tempElement.firstChild);\n\n while (tempElement.firstChild) {\n // inserts tempElement.firstChild before textNode\n parentNode.insertBefore(tempElement.firstChild, textNode);\n }\n parentNode.removeChild(textNode);\n }", "function parseInside (txt, left, right) {\n /*\n if (options.simplifiedAutoLink) {\n txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);\n }\n */\n return left + txt + right;\n }", "function parseInside (txt, left, right) {\n /*\n if (options.simplifiedAutoLink) {\n txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);\n }\n */\n return left + txt + right;\n }", "function parseInside (txt, left, right) {\n /*\n if (options.simplifiedAutoLink) {\n txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);\n }\n */\n return left + txt + right;\n }", "function diffNode (path, entityId, prev, next, el) {\n\t var leftType = nodeType(prev)\n\t var rightType = nodeType(next)\n\n\t // Type changed. This could be from element->text, text->ComponentA,\n\t // ComponentA->ComponentB etc. But NOT div->span. These are the same type\n\t // (ElementNode) but different tag name.\n\t if (leftType !== rightType) return replaceElement(entityId, path, el, next)\n\n\t switch (rightType) {\n\t case 'text': return diffText(prev, next, el)\n\t case 'empty': return el\n\t case 'element': return diffElement(path, entityId, prev, next, el)\n\t case 'component': return diffComponent(path, entityId, prev, next, el)\n\t }\n\t }", "function previousElementSibling(el) {\n do { el = el.previousSibling; } while ( el && el.nodeType !== 1 );\n return el;\n}", "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }" ]
[ "0.7846261", "0.62798476", "0.62798476", "0.62798476", "0.62798476", "0.62798476", "0.62798476", "0.62279105", "0.6168461", "0.6093209", "0.60050935", "0.5993574", "0.5974843", "0.59083056", "0.58984995", "0.5685879", "0.565117", "0.562197", "0.5571429", "0.55681014", "0.554602", "0.55090415", "0.5412631", "0.53852046", "0.53443146", "0.5327244", "0.5317827", "0.5288924", "0.5284663", "0.527073", "0.5269654", "0.52482194", "0.5224075", "0.52221334", "0.51974094", "0.5165467", "0.5118964", "0.5096052", "0.507358", "0.5073292", "0.505295", "0.503086", "0.5015122", "0.49737027", "0.49681574", "0.49644062", "0.49510792", "0.4947361", "0.49289677", "0.49225098", "0.49130878", "0.49130878", "0.49130878", "0.49130878", "0.49130878", "0.49099138", "0.49073017", "0.48983115", "0.48976347", "0.4885611", "0.48834854", "0.48803562", "0.48770893", "0.48746848", "0.48746848", "0.48746848", "0.48746848", "0.48746848", "0.48746848", "0.48746848", "0.48746848", "0.48746848", "0.48729184", "0.4872765", "0.48355272", "0.48330903", "0.48294762", "0.48294762", "0.48158318", "0.48158318", "0.48061118", "0.48048985", "0.48034167", "0.48006034", "0.47977144", "0.47917873", "0.4791104", "0.4790878", "0.47884178", "0.47884178", "0.47884178", "0.47875726", "0.4786527", "0.47839853", "0.47839853" ]
0.80958956
4
Merge two blockquotes: `node` into `prev`, unless in CommonMark mode.
function mergeBlockquote(prev, node) { if (this.options.commonmark) { return node; } prev.children = prev.children.concat(node.children); return prev; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeBlockquote(previous, node) {\n if (this.options.commonmark || this.options.gfm) {\n return node\n }\n\n previous.children = previous.children.concat(node.children)\n\n return previous\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(previous, node) {\n previous.value += node.value\n\n return previous\n}", "function get_or_create_prev_block(node, blockTagName) {\n var rtn = node.previousSibling;\n if (!rtn || rtn.nodeName != blockTagName) {\n rtn = node.ownerDocument.createElement(blockTagName);\n node.parentNode.insertBefore(rtn, node);\n }\n return rtn;\n }", "set prev(node) {\n this._prev = Node.sanitizeNode(node, true);\n }", "testEnterInBlockquoteRemovesExtraNodes() {\n setUpFields(true);\n\n // Let's assume we have the following DOM structure and the\n // cursor is placed after the first numbered list item \"one\".\n //\n // <blockquote class=\"tr_bq\">\n // <div><div>a</div><ol><li>one|</li></div>\n // <div>two</div>\n // </blockquote>\n //\n // After pressing enter, we have the following structure.\n //\n // <blockquote class=\"tr_bq\">\n // <div><div>a</div><ol><li>one|</li></div>\n // </blockquote>\n // <div>&nbsp;</div>\n // <blockquote class=\"tr_bq\">\n // <div><ol><li><span id=\"\"></span></li></ol></div>\n // <div>two</div>\n // </blockquote>\n //\n // This appears to the user as an empty list. After the fix, the HTML\n // will be\n //\n // <blockquote class=\"tr_bq\">\n // <div><div>a</div><ol><li>one|</li></div>\n // </blockquote>\n // <div>&nbsp;</div>\n // <blockquote class=\"tr_bq\">\n // <div>two</div>\n // </blockquote>\n //\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote class=\"tr_bq\">' +\n '<div><div>a</div><ol><li id=\"cursor\">one</li></div>' +\n '<div>b</div>' +\n '</blockquote>'));\n const dom = field1.getEditableDomHelper();\n Range.createCaret(dom.getElement('cursor').firstChild, 3).select();\n testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);\n const elem = field1.getElement();\n let secondBlockquote =\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)[1];\n assertHTMLEquals('<div>b</div>', secondBlockquote.innerHTML);\n\n // Ensure that we remove only unnecessary subtrees.\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote class=\"tr_bq\">' +\n '<div><span>a</span><div id=\"cursor\">one</div><div>two</div></div>' +\n '<div><span>c</span></div>' +\n '</blockquote>'));\n Range.createCaret(dom.getElement('cursor').firstChild, 3).select();\n testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);\n secondBlockquote =\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)[1];\n const expectedHTML = '<div><div>two</div></div>' +\n '<div><span>c</span></div>';\n assertHTMLEquals(expectedHTML, secondBlockquote.innerHTML);\n\n // Place the cursor in the middle of a line.\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote id=\"quote\" class=\"tr_bq\">' +\n '<div>one</div><div>two</div>' +\n '</blockquote>'));\n Range.createCaret(dom.getElement('quote').firstChild.firstChild, 1)\n .select();\n testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);\n const blockquotes =\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem);\n assertEquals(2, blockquotes.length);\n assertHTMLEquals('<div>o</div>', blockquotes[0].innerHTML);\n assertHTMLEquals('<div>ne</div><div>two</div>', blockquotes[1].innerHTML);\n }", "function mergeTwoNodes(node1, node2) {\n node1.innerHTML = node1.innerHTML + node2.innerHTML\n return node1\n}", "function getRealPreviousSibling(node) {\n var prevSibling = node;\n do {\n prevSibling = prevSibling.previousSibling;\n } while (prevSibling && isEmptyTextNode(prevSibling));\n return prevSibling;\n}", "function prev(n){\n while((n = n.previousSibling) && n.nodeType != 1);\n return n;\n }", "function prevNode(node) {\n if (!node) return null;\n if (node.previousSibling) {\n return previousDeep(node.previousSibling);\n }\n return node.parentNode;\n}", "function insert_before(n1,n2){\r\n\tvar before = get_prev(n1);\r\n\tif(is_empty_node(before)){\r\n\t\tset_previous(n1,n2);\r\n\t\tset_next(n2,n1);\r\n\t\tset_previous(n2,empty_node);\r\n\t}else{\r\n\t\tset_next(before,n2);\r\n\t\tset_previous(n2,before);\r\n\t\tset_next(n2,n1);\r\n\t\tset_previous(n1,n2);\r\n\r\n\t}\r\n}", "function previousDeep(node) {\n if (!node) return null;\n while (node.childNodes.length) {\n node = node.lastChild;\n }\n return node;\n}", "function trimNode(node) {\n\t\t\t\tvar i, children = node.childNodes, type = node.nodeType;\n\n\t\t\t\tfunction surroundedBySpans(node) {\n\t\t\t\t\tvar previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';\n\t\t\t\t\tvar nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';\n\t\t\t\t\treturn previousIsSpan && nextIsSpan;\n\t\t\t\t}\n\n\t\t\t\tif (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (i = children.length - 1; i >= 0; i--) {\n\t\t\t\t\ttrimNode(children[i]);\n\t\t\t\t}\n\n\t\t\t\tif (type != 9) {\n\t\t\t\t\t// Keep non whitespace text nodes\n\t\t\t\t\tif (type == 3 && node.nodeValue.length > 0) {\n\t\t\t\t\t\t// If parent element isn't a block or there isn't any useful contents for example \"<p> </p>\"\n\t\t\t\t\t\t// Also keep text nodes with only spaces if surrounded by spans.\n\t\t\t\t\t\t// eg. \"<p><span>a</span> <span>b</span></p>\" should keep space between a and b\n\t\t\t\t\t\tvar trimmedLength = trim(node.nodeValue).length;\n\t\t\t\t\t\tif (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (type == 1) {\n\t\t\t\t\t\t// If the only child is a bookmark then move it up\n\t\t\t\t\t\tchildren = node.childNodes;\n\n\t\t\t\t\t\t// TODO fix this complex if\n\t\t\t\t\t\tif (children.length == 1 && children[0] && children[0].nodeType == 1 &&\n\t\t\t\t\t\t\tchildren[0].getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\t\t\tnode.parentNode.insertBefore(children[0], node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Keep non empty elements or img, hr etc\n\t\t\t\t\t\tif (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.remove(node);\n\t\t\t\t}\n\n\t\t\t\treturn node;\n\t\t\t}", "function trimNode(node) {\n\t\t\t\tvar i, children = node.childNodes, type = node.nodeType;\n\n\t\t\t\tfunction surroundedBySpans(node) {\n\t\t\t\t\tvar previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';\n\t\t\t\t\tvar nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';\n\t\t\t\t\treturn previousIsSpan && nextIsSpan;\n\t\t\t\t}\n\n\t\t\t\tif (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (i = children.length - 1; i >= 0; i--) {\n\t\t\t\t\ttrimNode(children[i]);\n\t\t\t\t}\n\n\t\t\t\tif (type != 9) {\n\t\t\t\t\t// Keep non whitespace text nodes\n\t\t\t\t\tif (type == 3 && node.nodeValue.length > 0) {\n\t\t\t\t\t\t// If parent element isn't a block or there isn't any useful contents for example \"<p> </p>\"\n\t\t\t\t\t\t// Also keep text nodes with only spaces if surrounded by spans.\n\t\t\t\t\t\t// eg. \"<p><span>a</span> <span>b</span></p>\" should keep space between a and b\n\t\t\t\t\t\tvar trimmedLength = trim(node.nodeValue).length;\n\t\t\t\t\t\tif (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (type == 1) {\n\t\t\t\t\t\t// If the only child is a bookmark then move it up\n\t\t\t\t\t\tchildren = node.childNodes;\n\n\t\t\t\t\t\t// TODO fix this complex if\n\t\t\t\t\t\tif (children.length == 1 && children[0] && children[0].nodeType == 1 &&\n\t\t\t\t\t\t\tchildren[0].getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\t\t\tnode.parentNode.insertBefore(children[0], node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Keep non empty elements or img, hr etc\n\t\t\t\t\t\tif (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.remove(node);\n\t\t\t\t}\n\n\t\t\t\treturn node;\n\t\t\t}", "function trimNode(node) {\n\t\t\t\tvar i, children = node.childNodes, type = node.nodeType;\n\n\t\t\t\tfunction surroundedBySpans(node) {\n\t\t\t\t\tvar previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';\n\t\t\t\t\tvar nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';\n\t\t\t\t\treturn previousIsSpan && nextIsSpan;\n\t\t\t\t}\n\n\t\t\t\tif (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (i = children.length - 1; i >= 0; i--) {\n\t\t\t\t\ttrimNode(children[i]);\n\t\t\t\t}\n\n\t\t\t\tif (type != 9) {\n\t\t\t\t\t// Keep non whitespace text nodes\n\t\t\t\t\tif (type == 3 && node.nodeValue.length > 0) {\n\t\t\t\t\t\t// If parent element isn't a block or there isn't any useful contents for example \"<p> </p>\"\n\t\t\t\t\t\t// Also keep text nodes with only spaces if surrounded by spans.\n\t\t\t\t\t\t// eg. \"<p><span>a</span> <span>b</span></p>\" should keep space between a and b\n\t\t\t\t\t\tvar trimmedLength = trim(node.nodeValue).length;\n\t\t\t\t\t\tif (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (type == 1) {\n\t\t\t\t\t\t// If the only child is a bookmark then move it up\n\t\t\t\t\t\tchildren = node.childNodes;\n\n\t\t\t\t\t\t// TODO fix this complex if\n\t\t\t\t\t\tif (children.length == 1 && children[0] && children[0].nodeType == 1 &&\n\t\t\t\t\t\t\tchildren[0].getAttribute('data-mce-type') == 'bookmark') {\n\t\t\t\t\t\t\tnode.parentNode.insertBefore(children[0], node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Keep non empty elements or img, hr etc\n\t\t\t\t\t\tif (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.remove(node);\n\t\t\t\t}\n\n\t\t\t\treturn node;\n\t\t\t}", "testEnterInBlockquoteRemovesUnnecessaryBrWithCursorBeforeBr() {\n setUpFields(true);\n\n // Assume the following HTML snippet:-\n // <blockquote>one|<br>two<br></blockquote>\n //\n // After enter on the cursor position, the resulting HTML should be.\n // <blockquote>one<br></blockquote>\n // <div>&nbsp;</div>\n // <blockquote>two<br></blockquote>\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote id=\"quote\" class=\"tr_bq\">one<br>' +\n 'two<br></blockquote>'));\n const dom = field1.getEditableDomHelper();\n let cursor = dom.getElement('quote').firstChild;\n Range.createCaret(cursor, 3).select();\n testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);\n const elem = field1.getElement();\n let secondBlockquote =\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)[1];\n assertHTMLEquals('two<br>', secondBlockquote.innerHTML);\n\n // Ensures that standard text node split works as expected with the new\n // change.\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote id=\"quote\" class=\"tr_bq\">one<b>two</b><br>'));\n cursor = dom.getElement('quote').firstChild;\n Range.createCaret(cursor, 3).select();\n testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);\n secondBlockquote =\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)[1];\n assertHTMLEquals('<b>two</b><br>', secondBlockquote.innerHTML);\n }", "function emitTagAndPreviousTextNode() {\n var textBeforeTag = html.slice(currentDataIdx, currentTag.idx);\n if (textBeforeTag) {\n // the html tag was the first element in the html string, or two \n // tags next to each other, in which case we should not emit a text \n // node\n onText(textBeforeTag, currentDataIdx);\n }\n if (currentTag.type === 'comment') {\n onComment(currentTag.idx);\n }\n else if (currentTag.type === 'doctype') {\n onDoctype(currentTag.idx);\n }\n else {\n if (currentTag.isOpening) {\n onOpenTag(currentTag.name, currentTag.idx);\n }\n if (currentTag.isClosing) { // note: self-closing tags will emit both opening and closing\n onCloseTag(currentTag.name, currentTag.idx);\n }\n }\n // Since we just emitted a tag, reset to the data state for the next char\n resetToDataState();\n currentDataIdx = charIdx + 1;\n }", "function emitTagAndPreviousTextNode() {\n var textBeforeTag = html.slice(currentDataIdx, currentTag.idx);\n if (textBeforeTag) {\n // the html tag was the first element in the html string, or two \n // tags next to each other, in which case we should not emit a text \n // node\n onText(textBeforeTag, currentDataIdx);\n }\n if (currentTag.type === 'comment') {\n onComment(currentTag.idx);\n }\n else if (currentTag.type === 'doctype') {\n onDoctype(currentTag.idx);\n }\n else {\n if (currentTag.isOpening) {\n onOpenTag(currentTag.name, currentTag.idx);\n }\n if (currentTag.isClosing) { // note: self-closing tags will emit both opening and closing\n onCloseTag(currentTag.name, currentTag.idx);\n }\n }\n // Since we just emitted a tag, reset to the data state for the next char\n resetToDataState();\n currentDataIdx = charIdx + 1;\n }", "testEnterInBlockquoteRemovesUnnecessaryBrWithCursorAfterBr() {\n setUpFields(true);\n\n // Assume the following HTML snippet:-\n // <blockquote>one<br>|two<br></blockquote>\n //\n // After enter on the cursor position without the fix, the resulting HTML\n // after the blockquote split was:-\n // <blockquote>one</blockquote>\n // <div>&nbsp;</div>\n // <blockquote><br>two<br></blockquote>\n //\n // This creates the impression on an unnecessary newline. The resulting HTML\n // after the fix is:-\n //\n // <blockquote>one<br></blockquote>\n // <div>&nbsp;</div>\n // <blockquote>two<br></blockquote>\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote id=\"quote\" class=\"tr_bq\">one<br>' +\n 'two<br></blockquote>'));\n const dom = field1.getEditableDomHelper();\n Range.createCaret(dom.getElement('quote'), 2).select();\n testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);\n const elem = field1.getElement();\n const secondBlockquote =\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)[1];\n assertHTMLEquals('two<br>', secondBlockquote.innerHTML);\n\n // Verifies that a blockquote split doesn't happen if it doesn't need to.\n field1.setSafeHtml(\n false,\n testing.newSafeHtmlForTest(\n '<blockquote class=\"tr_bq\">one<br id=\"brcursor\"></blockquote>'));\n selectNodeAndHitEnter(field1, 'brcursor');\n assertEquals(\n 1,\n dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)\n .length);\n }", "function previousSibling(node) {\n var node = node.previousSibling;\n try {\n while(node.data) node = node.previousSibling;\n } catch(e) {}\n return node;\n}", "function result_element_prepend(parent, child, next)\n{\n if(next == null)\n result_element_append(parent, child);\n else\n if(parent != null && child != null)\n {\n // insert child node before the next node:\n for(var i = 0; i < parent.content.length; i++)\n {\n if(parent.content[i] == next)\n {\n parent.content.splice(i, 0, child);\n return;\n }\n }\n }\n}", "function getPreviousSibling(startBrother) {\n\tendBrother = startBrother.previousSibling;\n\twhile(endBrother.nodeType != 1) endBrother = endBrother.previousSibling;\n\treturn endBrother;\n}", "function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }", "function prev(node) {\r\n var prev_node;\r\n\r\n assert(isElement(node), 'pklib.dom.prev: @node is not HTMLElement');\r\n\r\n while (true) {\r\n prev_node = node.previousSibling;\r\n if (prev_node !== undefined && prev_node !== null && prev_node.nodeType !== node_types.ELEMENT_NODE) {\r\n node = prev_node;\r\n } else {\r\n break;\r\n }\r\n }\r\n return prev_node;\r\n }", "function _insertBefore(parentNode, newChild, nextChild) {\n var cp = newChild.parentNode;\n\n if (cp) {\n cp.removeChild(newChild); //remove and update\n }\n\n if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {\n var newFirst = newChild.firstChild;\n\n if (newFirst == null) {\n return newChild;\n }\n\n var newLast = newChild.lastChild;\n } else {\n newFirst = newLast = newChild;\n }\n\n var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n newFirst.previousSibling = pre;\n newLast.nextSibling = nextChild;\n\n if (pre) {\n pre.nextSibling = newFirst;\n } else {\n parentNode.firstChild = newFirst;\n }\n\n if (nextChild == null) {\n parentNode.lastChild = newLast;\n } else {\n nextChild.previousSibling = newLast;\n }\n\n do {\n newFirst.parentNode = parentNode;\n } while (newFirst !== newLast && (newFirst = newFirst.nextSibling));\n\n _onUpdateChild(parentNode.ownerDocument || parentNode, parentNode); //console.log(parentNode.lastChild.nextSibling == null)\n\n\n if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n newChild.firstChild = newChild.lastChild = null;\n }\n\n return newChild;\n}", "previous(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n mode = 'lowest',\n voids = false\n } = options;\n var {\n match,\n at = editor.selection\n } = options;\n\n if (!at) {\n return;\n }\n\n var [, from] = Editor.first(editor, at);\n var [, to] = Editor.first(editor, []);\n var span = [from, to];\n\n if (Path.isPath(at) && at.length === 0) {\n throw new Error(\"Cannot get the previous node from the root node!\");\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = () => true;\n }\n }\n\n var [, previous] = Editor.nodes(editor, {\n reverse: true,\n at: span,\n match,\n mode,\n voids\n });\n return previous;\n }", "insertBefore(node) {\n if (this.fragment.hasChildNodes()) {\n node.parentNode.insertBefore(this.fragment, node);\n } else {\n const parentNode = node.parentNode;\n const end = this.lastChild;\n let current = this.firstChild;\n let next;\n\n while (current !== end) {\n next = current.nextSibling;\n parentNode.insertBefore(current, node);\n current = next;\n }\n\n parentNode.insertBefore(end, node);\n }\n }", "mergeNodes(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n match,\n at = editor.selection\n } = options;\n var {\n hanging = false,\n voids = false,\n mode = 'lowest'\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = n => Editor.isBlock(editor, n);\n }\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n if (Range.isRange(at)) {\n if (Range.isCollapsed(at)) {\n at = at.anchor;\n } else {\n var [, end] = Range.edges(at);\n var pointRef = Editor.pointRef(editor, end);\n Transforms.delete(editor, {\n at\n });\n at = pointRef.unref();\n\n if (options.at == null) {\n Transforms.select(editor, at);\n }\n }\n }\n\n var [current] = Editor.nodes(editor, {\n at,\n match,\n voids,\n mode\n });\n var prev = Editor.previous(editor, {\n at,\n match,\n voids,\n mode\n });\n\n if (!current || !prev) {\n return;\n }\n\n var [node, path] = current;\n var [prevNode, prevPath] = prev;\n\n if (path.length === 0 || prevPath.length === 0) {\n return;\n }\n\n var newPath = Path.next(prevPath);\n var commonPath = Path.common(path, prevPath);\n var isPreviousSibling = Path.isSibling(path, prevPath);\n var levels = Array.from(Editor.levels(editor, {\n at: path\n }), _ref2 => {\n var [n] = _ref2;\n return n;\n }).slice(commonPath.length).slice(0, -1); // Determine if the merge will leave an ancestor of the path empty as a\n // result, in which case we'll want to remove it after merging.\n\n var emptyAncestor = Editor.above(editor, {\n at: path,\n mode: 'highest',\n match: n => levels.includes(n) && hasSingleChildNest(editor, n)\n });\n var emptyRef = emptyAncestor && Editor.pathRef(editor, emptyAncestor[1]);\n var properties;\n var position; // Ensure that the nodes are equivalent, and figure out what the position\n // and extra properties of the merge will be.\n\n if (Text.isText(node) && Text.isText(prevNode)) {\n var rest = _objectWithoutProperties(node, _excluded);\n\n position = prevNode.text.length;\n properties = rest;\n } else if (Element.isElement(node) && Element.isElement(prevNode)) {\n var rest = _objectWithoutProperties(node, _excluded2);\n\n position = prevNode.children.length;\n properties = rest;\n } else {\n throw new Error(\"Cannot merge the node at path [\".concat(path, \"] with the previous sibling because it is not the same kind: \").concat(JSON.stringify(node), \" \").concat(JSON.stringify(prevNode)));\n } // If the node isn't already the next sibling of the previous node, move\n // it so that it is before merging.\n\n\n if (!isPreviousSibling) {\n Transforms.moveNodes(editor, {\n at: path,\n to: newPath,\n voids\n });\n } // If there was going to be an empty ancestor of the node that was merged,\n // we remove it from the tree.\n\n\n if (emptyRef) {\n Transforms.removeNodes(editor, {\n at: emptyRef.current,\n voids\n });\n } // If the target node that we're merging with is empty, remove it instead\n // of merging the two. This is a common rich text editor behavior to\n // prevent losing formatting when deleting entire nodes when you have a\n // hanging selection.\n // if prevNode is first child in parent,don't remove it.\n\n\n if (Element.isElement(prevNode) && Editor.isEmpty(editor, prevNode) || Text.isText(prevNode) && prevNode.text === '' && prevPath[prevPath.length - 1] !== 0) {\n Transforms.removeNodes(editor, {\n at: prevPath,\n voids\n });\n } else {\n editor.apply({\n type: 'merge_node',\n path: newPath,\n position,\n properties\n });\n }\n\n if (emptyRef) {\n emptyRef.unref();\n }\n });\n }", "mergeNodes(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n match,\n at = editor.selection\n } = options;\n var {\n hanging = false,\n voids = false,\n mode = 'lowest'\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = n => Editor.isBlock(editor, n);\n }\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n if (Range.isRange(at)) {\n if (Range.isCollapsed(at)) {\n at = at.anchor;\n } else {\n var [, end] = Range.edges(at);\n var pointRef = Editor.pointRef(editor, end);\n Transforms.delete(editor, {\n at\n });\n at = pointRef.unref();\n\n if (options.at == null) {\n Transforms.select(editor, at);\n }\n }\n }\n\n var [current] = Editor.nodes(editor, {\n at,\n match,\n voids,\n mode\n });\n var prev = Editor.previous(editor, {\n at,\n match,\n voids,\n mode\n });\n\n if (!current || !prev) {\n return;\n }\n\n var [node, path] = current;\n var [prevNode, prevPath] = prev;\n\n if (path.length === 0 || prevPath.length === 0) {\n return;\n }\n\n var newPath = Path.next(prevPath);\n var commonPath = Path.common(path, prevPath);\n var isPreviousSibling = Path.isSibling(path, prevPath);\n var levels = Array.from(Editor.levels(editor, {\n at: path\n }), (_ref2) => {\n var [n] = _ref2;\n return n;\n }).slice(commonPath.length).slice(0, -1); // Determine if the merge will leave an ancestor of the path empty as a\n // result, in which case we'll want to remove it after merging.\n\n var emptyAncestor = Editor.above(editor, {\n at: path,\n mode: 'highest',\n match: n => levels.includes(n) && Element.isElement(n) && n.children.length === 1\n });\n var emptyRef = emptyAncestor && Editor.pathRef(editor, emptyAncestor[1]);\n var properties;\n var position; // Ensure that the nodes are equivalent, and figure out what the position\n // and extra properties of the merge will be.\n\n if (Text.isText(node) && Text.isText(prevNode)) {\n var rest = _objectWithoutProperties(node, [\"text\"]);\n\n position = prevNode.text.length;\n properties = rest;\n } else if (Element.isElement(node) && Element.isElement(prevNode)) {\n var rest = _objectWithoutProperties(node, [\"children\"]);\n\n position = prevNode.children.length;\n properties = rest;\n } else {\n throw new Error(\"Cannot merge the node at path [\".concat(path, \"] with the previous sibling because it is not the same kind: \").concat(JSON.stringify(node), \" \").concat(JSON.stringify(prevNode)));\n } // If the node isn't already the next sibling of the previous node, move\n // it so that it is before merging.\n\n\n if (!isPreviousSibling) {\n Transforms.moveNodes(editor, {\n at: path,\n to: newPath,\n voids\n });\n } // If there was going to be an empty ancestor of the node that was merged,\n // we remove it from the tree.\n\n\n if (emptyRef) {\n Transforms.removeNodes(editor, {\n at: emptyRef.current,\n voids\n });\n } // If the target node that we're merging with is empty, remove it instead\n // of merging the two. This is a common rich text editor behavior to\n // prevent losing formatting when deleting entire nodes when you have a\n // hanging selection.\n\n\n if (Element.isElement(prevNode) && Editor.isEmpty(editor, prevNode) || Text.isText(prevNode) && prevNode.text === '') {\n Transforms.removeNodes(editor, {\n at: prevPath,\n voids\n });\n } else {\n editor.apply({\n type: 'merge_node',\n path: newPath,\n position,\n properties\n });\n }\n\n if (emptyRef) {\n emptyRef.unref();\n }\n });\n }", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "function _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}", "leafFallback(dom) {\n if (dom.nodeName == \"BR\" && this.top.type && this.top.type.inlineContent)\n this.addTextNode(dom.ownerDocument.createTextNode(\"\\n\"));\n }", "function prevElementSibling(elem) {\n let { prev } = elem;\n while (prev !== null && !node_isTag(prev))\n ({ prev } = prev);\n return prev;\n}", "function GetPreviousTextNode(pNode) {\n\tvar lPreviuosSibling = false;\n\tvar lParent = pNode;\n\twhile(lParent){\n\t\tlPreviuosSibling = lParent.previousSibling;\n\t\twhile(lPreviuosSibling){\n\t\t\tif(lPreviuosSibling.nodeType == 3)\n\t\t\t\treturn lPreviuosSibling;\n\t\t\tif(lPreviuosSibling.nodeType == 1){\n\t\t\t\tvar lTextNode = GetLastTextNodeDescendant(lPreviuosSibling);\n\t\t\t\tif(lTextNode)\n\t\t\t\t\treturn lTextNode;\n\t\t\t}\n\t\t\tlPreviuosSibling = lPreviuosSibling.previousSibling;\n\t\t}\n\t\tlParent = lParent.parentNode;\n\t}\n\treturn false;\n}", "function mergeTextNodes(data, coupleData, mode) {\n var prev = data.node;\n var next = data.node;\n var tagsMerged = mode === 'both' ? true : false;\n var remove = [];\n\n while (true) {\n prev = prev.previousSibling;\n if (!prev || prev.nodeType !== Node.TEXT_NODE) break;\n\n if (prev === coupleData.node) {\n tagsMerged = true;\n data.index += prev.nodeValue.length;\n data.node.nodeValue = prev.nodeValue + data.node.nodeValue;\n coupleData.node = data.node;\n } else if (prev.nodeValue.trim().length) {\n break;\n }\n\n remove.push(prev);\n }\n\n while (true) {\n next = next.nextSibling;\n if (!next || next.nodeType !== Node.TEXT_NODE) break;\n\n if (next === coupleData.node) {\n tagsMerged = true;\n coupleData.index += data.node.nodeValue.length;\n data.node.nodeValue = data.node.nodeValue + next.nodeValue;\n coupleData.node = data.node;\n } else if (next.nodeValue.trim().length) {\n break;\n }\n\n remove.push(next);\n }\n\n var parent = data.node.parentElement;\n for (var i = 0; i < remove.length; i++) {\n parent.removeChild(remove[i]);\n }\n\n return tagsMerged;\n}", "function _insertBefore(parentNode, newChild, nextChild) {\n var cp = newChild.parentNode;\n if (cp) {\n cp.removeChild(newChild); //remove and update\n }\n if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {\n var newFirst = newChild.firstChild;\n if (newFirst == null) {\n return newChild;\n }\n var newLast = newChild.lastChild;\n } else {\n newFirst = newLast = newChild;\n }\n var pre = nextChild\n ? nextChild.previousSibling\n : parentNode.lastChild;\n\n newFirst.previousSibling = pre;\n newLast.nextSibling = nextChild;\n\n if (pre) {\n pre.nextSibling = newFirst;\n } else {\n parentNode.firstChild = newFirst;\n }\n if (nextChild == null) {\n parentNode.lastChild = newLast;\n } else {\n nextChild.previousSibling = newLast;\n }\n do {\n newFirst.parentNode = parentNode;\n } while (\n newFirst !== newLast &&\n (newFirst = newFirst.nextSibling)\n );\n _onUpdateChild(\n parentNode.ownerDocument || parentNode,\n parentNode\n );\n //console.log(parentNode.lastChild.nextSibling == null)\n if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n newChild.firstChild = newChild.lastChild = null;\n }\n return newChild;\n }", "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "function _getPreviousSiblingThatIsNotBlank(node) {\n var previousSibling = node.previousSibling;\n while (previousSibling && _isBlankTextNode(previousSibling)) {\n previousSibling = previousSibling.previousSibling;\n }\n return previousSibling;\n }", "function _removeLineBreakBeforeAndAfter(node) {\n var nextSibling = _getNextSiblingThatIsNotBlank(node),\n previousSibling = _getPreviousSiblingThatIsNotBlank(node);\n\n if (nextSibling && _isLineBreak(nextSibling)) {\n nextSibling.parentNode.removeChild(nextSibling);\n }\n if (previousSibling && _isLineBreak(previousSibling)) {\n previousSibling.parentNode.removeChild(previousSibling);\n }\n }", "function _removeLineBreakBeforeAndAfter(node) {\n var nextSibling = _getNextSiblingThatIsNotBlank(node),\n previousSibling = _getPreviousSiblingThatIsNotBlank(node);\n\n if (nextSibling && _isLineBreak(nextSibling)) {\n nextSibling.parentNode.removeChild(nextSibling);\n }\n if (previousSibling && _isLineBreak(previousSibling)) {\n previousSibling.parentNode.removeChild(previousSibling);\n }\n }", "function merge(n1, n2) {\n n1.eval = n2.eval;\n if (n2.glyphs) n1.glyphs = n2.glyphs;\n n2.comments && n2.comments.forEach(function(c) {\n if (!n1.comments) n1.comments = [c];\n else if (!n1.comments.filter(function(d) {\n return d.text === c.text;\n }).length) n1.comments.push(c);\n });\n n2.children.forEach(function(c) {\n var existing = childById(n1, c.id);\n if (existing) merge(existing, c);\n else n1.children.push(c);\n });\n}", "function getCommentPrecedingNode(parsed, node) {\n var statementPath = statementOf(parsed, node, { asPath: true }),\n blockPath = statementPath.slice(0, -2),\n block = lively_lang.Path(blockPath).get(parsed);\n\n return !block.comments || !block.comments.length ? null : lively_lang.chain(extractComments(parsed)).reversed().detect(function (ea) {\n return ea.followingNode === node;\n }).value();\n}", "previous(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n mode = 'lowest',\n voids = false\n } = options;\n var {\n match,\n at = editor.selection\n } = options;\n\n if (!at) {\n return;\n }\n\n var pointBeforeLocation = Editor.before(editor, at, {\n voids\n });\n\n if (!pointBeforeLocation) {\n return;\n }\n\n var [, to] = Editor.first(editor, []); // The search location is from the start of the document to the path of\n // the point before the location passed in\n\n var span = [pointBeforeLocation.path, to];\n\n if (Path.isPath(at) && at.length === 0) {\n throw new Error(\"Cannot get the previous node from the root node!\");\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = () => true;\n }\n }\n\n var [previous] = Editor.nodes(editor, {\n reverse: true,\n at: span,\n match,\n mode,\n voids\n });\n return previous;\n }", "function isPreviousLineEmpty(text, node) {\n let idx = locStart$1(node) - 1;\n idx = skipSpaces(text, idx, { backwards: true });\n idx = skipNewline(text, idx, { backwards: true });\n idx = skipSpaces(text, idx, { backwards: true });\n const idx2 = skipNewline(text, idx, { backwards: true });\n return idx !== idx2;\n}", "function insertBeforeEnd(node,html)\r\n{\r\n\r\n\tif(node.insertAdjacentHTML)\r\n\t{\r\n\t\tnode.insertAdjacentHTML('beforeEnd', html);\t\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\t//--\r\n\t\t//-- netscape way of inserting html ()\r\n\t\tvar r = node.ownerDocument.createRange();\r\n\t\tr.setStartBefore(node);\r\n\t\tvar parsedHTML = r.createContextualFragment(html);\r\n\t\tnode.appendChild(parsedHTML);\r\n\t}\r\n\r\n\treturn node.lastChild;\r\n}", "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "oppositeNode(node) {\n if (this.inputNode === node) {\n return this.outputNode;\n } else if (this.outputNode === node) {\n return this.inputNode;\n }\n\n return;\n }", "function diffText (previous, current, el) {\n\t if (current !== previous) el.data = current\n\t return el\n\t }", "* tryCombineWithLeft (op) {\n if (\n op != null &&\n op.left != null &&\n op.content != null &&\n op.left[0] === op.id[0] &&\n Y.utils.compareIds(op.left, op.origin)\n ) {\n var left = yield* this.getInsertion(op.left)\n if (left.content != null &&\n left.id[1] + left.content.length === op.id[1] &&\n left.originOf.length === 1 &&\n !left.gc && !left.deleted &&\n !op.gc && !op.deleted\n ) {\n // combine!\n if (op.originOf != null) {\n left.originOf = op.originOf\n } else {\n delete left.originOf\n }\n left.content = left.content.concat(op.content)\n left.right = op.right\n yield* this.os.delete(op.id)\n yield* this.setOperation(left)\n }\n }\n }", "function removeBlockQuoteOnBackSpace() {\n\t\t\t// Add block quote deletion handler\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng, container, offset, root, parent;\n\n\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trng = selection.getRng();\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\troot = dom.getRoot();\n\t\t\t\tparent = container;\n\n\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t}\n\n\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\n\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function removeBlockQuoteOnBackSpace() {\n\t\t\t// Add block quote deletion handler\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng, container, offset, root, parent;\n\n\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trng = selection.getRng();\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\troot = dom.getRoot();\n\t\t\t\tparent = container;\n\n\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t}\n\n\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\n\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function removeBlockQuoteOnBackSpace() {\n\t\t\t// Add block quote deletion handler\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng, container, offset, root, parent;\n\n\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trng = selection.getRng();\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\troot = dom.getRoot();\n\t\t\t\tparent = container;\n\n\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t}\n\n\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\n\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling}", "function prepend(elem,prev){var parent=elem.parent;if(parent){var childs=parent.children;childs.splice(childs.lastIndexOf(elem),0,prev);}if(elem.prev){elem.prev.next=prev;}prev.parent=parent;prev.prev=elem.prev;prev.next=elem;elem.prev=prev;}", "function diffText (previous, current, el) {\n if (current.data !== previous.data) el.data = current.data\n return el\n }", "insertNode(node) {\n if (node.isInline && this.needsBlock && !this.top.type) {\n let block = this.textblockFromContext();\n if (block)\n this.enterInner(block);\n }\n if (this.findPlace(node)) {\n this.closeExtra();\n let top = this.top;\n top.applyPending(node.type);\n if (top.match)\n top.match = top.match.matchType(node.type);\n let marks = top.activeMarks;\n for (let i = 0; i < node.marks.length; i++)\n if (!top.type || top.type.allowsMarkType(node.marks[i].type))\n marks = node.marks[i].addToSet(marks);\n top.content.push(node.mark(marks));\n return true;\n }\n return false;\n }", "function getPreviousBlock(editor) {\n return getNearbyBlock(editor, \"previous\");\n}", "function mergeSelectedBlockAndSetToInlineContainer(editor, options) {\n const { mode = \"previous\" } = options;\n const selection = editor.selection;\n if (!selection)\n return;\n const [, selectedBlockPath] = index_es/* Editor.parent */.ML.parent(editor, selection.anchor.path);\n const mergePath = mode === \"previous\" ? selectedBlockPath : index_es/* Path.next */.y$.next(selectedBlockPath);\n // The path of the newly merged node\n const resultingPath = mode === \"previous\"\n ? index_es/* Path.previous */.y$.previous(selectedBlockPath)\n : selectedBlockPath;\n index_es/* Editor.withoutNormalizing */.ML.withoutNormalizing(editor, () => {\n index_es/* Transforms.mergeNodes */.YR.mergeNodes(editor, { at: mergePath });\n index_es/* Transforms.setNodes */.YR.setNodes(editor, { type: utils_NodeTypes.INLINE_CONTAINER }, { at: resultingPath });\n });\n}", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling;}", "function injectAfter(parentNode, referenceNode, node) {\n let beforeNode;\n if (node.parentNode === parentNode &&\n node.previousSibling === referenceNode) {\n return;\n }\n if (referenceNode == null) {\n // node is supposed to be first.\n beforeNode = parentNode.firstChild;\n } else {\n // node is supposed to be after referenceNode.\n beforeNode = referenceNode.nextSibling;\n }\n if (beforeNode && beforeNode.previousSibling !== node) {\n // Cases where `node === beforeNode` should get filtered out by earlier\n // checks and the behavior isn't well-defined.\n invariant(\n node !== beforeNode,\n 'ReactART: Can not insert node before itself'\n );\n node.injectBefore(beforeNode);\n } else if (node.parentNode !== parentNode) {\n node.inject(parentNode);\n }\n}", "popToNearestCommonAncestor(prev, parentNext);\n } else {\n // We must still be deeper.\n popNextToCommonLevel(prev, parentNext);\n }", "function replaceEmptyNode(data, coupleData, mode) {\n var node = data.node;\n var parent = node.parentElement;\n var tagText = mode === 'both' ? data.tag + coupleData.tag : data.tag;\n\n // Simple check\n var skip =\n !parent ||\n parent === root ||\n !parent.parentElement ||\n parent.childNodes.length > 1 ||\n !replacableNodes[parent.nodeName];\n\n if (skip) return;\n\n var empty = tagText === node.nodeValue.trim();\n\n // Check if tag text node contains only tag(s) and spaces\n if (!empty && mode === 'both') {\n var text = node.nodeValue;\n var inner = text.substring(0, data.index) +\n text.substring(data.index + data.tag.length, coupleData.index) +\n text.substring(coupleData.index + coupleData.tag.length);\n\n empty = !inner.trim().length;\n }\n\n if (!empty) return;\n\n parent.parentElement.replaceChild(node, parent);\n data.level--;\n\n // There are element nodes in new parent, so it's definitely not empty. Do not perform recursive replace\n if (node.parentElement.children.length) return;\n\n // Join moved node with possible sibling empty text nodes in new parent element\n // Node.normalize() can not be used here, because it can destroy current references to text nodes with tags\n var tagsMerged = mergeTextNodes(data, coupleData, mode);\n mode = tagsMerged ? 'both' : mode;\n\n replaceEmptyNode(data, coupleData, mode);\n}", "popToNearestCommonAncestor(parentPrev, next);\n } else {\n // We must still be deeper.\n popPreviousToCommonLevel(parentPrev, next);\n }", "function compareDocumentPosition(nodeA,nodeB){var aParents=[];var bParents=[];if(nodeA===nodeB){return 0;}var current=tagtypes_1.hasChildren(nodeA)?nodeA:nodeA.parent;while(current){aParents.unshift(current);current=current.parent;}current=tagtypes_1.hasChildren(nodeB)?nodeB:nodeB.parent;while(current){bParents.unshift(current);current=current.parent;}var idx=0;while(aParents[idx]===bParents[idx]){idx++;}if(idx===0){return 1/* DISCONNECTED */;}var sharedParent=aParents[idx-1];var siblings=sharedParent.children;var aSibling=aParents[idx];var bSibling=bParents[idx];if(siblings.indexOf(aSibling)>siblings.indexOf(bSibling)){if(sharedParent===nodeB){return 4/* FOLLOWING */|16/* CONTAINED_BY */;}return 4/* FOLLOWING */;}else{if(sharedParent===nodeA){return 2/* PRECEDING */|8/* CONTAINS */;}return 2/* PRECEDING */;}}", "getPreviousParagraphBlock(block) {\n if (block.previousRenderedWidget instanceof ParagraphWidget) {\n return block.previousRenderedWidget;\n }\n else if (block.previousRenderedWidget instanceof TableWidget) {\n return this.getLastParagraphInLastCell((block.previousRenderedWidget));\n }\n if (block.containerWidget instanceof TableCellWidget) {\n return this.getPreviousParagraphCell((block.containerWidget));\n }\n else if (block.containerWidget instanceof BodyWidget) {\n return this.getPreviousParagraph(block.containerWidget);\n }\n else if (block.containerWidget instanceof HeaderFooterWidget && this.isMoveDownOrMoveUp) {\n return this.getLastBlockInPreviousHeaderFooter(block);\n }\n return undefined;\n }", "function previousElementSibling(el) {\n do { el = el.previousSibling; } while ( el && el.nodeType !== 1 );\n return el;\n}", "function nodeToMarkdeepSource(node, leaveEscapes) {\n var source = node.innerHTML;\n\n // Markdown uses <[email protected]> e-mail syntax, which HTML parsing\n // will try to close by inserting the matching close tags at the end of the\n // document. Remove anything that looks like that and comes *after*\n // the first fallback style.\n source = source.replace(/(?:<style class=\"fallback\">[\\s\\S]*?<\\/style>[\\s\\S]*)<\\/\\S+@\\S+\\.\\S+?>/gim, '');\n \n // Remove artificially inserted close tags\n source = source.replace(/<\\/h?ttps?:.*>/gi, '');\n \n // Now try to fix the URLs themselves, which will be \n // transformed like this: <http: casual-effects.com=\"\" markdeep=\"\">\n source = source.replace(/<(https?): (.*?)>/gi, function (match, protocol, list) {\n\n // Remove any quotes--they wouldn't have been legal in the URL anyway\n var s = '<' + protocol + '://' + list.replace(/=\"\"\\s/g, '/');\n\n if (s.substring(s.length - 3) === '=\"\"') {\n s = s.substring(0, s.length - 3);\n }\n\n // Remove any lingering quotes (since they\n // wouldn't have been legal in the URL)\n s = s.replace(/\"/g, '');\n\n return s + '>';\n });\n\n // Remove the \"fallback\" style tags\n source = source.replace(/<style class=[\"']fallback[\"']>.*?<\\/style>/gmi, '');\n\n source = unescapeHTMLEntities(source);\n\n return source;\n}", "replaceSelectionWith(node, inheritMarks = true) {\n let selection = this.selection;\n if (inheritMarks)\n node = node.mark(this.storedMarks || (selection.empty ? selection.$from.marks() : selection.$from.marksAcross(selection.$to) || Mark$1.none));\n selection.replaceWith(this, node);\n return this;\n }", "function removeEmptyLinesBefore(\n\tnode,\n\tnewline\n) {\n\tnode.raws.before = node.raws.before.replace(/(\\r?\\n\\s*\\r?\\n)+/g, newline);\n\n\treturn node;\n}", "function previousElement(/* Node */ node, /*string? */ tagName) { \n\t//\tsummary:\n\t//\t\treturns the previous sibling element matching tagName\n\tif(!node) { return null; }\n\tif(tagName) { tagName = tagName.toLowerCase(); }\n\tdo {\n\t\tnode = node.previousSibling;\n\t} while(node && node.nodeType != 1 /* ELEMENT_NODE */);\n\n\tif(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {\n\t\treturn previousElement(node, tagName);\n\t}\n\treturn node;\t//\tElement\n}", "function stretchSpansOverChange(doc, change) {\r\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\r\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\r\n if (!oldFirst && !oldLast) return null;\r\n\r\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\r\n // Get the spans that 'stick out' on both sides\r\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\r\n var last = markedSpansAfter(oldLast, endCh, isInsert);\r\n\r\n // Next, merge those two ends\r\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\r\n if (first) {\r\n // Fix up .to properties of first\r\n for (var i = 0; i < first.length; ++i) {\r\n var span = first[i];\r\n if (span.to == null) {\r\n var found = getMarkedSpanFor(last, span.marker);\r\n if (!found) span.to = startCh;\r\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\r\n }\r\n }\r\n }\r\n if (last) {\r\n // Fix up .from in last (or move them into first in case of sameLine)\r\n for (var i = 0; i < last.length; ++i) {\r\n var span = last[i];\r\n if (span.to != null) span.to += offset;\r\n if (span.from == null) {\r\n var found = getMarkedSpanFor(first, span.marker);\r\n if (!found) {\r\n span.from = offset;\r\n if (sameLine) (first || (first = [])).push(span);\r\n }\r\n } else {\r\n span.from += offset;\r\n if (sameLine) (first || (first = [])).push(span);\r\n }\r\n }\r\n }\r\n // Make sure we didn't create any zero-length spans\r\n if (first) first = clearEmptySpans(first);\r\n if (last && last != first) last = clearEmptySpans(last);\r\n\r\n var newMarkers = [first];\r\n if (!sameLine) {\r\n // Fill gap with whole-line-spans\r\n var gap = change.text.length - 2, gapMarkers;\r\n if (gap > 0 && first)\r\n for (var i = 0; i < first.length; ++i)\r\n if (first[i].to == null)\r\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\r\n for (var i = 0; i < gap; ++i)\r\n newMarkers.push(gapMarkers);\r\n newMarkers.push(last);\r\n }\r\n return newMarkers;\r\n }", "mergeToLeft(leftNode, rightNode) {\n if (!rightNode.empty()) {\n let leftNodeLastRightChildOldValue = leftNode.last().rightChild;\n leftNode.last().rightChild = rightNode.getLeftmostChild();\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild = leftNodeLastRightChildOldValue;\n }\n )\n if (leftNode.hasRightmostChild()) {\n let leftNodeLastRightChildParentOldValue = leftNode.last().rightChild.parent;\n leftNode.last().rightChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild.parent = leftNodeLastRightChildParentOldValue;\n }\n );\n }\n while (!rightNode.empty()) {\n let rightNodeElement = rightNode.popFirst();\n this.addAtLastIndexOfCallStack(\n this.undoPopFirst.bind(this, rightNodeElement, rightNode)\n );\n leftNode.addLast(rightNodeElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, leftNode)\n )\n if (leftNode.last().leftChild != null) {\n let leftNodeLastLeftChildParentOldValue = leftNode.last().leftChild.parent;\n leftNode.last().leftChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().leftChild.parent = leftNodeLastLeftChildParentOldValue;\n }\n )\n }\n if (leftNode.last().rightChild != null) {\n let leftNodeLastRightChildParentOldValue = leftNode.last().rightChild.parent;\n leftNode.last().rightChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild.parent = leftNodeLastRightChildParentOldValue\n }\n );\n }\n }\n }\n\n let rightNodeParentOldValue = rightNode.parent;\n rightNode.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.parent = rightNodeParentOldValue;\n }\n );\n\n let rightNodeOldValue = rightNode;\n rightNode = null;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode = rightNodeOldValue;\n }\n );\n }", "function mergeTokens(a, b) {\n\ta.text += ' ' + b.text;\n\ta.normalised += ' ' + b.normalised;\n\ta.pos_reason += '|' + b.pos_reason;\n\ta.start = a.start || b.start;\n\ta.noun_capital = a.noun_capital || b.noun_capital;\n\ta.punctuated = a.punctuated || b.punctuated;\n\ta.end = a.end || b.end;\n\treturn a;\n}", "function _addLineBreakBeforeAndAfter(node) {\n var doc = node.ownerDocument,\n nextSibling = _getNextSiblingThatIsNotBlank(node),\n previousSibling = _getPreviousSiblingThatIsNotBlank(node);\n\n if (nextSibling && !_isLineBreakOrBlockElement(nextSibling)) {\n node.parentNode.insertBefore(doc.createElement(\"br\"), nextSibling);\n }\n if (previousSibling && !_isLineBreakOrBlockElement(previousSibling)) {\n node.parentNode.insertBefore(doc.createElement(\"br\"), node);\n }\n }", "function _addLineBreakBeforeAndAfter(node) {\n var doc = node.ownerDocument,\n nextSibling = _getNextSiblingThatIsNotBlank(node),\n previousSibling = _getPreviousSiblingThatIsNotBlank(node);\n\n if (nextSibling && !_isLineBreakOrBlockElement(nextSibling)) {\n node.parentNode.insertBefore(doc.createElement(\"br\"), nextSibling);\n }\n if (previousSibling && !_isLineBreakOrBlockElement(previousSibling)) {\n node.parentNode.insertBefore(doc.createElement(\"br\"), node);\n }\n }" ]
[ "0.8367985", "0.61349255", "0.61349255", "0.61349255", "0.61349255", "0.61349255", "0.61349255", "0.5929898", "0.57884717", "0.56467134", "0.5552458", "0.5434768", "0.54283446", "0.53055257", "0.52956045", "0.5261775", "0.519828", "0.51654506", "0.51654506", "0.51654506", "0.5158388", "0.5154493", "0.51525676", "0.51443124", "0.51291895", "0.5092888", "0.5057672", "0.5055477", "0.50383544", "0.5022677", "0.5008313", "0.5002222", "0.5001866", "0.49915355", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49751157", "0.49695903", "0.4946372", "0.49327725", "0.49260396", "0.49234048", "0.49224404", "0.49224404", "0.49177858", "0.49177858", "0.49074015", "0.48976362", "0.4889695", "0.48678383", "0.48542234", "0.48500454", "0.48500454", "0.4843769", "0.48360288", "0.48236436", "0.48208788", "0.48208788", "0.48208788", "0.48138103", "0.48113838", "0.48002484", "0.47860533", "0.47813356", "0.47792453", "0.4766669", "0.4764555", "0.476018", "0.47473565", "0.47436315", "0.4741636", "0.47408846", "0.47386026", "0.47369197", "0.4727429", "0.47101566", "0.46931624", "0.46850008", "0.4679759", "0.46650743", "0.46578437", "0.46578437" ]
0.8524703
4
Construct a tokenizer. This creates both `tokenizeInline` and `tokenizeBlock`.
function factory(type) { return tokenize; /* Tokenizer for a bound `type`. */ function tokenize(value, location) { var self = this; var offset = self.offset; var tokens = []; var methods = self[type + 'Methods']; var tokenizers = self[type + 'Tokenizers']; var line = location.line; var column = location.column; var index; var length; var method; var name; var matched; var valueLength; /* Trim white space only lines. */ if (!value) { return tokens; } /* Expose on `eat`. */ eat.now = now; eat.file = self.file; /* Sync initial offset. */ updatePosition(''); /* Iterate over `value`, and iterate over all * tokenizers. When one eats something, re-iterate * with the remaining value. If no tokenizer eats, * something failed (should not happen) and an * exception is thrown. */ while (value) { index = -1; length = methods.length; matched = false; while (++index < length) { name = methods[index]; method = tokenizers[name]; if ( method && /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) && (!method.notInList || !self.inList) && (!method.notInBlock || !self.inBlock) && (!method.notInLink || !self.inLink) ) { valueLength = value.length; method.apply(self, [eat, value]); matched = valueLength !== value.length; if (matched) { break; } } } /* istanbul ignore if */ if (!matched) { self.file.fail(new Error('Infinite loop'), eat.now()); } } self.eof = now(); return tokens; /* Update line, column, and offset based on * `value`. */ function updatePosition(subvalue) { var lastIndex = -1; var index = subvalue.indexOf('\n'); while (index !== -1) { line++; lastIndex = index; index = subvalue.indexOf('\n', index + 1); } if (lastIndex === -1) { column += subvalue.length; } else { column = subvalue.length - lastIndex; } if (line in offset) { if (lastIndex !== -1) { column += offset[line]; } else if (column <= offset[line]) { column = offset[line] + 1; } } } /* Get offset. Called before the first character is * eaten to retrieve the range's offsets. */ function getOffset() { var indentation = []; var pos = line + 1; /* Done. Called when the last character is * eaten to retrieve the range’s offsets. */ return function () { var last = line + 1; while (pos < last) { indentation.push((offset[pos] || 0) + 1); pos++; } return indentation; }; } /* Get the current position. */ function now() { var pos = {line: line, column: column}; pos.offset = self.toOffset(pos); return pos; } /* Store position information for a node. */ function Position(start) { this.start = start; this.end = now(); } /* Throw when a value is incorrectly eaten. * This shouldn’t happen but will throw on new, * incorrect rules. */ function validateEat(subvalue) { /* istanbul ignore if */ if (value.substring(0, subvalue.length) !== subvalue) { /* Capture stack-trace. */ self.file.fail( new Error( 'Incorrectly eaten value: please report this ' + 'warning on http://git.io/vg5Ft' ), now() ); } } /* Mark position and patch `node.position`. */ function position() { var before = now(); return update; /* Add the position to a node. */ function update(node, indent) { var prev = node.position; var start = prev ? prev.start : before; var combined = []; var n = prev && prev.end.line; var l = before.line; node.position = new Position(start); /* If there was already a `position`, this * node was merged. Fixing `start` wasn’t * hard, but the indent is different. * Especially because some information, the * indent between `n` and `l` wasn’t * tracked. Luckily, that space is * (should be?) empty, so we can safely * check for it now. */ if (prev && indent && prev.indent) { combined = prev.indent; if (n < l) { while (++n < l) { combined.push((offset[n] || 0) + 1); } combined.push(before.column); } indent = combined.concat(indent); } node.position.indent = indent || []; return node; } } /* Add `node` to `parent`s children or to `tokens`. * Performs merges where possible. */ function add(node, parent) { var children = parent ? parent.children : tokens; var prev = children[children.length - 1]; if ( prev && node.type === prev.type && node.type in MERGEABLE_NODES && mergeable(prev) && mergeable(node) ) { node = MERGEABLE_NODES[node.type].call(self, prev, node); } if (node !== prev) { children.push(node); } if (self.atStart && tokens.length !== 0) { self.exitStart(); } return node; } /* Remove `subvalue` from `value`. * `subvalue` must be at the start of `value`. */ function eat(subvalue) { var indent = getOffset(); var pos = position(); var current = now(); validateEat(subvalue); apply.reset = reset; reset.test = test; apply.test = test; value = value.substring(subvalue.length); updatePosition(subvalue); indent = indent(); return apply; /* Add the given arguments, add `position` to * the returned node, and return the node. */ function apply(node, parent) { return pos(add(pos(node), parent), indent); } /* Functions just like apply, but resets the * content: the line and column are reversed, * and the eaten value is re-added. * This is useful for nodes with a single * type of content, such as lists and tables. * See `apply` above for what parameters are * expected. */ function reset() { var node = apply.apply(null, arguments); line = current.line; column = current.column; value = subvalue + value; return node; } /* Test the position, after eating, and reverse * to a not-eaten state. */ function test() { var result = pos({}); line = current.line; column = current.column; value = subvalue + value; return result.position; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "static makeTokenizer(literals, input) {\n if (theTokenizer === null) {\n theTokenizer = new tokenizer(literals, input);\n }\n }", "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "function Token(type, text, newlines, whitespace_before, parent) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = /* inline comment*/ [];\n\n\n this.comments_after = []; // no new line before and newline after\n this.newlines = newlines || 0;\n this.wanted_newline = newlines > 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = parent || null;\n this.opened = null;\n this.directives = null;\n}", "tokenizer(token , isEndOfInput , previousTokens , terminal , config){\n }", "function tokenize(text) {\n return tokenizer.processItem({ lineText: text }, true);\n}", "function tokenizer(input) {\n const singleTokensSpecs = [\n { char: '=', tokenType: 'equal' },\n { char: '*', tokenType: 'star' },\n { char: '!', tokenType: 'not' },\n { char: '[', tokenType: 'bracket' },\n { char: ']', tokenType: 'bracket' },\n { char: '-', tokenType: 'minus' },\n { char: '+', tokenType: 'plus' },\n { char: '\\\\', tokenType: 'backslash' },\n { char: '/', tokenType: 'forwardslash' },\n { char: '.', tokenType: 'dot' },\n { char: '<', tokenType: 'less' },\n { char: '>', tokenType: 'greater' },\n { char: '|', tokenType: 'pipe' },\n { char: '&', tokenType: 'and' },\n { char: '%', tokenType: 'percent' },\n { char: '^', tokenType: 'caret' },\n { char: ',', tokenType: 'comma' },\n { char: ';', tokenType: 'semi' },\n { char: '~', tokenType: 'tilde' },\n { char: '`', tokenType: 'grave' },\n { char: '(', tokenType: 'paren' },\n { char: ')', tokenType: 'paren' },\n { char: ':', tokenType: 'colon' },\n { char: '{', tokenType: 'curly' },\n { char: '}', tokenType: 'curly' },\n { char: '#', tokenType: 'SPECIAL' }\n ];\n const regexSingleTokensSpecs = [\n {\n start: /^(\\/\\/.*)/,\n tokenType: 'NONE',\n addLength: 0\n },\n {\n start: /^([\\s\\t\\n]+)/,\n tokenType: 'NONE',\n addLength: 0\n },\n {\n start: /^(\\d[\\d_]*\\b)/,\n tokenType: 'numberDec',\n addLength: 0\n },\n {\n start: /^0[xX]([\\da-fA-F][\\da-fA-F_]*\\b)/,\n tokenType: 'numberHex',\n addLength: 2\n },\n {\n start: /^(break|const|continue|do|else|exit|for|goto|halt|if|long|return|sleep|struct|void|while)/,\n tokenType: 'keyword',\n addLength: 0\n },\n {\n start: /^(asm)/,\n tokenType: 'SPECIAL',\n addLength: 0\n },\n {\n start: /^(\\w+)/,\n tokenType: 'variable',\n addLength: 0\n }\n ];\n const regexDoubleTokensSpecs = [\n {\n start: /^\\/\\*/,\n end: /([\\s\\S]*?\\*\\/)/,\n tokenType: 'NONE',\n startLength: 2,\n removeTrailing: 0,\n errorMsg: \"Missing '*/' to end comment section.\"\n },\n {\n start: /^\"/,\n end: /([\\s\\S]*?\")/,\n tokenType: 'string',\n startLength: 1,\n removeTrailing: 1,\n errorMsg: \"Missing '\\\"' to end string.\"\n },\n {\n start: /^'/,\n end: /([\\s\\S]*?')/,\n tokenType: 'string',\n startLength: 1,\n removeTrailing: 1,\n errorMsg: \"Missing \\\"'\\\" to end string.\"\n }\n ];\n let currentChar, remainingText;\n let current = 0;\n const tokens = [];\n let currentLine = 1;\n while (current < input.length) {\n currentChar = input.charAt(current);\n remainingText = input.slice(current);\n // Resolve double regex tokens\n const found = regexDoubleTokensSpecs.find(ruleN => {\n const startParts = ruleN.start.exec(remainingText);\n if (startParts != null) {\n const endParts = ruleN.end.exec(remainingText.slice(ruleN.startLength));\n current += ruleN.startLength;\n if (endParts !== null) {\n if (ruleN.tokenType === 'NONE') {\n currentLine += (endParts[1].match(/\\n/g) || '').length;\n current += endParts[1].length;\n return true; // breaks find function\n }\n tokens.push({ type: ruleN.tokenType, value: endParts[1].slice(0, -ruleN.removeTrailing), line: currentLine });\n currentLine += (endParts[1].match(/\\n/g) || '').length;\n current += endParts[1].length;\n return true; // breaks find function\n }\n throw new TypeError(`At line: ${currentLine}. ${ruleN.errorMsg}`);\n }\n return false;\n });\n if (found !== undefined) {\n // item already processed\n continue;\n }\n // Resolve single regex tokens\n const found2 = regexSingleTokensSpecs.find(ruleN => {\n const startParts = ruleN.start.exec(remainingText);\n if (startParts != null) {\n if (ruleN.tokenType === 'NONE') {\n currentLine += (startParts[1].match(/\\n/g) || '').length;\n current += startParts[1].length + ruleN.addLength;\n return true; // breaks find function\n }\n if (ruleN.tokenType === 'SPECIAL') {\n // handle asm case\n const asmParts = /^(asm[^\\w]*\\{([\\s\\S]*?)\\})/.exec(remainingText);\n if (asmParts === null) {\n throw new TypeError('At line:' + currentLine + ' Error parsing `asm { ... }` keyword');\n }\n tokens.push({ type: 'keyword', value: 'asm', line: currentLine, asmText: asmParts[2] });\n currentLine += (asmParts[1].match(/\\n/g) || '').length;\n current += asmParts[1].length;\n return true; // breaks find function\n }\n tokens.push({ type: ruleN.tokenType, value: startParts[1], line: currentLine });\n currentLine += (startParts[1].match(/\\n/g) || '').length;\n current += startParts[1].length + ruleN.addLength;\n return true; // breaks find function\n }\n return false;\n });\n if (found2 !== undefined) {\n continue;\n }\n // Resolve all single tokens\n const search = singleTokensSpecs.find(charDB => charDB.char === currentChar);\n if (search !== undefined) {\n if (search.tokenType === 'NONE') {\n current++;\n continue;\n }\n else if (search.tokenType === 'SPECIAL') {\n if (search.char === '#') {\n current++;\n const lines = input.slice(current).split('\\n');\n let i = 0;\n let val = '';\n for (; i < lines.length; i++) {\n val += lines[i];\n current += lines[i].length + 1; // newline!\n currentLine++;\n if (lines[i].endsWith('\\\\')) {\n val = val.slice(0, -1);\n continue;\n }\n break;\n }\n tokens.push({ type: 'macro', value: val, line: currentLine - i - 1 });\n continue;\n }\n throw new TypeError(`At line: ${currentLine}. SPECIAL rule not implemented in tokenizer().`);\n }\n tokens.push({ type: search.tokenType, value: currentChar, line: currentLine });\n current++;\n continue;\n }\n throw new TypeError(`At line: ${currentLine}. Forbidden character found: '${currentChar}'.`);\n }\n return tokens;\n}", "tokenize(input, ruleName) {\n const tokens = super.tokenize(input)\n if (typeof input === \"string\" && ruleName === \"block\") return this.tokenizer.breakIntoBlocks(tokens)\n return tokens\n }", "tokenize () {\n console.log(\"Initializing tokenizer\");\n //0. Pick some RESERVEDWORD (string which never occurs in your input)\n //1. Read the whole program into a single string; kill the newlines and tabs\n let tokenizedProgram = this.program.replace(\"\\n\",\"\");\n //2. Replace all constant literals with “RESERVEDWORD”<the literal>“RESERVEDWORD”\n let that = this;\n literals.forEach(function(s) {\n tokenizedProgram = tokenizedProgram.split(s).join(that.RESERVEDWORD + s.trim() + that.RESERVEDWORD);\n });\n //3. Replace all “RESERVEDWORDRESERVEDWORD” with just “RESERVEDWORD”\n tokenizedProgram = tokenizedProgram.replace(this.RESERVEDWORD + this.RESERVEDWORD, this.RESERVEDWORD);\n //4. Remove leading “RESERVEDWORD” character, then split on “RESERVEDWORD”\n if(tokenizedProgram.length>0 && tokenizedProgram[0] === this.RESERVEDWORD){\n tokenizedProgram = tokenizedProgram.substring(1);\n }\n let tokens = tokenizedProgram.split(this.RESERVEDWORD);\n //5. Trim whitespace around tokens\n for(let i = 0; i < tokens.length; i++){\n let t = tokens[i].trim();\n if (t.length > 0) {\n this.tokens.push(t);\n }\n }\n console.log(this.tokens);\n console.log(\"Done tokenizing\");\n }", "function Tokenizer(selector) {\n this.selector = selector;\n this.tokens = [];\n this.tokenize();\n }", "function Tokenizer(str) {\n this._str = str;\n this.pos = 0;\n}", "function Tokenizer (input) {\n this.reader = input;\n this._previous = null;\n }", "function factory(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this\n var offset = self.offset\n var tokens = []\n var methods = self[type + 'Methods']\n var tokenizers = self[type + 'Tokenizers']\n var line = location.line\n var column = location.column\n var index\n var length\n var method\n var name\n var matched\n var valueLength\n\n // Trim white space only lines.\n if (!value) {\n return tokens\n }\n\n // Expose on `eat`.\n eat.now = now\n eat.file = self.file\n\n // Sync initial offset.\n updatePosition('')\n\n // Iterate over `value`, and iterate over all tokenizers. When one eats\n // something, re-iterate with the remaining value. If no tokenizer eats,\n // something failed (should not happen) and an exception is thrown.\n while (value) {\n index = -1\n length = methods.length\n matched = false\n\n while (++index < length) {\n name = methods[index]\n method = tokenizers[name]\n\n // Previously, we had constructs such as footnotes and YAML that used\n // these properties.\n // Those are now external (plus there are userland extensions), that may\n // still use them.\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n /* istanbul ignore next */ (!method.notInList || !self.inList) &&\n /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length\n\n method.apply(self, [eat, value])\n\n matched = valueLength !== value.length\n\n if (matched) {\n break\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now())\n }\n }\n\n self.eof = now()\n\n return tokens\n\n // Update line, column, and offset based on `value`.\n function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }\n\n // Get offset. Called before the first character is eaten to retrieve the\n // range’s offsets.\n function getOffset() {\n var indentation = []\n var pos = line + 1\n\n // Done. Called when the last character is eaten to retrieve the range’s\n // offsets.\n return function () {\n var last = line + 1\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1)\n\n pos++\n }\n\n return indentation\n }\n }\n\n // Get the current position.\n function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start\n this.end = now()\n }\n\n // Throw when a value is incorrectly eaten. This shouldn’t happen but will\n // throw on new, incorrect rules.\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.slice(0, subvalue.length) !== subvalue) {\n // Capture stack-trace.\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft'\n ),\n now()\n )\n }\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }\n\n // Add `node` to `parent`s children or to `tokens`. Performs merges where\n // possible.\n function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }\n\n // Remove `subvalue` from `value`. `subvalue` must be at the start of\n // `value`.\n function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }\n }\n}", "constructor(tokenizer) { \n super()\n this.tokenizer = tokenizer \n this.leftover = false\n }", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n\n this.tag = tag;\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n\n this.attrs = null;\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n\n this.map = null;\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n\n this.nesting = nesting;\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n\n this.level = 0;\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n\n this.children = null;\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n\n this.content = '';\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n\n this.markup = '';\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n\n this.info = '';\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n\n this.meta = null;\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n\n this.block = false;\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n\n this.hidden = false;\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /**\n * Update line, column, and offset based on\n * `value`.\n *\n * @example\n * updatePosition('foo');\n *\n * @param {string} subvalue - Subvalue to eat.\n */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /**\n * Get offset. Called before the first character is\n * eaten to retrieve the range's offsets.\n *\n * @return {Function} - `done`, to be called when\n * the last character is eaten.\n */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /**\n * Done. Called when the last character is\n * eaten to retrieve the range’s offsets.\n *\n * @return {Array.<number>} - Offset.\n */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /**\n * Get the current position.\n *\n * @example\n * position = now(); // {line: 1, column: 1, offset: 0}\n *\n * @return {Object} - Current Position.\n */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /**\n * Store position information for a node.\n *\n * @example\n * start = now();\n * updatePosition('foo');\n * location = new Position(start);\n * // {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n *\n * @param {Object} start - Starting position.\n */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /**\n * Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules.\n *\n * @example\n * // When the current value is set to `foo bar`.\n * validateEat('foo');\n * eat('foo');\n *\n * validateEat('bar');\n * // throws, because the space is not eaten.\n *\n * @param {string} subvalue - Value to be eaten.\n * @throws {Error} - When `subvalue` cannot be eaten.\n */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @example\n * var update = position();\n * updatePosition('foo');\n * update({});\n * // {\n * // position: {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n * // }\n *\n * @returns {Function} - Updater.\n */\n function position() {\n var before = now();\n\n return update;\n\n /**\n * Add the position to a node.\n *\n * @example\n * update({type: 'text', value: 'foo'});\n *\n * @param {Node} node - Node to attach position\n * on.\n * @param {Array} [indent] - Indentation for\n * `node`.\n * @return {Node} - `node`.\n */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /**\n * Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible.\n *\n * @example\n * add({});\n *\n * add({}, {children: []});\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Parent to insert into.\n * @return {Object} - Added or merged into node.\n */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /**\n * Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`.\n *\n * @example\n * eat('foo')({type: 'text', value: 'foo'});\n *\n * @param {string} subvalue - Removed from `value`,\n * and passed to `updatePosition`.\n * @return {Function} - Wrapper around `add`, which\n * also adds `position` to node.\n */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /**\n * Add the given arguments, add `position` to\n * the returned node, and return the node.\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Node to insert into.\n * @return {Node} - Added node.\n */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /**\n * Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n *\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n *\n * See `apply` above for what parameters are\n * expected.\n *\n * @return {Node} - Added node.\n */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /**\n * Test the position, after eating, and reverse\n * to a not-eaten state.\n *\n * @return {Position} - Position after eating `subvalue`.\n */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "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}", "tokenize(index) {\n\t\t\tconst {tokenize} = this.impl;\n\t\t\tif (tokenize === undefined) {\n\t\t\t\tthrow new Error(\"No tokenize implementation defined\");\n\t\t\t} else {\n\t\t\t\treturn tokenize(this, index);\n\t\t\t}\n\t\t}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}", "tokenize(str) {\n this.tokens = [];\n this.ss = new StringStream_1.StringStream(str);\n this.currParenthesisLevel = 0;\n this.errors = [];\n try {\n while (!this.ss.eof()) {\n this.readNextToken();\n }\n }\n catch (err) {\n if (err instanceof errors_1.InvalidParseError) {\n this.errors.push(err);\n }\n else {\n throw err;\n }\n }\n //this._insertImplicitMultiplications()\n //this._removeLineWhiteSpace() // now we can remove all non newline whitespace\n }", "function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n }", "constructor() { \n \n RegexpTokenizerInfo.initialize(this);\n }", "function Tokenizer(source) {\n\n const input = InputStream(source)\n let current = null\n \n return {\n next: next,\n peek: peek,\n eof: eof,\n }\n\n\n function isWhitespace(ch) { return /\\s/.test(ch) }\n function isDigit(ch) { return /[0-9]/.test(ch) }\n function isHex(ch) { return /[0-9a-fA-FxX]/.test(ch) }\n function isIdStart(ch) { return /[a-z_]/i.test(ch) }\n function isId(ch) { return /[a-z_0-9!]/i.test(ch) }\n function isDelim(ch) { return /[.,;(){}[\\]:]/.test(ch) }\n function isOperator(ch) { return /[+\\-*\\/%=&|<>!^]/.test(ch) }\n function isKeyword(wd) {\n return /bool|break|case|class|continue|const|delete|do|double|else|export|extern|float|for|if|import|int|module|new|print|private|public|return|switch|static|throw|to!int|to!double|to!float|uint|void|while/.test(wd);\n }\n\n /*\n * next Token\n *\n * @returns the next new token from the source\n */\n function nextToken() {\n let ch = ''\n\n readWhile(isWhitespace);\n if (input.eof()) {\n return null\n }\n if (input.peek(2) === \"//\") {\n skipTo('\\n')\n return nextToken()\n }\n if (input.peek(3) === \"/**\") {\n skipTo(\"*/\")\n return nextToken()\n }\n if (input.peek(2) === \"/*\") {\n skipTo(\"*/\")\n return nextToken()\n }\n ch = input.peek()\n if (ch === '\"') {\n return new Token(Token.String, readEscaped('\"'), input.getLine(), input.getCol())\n }\n if (ch === \"'\") {\n return new Token(Token.String, readEscaped(\"'\"), input.getLine(), input.getCol())\n }\n if (isDigit(ch)) {\n return new Token(Token.Number, readNumber(), input.getLine(), input.getCol())\n }\n if (isIdStart(ch)) {\n return (function(id) {\n return new Token((isKeyword(id) ? Token.Keyword : Token.Variable), id, input.getLine(), input.getCol())\n })(readWhile(isId))\n }\n if (isDelim(ch)) {\n return new Token(Token.Delimiter, input.next(), input.getLine(), input.getCol())\n }\n if (isOperator(ch)) {\n // return new Token(Token.Operator, readWhile(isOperator), input.getLine(), input.getCol())\n return new Token(Token.Delimiter, readWhile(isOperator), input.getLine(), input.getCol())\n }\n\n throw new Error(`Can't handle character: ${ch}`)\n }\n\n /*\n * read Number\n *\n * @returns the next number from the source stream\n */\n function readNumber() {\n let has_dot = false\n let is_hex = false\n\n let input = readWhile(function(ch) {\n if (ch === '.') {\n if (has_dot) {\n return false\n }\n has_dot = true\n return true\n }\n if (ch === 'x') {\n if (is_hex) {\n return false\n }\n is_hex = true\n }\n if (is_hex)\n return isHex(ch)\n else\n return isDigit(ch)\n })\n if (is_hex) {\n return parseInt(input, 16)\n }\n else {\n if (has_dot) {\n return parseFloat(input)\n } \n else {\n return parseInt(input, 10)\n }\n }\n }\n\n /*\n * read Escaped\n *\n * @returns the next escaped string until end\n */\n function readEscaped(end) {\n let ch = ''\n let escaped = false\n let str = ''\n\n input.next()\n while (!input.eof()) {\n ch = input.next()\n if (escaped) {\n str += ch\n escaped = false\n } else if (ch === '\\\\') {\n escaped = true\n } else if (ch === end) {\n break\n } else {\n str += ch\n }\n }\n return str\n }\n\n /*\n * read While\n *\n * @param predicate function to call to test\n * @returns the next token until predicate\n */\n function readWhile(predicate) {\n let str = ''\n\n while (!input.eof() && predicate(input.peek())) {\n str += input.next()\n }\n return str\n }\n\n /*\n * skip to end\n *\n * skip to the end string\n */\n function skipTo(end) {\n let len = end.length\n\n while (!input.eof() && input.peek(len) !== end) {\n input.next()\n }\n while (!input.eof() && len) {\n input.next()\n len--\n }\n }\n function eof() { return peek() === null }\n function peek() { return current || (current = nextToken()) }\n function next() {\n let token = current\n\n current = null\n return token || nextToken()\n }\n}", "function Token(type, tag, nesting) {\n /**\n\t * Token#type -> String\n\t *\n\t * Type of the token (string, e.g. \"paragraph_open\")\n\t **/\n this.type = type;\n /**\n\t * Token#tag -> String\n\t *\n\t * html tag name, e.g. \"p\"\n\t **/ this.tag = tag;\n /**\n\t * Token#attrs -> Array\n\t *\n\t * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n\t **/ this.attrs = null;\n /**\n\t * Token#map -> Array\n\t *\n\t * Source map info. Format: `[ line_begin, line_end ]`\n\t **/ this.map = null;\n /**\n\t * Token#nesting -> Number\n\t *\n\t * Level change (number in {-1, 0, 1} set), where:\n\t *\n\t * - `1` means the tag is opening\n\t * - `0` means the tag is self-closing\n\t * - `-1` means the tag is closing\n\t **/ this.nesting = nesting;\n /**\n\t * Token#level -> Number\n\t *\n\t * nesting level, the same as `state.level`\n\t **/ this.level = 0;\n /**\n\t * Token#children -> Array\n\t *\n\t * An array of child nodes (inline and img tokens)\n\t **/ this.children = null;\n /**\n\t * Token#content -> String\n\t *\n\t * In a case of self-closing tag (code, html, fence, etc.),\n\t * it has contents of this tag.\n\t **/ this.content = \"\";\n /**\n\t * Token#markup -> String\n\t *\n\t * '*' or '_' for emphasis, fence string for fence, etc.\n\t **/ this.markup = \"\";\n /**\n\t * Token#info -> String\n\t *\n\t * Additional information:\n\t *\n\t * - Info string for \"fence\" tokens\n\t * - The value \"auto\" for autolink \"link_open\" and \"link_close\" tokens\n\t * - The string value of the item marker for ordered-list \"list_item_open\" tokens\n\t **/ this.info = \"\";\n /**\n\t * Token#meta -> Object\n\t *\n\t * A place for plugins to store an arbitrary data\n\t **/ this.meta = null;\n /**\n\t * Token#block -> Boolean\n\t *\n\t * True for block-level tokens, false for inline tokens.\n\t * Used in renderer to calculate line breaks\n\t **/ this.block = false;\n /**\n\t * Token#hidden -> Boolean\n\t *\n\t * If it's true, ignore this element when rendering. Used for tight lists\n\t * to hide paragraphs.\n\t **/ this.hidden = false;\n }", "static getTokenizer() {\n return theTokenizer;\n }", "function Lexer(a){this.tokens=[],this.tokens.links={},this.options=a||Marked.defaults,this.rules=block.normal,this.options.gfm&&(this.options.tables?this.rules=block.tables:this.rules=block.gfm)}", "token(input, start, end, value) { return new Token(input, start, end, this.type, value) }", "function BBCodeParser_MultiTokenizer(input, position) {\r\n\t\tvar length = 0;\r\n\r\n\t\tif(position === undefined) position = 0;\r\n\t\tinput = input + '';\r\n\t\tlength = input.length;\r\n\t\tposition = PHPC.intval(position);\r\n\r\n\t\tthis.hasNextToken = function(delimiter) {\r\n\t\t\tif(delimiter === undefined) delimiter = ' ';\r\n\t\t\treturn input.indexOf(delimiter, Math.min(length, position)) !== -1;\r\n\t\t}\r\n\r\n\t\tthis.nextToken = function(delimiter) {\r\n\t\t\tif(delimiter === undefined) delimiter = ' ';\r\n\r\n\t\t\tif(position >= length) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tvar index = input.indexOf(delimiter, position);\r\n\t\t\tif(index === -1) {\r\n\t\t\t\tindex = length;\r\n\t\t\t}\r\n\r\n\t\t\tvar result = input.substr(position, index - position);\r\n\t\t\tposition = index + 1;\r\n\r\n\t\t\treturn result;\r\n\t\t}\r\n\r\n\t\tthis.reset = function() {\r\n\t\t\tposition = false;\r\n\t\t}\r\n\r\n\t}", "tokenize(AST, sourceCodeString) {\n this.tokensBytePos = {};\n this.lastLo = -1;\n // Attributes on the top-level don't exist in the 'tokens' array in the AST\n // and must be extracted from 'attrs' instead.\n // Keep track of the byte positons for seen idents and attribs,\n // and add tokens for attribs that don't exist in idents.\n this.idents = {};\n this.attribs = {};\n this.mods = {};\n this.sourceCodeBuffer = Buffer.from(sourceCodeString);\n\n // Some token types cannot be derived since they don't exist in the ast_json-data\n // and therefore need to be hard-coded manually:\n this.tokenTypes = {\n Pound: '#',\n Not: '!',\n LBrace: '{',\n RBrace: '}',\n LParen: '(',\n RParen: ')',\n LBracket: '[',\n RBracket: ']',\n };\n // Detect if there is a magic byte-order-mark sequence in the beginning of the file:\n let BOM = null;\n if (this.sourceCodeBuffer[0] == 239\n && this.sourceCodeBuffer[1] == 187\n && this.sourceCodeBuffer[2] == 191\n ) {\n // Remove byte order mark\n BOM = this.sourceCodeBuffer.slice(0,3);\n this.sourceCodeBuffer = this.sourceCodeBuffer.slice(3, this.sourceCodeBuffer.length);\n }\n this.traverse(AST);\n for (let identPos in this.attribs) {\n if (!this.idents.hasOwnProperty(identPos)) {\n if (this.attribs[identPos].style == 'Inner') {\n // InnerAttribute\n this._newToken('Pound', this.attribs[identPos].lo);\n this._newToken('Not', this.attribs[identPos].lo+1);\n this._newToken('LBracket', this.attribs[identPos].lo+2);\n } else if (this.attribs[identPos].style == 'Outer') {\n // OuterAttribute\n this._newToken('Pound', this.attribs[identPos].lo);\n this._newToken('LBracket', this.attribs[identPos].lo+1);\n } else {\n throw new Error('Unknown attribute style: ' + this.attribs[identPos].style);\n }\n this._newToken('RBracket', this.attribs[identPos].hi-1);\n }\n }\n for (let modPos in this.mods) {\n if (!this.idents.hasOwnProperty(modPos)) {\n let modPosOffset = parseInt(modPos);\n if (this.mods[modPos].pub) {\n this.tokensBytePos[modPosOffset] = ['Ident', 'pub']; modPosOffset += 3+1;\n }\n this.tokensBytePos[modPosOffset] = ['Ident', 'mod']; modPosOffset += 3+1;\n this.tokensBytePos[modPosOffset] = ['Ident', this.mods[modPos].ident]; modPosOffset += this.mods[modPos].ident.length + 1;\n this.tokensBytePos[modPosOffset] = ['LBrace', '{']; modPosOffset += 1;\n this.tokensBytePos[this.mods[modPos].hi*1-1] = ['RBrace', '}'];\n }\n }\n let sortedTokens = [];\n let tokenId = 0;\n for(let lo of Object.keys(this.tokensBytePos).sort(function(a, b){return a - b})) {\n this.identToKeyword(this.tokensBytePos[lo]);\n this.tokensBytePos[lo][3] = tokenId++;\n sortedTokens.push(this.tokensBytePos[lo]);\n }\n return sortedTokens;\n }", "function GenTokenParser(){}", "function tokenizer(source, state) {\n\tfunction isSpace(ch) {\n\t\t// The messy regexp is because IE's regexp matcher is of the\n\t\t// opinion that non-breaking spaces are no whitespace.\n\t\treturn ch != \"\\n\" && /^[\\s\\u00a0]$/.test(ch);\n\t}\n\n\tfunction out(token) {\n\t\ttoken.value = token.content = (token.content || \"\") + source.get();\n\t\treturn token;\n\t}\n\n\tfunction next() {\n\t\tvar token;\n\t\tif (!source.more()) throw StopIteration;\n\t\tif (source.peek() == \"\\n\") {\n\t\t\tsource.next();\n\t\t\treturn out({ type:\"whitespace\", style:\"whitespace\" });\n\t\t} else if (source.applies(isSpace)) {\n\t\t\tsource.nextWhile(isSpace);\n\t\t\treturn out({ type:\"whitespace\", style:\"whitespace\" });\n\t\t} else {\n\t\t\twhile (!token) token = state(source, function (s) { state = s; });\n\t\t\treturn out(token);\n\t\t}\n\t}\n\n\treturn { next: next, state: function() { return state; } };\n}", "function makeLexer() {\n const mooLexer = moo.compile(tokens);\n\n return {\n current: null,\n lines: [],\n get line() {\n return mooLexer.line;\n },\n get col() {\n return mooLexer.col;\n },\n save() {\n return mooLexer.save();\n },\n reset(chunk, info) {\n this.lines = chunk.split('\\n');\n return mooLexer.reset(chunk, info);\n },\n next() {\n // It's a cruel and unusual punishment to implement comments with nearly\n let token = mooLexer.next();\n // Drop all comment tokens found\n while (token && token.type === 'comment') {\n token = mooLexer.next();\n }\n this.current = token;\n return this.current;\n },\n formatError(token) {\n return mooLexer.formatError(token);\n },\n has(name) {\n return mooLexer.has(name);\n },\n };\n}", "function Token (type, children, text) {\n this.type = type\n\n if (children) {\n this.children = children\n }\n\n if (text) {\n this.text = text\n }\n }", "function tokenize(code){\n\t// split\n\tcode = code.match(/\\^.|./g);\n\t// depth\n\tvar depth = [0,0];\n\tvar open = \"[{\";\n\tvar close = \"]}\";\n\tfor(var i=0;i<code.length;i++){\n\t\tvar ind1 = open.indexOf(code[i]);\n\t\tvar ind2 = close.indexOf(code[i]);\n\t\tif(ind1+1){\n\t\t\tcode[i]+=depth[ind1]++;\n\t\t} else if(ind2+1){\n\t\t\tcode[i]+=--depth[ind2];\n\t\t}\n\t}\n\treturn code;\n}", "function InlineLexer(links, options) {\n\t\t this.options = options || marked.defaults;\n\t\t this.links = links;\n\t\t this.rules = inline.normal;\n\t\t this.renderer = this.options.renderer || new Renderer;\n\t\t this.renderer.options = this.options;\n\t\t\n\t\t if (!this.links) {\n\t\t throw new\n\t\t Error('Tokens array requires a `links` property.');\n\t\t }\n\t\t\n\t\t if (this.options.gfm) {\n\t\t if (this.options.breaks) {\n\t\t this.rules = inline.breaks;\n\t\t } else {\n\t\t this.rules = inline.gfm;\n\t\t }\n\t\t } else if (this.options.pedantic) {\n\t\t this.rules = inline.pedantic;\n\t\t }\n\t\t}", "function createToken() {\n\t\tif(matchDigit()) {\n\t\t\t// increment token total\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\t// output token found\n\t\t\tputMessage(\"Found digit: \\t\\t\" + lexString.charAt(0));\n\t\t\t// add token to the token array\n\t\t\ttokens[tokenIndex] = {type: \"digit\", value: lexString.charAt(0), line: lineCount};\n\t\t\t// slice off the first character (of in the case of IDs, the first couple)\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\t// increment the index of the token array\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\tif(matchDigit()) {\n\t\t\t\tputMessage(\"Error: Double digit numbers not supported\");\n\t\t\t\terrorB = true;\n\t\t\t}\n\n\t\t}\n\t\telse if(matchType()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tif(lexString.charAt(0) === \"i\") {\n\t\t\t\tputMessage(\"Found Id: \\t\\t\\t\" + \"int\");\n\t\t\t\ttokens[tokenIndex] = {type: \"type\", value: \"int\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(3, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t\tif(matchChar()) {\n\t\t\t\t\tputMessage(\"Error: Character directly following a type (line \" + lineCount + \")\");\n\t\t\t\t\terrorB = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(lexString.charAt(0) === \"b\") {\n\t\t\t\tputMessage(\"Found Id: \\t\\t\\t\" + \"boolean\");\n\t\t\t\ttokens[tokenIndex] = {type: \"type\", value: \"boolean\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(7, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t\tif(matchChar()) {\n\t\t\t\t\tputMessage(\"Error: Character directly following a type (line \" + lineCount + \")\");\n\t\t\t\t\terrorB = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tputMessage(\"Found Id: \\t\\t\\t\" + \"string\");\n\t\t\t\ttokens[tokenIndex] = {type: \"type\", value: \"string\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(6, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t}\n\t\t}\n\t\telse if(matchBool()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tif(lexString.charAt(0) === \"t\") {\n\t\t\t\tputMessage(\"Found boolean: \\t\" + \"true\");\n\t\t\t\ttokens[tokenIndex] = {type: \"bool\", value: \"true\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(4, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t\tif(matchChar()) {\n\t\t\t\t\tputMessage(\"Error: Character directly following a boolean (line \" + lineCount + \")\");\n\t\t\t\t\terrorB = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tputMessage(\"Found boolean: \\t\" + \"false\");\n\t\t\t\ttokens[tokenIndex] = {type: \"bool\", value: \"false\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(5, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t}\n\t\t}\n\t\telse if(matchCond()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tif(lexString.charAt(0) === \"i\") {\n\t\t\t\tputMessage(\"Found conditional: \\t\" + \"if\");\n\t\t\t\ttokens[tokenIndex] = {type: \"cond\", value: \"if\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(2, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t\tif(matchChar()) {\n\t\t\t\t\tputMessage(\"Error: Character directly following a cond (line \" + lineCount + \")\");\n\t\t\t\t\terrorB = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tputMessage(\"Found conditional: \\t\" + \"while\");\n\t\t\t\ttokens[tokenIndex] = {type: \"cond\", value: \"while\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(5, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t}\n\t\t}\n\t\telse if(matchPrint()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tputMessage(\"Found symbol: \\t\\t\\t\" + \"print\");\n\t\t\ttokens[tokenIndex] = {type: \"symbol\", value: \"print\", line: lineCount};\n\t\t\tlexString = lexString.slice(5, lexString.length);\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t}\n\t\telse if(matchChar()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tputMessage(\"Found character: \\t\" + lexString.charAt(0));\n\t\t\ttokens[tokenIndex] = {type: \"char\", value: lexString.charAt(0), line: lineCount};\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\tif(matchChar()) {\n\t\t\t\tputMessage(\"Error: Character directly following a character (line \" + lineCount + \")\");\n\t\t\t\terrorB = true;\n\t\t\t}\n\t\t}\n\t\telse if(matchOp()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tputMessage(\"Found operator: \\t\" + lexString.charAt(0));\n\t\t\ttokens[tokenIndex] = {type: \"op\", value: lexString.charAt(0), line: lineCount};\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t}\n\t\telse if(matchSymbol()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tputMessage(\"Found symbol: \\t\\t\" + lexString.charAt(0));\n\t\t\ttokens[tokenIndex] = {type: \"symbol\", value: lexString.charAt(0), line: lineCount};\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t}\n\t\telse if(matchEqual()) {\n\t\t\tvar save = lexString;\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\tif(matchEqual()) {\n\t\t\t\ttotalTokens = totalTokens + 1;\n\t\t\t\tputMessage(\"Found symbol: \\t\\t\" + \"==\");\n\t\t\t\ttokens[tokenIndex] = {type: \"symbol\", value: \"==\", line: lineCount};\n\t\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttotalTokens = totalTokens + 1;\n\t\t\t\tputMessage(\"Found symbol: \\t\\t\" + \"=\");\n\t\t\t\ttokens[tokenIndex] = {type: \"symbol\", value: \"=\", line: lineCount};\n\t\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\t}\n\t\t}\n\t\telse if(matchQuote()) {\n\t\t\tputMessage(\"Found symbol: \\t\\t\" + \"\\\"\");\n\t\t\ttokens[tokenIndex] = {type: \"symbol\", value: \"\\\"\", line: lineCount};\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tlexCharList();\n\t\t}\n\t\telse if (matchWhite()) {\n\t\t\t// there is no token for white space (return or tab) ... SLICE IT UP\n\t\t\tif(matchNewLine()) {\n\t\t\t\tlineCount = lineCount + 1;\n\t\t\t}\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t}\n\t\telse if(matchEnd()) {\n\t\t\ttotalTokens = totalTokens + 1;\n\t\t\tputMessage(\"Found end of program!\");\n\t\t\ttokens[tokenIndex] = {type: \"end\", value: lexString.charAt(0), line: lineCount};\n\t\t\tif(lexString.slice(1, lexString.length).length !== 0) {\n\t\t\t\t//throw an error\n\t\t\t\tputMessage(\"Warning: Code following program end. Deleting extra code.\");\n\t\t\t}\n\t\t\tlexString = \"\";\n\t\t\ttokenIndex = tokenIndex + 1;\n\t\t}\n\t\telse {\n\t\t\t// put error message here\n\t\t\tputMessage(\"Error: \\\"\" + lexString.charAt(0) + \"\\\" not in the language (line \" + lineCount + \")\");\n\t\t\tlexString = lexString.slice(1, lexString.length);\n\t\t\terrorB = true;\n\t\t}\n\t}", "token(input, start, end, value) {\n return new Token(input, start, end, value, this.type)\n }", "function JSONTokenizer(callback){\n\tthis.stack = [];\n\tthis.valFragment = \"\";\n\tthis.escapeState = null;\n\tthis.firstSurrogate = null;\n\tthis.topFn = this.processA;\n\tthis.curString = null;\n\tthis.curKey = null;\n\n\tthis.curState = \"\";\n\treturn this;\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n \n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n \n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n }", "function InlineLexer(links, options) {\n\t this.options = options || marked.defaults;\n\t this.links = links;\n\t this.rules = inline.normal;\n\t this.renderer = this.options.renderer || new Renderer;\n\t this.renderer.options = this.options;\n\t\n\t if (!this.links) {\n\t throw new\n\t Error('Tokens array requires a `links` property.');\n\t }\n\t\n\t if (this.options.gfm) {\n\t if (this.options.breaks) {\n\t this.rules = inline.breaks;\n\t } else {\n\t this.rules = inline.gfm;\n\t }\n\t } else if (this.options.pedantic) {\n\t this.rules = inline.pedantic;\n\t }\n\t}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n }", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n }", "function InlineLexer(links, options) {\n\t this.options = options || marked.defaults;\n\t this.links = links;\n\t this.rules = inline.normal;\n\t this.renderer = this.options.renderer || new Renderer();\n\t this.renderer.options = this.options;\n\n\t if (!this.links) {\n\t throw new Error('Tokens array requires a `links` property.');\n\t }\n\n\t if (this.options.gfm) {\n\t if (this.options.breaks) {\n\t this.rules = inline.breaks;\n\t } else {\n\t this.rules = inline.gfm;\n\t }\n\t } else if (this.options.pedantic) {\n\t this.rules = inline.pedantic;\n\t }\n\t }", "function InlineLexer(links, options) {\n\t this.options = options || marked.defaults;\n\t this.links = links;\n\t this.rules = inline.normal;\n\t this.renderer = this.options.renderer || new Renderer();\n\t this.renderer.options = this.options;\n\n\t if (!this.links) {\n\t throw new Error('Tokens array requires a `links` property.');\n\t }\n\n\t if (this.options.gfm) {\n\t if (this.options.breaks) {\n\t this.rules = inline.breaks;\n\t } else {\n\t this.rules = inline.gfm;\n\t }\n\t } else if (this.options.pedantic) {\n\t this.rules = inline.pedantic;\n\t }\n\t }", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}", "function InlineLexer(links, options) {\n\t this.options = options || marked.defaults;\n\t this.links = links;\n\t this.rules = inline.normal;\n\t this.renderer = this.options.renderer || new Renderer;\n\t this.renderer.options = this.options;\n\n\t if (!this.links) {\n\t throw new\n\t Error('Tokens array requires a `links` property.');\n\t }\n\n\t if (this.options.gfm) {\n\t if (this.options.breaks) {\n\t this.rules = inline.breaks;\n\t } else {\n\t this.rules = inline.gfm;\n\t }\n\t } else if (this.options.pedantic) {\n\t this.rules = inline.pedantic;\n\t }\n\t}", "function InlineLexer(links, options) {\n\t this.options = options || marked.defaults;\n\t this.links = links;\n\t this.rules = inline.normal;\n\t this.renderer = this.options.renderer || new Renderer;\n\t this.renderer.options = this.options;\n\n\t if (!this.links) {\n\t throw new\n\t Error('Tokens array requires a `links` property.');\n\t }\n\n\t if (this.options.gfm) {\n\t if (this.options.breaks) {\n\t this.rules = inline.breaks;\n\t } else {\n\t this.rules = inline.gfm;\n\t }\n\t } else if (this.options.pedantic) {\n\t this.rules = inline.pedantic;\n\t }\n\t}", "function InlineLexer(links, options) {\n\t this.options = options || marked.defaults;\n\t this.links = links;\n\t this.rules = inline.normal;\n\t this.renderer = this.options.renderer || new Renderer;\n\t this.renderer.options = this.options;\n\n\t if (!this.links) {\n\t throw new\n\t Error('Tokens array requires a `links` property.');\n\t }\n\n\t if (this.options.gfm) {\n\t if (this.options.breaks) {\n\t this.rules = inline.breaks;\n\t } else {\n\t this.rules = inline.gfm;\n\t }\n\t } else if (this.options.pedantic) {\n\t this.rules = inline.pedantic;\n\t }\n\t}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "token(input, start, value) { return new Token(input,start,input.pos,this.type,value) }", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}", "function InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer;\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new\n Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n } else if (this.options.pedantic) {\n this.rules = inline.pedantic;\n }\n}" ]
[ "0.6646729", "0.6646729", "0.6646729", "0.6635544", "0.6635544", "0.6635544", "0.65058005", "0.65058005", "0.65058005", "0.65058005", "0.65058005", "0.65058005", "0.65058005", "0.6393914", "0.6288154", "0.6116398", "0.60865617", "0.5903005", "0.58500975", "0.58098423", "0.5802991", "0.57328814", "0.56961286", "0.565843", "0.5625489", "0.55538887", "0.555252", "0.55161625", "0.5511896", "0.5511583", "0.54350245", "0.54350245", "0.54350245", "0.54350245", "0.54350245", "0.54350245", "0.54350245", "0.54350245", "0.54350245", "0.5415448", "0.537711", "0.53676236", "0.53602064", "0.53389066", "0.5318832", "0.5302927", "0.52891886", "0.5266865", "0.5240251", "0.5228955", "0.52237326", "0.5164495", "0.51624286", "0.5157141", "0.5141492", "0.5128836", "0.5128299", "0.51220125", "0.51195365", "0.51106364", "0.5105834", "0.5105834", "0.5097691", "0.5097691", "0.50961983", "0.50961983", "0.50961983", "0.50961983", "0.50961983", "0.50961983", "0.50935376", "0.50935376", "0.50935376", "0.508833", "0.508833", "0.508833", "0.508833", "0.508833", "0.508833", "0.508833", "0.508833", "0.508833", "0.508833", "0.50830853", "0.5077968", "0.5077968", "0.5077968", "0.5077968", "0.5077968", "0.5077968", "0.5077968", "0.5077968", "0.5077968", "0.5077968", "0.5077968", "0.5077968" ]
0.57973605
24
Tokenizer for a bound `type`.
function tokenize(value, location) { var self = this; var offset = self.offset; var tokens = []; var methods = self[type + 'Methods']; var tokenizers = self[type + 'Tokenizers']; var line = location.line; var column = location.column; var index; var length; var method; var name; var matched; var valueLength; /* Trim white space only lines. */ if (!value) { return tokens; } /* Expose on `eat`. */ eat.now = now; eat.file = self.file; /* Sync initial offset. */ updatePosition(''); /* Iterate over `value`, and iterate over all * tokenizers. When one eats something, re-iterate * with the remaining value. If no tokenizer eats, * something failed (should not happen) and an * exception is thrown. */ while (value) { index = -1; length = methods.length; matched = false; while (++index < length) { name = methods[index]; method = tokenizers[name]; if ( method && /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) && (!method.notInList || !self.inList) && (!method.notInBlock || !self.inBlock) && (!method.notInLink || !self.inLink) ) { valueLength = value.length; method.apply(self, [eat, value]); matched = valueLength !== value.length; if (matched) { break; } } } /* istanbul ignore if */ if (!matched) { self.file.fail(new Error('Infinite loop'), eat.now()); } } self.eof = now(); return tokens; /* Update line, column, and offset based on * `value`. */ function updatePosition(subvalue) { var lastIndex = -1; var index = subvalue.indexOf('\n'); while (index !== -1) { line++; lastIndex = index; index = subvalue.indexOf('\n', index + 1); } if (lastIndex === -1) { column += subvalue.length; } else { column = subvalue.length - lastIndex; } if (line in offset) { if (lastIndex !== -1) { column += offset[line]; } else if (column <= offset[line]) { column = offset[line] + 1; } } } /* Get offset. Called before the first character is * eaten to retrieve the range's offsets. */ function getOffset() { var indentation = []; var pos = line + 1; /* Done. Called when the last character is * eaten to retrieve the range’s offsets. */ return function () { var last = line + 1; while (pos < last) { indentation.push((offset[pos] || 0) + 1); pos++; } return indentation; }; } /* Get the current position. */ function now() { var pos = {line: line, column: column}; pos.offset = self.toOffset(pos); return pos; } /* Store position information for a node. */ function Position(start) { this.start = start; this.end = now(); } /* Throw when a value is incorrectly eaten. * This shouldn’t happen but will throw on new, * incorrect rules. */ function validateEat(subvalue) { /* istanbul ignore if */ if (value.substring(0, subvalue.length) !== subvalue) { /* Capture stack-trace. */ self.file.fail( new Error( 'Incorrectly eaten value: please report this ' + 'warning on http://git.io/vg5Ft' ), now() ); } } /* Mark position and patch `node.position`. */ function position() { var before = now(); return update; /* Add the position to a node. */ function update(node, indent) { var prev = node.position; var start = prev ? prev.start : before; var combined = []; var n = prev && prev.end.line; var l = before.line; node.position = new Position(start); /* If there was already a `position`, this * node was merged. Fixing `start` wasn’t * hard, but the indent is different. * Especially because some information, the * indent between `n` and `l` wasn’t * tracked. Luckily, that space is * (should be?) empty, so we can safely * check for it now. */ if (prev && indent && prev.indent) { combined = prev.indent; if (n < l) { while (++n < l) { combined.push((offset[n] || 0) + 1); } combined.push(before.column); } indent = combined.concat(indent); } node.position.indent = indent || []; return node; } } /* Add `node` to `parent`s children or to `tokens`. * Performs merges where possible. */ function add(node, parent) { var children = parent ? parent.children : tokens; var prev = children[children.length - 1]; if ( prev && node.type === prev.type && node.type in MERGEABLE_NODES && mergeable(prev) && mergeable(node) ) { node = MERGEABLE_NODES[node.type].call(self, prev, node); } if (node !== prev) { children.push(node); } if (self.atStart && tokens.length !== 0) { self.exitStart(); } return node; } /* Remove `subvalue` from `value`. * `subvalue` must be at the start of `value`. */ function eat(subvalue) { var indent = getOffset(); var pos = position(); var current = now(); validateEat(subvalue); apply.reset = reset; reset.test = test; apply.test = test; value = value.substring(subvalue.length); updatePosition(subvalue); indent = indent(); return apply; /* Add the given arguments, add `position` to * the returned node, and return the node. */ function apply(node, parent) { return pos(add(pos(node), parent), indent); } /* Functions just like apply, but resets the * content: the line and column are reversed, * and the eaten value is re-added. * This is useful for nodes with a single * type of content, such as lists and tables. * See `apply` above for what parameters are * expected. */ function reset() { var node = apply.apply(null, arguments); line = current.line; column = current.column; value = subvalue + value; return node; } /* Test the position, after eating, and reverse * to a not-eaten state. */ function test() { var result = pos({}); line = current.line; column = current.column; value = subvalue + value; return result.position; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /**\n * Update line, column, and offset based on\n * `value`.\n *\n * @example\n * updatePosition('foo');\n *\n * @param {string} subvalue - Subvalue to eat.\n */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /**\n * Get offset. Called before the first character is\n * eaten to retrieve the range's offsets.\n *\n * @return {Function} - `done`, to be called when\n * the last character is eaten.\n */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /**\n * Done. Called when the last character is\n * eaten to retrieve the range’s offsets.\n *\n * @return {Array.<number>} - Offset.\n */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /**\n * Get the current position.\n *\n * @example\n * position = now(); // {line: 1, column: 1, offset: 0}\n *\n * @return {Object} - Current Position.\n */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /**\n * Store position information for a node.\n *\n * @example\n * start = now();\n * updatePosition('foo');\n * location = new Position(start);\n * // {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n *\n * @param {Object} start - Starting position.\n */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /**\n * Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules.\n *\n * @example\n * // When the current value is set to `foo bar`.\n * validateEat('foo');\n * eat('foo');\n *\n * validateEat('bar');\n * // throws, because the space is not eaten.\n *\n * @param {string} subvalue - Value to be eaten.\n * @throws {Error} - When `subvalue` cannot be eaten.\n */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @example\n * var update = position();\n * updatePosition('foo');\n * update({});\n * // {\n * // position: {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n * // }\n *\n * @returns {Function} - Updater.\n */\n function position() {\n var before = now();\n\n return update;\n\n /**\n * Add the position to a node.\n *\n * @example\n * update({type: 'text', value: 'foo'});\n *\n * @param {Node} node - Node to attach position\n * on.\n * @param {Array} [indent] - Indentation for\n * `node`.\n * @return {Node} - `node`.\n */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /**\n * Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible.\n *\n * @example\n * add({});\n *\n * add({}, {children: []});\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Parent to insert into.\n * @return {Object} - Added or merged into node.\n */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /**\n * Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`.\n *\n * @example\n * eat('foo')({type: 'text', value: 'foo'});\n *\n * @param {string} subvalue - Removed from `value`,\n * and passed to `updatePosition`.\n * @return {Function} - Wrapper around `add`, which\n * also adds `position` to node.\n */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /**\n * Add the given arguments, add `position` to\n * the returned node, and return the node.\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Node to insert into.\n * @return {Node} - Added node.\n */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /**\n * Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n *\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n *\n * See `apply` above for what parameters are\n * expected.\n *\n * @return {Node} - Added node.\n */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /**\n * Test the position, after eating, and reverse\n * to a not-eaten state.\n *\n * @return {Position} - Position after eating `subvalue`.\n */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this\n var offset = self.offset\n var tokens = []\n var methods = self[type + 'Methods']\n var tokenizers = self[type + 'Tokenizers']\n var line = location.line\n var column = location.column\n var index\n var length\n var method\n var name\n var matched\n var valueLength\n\n // Trim white space only lines.\n if (!value) {\n return tokens\n }\n\n // Expose on `eat`.\n eat.now = now\n eat.file = self.file\n\n // Sync initial offset.\n updatePosition('')\n\n // Iterate over `value`, and iterate over all tokenizers. When one eats\n // something, re-iterate with the remaining value. If no tokenizer eats,\n // something failed (should not happen) and an exception is thrown.\n while (value) {\n index = -1\n length = methods.length\n matched = false\n\n while (++index < length) {\n name = methods[index]\n method = tokenizers[name]\n\n // Previously, we had constructs such as footnotes and YAML that used\n // these properties.\n // Those are now external (plus there are userland extensions), that may\n // still use them.\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n /* istanbul ignore next */ (!method.notInList || !self.inList) &&\n /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length\n\n method.apply(self, [eat, value])\n\n matched = valueLength !== value.length\n\n if (matched) {\n break\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now())\n }\n }\n\n self.eof = now()\n\n return tokens\n\n // Update line, column, and offset based on `value`.\n function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }\n\n // Get offset. Called before the first character is eaten to retrieve the\n // range’s offsets.\n function getOffset() {\n var indentation = []\n var pos = line + 1\n\n // Done. Called when the last character is eaten to retrieve the range’s\n // offsets.\n return function () {\n var last = line + 1\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1)\n\n pos++\n }\n\n return indentation\n }\n }\n\n // Get the current position.\n function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start\n this.end = now()\n }\n\n // Throw when a value is incorrectly eaten. This shouldn’t happen but will\n // throw on new, incorrect rules.\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.slice(0, subvalue.length) !== subvalue) {\n // Capture stack-trace.\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft'\n ),\n now()\n )\n }\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }\n\n // Add `node` to `parent`s children or to `tokens`. Performs merges where\n // possible.\n function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }\n\n // Remove `subvalue` from `value`. `subvalue` must be at the start of\n // `value`.\n function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }\n }\n}", "acceptToken(type, length) {\n if(this.processWhiteSpace(type, length)) {\n return null;\n }\n if(type < this.Token.$Token) {\n return this.makeToken(type, 0, length);\n } else {\n return this.makeToken(type & this.Token.$Token, type, length);\n }\n }", "function token(type, value) {\n \t\tthis.type = type;\n \t\tthis.value = value;\n \t}", "function typeToken() {\n\t\tvar type = thisToken;\n\t\tif (lastToken == '*')\n\t\t\ttype = '*' + type;\n\t\tgetToken();\n\t\tremoveNewLine();\n\t\tif (thisToken == '*' || thisToken == '&') {\n\t\t\tif (thisToken == '*')\n\t\t\t\ttype = thisToken + type;\n\t\t\tgetToken();\n\t\t}\n\t\t//type cast, not implemented\n\t\tif (thisToken == ')') {\n\t\t\tgetToken();\n\t\t\texecut();\n\t\t\treturn;\n\t\t}\n\t\tgetToken();\n\t\t//call function registration\n\t\tif (thisToken == '(') {\n\t\t\tpreviousToken();\n\t\t\taddFunction(type);\n\t\t} else if (thisToken == '[') {\n\t\t\taddArray(type);\n\t\t}\n\t\t//declaration of variables of the same type, separated by commas, assignment is not supported\n\t\telse if (thisToken == ',') {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t\tgetToken();\n\t\t\twhile (thisToken && thisToken != ';') {\n\t\t\t\tgetToken();\n\t\t\t\taddVar(type);\n\t\t\t\tgetToken();\n\t\t\t\tif (!(thisToken == ',' || thisToken == ';'))\n\t\t\t\t\tputError(lineCount, 17, '');\n\t\t\t\t//info(\"\" + lineCount + \" unsupported variable declaration\");\n\t\t\t}\n\t\t} else {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t}\n\t}", "function tokener(value, type) {\r\n session.tokens.push({\r\n value: value,\r\n type: type || value,\r\n start: null,\r\n end: null\r\n });\r\n }", "isToken(type) { return this.tokenizer.isTokenType(type) }", "getType() {\n return this.token.token_type;\n }", "constructor(token, type) {\n this._token = token; //token object\n this._type = type; //string\n }", "function finishToken(type, val) {\n tokEnd = tokPos;\n if (options.locations) tokEndLoc = new line_loc_t;\n tokType = type;\n skipSpace();\n tokVal = val;\n tokRegexpAllowed = type.beforeExpr;\n }", "eatToken(type) {\n\t\t\tconst token = this.getToken();\n\t\t\tif (token.type === type) {\n\t\t\t\tthis.nextToken();\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn token;\n\t\t\t} else {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}", "constructor(tokens) {\n this.tokens = tokens\n this.pos = 0\n this.types = {}\n for( var i=0; i<tokens.length; i++) this.types[tokens[i].type] = \"\"\n }", "tokenizer(token , isEndOfInput , previousTokens , terminal , config){\n }", "function token(typ,val){\n\t\treturn new Token(typ,val,-1,0);\n\t}", "function Token(type, value) {\n\tthis.type = type;\n\tthis.value = value;\n}", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "function tokenizer(term) {\n if (!term) {\n return [];\n }\n\n var tokens = [term];\n var meth = term.indexOf('::');\n\n // Split tokens into methods if \"::\" is found.\n if (meth > -1) {\n tokens.push(term.substr(meth + 2));\n term = term.substr(0, meth - 2);\n }\n\n // Split by namespace or fake namespace.\n if (term.indexOf('\\\\') > -1) {\n tokens = tokens.concat(term.split('\\\\'));\n } else if (term.indexOf('_') > 0) {\n tokens = tokens.concat(term.split('_'));\n }\n\n // Merge in splitting the string by case and return\n tokens = tokens.concat(term.match(/(([A-Z]?[^A-Z]*)|([a-z]?[^a-z]*))/g).slice(0,-1));\n\n return tokens;\n }", "tokenTypes(){ return [] }", "function Tokenizer(str) {\n this._str = str;\n this.pos = 0;\n}", "function it(type, value, quote) {\n var id, the_token;\n if (type === '(string)' || type === '(range)') {\n if (jx.test(value)) {\n warn_at(bundle.url, line, from);\n }\n }\n the_token = Object.create(syntax[(\n type === '(punctuator)' ||\n (type === '(identifier)' && is_own(syntax, value)) ?\n value :\n type\n )] || syntax['(error)']);\n if (type === '(identifier)') {\n the_token.identifier = true;\n if (value === '__iterator__' || value === '__proto__') {\n fail_at(bundle.reserved_a, line, from, value);\n } else if (option.nomen &&\n (value.charAt(0) === '_' ||\n value.charAt(value.length - 1) === '_')) {\n warn_at(bundle.dangling_a, line, from, value);\n }\n }\n if (value !== undefined) {\n the_token.value = value;\n }\n if (quote) {\n the_token.quote = quote;\n }\n if (comments) {\n the_token.comments = comments;\n comments = null;\n }\n the_token.line = line;\n the_token.from = from;\n the_token.thru = character;\n the_token.prev = older_token;\n id = the_token.id;\n prereg = id && (\n ('(,=:[!&|?{};'.indexOf(id.charAt(id.length - 1)) >= 0) ||\n id === 'return'\n );\n older_token.next = the_token;\n older_token = the_token;\n return the_token;\n }", "static getTokenizer() {\n return theTokenizer;\n }", "function sc_Token(type, val, pos) {\n this.type = type;\n this.val = val;\n this.pos = pos;\n}", "isTokenType(type) { return this.lexeme[type] !== undefined }", "makeToken(type, literal, length) {\n let pos = this.pos;\n if(length === 0 && type !== this.Token.$EOF) {\n length = 1;\n type = this.Token.$Error;\n literal = 0;\n }\n let start = { line: this.line, col: pos - this.linepos };\n if(type === this.Token.$Error) {\n this.linetok = this.line;\n this.linetokpos = this.linepos;\n } else {\n this.line = this.linetok;\n this.linepos = this.linetokpos;\n }\n this.forward(length);\n let end = { line: this.line, col: this.pos - this.linepos};\n return new Token(type, literal, this.input, pos, length, start, end);\n }", "function it(type, value) {\n var id, the_token;\n if (type === '(string)') {\n if (jx.test(value)) {\n warn('url', line, from);\n }\n }\n the_token = Object.create(syntax[(\n type === '(punctuator)' || (type === '(identifier)' &&\n Object.prototype.hasOwnProperty.call(syntax, value))\n ? value\n : type\n )] || syntax['(error)']);\n if (type === '(identifier)') {\n the_token.identifier = true;\n if (value === '__iterator__' || value === '__proto__') {\n stop('reserved_a', line, from, value);\n } else if (!option.nomen &&\n (value.charAt(0) === '_' ||\n value.charAt(value.length - 1) === '_')) {\n warn('dangling_a', line, from, value);\n }\n }\n if (type === '(number)') {\n the_token.number = +value;\n } else if (value !== undefined) {\n the_token.string = String(value);\n }\n the_token.line = line;\n the_token.from = from;\n the_token.thru = character;\n if (comments.length) {\n the_token.comments = comments;\n comments = [];\n }\n id = the_token.id;\n prereg = id && (\n ('(,=:[!&|?{};~+-*%^<>'.indexOf(id.charAt(id.length - 1)) >= 0) ||\n id === 'return' || id === 'case'\n );\n return the_token;\n }", "static makeTokenizer(literals, input) {\n if (theTokenizer === null) {\n theTokenizer = new tokenizer(literals, input);\n }\n }", "function tokenizer(input) {\n const singleTokensSpecs = [\n { char: '=', tokenType: 'equal' },\n { char: '*', tokenType: 'star' },\n { char: '!', tokenType: 'not' },\n { char: '[', tokenType: 'bracket' },\n { char: ']', tokenType: 'bracket' },\n { char: '-', tokenType: 'minus' },\n { char: '+', tokenType: 'plus' },\n { char: '\\\\', tokenType: 'backslash' },\n { char: '/', tokenType: 'forwardslash' },\n { char: '.', tokenType: 'dot' },\n { char: '<', tokenType: 'less' },\n { char: '>', tokenType: 'greater' },\n { char: '|', tokenType: 'pipe' },\n { char: '&', tokenType: 'and' },\n { char: '%', tokenType: 'percent' },\n { char: '^', tokenType: 'caret' },\n { char: ',', tokenType: 'comma' },\n { char: ';', tokenType: 'semi' },\n { char: '~', tokenType: 'tilde' },\n { char: '`', tokenType: 'grave' },\n { char: '(', tokenType: 'paren' },\n { char: ')', tokenType: 'paren' },\n { char: ':', tokenType: 'colon' },\n { char: '{', tokenType: 'curly' },\n { char: '}', tokenType: 'curly' },\n { char: '#', tokenType: 'SPECIAL' }\n ];\n const regexSingleTokensSpecs = [\n {\n start: /^(\\/\\/.*)/,\n tokenType: 'NONE',\n addLength: 0\n },\n {\n start: /^([\\s\\t\\n]+)/,\n tokenType: 'NONE',\n addLength: 0\n },\n {\n start: /^(\\d[\\d_]*\\b)/,\n tokenType: 'numberDec',\n addLength: 0\n },\n {\n start: /^0[xX]([\\da-fA-F][\\da-fA-F_]*\\b)/,\n tokenType: 'numberHex',\n addLength: 2\n },\n {\n start: /^(break|const|continue|do|else|exit|for|goto|halt|if|long|return|sleep|struct|void|while)/,\n tokenType: 'keyword',\n addLength: 0\n },\n {\n start: /^(asm)/,\n tokenType: 'SPECIAL',\n addLength: 0\n },\n {\n start: /^(\\w+)/,\n tokenType: 'variable',\n addLength: 0\n }\n ];\n const regexDoubleTokensSpecs = [\n {\n start: /^\\/\\*/,\n end: /([\\s\\S]*?\\*\\/)/,\n tokenType: 'NONE',\n startLength: 2,\n removeTrailing: 0,\n errorMsg: \"Missing '*/' to end comment section.\"\n },\n {\n start: /^\"/,\n end: /([\\s\\S]*?\")/,\n tokenType: 'string',\n startLength: 1,\n removeTrailing: 1,\n errorMsg: \"Missing '\\\"' to end string.\"\n },\n {\n start: /^'/,\n end: /([\\s\\S]*?')/,\n tokenType: 'string',\n startLength: 1,\n removeTrailing: 1,\n errorMsg: \"Missing \\\"'\\\" to end string.\"\n }\n ];\n let currentChar, remainingText;\n let current = 0;\n const tokens = [];\n let currentLine = 1;\n while (current < input.length) {\n currentChar = input.charAt(current);\n remainingText = input.slice(current);\n // Resolve double regex tokens\n const found = regexDoubleTokensSpecs.find(ruleN => {\n const startParts = ruleN.start.exec(remainingText);\n if (startParts != null) {\n const endParts = ruleN.end.exec(remainingText.slice(ruleN.startLength));\n current += ruleN.startLength;\n if (endParts !== null) {\n if (ruleN.tokenType === 'NONE') {\n currentLine += (endParts[1].match(/\\n/g) || '').length;\n current += endParts[1].length;\n return true; // breaks find function\n }\n tokens.push({ type: ruleN.tokenType, value: endParts[1].slice(0, -ruleN.removeTrailing), line: currentLine });\n currentLine += (endParts[1].match(/\\n/g) || '').length;\n current += endParts[1].length;\n return true; // breaks find function\n }\n throw new TypeError(`At line: ${currentLine}. ${ruleN.errorMsg}`);\n }\n return false;\n });\n if (found !== undefined) {\n // item already processed\n continue;\n }\n // Resolve single regex tokens\n const found2 = regexSingleTokensSpecs.find(ruleN => {\n const startParts = ruleN.start.exec(remainingText);\n if (startParts != null) {\n if (ruleN.tokenType === 'NONE') {\n currentLine += (startParts[1].match(/\\n/g) || '').length;\n current += startParts[1].length + ruleN.addLength;\n return true; // breaks find function\n }\n if (ruleN.tokenType === 'SPECIAL') {\n // handle asm case\n const asmParts = /^(asm[^\\w]*\\{([\\s\\S]*?)\\})/.exec(remainingText);\n if (asmParts === null) {\n throw new TypeError('At line:' + currentLine + ' Error parsing `asm { ... }` keyword');\n }\n tokens.push({ type: 'keyword', value: 'asm', line: currentLine, asmText: asmParts[2] });\n currentLine += (asmParts[1].match(/\\n/g) || '').length;\n current += asmParts[1].length;\n return true; // breaks find function\n }\n tokens.push({ type: ruleN.tokenType, value: startParts[1], line: currentLine });\n currentLine += (startParts[1].match(/\\n/g) || '').length;\n current += startParts[1].length + ruleN.addLength;\n return true; // breaks find function\n }\n return false;\n });\n if (found2 !== undefined) {\n continue;\n }\n // Resolve all single tokens\n const search = singleTokensSpecs.find(charDB => charDB.char === currentChar);\n if (search !== undefined) {\n if (search.tokenType === 'NONE') {\n current++;\n continue;\n }\n else if (search.tokenType === 'SPECIAL') {\n if (search.char === '#') {\n current++;\n const lines = input.slice(current).split('\\n');\n let i = 0;\n let val = '';\n for (; i < lines.length; i++) {\n val += lines[i];\n current += lines[i].length + 1; // newline!\n currentLine++;\n if (lines[i].endsWith('\\\\')) {\n val = val.slice(0, -1);\n continue;\n }\n break;\n }\n tokens.push({ type: 'macro', value: val, line: currentLine - i - 1 });\n continue;\n }\n throw new TypeError(`At line: ${currentLine}. SPECIAL rule not implemented in tokenizer().`);\n }\n tokens.push({ type: search.tokenType, value: currentChar, line: currentLine });\n current++;\n continue;\n }\n throw new TypeError(`At line: ${currentLine}. Forbidden character found: '${currentChar}'.`);\n }\n return tokens;\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "token(input, start, end, value) { return new Token(input, start, end, this.type, value) }", "token(input, start, value) { return new Token(input,start,input.pos,this.type,value) }", "_eat(tokenType) {\n const token = this._lookahead;\n\n if (token === null) {\n throw new SyntaxError(\n `Unexpected end of input, expected: \"${tokenType}\"`,\n );\n }\n\n if (token.type !== tokenType) {\n throw new SyntaxError(\n `Unexpected token: \"${token.value}\", expected: \"${tokenType}\"`,\n );\n }\n\n // Advance to next token.\n this._lookahead = this._tokenizer.getNextToken();\n\n return token;\n }", "function GenTokenParser(){}", "typeToken() {\n let typeToken;\n if (this.checkAny(...TokenKind_1.DeclarableTypes)) {\n // Token is a built in type\n typeToken = this.advance();\n }\n else if (this.options.mode === ParseMode.BrighterScript) {\n try {\n // see if we can get a namespaced identifer\n const qualifiedType = this.getNamespacedVariableNameExpression();\n typeToken = (0, creators_1.createToken)(TokenKind_1.TokenKind.Identifier, qualifiedType.getName(this.options.mode), qualifiedType.range);\n }\n catch (_a) {\n //could not get an identifier - just get whatever's next\n typeToken = this.advance();\n }\n }\n else {\n // just get whatever's next\n typeToken = this.advance();\n }\n return typeToken;\n }", "function tokenType(source) {\n switch (source) {\n case BOM:\n return 'byte-order-mark';\n case DOCUMENT:\n return 'doc-mode';\n case FLOW_END:\n return 'flow-error-end';\n case SCALAR:\n return 'scalar';\n case '---':\n return 'doc-start';\n case '...':\n return 'doc-end';\n case '':\n case '\\n':\n case '\\r\\n':\n return 'newline';\n case '-':\n return 'seq-item-ind';\n case '?':\n return 'explicit-key-ind';\n case ':':\n return 'map-value-ind';\n case '{':\n return 'flow-map-start';\n case '}':\n return 'flow-map-end';\n case '[':\n return 'flow-seq-start';\n case ']':\n return 'flow-seq-end';\n case ',':\n return 'comma';\n }\n switch (source[0]) {\n case ' ':\n case '\\t':\n return 'space';\n case '#':\n return 'comment';\n case '%':\n return 'directive-line';\n case '*':\n return 'alias';\n case '&':\n return 'anchor';\n case '!':\n return 'tag';\n case \"'\":\n return 'single-quoted-scalar';\n case '\"':\n return 'double-quoted-scalar';\n case '|':\n case '>':\n return 'block-scalar-header';\n }\n return null;\n}", "function tokenType(source) {\n switch (source) {\n case BOM:\n return 'byte-order-mark';\n case DOCUMENT:\n return 'doc-mode';\n case FLOW_END:\n return 'flow-error-end';\n case SCALAR:\n return 'scalar';\n case '---':\n return 'doc-start';\n case '...':\n return 'doc-end';\n case '':\n case '\\n':\n case '\\r\\n':\n return 'newline';\n case '-':\n return 'seq-item-ind';\n case '?':\n return 'explicit-key-ind';\n case ':':\n return 'map-value-ind';\n case '{':\n return 'flow-map-start';\n case '}':\n return 'flow-map-end';\n case '[':\n return 'flow-seq-start';\n case ']':\n return 'flow-seq-end';\n case ',':\n return 'comma';\n }\n switch (source[0]) {\n case ' ':\n case '\\t':\n return 'space';\n case '#':\n return 'comment';\n case '%':\n return 'directive-line';\n case '*':\n return 'alias';\n case '&':\n return 'anchor';\n case '!':\n return 'tag';\n case \"'\":\n return 'single-quoted-scalar';\n case '\"':\n return 'double-quoted-scalar';\n case '|':\n case '>':\n return 'block-scalar-header';\n }\n return null;\n }", "function emitToken(type, value, prefix, line, length) {\n const start = input ? currentLineLength - input.length : currentLineLength;\n const end = start + length;\n const token = {\n type,\n value,\n prefix,\n line,\n start,\n end\n };\n callback(null, token);\n return token;\n }", "finishToken(type, val) {\n if (val === undefined) val = type.label;\n let prevType = this.state.lex.type;\n this.finishTokenLex(type, val);\n this.updateContext(type, prevType);\n\n if (type === tt.indent) ++this.state.indentation;\n else if (type === tt.dedent) --this.state.indentation;\n\n let token = Token.fromState(this.state.lex);\n\n this.endToken(token);\n\n // Lookahead to see if the newline should actually be ignored, and ignore it if so\n if (token.type === tt.newline) {\n let nextToken = this.readNextToken();\n\n if (nextToken.type.continuesPreviousLine) {\n // convert newline token to whitespace, for sourceElementsTokens\n token.type = tt.whitespace;\n token.value = {code: this.input.slice(token.start, token.end)};\n // TODO: coalesce sequential whitespace sourceElements\n\n // remove newline from concrete tokens\n this.assert(this.state.tokens.pop() === nextToken);\n this.assert(this.state.tokens.pop() === token);\n this.state.tokens.push(nextToken);\n token = nextToken;\n token.meta.continuedPreviousLine = true;\n }\n }\n\n return token;\n }", "constructor(type, word) {\n super()\n this.word = word\n this.type = type\n }", "function BBCodeParser_Token(type, content, argument) {\r\n\r\n\t\tthis.type = BBCodeParser_Token.NONE;\r\n\t\tthis.stat = BBCodeParser_Token.UNDETERMINED;\r\n\t\tthis.content = '';\r\n\t\tthis.argument = null;\r\n\t\tthis.matches = null; // matching start/end code index\r\n\r\n\t\tif(argument === undefined) argument = null;\r\n\t\tthis.type = type;\r\n\t\tthis.content = content;\r\n\t\tthis.stat = (this.type === BBCodeParser_Token.CONTENT)? BBCodeParser_Token.VALID : BBCodeParser_Token.UNDETERMINED;\r\n\t\tthis.argument = argument;\r\n\r\n\t}", "function typenize (type)\n {\n let typewords = type.split(' ');\n\n if (typewords.length === 1)\n {\n if (typewords[0] === 'Integer' || typewords[0] === 'Float')\n return 'number';\n\n else if (typewords[0] === 'String')\n return 'string';\n\n else if (typewords[0] === 'Boolean' || typewords[0] === 'True' || typewords[0] === 'False')\n return 'boolean';\n \n else if (typewords[0] === 'InputFile')\n return '{ name: string, data: Buffer }';\n\n else if (typewords[0] === 'CallbackGame')\n return 'any';\n\n else\n return typewords[0];\n }\n\n else if (typewords.length === 3)\n {\n if (typewords[0] === 'Array' && typewords[1] === 'of')\n return 'Array<' + typenize(typewords[2]) + '>';\n\n else if (typewords[1] === 'or')\n return typenize(typewords[0]) + ' | ' + typenize(typewords[2]);\n }\n\n return 'any';\n }", "function finishToken(\n type,\n contextualKeyword = ContextualKeyword.NONE,\n) {\n state.end = state.pos;\n state.type = type;\n state.contextualKeyword = contextualKeyword;\n}", "function finishToken(\n type,\n contextualKeyword = _keywords.ContextualKeyword.NONE,\n) {\n _base.state.end = _base.state.pos;\n _base.state.type = type;\n _base.state.contextualKeyword = contextualKeyword;\n}", "function DirectiveType() {}", "findTokenType(type) {\n let token = this.findToken();\n if(token.type != type) {\n this.unexpectedToken(token);\n }\n return token;\n }", "isTokenType(type){ return false }", "function tokenize() {\n return input\n .replace(/\\t/g, \"\")\n .split(/\\s+/)\n .map(str => str.trim())\n .filter(str => str.length)\n .filter(str => validateAgainstSpec(str));\n }", "function filterTokens(params, type, callback) {\n params.tokens.forEach(function forToken(token) {\n if (token.type === type) {\n callback(token);\n }\n });\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "function tokenizer () {\n return split(/(<\\/?[\\w\\d-_]+>)/)\n}", "function parse_type() {\n tree.addNode('type', 'branch');\n if (foundTokensCopy[parseCounter][1] == 'int') {\n match('int', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'string') {\n match('string', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'boolean') {\n match('boolean', parseCounter);\n parseCounter++;\n }\n tree.endChildren();\n\n}", "tokenize(buf, off, len, line, column) {\n this._reset(line, column);\n\n let parseState = START;\n for (let i = 0; i < len; i += 1) {\n const c = buf[off + i];\n switch (parseState) {\n case START:\n if (c === '<') {\n parseState = TAG;\n }\n break;\n case TAG:\n if (c === '/') {\n this.endTag = true;\n parseState = NAME;\n } else if (c === '\"' || c === '\\'') {\n this.quoteChar = c;\n parseState = STRING;\n } else if (isWhitespace(c)) {\n parseState = INSIDE;\n } else {\n this.tagName += c;\n parseState = NAME;\n }\n break;\n case NAME:\n if (isWhitespace(c)) {\n parseState = INSIDE;\n } else if (c === '\"' || c === '\\'') {\n this.quoteChar = c;\n parseState = STRING;\n } else if (c === '>') {\n parseState = END;\n } else if (c === '/') {\n parseState = ENDSLASH;\n } else {\n this.tagName += c;\n }\n break;\n case INSIDE:\n if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else if (c === '/') {\n this._attributeEnded();\n parseState = ENDSLASH;\n } else if (c === '\"' || c === '\\'') {\n this._attributeValueStarted();\n this.quoteChar = c;\n parseState = STRING;\n } else if (c === '=') {\n parseState = EQUAL;\n } else if (!isWhitespace(c)) {\n this.attName += c;\n parseState = ATTNAME;\n }\n break;\n case ATTNAME:\n if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else if (c === '/') {\n this._attributeEnded();\n parseState = ENDSLASH;\n } else if (c === '=') {\n parseState = EQUAL;\n } else if (c === '\"' || c === '\\'') {\n this.quoteChar = c;\n parseState = STRING;\n } else if (isWhitespace(c)) {\n parseState = BETWEEN_ATTNAME;\n } else {\n this.attName += c;\n }\n break;\n case BETWEEN_ATTNAME:\n if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else if (c === '/') {\n this._attributeEnded();\n parseState = ENDSLASH;\n } else if (c === '\"' || c === '\\'') {\n this._attributeValueStarted();\n this.quoteChar = c;\n parseState = STRING;\n } else if (c === '=') {\n parseState = EQUAL;\n } else if (!isWhitespace(c)) {\n this._attributeEnded();\n this.attName += c;\n parseState = ATTNAME;\n }\n break;\n case EQUAL:\n if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else if (c === '\"' || c === '\\'') {\n this._attributeValueStarted();\n this.quoteChar = c;\n parseState = STRING;\n } else if (!isWhitespace(c)) {\n this._attributeValueStarted();\n this.attValue += c;\n parseState = ATTVALUE;\n }\n break;\n case ATTVALUE:\n if (isWhitespace(c)) {\n this._attributeEnded();\n parseState = INSIDE;\n } else if (c === '\"' || c === '\\'') {\n this._attributeEnded();\n this.quoteChar = c;\n parseState = STRING;\n } else if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else {\n this.attValue += c;\n }\n break;\n case STRING:\n if (c === this.quoteChar) {\n this._attributeEnded();\n parseState = INSIDE;\n } else {\n this.attValue += (c);\n }\n break;\n case ENDSLASH:\n if (c === '>') {\n this.endSlash = true;\n parseState = END;\n } else if (c === '\"' || c === '\\'') {\n this.quoteChar = c;\n parseState = STRING;\n } else if (c !== '/' && !isWhitespace(c)) {\n this.attName += c;\n parseState = ATTNAME;\n } else {\n parseState = INSIDE;\n }\n break;\n case END:\n break;\n default:\n throw new Error('Unexpected parse state');\n }\n if (c === '\\n') {\n this.line += 1;\n this.column = 0;\n } else {\n this.column += 1;\n }\n }\n return this;\n }", "function DirectiveType(){}", "addTag(token, type = undefined, word) {\n if (!token) {\n switch (type) {\n case \"if\":\n return <syn className=\"if\">{word}</syn>;\n case \"func\":\n return <syn className=\"func\">{word}</syn>;\n case \"comm\":\n return <syn className=\"comm\">{word}</syn>;\n default:\n return <syn className=\"default\">{word}</syn>;\n }\n } else {\n switch (token) {\n case \"comm\":\n return <syn className=\"comm\">//</syn>;\n case \"semic\":\n return <syn className=\"semic\">;</syn>;\n case \"lparen\":\n return <syn className=\"paren\">(</syn>;\n case \"rparen\":\n return <syn className=\"paren\">)</syn>;\n case \"lbrack\":\n return <syn className=\"brack\">{\"{\"}</syn>;\n case \"rbrack\":\n return <syn className=\"brack\">{\"}\"}</syn>;\n case \"dquote\":\n return <syn className=\"dquote\">{'\"'}</syn>;\n case \"squote\":\n return <syn className=\"squote\">{\"'\"}</syn>;\n case \"dot\":\n return <syn className=\"dot\">.</syn>;\n case \"lsq\":\n return <syn className=\"sq\">[</syn>;\n case \"rsq\":\n return <syn className=\"sq\">]</syn>;\n case \"eq\":\n return <syn className=\"eq\">=</syn>;\n case \"plus\":\n return <syn className=\"plus\">+</syn>;\n }\n }\n }", "function parseTypeName() {\n var expr, applications, startIndex = index - value.length;\n\n expr = parseNameExpression();\n if (token === Token.DOT_LT || token === Token.LT) {\n next();\n applications = parseTypeExpressionList();\n expect(Token.GT);\n return maybeAddRange({\n type: Syntax.TypeApplication,\n expression: expr,\n applications: applications\n }, [startIndex, previous]);\n }\n return expr;\n }", "tokenize(input, ruleName) {\n const tokens = super.tokenize(input)\n if (typeof input === \"string\" && ruleName === \"block\") return this.tokenizer.breakIntoBlocks(tokens)\n return tokens\n }", "tokenBefore(types) {\n let token = language.syntaxTree(this.state).resolveInner(this.pos, -1);\n while (token && types.indexOf(token.name) < 0)\n token = token.parent;\n return token ? { from: token.from, to: this.pos,\n text: this.state.sliceDoc(token.from, this.pos),\n type: token.type } : null;\n }", "addToken(type, range) {\n const token = Object.assign({ type, value: this.code.slice(...range) }, this.getConvertLocation(...range));\n this.tokens.push(token);\n return token;\n }", "function _Token(type, token, pos, string) {\n return { type: type, token: token, pos: pos, string: string };\n}", "function Token(type, text, newlines, whitespace_before, parent) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = /* inline comment*/ [];\n\n\n this.comments_after = []; // no new line before and newline after\n this.newlines = newlines || 0;\n this.wanted_newline = newlines > 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = parent || null;\n this.opened = null;\n this.directives = null;\n}", "get delim () {\n return delim[type]\n }", "function tokenTypes(n) {\r\n\tif (n.parent) {\r\n\t\tvar tt = [n.type];\r\n\t\treturn tt.concat(tokenTypes(n.parent));\r\n } else {\r\n \treturn n.type;\r\n\t}\r\n}", "getDirectiveBoundTarget() {\n if (this.next === EOF || this.peekKeywordAs() || this.peekKeywordLet()) {\n return null;\n }\n const ast = this.parsePipe(); // example: \"condition | async\"\n const { start, end } = ast.span;\n const value = this.input.substring(start, end);\n return new ASTWithSource(ast, value, this.location, this.absoluteOffset + start, this.errors);\n }", "getDirectiveBoundTarget() {\n if (this.next === EOF || this.peekKeywordAs() || this.peekKeywordLet()) {\n return null;\n }\n const ast = this.parsePipe(); // example: \"condition | async\"\n const { start, end } = ast.span;\n const value = this.input.substring(start, end);\n return new ASTWithSource(ast, value, this.location, this.absoluteOffset + start, this.errors);\n }", "function fType(type) {\n\t\tif (directives.indexOf(type) > -1) {\n\t\t\treturn '@' + type;\n\t\t}\n\n\t\treturn type;\n\t}", "function Token (type, children, text) {\n this.type = type\n\n if (children) {\n this.children = children\n }\n\n if (text) {\n this.text = text\n }\n }", "function JSONTokenizer(callback){\n\tthis.stack = [];\n\tthis.valFragment = \"\";\n\tthis.escapeState = null;\n\tthis.firstSurrogate = null;\n\tthis.topFn = this.processA;\n\tthis.curString = null;\n\tthis.curKey = null;\n\n\tthis.curState = \"\";\n\treturn this;\n}" ]
[ "0.6440441", "0.6440441", "0.6440441", "0.6440441", "0.6440441", "0.63420445", "0.63303924", "0.60194075", "0.5882372", "0.5778136", "0.57694876", "0.57538456", "0.5736236", "0.5673441", "0.5641058", "0.5611508", "0.5604817", "0.5583866", "0.55630934", "0.5543313", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.55373734", "0.5508835", "0.55083543", "0.5464218", "0.5443948", "0.54360807", "0.54146504", "0.53442055", "0.53309935", "0.5320155", "0.52048904", "0.5191649", "0.5191649", "0.5191649", "0.5182435", "0.51792175", "0.5174347", "0.5171587", "0.51602674", "0.5150307", "0.5144068", "0.51370376", "0.51354676", "0.51200366", "0.51151896", "0.5114313", "0.5113384", "0.5108422", "0.5104231", "0.50840634", "0.5078997", "0.5072577", "0.5033276", "0.5031749", "0.5031749", "0.5031749", "0.5031749", "0.5031749", "0.5031749", "0.5031749", "0.50205344", "0.5015582", "0.50134146", "0.5001479", "0.49834645", "0.4981439", "0.49500126", "0.49444678", "0.49320585", "0.492236", "0.4909153", "0.48967198", "0.48935553", "0.48889983", "0.48889983", "0.4886361", "0.48839033", "0.4877592" ]
0.0
-1
Update line, column, and offset based on `value`.
function updatePosition(subvalue) { var lastIndex = -1; var index = subvalue.indexOf('\n'); while (index !== -1) { line++; lastIndex = index; index = subvalue.indexOf('\n', index + 1); } if (lastIndex === -1) { column += subvalue.length; } else { column = subvalue.length - lastIndex; } if (line in offset) { if (lastIndex !== -1) { column += offset[line]; } else if (column <= offset[line]) { column = offset[line] + 1; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }", "update(value) {\n let idx = this.valueToIdxMap.get(value);\n if (!this.moveUp(idx)) {\n this.moveDown(idx);\n }\n }", "set offset( value )\n {\n if ( typeof value === 'number' ) this.mOffsetInput.value = value;\n }", "_updateValue(row, column, newValue) {\n const that = this,\n oldValue = that._getValueInCell(row, column);\n\n if (!that._areDifferent(newValue, oldValue)) {\n return;\n }\n\n const dimensionValues = that._coordinates,\n actualIndexes = dimensionValues.slice(0),\n changedValueDimensions = [];\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n actualIndexes[actualIndexes.length - 1] += column;\n actualIndexes[actualIndexes.length - 2] += row;\n }\n else {\n actualIndexes[0] += column;\n actualIndexes[1] += row;\n }\n\n for (let i = 0; i < that.dimensions; i++) {\n if (i === 0) { // x\n if (that._oneDimensionSpecialCase === false) {\n changedValueDimensions.push(actualIndexes[0]);\n }\n else {\n changedValueDimensions.push(row + dimensionValues[0]);\n }\n }\n else if (i === 1) { // y\n changedValueDimensions.push(actualIndexes[1]);\n }\n else { // other dimensions\n changedValueDimensions.push(actualIndexes[i]);\n }\n }\n\n let tempArr = that.value;\n\n for (let j = 0; j < changedValueDimensions.length; j++) {\n if (tempArr[changedValueDimensions[j]] === undefined || tempArr[changedValueDimensions[j]] === oldValue) {\n if (j !== changedValueDimensions.length - 1) {\n tempArr[changedValueDimensions[j]] = [];\n }\n else {\n tempArr[changedValueDimensions[j]] = newValue;\n }\n }\n tempArr = tempArr[changedValueDimensions[j]];\n }\n\n that._fillValueArray(changedValueDimensions.slice(0));\n\n that.$.fireEvent('change', { 'value': newValue, 'oldValue': oldValue, 'dimensionIndexes': changedValueDimensions });\n }", "setValue(value) {\n // Save old values in computeCell for comparison checks\n for (const computeCell of this.computeCells) {\n computeCell.saveValue();\n }\n this.value = value;\n this.onUpdate();\n }", "set Offset(value) {\n this._offset = value;\n }", "function setTailPosition(axis, value) {\n stringValue = String(value) + \"px\";\n $tail.css(axis, stringValue);\n}", "function updateCode(value) {\n\n if (codeMirror.getValue() !== value) {\n var anchor = codeMirror.getCursor(true), head = codeMirror.getCursor(false); // Backup original selection position\n if (cow.merging) {\n value = mergeStr(codeMirror.getValue()||\"\", value||\"\");\n // myChange = true;\n }\n codeMirror.setValue(value); // Set new value / contents\n codeMirror.setSelection(anchor, head); // Restore selection position\n codeMirror.setCursor(head.line, head.ch); // Restore cursor position\n }\n }", "function setCellPositon() {\n puzzleData.forEach((item, index) => {\n if (item.value) _move(item.el, index);\n })\n }", "function setPos(val) {\n RTG_VCF_RECORD.setStart(val - 1); // To internal zero-based\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }", "function updateVertexHeight(value, x, y, mesh, width){\n var i = getIdx(x, y, width);\n mesh.geometry.vertices[i].y = value;\n}", "function edit_table_row (source_table, information_str, value)\n{ \n idx = source_table.data ['x_data'].indexOf (information_str)\n if (idx >= 0) \n {\n source_table.data ['y_data'] [idx] = value;\n }\n}", "constructor(type, value, line, column) {\r\n this.type = type;\r\n this.value = value;\r\n this.line = line;\r\n this.column = column;\r\n }", "updateLineNumber(editor, fromLine, toLine) {\n const annotations = this.getAnnotations(editor, fromLine)\n return this._setAnnotations(\n editor,\n annotations.map(annotation => {\n return {\n ...annotation,\n lineNumber: toLine,\n }\n })\n )\n }", "_moveThumbBasedOnValue(value) {\n const that = this,\n px = that._numericProcessor.valueToPx(that._numericProcessor.getCoercedValue(value));\n\n that.updateFillSizeAndPosition(px, that._settings.margin, value, true);\n }", "set position(value) {\n this.position$.next(value);\n }", "function updateValue( value ) \n{\n \n updateComponentValue( value );\n \n}", "function setGridCellDev(grid, row, col, value)\n{\n // IGNORE IF IT'S OUTSIDE THE GRID\n if (!isValidCellDev(row, col))\n {\n return;\n }\n var index = (row * gridWidthDev) + col;\n grid[index] = value;\n}", "function consume() {\n // Line ending; assumes CR is not used (remark removes those).\n if (value.charCodeAt(index) === lineFeed) {\n place.line++\n place.column = 1\n }\n // Anything else.\n else {\n place.column++\n }\n\n index++\n\n place.offset++\n place.index = index\n }", "function setCell(x, y, value) {\n\t\t// If we're writing notes on an empty sqaure\n\t\tif (notes && value !== 0 && !readonly[y][x]) {\n\t\t\t// DOn't mutate state directly\n\t\t\tconst copy = candidates.slice();\n\n\t\t\tif (copy[y][x].includes(value)) {\n\t\t\t\t// Remove values from candidates if already existed\n\t\t\t\tcopy[y][x].splice(copy[y][x].indexOf(value), 1);\n\t\t\t} else {\n\t\t\t\tcopy[y][x].push(value);\n\t\t\t}\n\n\t\t\tsetCandidates(copy);\n\t\t} else {\n\t\t\t// Setting single value to cell if its not readonly\n\t\t\tif (!readonly[y][x]) {\n\t\t\t\tconst copy = sudoku.slice();\n\t\t\t\t// Delete's value if same key is pressed\n\t\t\t\tif (value === sudoku[y][x]) {\n\t\t\t\t\tcopy[y][x] = 0;\n\t\t\t\t} else {\n\t\t\t\t\tcopy[y][x] = value;\n\t\t\t\t}\n\n\t\t\t\tsetSudoku(copy);\n\t\t\t}\n\t\t}\n\t}", "function moveWriteCell(x, y, color, line) {\n if (pos < 0) line = line.substr(pos * -1);\n var msg = pad + color + line;\n\t\t\n writeCell(x, y, msg,animationBoard.id);\n }", "static update(fields, value) {\n if (typeof value === 'number') {\n fields.position = value;\n } else if (typeof value === 'string') {\n fields.insertString = value;\n } else if (typeof value === 'object' && value.d !== undefined) {\n fields.delNum = value.d;\n }\n }", "function setTile(x, y, value) {\n convert(x, y, function (index) {\n data[index] = value;\n \n redraw(x, y, true);\n\n if (tileset.isNSensitive(value)) {\n //Update adjacent\n redraw(x - 1, y, true);\n redraw(x + 1, y, true);\n redraw(x, y - 1, true);\n redraw(x, y + 1, true);\n }\n });\n }", "modify(index, v) { // index is already multiplied by values_per_entry\n if (this.values_per_entry > 1) {\n console.assert(v.length == this.values_per_entry, \"Unexpected number of values\")\n let vindex = index * this.values_per_entry\n console.assert(vindex < this.lst.length, \"modify out of range\")\n for(let vi = 0; vi < v.length; ++vi)\n this.lst[vindex + vi] = v[vi]\n this.reprint_line(vindex, v)\n }\n else {\n console.assert(v.length === undefined, \"Unexpected list\")\n this.lst[index] = v\n this.reprint_line(index, this.lst[index])\n } \n this.pset_dirty()\n }", "function changeLinePos(line, pos) {\n pos = {\n x: pos.x / resizer,\n y: pos.y / resizer\n }\n gMeme[getMemeIdxInGMeme(gCurrMeme)].lines[line].pos = pos;\n}", "setCell(row, column, value) {\n if (/[0-9]/.test(value)) {\n this.sudokuBoard[row][column] = +value;\n }\n return this.getCell(row, column);\n }", "function set(row, col, value) {\n _data[row][col] = value;\n }", "_set_value(value) {\n if (!this._has_value_flag) {\n this._update_size(1);\n this._has_value_flag = true;\n }\n this._value = value;\n }", "updateValue(value) {\n const that = this.context;\n\n value = value instanceof JQX.Utilities.BigNumber ? value : new JQX.Utilities.BigNumber(value);\n\n const renderedValue = this.validate(value, that._minObject, that._maxObject);\n let oldValue = that.value,\n valueDetail, difference;\n\n that._number = renderedValue;\n that._drawValue = that.logarithmicScale ? Math.log10(renderedValue) : renderedValue;\n\n if (that.mode === 'numeric') {\n valueDetail = value.toString();\n that.value = valueDetail;\n difference = this.compare(value, oldValue);\n }\n else {\n oldValue = JQX.Utilities.DateTime.fromFullTimeStamp(oldValue);\n that._valueDate = JQX.Utilities.DateTime.fromFullTimeStamp(value);\n that.value = value;\n value = that._valueDate;\n valueDetail = value;\n difference = value.compare(oldValue) !== 0;\n }\n\n if (!that._programmaticValueIsSet && (difference || that._scaleTypeChangedFlag)) {\n that.$.fireEvent('change', { 'value': valueDetail, 'oldValue': oldValue });\n }\n\n if (that.$.hiddenInput) {\n that.$.hiddenInput.value = value;\n }\n\n that._moveThumbBasedOnValue(that._drawValue);\n }", "function updatePosition(str) {\n\t var lines = str.match(/\\n/g);\n\t if (lines) lineno += lines.length;\n\t var i = str.lastIndexOf('\\n');\n\t column = ~i ? str.length - i : column + str.length;\n\t }", "function updatePositionsincident() {\n var positions = line.geometry.attributes.position.array;\n\n var x = -16;\n var y = 0; \n var z = -2.5;\n var index = 0;\n\n for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {\n\n positions[ index ++ ] = x;\n positions[ index ++ ] = y;\n positions[ index ++ ] = z;\n\n x += (11.78/MAX_POINTS);\n y += (3/MAX_POINTS);\n }\n}", "setValue(val) {\n const valRel = (val - this.valueMin) / (this.valueMax - this.valueMin);\n const newPos = valRel * this.sliderWidth + 2 * this.handleOffset;\n this.translate(newPos);\n this.value = this.getPositionValue();\n this.dispatchEvent(new CustomEvent(\"update\"));\n }", "_updateValue(value) {\n const valuesHandler = this._valuesHandler;\n valuesHandler.updateValue(valuesHandler.getActualValue(value));\n }", "function moveWriteCell(x, y, color, line) {\n if (pos < 0) pos += board.cols;\n var msg = color + shiftWrapText(line, \" \", pos, board.cols);\n writeCell(x, y, msg, animationBoard.id);\n }", "changeValue(value) {\n this.rawValue = value;\n if (this.rawToFinalValue) {\n this.value = this.rawToFinalValue(value);\n }\n else\n this.value = value;\n this.parentSectionReflection.valueChanged();\n this.validate();\n }", "set(row, column, value) {\n const n = this._width * row + column;\n this._elements[n] = value;\n return this;\n }", "function setCell(row, column, value) {\n \t$scope.game.board[row][column] = value;\n $scope.game.$save();\n\n }", "deleteValueAtOffset(offset) {\n if (offset < 0 || offset > this.length) {\n throw new Error(`Invalid offset \"${offset}\"`);\n }\n const [ left, right ] = [\n this.value.slice(0, offset),\n this.value.slice(offset+1)\n ];\n this.value = left + right;\n }", "set value(value)\n {\n this.updated = true\n this._value = value\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function updatePosition(str) {\n const lines = str.match(/\\n/g);\n\n if (lines) {\n lineno += lines.length;\n }\n\n const i = str.lastIndexOf('\\n'); // eslint-disable-next-line no-bitwise\n\n column = ~i ? str.length - i : column + str.length;\n }", "function updateValueLine() {\n if (paused) return;\n\n var hoverValue = g.selectAll('.nv-hoverValue').data(index);\n\n var hoverEnter = hoverValue.enter()\n .append('g').attr('class', 'nv-hoverValue')\n .style('stroke-opacity', 0)\n .style('fill-opacity', 0);\n\n hoverValue.exit()\n .transition().duration(250)\n .style('stroke-opacity', 0)\n .style('fill-opacity', 0)\n .remove();\n\n hoverValue\n .attr('transform', function(d) { return 'translate(' + x(sparkline.x()(data[d],d)) + ',0)' })\n .transition().duration(250)\n .style('stroke-opacity', 1)\n .style('fill-opacity', 1);\n\n if (!index.length) return;\n\n hoverEnter.append('line')\n .attr('x1', 0)\n .attr('y1', -margin.top)\n .attr('x2', 0)\n .attr('y2', availableHeight);\n\n hoverEnter.append('text').attr('class', 'nv-xValue')\n .attr('x', -6)\n .attr('y', -margin.top)\n .attr('text-anchor', 'end')\n .attr('dy', '.9em');\n\n g.select('.nv-hoverValue .nv-xValue')\n .text(xTickFormat(sparkline.x()(data[index[0]], index[0])));\n\n hoverEnter.append('text').attr('class', 'nv-yValue')\n .attr('x', 6)\n .attr('y', -margin.top)\n .attr('text-anchor', 'start')\n .attr('dy', '.9em');\n\n g.select('.nv-hoverValue .nv-yValue')\n .text(yTickFormat(sparkline.y()(data[index[0]], index[0])));\n }", "function updateValueLine() {\n if (paused) return;\n\n var hoverValue = g.selectAll('.nv-hoverValue').data(index);\n\n var hoverEnter = hoverValue.enter()\n .append('g').attr('class', 'nv-hoverValue')\n .style('stroke-opacity', 0)\n .style('fill-opacity', 0);\n\n hoverValue.exit()\n .transition().duration(250)\n .style('stroke-opacity', 0)\n .style('fill-opacity', 0)\n .remove();\n\n hoverValue\n .attr('transform', function(d) { return 'translate(' + x(sparkline.x()(data[d],d)) + ',0)' })\n .transition().duration(250)\n .style('stroke-opacity', 1)\n .style('fill-opacity', 1);\n\n if (!index.length) return;\n\n hoverEnter.append('line')\n .attr('x1', 0)\n .attr('y1', -margin.top)\n .attr('x2', 0)\n .attr('y2', availableHeight);\n\n hoverEnter.append('text').attr('class', 'nv-xValue')\n .attr('x', -6)\n .attr('y', -margin.top)\n .attr('text-anchor', 'end')\n .attr('dy', '.9em');\n\n g.select('.nv-hoverValue .nv-xValue')\n .text(xTickFormat(sparkline.x()(data[index[0]], index[0])));\n\n hoverEnter.append('text').attr('class', 'nv-yValue')\n .attr('x', 6)\n .attr('y', -margin.top)\n .attr('text-anchor', 'start')\n .attr('dy', '.9em');\n\n g.select('.nv-hoverValue .nv-yValue')\n .text(yTickFormat(sparkline.y()(data[index[0]], index[0])));\n }", "function updateValueLine() {\n if (paused) return;\n\n var hoverValue = g.selectAll('.nv-hoverValue').data(index);\n\n var hoverEnter = hoverValue.enter()\n .append('g').attr('class', 'nv-hoverValue')\n .style('stroke-opacity', 0)\n .style('fill-opacity', 0);\n\n hoverValue.exit()\n .transition().duration(250)\n .style('stroke-opacity', 0)\n .style('fill-opacity', 0)\n .remove();\n\n hoverValue\n .attr('transform', function(d) { return 'translate(' + x(sparkline.x()(data[d],d)) + ',0)' })\n .transition().duration(250)\n .style('stroke-opacity', 1)\n .style('fill-opacity', 1);\n\n if (!index.length) return;\n\n hoverEnter.append('line')\n .attr('x1', 0)\n .attr('y1', -margin.top)\n .attr('x2', 0)\n .attr('y2', availableHeight);\n\n hoverEnter.append('text').attr('class', 'nv-xValue')\n .attr('x', -6)\n .attr('y', -margin.top)\n .attr('text-anchor', 'end')\n .attr('dy', '.9em');\n\n g.select('.nv-hoverValue .nv-xValue')\n .text(xTickFormat(sparkline.x()(data[index[0]], index[0])));\n\n hoverEnter.append('text').attr('class', 'nv-yValue')\n .attr('x', 6)\n .attr('y', -margin.top)\n .attr('text-anchor', 'start')\n .attr('dy', '.9em');\n\n g.select('.nv-hoverValue .nv-yValue')\n .text(yTickFormat(sparkline.y()(data[index[0]], index[0])));\n }", "update(cell, value) {\n\t\tlet queue = []\n\t\tlet newCell = new DokuCell({\n\t\t\tindex: cell.index,\n\t\t\tpossibilities: [value]\n\t\t})\n\t\tqueue.push(newCell)\n\t\tthis.cells[cell.index] = newCell\n\t\twhile (queue.length !== 0) {\n\t\t\tlet processing = queue.shift()\n\t\t\tif (processing.possibilities.length === 0) { break }\n\n\t\t\tfor (let loc of ['row', 'col', 'subgrid']) {\n\t\t\t\tlet results = this.percolate(processing, processing.possibilities[0], loc)\n\t\t\t\tqueue = queue.concat(results)\n\t\t\t}\n\t\t}\n\t}", "constructor(kind, start, end, line, column, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\n this.value = value;\n this.prev = null;\n this.next = null;\n }", "updateValue(value) {\n const that = this.context,\n renderedValue = this.validate(value, that._minObject, that._maxObject),\n oldActualValue = that.value;\n\n if (value.toString() !== oldActualValue.toString() || that._scaleTypeChangedFlag) {\n that.value = value.toString();\n that._number = renderedValue;\n\n if (!that._programmaticValueIsSet) {\n that.$.fireEvent('change', { 'value': that.value, 'oldValue': oldActualValue });\n }\n }\n else {\n that.value = typeof (value) === 'string' ? value : value.toString();\n }\n\n that._drawValue = that.logarithmicScale ? Math.log10(renderedValue).toString() : renderedValue.toString();\n that._moveThumbBasedOnValue(that._drawValue);\n\n if (that.$.hiddenInput) {\n that.$.hiddenInput.value = that.value;\n }\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g)\n if (lines) {\n lineno += lines.length\n }\n var i = str.lastIndexOf('\\n')\n column = ~i ? str.length - i : column + str.length\n }", "set point(value) {}", "setValue(value) {\n let {grip} = this\n grip.object3D.position.z = 0\n grip.object3D.position.x = Math.max(grip.object3D.position.x, 0.001)\n this.spherical.setFromCartesianCoords(grip.object3D.position.x, grip.object3D.position.y, grip.object3D.position.z)\n this.spherical.theta = Math.PI/ 2\n this.spherical.radius = this.data.handleLength\n this.spherical.phi = THREE.Math.mapLinear(value, this.data.valueRange.x, this.data.valueRange.y, this.data.angleRange.x * Math.PI / 180, this.data.angleRange.y * Math.PI / 180)\n grip.object3D.position.setFromSpherical(this.spherical)\n\n this.bodyPositioner.object3D.matrix.lookAt(this.grip.object3D.position, this.origin, this.forward)\n Util.applyMatrix(this.bodyPositioner.object3D.matrix, this.bodyPositioner.object3D)\n }", "function updatePosition(str) {\n var lines = str.match(/\\n/g);\n if (lines)\n lineno += lines.length;\n var i = str.lastIndexOf('\\n');\n column = ~i ? str.length - i : column + str.length;\n }", "function setIndexPosition(val)\n { \n _pause();\n \n var max = _fileLength()-1;\n // val could be a floating-point number\n val = clamp(parseInt(val), 0, max);\n \n currentIndexPosition = nextIndexPosition = val;\n \n update(performance.now());\n draw();\n }", "function updateDevice(value) {\n if (updateFunction) {\n updateFunction(object, min, max, value);\n }\n }", "set(index, value) {\n this._data[index * CELL_SIZE + 1 /* FG */] = value[CHAR_DATA_ATTR_INDEX];\n if (value[CHAR_DATA_CHAR_INDEX].length > 1) {\n this._combined[index] = value[1];\n this._data[index * CELL_SIZE + 0 /* CONTENT */] = index | 2097152 /* IS_COMBINED_MASK */ | (value[CHAR_DATA_WIDTH_INDEX] << 22 /* WIDTH_SHIFT */);\n }\n else {\n this._data[index * CELL_SIZE + 0 /* CONTENT */] = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0) | (value[CHAR_DATA_WIDTH_INDEX] << 22 /* WIDTH_SHIFT */);\n }\n }", "changeHorizontalPosition(value, change) {\n return String.fromCharCode(value.charCodeAt(0) + change);\n }", "set rectValue(value) {}", "setCell(x, y, val) {\n if (this.isInside(x, y)) {\n this._board[y] = this._board[y].substring(0, x) +\n val + this._board[y].substring(x + 1);\n }\n }", "function updatePositionsfinal() {\n var positions = line2.geometry.attributes.position.array;\n\n var x = 6; \n var y = 2.7; \n var z = -2.5;\n var index = 0;\n\n for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {\n\n positions[ index ++ ] = x;\n positions[ index ++ ] = y;\n positions[ index ++ ] = z;\n\n x += (9/MAX_POINTS);\n y += (2.6/MAX_POINTS);\n }\n}", "function update_slider(value) {\n d3.select(\"#barcode\").select(\"line\")\n .attr(\"x1\", x(value)) // we map the slider value to the x axis\n .attr(\"x2\", x(value))\n}", "update(x, y, point) {\n\t \tlet constructor = this;\n\t\tmoveAt(x, y, point); \t\n\t\tfunction moveAt(x, y, point) {\n\t\t\tif (point == \"start\") {\n\t\t\t constructor.x1 = x;\n\t\t\t constructor.y1 = y;\n\t\t\t constructor.line.setAttribute('x1', x);\n\t\t\t constructor.line.setAttribute('y1', y);\n\t\t\t}\n\t\t\telse {\n\t\t\t constructor.x2 = x;\n\t\t\t constructor.y2 = y;\n\t\t\t\tconstructor.line.setAttribute('x2', x);\n\t\t\t constructor.line.setAttribute('y2', y);\n\t\t\t}\n\t\t}\n\t}", "function updateValueLine() {\n\t if (paused) return;\n\n\t var hoverValue = g.selectAll('.nv-hoverValue').data(index);\n\n\t var hoverEnter = hoverValue.enter()\n\t .append('g').attr('class', 'nv-hoverValue')\n\t .style('stroke-opacity', 0)\n\t .style('fill-opacity', 0);\n\n\t hoverValue.exit()\n\t .transition().duration(250)\n\t .style('stroke-opacity', 0)\n\t .style('fill-opacity', 0)\n\t .remove();\n\n\t hoverValue\n\t .attr('transform', function(d) { return 'translate(' + x(sparkline.x()(data[d],d)) + ',0)' })\n\t .transition().duration(250)\n\t .style('stroke-opacity', 1)\n\t .style('fill-opacity', 1);\n\n\t if (!index.length) return;\n\n\t hoverEnter.append('line')\n\t .attr('x1', 0)\n\t .attr('y1', -margin.top)\n\t .attr('x2', 0)\n\t .attr('y2', availableHeight);\n\n\t hoverEnter.append('text').attr('class', 'nv-xValue')\n\t .attr('x', -6)\n\t .attr('y', -margin.top)\n\t .attr('text-anchor', 'end')\n\t .attr('dy', '.9em');\n\n\t g.select('.nv-hoverValue .nv-xValue')\n\t .text(xTickFormat(sparkline.x()(data[index[0]], index[0])));\n\n\t hoverEnter.append('text').attr('class', 'nv-yValue')\n\t .attr('x', 6)\n\t .attr('y', -margin.top)\n\t .attr('text-anchor', 'start')\n\t .attr('dy', '.9em');\n\n\t g.select('.nv-hoverValue .nv-yValue')\n\t .text(yTickFormat(sparkline.y()(data[index[0]], index[0])));\n\t }", "makeValue(value) {\n this.code += `[-]`; // Set cell to zero\n this.code += `+`.repeat(value);\n }", "update(data) {\n for (let i = 0; i < this.Offsets.length; i += 2) {\n this.Offsets[i] = data[i];\n this.Offsets[i + 1] = data[i + 1];\n }\n }", "function updateOffset() {\n canvasBounding = canvas.getBoundingClientRect();\n offsetX = canvasBounding.left;\n offsetY = canvasBounding.top;\n}", "_setCellValue(cellRef, value) {\n const tabId = cellRef.get('tabId');\n const rowIdx = cellRef.get('rowIdx');\n const colIdx = cellRef.get('colIdx');\n\n if ( !this.vals.has(tabId) ) {\n this.vals = this.vals.set(tabId, new List());\n }\n if ( !this.vals.getIn([tabId, rowIdx]) ) {\n this.vals = this.vals.setIn([tabId, rowIdx], new List());\n }\n this.vals = this.vals.setIn([cellRef.get('tabId'), cellRef.get('rowIdx'), cellRef.get('colIdx')], value);\n }", "function updateCursorPosition() {\r\n var position = editor.getCursorPosition();\r\n // indicate cursor postion elements\r\n document.getElementById(\"cur-row\").innerText = position.row + 1;\r\n document.getElementById(\"cur-col\").innerText = position.column + 1;\r\n document.getElementById(\"all-lines\").innerText = editor.getSession().getLength();\r\n}", "updatePhysicalPosition(moveNextLine) {\n if (this.currentWidget && this.owner.isLayoutEnabled && this.isUpdateLocation) {\n this.location = this.selection.getPhysicalPositionInternal(this.currentWidget, this.offset, moveNextLine);\n }\n }", "update() {\n let xpos = 0, ypos = 0;\n let i;\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.ctx.strokeStyle = \"#E0E0E0\";\n for (i = 0; i < this.cols*this.rows; i++) {\n if (i % this.cols === 0 && i !== 0) {\n ypos += this.cellSize;\n xpos = 0;\n }\n if (this.engine.getCellStateFromIndex(i) === 1) {\n this.ctx.fillRect(xpos, ypos, this.cellSize, this.cellSize);\n }\n if (this.cellSize > 5) {\n this.ctx.strokeRect(xpos, ypos, this.cellSize, this.cellSize);\n }\n xpos += this.cellSize;\n }\n }", "function setCell(column, row, value) {\n var s = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = s.getSheetByName('Data');\n //sheet.appendRow([column, row, value]);\n sheet.getRange(getSheetTranslation(column)+row).setValue(value);\n}", "function HM_UpdateTooltip(x, y, value) {\n // + 15 for distance to cursor\n var translation = 'translate(' + (x + 100) + 'px, ' + (y + 100) + 'px)';\n hm_tooltip.style.webkitTransform = translation;\n hm_tooltip.innerHTML = value;\n}", "updateValue(value) {\n if (this.control) {\n this.control.control.setValue(value);\n }\n else {\n this.target.value = value;\n }\n }", "updatePosition(x, y) {\n // maze position, sprite width, grid places over\n var canvasX = this.startCanvasX + this.spriteWidth/2 + (this.spriteWidth * x);\n var canvasY = this.startCanvasY - this.spriteWidth/2 + this.mazeHeight - (this.spriteWidth * y);\n\n this.raster.position = new Point(canvasX, canvasY);\n }", "function updateLine(line, text, markedSpans, estimateHeight) {\n\t\t line.text = text;\n\t\t if (line.stateAfter) line.stateAfter = null;\n\t\t if (line.styles) line.styles = null;\n\t\t if (line.order != null) line.order = null;\n\t\t detachMarkedSpans(line);\n\t\t attachMarkedSpans(line, markedSpans);\n\t\t var estHeight = estimateHeight ? estimateHeight(line) : 1;\n\t\t if (estHeight != line.height) updateLineHeight(line, estHeight);\n\t\t }", "function updateLine(line, text, markedSpans, estimateHeight) {\n\t\t line.text = text;\n\t\t if (line.stateAfter) { line.stateAfter = null; }\n\t\t if (line.styles) { line.styles = null; }\n\t\t if (line.order != null) { line.order = null; }\n\t\t detachMarkedSpans(line);\n\t\t attachMarkedSpans(line, markedSpans);\n\t\t var estHeight = estimateHeight ? estimateHeight(line) : 1;\n\t\t if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n\t\t }", "setValue(value, step) {\r\n if (is.num(value)) {\r\n this.lastPosition = value;\r\n\r\n if (step) {\r\n value = Math.round(value / step) * step;\r\n\r\n if (this.done) {\r\n this.lastPosition = value;\r\n }\r\n }\r\n }\r\n\r\n if (this._value === value) {\r\n return false;\r\n }\r\n\r\n this._value = value;\r\n return true;\r\n }", "function assign(value) {\n return function(row, col) {\n return function(puzzle) {\n // will erase all pencil marks as well\n const changedPuzzle = modifyCell(value, row, col, puzzle);\n\n const mark = valueToMark(value);\n const removedAssignedMark = removeMarks(mark);\n\n // reduce the value out of the row, these are col indices\n const reducedRow = indices.reduce((p, cI) => {\n return removedAssignedMark(row, cI)(p);\n }, changedPuzzle);\n\n // reduce the value out of the col, these are row indices\n const reducedRowAndCol = indices.reduce((p, rI) => {\n return removedAssignedMark(rI, col)(p);\n }, reducedRow);\n\n // reduce the value out of the block\n const block = getBlockForRowCol(row, col);\n const reducedRowAndColAndBlock = getAllBlockRowCols(block).reduce((p, i) => {\n return removedAssignedMark(i[0], i[1])(p);\n }, reducedRowAndCol);\n\n return reducedRowAndColAndBlock;\n };\n };\n}", "function updateDrawingLineOfAPeer(oldLineObj, newLineObj) {\n oldLineObj.set({\n x2: (newLineObj.x1 < 0) ? newLineObj.left + newLineObj.width : newLineObj.left ,\n y2: (newLineObj.y1 < 0) ? newLineObj.top + newLineObj.height : newLineObj.top\n });\n}", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "edit(value) {\r\n if (this.disabled === 'true') {\r\n return;\r\n }\r\n this.onEditing.emit('editing click');\r\n this.preValue = value;\r\n this.editing = true;\r\n this._originalValue = value;\r\n }" ]
[ "0.7200816", "0.6309424", "0.60053426", "0.59290123", "0.5819368", "0.5707939", "0.570109", "0.567639", "0.560666", "0.55809885", "0.5569548", "0.5569548", "0.5569548", "0.5569548", "0.5569548", "0.5548626", "0.55301285", "0.5474081", "0.54643226", "0.54447085", "0.54388785", "0.5434812", "0.54161084", "0.541135", "0.5410968", "0.5397868", "0.53817165", "0.536501", "0.5354527", "0.5346209", "0.53308874", "0.53234005", "0.5310727", "0.5282615", "0.52801144", "0.52794486", "0.52748746", "0.52725273", "0.52578086", "0.52384126", "0.52306247", "0.5229883", "0.522454", "0.5223374", "0.52146846", "0.52018183", "0.52018183", "0.52018183", "0.52018183", "0.52018183", "0.52018183", "0.52015287", "0.51947165", "0.51947165", "0.51947165", "0.5192032", "0.5191786", "0.51906765", "0.5186524", "0.5174106", "0.5161632", "0.5156606", "0.5156562", "0.5153621", "0.51511276", "0.5150771", "0.51499057", "0.51409614", "0.5126941", "0.5107531", "0.5089741", "0.50824183", "0.50778574", "0.5075578", "0.50713694", "0.506546", "0.50624615", "0.5050521", "0.50368047", "0.50351137", "0.5004513", "0.50008404", "0.49975", "0.49955422", "0.49942273", "0.49916768", "0.49874887", "0.49841624", "0.49803314", "0.49803314", "0.49803314", "0.49803314", "0.49803314", "0.49803314", "0.49803314", "0.49803114" ]
0.7229543
4
Get offset. Called before the first character is eaten to retrieve the range's offsets.
function getOffset() { var indentation = []; var pos = line + 1; /* Done. Called when the last character is * eaten to retrieve the range’s offsets. */ return function () { var last = line + 1; while (pos < last) { indentation.push((offset[pos] || 0) + 1); pos++; } return indentation; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStartOffSet() {\n var selObj = window.getSelection();\n var selRange = selObj.getRangeAt(0);\n return selRange['startOffset'];\n }", "function getOffset() {\n\t\t\treturn offset;\n\t\t}", "getOffset() {\r\n return this.builder.offset;\r\n }", "offsetAt(position) {\n return (0, utils_1.offsetAt)(position, this.getText(), this.getLineOffsets());\n }", "function annot_offset(range_end){\n var lines = editor.getSession().getDocument().getLines(0, range_end.row);\n var total_off = 0;\n var num_char;\n\n for(var i = 0; i < lines.length; i++){\n num_char = lines[i].length;\n total_off += parseInt((num_char - 1) / 80, 10);\n }\n\n return total_off;\n}", "function fnGetCaretPosition(_dom) {\n if ('selectionStart' in _dom) {\n return (_dom.selectionStart);\n } else { // IE below version 9\n var _sel = document.selection.createRange();\n _sel.moveStart('character', -_dom.value.length);\n return (_sel.text.length);\n }\n }", "function getOffset(offset) {\n\t\t\t// Add all insertions before this location together to calculate\n\t\t\t// the current offset\n\t\t\tfor (var i = 0, l = insertions.length; i < l; i++) {\n\t\t\t\tvar insertion = insertions[i];\n\t\t\t\tif (insertion[0] >= offset)\n\t\t\t\t\tbreak;\n\t\t\t\toffset += insertion[1];\n\t\t\t}\n\t\t\treturn offset;\n\t\t}", "getFieldCharacterPosition(firstInline) {\n let nextValidInline = this.getNextValidElementForField(firstInline);\n //If field separator/end exists at end of paragraph, then move to next paragraph.\n if (isNullOrUndefined(nextValidInline)) {\n let nextParagraph = firstInline.line.paragraph;\n return this.getEndPosition(nextParagraph);\n }\n else {\n return this.getPhysicalPositionInline(nextValidInline, 0, true);\n }\n }", "function doGetCaretPosition(input) {\n if (document.selection) {\n input.focus ();\n var sel = document.selection.createRange();\n sel.moveStart ('character', -input.value.length);\n \n return sel.text.length;\n }\n \n if (input.selectionStart || input.selectionStart == '0') \n return input.selectionStart;\n \n return 0;\n }", "function getCaretPosition () {\r\n var selection = window.getSelection()\r\n var position = selection.anchorOffset\r\n // We move up to the parent span\r\n var sibling = selection.anchorNode.parentNode.previousSibling\r\n while (sibling !== null) {\r\n if (sibling.childNodes.length > 0) {\r\n position += sibling.childNodes[0].length\r\n }\r\n sibling = sibling.previousSibling\r\n }\r\n return position // position\r\n}", "getPageOffset() {\n return this.coord.getPageOffset();\n }", "function translator_getPosition()\n{\n var position = this.parser.getPosition();\n return position - this.offsetAdj;\n}", "function getCursorPosition() {\n var selection = window.getSelection();\n return {\n node: selection.anchorNode,\n offset: selection.anchorOffset\n };\n }", "offset() {\n return this.bb.readInt64(this.bb_pos);\n }", "get offset() { setModified.apply(this); return this._offset; }", "get caretPos() {\n return this.textSelection[0];\n }", "function getOffset() {\n\t\t\tif (!vm.current) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t//console.log(vm.getRank(vm.current));\n\t\t\treturn (vm.getRank(vm.current) - 2) * 17;\n\t\t}", "function getScanStartPosition(enclosingNode, originalRange, sourceFile) {\n var start = enclosingNode.getStart(sourceFile);\n if (start === originalRange.pos && enclosingNode.end === originalRange.end) {\n return start;\n }\n var precedingToken = ts.findPrecedingToken(originalRange.pos, sourceFile);\n if (!precedingToken) {\n // no preceding token found - start from the beginning of enclosing node\n return enclosingNode.pos;\n }\n // preceding token ends after the start of original range (i.e when originalRange.pos falls in the middle of literal)\n // start from the beginning of enclosingNode to handle the entire 'originalRange'\n if (precedingToken.end >= originalRange.pos) {\n return enclosingNode.pos;\n }\n return precedingToken.end;\n }", "function getDropCharOffset (x, y) {\n // Helper function for getting the x-y character offset of a drop\n // event in a contenteditable field.\n // Modified from http://stackoverflow.com/a/10659990.\n var range\n // Standards-based way; implemented only in Firefox\n if (document.caretPositionFromPoint) {\n var pos = document.caretPositionFromPoint(x, y)\n return {\n 'offset': pos.offset,\n 'node': pos.offsetNode\n }\n } else if (document.caretRangeFromPoint) {\n // Webkit\n range = document.caretRangeFromPoint(x, y)\n return {\n 'offset': range.startOffset,\n 'node': range.startContainer\n }\n } else if (document.body.createTextRange) {\n // IE doesn't natively support retrieving the character offset, so\n // insert image at end of text\n // TODO(jrbotros): rewrite with https://github.com/timdown/rangy\n return\n }\n }", "function getBeginningOfLineOffset(node) {\n return node.position.start.offset - node.position.start.column + 1;\n}", "function cursorIndex() {\r\n var current = selection.createRange(),\r\n diff = current.duplicate();\r\n\r\n diff.moveToElementText(this);\r\n diff.setEndPoint('EndToEnd', current);\r\n\r\n return diff.text.length - current.text.length;\r\n }", "getCursorPosition (offset = true) {\n return this.api.getCursorPosition(offset)\n }", "getOffset() {\nreturn this.offset;\n}", "function getCaretPosition(node) {\r\n\t\tvar range, preCaretRange, caretOffset,\r\n\t\t\twin = getNodeWindow(node);\r\n\r\n\t\tif(isContentEditable(node)){\r\n\t\t\trange = win.getSelection().getRangeAt(0);\r\n\t\t\tpreCaretRange = range.cloneRange();\r\n\r\n\t\t\tpreCaretRange.selectNodeContents(node);\r\n\t\t\tpreCaretRange.setEnd(range.endContainer, range.endOffset);\r\n\t\t\tcaretOffset = preCaretRange.innerText.length;\r\n\r\n\t\t\treturn caretOffset;\r\n\t\t}\r\n\t\telse return node.selectionEnd;\r\n\t}", "function doGetCaretPosition (ctrl) {\n var CaretPos = 0;\n // IE Support\n if (document.selection) {\n ctrl.focus ();\n var Sel = document.selection.createRange ();\n Sel.moveStart ('character', -ctrl.value.length);\n CaretPos = Sel.text.length;\n }\n // Firefox support\n else if (ctrl.selectionStart || ctrl.selectionStart == '0')\n CaretPos = ctrl.selectionStart;\n return (CaretPos);\n }", "positionAt(offset) {\n return (0, utils_1.positionAt)(offset, this.getText(), this.getLineOffsets());\n }", "getIndex() {\n\t\t\tconst {overrides} = this.impl;\n\t\t\tif (overrides !== undefined) {\n\t\t\t\treturn overrides.getIndex(this);\n\t\t\t}\n\n\t\t\treturn this.currentToken.start;\n\t\t}", "getCursorPosition() {\n const _pos = this.editor.selection.active;\n return new mte_kernel_1.Point(_pos.line, _pos.character);\n }", "function peek() {\n return input.charAt(pos);\n }", "function peek() {\n return input.charAt(pos);\n }", "function getEndOffSet() {\n var selObj = window.getSelection();\n var selRange = selObj.getRangeAt(0);\n return selRange['endOffset'];\n }", "getOffsetValue(selection) {\n if (this.startParagraph) {\n let lineInfo = selection.getLineInfoBasedOnParagraph(this.startParagraph, this.startOffset);\n selection.start.setPositionFromLine(lineInfo.line, lineInfo.offset);\n }\n selection.start.updatePhysicalPosition(true);\n if (selection.isEmpty) {\n selection.end.setPositionInternal(selection.start);\n }\n else {\n if (this.endParagraph) {\n let lineInfo = selection.getLineInfoBasedOnParagraph(this.endParagraph, this.endOffset);\n selection.end.setPositionFromLine(lineInfo.line, lineInfo.offset);\n }\n selection.end.updatePhysicalPosition(true);\n }\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "peek() { return this.string.charAt(this.pos) || undefined; }", "function getOffsetExcludeWS() {\n if (this.scanner.tokenIndex > 0) {\n if (this.scanner.lookupType(-1) === WhiteSpace) {\n return this.scanner.tokenIndex > 1\n ? this.scanner.getTokenStart(this.scanner.tokenIndex - 1)\n : this.scanner.firstCharOffset;\n }\n }\n\n return this.scanner.tokenStart;\n}", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "positionAt(offset) {\n const before = this.textDocument.slice(0, offset);\n const newLines = before.match(/\\n/g);\n const line = newLines ? newLines.length : 0;\n const preCharacters = before.match(/(\\n|^).*$/g);\n return new tokenizer_1.Position(line, preCharacters ? preCharacters[0].length : 0);\n }", "function getStartingPositionOfCurrentWordInDiv(editableDiv) {\r\n\tvar caretPos = getCaretPositionInDiv(editableDiv);\r\n\tvar curLetter = getCharAtPosInDiv(editableDiv, caretPos);\r\n\tvar curPos = caretPos;\r\n\r\n\tdo {\r\n\t\tcurPos = curPos-1;\r\n\t\tcurLetter\t= getCharAtPosInDiv(editableDiv, curPos);\r\n\r\n\t} while (curLetter != ' ' && curPos > 0);\r\n\treturn curPos==0 ? 0:curPos+1;\r\n}", "get textOffset() {\n return this.pos - this.path[this.path.length - 1];\n }", "get selectionStart() { return this.selectionStartIn; }", "function caretPos(el) {\n\t\tif (\"selection\" in document) {\n\t\t\tvar range = el.createTextRange();\n\t\t\ttry {\n\t\t\t\trange.setEndPoint(\"EndToStart\", document.selection.createRange());\n\t\t\t} catch (e) {\n\t\t\t\t// Catch IE failure here, return 0 like\n\t\t\t\t// other browsers\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn range.text.length;\n\t\t} else if (el.selectionStart != null) {\n\t\t\treturn el.selectionStart;\n\t\t}\n\t}", "function doGetCaretPosition(oField) {\n var iCaretPos = 0;\n if (document.selection) {\n oField.focus ();\n var oSel = document.selection.createRange();\n oSel.moveStart ('character', -oField.value.length);\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart || oField.selectionStart == '0') {\n iCaretPos = oField.selectionStart;\n }\n return (iCaretPos);\n }", "function doGetCaretPosition(oField) {\n\t\tvar iCaretPos = 0;\n\t\tif (document.selection) {\n\t\t\tif (!oField.is(':focus')) {\n\t\t\t\toField.focus();\n\t\t\t}\n\t\t\tvar oSel = document.selection.createRange();\n\t\t\toSel.moveStart('character', -oField.value.length);\n\t\t\tiCaretPos = oSel.text.length;\n\t\t} else if (oField.selectionStart || oField.selectionStart == '0') {\n\t\t\tiCaretPos = oField.selectionStart;\n\t\t}\n\t\treturn (iCaretPos);\n\t}", "function getCaretPos(el) { \n\tif (el.selectionStart) { \n\t\treturn el.selectionStart; \n\t} else if (document.selection) { \n\t\tel.focus(); \n\t\n\t\tvar r = document.selection.createRange(); \n\t\tif (r == null) { \n\t\t\treturn 0; \n\t\t} \n\t\n\t\tvar re = el.createTextRange(), \n\t\trc = re.duplicate(); \n\t\tre.moveToBookmark(r.getBookmark()); \n\t\trc.setEndPoint('EndToStart', re); \n\t\n\t\treturn rc.text.length; \n\t} \n\treturn 0;\n}", "function getCaretPos (field) {\n\n\t\tvar pos = 0;\n\n\t\t// IE\n\t\tif (document.selection) {\n\t\t\tfield.focus(); \t\t\t\t\t\t\t\t\t\t// Set focus on element\n\t\t\tvar sel = document.selection.createRange(); \t\t// Get empty selection range\n\t\t\tsel.moveStart('character', -field.value.length); \t// Move selection to 0 position\n\t\t\tpos = sel.text.length; \t\t\t\t\t\t\t\t// The caret position is selection length\n\t\t}\n\n\t\t// Firefox\n\t\telse if (field.selectionStart || field.selectionStart == '0')\n\t\t\tpos = field.selectionStart;\n\n\t\treturn pos;\n\t}", "getStartOffset(paragraph) {\n let startOffset = 0;\n if (paragraph.childWidgets.length > 0) {\n let childWidgets = paragraph.childWidgets[0];\n return this.getStartLineOffset(childWidgets);\n }\n return startOffset;\n }", "function getTextPositionOffset(parent, child, offset) {\n var range = document.createRange()\n , selection\n , contents\n\n if (!child) {\n selection = window.getSelection();\n child = selection.focusNode || parent;\n offset = selection.focusOffset || 0;\n }\n\n range.setStart(parent, 0);\n range.setEnd(child, offset);\n contents = range.cloneContents();\n\n return contents.textContent.trimLeft().length + contents.childNodes.length - 1;\n}", "get start() {\n return this.selector('TextPositionSelector').start;\n }", "get start() {\n return this.selector('TextPositionSelector').start;\n }", "function getPosition() {\n return _character.getPosition();\n }", "function getOffset(el) {\n var rect = el.getBoundingClientRect();\n return {\n left: rect.left + rect.width / 2\n };\n}", "peek() {\n return this.input.charAt(this.pos);\n }", "GetCursorStartPos()\n {\n let win = this.getCurrentWindowRead();\n return Vec2.Subtract(win.DC.CursorStartPos, win.Pos);\n }", "get begin() {\n if (this._positions.anchor < this._positions.focus) {\n return this._positions.anchor\n }\n\n return this._positions.focus\n }", "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "function getFirstVisiblePosition(el) {\r\n var firstVisibleTextChild = isTextNode(el) ? el : getFirstVisibleTextNode(el);\r\n var curDocument = findDocument(el);\r\n var range = curDocument.createRange();\r\n if (firstVisibleTextChild) {\r\n range.selectNodeContents(firstVisibleTextChild);\r\n return calculatePositionByNodeAndOffset(el, { node: firstVisibleTextChild, offset: range.startOffset });\r\n }\r\n return 0;\r\n }", "getRange(selection) {\n const range = codeChunkContainingPoint('cell', this.editor, this.getCursorPositionForSelection(selection));\n return range.translate(\n [0, 0],\n [this.isA(), 0],\n );\n }", "function computeOffset(position, data) {\n let line = position.line;\n let column = position.column + 1;\n for (let i = 0; i < data.length; i++) {\n if (line > 1) {\n /* not yet on the correct line */\n if (data[i] === \"\\n\") {\n line--;\n }\n }\n else if (column > 1) {\n /* not yet on the correct column */\n column--;\n }\n else {\n /* line/column found, return current position */\n return i;\n }\n }\n /* istanbul ignore next: should never reach this line unless espree passes bad\n * positions, no sane way to test */\n throw new Error(\"Failed to compute location offset from position\");\n}", "function getOffset(el) {\n const rect = el.getBoundingClientRect();\n return {\n left: rect.left,\n top: rect.top\n };\n }", "function getOffset(cursor, defaultOffset) {\n if (typeof cursor === 'undefined' || cursor === null) {\n return defaultOffset;\n }\n\n let offset = cursorToOffset(cursor);\n if (isNaN(offset)) {\n return defaultOffset;\n }\n\n return offset;\n}", "function getchar(position){\n return $(position).text();\n}", "getUntilChar(char) {\n const currIndex = this.index;\n var finalIndex = currIndex;\n while (this.currentChar != char && this.index < this.length) {\n this.consume();\n finalIndex = this.index;\n }\n return this.string.substring(currIndex, finalIndex);\n }", "getPreviousValidOffset(paragraph, offset) {\n if (offset === 0) {\n return 0;\n }\n let validOffset = 0;\n let count = 0;\n let value = 0;\n let bidi = paragraph.paragraphFormat.bidi;\n for (let i = 0; i < paragraph.childWidgets.length; i++) {\n let lineWidget = paragraph.childWidgets[i];\n if (!bidi) {\n for (let j = 0; j < lineWidget.children.length; j++) {\n let inline = lineWidget.children[j];\n if (inline.length === 0) {\n continue;\n }\n if (offset <= count + inline.length) {\n return offset - 1 === count ? validOffset : offset - 1;\n }\n if (inline instanceof TextElementBox || inline instanceof ImageElementBox\n || (inline instanceof FieldElementBox && HelperMethods.isLinkedFieldCharacter(inline))) {\n validOffset = count + inline.length;\n }\n count += inline.length;\n }\n }\n else {\n value = lineWidget.getInlineForOffset(offset, false, undefined, false, true, false).index;\n if (value >= 0) {\n return value;\n }\n }\n }\n return offset - 1 === count ? validOffset : offset - 1;\n }", "function getCaret(el) { \n if (el.selectionStart) { \n return el.selectionStart; \n } else if (document.selection) { \n el.focus(); \n\n var r = document.selection.createRange(); \n if (r === null) { \n return 0; \n } \n\n var re = el.createTextRange(), \n rc = re.duplicate(); \n re.moveToBookmark(r.getBookmark()); \n rc.setEndPoint('EndToStart', re); \n\n return rc.text.length; \n } \n return 0; \n}", "function GetCaretStart(obj)\n{\n\tif(typeof obj.selectionStart != \"undefined\")\n\t{\n\t\treturn obj.selectionStart;\n\t}\n\telse if(document.selection&&document.selection.createRange)\n\t{\n\t\tvar M=document.selection.createRange();\n\t\ttry\n\t\t{\n\t\t\tvar Lp = M.duplicate();\n\t\t\tLp.moveToElementText(obj);\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\tvar Lp = obj.createTextRange();\n\t\t}\n\t\tLp.setEndPoint(\"EndToStart\",M);\n\t\tvar rb = Lp.text.length;\n\t\tif(rb > obj.value.length)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\treturn rb;\n\t}\n}", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }" ]
[ "0.68127346", "0.6555926", "0.63602346", "0.62810284", "0.6277667", "0.62405443", "0.62127423", "0.6079076", "0.6078199", "0.6076148", "0.60605866", "0.60522854", "0.60417366", "0.60320246", "0.6025202", "0.60207105", "0.6010249", "0.60081047", "0.6007811", "0.59976846", "0.5997052", "0.5992683", "0.5983089", "0.595118", "0.5940306", "0.59147346", "0.59070593", "0.58964777", "0.5888353", "0.5888353", "0.5836988", "0.5821638", "0.5801252", "0.5801252", "0.5801252", "0.5801252", "0.5801252", "0.5801252", "0.5801252", "0.5801252", "0.5801252", "0.5801252", "0.5801252", "0.5801252", "0.5801252", "0.5801252", "0.5794128", "0.5791345", "0.5790869", "0.57861394", "0.5776612", "0.57750756", "0.5773152", "0.57726", "0.57700455", "0.57628864", "0.5758103", "0.5757896", "0.5752825", "0.57476324", "0.5732737", "0.5732737", "0.57206", "0.57161206", "0.5706829", "0.5699288", "0.56975365", "0.56743693", "0.5667715", "0.5664623", "0.56600684", "0.5625419", "0.56193674", "0.5615158", "0.56096125", "0.5609156", "0.56081504", "0.56065196", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666", "0.56047666" ]
0.76455736
4
Get the current position.
function now() { var pos = {line: line, column: column}; pos.offset = self.toOffset(pos); return pos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentPosition() {\n return $._getCurrentPosition();\n}", "function getPos() {\n\t\treturn _this.position;\n\t}", "function getPosition() {\n return _character.getPosition();\n }", "async getPosition() {\n return this._position;\n }", "getPosition() {\n return this._lastPosition;\n }", "get_position() {\n return this.liveFunc._position;\n }", "getPosition() {\n\t\t\tconst {overrides} = this.impl;\n\t\t\tif (overrides !== undefined) {\n\t\t\t\treturn overrides.getPosition(this);\n\t\t\t}\n\n\t\t\tconst index = this.getIndex();\n\t\t\tconst cached = this.indexTracker.cachedPositions.get(index.valueOf());\n\t\t\tif (cached !== undefined) {\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tconst pos = {\n\t\t\t\tline: this.currLine,\n\t\t\t\tcolumn: this.currColumn,\n\t\t\t};\n\t\t\tthis.indexTracker.setPositionIndex(pos, index);\n\t\t\treturn pos;\n\t\t}", "function getCurrentPosition()\n\t\t{\n\t\t\tlet currentTransformValues = getCurrentGroupTransformValues(),\n\t\t\t\tviewBoxCoordinates = { x: currentTransformValues.translateX, y: currentTransformValues.translateY },\n\t\t\t\tworldCoordinates = { x: viewBoxCoordinates.x / ViewBoxScaleFactor, y: viewBoxCoordinates.y / ViewBoxScaleFactor },\n\t\t\t\tcurrentPosition =\n\t\t\t\t\t{\n\t\t\t\t\t\tviewBoxCoordinates: viewBoxCoordinates,\n\t\t\t\t\t\tworldCoordinates: worldCoordinates,\n\t\t\t\t\t\tflip: (currentTransformValues.scaleX < 0) ? -1 : 1,\n\t\t\t\t\t\tangle: currentTransformValues.rotateAngle\n\t\t\t\t\t};\n\t\t\treturn currentPosition;\n\t\t} // end getCurrentPosition()", "get position() {\n\t\t\treturn {x: this.x, y: this.y};\n\t\t}", "get position() {\n\t\treturn this.state.sourcePosition;\n\t}", "get position() {\n\t\treturn this._position.object;\n\t}", "get position() {\n return this._position;\n }", "currentPointerPosition(e) {\n const [x, y] = Mouse.rel(e);\n return this.positionToSequence({\n xPos: x,\n yPos: y,\n });\n }", "getCursorPosition() {\n const _pos = this.editor.selection.active;\n return new mte_kernel_1.Point(_pos.line, _pos.character);\n }", "get position() {\n if (!position ||\n (Date.now() - position.timestamp > positionTTL)) {\n\n updatePosition();\n }\n\n return position;\n }", "get position() { return this._position; }", "get position() { return this._position; }", "get current() {\n return this.strand.at(this.cursor);\n }", "getPos() {\n return this.positions;\n }", "function getPosition() {\n let position = document.getElementById(getyx(y,x));\n\treturn position;\n}", "pos() {\n if (this.is_vertex()) {\n return this.position;\n } else {\n return this.offset;\n }\n }", "get currentAbsoluteOffset() {\n return this.absoluteOffset + this.inputIndex;\n }", "get currentAbsoluteOffset() {\n return this.absoluteOffset + this.inputIndex;\n }", "function translator_getPosition()\n{\n var position = this.parser.getPosition();\n return position - this.offsetAdj;\n}", "position() {\n return VrMath.getTranslation(this.headMatrix);\n }", "getCurrentScrollPosition() {\n return this._state;\n }", "get position() {\n return {x: this.x, y: this.y}\n }", "function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }", "function processCurrentposition(data) {\n var pos = parseInt(data);\n setPosition(pos);\n}", "function pos() {\n return RTG_VCF_RECORD.getOneBasedStart();\n }", "getCurrent() \r\n\t{\r\n\t\treturn this.current;\r\n\t}", "getLocation() {\n return this.position;\n }", "get position() {\n return {\n x: this.x,\n y: this.y\n };\n }", "addr() {\n return this.pos;\n }", "addr() {\n return this.pos;\n }", "function getcurentposition() {\n\tnavigator.geolocation.getCurrentPosition(GeoOnSuccess, GeoOnError, {enableHighAccuracy: true});\n}", "getNewPos(){\n return this.newPos;\n }", "getCursorPos(){\n let posVector = {\n \"x\":this.activePointer.x,\n \"y\":this.activePointer.y\n }\n return posVector;\n }", "presentPosition() {\n\t\treturn this.positionContainer.length > 0 ? this.positionContainer[this.positionContainer.length - 1] : null;\n\t}", "getPlayerPosition() {\n return this.player.position;\n }", "get position() {\n const now = this.now();\n const ticks = this._clock.getTicksAtTime(now);\n return new TicksClass(this.context, ticks).toBarsBeatsSixteenths();\n }", "function geoGetCurrentPos() {\n return new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition((position) => {\n resolve(position);\n }, () => {\n reject(new Error('Unable to fetch location.'));\n });\n });\n }", "function _getCurrent(){\n return current || null;\n }", "function TimelinePosCur() {\n var pos = null;\n for (var i = 0, len = tw.timeline.length; i < len; i++) {\n if (tw.timeline[i].time > tw.tCur) {\n pos = i - 1;\n break;\n }\n }\n // Case: no any value when get value-end in Timeline array[]\n if (pos === null)\n pos = tw.timeline.length - 1;\n // Store position of Animation\n tw.timePosCur = pos;\n }", "function currentPos(ele, mode, direction) {\n var pos = 0;\n direction || (direction = \"left\");\n if ([\"left\", \"top\"].indexOf(direction) === -1) return 0;\n if (mode === \"transition\" && ele.style.transform) {\n pos = ele.style.transform.match(/\\((-?\\d+)px\\)/i);\n return (pos && pos.length >= 2) ? parseInt(pos[1]) : 0;\n }\n if (mode === \"step\") {\n return parseInt(ele.style[direction] === \"\" ? 0 : ele.style[direction]);\n }\n return 0;\n }", "_current() {\n return this._history[this.index];\n }", "get cursorX() {\n\t\treturn this._cursorPos[0];\n\t}", "get_position() {\r\n return {\r\n x_pos: this.sprite.x_pos,\r\n y_pos: this.sprite.y_pos\r\n };\r\n }", "function pos() {\r\n var p = _pfa(arguments);\r\n\r\n if (p) {\r\n self.moveTo(p.x, p.y);\r\n }\r\n\r\n return new Pos(ie ? self.screenLeft : self.screenX,\r\n ie ? self.screenTop : self.screenY);\r\n}", "function _calcCurrentPos() {\n\t\t\treturn _settings.wrapper ? Math.ceil( _settings.wrapper.scrollTop() ) : Math.ceil( $( window ).scrollTop() );\n\t\t}", "get targetPosition() {}", "_positionToCurrent(position) {\n const { start, end } = this._moving;\n const { step, min, max, rtl } = this.props;\n\n if (position < start) {\n position = start;\n } else if (position > end) {\n position = end;\n }\n let percent = getPercent(start, end, position);\n percent = rtl ? 100 - percent : percent;\n // reset by step\n const newValue = parseFloat(\n (Math.round(((percent / 100) * (max - min)) / step) * step).toFixed(getPrecision(step))\n );\n const currentValue = (min + newValue).toFixed(getPrecision(step));\n\n return Number(currentValue);\n }", "function _pos() {\r\n var p = _pfa(arguments);\r\n if (p) {\r\n this.p = absPos(this, p);\r\n }\r\n return objCss(this, \"position\") == \"absolute\" ? this.p : absPos(this);\r\n}", "getCursorPosition() {\n return this.cursorPosition;\n }", "position() {\n return this._positionBuilder;\n }", "get startingPositionInput() {\n return this._startingPosition;\n }", "function currentCoord() {\n\treturn game_data.village.coord;\n}", "function getInitialPos() {\n\n if(!fixed) {\n initialPos = $elem.position();\n }\n\n return initialPos;\n\n }", "GetCursorStartPos()\n {\n let win = this.getCurrentWindowRead();\n return Vec2.Subtract(win.DC.CursorStartPos, win.Pos);\n }", "get pos()\n\t{\n\t\treturn new NodeGraph.Position(this.x, this.y);\n\t}", "setLastPos() {\n this.previousPos = this.getCurrentPosition();\n }", "function Position_GetPosition(html)\n{\n\t//done!\n\treturn new Position_Rect(Browser_GetLeft(html), Browser_GetTop(html), Browser_GetOffsetWidth(html), Browser_GetOffsetHeight(html));\n}", "function getPosition() {\n return n.attr(\"T\")\n }", "function getPosition(position) {\n\t\treturn board[position];\n\t}", "GetCursorPos()\n {\n let win = this.getCurrentWindowRead();\n return new Vec2(win.DC.CursorPos.x - win.Pos.x + win.Scroll.x,\n win.DC.CursorPos.y - win.Pos.y + win.Scroll.y);\n }", "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}", "get position() {\n return this._boundingBox.topLeft.rotate(this.rotation, this.pivot);\n }", "function pos_actuelle()\n {\n\treturn (joueurs[joueur_actuel].position);\n }", "function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }", "getCurrent() {\n return this.entries[this.currentIndex];\n }", "getCurrent() {\n return this.entries[this.currentIndex];\n }", "function getUserPos()\r\n{\r\n\treturn userPos;\r\n}", "get position()\n\t{\n\t\texchWebService.commonAbFunctions.logInfo(\"exchangeAbFolderDirectory: get position\\n\");\n\t\treturn 2;\n\t}", "function getCurrentIndex() {\n\t\treturn currentIndex;\n\t}", "get position() {\n return this.chunkPosition + this.i;\n }", "function currentYPosition() {\n // Firefox, Chrome, Opera, Safari\n if (self.pageYOffset) {\n return self.pageYOffset;\n }\n // Internet Explorer 6 - standards mode\n if (document.documentElement && document.documentElement.scrollTop) {\n return document.documentElement.scrollTop;\n }\n // Internet Explorer 6, 7 and 8\n if (document.body.scrollTop) {\n return document.body.scrollTop;\n }\n return 0;\n}", "function getCurPos() {\n let xPos = event.offsetX;\n let yPos = event.offsetY;\n //for each selected==true ? card chang its position : nothing\n player.cards.onHand.forEach(element => {\n if (element.selected) {\n element.speaking = false;\n let distanceX = element.width / 2;\n let distanceY = element.height / 2;\n element.x = xPos - distanceX;\n element.y = yPos - distanceY;\n }\n });\n}", "get cursorPrevX() {\n\t\treturn this._cursorPrevPos[0];\n\t}", "getPos() {\n return {\n x : this.getX(),\n y : this.getY(),\n deg : this.getDeg(),\n scale : this.getScale(),\n turnover : this.getTurnover(),\n }\n }", "get left(): number {\n return this.position.x\n }", "get begin() {\n if (this._positions.anchor < this._positions.focus) {\n return this._positions.anchor\n }\n\n return this._positions.focus\n }", "get left() {\n // origin is at top left so just return x\n return this.x\n }", "function getPos_x(){\n return x;\n}", "getInitialPosition(){\n return new Position(this.width/2, this.height - 6);\n }", "function getPosition() {\n\n\t//change time box to show updated message\n\t$('#time').val(\"Getting data...\");\n\n\t//instruct location service to get position with appropriate callbacks\n\tnavigator.geolocation.getCurrentPosition(successPosition, failPosition);\n}", "function getPosition(elem) {\n if (!elem.offsetParent) {\n return null;\n }\n var rect = elem.getBoundingClientRect();\n return {\n left: rect.left, \n top: rect.top\n };\n }", "function getCursorPosition() {\n var selection = window.getSelection();\n return {\n node: selection.anchorNode,\n offset: selection.anchorOffset\n };\n }", "function damePosicion () {\n return miMarcador[0].getPosition()\n }", "function getTimePosition() {\n mopidy.playback.getTimePosition()\n .then(processCurrentTimePosition, consoleError);\n}", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function getPlayerLocation() {\n\t\tTitanium.Geolocation.getCurrentPosition( updatePlayerPosition );\n\t}", "get xPosition() { return this._xPosition; }" ]
[ "0.8059421", "0.7960642", "0.788338", "0.7707294", "0.75241387", "0.7512489", "0.7508141", "0.73519945", "0.7219399", "0.7159119", "0.7157245", "0.7149591", "0.71272236", "0.70371795", "0.70171124", "0.7005105", "0.7005105", "0.7004674", "0.6965421", "0.6886338", "0.6807483", "0.68041927", "0.68041927", "0.678062", "0.6779578", "0.6723054", "0.6702111", "0.668678", "0.6668834", "0.66275185", "0.6624051", "0.66020375", "0.65974784", "0.6585126", "0.6585126", "0.65829223", "0.65777636", "0.65709406", "0.65701437", "0.65684783", "0.65321255", "0.65266854", "0.65210825", "0.65085834", "0.64948344", "0.6490388", "0.6478958", "0.6471457", "0.6465249", "0.6456651", "0.6451986", "0.6445536", "0.64434344", "0.6440019", "0.64332324", "0.64321446", "0.64197206", "0.6416148", "0.6406501", "0.6389355", "0.6387651", "0.6382818", "0.63722295", "0.6370634", "0.63686043", "0.6327088", "0.6322699", "0.6308519", "0.6306937", "0.62995", "0.62995", "0.62991655", "0.6294919", "0.62881595", "0.6285495", "0.627974", "0.62796223", "0.6279397", "0.6274087", "0.6264246", "0.6252497", "0.6245192", "0.62410825", "0.62299013", "0.62237597", "0.6216041", "0.6214639", "0.62118566", "0.6211515", "0.6205362", "0.6205362", "0.6205362", "0.6205362", "0.6205362", "0.6202819", "0.62003267" ]
0.668909
30
Store position information for a node.
function Position(start) { this.start = start; this.end = now(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setNodePosition(Pos, node) {\n let currrentNode = this.nodes.find(n => n === node);\n currrentNode.x = Pos.x;\n currrentNode.y = Pos.y;\n }", "savePosition() {\n this.savedX = this.x;\n this.savedY = this.y;\n }", "function savePositions () {\n var updateTheseNodes = {};\n\n // store indices for all fixed nodes\n for (var key in data) {\n updateTheseNodes[key] = {\n 'fixedNodes': {},\n 'unfixedNodes': {}\n };\n if (data.hasOwnProperty(key)) {\n d3.select(\"#vis\" + key).selectAll(\".node\").each(function(d, i) {\n // we need to name the nodes so we can identify them on the server; indices don't suffice\n if(d.fixed) updateTheseNodes[key].fixedNodes[\"n\" + i] = {\"x\": d.x, \"y\": d.y};\n else updateTheseNodes[key].unfixedNodes[\"n\" + i] = true;\n });\n }\n }\n\n // send fixed node indices to the server to save\n $.ajax({\n url: \"/assignments/updatePositions/\"+assignmentNumber,\n type: \"post\",\n data: updateTheseNodes\n }).done(function(status) {\n if(status == 'OK'){\n alertMessage(\"Node positions saved!\", \"success\");\n } else {\n alertMessage(\"Unsuccessful. Try logging in!\", \"danger\");\n }\n });\n}", "function node_position(node){\n params = {\n x: node.getX() - node.getOffsetX(),\n y: node.getY() - node.getOffsetY(),\n width: node.getWidth() * node.getScaleX(),\n height: node.getHeight() * node.getScaleY()\n };\n\n return params;\n}", "get pos()\n\t{\n\t\treturn new NodeGraph.Position(this.x, this.y);\n\t}", "saveNodesPositions() {\n if (this.visualization && this.visualization.getNodesPositions) {\n const nodes = this.visualization.getNodesPositions();\n this.props.actions.setVisualizationNodesPosition(this.props.visualizationKey, nodes);\n }\n }", "assignPosition(node, position) {\n\t\tif(node.parentNode && position<node.parentNode.position){\n\t\t\tposition = node.parentNode.position;\n\t\t}\n\t\twhile(this.positionMap.get(`${node.level},${position}`)){\n\t\t\tposition++;\n\t\t}\n\t\tnode.position = position;\n\t\tthis.positionMap.set(`${node.level},${position}`, true);\n\t\tfor(var i in node.children){\n\t\t\tthis.assignPosition(node.children[i], position+Number(i));\n\t\t}\n\t}", "function savePosition()\r\n{\r\n\tvar pos = getPosition();\r\n\tMZ_setValue(numTroll+\".position.X\",pos[0]);\r\n\tMZ_setValue(numTroll+\".position.Y\",pos[1]);\r\n\tMZ_setValue(numTroll+\".position.N\",pos[2]);\r\n}", "assignPosition(node, position) {\n // update the position of the node\n node.position = position;\n \n // the base case\n if (node.children.length === 0)\n {\n leafNodeCounter = leafNodeCounter + 1;\n return node;\n }\n // recursive case\n else\n {\n leafNodeCounter = 0;\n for (var d = 0; d < node.children.length; d++)\n {\n // this is a really bad hack and there is definitely something better out there. \n // However, it gets the job done\n if (node.children[d].name === \"Protosomes\")\n {\n leafNodeCounter = leafNodeCounter + 2;\n }\n\n this.assignPosition(node.children[d], node.position + leafNodeCounter);\n }\n }\n\n }", "function savePosition() {\n\t\tvar xhr = new XMLHttpRequest();\n\n\t\txhr.onreadystatechange = function() {\n\t\t\t// We stored the position, we'll store it again\n\t\t\tif (xhr.readyState == 4 && xhr.status == 200)\n\t\t\t\tsetTimeout(savePosition, SAVE_INTERVAL);\n\t\t};\n\n\t\txhr.open('POST', 'save-position.php', true);\n\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\txhr.send('data=' + JSON.stringify(calcPos()));\n\t}", "function writePosition(x,y){\n //first refer to the point and set the value\n database.ref('ball/position').set({\n 'x':position.x+x,\n 'y':position.y+y\n })\n}", "function storeNode(node) {\n // add reference between entity id and node\n if (node.elt.get('info')) {\n var entity = node.elt.get('info').entity;\n if (entity !== undefined) {\n if (nodes_by_entity_ids[entity] === undefined) {\n nodes_by_entity_ids[entity] = [node];\n } else {\n nodes_by_entity_ids[entity].push(node);\n }\n }\n }\n }", "handlePosition(node) {\n return 'middle top'; // sets the position of the handle in the format of \"X-AXIS Y-AXIS\" such as \"left top\", \"middle top\"\n }", "function savePosition(position) {\n // Update location copy text\n locBody.text = position.coords.latitude.toFixed(3) + \" , \" + position.coords.longitude.toFixed(3);\n // Log coordinates to console\n console.log(\n \"Latitude: \" + position.coords.latitude,\n \"Longitude: \" + position.coords.longitude\n );\n // Reset distance label copy text\n distBody.text = \"--\";\n // Update saved position variable\n savedPosition = position; // This belongs in the model.\n}", "updatePosition(position) {\n this.position = position;\n localStorage.setItem(\"position\", position);\n }", "function patch(node) {\n if (!node.position) {\n node.position = {}\n }\n}", "function writePosition(x,y){\n //set will set new values to the x and yinside the data base\n //position.x=recent position of the ball from the data base and x=new position of hypnotic ball on the canvas(when moved with w,a,s,d keys)\n database.ref('ball/position').set({\n 'x':position.x+x,\n 'y':position.y+y\n })\n\n}", "newPosition(position) {\n this.position = position;\n }", "function insertPositions() {\n $.each(rankingData, function(index, value) {\n rankingData[index].position = index + 1;\n });\n }", "get position() { return this._position; }", "get position() { return this._position; }", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\n }", "get position() {\n\t\t\treturn {x: this.x, y: this.y};\n\t\t}", "storeNode(node, id) {\n node._index_ = id;\n this.nodes.set(id, node);\n }", "set position (newPosition) {\n this.emit('position', newPosition)\n this._position = newPosition * this.ticksPerSongPosition\n }", "get position() {\n return this._position;\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n this.updateMatrixWorld();\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n }", "function writePosition(x,y){\n //updating the x and y position in the database\n database.ref(\"ball/position\").set({\n 'x': position.x + x, \n 'y': position.y + y\n })\n\n\n}", "function recordPosition(position) {\n var latitude = position.coords.latitude;\n var longitude = position.coords.longitude;\n\n Session.set('lat', latitude);\n Session.set('long', longitude);\n var savedlated = Session.get('lat');\n var savedlonged = Session.get('long');\n console.log(savedlated+ \",\" + savedlonged);\n console.log(latitude + \",\" + longitude);\n}", "function coordinates(){\n $('.info-top').html(posY);\n $('.info-left').html(posX);\n }", "function getPosition() {\n return n.attr(\"T\")\n }", "function processCurrentposition(data) {\n var pos = parseInt(data);\n setPosition(pos);\n}", "function positionTokenAtNode(token, node) {\n // these details depend on the node template\n token.location = node.position.copy().offset(4 + 6, 5 + 6);\n }", "function PositionData() {\r\n this.TerritoryType = ExtraTools.eTerritoryType.None;\r\n this.X = 0;\r\n this.Y = 0;\r\n this.Distribution = ExtraTools.eTerritoryDistribution.None;\r\n this.OasisBonus = ExtraTools.eOasisBonus.None;\r\n this.PlayerID = 0;\r\n this.PlayerName = null;\r\n this.AllyID = 0;\r\n this.AllyName = null;\r\n this.VillageName = null;\r\n this.VillagePoints = 0;\r\n this.Tribe = ExtraTools.eTribe.None;\r\n this.LastRaidDate = null;\r\n this.LastRaidHours = null;\r\n this.LastRaidResources = null;\r\n this.LastRaidMaxResources = null;\r\n}", "addPosition(pos) {\n this.positions += '=\"'+pos.line + ':' + pos.linePosition + '\",';\n }", "set pos(newPos) {\n this._pos = newPos;\n }", "function storePosition(position) {\n console.log(\"Latitude: \" + position.coords.latitude + \" Longitude: \" + position.coords.longitude);\n \n localStorage.setItem('airport', 'ATL');\n localStorage.setItem('map', 'C');\n localStorage.setItem('destination', 'C33');\n localStorage.setItem('userLat', position.coords.latitude);\n localStorage.setItem('userLon', position.coords.longitude);\n\n console.log(localStorage.getItem('airport'));\n console.log(localStorage.getItem('map'));\n console.log(localStorage.getItem('destination'));\n console.log(localStorage.getItem('userLat'));\n console.log(localStorage.getItem('userLon'));\n}", "SetNewPositionToANode(registeredPos) {\n this.setNodePosition(registeredPos.newValue, registeredPos.element);\n }", "savePosition(position) {\n const lat = position.coords.latitude\n const long = position.coords.longitude\n \n localStorage.setItem('lat', lat)\n localStorage.setItem('long', long)\n }", "function update_coords(index, position = null) {\n var history = document.getElementById(\"history\");\n var entry = history.rows[history.rows.length - 1];\n var coords = entry.insertCell(index);\n if (position) {\n coords.appendChild(document.createTextNode(pos_repr(position)));\n update_storage();\n }\n else {\n coords.appendChild(document.createTextNode(\"Locating...\"));\n navigator.geolocation.getCurrentPosition(function(position) {\n var coords_text = document.createTextNode(pos_repr(position));\n coords.removeChild(coords.childNodes[0]);\n coords.appendChild(coords_text);\n update_storage();\n }, function() {\n var coords_text = document.createTextNode(\"No geo data\");\n coords.removeChild(coords.childNodes[0]);\n coords.appendChild(coords_text);\n update_storage();\n });\n }\n\n}", "nodePosition() {\n if (this.tempPos.next == null) {\n return -1; // last pos\n } else if (this.tempPos.prev == null) {\n return 1; // first pos\n } else {\n return 0; // middle pos\n }\n }", "function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }", "function get_node_map_position(node, map)\n{\n\tvar coor = new L.LatLng(node.Latitude, node.Longitude);\n\t\n\treturn \"translate(\"+ \n\t\tmap.latLngToLayerPoint(coor).x +\",\"+ \n\t\tmap.latLngToLayerPoint(coor).y +\")\";\n}", "function get_node_map_position(node, map)\n{\n\tvar coor = new L.LatLng(node.Latitude, node.Longitude);\n\t\n\treturn \"translate(\"+ \n\t\tmap.latLngToLayerPoint(coor).x +\",\"+ \n\t\tmap.latLngToLayerPoint(coor).y +\")\";\n}", "position (data) {\n\t\tthrow interfaceError('position')\n\t}", "function saveDiagramProperties() {\n myDiagram.model.modelData.position = go.Point.stringify(myDiagram.position);\n}", "updatePosition() {\n this.position = Utils.convertToEntityPosition(this.bmp);\n }", "setUserPosition(state, json) {\n state.lex.sessionAttributes.userPosition = json;\n state.lex.sessionAttributes.latitude = json.latitude;\n state.lex.sessionAttributes.longitude = json.longitude;\n }", "function storeposition() {\n if (calc < points) {\n numx.push(x);\n numy.push(y);\n calc += 1;\n } else {\n numx.splice(0, 1);\n numy.splice(0, 1);\n calc -= 1;\n }\n}", "function position(pos) {\n log.innerHTML = pos\n }", "function Legato_Structure_Position( top, right, bottom, left )\r\n{\r\n\r\n\t// Store the passed in parameters.\r\n\tthis.top = top;\r\n\tthis.right = right;\r\n\tthis.bottom = bottom;\r\n\tthis.left = left;\r\n\r\n}", "setPosition(x, y) {\n this.pos.x = x;\n this.pos.y = y;\n }", "function updateNodePositions() {\n // set node positions\n rect.attr('transform', function (d) {\n return 'translate(' + d.x + ',' + d.y + ')';\n });\n}", "function Position() {\n this.x = 0;\n this.y = 0;\n}", "function setNodesPosition(nodes) {\n var deferred = $.Deferred();\n if ( nodes.length == 0 ) { deferred.resolve(); return deferred.promise(); }\n var lab_filename = $('#lab-viewport').attr('data-path');\n var form_data = [];\n form_data=nodes;\n var url = '/api/labs' + lab_filename + '/nodes' ;\n var type = 'PUT';\n $.ajax({\n cache: false,\n timeout: TIMEOUT,\n type: type,\n url: encodeURI(url),\n dataType: 'json',\n data: JSON.stringify(form_data),\n success: function (data) {\n if (data['status'] == 'success') {\n logger(1, 'DEBUG: node position updated.');\n deferred.resolve();\n } else {\n // Application error\n logger(1, 'DEBUG: application error (' + data['status'] + ') on ' + type + ' ' + url + ' (' + data['message'] + ').');\n deferred.reject(data['message']);\n }\n },\n error: function (data) {\n // Server error\n var message = getJsonMessage(data['responseText']);\n logger(1, 'DEBUG: server error (' + data['status'] + ') on ' + type + ' ' + url + '.');\n logger(1, 'DEBUG: ' + message);\n deferred.reject(message);\n }\n });\n return deferred.promise();\n}", "function getPos() {\n\t\treturn _this.position;\n\t}", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function setPosition(e) {\n pos.x = e.clientX;\n pos.y = e.clientY;\n}", "function setPosition(e) {\n pos.x = e.clientX;\n pos.y = e.clientY;\n}", "function setPosition(e) {\n pos.x = e.clientX;\n pos.y = e.clientY;\n}", "function onDragMove() {\n if (this.dragging) {\n let newPosition = this.data.getLocalPosition(this.parent);\n this.x = newPosition.x;\n this.y = newPosition.y;\n }\n}", "function setPosition(e) {\r\n pos.x = e.clientX;\r\n pos.y = e.clientY;\r\n}", "updatePos(token, tObj) {\n tObj.xPos = token.get('left');\n tObj.yPos = token.get('top');\n }", "FetchNodeIndex(position)\n {\n return position.x + (position.y * grid.resolution);\n }", "get position() {\n return {x: this.x, y: this.y}\n }", "updatePosition(position) \n {\n this.position = position;\n }", "function updatePosition() {\r\n\t\t\tcircle.attr('transform', `translate(${point.x * graph.cell_size + graph.offset.x} ${point.y * graph.cell_size + graph.offset.y})`);\r\n\t\t}", "function point(node) {\n var point = (node && node.position && node.position[type]) || {}\n\n return {\n line: point.line || null,\n column: point.column || null,\n offset: isNaN(point.offset) ? null : point.offset\n }\n }", "set position(value) {\n this.position$.next(value);\n }", "setPosition(x, y) {\n this.x = x\n this.y = y\n }", "function PersistInNode(n) {\n RED.nodes.createNode(this, n);\n var node = this;\n\n node.name = n.name;\n node.storageNode = RED.nodes.getNode(n.storageNode);\n\n node.on(\"input\", function (msg) {\n node.storageNode.store(node.name, msg);\n });\n }", "function Position (x, y) {\n this.x = x;\n this.y = y;\n this.position = this;\n}", "function setPosition(position) {\n\tglobalPos.latitude = position.coords.latitude;\n\tglobalPos.longitude = position.coords.longitude;\n\t\n\tconsole.log(\"globalLat: \" + globalPos.latitude + \", globalLong: \" + globalPos.longitude);\n\tcheckSound();\n\tprintPosition(position);\n\t\n}", "get position() {\n\t\treturn this._position.object;\n\t}", "function readPosition(data) {\r\n height = data.val();\r\n balloon.x = height.x;\r\n balloon.y = height.y;\r\n}", "function Position(table) {\n\n this.time = new Date(table[0]);\n this.tag_id = table[1];\n this.x = parseFloat(table[2]);\n this.y = parseFloat(table[3]);\n\n}", "function setNode(pos, dist){\n\tif(nodeArray[pos] != start){\n\t\tnodeArray[pos].addDis('&#8734');\n\t}\n\n\tif(pos < nodeArray.length - 1){\n\t\tsetTimeout(function(){setNode(++pos, dist);}, 50);\n\t\t// setTimeout(function(){alert(pos);}, 1000);\n\t}\n\n\tif (pos == nodeArray.length - 1) {\n\t\tdijkstraHelp(null, q, [], dist);\n\t};\n}", "function set_player_loc(x, y) {\n player['x'] = x;\n player['newx'] = x;\n player['y'] = y;\n player['newy'] = y\n}", "function Position(x,y){\n this.x = x;\n this.y = y;\n}", "function Position(x,y){\n this.x = x;\n this.y = y;\n}", "function setpos (object, x, y) {\n object.setAttribute('x', x + '');\n object.setAttribute('y', y + '');\n}", "function generatePositionData(){\n\t\n\tvar message = new Object();\n message.sessionName = sessionName;\n message.longitude = longitude = (Math.random()/1000)+25.4559615;\n message.latitude = latitude = (Math.random()/1000)+65.0564222;\n message.state = connection;\n \n if(connection === \"Online\" && synchronizing === false)\n \tsendPosition(message);\n else if(connection === \"Offline\")\n \tsaveLocally(message);\n \t\n showCoordinates();\n}", "setPosition(x, y) {\n this.x = x;\n this.y = y;\n }", "function Position (x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "function positionNode(node,col,row) {\n // Could cache this info - all nodes are the same size (I assert...)\n var bbox = node.getBBox();\n // Sizes used here relate to node sizes in render-service and the default grid size (40)\n var offsetx = 40;//bbox.width/2;\n var offsety = 40;//bbox.height/2;\n var hspace = 120+80;//bbox.width*1.5; \n var vspace = 40*2;//bbox.height*2; \n node.translate((offsetx+col*hspace)-bbox.x,(offsety+row*vspace)-bbox.y);\n var outgoingLinks = getOutgoingLinks(node,OUTPUT_PORT);\n var target, targetId;\n if (outgoingLinks.length !== 0) {\n targetId = outgoingLinks[0].get('target').id;\n target = graph.getCell(targetId);\n row = positionNode(target,col+1,row);\n }\n // As we 'unwind' visit tap streams\n var outgoingTapLinks = getOutgoingLinks(node,TAP_PORT);\n for (var i=0;i<outgoingTapLinks.length;i++) {\n row++;\n var link = outgoingTapLinks[i];\n targetId = link.get('target').id;\n target = graph.getCell(targetId);\n row = positionNode(target,col+1,row);\n }\n return row;\n }", "get position() {\n return {\n x: this.x,\n y: this.y\n };\n }", "function setNodePosition(){\n\t\t//console.log(print);\n\t\tvar change = 0;\n\t\tvar offset = Math.max(xOffset - leftPanelWidth,0);\n\n\t\t//set xpos of nodes, and check if node is an outside node\n\t\tlayerMap.forEach(function(d, i){\n\t\t\tif (i > 0){\n\t\t\t\td.forEach(function(e){\n\t\t\t\t\tvar tmp = [];\n\t\t\t\t\tnodesChildren[e].forEach(function(f){\n\t\t\t\t\t\tif (!nodesData[f].outside.isOutside){\n\t\t\t\t\t\t\ttmp.push(nodesData[f].xpos);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\t\n\t\t\t\t\tif (tmp.length == 0){\n\t\t\t\t\t\tif (!nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = true;\n\t\t\t\t\t\tnodesData[e].xpos = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].xpos = (d3.min(tmp) + d3.max(tmp)) / 2;\n\t\t\t\t\t\tif (!d.fixed){\n\t\t\t\t\t\t\tnodesData[e].position.x = nodesData[e].xpos;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = false;\n\t\t\t\t\t}\n\t\t\t\t}); \n\t\t\t} else {\n\t\t\t\td.forEach(function(e){\n\t\t\t\t\tvar tmpX = nodesData[e].xpos;\t\n\t\t\t\t\tif (tmpX - nodeRadius > offset && tmpX + nodeRadius < offset + windowWidth){\n\t\t\t\t\t\tif (nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = true;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t});\n\n\n\t\t\n\t\t//Set the color, opacity of nodes based on the status of isOutside\n\t\tnodes.each(function(d){\n\t\t\t/*if (d.noLayer){\n\t\t\t\td.outside.isOutside = true;\n\t\t\t\td3.select(this)\n\t\t\t\t\t.attr(\"opacity\", 0.8)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", \"red\");\n\t\t\t}\t\t*/\t\t\t\t\n\t\t\tif (d.fixed && !(d.x - nodeRadius > offset && d.x + nodeRadius < offset + windowWidth)){\n\t\t\t\td.fixed = false\t\t\t\t\n\t\t\t\td3.select(this).classed(\"fixed\", false);\n\t \t\t\td.position.x = d.xpos;\n\t\t\t\td.position.y = height - nodeRadius - d.layer * unitLinkLength;\n\t\t\t}\n\t\t\tif (d.outside.isOutside && !d.noLayer){\n\t\t\t\tif (d.unAssigned){\n\n\t\t\t\t}\t\t\t\t\n\t\t\t\td3.select(this)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(500)\n\t\t\t\t\t.attr(\"opacity\", 0.5)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", function(d){\n\t\t\t\t\t\treturn cScale(d.index + 1);\n\t\t\t\t\t});\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\td3.select(this)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(500)\n\t\t\t\t\t.attr(\"opacity\", 0.7)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", \"red\");\t\t\t\t\n\t\t\t}\n\t\t\t//console.log(d.id + \" \" + d.outside.isOutside + \" \" + d.position.x);\n\t\t});\n\t\t//console.log(change)\n\n\t\t//when some node changes its status, the correspoding links, labels and the x position of inside nodes should also change.\n\t\tif (change > 0 || firstTime){\n\t\t\tfirstTime = false;\n\t\t\td3.select(htmlElement).selectAll(\".nodeLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\tif (d.node.noLayer){\n\t\t\t\t\t\td.node.showLabel = true;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (d.type == \"nodeLabel\" && d.node.outside){\n\t\t\t\t\t\tif ((!d.node.outside.isOutside && (print || d.node.type != \"anchor\")) || (d.node.outside.isOutside && d.node.degree >= 3)){\n\t\t\t\t\t\t\td.node.showLabel = true;\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t\td.node.showLabel = false;\n\t\t\t\t\treturn 0;\t\t\t\n\t\t\t\t});\n\t\t\td3.select(htmlElement).selectAll(\".linkLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\tif (d.type == \"linkLabel\"){\n\t\t\t\t\t\t// if (nodesData[d.node.tgt].noLayer){\n\t\t\t\t\t\t// \td.show = true;\n\t\t\t\t\t\t// \treturn 1;\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// if (nodesData[d.node.tgt].type == 'anchor' && !nodesData[d.node.tgt].outside.isOutside){\n\t\t\t\t\t\t// \td.show = true;\n\t\t\t\t\t\t// \treturn 1;\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tif ((d.node.src < nodesData.length && nodesData[d.node.src].noLayer == undefined && nodesData[d.node.src].outside.isOutside) \n\t\t\t\t\t\t\t|| (d.node.tgt < nodesData.length && nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)){\n\t\t\t\t\t\t\td.show = false;\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\td.show = true;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\td3.select(htmlElement).selectAll(\".edgeLinkLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\t//console.log(d.index);\n\t\t\t\t\tif (!d.node.src.show || \n\t\t\t\t\t\t(nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)) {\n\t\t\t\t\t\td.show = false;\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\td.show = true;\n\t\t\t\t\treturn 1;\t\t\t\t\t\n\t\t\t\t});\n\t\t\t/*d3.select(htmlElement).selectAll(\".clickBoard\")\n\t\t\t\t.attr(\"fill\", function(d){\n\t\t\t\t\tif (d.content == \"edgeLinks\"){\n\t\t\t\t\t\tif (nodesData[d.node.tgt].outside.isOutside || !d.node.src.show){\n\t\t\t\t\t\t\treturn \"node\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"transparent\";\n\t\t\t\t\t} else if (d.type == \"linkLabel\"){\n\t\t\t\t\t\tif (nodesData[d.node.src].outside.isOutside || nodesData[d.node.tgt].outside.isOutside){\n\t\t\t\t\t\t\treturn \"none\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"transparent\";\n\t\t\t\t\t} \n\t\t\t\t\treturn d.node.showLabel ? \"transparent\" : \"none\";\n\t\t\t\t});*/\n\n\t\t\tlinks.classed(\"outsideLink\", function(d){\n\t\t\t\t/*if (d.type == \"edgeLink\"){\n\t\t\t\t\treturn d.target.outside.isOutside;\n\t\t\t\t}*/\n\t\t\t\tif (d.target.noLayer){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (d.source.outside && d.target.outside){\n\t\t\t\t\tif (d.target.type == 'anchor' && !d.target.outside.isOutside){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn d.source.outside.isOutside || d.target.outside.isOutside;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\t\n\t\t\tforce.start();\n\t\t}\n\t}", "function Position(left, top) {\n this.left = left;\n this.top = top;\n}", "function Position(left, top) {\n this.left = left;\n this.top = top;\n}", "function positionNode(d) {\n // keep the node within the boundaries of the svg\n if (d.x < 0) {\n d.x = 0\n };\n if (d.y < 0) {\n d.y = 0\n };\n if (d.x > width) {\n d.x = width\n };\n if (d.y > height) {\n d.y = height\n };\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n }", "function setPositions(nodes) {\n // determine positions\n for (i in nodes) {\n if (nodes[i].category === \"Math\") {\n nodes[i].x = mathX\n nodes[i].y = firstY + i * smallVerticalGap\n } else if (nodes[i].category === \"Lower\") {\n nodes[i].x = mathX*2\n nodes[i].y = firstY + (i-numMath) * bigVerticalGap\n } else if (nodes[i].category === \"100\") {\n nodes[i].x = mathX*3\n nodes[i].y = firstY + (i-(numMath+numLower)) * 70\n } else if (nodes[i].category === \"101\") {\n nodes[i].x = mathX*4\n nodes[i].y = firstY + (i-(numMath+numLower+num100)) * bigVerticalGap\n } else if (nodes[i].category === \"102\") {\n nodes[i].x = mathX*5\n nodes[i].y = firstY + (i-(numMath+numLower+num100+num101)) * bigVerticalGap\n } else if (nodes[i].category === \"Elective\") {\n nodes[i].x = horizontalX + (i-(numMath+numRequired)) * horizontalGap\n nodes[i].y = horizontalY\n } else if (nodes[i].category === \"Consulting\") {\n nodes[i].x = horizontalX + (i-(numMath+numRequired+numElective)) * horizontalGap\n nodes[i].y = horizontalY + 100\n }\n }\n }", "get position() {\n if (!position ||\n (Date.now() - position.timestamp > positionTTL)) {\n\n updatePosition();\n }\n\n return position;\n }", "function updateCoords(){\n storage.write('coords.json', coords);\n}", "function Position(x, y){\n this.x = x;\n this.y = y;\n}", "set x(nx){\n\t\tthis.position.nx = nx;\n\t}", "function CachedItemPosition() {}" ]
[ "0.6429529", "0.6342312", "0.6323051", "0.6272802", "0.62619543", "0.62437344", "0.6160176", "0.6146154", "0.605768", "0.60570323", "0.5981281", "0.5944375", "0.5837915", "0.58164245", "0.57895595", "0.57648104", "0.57380444", "0.57083964", "0.56974506", "0.5696474", "0.5696474", "0.5628467", "0.5620285", "0.56195647", "0.56117177", "0.5601444", "0.5598649", "0.55886745", "0.55843616", "0.5577264", "0.5575553", "0.55752116", "0.55547965", "0.5544916", "0.5531029", "0.552851", "0.5523621", "0.5521876", "0.5509564", "0.54963034", "0.54863626", "0.5484418", "0.5477001", "0.54662627", "0.54662627", "0.545125", "0.5442216", "0.543979", "0.54368657", "0.5423125", "0.5385639", "0.53680253", "0.5360809", "0.53593934", "0.5358135", "0.53559065", "0.534988", "0.53493565", "0.53493565", "0.53493565", "0.53493565", "0.53493565", "0.5345009", "0.5345009", "0.5345009", "0.5339364", "0.532894", "0.53145474", "0.5312302", "0.5300629", "0.52938026", "0.5293343", "0.5291923", "0.52867204", "0.5286162", "0.5281573", "0.5273592", "0.5270459", "0.52645636", "0.5257547", "0.5253042", "0.5247548", "0.52468735", "0.524605", "0.524605", "0.5241881", "0.52385825", "0.5237467", "0.52205765", "0.52202517", "0.52176803", "0.5211844", "0.52094114", "0.52094114", "0.520727", "0.52062726", "0.51955456", "0.51951987", "0.5194495", "0.5192274", "0.51922274" ]
0.0
-1
Mark position and patch `node.position`.
function position() { var before = now(); return update; /* Add the position to a node. */ function update(node, indent) { var prev = node.position; var start = prev ? prev.start : before; var combined = []; var n = prev && prev.end.line; var l = before.line; node.position = new Position(start); /* If there was already a `position`, this * node was merged. Fixing `start` wasn’t * hard, but the indent is different. * Especially because some information, the * indent between `n` and `l` wasn’t * tracked. Luckily, that space is * (should be?) empty, so we can safely * check for it now. */ if (prev && indent && prev.indent) { combined = prev.indent; if (n < l) { while (++n < l) { combined.push((offset[n] || 0) + 1); } combined.push(before.column); } indent = combined.concat(indent); } node.position.indent = indent || []; return node; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function patch(node) {\n if (!node.position) {\n node.position = {}\n }\n}", "setNodePosition(Pos, node) {\n let currrentNode = this.nodes.find(n => n === node);\n currrentNode.x = Pos.x;\n currrentNode.y = Pos.y;\n }", "assignPosition(node, position) {\n // update the position of the node\n node.position = position;\n \n // the base case\n if (node.children.length === 0)\n {\n leafNodeCounter = leafNodeCounter + 1;\n return node;\n }\n // recursive case\n else\n {\n leafNodeCounter = 0;\n for (var d = 0; d < node.children.length; d++)\n {\n // this is a really bad hack and there is definitely something better out there. \n // However, it gets the job done\n if (node.children[d].name === \"Protosomes\")\n {\n leafNodeCounter = leafNodeCounter + 2;\n }\n\n this.assignPosition(node.children[d], node.position + leafNodeCounter);\n }\n }\n\n }", "assignPosition(node, position) {\n\t\tif(node.parentNode && position<node.parentNode.position){\n\t\t\tposition = node.parentNode.position;\n\t\t}\n\t\twhile(this.positionMap.get(`${node.level},${position}`)){\n\t\t\tposition++;\n\t\t}\n\t\tnode.position = position;\n\t\tthis.positionMap.set(`${node.level},${position}`, true);\n\t\tfor(var i in node.children){\n\t\t\tthis.assignPosition(node.children[i], position+Number(i));\n\t\t}\n\t}", "function positionTokenAtNode(token, node) {\n // these details depend on the node template\n token.location = node.position.copy().offset(4 + 6, 5 + 6);\n }", "function updatePosition() {\r\n\t\t\tcircle.attr('transform', `translate(${point.x * graph.cell_size + graph.offset.x} ${point.y * graph.cell_size + graph.offset.y})`);\r\n\t\t}", "function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }", "function setCursorPositionInNode(node, pos)\n\t{\n\t\tvar sel, range;\n\t\tif (window.getSelection && document.createRange) {\n\t\t\trange = document.createRange();\n \t\t\trange.setEnd(node, pos);\n\t\t\trange.setStart(node, pos);\n\t\t\tsel = window.getSelection();\n\t\t\tsel.removeAllRanges();\n\t\t\tsel.addRange(range);\n\t\t} else if (document.body.createTextRange) {\n\t\t\trange = document.body.createTextRange();\n\t\t\trange.setEnd(node, pos);\n\t\t\trange.setStart(node, pos);\n\t\t\trange.select();\n\t\t}\n\t}", "markLocation(node/*, startLocation*/) {\n return node;\n }", "set pos(newPos) {\n this._pos = newPos;\n }", "function sync(dom, pos) {\r\n dom.style.left = `${pos.x}px`;\r\n dom.style.top = `${pos.y}px`;\r\n}", "markOn(){\n this.room.markPosition(this.positionX, this.positionY);\n }", "setPosition(x, y) {\n this.pos.x = x;\n this.pos.y = y;\n }", "setPosition(newX=this.x, newY=this.y) {\n this.x = newX;\n this.y = newY;\n this.updateEdges() // Update Edge positions\n this.setAnchorPostion(this, newX, newY); // Update DOM element\n }", "function setpos (object, x, y) {\n object.setAttribute('x', x + '');\n object.setAttribute('y', y + '');\n}", "function updateNodePositions() {\n // set node positions\n rect.attr('transform', function (d) {\n return 'translate(' + d.x + ',' + d.y + ')';\n });\n}", "modify_mark(marker) {\n if (!marker.offset_handled) {\n marker.start_pos += this.offset;\n marker.end_pos += this.offset;\n }\n return marker;\n }", "function markPosition(x, y, markerObject) {\n if (x >= 0 && x < size && y >= 0 && y < size){\n if (matrix[y][x] && matrix[y][x].marker != markerObject.marker)\n matrix[y][x] = {steps: matrix[y][x].steps + markerObject.steps, marker: 'x'};\n else \n matrix[y][x] = markerObject;\n }\n}", "function setNodePosition(){\n\t\t//console.log(print);\n\t\tvar change = 0;\n\t\tvar offset = Math.max(xOffset - leftPanelWidth,0);\n\n\t\t//set xpos of nodes, and check if node is an outside node\n\t\tlayerMap.forEach(function(d, i){\n\t\t\tif (i > 0){\n\t\t\t\td.forEach(function(e){\n\t\t\t\t\tvar tmp = [];\n\t\t\t\t\tnodesChildren[e].forEach(function(f){\n\t\t\t\t\t\tif (!nodesData[f].outside.isOutside){\n\t\t\t\t\t\t\ttmp.push(nodesData[f].xpos);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\t\n\t\t\t\t\tif (tmp.length == 0){\n\t\t\t\t\t\tif (!nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = true;\n\t\t\t\t\t\tnodesData[e].xpos = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].xpos = (d3.min(tmp) + d3.max(tmp)) / 2;\n\t\t\t\t\t\tif (!d.fixed){\n\t\t\t\t\t\t\tnodesData[e].position.x = nodesData[e].xpos;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = false;\n\t\t\t\t\t}\n\t\t\t\t}); \n\t\t\t} else {\n\t\t\t\td.forEach(function(e){\n\t\t\t\t\tvar tmpX = nodesData[e].xpos;\t\n\t\t\t\t\tif (tmpX - nodeRadius > offset && tmpX + nodeRadius < offset + windowWidth){\n\t\t\t\t\t\tif (nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = true;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t});\n\n\n\t\t\n\t\t//Set the color, opacity of nodes based on the status of isOutside\n\t\tnodes.each(function(d){\n\t\t\t/*if (d.noLayer){\n\t\t\t\td.outside.isOutside = true;\n\t\t\t\td3.select(this)\n\t\t\t\t\t.attr(\"opacity\", 0.8)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", \"red\");\n\t\t\t}\t\t*/\t\t\t\t\n\t\t\tif (d.fixed && !(d.x - nodeRadius > offset && d.x + nodeRadius < offset + windowWidth)){\n\t\t\t\td.fixed = false\t\t\t\t\n\t\t\t\td3.select(this).classed(\"fixed\", false);\n\t \t\t\td.position.x = d.xpos;\n\t\t\t\td.position.y = height - nodeRadius - d.layer * unitLinkLength;\n\t\t\t}\n\t\t\tif (d.outside.isOutside && !d.noLayer){\n\t\t\t\tif (d.unAssigned){\n\n\t\t\t\t}\t\t\t\t\n\t\t\t\td3.select(this)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(500)\n\t\t\t\t\t.attr(\"opacity\", 0.5)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", function(d){\n\t\t\t\t\t\treturn cScale(d.index + 1);\n\t\t\t\t\t});\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\td3.select(this)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(500)\n\t\t\t\t\t.attr(\"opacity\", 0.7)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", \"red\");\t\t\t\t\n\t\t\t}\n\t\t\t//console.log(d.id + \" \" + d.outside.isOutside + \" \" + d.position.x);\n\t\t});\n\t\t//console.log(change)\n\n\t\t//when some node changes its status, the correspoding links, labels and the x position of inside nodes should also change.\n\t\tif (change > 0 || firstTime){\n\t\t\tfirstTime = false;\n\t\t\td3.select(htmlElement).selectAll(\".nodeLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\tif (d.node.noLayer){\n\t\t\t\t\t\td.node.showLabel = true;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (d.type == \"nodeLabel\" && d.node.outside){\n\t\t\t\t\t\tif ((!d.node.outside.isOutside && (print || d.node.type != \"anchor\")) || (d.node.outside.isOutside && d.node.degree >= 3)){\n\t\t\t\t\t\t\td.node.showLabel = true;\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t\td.node.showLabel = false;\n\t\t\t\t\treturn 0;\t\t\t\n\t\t\t\t});\n\t\t\td3.select(htmlElement).selectAll(\".linkLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\tif (d.type == \"linkLabel\"){\n\t\t\t\t\t\t// if (nodesData[d.node.tgt].noLayer){\n\t\t\t\t\t\t// \td.show = true;\n\t\t\t\t\t\t// \treturn 1;\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// if (nodesData[d.node.tgt].type == 'anchor' && !nodesData[d.node.tgt].outside.isOutside){\n\t\t\t\t\t\t// \td.show = true;\n\t\t\t\t\t\t// \treturn 1;\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tif ((d.node.src < nodesData.length && nodesData[d.node.src].noLayer == undefined && nodesData[d.node.src].outside.isOutside) \n\t\t\t\t\t\t\t|| (d.node.tgt < nodesData.length && nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)){\n\t\t\t\t\t\t\td.show = false;\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\td.show = true;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\td3.select(htmlElement).selectAll(\".edgeLinkLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\t//console.log(d.index);\n\t\t\t\t\tif (!d.node.src.show || \n\t\t\t\t\t\t(nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)) {\n\t\t\t\t\t\td.show = false;\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\td.show = true;\n\t\t\t\t\treturn 1;\t\t\t\t\t\n\t\t\t\t});\n\t\t\t/*d3.select(htmlElement).selectAll(\".clickBoard\")\n\t\t\t\t.attr(\"fill\", function(d){\n\t\t\t\t\tif (d.content == \"edgeLinks\"){\n\t\t\t\t\t\tif (nodesData[d.node.tgt].outside.isOutside || !d.node.src.show){\n\t\t\t\t\t\t\treturn \"node\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"transparent\";\n\t\t\t\t\t} else if (d.type == \"linkLabel\"){\n\t\t\t\t\t\tif (nodesData[d.node.src].outside.isOutside || nodesData[d.node.tgt].outside.isOutside){\n\t\t\t\t\t\t\treturn \"none\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"transparent\";\n\t\t\t\t\t} \n\t\t\t\t\treturn d.node.showLabel ? \"transparent\" : \"none\";\n\t\t\t\t});*/\n\n\t\t\tlinks.classed(\"outsideLink\", function(d){\n\t\t\t\t/*if (d.type == \"edgeLink\"){\n\t\t\t\t\treturn d.target.outside.isOutside;\n\t\t\t\t}*/\n\t\t\t\tif (d.target.noLayer){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (d.source.outside && d.target.outside){\n\t\t\t\t\tif (d.target.type == 'anchor' && !d.target.outside.isOutside){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn d.source.outside.isOutside || d.target.outside.isOutside;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\t\n\t\t\tforce.start();\n\t\t}\n\t}", "set x(nx){\n\t\tthis.position.nx = nx;\n\t}", "set position(p) {\n this.previous.to(this);\n if (this._lock)\n this._lockPt = p;\n this.to(p);\n }", "updatePos(token, tObj) {\n tObj.xPos = token.get('left');\n tObj.yPos = token.get('top');\n }", "newPosition(position) {\n this.position = position;\n }", "setPosition(x, y) {\n this.x = x\n this.y = y\n }", "function setPosition(el, point) {\n /*eslint-disable */\n el._leaflet_pos = point;\n /* eslint-enable */\n\n if (any3d) {\n setTransform(el, point);\n } else {\n el.style.left = point.x + 'px';\n el.style.top = point.y + 'px';\n }\n } // @function getPosition(el: HTMLElement): Point", "function patch(nodes, location, offset) {\n var index = -1\n var start = offset\n var end\n var node\n\n while (++index < nodes.length) {\n node = nodes[index]\n\n if (node.children) {\n patch(node.children, location, start)\n }\n\n end = start + toString(node).length\n\n node.position = {\n start: location.toPoint(start),\n end: location.toPoint(end)\n }\n\n start = end\n }\n\n return nodes\n }", "function handleToMovePatchNode() {}", "setPosition(x, y) {\n this.x = x;\n this.y = y;\n }", "sendToStartPos() {\n this.x = this.spawnX;\n this.y = this.spawnY;\n }", "set position (newPosition) {\n this.emit('position', newPosition)\n this._position = newPosition * this.ticksPerSongPosition\n }", "function setPos(j) {\n pos = j;\n update();\n\n\n}", "function setpostion(newPostion) {\n setPosition(newPostion);\n }", "updatePosition(position) \n {\n this.position = position;\n }", "setPosition() {\r\n if (!this.object) return;\r\n this.updatePosition();\r\n }", "set_position(newval) {\n this.liveFunc.set_position(newval);\n return this._yapi.SUCCESS;\n }", "setPosition(position) {\n this.position = position;\n }", "set position(value) {\n this.position$.next(value);\n }", "updatePos(node) {\n if (node != null) {\n\n var q = node.distanceFromParent;\n\n // this.isRB && \n if (node.dpth == 0) {\n node.changePositionNoMove(10_000, 200);\n }\n \n if (node.dpth > 0) {\n node.changePositionNoMove(node.parent.posX+q, node.parent.posY+this.z);\n }\n\n this.updatePos(node.left);\n this.updatePos(node.right);\n }\n }", "SetNewPositionToANode(registeredPos) {\n this.setNodePosition(registeredPos.newValue, registeredPos.element);\n }", "function setPosition( graphID, updatedX, updatedY )\n{\n console.log( `moving ${graphID} to ${updatedX}, ${updatedY}`);\n\n // changing a body's position in Matter JS maintains the constraints\n // we will remove all the constraints, move the body, then put the constraints back in\n var circleBody = idToCircleMap.get( graphID );\n\n // track neighbors \n var neighbors = new Array();\n var currentConstraints = Composite.allConstraints(barAndJointComposite);\n var currentConstraint;\n\n // iterate over all constraints\n // if find a neighbor, remove the constraint and track the graphID to add back in\n for ( var i = 0; i < currentConstraints.length; i++ )\n {\n currentConstraint = currentConstraints[i];\n if ( currentConstraint.bodyA == circleBody )\n {\n neighbors.push( currentConstraint.bodyB.graphID );\n Composite.remove( barAndJointComposite, currentConstraint ); \n }\n else if ( currentConstraint.bodyB == circleBody )\n {\n neighbors.push( currentConstraint.bodyA.graphID );\n Composite.remove( barAndJointComposite, currentConstraint ); \n }\n }\n Body.setPosition( circleBody, {x:updatedX, y:updatedY});\n\n // now add the constraints back in\n for ( var i = 0; i < neighbors.length; i++ )\n addConstraintBetween( graphID, neighbors[i] );\n console.log( circleBody );\n}", "setPosition(posX, posY) {\n this._positionX = posX;\n this._positionY = posY;\n this._zoomDirty = true;\n }", "function changeLinePos(line, pos) {\n pos = {\n x: pos.x / resizer,\n y: pos.y / resizer\n }\n gMeme[getMemeIdxInGMeme(gCurrMeme)].lines[line].pos = pos;\n}", "set posX(value){\n this._posX = value;\n }", "setPosition(position)\n {\n this.position = position;\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n this.updateMatrixWorld();\n }", "update () {\n this.position = [this.x, this.y];\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "addNodeMark(pos, mark) {\n this.step(new AddNodeMarkStep(pos, mark));\n return this;\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n }", "setPosition(newX=this.x, newY=this.y) {\n this.x = newX;\n this.y = newY;\n this.updateEdges() // Update Edge positions\n this.setBlobPosition(this, newX, newY); // Update DOM element\n // Update Text Positioning\n if (this.shape === \"rectangle\") {\n this.updateTextPosition(this.html, this.x, this.y, this.width, this.height);\n }\n else if (this.shape === \"circle\") {\n this.updateTextPosition(this.html, this.x - this.radius/1.4, this.y - this.radius/1.4, this.radius*1.4, this.radius*1.4);\n }\n else {\n this.updateTextPosition(this.html, this.x - this.radiusx/1.4, this.y - this.radiusy/1.4, this.radiusx*1.4, this.radiusy*1.4);\n }\n }", "set targetPosition(value) {}", "set_red_ghost_pos(position) {\r\n\r\n this.ghost.ghost_red_pos_x = position.x_pos;\r\n this.ghost.ghost_red_pos_y = position.y_pos; \r\n }", "setPos(x,y){\n\t\tthis.setX(x);\n\t\tthis.setY(y);\n\t}", "invalidateCSSPositioning() {\n if ( !this.positionDirty ) {\n this.positionDirty = true;\n\n // mark all ancestors of this peer so that we can quickly find this dirty peer when we traverse\n // the PDOMInstance tree\n let parent = this.pdomInstance.parent;\n while ( parent ) {\n parent.peer.childPositionDirty = true;\n parent = parent.parent;\n }\n }\n }", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "function CWCMFlowNode_setPoint(_x, _y){\n\tthis.updated = true;\n\tthis.center.x = _x;\n\tthis.center.y = _y;\n}", "moveTo(point) {\n if (!this.fixed) {\n this.reset()\n this.dest = point\n }\n // this.pos = point\n // this.fixed = true\n }", "function markIt(node) {\n node.addClass(\"marked\");\n jsav.umsg(\"Mark node \" + node.value());\n node.highlight();\n jsav.step();\n}", "function positionSet(point, index) {\n circles[index].x = point.x;\n circles[index].y = point.y;\n positioned[index] = true;\n }", "function position() {\n var start = {line: lineno, column: column}\n return function(node) {\n node.position = new Position(start)\n whitespace()\n return node\n }\n }", "setOldPosition(registeredPos) {\n this.setNodePosition(registeredPos.oldValue, registeredPos.element);\n }", "function positionSet(point, index) {\n circles[index].x = point.x;\n circles[index].y = point.y;\n positioned[index] = true;\n }", "function positionSet(point, index) {\n circles[index].x = point.x;\n circles[index].y = point.y;\n positioned[index] = true;\n }", "function positionSet(point, index) {\n circles[index].x = point.x;\n circles[index].y = point.y;\n positioned[index] = true;\n }", "function reposition(node, x, k) {\r\n // console.log(node)\r\n node.x = x;\r\n if (node.children && (n = node.children.length)) {\r\n var i = -1, n;\r\n while (++i < n) x += reposition(node.children[i], x, k);\r\n }\r\n return node.dx = node.value * k;\r\n}", "function ticked() {\n link.attr(\"d\", positionLink);\n node.attr(\"transform\", positionNode);\n }", "function setNewXPositions(last) {\n data.tree.eachBefore(d => {\n d.x = d.x / last\n d.x = d.x * graph.scale.vertical.value\n\n let element = d3.select('#node' + d.data.id)\n if (!element) return\n element.attr('transform', 'translate(' + [d.y, d.x] + ')')\n if (d.parent) {\n d3.select('#link' + d.data.id)\n .select('path')\n .attr('d', 'M' + [d.parent.y, d.parent.x] + 'V' + d.x + 'H' + d.y)\n\n if (graph.style.linkLabels) {\n if (d3.select('#label' + d.data.id)) {\n d3.select('#label' + d.data.id)\n .attr('y', (d.x - 5).toString())\n }\n }\n }\n })\n }", "function pointAt(node){\n var parent = node.parentNode;\n var next = node.nextSibling;\n return function(newnode) {\n parent.insertBefore(newnode, next);\n };\n }", "setWorldPosition(position, update = false){ \n let new_pos = this.getParentSpaceMatrix().getInverse().times(position)\n let pp_r_s_inv = Matrix3x3.Translation(new_pos).times(\n Matrix3x3.Rotation(this.getRotation()).times(\n Matrix3x3.Scale(this.getScale())\n )).getInverse()\n let new_a_mat = pp_r_s_inv.times(this.matrix)\n this.setPosition(new_pos, update)\n this.setAnchorShift(new Vec2(new_a_mat.m02, new_a_mat.m12))\n this.updateMatrixProperties()\n }", "changePosition(x, y, z) {\n\t\t'use strict';\n\t\tthis.obj.position.set(x, y, z);\n\t}", "changePosition(x, y, z) {\n\t\t'use strict';\n\t\tthis.obj.position.set(x, y, z);\n\t}", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "insertAfterPart(ref){ref.__insert(this.startNode=createMarker());this.endNode=ref.endNode;ref.endNode=this.startNode}", "function position() {\n const start = {\n line: lineno,\n column\n };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function reposition(node, x, k) {\n node.x = x;\n if (node.children && (n = node.children.length)) {\n var i = -1, n;\n while (++i < n) x += reposition(node.children[i], x, k);\n }\n return node.dx = node.value * k;\n }", "function setNodesPosition(nodes) {\n var deferred = $.Deferred();\n if ( nodes.length == 0 ) { deferred.resolve(); return deferred.promise(); }\n var lab_filename = $('#lab-viewport').attr('data-path');\n var form_data = [];\n form_data=nodes;\n var url = '/api/labs' + lab_filename + '/nodes' ;\n var type = 'PUT';\n $.ajax({\n cache: false,\n timeout: TIMEOUT,\n type: type,\n url: encodeURI(url),\n dataType: 'json',\n data: JSON.stringify(form_data),\n success: function (data) {\n if (data['status'] == 'success') {\n logger(1, 'DEBUG: node position updated.');\n deferred.resolve();\n } else {\n // Application error\n logger(1, 'DEBUG: application error (' + data['status'] + ') on ' + type + ' ' + url + ' (' + data['message'] + ').');\n deferred.reject(data['message']);\n }\n },\n error: function (data) {\n // Server error\n var message = getJsonMessage(data['responseText']);\n logger(1, 'DEBUG: server error (' + data['status'] + ') on ' + type + ' ' + url + '.');\n logger(1, 'DEBUG: ' + message);\n deferred.reject(message);\n }\n });\n return deferred.promise();\n}", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\n }", "reset(position) {\n this.x = this.x0;\n this.y = this.y0;\n }", "function position() {\n\t var start = { line: lineno, column: column };\n\t return function(node){\n\t node.position = new Position(start);\n\t whitespace();\n\t return node;\n\t };\n\t }", "updatePosition() {\n this.position = Utils.convertToEntityPosition(this.bmp);\n }", "function removePosition(node, force) {\n visit(node, force ? hard : soft);\n return node;\n}", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }", "updatePosition() {\n this.handleWrapping();\n this.x += this.vx;\n }" ]
[ "0.7862141", "0.6787863", "0.66805166", "0.6609155", "0.6173004", "0.6159076", "0.6156995", "0.60025716", "0.599988", "0.5988381", "0.59879845", "0.59078616", "0.58900505", "0.5886544", "0.5858589", "0.58463717", "0.58296645", "0.5808339", "0.57834077", "0.57740074", "0.57380086", "0.5733875", "0.5715833", "0.57150656", "0.5685423", "0.5680968", "0.5666332", "0.5666188", "0.56428653", "0.56371593", "0.5618294", "0.5617533", "0.5598555", "0.5595608", "0.55928737", "0.55862945", "0.5575621", "0.55662173", "0.5565482", "0.55582917", "0.5547722", "0.55473477", "0.5531179", "0.5530716", "0.55269223", "0.55267364", "0.5519412", "0.5519412", "0.5519412", "0.5519412", "0.5519412", "0.5519412", "0.55135405", "0.5513324", "0.5509897", "0.55092275", "0.55068827", "0.5505693", "0.5504801", "0.54890144", "0.54890144", "0.54890144", "0.54809153", "0.5474242", "0.5465788", "0.5463138", "0.54621387", "0.5430871", "0.54268086", "0.54268086", "0.54268086", "0.54261124", "0.5417207", "0.5412953", "0.54090476", "0.5395924", "0.5392038", "0.5392038", "0.5383833", "0.5383833", "0.5383833", "0.5376505", "0.5364341", "0.5351035", "0.5350081", "0.53489304", "0.5348565", "0.5348259", "0.5345013", "0.5342669", "0.534263", "0.534263", "0.534263", "0.534263", "0.534263", "0.53317815" ]
0.61260253
10
Add the position to a node.
function update(node, indent) { var prev = node.position; var start = prev ? prev.start : before; var combined = []; var n = prev && prev.end.line; var l = before.line; node.position = new Position(start); /* If there was already a `position`, this * node was merged. Fixing `start` wasn’t * hard, but the indent is different. * Especially because some information, the * indent between `n` and `l` wasn’t * tracked. Luckily, that space is * (should be?) empty, so we can safely * check for it now. */ if (prev && indent && prev.indent) { combined = prev.indent; if (n < l) { while (++n < l) { combined.push((offset[n] || 0) + 1); } combined.push(before.column); } indent = combined.concat(indent); } node.position.indent = indent || []; return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add (node, parent) {\n parent.children.push(node)\n if (parser.position) {\n parent.position = {\n start: parent.children[0].position.start,\n end: node.position.end\n }\n }\n }", "addPosition(pos) {\n this.positions += '=\"'+pos.line + ':' + pos.linePosition + '\",';\n }", "assignPosition(node, position) {\n\t\tif(node.parentNode && position<node.parentNode.position){\n\t\t\tposition = node.parentNode.position;\n\t\t}\n\t\twhile(this.positionMap.get(`${node.level},${position}`)){\n\t\t\tposition++;\n\t\t}\n\t\tnode.position = position;\n\t\tthis.positionMap.set(`${node.level},${position}`, true);\n\t\tfor(var i in node.children){\n\t\t\tthis.assignPosition(node.children[i], position+Number(i));\n\t\t}\n\t}", "assignPosition(node, position) {\n // update the position of the node\n node.position = position;\n \n // the base case\n if (node.children.length === 0)\n {\n leafNodeCounter = leafNodeCounter + 1;\n return node;\n }\n // recursive case\n else\n {\n leafNodeCounter = 0;\n for (var d = 0; d < node.children.length; d++)\n {\n // this is a really bad hack and there is definitely something better out there. \n // However, it gets the job done\n if (node.children[d].name === \"Protosomes\")\n {\n leafNodeCounter = leafNodeCounter + 2;\n }\n\n this.assignPosition(node.children[d], node.position + leafNodeCounter);\n }\n }\n\n }", "setNodePosition(Pos, node) {\n let currrentNode = this.nodes.find(n => n === node);\n currrentNode.x = Pos.x;\n currrentNode.y = Pos.y;\n }", "SetNewPositionToANode(registeredPos) {\n this.setNodePosition(registeredPos.newValue, registeredPos.element);\n }", "function positionTokenAtNode(token, node) {\n // these details depend on the node template\n token.location = node.position.copy().offset(4 + 6, 5 + 6);\n }", "insertAtPosition(position, nodeToInsert) {\n if(position > this.length + 1 || !position || !nodeToInsert)\n return\n\n if(position === 1) {\n this.setHead(nodeToInsert)\n return\n }\n\n let curr = this.head, currPost = 1\n while(curr && currPost++ < position)\n curr = curr.next\n\n if(curr) this.insertBefore(curr, nodeToInsert)\n else this.setTail(nodeToInsert)\n\n }", "insertIn(position, value) {\n if (position < 0 || \n position > this.length) {\n\n console.error(\"Position is out of range! \", position)\n return null;\n }\n\n let node = new Node(value);\n\n if (position === 0) {\n\n node.next = this.head;\n this.head = node;\n\n } else {\n let current = this.head,\n prev = null,\n index = 0;\n\n while (index < position) {\n prev = current;\n current = current.next;\n index ++;\n }\n\n prev.next = node;\n node.next = current;\n }\n\n this.length++;\n\n }", "pushPosition(position) {\n\t\tthis.positionContainer.push(position);\n\t}", "function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }", "insertAfter(position, data) {\n /*\n `position === -1` means we are adding the node before the head,\n hence, our `head` should be changed\n */\n if (position === -1) {\n let newNode = new ListNode(data)\n newNode.next = this.head\n this.head = newNode\n return\n }\n\n let currentNode = this.find(position)\n\n if (currentNode) {\n let newNode = new ListNode(data)\n newNode.next = currentNode.next\n currentNode.next = newNode\n } else {\n throw new Error(`Cannot insert at position ${position + 1}: unreachable position!`)\n }\n }", "function addNode(){\n\n if (!CONST.nodeEditingEnabled)\n return;\n // prevent I-bar on drag\n //d3.event.preventDefault();\n\n // because :active only works in WebKit?\n svg.classed('active', true);\n\n if(d3.event.ctrlKey || mousedown_node || mousedown_link) return;\n\n // insert new node at point\n var point = d3.mouse(this),\n node = {id: 'ID' + ++lastNodeId, reflexive: false};\n node.x = point[0];\n node.y = point[1];\n nodes.push(node);\n\n showMsg('New node is added', 'success');\n restart();\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function InsertNode() {}", "insertAt(item, position) {\n if(this.head === null) {\n this.head = new _Node(item, this.head)\n }\n let currNode = this.head\n let count = 0\n while(count < position - 1) {\n currNode = currNode.next\n count++\n }\n currNode.next = new _Node(item, currNode.next)\n }", "insert(pos, val) {\n const newNode = new LListNode(val, pos.current().getNext());\n pos.current().setNext(newNode);\n pos.next();\n return pos;\n }", "addNode(node, outerDeco, innerDeco, view, pos) {\n this.top.children.splice(this.index++, 0, NodeViewDesc.create(this.top, node, outerDeco, innerDeco, view, pos));\n this.changed = true;\n }", "function insertNode(text, position, parentNode, session) {\n var seed = session.seed();\n\n seed.setValue(text);\n parentNode.insert(seed, position);\n\n return seed;\n }", "function insertNode(location, reference) {\n\tvar newNode = document.createElement('div');\n\tnewNode.className = 'node';\n\n\tif (location === 'before') {\n\t\tnodeList.insertBefore(newNode, reference);\n\t} else {\n\t\tnodeList.insertBefore(newNode, reference.nextSibling);\n\t}\n\t\n\tnewNode.innerHTML = nodeFiller;\n}", "newPosition(position) {\n this.position = position;\n }", "function positionNode(d) {\n // keep the node within the boundaries of the svg\n if (d.x < 0) {\n d.x = 0\n };\n if (d.y < 0) {\n d.y = 0\n };\n if (d.x > width) {\n d.x = width\n };\n if (d.y > height) {\n d.y = height\n };\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n }", "insert(pos, val){\r\n\r\n if(pos > this.length || pos < 0) return false;\r\n\r\n if(pos === this.length){\r\n this.push(val);\r\n }else if(pos === 0){\r\n this.unshift(val);\r\n }else{\r\n let selectedNode = this.getNode(pos-1);\r\n let oldNext = selectedNode.next;\r\n\r\n let newNode = new Node(val);\r\n selectedNode.next = newNode;\r\n newNode.next = oldNext; \r\n newNode.prev = selectedNode;\r\n selectedNode.prev = newNode;\r\n this.length += 1;\r\n }\r\n\r\n return true;\r\n\r\n }", "function addNodeOnto(x,y,name){\n var index = node_dataOnto.length;\n node_dataOnto.push({x:x,y:y,name:name,index:index});\n refreshGraphOnto(node_dataOnto,link_dataOnto);\n}", "function adjustNodeInsertPosition(root, nodeToInsert, position) {\n adjustSteps.forEach(function (handler) {\n position = handler(root, nodeToInsert, position);\n });\n return position;\n}", "createNode(pos) {\n let newX;\n let newY;\n if (pos !== undefined) {\n newX = pos.x;\n newY = pos.y;\n }\n else {\n newX = this.cursorPosition.x;\n newY = this.cursorPosition.y;\n }\n return new Types_1.Node(\"0\", this.findLowestIDAvailable(), newX, newY, this.frozen, false);\n }", "function addNode(){\n d.push(createNode(nodeCount));\n nodeCount++;\n}", "function patch(node) {\n if (!node.position) {\n node.position = {}\n }\n}", "function insertNodeAtPosition(head, data, position){ \n \tif(position == 0){\n \tconst to_insert = new LinkedListNode(data)\n \tto_insert.next = head\n head = to_insert\n return head\n }\n let count = 1\n let current = head\n while(count < position){\n \tcount++\n current = current.next\n\t}\n const to_insert = new LinkedListNode(data)\n to_insert.next = current.next\n current.next = to_insert\n \n current = head\n let result = \"\"\n while(current){\n \tresult += `${current.data} `\n \tcurrent = current.next\n }\n \n return head\n}", "set position(value) {\n this.position$.next(value);\n }", "get pos()\n\t{\n\t\treturn new NodeGraph.Position(this.x, this.y);\n\t}", "insertAt(element, pos) {\n let nodeToInsert = new Node(element);\n let count = 0;\n let current = this.head;\n let previous;\n if (pos === 0) {\n nodeToInsert.next = this.head;\n this.head = nodeToInsert;\n } else if (pos == this.size) {\n while (count < pos) {\n previous = current;\n current = current.next;\n count++;\n }\n previous.next = nodeToInsert;\n }\n else {\n while (count < pos) {\n previous = current;\n current = current.next;\n count++;\n }\n nodeToInsert.next = previous.next;\n previous.next = nodeToInsert;\n this.size++;\n }\n }", "insertAt(element, position){\n var head = this.head;\n var node = new Node(element);\n if(position <=0 || position>this.size+1)\n return;\n else if(position == 1){\n node.next = head;\n this.head = node;\n }\n else if(position == this.size+1){\n var current = this.head;\n while(current.next){\n current = current.next;\n }\n current.next = node;\n }\n else{\n var current = this.head;\n for(var i=1; i<position-1; i++){\n current = current.next;\n }\n var nextNode = current.next;\n node.next = current.next;\n current.next = node;\n\n }\n this.size++;\n\n }", "set position (newPosition) {\n this.emit('position', newPosition)\n this._position = newPosition * this.ticksPerSongPosition\n }", "function addNodeToCy(nodeText, x, y){\r\n\tif(x == undefined) x = 0;\r\n\tif(y == undefined) y = 0;\r\n\t\r\n\tif(hasSuperSubScript(nodeText)){\r\n\t\treturn insertSuperSubscript(nodeText, x, y);\r\n\t}\t\r\n\r\n\tnode = \t{ // node\" +\r\n\t\t\t\tdata: {name: nodeText/*, label_name: nodeText*/},\r\n\t\t\t\trenderedPosition: { x: x, y: y},\r\n\t\t\t\tclasses:['base']\r\n\t\t\t};\r\n\treturn cy.add(node);\r\n}", "constructor($pos) {\n let node = $pos.nodeAfter;\n let $end = $pos.node(0).resolve($pos.pos + node.nodeSize);\n super($pos, $end);\n this.node = node;\n }", "function writePosition(x,y){\n //first refer to the point and set the value\n database.ref('ball/position').set({\n 'x':position.x+x,\n 'y':position.y+y\n })\n}", "insertAt(position,item){\n \n if(this.head === null){\n this.insertFirst(item);\n }\n \n let ticker = 0;\n let currNode = this.head;\n let nextNode = this.head;\n \n while ((nextNode !== null) && (ticker !== position)) {\n //save the previous node \n currNode = nextNode;\n nextNode = currNode.next;\n ticker++;\n }\n \n currNode.next = new _Node(item,nextNode);\n \n }", "function addPosition(x,y,positionArray) {\n var position={x,y};\n positionArray.push(position);\n}", "insert(position, element){\n if (position >= 0 && position < this.length){\n var node = new Node(element);\n var current = this.head;\n var previous;\n var counter = 0;\n // if adding element at the beginning of the list...\n if (position === 0){\n // push back the 1st element...\n node.next = current;\n // point head to inserted node\n this.head = node;\n } else {\n // loop thru til we reach the desired position...\n while (counter++ < position){\n previous = current;\n current = current.next;\n }\n // when finally bust out of the loop, CURRENT is referencing element after the position we would like to insert... (want to add new item b/w prev and current)\n // point previous.next to node && point node.next to current\n // make a link b/w the new item and current\n node.next = current;\n // change link b/w previous and current\n previous.next = node;\n }\n this.length++;\n return true;\n } else {\n return false;\n }\n }", "setPosition(newX=this.x, newY=this.y) {\n this.x = newX;\n this.y = newY;\n this.updateEdges() // Update Edge positions\n this.setAnchorPostion(this, newX, newY); // Update DOM element\n }", "insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}", "set pos(newPos) {\n this._pos = newPos;\n }", "function addNode(val,x,y)\n{\n d3.select(`#node${val-1}`).remove();\n\n const svg = d3.select('svg');\n\n const g= svg.append('g')\n .attr('id',`node${val-1}`);\n\n const c = g.append('circle')\n .attr('cx',`${x}`)\n .attr('cy',`${y}`)\n .attr('r',25)\n .style('fill','#F5F2B8')\n .attr('stroke','#383F51')\n .attr('stroke-width','2px');\n\n const t =g.append('text')\n .attr('x',`${x}`)\n .attr('y',`${y}`)\n .text(val)\n .attr('fill','#383F51')\n .attr('alignment-baseline',\"central\")\n .attr('text-anchor','middle')\n .attr('font-size','20px')\n .style('font-weight','bold');\n\n}", "function setCursorPositionInNode(node, pos)\n\t{\n\t\tvar sel, range;\n\t\tif (window.getSelection && document.createRange) {\n\t\t\trange = document.createRange();\n \t\t\trange.setEnd(node, pos);\n\t\t\trange.setStart(node, pos);\n\t\t\tsel = window.getSelection();\n\t\t\tsel.removeAllRanges();\n\t\t\tsel.addRange(range);\n\t\t} else if (document.body.createTextRange) {\n\t\t\trange = document.body.createTextRange();\n\t\t\trange.setEnd(node, pos);\n\t\t\trange.setStart(node, pos);\n\t\t\trange.select();\n\t\t}\n\t}", "addAfter(value, position){\n\t\tif(!this.head) return this.add(value);\n\t\tif(this.length < position) return 'position does not exist';\n\t\tif(this.length === position) return this.add(value);\n\t\tlet newNode = new Node(value);\n\t\tlet aux, count = 1;\n\t\tlet current = this.head;\n\t\twhile(count <= position){\n\t\t\tcurrent = current.next\n\t\t\tcount++\n\t\t}\n\t\taux = current.next;\n\t\tnewNode.next = aux;\n\t\tcurrent.next = newNode;\n\t\tthis.length++;\n\t\treturn this;\n\t}", "function setNode(pos, dist){\n\tif(nodeArray[pos] != start){\n\t\tnodeArray[pos].addDis('&#8734');\n\t}\n\n\tif(pos < nodeArray.length - 1){\n\t\tsetTimeout(function(){setNode(++pos, dist);}, 50);\n\t\t// setTimeout(function(){alert(pos);}, 1000);\n\t}\n\n\tif (pos == nodeArray.length - 1) {\n\t\tdijkstraHelp(null, q, [], dist);\n\t};\n}", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling}", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n }", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\n }", "function append(node, item, offset) {\n\n\t\titem.offset = ++offset;\n\t\tsiblingIndex.add(item);\n\t\tnode.children.push(item);\n\t\titem.parent = node;\n\t\titem.id = id++;\n\t\ttree.push(item);\n\n\t}", "function pointAt(node){\n var parent = node.parentNode;\n var next = node.nextSibling;\n return function(newnode) {\n parent.insertBefore(newnode, next);\n };\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n this.updateMatrixWorld();\n }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "function updateNodePositions() {\n // set node positions\n rect.attr('transform', function (d) {\n return 'translate(' + d.x + ',' + d.y + ')';\n });\n}", "function addNode(x,y,radius,nodeColor,nodeName)\r\n{\r\n\r\n\tnodeText[nodeString.length]='<text x=\"'+(x-4.3*nodeName.length)+'\" y=\"'+(y+2*radius)+'\" fill=\"white\">'+nodeName+'</text>';\r\n\tnodeString[nodeString.length]='<circle cx=\"'+x+'\" cy=\"'+y+'\" r=\"'+radius+'\" stroke=\"white\" stroke-width=\"1\" fill=\"'+nodeColor+'\" onmouseover=\"changeNodeInformation('+nodeString.length+')\" onClick=\"nodeClickHandle('+nodeString.length+')\" />';\r\n}", "addValue(val) {\n let n = new Node(val);\n if (this.root == null) {\n this.root = n;\n // An initial position for the root node\n this.root.x = width / 2;\n this.root.y = 16;\n } else {\n this.root.addNode(n);\n }\n }", "function position() {\n var start = {line: lineno, column: column}\n return function(node) {\n node.position = new Position(start)\n whitespace()\n return node\n }\n }", "function createNodes(node, positionX, positionY, val = 0){\n let newVal = val + int(node.freq);\n circles.push([positionX, positionY, node.freq, node.symbol]);\n \n if(node.left !== null){\n createNodes(node.left, positionX - 100, positionY + 100, newVal);\n lines.push([positionX, positionY, positionX - 100, positionY + 100]);\n } \n \n if(node.right !== null){\n createNodes(node.right, positionX + 100, positionY + 100, newVal)\n lines.push([positionX, positionY, positionX + 100, positionY + 100]);\n }\n \n}", "function insertPositions() {\n $.each(rankingData, function(index, value) {\n rankingData[index].position = index + 1;\n });\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "add_node (node) {\n this.socket.emit('add_node', {\n nodeId: node.nodeId,\n iport: node.iport\n });\n }", "function position(pos) {\n log.innerHTML = pos\n }", "addAt(index, data) {\n var node = new Node(data);\n\n if (index < 0 || index > this.size) {\n console.log(\"this index \" + index + \"th position is not from current list position 0 to \" + this. size);\n this.size--;\n }else if (index == 0) {\n this.addStart(data);\n this.size--;\n }else if (index == this.size) {\n this.add(data);\n this.size--;\n }else {\n var temp = this.head;\n for (var i = 0; i < index - 1; i++) {\n temp = temp.next;\n }\n\n //updating new nodes pointer to next node\n node.next = temp.next;\n //updating previous node's pointer to new node\n temp.next = node;\n }\n this.size++;\n }", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling;}", "function position() {\n\t var start = { line: lineno, column: column };\n\t return function(node){\n\t node.position = new Position(start);\n\t whitespace();\n\t return node;\n\t };\n\t }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "set x(nx){\n\t\tthis.position.nx = nx;\n\t}", "setNodeColumn() {\n const node = this;\n if (!defined(node.options.column)) {\n // No links to this node, place it left\n if (node.linksTo.length === 0) {\n node.column = 0;\n }\n else {\n node.column = node.getFromNode().fromColumn + 1;\n }\n }\n }", "pushNewPos(x, y, stack)\n\t{\n\t\tconsole.log (\"==> \", x, \", \", y);\n let npos = new Position();\n\t\tnpos.setx(x);\n\t\tnpos.sety(y);\n\t\tif (this.maze.validPosition(x,y))\n\t\t\tstack.push(npos);\n\t}", "setPosition(x, y) {\n this.pos.x = x;\n this.pos.y = y;\n }", "insert(index, val) {\n // check if the index less than zero ang greater than the length.\n if(index < 0 || index > this.length) {\n return false;\n }\n // if the index is the same as length use push.\n if(index === this.length){\n this.push(val);\n return true;\n }\n // if the index is zero use unshift. \n if(index === 0) {\n this.unshift(val);\n return true;\n }\n // get the node at the target position\n let targetNode = this.get(index);\n // find the node before the target index.\n let beforeTargetNode = this.get(index - 1);\n // Create new Node with val. \n let newNode = new Node(val);\n // set the next prop on the node be the new node. \n newNode.next = targetNode;\n // set the before target node next prop to the new Node. \n beforeTargetNode.next = newNode;\n // increment the length\n this.length++;\n\n // return true.\n return true;\n }", "function insertOrAppend(container, pos, el) {\n var childs = container.childNodes;\n if (pos < childs.length) {\n var refNode = childs[pos];\n container.insertBefore(el, refNode);\n } else {\n container.appendChild(el);\n }\n }", "addNode(x, y, text, rx = 20, ry = 20) {\n let node = new Node(x, y, rx, ry, text);\n this.root.appendChild(node.root);\n this.nodes.push(node);\n return node;\n }", "insertNode(editor, node) {\n editor.insertNode(node);\n }", "insertNode(editor, node) {\n editor.insertNode(node);\n }", "function position() {\n const start = {\n line: lineno,\n column\n };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function insert(n, p, x1, y1, x2, y2) {\n if (isNaN(p.x) || isNaN(p.y)) return; // ignore invalid points\n if (n.leaf) {\n var v = n.point;\n if (v) {\n // If the point at this leaf node is at the same position as the new\n // point we are adding, we leave the point associated with the\n // internal node while adding the new point to a child node. This\n // avoids infinite recursion.\n if ((Math.abs(v.x - p.x) + Math.abs(v.y - p.y)) < .01) {\n insertChild(n, p, x1, y1, x2, y2);\n } else {\n n.point = null;\n insertChild(n, v, x1, y1, x2, y2);\n insertChild(n, p, x1, y1, x2, y2);\n }\n } else {\n n.point = p;\n }\n } else {\n insertChild(n, p, x1, y1, x2, y2);\n }\n }", "function insert(n, p, x1, y1, x2, y2) {\n if (isNaN(p.x) || isNaN(p.y)) return; // ignore invalid points\n if (n.leaf) {\n var v = n.point;\n if (v) {\n // If the point at this leaf node is at the same position as the new\n // point we are adding, we leave the point associated with the\n // internal node while adding the new point to a child node. This\n // avoids infinite recursion.\n if ((Math.abs(v.x - p.x) + Math.abs(v.y - p.y)) < .01) {\n insertChild(n, p, x1, y1, x2, y2);\n } else {\n n.point = null;\n insertChild(n, v, x1, y1, x2, y2);\n insertChild(n, p, x1, y1, x2, y2);\n }\n } else {\n n.point = p;\n }\n } else {\n insertChild(n, p, x1, y1, x2, y2);\n }\n }", "setPosition(x, y) {\n this.x = x\n this.y = y\n }", "insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }", "setPosition(position) {\n this.position = position;\n }", "insert(element, position) {\n // check for out-of-bounds values\n if(index >= 0 && index <= this.count) { \n const node = new Node(element);\n // change the head reference to node and add a new element to the list\n if(index === 0) { \n node.next = current; \n this.head = node;\n // to loop through the list until the desired position\n } else {\n const previous = this.getElementAt(index - 1);\n node.next = previous.next; // to link the new node and the current\n previous.next = node; \n }\n this.count++;\n return true;\n }\n return false;\n }", "insertCell(x, y) {\n this.root.insert(x, y);\n }", "function ParticleRotateToPositionNode(mode /*uint*/, position) {\n if (position === void 0) { position = null; }\n _super.call(this, \"ParticleRotateToPosition\", mode, 3, 3);\n this._pStateClass = ParticleRotateToPositionState;\n this._iPosition = position || new Vector3D();\n }", "function addNode() {\r\n\t\t\t\t\t\t\t// removeId(root);\r\n\r\n\t\t\t\t\t\t\tvar newNode = {};\r\n\t\t\t\t\t\t\tnewNode.name = \"Node\"\r\n\t\t\t\t\t\t\t\t\t+ Math.floor((Math.random() * 100) + 1);\r\n\t\t\t\t\t\t\tnewNode.VALUE = 100;\r\n\t\t\t\t\t\t\tvar component = root[\"children\"]; // considering\r\n\t\t\t\t\t\t\t// component\r\n\t\t\t\t\t\t\t// node to add\r\n\t\t\t\t\t\t\t// new nodes as\r\n\t\t\t\t\t\t\t// a test.\r\n\t\t\t\t\t\t\tcomponent.push(newNode);\r\n\t\t\t\t\t\t\tgeneratedNodesIdx.push(component.length - 1);// tracking\r\n\t\t\t\t\t\t\t// newly\r\n\t\t\t\t\t\t\t// generated\r\n\t\t\t\t\t\t\t// nodes\r\n\t\t\t\t\t\t\t// to\r\n\t\t\t\t\t\t\t// remove\r\n\t\t\t\t\t\t\tupdate();\r\n\t\t\t\t\t\t}", "setPosition(x, y) {\n this.x = x;\n this.y = y;\n }", "function updatePosition() {\r\n\t\t\tcircle.attr('transform', `translate(${point.x * graph.cell_size + graph.offset.x} ${point.y * graph.cell_size + graph.offset.y})`);\r\n\t\t}" ]
[ "0.658252", "0.6516254", "0.6485225", "0.6460037", "0.6390183", "0.6232858", "0.62273777", "0.61630327", "0.61246794", "0.6046579", "0.6042932", "0.59990585", "0.5977073", "0.59656715", "0.59656715", "0.59656715", "0.59656715", "0.59656715", "0.5927004", "0.5904087", "0.5901326", "0.5862122", "0.5837494", "0.5818516", "0.5809244", "0.5798123", "0.57735884", "0.5773387", "0.57725775", "0.5767759", "0.5730544", "0.57184005", "0.57085234", "0.56811124", "0.566903", "0.5663585", "0.56635445", "0.5659751", "0.5659738", "0.56525177", "0.5603281", "0.5602016", "0.56009126", "0.5599812", "0.55939066", "0.5590976", "0.557026", "0.5556393", "0.55522", "0.5531865", "0.5527891", "0.55262816", "0.550683", "0.550278", "0.5494469", "0.5493419", "0.5480834", "0.5473686", "0.5461298", "0.54611135", "0.5454388", "0.5453217", "0.54523706", "0.54464793", "0.54393375", "0.54393375", "0.54393375", "0.54393375", "0.54393375", "0.54393375", "0.54354423", "0.54287136", "0.5427799", "0.54218966", "0.5409817", "0.53885686", "0.53885686", "0.53885686", "0.53885686", "0.53885686", "0.53767854", "0.5372445", "0.536574", "0.5362778", "0.53599876", "0.5356583", "0.535652", "0.53555924", "0.53555924", "0.53509176", "0.53481823", "0.53481823", "0.5344199", "0.5330284", "0.53295624", "0.5325118", "0.5307119", "0.5300672", "0.52838975", "0.5283219", "0.5277242" ]
0.0
-1
Add `node` to `parent`s children or to `tokens`. Performs merges where possible.
function add(node, parent) { var children = parent ? parent.children : tokens; var prev = children[children.length - 1]; if ( prev && node.type === prev.type && node.type in MERGEABLE_NODES && mergeable(prev) && mergeable(node) ) { node = MERGEABLE_NODES[node.type].call(self, prev, node); } if (node !== prev) { children.push(node); } if (self.atStart && tokens.length !== 0) { self.exitStart(); } return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }", "function add (node, parent) {\n parent.children.push(node)\n if (parser.position) {\n parent.position = {\n start: parent.children[0].position.start,\n end: node.position.end\n }\n }\n }", "function mutation_append(node, parent) {\n /**\n * To append a node to a parent, pre-insert node into parent before null.\n */\n return mutation_preInsert(node, parent, null);\n}", "function union(nodeA, nodeB, parent) {\n let parentA = findParent(nodeA, parent);\n let parentB = findParent(nodeB, parent);\n parent[parentB] = parentA;\n}", "function addNodes(parent, nodes) {\n return nodes ? { ...parent, nodes } : parent;\n }", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }", "appendToTree(Node) {\n this.tree = {...this.tree, ...Node};\n }", "function addNode(parent_id, node_data, user, done) {\n\n Node.findById(parent_id, function (error, parent_node) {\n if (error) {\n return done(error);\n }\n\n if (!parent_node) {\n return done('This parent node doesn\\'t exist');\n }\n\n // Assign task ID.\n // Task IDs are incremental, prefixed by parent task IDs.\n var taskId = 1;\n if (typeof parent_node.last_task_id !== 'undefined') {\n taskId = parent_node.last_task_id + 1;\n }\n\n var node = new Node({\n title: node_data.title,\n user: user._id,\n _parent: parent_node._id,\n level: parent_node.level + 1,\n path: (parent_node.path) ? (parent_node.path + ',' + parent_node._id) : parent_node._id,\n _project: parent_node._project,\n task_id: parent_node.task_id + '.' + taskId,\n });\n\n // Save the last task ID.\n parent_node.set('last_task_id', taskId);\n parent_node.save();\n\n node.save(function (error) {\n if (error) {\n return done(error);\n }\n\n parent_node._nodes.unshift(node._id);\n parent_node.save(function (err) {});\n\n done(null, node, parent_node);\n\n });\n });\n}", "function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }", "function appendNode(parent, node) {\n\n // Handle the replacement based on the type\n if (isElement(node) == true)\n parent.appendChild(node);\n else {\n var el = document.createElement(\"div\");\n el.innerHTML = node;\n\n var nodes = [];\n\n // Populate the nodes\n for (var i = 0; i < el.childNodes.length; i++)\n nodes.push(el.childNodes[i]);\n\n // Insert all the nodes\n for (i = 0; i < nodes.length; i++)\n parent.appendChild(nodes[i]);\n\n }\n\n // Return\n return;\n\n }", "shiftNodeUp(node) {\n\n\t\tif (node.parent == null) {\n\t\t\tthis.root = node;\n\t\t\treturn;\n\t\t}\n\n\t\tif (node.priority <= node.parent.priority) {\n\t\t\treturn;\n\n\t\t} else if (this.parentNodes.length != 0) {\n\t\t\tvar indexOfNode = this.parentNodes.indexOf (node);\n\t\t\tvar indexOfNodeParent = this.parentNodes.indexOf (node.parent);\n\t\t\tif ( indexOfNode != -1) {\n\t\t\t\tthis.parentNodes[indexOfNode] = node.parent;\n\t\t\t\tif (indexOfNodeParent != -1) {\n\t\t\t\t\tthis.parentNodes[indexOfNodeParent] = node;\n\t\t\t\t}\t\n\t\t\t}\t\n\n\t\tif (this.root == node.parent) { \n\t\t\tthis.root = node; \n\t\t}\n\n\t\tnode.swapWithParent ();\n\t\tthis.shiftNodeUp(node);\n\t\t} \t\n\t}", "function walkAddParent(ast, fn) {\n let stack = [ast], i, j, key, len, node, child, subchild;\n for (i = 0; i < stack.length; i += 1) {\n node = stack[i];\n fn(node);\n for (key in node) {\n if (key !== 'parent' && key.substr(0, 3) != 'fp_') {\n child = node[key];\n if (child instanceof Array) {\n for (j = 0, len = child.length; j < len; j += 1) {\n subchild = child[j];\n if (subchild instanceof Object) {\n subchild.parent = node;\n }\n stack.push(subchild);\n }\n }\n else if (child != void 0 && typeof child.type === 'string') {\n child.parent = node;\n stack.push(child);\n }\n }\n }\n }\n}", "addSibling(node){\r\n\t\tif(this.parent != null){\r\n\t\t\tvar childrenList = this.parent.children;\r\n\t\t\tchildrenList[childrenList.length] = node;\r\n\t\t\tnode.parent = this.parent;\r\n\t\t}\r\n\t}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "addParent(node, parent) {\n // implement by subclass\n }", "function mergeBlockquote(previous, node) {\n if (this.options.commonmark || this.options.gfm) {\n return node\n }\n\n previous.children = previous.children.concat(node.children)\n\n return previous\n}", "mergeToRight(leftNode, rightNode) {\n if (!leftNode.empty()) {\n\n let rightNodeFirstLeftChildOldValue = rightNode.first().leftChild;\n rightNode.first().leftChild = leftNode.getRightmostChild();\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.first().leftChild = rightNodeFirstLeftChildOldValue;\n }\n );\n\n if (rightNode.hasLeftmostChild()) {\n let rightNodeFirstLeftChildParentOldValue = rightNode.first().leftChild.parent;\n rightNode.first().leftChild.parent = rightNode;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.first().leftChild.parent = rightNodeFirstLeftChildParentOldValue;\n }\n );\n }\n while (!leftNode.empty()) {\n let leftNodeElement = leftNode.popLast();\n this.addAtLastIndexOfCallStack(\n this.undoPopLast.bind(this, leftNodeElement, leftNode)\n );\n\n rightNode.addFirst(leftNodeElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddFirst.bind(this, rightNode)\n );\n\n if (rightNode.first().leftChild !== null) {\n let rightNodeFirstLeftChildParentOldValue = rightNode.first().leftChild.parent;\n rightNode.first().leftChild.parent = rightNode;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.first().leftChild.parent = rightNodeFirstLeftChildParentOldValue;\n }\n );\n }\n if (rightNode.first().rightChild !== null) {\n let rightNodeFirstRightChildParentOldValue = rightNode.first().rightChild.parent;\n rightNode.first().rightChild.parent = rightNode;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.first().rightChild.parent = rightNodeFirstRightChildParentOldValue;\n }\n );\n }\n }\n }\n\n let leftNodeParentOldValue = leftNode.parent;\n leftNode.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.parent = leftNodeParentOldValue;\n }\n )\n\n let leftNodeOldValue = leftNode;\n leftNode = null;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode = leftNodeOldValue;\n }\n );\n\n }", "function merge(target, source) {\n target.additionalNodes = target.additionalNodes || [];\n target.additionalNodes.push(source.node);\n if (source.additionalNodes) {\n (_a = target.additionalNodes).push.apply(_a, source.additionalNodes);\n }\n target.children = ts.concatenate(target.children, source.children);\n if (target.children) {\n mergeChildren(target.children);\n sortChildren(target.children);\n }\n var _a;\n }", "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 }", "function _insertBefore(parent, node, refNode) {\n\t\tparent.insertBefore(node, refNode);\n\t}", "function mutation_replaceAll(node, parent) {\n /**\n * 1. If node is not null, adopt node into parent’s node document.\n */\n if (node !== null) {\n DocumentAlgorithm_1.document_adopt(node, parent._nodeDocument);\n }\n /**\n * 2. Let removedNodes be parent’s children.\n */\n const removedNodes = Array.from(parent._children);\n /**\n * 3. Let addedNodes be the empty list.\n * 4. If node is DocumentFragment node, then set addedNodes to node’s\n * children.\n * 5. Otherwise, if node is non-null, set addedNodes to [node].\n */\n let addedNodes = [];\n if (node && node._nodeType === interfaces_1.NodeType.DocumentFragment) {\n addedNodes = Array.from(node._children);\n }\n else if (node !== null) {\n addedNodes.push(node);\n }\n /**\n * 6. Remove all parent’s children, in tree order, with the suppress\n * observers flag set.\n */\n for (const childNode of removedNodes) {\n mutation_remove(childNode, parent, true);\n }\n /**\n * 7. If node is not null, then insert node into parent before null with the\n * suppress observers flag set.\n */\n if (node !== null) {\n mutation_insert(node, parent, null, true);\n }\n /**\n * 8. Queue a tree mutation record for parent with addedNodes, removedNodes,\n * null, and null.\n */\n if (dom_1.dom.features.mutationObservers) {\n MutationObserverAlgorithm_1.observer_queueTreeMutationRecord(parent, addedNodes, removedNodes, null, null);\n }\n}", "add_node(parent, child) {\n if (!this._is_node(parent)) {\n console.error(\"[ERROR] can't add a data that is not a node : 'parent' is not a node\")\n }\n if (!this._is_node(child)) {\n console.error(\"[ERROR] can't add a data that is not a node : 'child' is not a node\")\n }\n\n if (this._id_set.includes(child.id)) {\n console.error(\"[ERROR] id '\" + child.id + \"' already exist in the tree\");\n return;\n }\n\n if (typeof child.parent_node !== 'undefined') {\n console.error(\"[ERROR] can't add a node that has a parent : 'child' already has a parent\");\n return;\n }\n\n child.parent_node = parent;\n parent.child_list.push(child);\n this._id_set.push(child.id);\n }", "process(node) {\n let parent = this.parentPrefix(node)\n\n for (let prefix of this.prefixes) {\n if (!parent || parent === prefix) {\n this.add(node, prefix)\n }\n }\n }", "mergeToLeft(leftNode, rightNode) {\n if (!rightNode.empty()) {\n let leftNodeLastRightChildOldValue = leftNode.last().rightChild;\n leftNode.last().rightChild = rightNode.getLeftmostChild();\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild = leftNodeLastRightChildOldValue;\n }\n )\n if (leftNode.hasRightmostChild()) {\n let leftNodeLastRightChildParentOldValue = leftNode.last().rightChild.parent;\n leftNode.last().rightChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild.parent = leftNodeLastRightChildParentOldValue;\n }\n );\n }\n while (!rightNode.empty()) {\n let rightNodeElement = rightNode.popFirst();\n this.addAtLastIndexOfCallStack(\n this.undoPopFirst.bind(this, rightNodeElement, rightNode)\n );\n leftNode.addLast(rightNodeElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, leftNode)\n )\n if (leftNode.last().leftChild != null) {\n let leftNodeLastLeftChildParentOldValue = leftNode.last().leftChild.parent;\n leftNode.last().leftChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().leftChild.parent = leftNodeLastLeftChildParentOldValue;\n }\n )\n }\n if (leftNode.last().rightChild != null) {\n let leftNodeLastRightChildParentOldValue = leftNode.last().rightChild.parent;\n leftNode.last().rightChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild.parent = leftNodeLastRightChildParentOldValue\n }\n );\n }\n }\n }\n\n let rightNodeParentOldValue = rightNode.parent;\n rightNode.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.parent = rightNodeParentOldValue;\n }\n );\n\n let rightNodeOldValue = rightNode;\n rightNode = null;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode = rightNodeOldValue;\n }\n );\n }", "liftUp(node, parentIndex, side) {\n let parentElement = node.popAt(Math.floor(this.base / 2));\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, parentElement, node, Math.floor(this.base / 2))\n );\n let newNode = this.split(node);\n\n if (!node.hasParent()) {\n node.parent = new BNode();\n let nodeParentIsLeafOldValue = node.parent.isLeaf;\n node.parent.isLeaf = false;\n this.addAtLastIndexOfCallStack(() => {\n node.parent.isLeaf = nodeParentIsLeafOldValue;\n });\n }\n\n if (this.root === node) {\n let rootOldValue = this.root;\n this.root = node.parent;\n this.addAtLastIndexOfCallStack(() => {\n this.root = rootOldValue\n });\n }\n\n let newNodeParentOldValue = newNode.parent;\n newNode.parent = node.parent;\n this.addAtLastIndexOfCallStack(() => {\n newNode.parent = newNodeParentOldValue;\n });\n\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = node;\n this.addAtLastIndexOfCallStack(() => {\n parentElement.leftChild = parentElementLeftChildOldValue\n });\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = newNode;\n this.addAtLastIndexOfCallStack(() => {\n parentElement.rightChild = parentElementRightChildOldValue;\n });\n\n if (node.parent.empty() || (parentIndex === node.parent.size() - 1 && side === true)) {\n node.parent.addLast(parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, node.parent)\n );\n } else {\n if (node.parent.hasLeftChildAt(parentIndex)) {\n let nodeParentAtLeftChildOldValue = node.parent.at(parentIndex).leftChild;\n node.parent.at(parentIndex).leftChild = parentElement.rightChild;\n this.addAtLastIndexOfCallStack(() => {\n node.parent.at(parentIndex).leftChild = nodeParentAtLeftChildOldValue;\n });\n }\n\n if (node.parent.hasRightChildAt(parentIndex - 1)) {\n let nodeParentAtRightChildOldValue = node.parent.at(parentIndex - 1).rightChild;\n node.parent.at(parentIndex - 1).rightChild = parentElement.leftChild;\n this.addAtLastIndexOfCallStack(() => {\n node.parent.at(parentIndex - 1).rightChild = nodeParentAtRightChildOldValue;\n });\n }\n\n node.parent.addAt(parentIndex, parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddAt.bind(this, node.parent, parentIndex)\n );\n }\n\n let nodeParentIsLeafOldValue = node.parent.isLeaf;\n node.parent.isLeaf = false;\n this.addAtLastIndexOfCallStack(() => {\n node.parent.isLeaf = nodeParentIsLeafOldValue;\n })\n }", "function addChildNode(child, node, sourceFile, appId) {\n var childType = child.type;\n if (child.type === \"Literal\") {\n if (child.value != undefined && typeof child.value === 'string') {\n childType = \"StringLiteral\";\n }\n else if (child.value != undefined && typeof child.value === 'number') {\n childType = \"NumberLiteral\";\n }\n else if (child.value != undefined && typeof child.value == 'boolean') {\n childType = \"BooleanLiteral\";\n }\n }\n\n var hasLoc = (child.loc != undefined), lineNumber, columnNumber;\n if (hasLoc) {\n lineNumber = child.loc.start.line;\n columnNumber = child.loc.start.column;\n }\n\n //Add this in the childNodes array of the current node\n var newCodeTreeNode = new CodeTreeNode(\"ast\", childType, node.codetreeref, sourceFile, appId);\n if (child.type === \"Literal\") newCodeTreeNode.abstractOut();\n if (hasLoc) newCodeTreeNode.addLoc(lineNumber, columnNumber);\n node.codetreeref.addChild(newCodeTreeNode);\n child.codetreeref = newCodeTreeNode;\n\n //Add values if necessary\n if (child.type === \"Literal\" && child.raw != undefined) {\n var newLiteralNode = new CodeTreeNode(\"ast\", \"\" + child.raw, newCodeTreeNode, sourceFile, appId);\n if (hasLoc) newLiteralNode.addLoc(lineNumber, columnNumber);\n newLiteralNode.abstractOut();\n newCodeTreeNode.addChild(newLiteralNode);\n }\n else if (child.type === \"Identifier\" && child.name != undefined) {\n var newNameNode = new CodeTreeNode(\"ast\", child.name, newCodeTreeNode, sourceFile, appId);\n if (hasLoc) newNameNode.addLoc(lineNumber, columnNumber);\n newNameNode.abstractOut();\n newCodeTreeNode.addChild(newNameNode);\n }\n else if (child.type === \"BinaryExpression\" || child.type === \"UpdateExpression\" || child.type === \"UnaryExpression\") {\n if (child.operator != undefined) {\n var newOperatorNode = new CodeTreeNode(\"ast\", child.operator, newCodeTreeNode, \n sourceFile, appId);\n if (hasLoc) newOperatorNode.addLoc(lineNumber, columnNumber);\n newCodeTreeNode.addChild(newOperatorNode);\n }\n if (child.prefix != undefined) {\n var newPrefixNode = new CodeTreeNode(\"ast\", child.prefix + \"\", newCodeTreeNode, \n sourceFile, appId);\n if (hasLoc) newPrefixNode.addLoc(lineNumber, columnNumber);\n newCodeTreeNode.addChild(newPrefixNode);\n }\n }\n }", "function addToTree(parent, current, userquestion, userans) {\n var newnode = {Q: userquestion, Y: userans, N: current};\n // replace the guess in the parent node\n if( current == parent.Y ) {\n parent.Y = newnode;\n } else if (current == parent.N) {\n parent.N = newnode;\n } else {\n throw new Error(\"this shouldn't happen\");\n }\n}", "add(node) {\n if (this.left === null) {\n this.left = node;\n return this.left;\n } else if (this.right === null) {\n this.right = node;\n return this.right;\n }\n return null;\n }", "merge(tree) {\n let arr = tree.toArray();\n for(let i=0; i<arr.length; i++) {\n this.add(arr[i]);\n }\n }", "function setParent(node) {\n if ('children' in node) {\n for (var index in node.children) {\n node.children[index].parent = node;\n setParent(node.children[index]);\n }\n }\n }", "function mutation_preInsert(node, parent, child) {\n /**\n * 1. Ensure pre-insertion validity of node into parent before child.\n * 2. Let reference child be child.\n * 3. If reference child is node, set it to node’s next sibling.\n * 4. Adopt node into parent’s node document.\n * 5. Insert node into parent before reference child.\n * 6. Return node.\n */\n mutation_ensurePreInsertionValidity(node, parent, child);\n let referenceChild = child;\n if (referenceChild === node)\n referenceChild = node._nextSibling;\n DocumentAlgorithm_1.document_adopt(node, parent._nodeDocument);\n mutation_insert(node, parent, referenceChild);\n return node;\n}", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "insertNode(node, newNode) {\n // Handle case where value is less than parent, GO LEFT\n if (newNode.data < node.data) {\n // Check if we can place node\n if (node.left === null) {\n // Place node\n node.left = newNode;\n // Otherwise use recursion to do the same process over again\n // until we find a null position to put the node\n } else this.insertNode(node.left, newNode);\n } else {\n // Handle case where value is grater than parent, GO RIGHT\n if (node.right === null) {\n node.right = newNode;\n } else this.insertNode(node.right, newNode);\n }\n }", "function addParentLinks(tree, parent) {\n if (!tree) {\n return;\n }\n tree.parent = parent;\n addParentLinks(tree.left, tree);\n addParentLinks(tree.right, tree);\n}", "function insertRight(parent, node) {\n\tvar index = parent.length - 1;\n\tparent[index] = node;\n\tparent.sizes[index] = (0, _util.length)(node) + (index > 0 ? parent.sizes[index - 1] : 0);\n}", "function addNode(token, docId, child) {\n\t\tvar getter = me.store.get(token);\n\t\t\n\t\tgetter.onsuccess = function(evt) {\n\t\t\tvar node = evt.target.result || { prefix: token };\n\t\t\tvar insert = false;\n\t\t\t\n\t\t\tif (child) {\n\t\t\t\t// It’s an internal node!\n\t\t\t\t// Children: Characters that could follow\n\t\t\t\tnode.children = node.children || [];\n\t\t\t\t\n\t\t\t\tif (node.children.indexOf(child) === -1) {\n\t\t\t\t\tnode.children.push(child);\n\t\t\t\t\tinsert = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// DocIds: Documents that contain this word *as a whole token*\n\t\t\t\t// Notice that the same document cannot add both docIds and\n\t\t\t\t// children to the same node, by definition of what these are.\n\t\t\t\tnode.docIds = node.docIds || [];\n\t\t\t\t\n\t\t\t\tif (node.docIds.indexOf(docId) === -1) {\n\t\t\t\t\tnode.docIds.push(docId);\n\t\t\t\t\tinsert = true;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tif (insert) {\n\t\t\t\tvar insertion = me.store.put(node);\n\t\t\t\t\n\t\t\t\t// TODO retry or something\n\t\t\t\tinsertion.onerror = me.onerror;\n\t\t\t}\n\t\t};\n\t\t\n\t\tgetter.onerror = me.onerror;\n\t}", "function visit(node) {\r\n if (visited.has(node)) {\r\n return;\r\n }\r\n visited.add(node);\r\n var children = graph.get(node);\r\n if (children) {\r\n children.forEach(visit);\r\n }\r\n sorted.push(node);\r\n }", "add(data, parentNode) {\n let node = new Node(data);\n parentNode = parentNode ? this.contains(parentNode) : null;\n\n if (parentNode) {\n parentNode.children.push(node);\n }\n else if (!this.root) {\n this.root = node;\n }\n else {\n return 'There is no parent node in the tree';\n }\n }", "function insert(parent, elm, ref) {\n if (isDef(parent)) {\n if (isDef(ref)) {\n if (nodeOps.parentNode(ref) === parent) {\n nodeOps.insertBefore(parent, elm, ref);\n }\n }\n else {\n nodeOps.appendChild(parent, elm);\n }\n }\n }", "function addChild(child, node) {\n\t var children = node.children;\n\t\n\t if (child.parentNode === node) {\n\t return;\n\t }\n\t\n\t children.push(child);\n\t child.parentNode = node;\n\t }", "function addChild(child, node) {\n var children = node.children;\n\n if (child.parentNode === node) {\n return;\n }\n\n children.push(child);\n child.parentNode = node;\n}", "propagateDownFromLeft(node, parentPos, leftSibling) {\n let parentElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, parentElement, node.parent, parentPos)\n );\n if (node.parent.hasRightChildAt(parentPos - 1)) {\n let nodeParentAtRightChildOldValue = node.parent.at(parentPos - 1).rightChild;\n node.parent.at(parentPos - 1).rightChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent.at(parentPos - 1).rightChild = nodeParentAtRightChildOldValue;\n }\n );\n }\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = null;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n )\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = node.hasLeftmostChild() ? node.getLeftmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue;\n }\n )\n\n node.addFirst(parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddFirst.bind(this, node)\n );\n\n let nodeIsLeafOldValue = node.isLeaf;\n node.isLeaf = node.isLeaf && leftSibling.isLeaf;\n this.addAtLastIndexOfCallStack(\n () => {\n node.isLeaf = nodeIsLeafOldValue;\n }\n );\n\n this.mergeToRight(leftSibling, node);\n if (node.parent === this.root && this.root.size() === 0) {\n let rootOldValue = this.root;\n this.root = node;\n this.addAtLastIndexOfCallStack(\n () => {\n this.root = rootOldValue;\n }\n );\n\n let nodeParentOldValue = node.parent;\n node.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent = nodeParentOldValue;\n }\n )\n }\n }", "function processNode(node){\n processChild(node);\n for( i in node.children )\n processNode(node.children[i]);\n }", "function mergeText(previous, node) {\n previous.value += node.value\n\n return previous\n}", "setLeftAndUpdateParent(node) {\n this.left = node;\n if (node) {\n node.parent = this;\n node.parentSide = LEFT;\n }\n }", "mergeNodes(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n match,\n at = editor.selection\n } = options;\n var {\n hanging = false,\n voids = false,\n mode = 'lowest'\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = n => Editor.isBlock(editor, n);\n }\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n if (Range.isRange(at)) {\n if (Range.isCollapsed(at)) {\n at = at.anchor;\n } else {\n var [, end] = Range.edges(at);\n var pointRef = Editor.pointRef(editor, end);\n Transforms.delete(editor, {\n at\n });\n at = pointRef.unref();\n\n if (options.at == null) {\n Transforms.select(editor, at);\n }\n }\n }\n\n var [current] = Editor.nodes(editor, {\n at,\n match,\n voids,\n mode\n });\n var prev = Editor.previous(editor, {\n at,\n match,\n voids,\n mode\n });\n\n if (!current || !prev) {\n return;\n }\n\n var [node, path] = current;\n var [prevNode, prevPath] = prev;\n\n if (path.length === 0 || prevPath.length === 0) {\n return;\n }\n\n var newPath = Path.next(prevPath);\n var commonPath = Path.common(path, prevPath);\n var isPreviousSibling = Path.isSibling(path, prevPath);\n var levels = Array.from(Editor.levels(editor, {\n at: path\n }), _ref2 => {\n var [n] = _ref2;\n return n;\n }).slice(commonPath.length).slice(0, -1); // Determine if the merge will leave an ancestor of the path empty as a\n // result, in which case we'll want to remove it after merging.\n\n var emptyAncestor = Editor.above(editor, {\n at: path,\n mode: 'highest',\n match: n => levels.includes(n) && hasSingleChildNest(editor, n)\n });\n var emptyRef = emptyAncestor && Editor.pathRef(editor, emptyAncestor[1]);\n var properties;\n var position; // Ensure that the nodes are equivalent, and figure out what the position\n // and extra properties of the merge will be.\n\n if (Text.isText(node) && Text.isText(prevNode)) {\n var rest = _objectWithoutProperties(node, _excluded);\n\n position = prevNode.text.length;\n properties = rest;\n } else if (Element.isElement(node) && Element.isElement(prevNode)) {\n var rest = _objectWithoutProperties(node, _excluded2);\n\n position = prevNode.children.length;\n properties = rest;\n } else {\n throw new Error(\"Cannot merge the node at path [\".concat(path, \"] with the previous sibling because it is not the same kind: \").concat(JSON.stringify(node), \" \").concat(JSON.stringify(prevNode)));\n } // If the node isn't already the next sibling of the previous node, move\n // it so that it is before merging.\n\n\n if (!isPreviousSibling) {\n Transforms.moveNodes(editor, {\n at: path,\n to: newPath,\n voids\n });\n } // If there was going to be an empty ancestor of the node that was merged,\n // we remove it from the tree.\n\n\n if (emptyRef) {\n Transforms.removeNodes(editor, {\n at: emptyRef.current,\n voids\n });\n } // If the target node that we're merging with is empty, remove it instead\n // of merging the two. This is a common rich text editor behavior to\n // prevent losing formatting when deleting entire nodes when you have a\n // hanging selection.\n // if prevNode is first child in parent,don't remove it.\n\n\n if (Element.isElement(prevNode) && Editor.isEmpty(editor, prevNode) || Text.isText(prevNode) && prevNode.text === '' && prevPath[prevPath.length - 1] !== 0) {\n Transforms.removeNodes(editor, {\n at: prevPath,\n voids\n });\n } else {\n editor.apply({\n type: 'merge_node',\n path: newPath,\n position,\n properties\n });\n }\n\n if (emptyRef) {\n emptyRef.unref();\n }\n });\n }", "mergeNodes(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n match,\n at = editor.selection\n } = options;\n var {\n hanging = false,\n voids = false,\n mode = 'lowest'\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n if (Path.isPath(at)) {\n var [parent] = Editor.parent(editor, at);\n\n match = n => parent.children.includes(n);\n } else {\n match = n => Editor.isBlock(editor, n);\n }\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n if (Range.isRange(at)) {\n if (Range.isCollapsed(at)) {\n at = at.anchor;\n } else {\n var [, end] = Range.edges(at);\n var pointRef = Editor.pointRef(editor, end);\n Transforms.delete(editor, {\n at\n });\n at = pointRef.unref();\n\n if (options.at == null) {\n Transforms.select(editor, at);\n }\n }\n }\n\n var [current] = Editor.nodes(editor, {\n at,\n match,\n voids,\n mode\n });\n var prev = Editor.previous(editor, {\n at,\n match,\n voids,\n mode\n });\n\n if (!current || !prev) {\n return;\n }\n\n var [node, path] = current;\n var [prevNode, prevPath] = prev;\n\n if (path.length === 0 || prevPath.length === 0) {\n return;\n }\n\n var newPath = Path.next(prevPath);\n var commonPath = Path.common(path, prevPath);\n var isPreviousSibling = Path.isSibling(path, prevPath);\n var levels = Array.from(Editor.levels(editor, {\n at: path\n }), (_ref2) => {\n var [n] = _ref2;\n return n;\n }).slice(commonPath.length).slice(0, -1); // Determine if the merge will leave an ancestor of the path empty as a\n // result, in which case we'll want to remove it after merging.\n\n var emptyAncestor = Editor.above(editor, {\n at: path,\n mode: 'highest',\n match: n => levels.includes(n) && Element.isElement(n) && n.children.length === 1\n });\n var emptyRef = emptyAncestor && Editor.pathRef(editor, emptyAncestor[1]);\n var properties;\n var position; // Ensure that the nodes are equivalent, and figure out what the position\n // and extra properties of the merge will be.\n\n if (Text.isText(node) && Text.isText(prevNode)) {\n var rest = _objectWithoutProperties(node, [\"text\"]);\n\n position = prevNode.text.length;\n properties = rest;\n } else if (Element.isElement(node) && Element.isElement(prevNode)) {\n var rest = _objectWithoutProperties(node, [\"children\"]);\n\n position = prevNode.children.length;\n properties = rest;\n } else {\n throw new Error(\"Cannot merge the node at path [\".concat(path, \"] with the previous sibling because it is not the same kind: \").concat(JSON.stringify(node), \" \").concat(JSON.stringify(prevNode)));\n } // If the node isn't already the next sibling of the previous node, move\n // it so that it is before merging.\n\n\n if (!isPreviousSibling) {\n Transforms.moveNodes(editor, {\n at: path,\n to: newPath,\n voids\n });\n } // If there was going to be an empty ancestor of the node that was merged,\n // we remove it from the tree.\n\n\n if (emptyRef) {\n Transforms.removeNodes(editor, {\n at: emptyRef.current,\n voids\n });\n } // If the target node that we're merging with is empty, remove it instead\n // of merging the two. This is a common rich text editor behavior to\n // prevent losing formatting when deleting entire nodes when you have a\n // hanging selection.\n\n\n if (Element.isElement(prevNode) && Editor.isEmpty(editor, prevNode) || Text.isText(prevNode) && prevNode.text === '') {\n Transforms.removeNodes(editor, {\n at: prevPath,\n voids\n });\n } else {\n editor.apply({\n type: 'merge_node',\n path: newPath,\n position,\n properties\n });\n }\n\n if (emptyRef) {\n emptyRef.unref();\n }\n });\n }", "insertNode(node, new_node) {\n // if the data is less than the node\n // data move left of the tree\n if (new_node.data < node.data) {\n if (node.left === null) {\n node.left = new_node;\n } else {\n //if left id not null\n //recurse until null is found\n this.insertNode(node.left, new_node);\n }\n } else {\n // if right is null insert node here\n if (node.right === null) {\n node.right = new_node;\n } else {\n //if right is not null\n //recurse until null is found\n this.insertNode(node.right, new_node);\n }\n }\n }", "function populate_parent(astroot) {\n\n function visit(node, parent) {\n if (!node || typeof node.type !== \"string\") {\n return;\n }\n\n for ( var prop in node) {\n if (node.hasOwnProperty(prop)) {\n\n // skip cyclic reference\n // at least for try-statement\n if (prop === '__parent__') {\n continue;\n }\n\n var child = node[prop];\n if (Array.isArray(child)) {\n for (var i = 0; i < child.length; i++) {\n visit(child[i], node);\n }\n }\n else {\n visit(child, node);\n }\n }\n }\n\n // must be post\n node.__parent__ = parent;\n }\n visit(astroot, null);\n}", "function addNode(node, path){\n if ( node.name.indexOf('.') === 0 || path.indexOf('/.') >= 0){ // ignore hidden files\n return;\n }\n var relativePath = path.replace(root,'');\n\n node.path = relativePath + '/' + node.name;\n nodesMap[node.path] = node;\n\n if ( relativePath.length === 0 ){ //is root\n tree.push(node);\n return;\n }\n node.parentPath = node.path.substring(0,node.path.lastIndexOf('/'));\n const parent = nodesMap[node.parentPath];\n parent.children.push(node);\n\n }", "propagateDownFromRight(node, parentPos, rightSibling) {\n let parentElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, parentElement, node.parent, parentPos)\n );\n\n if (node.parent.hasLeftChildAt(parentPos)) {\n let nodeParentAtLeftChildOldValue = node.parent.at(parentPos).leftChild;\n node.parent.at(parentPos).leftChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent.at(parentPos).leftChild = nodeParentAtLeftChildOldValue;\n }\n )\n }\n\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = node.hasRightmostChild() ? node.getRightmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n );\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = null;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue;\n }\n );\n\n node.addLast(parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, node)\n );\n\n let nodeIsLeafOldValue = node.isLeaf;\n node.isLeaf = node.isLeaf && rightSibling.isLeaf;\n this.addAtLastIndexOfCallStack(\n () => {\n node.isLeaf = nodeIsLeafOldValue;\n }\n );\n\n this.mergeToLeft(node, rightSibling);\n\n\n if (node.parent === this.root && this.root.size() === 0) {\n let rootOldValue = this.root;\n this.root = node;\n this.addAtLastIndexOfCallStack(\n () => {\n this.root = rootOldValue;\n }\n )\n\n let nodeParentOldValue = node.parent;\n node.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent = nodeParentOldValue;\n }\n );\n }\n }", "function appendBuiltContent (ancestorBranches, key, node) {\n Object(__WEBPACK_IMPORTED_MODULE_1__ascent__[\"c\" /* nodeOf */])(Object(__WEBPACK_IMPORTED_MODULE_3__lists__[\"g\" /* head */])(ancestorBranches))[key] = node\n }", "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 }", "function append(node, item, offset) {\n\n\t\titem.offset = ++offset;\n\t\tsiblingIndex.add(item);\n\t\tnode.children.push(item);\n\t\titem.parent = node;\n\t\titem.id = id++;\n\t\ttree.push(item);\n\n\t}", "function recursiveAdd(node) {\n // node.depth = depth;\n if (node.data.name !== 'ROOT') {\n descendants.push(node);\n }\n if (node.children) {\n node.children.forEach(d => recursiveAdd(d));\n }\n }", "setRightAndUpdateParent(node) {\n this.right = node;\n if (node) {\n node.parent = this;\n node.parentSide = RIGHT;\n }\n }", "function insert(node, parent, tight) {\n var children = parent.children\n var length = children.length\n var last = children[length - 1]\n var isLoose = false\n var index\n var item\n\n if (node.depth === 1) {\n item = listItem()\n\n item.children.push({\n type: PARAGRAPH,\n children: [\n {\n type: LINK,\n title: null,\n url: '#' + node.id,\n children: [{type: TEXT, value: node.value}]\n }\n ]\n })\n\n children.push(item)\n } else if (last && last.type === LIST_ITEM) {\n insert(node, last, tight)\n } else if (last && last.type === LIST) {\n node.depth--\n\n insert(node, last, tight)\n } else if (parent.type === LIST) {\n item = listItem()\n\n insert(node, item, tight)\n\n children.push(item)\n } else {\n item = list()\n node.depth--\n\n insert(node, item, tight)\n\n children.push(item)\n }\n\n // Properly style list-items with new lines.\n parent.spread = !tight\n\n if (parent.type === LIST && parent.spread) {\n parent.spread = false\n index = -1\n\n while (++index < length) {\n if (children[index].children.length > 1) {\n parent.spread = true\n break\n }\n }\n }\n\n // To do: remove `loose` in next major release.\n if (parent.type === LIST_ITEM) {\n parent.loose = tight ? false : children.length > 1\n } else {\n if (tight) {\n isLoose = false\n } else {\n index = -1\n\n while (++index < length) {\n if (children[index].loose) {\n isLoose = true\n\n break\n }\n }\n }\n\n index = -1\n\n while (++index < length) {\n children[index].loose = isLoose\n }\n }\n}", "_replaceWith(node) {\n if (this.parent) {\n if (this == this.parent.left) {\n this.parent.left = node;\n } else if (this == this.parent.right) {\n this.parent.right = node;\n }\n\n if (node) {\n node.parent = this.parent;\n }\n } else {\n if (node) {\n this.key = node.key;\n this.value = node.value;\n this.left = node.left;\n this.right = node.right;\n } else {\n this.key = null;\n this.value = null;\n this.left = null;\n this.right = null;\n }\n }\n }", "function add_parent_links(node) {\n\tfor(var c = 0; c < node.children.length; c++) {\n\t\tnode.children[c].parent = node;\n\t\tadd_parent_links(node.children[c]);\n\t}\n}", "function moveNode(node, parent) {\n\tvar n = document.getElementById(node);\n\tvar p = document.getElementById(parent);\n\tif (n != undefined && n !== null && p != undefined && p !== null) {\n\t\tp.appendChild(n.parentNode.removeChild(n));\n\t}\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function doTreesMerge(newLvl, existingLvl, newParentId, existingParentId, tP) { //console.log(\"doTreesMerge called. newLvl = %s, existingLvl = %s, newParent = %s, existingParent = %s\", newLvl, existingLvl, taxaNameMap[newParentId], taxaNameMap[existingParentId])\n if (newLvl > existingLvl) { // more specific taxon\n if (treesMergeAtHigherLevel(tP.taxaObjs[taxaNameMap[newParentId]], existingParentId, tP)) {\n tP.recrd.parent = newParentId; \t\t\t\t\t\t// console.log(\"trees merge\");\n }\n } else { confirmDirectRelationship(tP.taxaObjs[taxaNameMap[newParentId]], newParentId); }\n /**\n * If the taxon has a less specific direct parent in this record than in one previously processed, \n * check to ensure the existing parent is a child of the parent taxon in this record.\n */\n function confirmDirectRelationship(existingTaxonObj, newParentId) { \n if (!isChild(existingTaxonObj)) { // No case yet. TODO: add to Complex Errors\n console.log(\"trees don't merge. newParent =%s, existing =%s, rcrd = %O, existingParent = %O\", taxaNameMap[newParentId], taxaNameMap[existingParentId], tP.recrd, tP.taxaObjs[taxaNameMap[existingParentId]].name); \n }\n\n function isChild(existingParnt) { // console.log(\"existingParnt - %s, existingParntLvl - %s, tP.taxaObjs = %O\", existingParnt.name, existingParnt.level, tP.taxaObjs)\n if ( existingParnt.level === newLvl ) { //console.log(\"levels equal. existingId = %s, newParentId = %s\", existingParnt.tempId, newParentId)\n if ( existingParnt.tempId === newParentId ) { return true; \n } else { return false; }\n }\n if ( existingParnt.parent === newParentId ) { return true;\n } else { return isChild(existingParnt.parent); }\n }\n }\n }", "function mutation_insert_single(node, parent, suppressObservers) {\n /**\n * 1. Let count be the number of children of node if it is a\n * DocumentFragment node, and one otherwise.\n * 2. If child is non-null, then:\n * 2.1. For each live range whose start node is parent and start\n * offset is greater than child's index, increase its start\n * offset by count.\n * 2.2. For each live range whose end node is parent and end\n * offset is greater than child's index, increase its end\n * offset by count.\n * 3. Let nodes be node’s children, if node is a DocumentFragment node;\n * otherwise « node ».\n * 4. If node is a DocumentFragment node, remove its children with the\n * suppress observers flag set.\n * 5. If node is a DocumentFragment node, then queue a tree mutation record\n * for node with « », nodes, null, and null.\n */\n /**\n * 6. Let previousSibling be child’s previous sibling or parent’s last\n * child if child is null.\n */\n const previousSibling = parent._lastChild;\n // set document element node\n if (util_1.Guard.isElementNode(node)) {\n // set document element node\n if (util_1.Guard.isDocumentNode(parent)) {\n parent._documentElement = node;\n }\n // mark that the document has namespaces\n if (!node._nodeDocument._hasNamespaces && (node._namespace !== null ||\n node._namespacePrefix !== null)) {\n node._nodeDocument._hasNamespaces = true;\n }\n }\n /**\n * 7. For each node in nodes, in tree order:\n * 7.1. If child is null, then append node to parent’s children.\n * 7.2. Otherwise, insert node into parent’s children before child’s\n * index.\n */\n node._parent = parent;\n parent._children.add(node);\n // assign siblings and children for quick lookups\n if (parent._firstChild === null) {\n node._previousSibling = null;\n node._nextSibling = null;\n parent._firstChild = node;\n parent._lastChild = node;\n }\n else {\n const prev = parent._lastChild;\n node._previousSibling = prev;\n node._nextSibling = null;\n if (prev)\n prev._nextSibling = node;\n if (!prev)\n parent._firstChild = node;\n parent._lastChild = node;\n }\n /**\n * 7.3. If parent is a shadow host and node is a slotable, then\n * assign a slot for node.\n */\n if (dom_1.dom.features.slots) {\n if (parent._shadowRoot !== null && util_1.Guard.isSlotable(node)) {\n ShadowTreeAlgorithm_1.shadowTree_assignASlot(node);\n }\n }\n /**\n * 7.4. If node is a Text node, run the child text content change\n * steps for parent.\n */\n if (dom_1.dom.features.steps) {\n if (util_1.Guard.isTextNode(node)) {\n DOMAlgorithm_1.dom_runChildTextContentChangeSteps(parent);\n }\n }\n /**\n * 7.5. If parent's root is a shadow root, and parent is a slot\n * whose assigned nodes is the empty list, then run signal\n * a slot change for parent.\n */\n if (dom_1.dom.features.slots) {\n if (util_1.Guard.isShadowRoot(TreeAlgorithm_1.tree_rootNode(parent)) &&\n util_1.Guard.isSlot(parent) && util_2.isEmpty(parent._assignedNodes)) {\n ShadowTreeAlgorithm_1.shadowTree_signalASlotChange(parent);\n }\n }\n /**\n * 7.6. Run assign slotables for a tree with node's root.\n */\n if (dom_1.dom.features.slots) {\n ShadowTreeAlgorithm_1.shadowTree_assignSlotablesForATree(TreeAlgorithm_1.tree_rootNode(node));\n }\n /**\n * 7.7. For each shadow-including inclusive descendant\n * inclusiveDescendant of node, in shadow-including tree\n * order:\n * 7.7.1. Run the insertion steps with inclusiveDescendant.\n */\n if (dom_1.dom.features.steps) {\n DOMAlgorithm_1.dom_runInsertionSteps(node);\n }\n if (dom_1.dom.features.customElements) {\n /**\n * 7.7.2. If inclusiveDescendant is connected, then:\n */\n if (util_1.Guard.isElementNode(node) &&\n ShadowTreeAlgorithm_1.shadowTree_isConnected(node)) {\n if (util_1.Guard.isCustomElementNode(node)) {\n /**\n * 7.7.2.1. If inclusiveDescendant is custom, then enqueue a custom\n * element callback reaction with inclusiveDescendant, callback name\n * \"connectedCallback\", and an empty argument list.\n */\n CustomElementAlgorithm_1.customElement_enqueueACustomElementCallbackReaction(node, \"connectedCallback\", []);\n }\n else {\n /**\n * 7.7.2.2. Otherwise, try to upgrade inclusiveDescendant.\n */\n CustomElementAlgorithm_1.customElement_tryToUpgrade(node);\n }\n }\n }\n /**\n * 8. If suppress observers flag is unset, then queue a tree mutation record\n * for parent with nodes, « », previousSibling, and child.\n */\n if (dom_1.dom.features.mutationObservers) {\n if (!suppressObservers) {\n MutationObserverAlgorithm_1.observer_queueTreeMutationRecord(parent, [node], [], previousSibling, null);\n }\n }\n}", "function insert(node, parent_id, sort)\n {\n var li, parent_li,\n parent_node = parent_id ? indexbyid[parent_id] : null\n search_ = search_active;\n\n // ignore, already exists\n if (indexbyid[node.id]) {\n return;\n }\n\n // apply saved state\n state = get_state(node.id, node.collapsed);\n if (state !== undefined) {\n node.collapsed = state;\n }\n\n // insert as child of an existing node\n if (parent_node) {\n node.level = parent_node.level + 1;\n if (!parent_node.children)\n parent_node.children = [];\n\n search_active = false;\n parent_node.children.push(node);\n parent_li = id2dom(parent_id);\n\n // re-render the entire subtree\n if (parent_node.children.length == 1) {\n render_node(parent_node, null, parent_li);\n li = id2dom(node.id);\n }\n else {\n // append new node to parent's child list\n li = render_node(node, parent_li.children('ul').first());\n }\n\n // list is in search mode\n if (search_) {\n search_active = search_;\n\n // add clone to current search results (top level)\n if (!li.is(':visible')) {\n $('<li>')\n .attr('id', li.attr('id') + '--xsR')\n .attr('class', li.attr('class'))\n .addClass('searchresult__')\n .append(li.children().first().clone(true, true))\n .appendTo(container);\n }\n }\n }\n // insert at top level\n else {\n node.level = 0;\n data.push(node);\n li = render_node(node, container);\n }\n\n indexbyid[node.id] = node;\n\n // set new reference to node.html after insert\n // will otherwise vanish in Firefox 3.6\n if (typeof node.html == 'object') {\n indexbyid[node.id].html = id2dom(node.id, true).children();\n }\n\n if (sort) {\n resort_node(li, typeof sort == 'string' ? '[class~=\"' + sort + '\"]' : '');\n }\n }", "function setChild(parent, node) {\n\n var c, newNode, currentDocument = parent._ownerDocument || parent;\n\n switch (node.type)\n {\n case 'tag':\n case 'script':\n case 'style':\n try {\n newNode = currentDocument.createElement(node.name);\n if (node.location) {\n newNode.sourceLocation = node.location;\n newNode.sourceLocation.file = parent.sourceLocation.file;\n }\n } catch (err) {\n currentDocument.trigger('error', 'invalid markup', {\n exception: err,\n node : node\n });\n\n return null;\n }\n break;\n\n case 'text':\n newNode = currentDocument.createTextNode(HTMLDecode(node.data));\n break;\n\n case 'comment':\n newNode = currentDocument.createComment(node.data);\n break;\n\n default:\n return null;\n break;\n }\n\n if (!newNode)\n return null;\n\n if (node.attribs) {\n for (c in node.attribs) {\n // catchin errors here helps with improperly escaped attributes\n // but properly fixing parent should (can only?) be done in the htmlparser itself\n try {\n newNode.setAttribute(c.toLowerCase(), HTMLDecode(node.attribs[c]));\n } catch(e2) { /* noop */ }\n }\n }\n\n if (node.children) {\n for (c = 0; c < node.children.length; c++) {\n setChild(newNode, node.children[c]);\n }\n }\n\n return parent.appendChild(newNode);\n}", "function inorder(node){\n if(!_.isNull(node.left)) inorder(node.left)\n trav.push({\"key\": node.key, \"value\": node.value, \"children\": [_.get(node, \"left.value\", \"null\"), _.get(node, \"right.value\", \"null\")]})\n if(!_.isNull(node.right)) inorder(node.right)\n}", "function addParent(obj, parent) {\n const isNode = obj && typeof obj.type === 'string';\n const childParent = isNode ? obj : parent;\n\n for (const k in obj) {\n const value = obj[k];\n\n if (Array.isArray(value)) {\n value.forEach(function (v) {\n addParent(v, childParent);\n });\n } else if (value && typeof value === 'object') {\n addParent(value, childParent);\n }\n }\n\n if (isNode) {\n Object.defineProperty(obj, 'parent', {\n configurable: true,\n writable: true,\n enumerable: false,\n value: parent || null\n });\n }\n\n return obj;\n}", "function addParent(obj, parent) {\n var isNode = obj && typeof obj.type === 'string'\n var childParent = isNode ? obj : parent\n\n for (var k in obj) {\n var value = obj[k]\n if (Array.isArray(value)) {\n value.forEach(function(v) {\n addParent(v, childParent)\n })\n } else if (value && typeof value === 'object') {\n addParent(value, childParent)\n }\n }\n\n if (isNode) {\n Object.defineProperty(obj, 'parent', {\n configurable: true,\n writable: true,\n enumerable: false,\n value: parent || null,\n })\n }\n\n return obj\n}", "function addParent(obj, parent) {\n var isNode = obj && typeof obj.type === 'string';\n var childParent = isNode ? obj : parent;\n for (var k in obj) {\n var value = obj[k];\n if (Array.isArray(value)) {\n value.forEach(function (v) { addParent(v, childParent); });\n }\n else if (value && typeof value === 'object') {\n addParent(value, childParent);\n }\n }\n if (isNode) {\n Object.defineProperty(obj, 'parent', {\n configurable: true,\n writable: true,\n enumerable: false,\n value: parent || null\n });\n }\n return obj;\n}", "function addParent(obj, parent) {\n\t var isNode = obj && typeof obj.type === 'string';\n\t var childParent = isNode ? obj : parent;\n\n\t for (var k in obj) {\n\t var value = obj[k];\n\t if (Array.isArray(value)) {\n\t value.forEach(function(v) { addParent(v, childParent); });\n\t } else if (value && typeof value === 'object') {\n\t addParent(value, childParent);\n\t }\n\t }\n\n\t if (isNode) {\n\t Object.defineProperty(obj, 'parent', {\n\t configurable: true,\n\t writable: true,\n\t enumerable: false,\n\t value: parent || null\n\t });\n\t }\n\n\t return obj;\n\t}" ]
[ "0.74632514", "0.59985286", "0.5736341", "0.57050353", "0.5690707", "0.55368066", "0.55368066", "0.55368066", "0.55368066", "0.55368066", "0.55221415", "0.5491665", "0.54881227", "0.54389185", "0.54165894", "0.5414174", "0.5388163", "0.53780395", "0.53780395", "0.53780395", "0.53780395", "0.53780395", "0.53780395", "0.53714144", "0.53184193", "0.52754843", "0.52702224", "0.5256814", "0.5209421", "0.51835114", "0.5183274", "0.515352", "0.51070684", "0.5099592", "0.50727195", "0.507041", "0.50421536", "0.50165516", "0.4990171", "0.49845716", "0.49508503", "0.49508503", "0.49508503", "0.49508503", "0.49508503", "0.49508503", "0.49508503", "0.49508503", "0.49508503", "0.49508503", "0.49508503", "0.49508503", "0.49508503", "0.49494687", "0.49428245", "0.4940417", "0.49365324", "0.49338052", "0.49255544", "0.4920291", "0.49131086", "0.4903505", "0.4898713", "0.48942837", "0.48933083", "0.48864508", "0.48854202", "0.48773092", "0.48745722", "0.48691237", "0.48665768", "0.48542204", "0.48422414", "0.48321122", "0.48300472", "0.4822784", "0.4816105", "0.48057905", "0.48034674", "0.48027286", "0.47897497", "0.47887504", "0.47887504", "0.47887504", "0.47887504", "0.47887504", "0.47887504", "0.47820315", "0.47804832", "0.4777472", "0.47700045", "0.4757912", "0.4756343", "0.47348145", "0.47318268", "0.4730397" ]
0.7813251
4
Remove `subvalue` from `value`. `subvalue` must be at the start of `value`.
function eat(subvalue) { var indent = getOffset(); var pos = position(); var current = now(); validateEat(subvalue); apply.reset = reset; reset.test = test; apply.test = test; value = value.substring(subvalue.length); updatePosition(subvalue); indent = indent(); return apply; /* Add the given arguments, add `position` to * the returned node, and return the node. */ function apply(node, parent) { return pos(add(pos(node), parent), indent); } /* Functions just like apply, but resets the * content: the line and column are reversed, * and the eaten value is re-added. * This is useful for nodes with a single * type of content, such as lists and tables. * See `apply` above for what parameters are * expected. */ function reset() { var node = apply.apply(null, arguments); line = current.line; column = current.column; value = subvalue + value; return node; } /* Test the position, after eating, and reverse * to a not-eaten state. */ function test() { var result = pos({}); line = current.line; column = current.column; value = subvalue + value; return result.position; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subInputValue(val, sub)\n{\n var dataArray = '';\n var data = \"\";\n if (val == sub) return 0;\n dataArray = val.toString().split(',');\n var index = $.inArray(sub, dataArray);\n dataArray.splice(index, 1);\n return dataArray.join();\n}", "deleteVal(str) {\n\t\tvar sub = str.substring(0, str.length - 1);\n\t\treturn sub;\n\t}", "function removeSarja(subfield) {\n if (subfield.code !== 'a') {\n return;\n }\n const tmp = subfield.value.replace(/ ?-(?:[a-z]|ä|ö)*sarja$/u, '');\n if (tmp.length > 0) {\n subfield.value = tmp; // eslint-disable-line functional/immutable-data\n return;\n }\n }", "function removeChar(value, char) {\n if (!value.length || !char.length) {\n return '';\n }\n\n if (char.includes(value[0])) {\n return '' + removeChar(value.slice(1), char);\n }\n\n return value[0] + removeChar(value.slice(1), char);\n}", "function removeSubStr(str, substr) {\n\t\tstr = str || \"\";\n\t\tvar k = str.indexOf(substr);\n\t\treturn k + 1 ? str.slice(0, k) + str.slice(k + substr.length) : str;\n\t}", "static removePrefix(value) {\n if (value.includes(InitialPrefix) && value.includes(EndPrefix)) {\n return value\n .toString()\n .replace(InitialPrefix, \"\")\n .replace(EndPrefix, \"\");\n }\n return value;\n }", "removeByValue (value) {\n\t\tthis.remove(this.findFirst(value));\n\t}", "function removeSubStr(string,substring){\n return string.replace(substring,\"\")\n}", "removeByValue(value) {\n return this.delete(this.getIndexOf(value));\n }", "function listRemoveOneElementByValue(list, remove_value){\n list=substr(list, 1, list.length-1);\n var index=find_not_in_str_list_dict(list, remove_value);\n list=replace_from_index_to_index(list, remove_value, \"\", index, index+remove_value.length);\n list=append(\"[\", list);\n list=append(list, \"]\");\n list=replace_not_in_string(list, \",,\", \",\");\n list=replace_not_in_string(list, \"[,\", \"[\");\n list=replace_not_in_string(list, \",]\", \"]\");\n return list;\n}", "function removeTrailingZeroes(value) {\n while (value.charAt(value.length - 1) === '0') {\n value = value.slice(0, -1);\n }\n if (value.charAt(value.length - 1) === '.') {\n value = value.slice(0, -1);\n }\n return value;\n }", "function deleteOnValue() {\n return displayScreenNumber.value = displayScreenNumber.value.slice(0, displayScreenNumber.value.length - 1);\n}", "removeValue (value) {\r\n // TODO: Do we need it?\r\n console.warn(`This feature is not implemented yet`)\r\n }", "remove(value) {\n\t\tif (!this.root) {\n\t\t\treturn 'Tree is empty!';\n\t\t} else {\n\t\t\tthis.removeNode(this.root, value);\n\t\t}\n\t}", "function removeZeros(value) {\n if (value.indexOf('.') !== -1) {\n while (value[value.length - 1] === '0') {\n value = value.substring(0, value.length - 1);\n }\n if (value[value.length - 1] === '.') {\n value = value.substring(0, value.length - 1);\n }\n }\n return value;\n}", "static subtract(array, subArray) {\n return Utils.removeIf(array, function(el) {\n return Utils.hasValue(subArray, el);\n });\n }", "removeValue(value) {\n\t\tlet currentNode = this.head\n\t\tlet index = 0\n\n\t\twhile (value != currentNode.value) {\n\t\t\tcurrentNode = currentNode.next\n\t\t\tindex++\n\t\t}\n\t\treturn this.remove(index)\n\t}", "function remove(as, value) {\n var index = as.indexOf(value);\n if (index != -1) {\n as.splice(index, 1);\n return true;\n }\n else {\n return false;\n }\n }", "function dropBrackets (value) {\n return value.replace(/[(,)]/g, '');\n}", "static removeValue(array, value) {\n for (var tI = array.length - 1; tI >= 0; tI--) {\n if (array[tI] === value) {\n array.splice(tI, 1);\n return tI;\n }\n }\n }", "function removeNumber(){\n var stringInput = document.getElementById(\"input-number\").value; \n var inputLength = stringInput.length\n var remove = stringInput.slice(0,inputLength-1);\n document.getElementById(\"input-number\").value = remove;\n}", "function clean_start_end_value(value){\n\n\t// In case we pass in a number\n\tvalue = value.toString();\n\n\tlet changed = false;\n\tlet new_value;\n\n\tif(value == ''){\n\n\t\t// Check if empty string\n\t\tnew_value = 0;\n\t\tchanged = true;\n\n\t}else if(value.charAt(0) == '0'){\n\n\t\t// Remove leading zeroes\n\t\tnew_value = parseInt(value,10);\n\t\tchanged = true;\n\n\t}else{\n\n\t\t// Check if we exceed the limits for the start or end value\n\t\tnew_value = parseInt(value,10);\n\t\tif(new_value > 180){\n\t\t\tnew_value = 180;\n\t\t\tchanged = true;\t \n\t\t}else if(new_value < 0){\n\t\t\tnew_value = 0;\n\t\t\tchanged = true;\n\t\t}\n\t}\n\n\tif(changed){\n\t\treturn new_value;\n\t}else{\n\t\treturn false;\n\t}\n}", "function removeFromLast(){\n \n const previousValue = document.querySelector(\".inputValueShower\").value\n \n const updateValue = previousValue.substring(0, previousValue.length - 1)\n \n document.querySelector(\".inputValueShower\").value = updateValue \n }", "function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }", "function cut_out_tags(value) {\n return value.replace(/<.+>/g, \"\");\n}", "static removeLeftZeros(value) {\n while (value.startsWith('0')) {\n value = value.substring(1, value.length);\n }\n return value;\n }", "function FFString_trim( value ){\n\treturn FFString_trimRight(FFSting_trimLeft(value));\t\n}", "remove(value) {\n this.root = this.removeVisitor(this.root, value)\n }", "function removeDigit() {\n pinInsert.value = pinInsert.value.slice(0, -1);\n}", "function removeExtraCommas(value) {\n\t//if last char of textbox value is comma then remove\n\tif(value.charAt(value.length-1) == ',')\n\t\tvalue = value.substring(0, value.length-1);\n\t//if first char of textbox value is comma then remove\n\tif(value.charAt(0) == ',')\n\t\tvalue = value.replace(\",\", \"\");\n\t//return value\n\treturn value;\n}", "function removeValue(array, value, can_fail) {\n var idx = array.indexOf(value);\n ASSERT(can_fail || idx != -1, 'Unable to Remove Value ' + value);\n if (idx != -1) array.splice(idx, 1);\n return idx != -1;\n}", "function reviver(key, value){\n \n if (typeof value === \"string\"){\n var str = value.replace(/---/g, \" \");\n return str;\n }\n return value\n }", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n\t\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n\t\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n\t\n}", "remove(value) {\n this.root = this.removeNode(thisroot, value);\n }", "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\t\t\tvar rng, container, offset;\n\n\t\t\t\t\trng = selection.getRng(true);\n\t\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\t\toffset = rng.startOffset;\n\n\t\t\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\t\t\tvalue = ' ' + value;\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}", "function trim( value ) {\r\n\t\r\n return LTrim(RTrim(value));\r\n\t\r\n }", "removekey(value) {\n\n this.root = this.remove(this.root, value)\n\n }", "function trim( value )\r\n{\r\n\t\r\n\treturn LTrim(RTrim(value));\r\n\t\r\n}", "cleanValue() {\n if (!this.node.value.match(/\\d/)) {\n this.node.value = '';\n }\n }", "function removeAt(arr, value) {\n return arr[value]\n}", "function del() {\n currentValue = currentValue.slice(0, -1);\n}", "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\tvar rng, container, offset;\n\n\t\t\trng = selection.getRng(true);\n\t\t\tcontainer = rng.startContainer;\n\t\t\toffset = rng.startOffset;\n\n\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t}\n\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue = ' ' + value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\tvar rng, container, offset;\n\n\t\t\trng = selection.getRng(true);\n\t\t\tcontainer = rng.startContainer;\n\t\t\toffset = rng.startOffset;\n\n\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t}\n\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue = ' ' + value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function remove_copy(first, last, output, val) {\r\n return remove_copy_if(first, last, output, function (elem) { return comparators_1.equal_to(elem, val); });\r\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n}", "function trim( value ) {\r\n\t\r\n\treturn LTrim(RTrim(value));\r\n\t\r\n}", "function removeOne(){\n let x=document.getElementById('input').value;\n console.log(x);\n let length=x.length;\n console.log(length);\n if(length>0)\n {\n document.getElementById('input').value=x.slice(0,length-1);\n if(operand1==null)\n {\n operand1=null;\n }\n else{\n operand2=null;\n }\n }\n else{\n window.alert('cannot remove from empty');\n }\n}", "function trim( value ) {\n\n return LTrim(RTrim(value));\n\n}", "function trim( value )\r\n{\r\n return LTrim(RTrim(value));\r\n}", "function trim( value )\n{\n\n return LTrim(RTrim(value));\n\n}", "remove(value) {\n let currentNode = this.head;\n\n if (currentNode !== null) {\n if (currentNode.data == value) {\n this.head = currentNode.next;\n this.size--;\n } else {\n let previousNode;\n\n while (currentNode && currentNode.data !== value) {\n previousNode = currentNode;\n currentNode = currentNode.next;\n }\n\n if (currentNode && previousNode) {\n previousNode.next = currentNode.next;\n this.size--;\n } else {\n return `Given ${value} value not found !!!`;\n }\n }\n }\n }", "function removeFirst(x, y){\n return x.toString().replace(y, \"\");\n }", "function cleanup(value) {\n return value.trim();\n }", "function trim( value ) {\r\n\t\treturn LTrim(RTrim(value));\r\n\t}", "function removeValueQuery(key, value) {\n\tarray = urlParams.getAll(key).filter((el) => el != value);\n\turlParams.delete(key);\n\tarray.forEach((el) => {\n\t\turlParams.append(key, el.replaceAll(' ', '-'));\n\t});\n}", "function trim( value ) {\r\n\treturn LTrim(RTrim(value));\r\n}", "eliminate_token( t, type, value ) {\n if( Array.isArray(t.value) ) {\n var a = t.value\n for(var i=a.length-1; i>=0; i-- ) {\n if(a[i].type==EmptyRule.TAG || \n a[i].type ==type &&\n (value==null || t.value==value)) a.splice(i,1)\n else a[i] = this.eliminate_token(a[i],type,value)\n } \n }\n return t\n }", "function removePX(value) {\n let loc = value.indexOf('p');\n return parseInt(value.slice(0, loc));\n}", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }", "function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }" ]
[ "0.6700181", "0.615384", "0.60974056", "0.607876", "0.5916318", "0.58879244", "0.57502335", "0.5706556", "0.5593472", "0.5556735", "0.5489102", "0.54677486", "0.5467472", "0.53538615", "0.53393024", "0.531904", "0.53051805", "0.5301847", "0.5237087", "0.52169204", "0.5209073", "0.5208504", "0.5207561", "0.51880056", "0.5165443", "0.51425266", "0.5141351", "0.5132516", "0.51232684", "0.5111768", "0.5109249", "0.5103616", "0.50922143", "0.50922143", "0.50922143", "0.5091758", "0.508758", "0.50851864", "0.50846404", "0.50806653", "0.50759155", "0.507323", "0.5061742", "0.50590986", "0.50590986", "0.5056074", "0.50483996", "0.5043513", "0.504032", "0.50335526", "0.5033535", "0.503239", "0.5029966", "0.5020886", "0.5016622", "0.5016143", "0.5009573", "0.500792", "0.50067466", "0.500353", "0.50029737", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378", "0.5002378" ]
0.5133321
31
Add the given arguments, add `position` to the returned node, and return the node.
function apply(node, parent) { return pos(add(pos(node), parent), indent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "assignPosition(node, position) {\n // update the position of the node\n node.position = position;\n \n // the base case\n if (node.children.length === 0)\n {\n leafNodeCounter = leafNodeCounter + 1;\n return node;\n }\n // recursive case\n else\n {\n leafNodeCounter = 0;\n for (var d = 0; d < node.children.length; d++)\n {\n // this is a really bad hack and there is definitely something better out there. \n // However, it gets the job done\n if (node.children[d].name === \"Protosomes\")\n {\n leafNodeCounter = leafNodeCounter + 2;\n }\n\n this.assignPosition(node.children[d], node.position + leafNodeCounter);\n }\n }\n\n }", "addAfter(value, position){\n\t\tif(!this.head) return this.add(value);\n\t\tif(this.length < position) return 'position does not exist';\n\t\tif(this.length === position) return this.add(value);\n\t\tlet newNode = new Node(value);\n\t\tlet aux, count = 1;\n\t\tlet current = this.head;\n\t\twhile(count <= position){\n\t\t\tcurrent = current.next\n\t\t\tcount++\n\t\t}\n\t\taux = current.next;\n\t\tnewNode.next = aux;\n\t\tcurrent.next = newNode;\n\t\tthis.length++;\n\t\treturn this;\n\t}", "insertAtPosition(position, nodeToInsert) {\n if(position > this.length + 1 || !position || !nodeToInsert)\n return\n\n if(position === 1) {\n this.setHead(nodeToInsert)\n return\n }\n\n let curr = this.head, currPost = 1\n while(curr && currPost++ < position)\n curr = curr.next\n\n if(curr) this.insertBefore(curr, nodeToInsert)\n else this.setTail(nodeToInsert)\n\n }", "pushPosition(position) {\n\t\tthis.positionContainer.push(position);\n\t}", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n\t var start = { line: lineno, column: column };\n\t return function(node){\n\t node.position = new Position(start);\n\t whitespace();\n\t return node;\n\t };\n\t }", "function position() {\n var start = {line: lineno, column: column}\n return function(node) {\n node.position = new Position(start)\n whitespace()\n return node\n }\n }", "function insertNode(text, position, parentNode, session) {\n var seed = session.seed();\n\n seed.setValue(text);\n parentNode.insert(seed, position);\n\n return seed;\n }", "insertIn(position, value) {\n if (position < 0 || \n position > this.length) {\n\n console.error(\"Position is out of range! \", position)\n return null;\n }\n\n let node = new Node(value);\n\n if (position === 0) {\n\n node.next = this.head;\n this.head = node;\n\n } else {\n let current = this.head,\n prev = null,\n index = 0;\n\n while (index < position) {\n prev = current;\n current = current.next;\n index ++;\n }\n\n prev.next = node;\n node.next = current;\n }\n\n this.length++;\n\n }", "async addNode(){\r\n return this.call('addnode',...(Array.from(arguments)));\r\n }", "function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }", "assignPosition(node, position) {\n\t\tif(node.parentNode && position<node.parentNode.position){\n\t\t\tposition = node.parentNode.position;\n\t\t}\n\t\twhile(this.positionMap.get(`${node.level},${position}`)){\n\t\t\tposition++;\n\t\t}\n\t\tnode.position = position;\n\t\tthis.positionMap.set(`${node.level},${position}`, true);\n\t\tfor(var i in node.children){\n\t\t\tthis.assignPosition(node.children[i], position+Number(i));\n\t\t}\n\t}", "createNode(pos) {\n let newX;\n let newY;\n if (pos !== undefined) {\n newX = pos.x;\n newY = pos.y;\n }\n else {\n newX = this.cursorPosition.x;\n newY = this.cursorPosition.y;\n }\n return new Types_1.Node(\"0\", this.findLowestIDAvailable(), newX, newY, this.frozen, false);\n }", "function add (node, parent) {\n parent.children.push(node)\n if (parser.position) {\n parent.position = {\n start: parent.children[0].position.start,\n end: node.position.end\n }\n }\n }", "function position() {\n const start = {\n line: lineno,\n column\n };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function insertNodeAtPosition(head, data, position){ \n \tif(position == 0){\n \tconst to_insert = new LinkedListNode(data)\n \tto_insert.next = head\n head = to_insert\n return head\n }\n let count = 1\n let current = head\n while(count < position){\n \tcount++\n current = current.next\n\t}\n const to_insert = new LinkedListNode(data)\n to_insert.next = current.next\n current.next = to_insert\n \n current = head\n let result = \"\"\n while(current){\n \tresult += `${current.data} `\n \tcurrent = current.next\n }\n \n return head\n}", "function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }", "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "function insert(position, newText) {\n return {\n range: {\n start: position,\n end: position\n },\n newText: newText\n };\n }", "function insert(position, newText) {\n return {\n range: {\n start: position,\n end: position\n },\n newText: newText\n };\n }", "function insert(position, newText) {\n return {\n range: {\n start: position,\n end: position\n },\n newText: newText\n };\n }", "function adjustNodeInsertPosition(root, nodeToInsert, position) {\n adjustSteps.forEach(function (handler) {\n position = handler(root, nodeToInsert, position);\n });\n return position;\n}", "insertAfter(position, data) {\n /*\n `position === -1` means we are adding the node before the head,\n hence, our `head` should be changed\n */\n if (position === -1) {\n let newNode = new ListNode(data)\n newNode.next = this.head\n this.head = newNode\n return\n }\n\n let currentNode = this.find(position)\n\n if (currentNode) {\n let newNode = new ListNode(data)\n newNode.next = currentNode.next\n currentNode.next = newNode\n } else {\n throw new Error(`Cannot insert at position ${position + 1}: unreachable position!`)\n }\n }", "addPosition(pos) {\n this.positions += '=\"'+pos.line + ':' + pos.linePosition + '\",';\n }", "insert(pos, val) {\n const newNode = new LListNode(val, pos.current().getNext());\n pos.current().setNext(newNode);\n pos.next();\n return pos;\n }", "function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new ParsePosition(start);\n whitespace();\n return node;\n };\n }", "insert(position, element){\n if (position >= 0 && position < this.length){\n var node = new Node(element);\n var current = this.head;\n var previous;\n var counter = 0;\n // if adding element at the beginning of the list...\n if (position === 0){\n // push back the 1st element...\n node.next = current;\n // point head to inserted node\n this.head = node;\n } else {\n // loop thru til we reach the desired position...\n while (counter++ < position){\n previous = current;\n current = current.next;\n }\n // when finally bust out of the loop, CURRENT is referencing element after the position we would like to insert... (want to add new item b/w prev and current)\n // point previous.next to node && point node.next to current\n // make a link b/w the new item and current\n node.next = current;\n // change link b/w previous and current\n previous.next = node;\n }\n this.length++;\n return true;\n } else {\n return false;\n }\n }", "addNode(x, y, text, rx = 20, ry = 20) {\n let node = new Node(x, y, rx, ry, text);\n this.root.appendChild(node.root);\n this.nodes.push(node);\n return node;\n }", "function addPosition(x,y,positionArray) {\n var position={x,y};\n positionArray.push(position);\n}", "getNextPositionForward(position) {\n const valueToAdd = position.c === 'N' || position.c === 'E' ? 1 : -1;\n const propToChange = position.c ==='W' || position.c === 'E' ? 'x' : 'y';\n position[propToChange] = position[propToChange] + valueToAdd;\n return position;\n }", "newPosition(position) {\n this.position = position;\n }", "constructor($pos) {\n let node = $pos.nodeAfter;\n let $end = $pos.node(0).resolve($pos.pos + node.nodeSize);\n super($pos, $end);\n this.node = node;\n }", "function insertNode(location, reference) {\n\tvar newNode = document.createElement('div');\n\tnewNode.className = 'node';\n\n\tif (location === 'before') {\n\t\tnodeList.insertBefore(newNode, reference);\n\t} else {\n\t\tnodeList.insertBefore(newNode, reference.nextSibling);\n\t}\n\t\n\tnewNode.innerHTML = nodeFiller;\n}", "findChildAtPosition(position, options) {\n return this.findChild((node) => {\n var _a;\n //if the current node includes this range, keep that node\n if (util_1.default.rangeContains(node.range, position)) {\n return (_a = node.findChildAtPosition(position, options)) !== null && _a !== void 0 ? _a : node;\n }\n }, options);\n }", "function addText(text, position = \"left\", color = \"\") {\n\tlet element = new Text(text, position, color ? color : fontColor);\n\telement.add();\n\treturn element;\n}", "insertAt(element, position){\n var head = this.head;\n var node = new Node(element);\n if(position <=0 || position>this.size+1)\n return;\n else if(position == 1){\n node.next = head;\n this.head = node;\n }\n else if(position == this.size+1){\n var current = this.head;\n while(current.next){\n current = current.next;\n }\n current.next = node;\n }\n else{\n var current = this.head;\n for(var i=1; i<position-1; i++){\n current = current.next;\n }\n var nextNode = current.next;\n node.next = current.next;\n current.next = node;\n\n }\n this.size++;\n\n }", "insertAt(item, position) {\n if(this.head === null) {\n this.head = new _Node(item, this.head)\n }\n let currNode = this.head\n let count = 0\n while(count < position - 1) {\n currNode = currNode.next\n count++\n }\n currNode.next = new _Node(item, currNode.next)\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n this.updateMatrixWorld();\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n }", "function InsertNode() {}", "function calcPosition (position, velocity) {\n var deltaP = multVector(velocity, animSpeed);\n return addVectors(position, deltaP);\n}", "goToPosition(position) {\n\t\t//if we are already ina position clear the positionContainer\n\t\tif (this.presentPosition()) {\n\t\t\tthis.positionContainer.length = 0;\n\t\t}\n\t\t//if we find an 'entry' in a given position , we call it\n\t\tif (position.entry) {\n\t\t\tposition.entry(play);\n\t\t}\n\t\t//setting the current game position in the positionContainer\n\t\tthis.positionContainer.push(position);\n\t}", "addModifier(modifier, position) {\n if (position !== undefined) {\n modifier.setPosition(position);\n }\n\n modifier.setStave(this);\n this.formatted = false;\n this.modifiers.push(modifier);\n return this;\n }", "function add_node( id, type, place)\n{\n\tvar my = document.createElement(type);\n\tmy.id = id;\n\n\tmy.style.position = \"relative\";\n\n\tplace.appendChild(my);\n\n\treturn my;\n}", "function createNodes(node, positionX, positionY, val = 0){\n let newVal = val + int(node.freq);\n circles.push([positionX, positionY, node.freq, node.symbol]);\n \n if(node.left !== null){\n createNodes(node.left, positionX - 100, positionY + 100, newVal);\n lines.push([positionX, positionY, positionX - 100, positionY + 100]);\n } \n \n if(node.right !== null){\n createNodes(node.right, positionX + 100, positionY + 100, newVal)\n lines.push([positionX, positionY, positionX + 100, positionY + 100]);\n }\n \n}", "appendValue( value, location ) {\n const node = new Node( value )\n\n if ( ! this.head ) {\n this.head = node\n\n return this\n }\n\n if ( location === 0 ) {\n node.next = this.head.next\n this.head.next = node\n\n return this\n }\n\n let count = 0\n let runner = this.head\n\n while ( count < location && runner.next ) {\n runner = runner.next\n count ++\n }\n\n node.next = runner.next\n runner.next = node\n\n return this\n }", "function node_add(_pos, _rx, _ry, _fontsize,_type){\r\n\tvar newnode=null;\r\n\tvar title_pre = \"V\";\r\n\tswitch(_type){\r\n\t\tcase \"ellipse\": title_pre =\"F\";\r\n\t\t\tbreak;\r\n\t\tcase \"rect\": title_pre =\"X\";\r\n\t\t\tbreak;\r\n\t\tcase \"triangle\": title_pre = \"1\";\r\n\t\t\tbreak;\r\n\t\tdefault:;\r\n\t}// end of switch (_type) title_pre\r\n\tswitch (_type){\r\n\t\tcase \"ellipse\": \r\n\t\t\tNodecurrent_IdNUM++;\r\n\t\t\tElli_current_TitleNUM++;\t\t\t\r\n\t\t\tnewnode = { id: \"node\"+String(Nodecurrent_IdNUM), type: _type, x:_pos.x, y:_pos.y, rx: default_RADIUSH,ry:default_RADIUSV, strokedotted:0, color: defaultCOLOR, title: title_pre+ Elli_current_TitleNUM, fontsize:defaultFONTSIZE,strokewidth:default_strokeWIDTH, selected: false};\r\n\t\t\tnodes.push(newnode);\r\n\t\t\tnumElli++;\r\n\t\t\tnumNode++;\t\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase \"rect\":\r\n\t\t\tNodecurrent_IdNUM++;\r\n\t\t\tRec_current_TitleNUM++;\r\n\t\t\tnewnode = { id: \"node\"+String(Nodecurrent_IdNUM), type: _type, x:_pos.x, y:_pos.y, rx: default_RADIUSH,ry:default_RADIUSV, strokedotted:0, color: defaultCOLOR, title: title_pre+ Rec_current_TitleNUM, fontsize:defaultFONTSIZE,strokewidth:default_strokeWIDTH,selected: false};\r\n\t\t\tnodes.push(newnode);\r\n\t\t\tnumRec++;\r\n\t\t\tnumNode++;\t\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase \"triangle\":{\r\n\t\t\tNodecurrent_IdNUM++;\r\n\t\t\tnewnode = { id: \"node\"+String(Nodecurrent_IdNUM), type: _type, x:_pos.x, y:_pos.y, rx: default_RADIUSH,ry:default_RADIUSV, strokedotted:0, color: defaultCOLOR, title: title_pre, fontsize:defaultFONTSIZE,strokewidth:default_strokeWIDTH,selected: false};\r\n\t\t\tnodes.push(newnode);\r\n\t\t\tnumTri++;\r\n\t\t\tnumNode++;\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:;\r\n\t}//end of switch (_type) \r\n\treturn newnode;\r\n}", "insert (options) {\n // set the parent div and create the node:\n options.div= this.div.sub;\n options.control= this.control;\n var node= new MooTreeNode(options);\n // set the new node's parent:\n node.parent= this;\n // mark this node's last node as no longer being the last, then add the new last node:\n var n= this.nodes;\n if (n.length) n[n.length-1].last= false;\n n.push(node);\n // repaint the new node:\n node.update();\n // repaint the new node's parent (this node):\n if (n.length == 1) this.update();\n // recursively repaint the new node's previous sibling node:\n if (n.length > 1) n[n.length-2].update(true);\n return node;\n }", "insertAt(position,item){\n \n if(this.head === null){\n this.insertFirst(item);\n }\n \n let ticker = 0;\n let currNode = this.head;\n let nextNode = this.head;\n \n while ((nextNode !== null) && (ticker !== position)) {\n //save the previous node \n currNode = nextNode;\n nextNode = currNode.next;\n ticker++;\n }\n \n currNode.next = new _Node(item,nextNode);\n \n }", "function prepareUiNode( node, position ) {\n\t\t\n\t\tvar id = node.getId();\n\t\tvar type = node.getInfo().nodeType;\n\t\tvar name = node.getInfo().typeName;\n\t\t\n\t\tvar div = $('<div>', {id : id})\n\t\t\t\t\t.addClass(campaign_designer.settings.nodeClass)\n\t\t\t\t\t.offset(position)\n\t\t\t\t\t.appendTo(campaign_designer.settings.nodePositionRoot)\n\t\t\t\t\t.html(\tname+'<br/><br/>' + \n\t\t\t\t\t\t\t'<a href=\"#\" class=\"cmdLink edit\" rel=\"'+id+'\">edit</a><br/>'+\n\t\t\t\t\t\t\t'<a href=\"#\" class=\"cmdLink remove\" rel=\"'+id+'\">remove</a>');\n\t\tnode.setUiNode( div );\n\t\treturn div;\n\t}", "insert(element, position) {\n // check for out-of-bounds values\n if(index >= 0 && index <= this.count) { \n const node = new Node(element);\n // change the head reference to node and add a new element to the list\n if(index === 0) { \n node.next = current; \n this.head = node;\n // to loop through the list until the desired position\n } else {\n const previous = this.getElementAt(index - 1);\n node.next = previous.next; // to link the new node and the current\n previous.next = node; \n }\n this.count++;\n return true;\n }\n return false;\n }", "function createObject(position, member) {\n\n function newObj(position, member) {\n this.position = position;\n this.member = member;\n }\n\n var newOB = new newObj(position, member);\n\n listOfPosition.push(newOB);\n\n\n}", "function ParticleRotateToPositionNode(mode /*uint*/, position) {\n if (position === void 0) { position = null; }\n _super.call(this, \"ParticleRotateToPosition\", mode, 3, 3);\n this._pStateClass = ParticleRotateToPositionState;\n this._iPosition = position || new Vector3D();\n }", "function addEl() {\r\n var nodes = arguments\r\n for (var i = 1; i < nodes.length; i++) {\r\n nodes[i - 1].appendChild(nodes[i])\r\n }\r\n}", "insert(pos, val){\r\n\r\n if(pos > this.length || pos < 0) return false;\r\n\r\n if(pos === this.length){\r\n this.push(val);\r\n }else if(pos === 0){\r\n this.unshift(val);\r\n }else{\r\n let selectedNode = this.getNode(pos-1);\r\n let oldNext = selectedNode.next;\r\n\r\n let newNode = new Node(val);\r\n selectedNode.next = newNode;\r\n newNode.next = oldNext; \r\n newNode.prev = selectedNode;\r\n selectedNode.prev = newNode;\r\n this.length += 1;\r\n }\r\n\r\n return true;\r\n\r\n }", "static createNode(params) {\n let renderer = params.renderer;\n let paper = params.paper;\n let metadata = params.metadata;\n let position = params.position;\n let props = params.props;\n let graph = params.graph || (params.paper ? params.paper.model : undefined);\n let node;\n if (!position) {\n position = { x: 0, y: 0 };\n }\n if (renderer && isFunction(renderer.createNode)) {\n node = renderer.createNode(metadata, props);\n }\n else {\n node = new joint.shapes.flo.Node();\n if (metadata) {\n node.attr('.label/text', metadata.name);\n }\n }\n node.set('type', joint.shapes.flo.NODE_TYPE);\n if (position) {\n node.set('position', position);\n }\n if (props) {\n Array.from(props.keys()).forEach(key => node.attr(`props/${key}`, props.get(key)));\n }\n node.attr('metadata', metadata);\n if (graph) {\n graph.addCell(node);\n }\n if (renderer && isFunction(renderer.initializeNewNode)) {\n let descriptor = {\n paper: paper,\n graph: graph\n };\n renderer.initializeNewNode(node, descriptor);\n }\n return node;\n }", "add(value, type, name, status, description) {\n if(typeof value !== 'number') {\n return null;\n }\n\n if(!this.root) {\n this.root = new Node(value, type, name, status, description);\n return;\n }\n\n let _insert = (node) => {\n if(value < node.value) {\n if(node.left === null) {\n node.left = new Node(value, type, name, status, description);\n return;\n } else if (node.left !== null) {\n return +_insert(node.left);\n }\n } else if(value >= node.value) {\n if(node.right === null) {\n node.right = new Node(value, type, name, status, description);\n return;\n } else if (node.right !== null) {\n return _insert(node.right);\n }\n }\n }\n _insert(this.root);\n }", "function LayoutNode(plane, position) {\n return {\n plane: plane,\n position: position\n };\n }", "insertAt(element, pos) {\n let nodeToInsert = new Node(element);\n let count = 0;\n let current = this.head;\n let previous;\n if (pos === 0) {\n nodeToInsert.next = this.head;\n this.head = nodeToInsert;\n } else if (pos == this.size) {\n while (count < pos) {\n previous = current;\n current = current.next;\n count++;\n }\n previous.next = nodeToInsert;\n }\n else {\n while (count < pos) {\n previous = current;\n current = current.next;\n count++;\n }\n nodeToInsert.next = previous.next;\n previous.next = nodeToInsert;\n this.size++;\n }\n }", "givePosition() {\n let v = createVector(this.x, this.y);\n return v;\n }", "setPosition(pos) {\n this.position = pos;\n return this;\n }", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\n }", "function addNode(x,y,radius,nodeColor,nodeName)\r\n{\r\n\r\n\tnodeText[nodeString.length]='<text x=\"'+(x-4.3*nodeName.length)+'\" y=\"'+(y+2*radius)+'\" fill=\"white\">'+nodeName+'</text>';\r\n\tnodeString[nodeString.length]='<circle cx=\"'+x+'\" cy=\"'+y+'\" r=\"'+radius+'\" stroke=\"white\" stroke-width=\"1\" fill=\"'+nodeColor+'\" onmouseover=\"changeNodeInformation('+nodeString.length+')\" onClick=\"nodeClickHandle('+nodeString.length+')\" />';\r\n}", "function getNodeByPosition(positionPath){\n\tvar tree = positionPath.getTree();\n\tvar node = tree.root;\n\tvar pathValues = tree.path;\n\n\tfor(var i = 0; i < pathValues.length; i++){\n\t\tnode = node.childNodes[pathValues[i]];\n\t}\n\n\treturn node;\n}", "function insertOrAppend(container, pos, el) {\n var childs = container.childNodes;\n if (pos < childs.length) {\n var refNode = childs[pos];\n container.insertBefore(el, refNode);\n } else {\n container.appendChild(el);\n }\n }", "function position(val, norm_fn)\n{\n norm_fn = def(norm_fn, normalizePosition);\n\n var value = norm_fn(val);\n require(typeof value !== 'undefined',\n \"Cannot create Position instance from \" + repr(val));\n\n return new Position(value);\n}", "function position(val, norm_fn)\n{\n norm_fn = def(norm_fn, normalizePosition);\n\n var value = norm_fn(val);\n require(typeof value !== 'undefined',\n \"Cannot create Position instance from \" + repr(val));\n\n return new Position(value);\n}", "function addNode(){\n d.push(createNode(nodeCount));\n nodeCount++;\n}", "function insert(position, newText, annotation) {\n return {\n range: {\n start: position,\n end: position\n },\n newText: newText,\n annotationId: annotation\n };\n }", "add(index, value) {\n if (index < 0 || index > this.size()) return; /* TODO: Throw IndexOutOfBoundsException */\n if (index === 0) return this.addFirst(value);\n if (index === this.size()) return this.addLast(value);\n\n const newNode = new Node(value);\n const beforeNode = this._getNode(index - 1);\n const afterNode = beforeNode.next;\n beforeNode.next = newNode;\n newNode.next = afterNode;\n this.length++;\n return this;\n }", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "pushNewPos(x, y, stack)\n\t{\n\t\tconsole.log (\"==> \", x, \", \", y);\n let npos = new Position();\n\t\tnpos.setx(x);\n\t\tnpos.sety(y);\n\t\tif (this.maze.validPosition(x,y))\n\t\t\tstack.push(npos);\n\t}", "function createNode(radius, xStartPos, id) {\n var newNode = Object.create(nodeObject);\n newNode.radius = radius;\n newNode.x = xStartPos;\n newNode.y = 0;\n newNode.id = id;\n\n return newNode;\n}", "function addNode(val,node){\n\tconst link = document.createElement(\"a\");\n\tconst para = document.createElement(\"p\");\n\tpara.innerHTML = val;\n\tlink.appendChild(para)\n\tnode.appendChild(link)\n}", "add(x, y){\n return new Vector2(this.x + x, this.y + y);\n }", "add(v) {\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tthis.x += arguments[i].x\n\t\t\tthis.y += arguments[i].y\n\t\t}\n\n\t\treturn this;\n\t}", "positionInfo(position)\n {\n return new WorldPositionInfo(this, position);\n }", "function addNodeToCy(nodeText, x, y){\r\n\tif(x == undefined) x = 0;\r\n\tif(y == undefined) y = 0;\r\n\t\r\n\tif(hasSuperSubScript(nodeText)){\r\n\t\treturn insertSuperSubscript(nodeText, x, y);\r\n\t}\t\r\n\r\n\tnode = \t{ // node\" +\r\n\t\t\t\tdata: {name: nodeText/*, label_name: nodeText*/},\r\n\t\t\t\trenderedPosition: { x: x, y: y},\r\n\t\t\t\tclasses:['base']\r\n\t\t\t};\r\n\treturn cy.add(node);\r\n}", "function spawnLocation(xPos, yPos) {\n \n return { x: xPos, y: yPos };\n\n}", "function addPosition() {\n var newposition = $(\"#position\").val();\n var params = {\n \"position\": newposition\n };\n submitAJAX(\"newpos\", params, showPosResult);\n}", "function domMan(elType, text, position, callback){\n\tvar newEl = create(elType);\n\tvar textInfo = text;\n\tnewEl.appendChild(text);\n\tposition.appendChild(newEl);\n\n\tif(callback !== undefined){\n\t\tcallback(newEl);\n\t}\n}", "function node_position(node){\n params = {\n x: node.getX() - node.getOffsetX(),\n y: node.getY() - node.getOffsetY(),\n width: node.getWidth() * node.getScaleX(),\n height: node.getHeight() * node.getScaleY()\n };\n\n return params;\n}", "add(x, y) {\n return new Vector(this.x + x, this.y + y);\n }", "FetchNodeIndex(position)\n {\n return position.x + (position.y * grid.resolution);\n }" ]
[ "0.61838925", "0.5975954", "0.5896411", "0.5889737", "0.5836782", "0.5836782", "0.5836782", "0.5836782", "0.5836782", "0.5836782", "0.5797241", "0.5789583", "0.5781526", "0.57615995", "0.57338274", "0.57241637", "0.5719491", "0.5719491", "0.5719491", "0.5719491", "0.5719491", "0.57086736", "0.56893516", "0.5684465", "0.56465167", "0.55630183", "0.5561238", "0.5551208", "0.5551208", "0.5551208", "0.5551208", "0.55402005", "0.55402005", "0.5511158", "0.5511158", "0.5511158", "0.5467837", "0.5462288", "0.5421731", "0.54200983", "0.54188895", "0.5418269", "0.540257", "0.5395241", "0.53818196", "0.53694993", "0.5356576", "0.53513736", "0.5345609", "0.5294407", "0.5288704", "0.5270351", "0.52666134", "0.525453", "0.5245886", "0.51901966", "0.51582646", "0.5114254", "0.50883776", "0.5076634", "0.5063654", "0.50613284", "0.5042738", "0.5037679", "0.5037285", "0.5035269", "0.50212026", "0.50163466", "0.5004402", "0.49998775", "0.49977487", "0.4983958", "0.4979884", "0.49663872", "0.4951994", "0.49517924", "0.49501655", "0.4936872", "0.49223682", "0.48997322", "0.4878315", "0.4878315", "0.48723122", "0.48702878", "0.4861866", "0.48603418", "0.48603418", "0.48603418", "0.4858839", "0.4857934", "0.48454696", "0.4836376", "0.48341382", "0.48330703", "0.48326892", "0.48264247", "0.48153514", "0.48119074", "0.47987878", "0.47973844", "0.4789399" ]
0.0
-1
Functions just like apply, but resets the content: the line and column are reversed, and the eaten value is readded. This is useful for nodes with a single type of content, such as lists and tables. See `apply` above for what parameters are expected.
function reset() { var node = apply.apply(null, arguments); line = current.line; column = current.column; value = subvalue + value; return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }", "_reset(line, column) {\n this.tagName = '';\n this.attributes = [];\n this.endTag = false;\n this.endSlash = false;\n this.line = line;\n this.column = column;\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function position() {\n var start = { line: lineno, column: column };\n return function(node){\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "shiftRight() {\n for (let line of this.cells) {\n for (let i = line.length - 1; i > 0; i--) {\n line[i].setType(line[i - 1].type);\n }\n line[0].setType(BeadType.default);\n }\n }", "function position() {\n\t var start = { line: lineno, column: column };\n\t return function(node){\n\t node.position = new Position(start);\n\t whitespace();\n\t return node;\n\t };\n\t }", "reverseIndex() {\n this._restrictCursor();\n const buffer = this._bufferService.buffer;\n if (buffer.y === buffer.scrollTop) {\n // possibly move the code below to term.reverseScroll();\n // test: echo -ne '\\e[1;1H\\e[44m\\eM\\e[0m'\n // blankLine(true) is xterm/linux behavior\n const scrollRegionHeight = buffer.scrollBottom - buffer.scrollTop;\n buffer.lines.shiftElements(buffer.ybase + buffer.y, scrollRegionHeight, 1);\n buffer.lines.set(buffer.ybase + buffer.y, buffer.getBlankLine(this._eraseAttrData()));\n this._dirtyRowService.markRangeDirty(buffer.scrollTop, buffer.scrollBottom);\n }\n else {\n buffer.y--;\n this._restrictCursor(); // quickfix to not run out of bounds\n }\n return true;\n }", "restoreValueAt(columnIndex, rowIndex) {\n if (!this.hasCellAt(columnIndex, rowIndex))\n return;\n var cell = this.getCellElementAt(columnIndex, rowIndex);\n if (!latte._undef(cell.data('original-value'))) {\n this.setValueAt(columnIndex, rowIndex, cell.data('original-value'));\n cell.removeData('original-value');\n }\n }", "function position() {\n var start = {line: lineno, column: column}\n return function(node) {\n node.position = new Position(start)\n whitespace()\n return node\n }\n }", "function position() {\n const start = {\n line: lineno,\n column\n };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }", "function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }", "function reverseLine(line){\n \n var tempX = line.x1;\n var tempY = line.y1;\n line.x1 = line.x2;\n line.y1 = line.y2;\n line.x2 = tempX;\n line.y2 = tempY;\n \n return line;\n}", "function decrementColumn() {\n GameData.column = correctColumn(GameData.column--);\n}", "function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new ParsePosition(start);\n whitespace();\n return node;\n };\n }", "_reverseCols() {\n this.forEach(arr => {\n arr.reverse();\n });\n }", "restore() {\n if(this.saved.caret)\n this.set(this.saved.startNodeIndex, this.saved.startOffset);\n else\n this.set(this.saved.startNodeIndex, this.saved.startOffset,\n this.saved.endNodeIndex, this.saved.endOffset);\n }", "propagateFromRightSibling(node, parentPos, rightSibling) {\n let nodeElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, nodeElement, node.parent, parentPos)\n );\n\n let nodeElementLeftChildOldValue = nodeElement.leftChild;\n nodeElement.leftChild = node.hasRightmostChild() ? node.getRightmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.leftChild = nodeElementLeftChildOldValue;\n }\n );\n\n let nodeElementRightChildOldValue = nodeElement.rightChild;\n nodeElement.rightChild = rightSibling.getLeftmostChild();\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.rightChild = nodeElementRightChildOldValue;\n }\n );\n\n if (nodeElement.hasLeftChild()) {\n let nodeElementLeftChildParentOldValue = nodeElement.leftChild.parent;\n nodeElement.leftChild.parent = node;\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.leftChild.parent = nodeElementLeftChildParentOldValue;\n }\n );\n }\n\n if (nodeElement.hasRightChild()) {\n let nodeElementRightChildParent = nodeElement.rightChild.parent;\n nodeElement.rightChild.parent = node;\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.rightChild.parent = nodeElementRightChildParent;\n }\n );\n }\n\n node.addLast(nodeElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, node)\n );\n\n let parentElement = rightSibling.popFirst();\n this.addAtLastIndexOfCallStack(\n this.undoPopFirst.bind(this, parentElement, rightSibling)\n );\n\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n );\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = rightSibling;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue;\n }\n );\n\n node.parent.addAt(parentPos, parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddAt.bind(this, node.parent, parentPos)\n );\n }", "propagateFromLeftSibling(node, parentPos, leftSibling) {\n let nodeElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, nodeElement, node.parent, parentPos)\n );\n\n let oldLeftChildValue = nodeElement.leftChild;\n nodeElement.leftChild = leftSibling.getRightmostChild();\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.leftChild = oldLeftChildValue;\n }\n );\n\n let oldRightChildValue = nodeElement.rightChild;\n nodeElement.rightChild = node.hasLeftmostChild() ? node.getLeftmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.rightChild = oldRightChildValue;\n }\n );\n\n if (nodeElement.hasLeftChild()) {\n let oldLeftChildParentValue = nodeElement.leftChild.parent;\n nodeElement.leftChild.parent = node;\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.leftChild.parent = oldLeftChildParentValue\n }\n );\n }\n\n if (nodeElement.hasRightChild()) {\n let oldRightChildParentValue = nodeElement.rightChild.parent;\n nodeElement.rightChild.parent = node;\n this.addAtLastIndexOfCallStack(\n () => {\n nodeElement.rightChild.parent = oldRightChildParentValue\n }\n );\n }\n\n node.addFirst(nodeElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddFirst.bind(this, node)\n );\n\n let parentElement = leftSibling.popLast();\n this.addAtLastIndexOfCallStack(\n this.undoPopLast.bind(this, parentElement, leftSibling)\n );\n\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = leftSibling;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n );\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue\n }\n );\n\n node.parent.addAt(parentPos, parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddAt.bind(this, node.parent, parentPos)\n );\n }", "function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }", "function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }", "function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }", "function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }", "function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }", "function flip(board, row, col) {\n const index = rowColToIndex(board, row, col);\n let boardCopy = [...board];\n if (boardCopy[index] === \"X\") {\n boardCopy = setBoardCell(boardCopy, \"O\", row, col);\n return boardCopy;\n }\n else if (boardCopy[index] === \"O\") {\n boardCopy = setBoardCell(boardCopy, \"X\", row, col);\n return boardCopy;\n }\n else {\n return boardCopy;\n }\n}", "function revert(h, node) {\n var subtype = node.referenceType\n var suffix = ']'\n var contents\n var head\n var tail\n\n if (subtype === 'collapsed') {\n suffix += '[]'\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']'\n }\n\n if (node.type === 'imageReference') {\n return u('text', '![' + node.alt + suffix)\n }\n\n contents = all(h, node)\n head = contents[0]\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value\n } else {\n contents.unshift(u('text', '['))\n }\n\n tail = contents[contents.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += suffix\n } else {\n contents.push(u('text', suffix))\n }\n\n return contents\n}", "function testTree_TableAccess_CrossColumnIndex_Reverse() {\n var treeBefore =\n 'project()\\n' +\n '-order_by(DummyTable.string DESC, DummyTable.number DESC)\\n' +\n '--select(value_pred(DummyTable.boolean eq false))\\n' +\n '---table_access(DummyTable)\\n';\n\n var treeAfter =\n 'project()\\n' +\n '-select(value_pred(DummyTable.boolean eq false))\\n' +\n '--table_access_by_row_id(DummyTable)\\n' +\n '---index_range_scan(DummyTable.pkDummyTable, ' +\n '[unbound, unbound],[unbound, unbound], reverse)\\n';\n\n var rootNodeBefore = constructTree2(lf.Order.DESC, lf.Order.DESC);\n assertEquals(treeBefore, lf.tree.toString(rootNodeBefore));\n\n var pass = new lf.proc.OrderByIndexPass(hr.db.getGlobal());\n var rootNodeAfter = pass.rewrite(rootNodeBefore);\n assertEquals(treeAfter, lf.tree.toString(rootNodeAfter));\n}", "function undo(){\n _.last(lines).remove();\n lines.pop();\n}", "setNodeColumn() {\n const node = this;\n if (!defined(node.options.column)) {\n // No links to this node, place it left\n if (node.linksTo.length === 0) {\n node.column = 0;\n }\n else {\n node.column = node.getFromNode().fromColumn + 1;\n }\n }\n }", "function mirrorVertical(originalFunction){\n return function(parameter){\n var point = originalFunction(parameter);\n point[1] = -point[1];\n return point;\n }\n}", "restoreOriginalState() {\n\n\t\tconst originalValueOffset = this.valueSize * 3;\n\t\tthis.binding.setValue( this.buffer, originalValueOffset );\n\n\t}", "function defaultTransform_(data, row, column, options) {\r\n if (!data[row][column]) {\r\n if (row < 2 || hasOption_(options, \"noInherit\")) {\r\n data[row][column] = \"\";\r\n } else {\r\n data[row][column] = data[row-1][column];\r\n }\r\n }\r\n\r\n if (!hasOption_(options, \"rawHeaders\") && row == 0) {\r\n if (column == 0 && data[row].length > 1) {\r\n removeCommonPrefixes_(data, row);\r\n }\r\n\r\n data[row][column] = toTitleCase_(data[row][column].toString().replace(/[\\/\\_]/g, \" \"));\r\n }\r\n\r\n if (!hasOption_(options, \"noTruncate\") && data[row][column]) {\r\n data[row][column] = data[row][column].toString().substr(0, 256);\r\n }\r\n\r\n if (hasOption_(options, \"debugLocation\")) {\r\n data[row][column] = \"[\" + row + \",\" + column + \"]\" + data[row][column];\r\n }\r\n}", "@action eventBinder() {\n var that = this;\n\n that.startPos = 0;\n that.endPos = 0;\n that.selection = '';\n that.lastchar = '\\n';\n that.previousValue = that.value;\n\n that.clearUndo();\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle,\n line = handle;\n\n if (typeof handle == \"number\") {\n line = getLine(doc, clipLine(doc, handle));\n } else {\n no = lineNo(handle);\n }\n\n if (no == null) {\n return null;\n }\n\n if (op(line, no) && doc.cm) {\n regLineChange(doc.cm, no, changeType);\n }\n\n return line;\n } // The document is represented as a BTree consisting of leaves, with", "function getCursor($node, offset) {\n\t\t\t\t$nodeTd = $node.parent();\n \t\t\tvar oldLine, newLine;\n\t\t\t\tif (!$nodeTd.hasClass(\"old\") && !$nodeTd.hasClass(\"new\") \n\t\t\t\t\t\t|| $nodeTd.hasClass(\"old\") && $nodeTd.hasClass(\"new\")) {\n\t\t\t\t\toldLine = $nodeTd.data(\"old\") + 1;\n\t\t\t\t\tnewLine = $nodeTd.data(\"new\") + 1;\n\t\t\t\t} else if ($nodeTd.hasClass(\"old\")) {\n\t\t\t\t\toldLine = $nodeTd.data(\"old\") + 1;\n\t\t\t\t} else {\n\t\t\t\t\tnewLine = $nodeTd.data(\"new\") + 1;\n\t\t\t\t}\n\t\t\t\tvar $contents = $nodeTd.contents();\n\t\t\t\tvar oldOffset = 0, newOffset = 0;\n \t\t\tfor (var i=0; i<$contents.length; i++) {\n \t\t\t\tvar $content = $($contents[i]);\n \t\t\t\tif ($content.is($node)) {\n \t\t\t\t\tif ($content.hasClass(\"delete\")) { \n \t\t\t\t\t\toldCh = oldOffset + offset;\n \t\t\t\t\t\tnewCh = undefined;\n \t\t\t\t\t\tnewLine = undefined;\n \t\t\t\t\t} else if ($content.hasClass(\"insert\")) {\n \t\t\t\t\t\toldCh = undefined;\n \t\t\t\t\t\toldLine = undefined;\n \t\t\t\t\t\tnewCh = newOffset + offset;\n \t\t\t\t\t} else {\n \t\t\t\t\t\toldCh = oldOffset + offset;\n \t\t\t\t\t\tnewCh = newOffset + offset;\n \t\t\t\t\t}\n \t\t\t\t\tbreak;\n \t\t\t\t} else {\n \t\t\t\t\tvar len = $content.text().length;\n \t\t\t\t\tif ($content.hasClass(\"delete\")) {\n \t\t\t\t\t\toldOffset += len;\n \t\t\t\t\t} else if ($content.hasClass(\"insert\")) {\n \t\t\t\t\t\tnewOffset += len;\n \t\t\t\t\t} else {\n\t \t\t\t\t\toldOffset += len;\n\t \t\t\t\t\tnewOffset += len;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tif ($nodeTd.hasClass(\"left\")) {\n \t\t\t\tnewLine = newCh = undefined;\n \t\t\t} else if ($nodeTd.hasClass(\"right\")) {\n \t\t\t\toldLine = oldCh = undefined;\n \t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\toldLine: oldLine,\n\t\t\t\t\toldCh: oldCh,\n\t\t\t\t\tnewLine: newLine,\n\t\t\t\t\tnewCh: newCh\n\t\t\t\t};\n \t\t}", "invert() {\r\n this.data = this.data.map(rows => rows.map(cols => cols*-1));\r\n }", "function modifyClearCells(arg, row, column) {\r\n\tvar i = arg.emptyCells.indexOf(String(row) + String(column));\r\n\targ.emptyCells.splice(i, 1);\r\n}", "function flipRe(idx) {return {row: Math.floor(idx/numRows), ele: idx%numRows}}", "function moveRight() {\n\t\tfor (var row = 0; row < Rows; row++) {\n\t\t\tarrayCol = new Array(Cols);\n\t\t\tfor (var col = 0; col < Cols; col++) {\n\t\t\t\tarrayCol[col] = matrix[row][Cols - 1 - col];\n\t\t\t}\n\t\t\tmatrix[row] = newArray(arrayCol).reverse();\n\t\t}\n\n\t\tdraw();\n\t}", "function clearCell(x,y){}", "function undo() {\n updateFormula(function(text) {\n return text.slice(0, -1);\n });\n }", "propagateDownFromLeft(node, parentPos, leftSibling) {\n let parentElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, parentElement, node.parent, parentPos)\n );\n if (node.parent.hasRightChildAt(parentPos - 1)) {\n let nodeParentAtRightChildOldValue = node.parent.at(parentPos - 1).rightChild;\n node.parent.at(parentPos - 1).rightChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent.at(parentPos - 1).rightChild = nodeParentAtRightChildOldValue;\n }\n );\n }\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = null;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n )\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = node.hasLeftmostChild() ? node.getLeftmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue;\n }\n )\n\n node.addFirst(parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddFirst.bind(this, node)\n );\n\n let nodeIsLeafOldValue = node.isLeaf;\n node.isLeaf = node.isLeaf && leftSibling.isLeaf;\n this.addAtLastIndexOfCallStack(\n () => {\n node.isLeaf = nodeIsLeafOldValue;\n }\n );\n\n this.mergeToRight(leftSibling, node);\n if (node.parent === this.root && this.root.size() === 0) {\n let rootOldValue = this.root;\n this.root = node;\n this.addAtLastIndexOfCallStack(\n () => {\n this.root = rootOldValue;\n }\n );\n\n let nodeParentOldValue = node.parent;\n node.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent = nodeParentOldValue;\n }\n )\n }\n }", "originalValue(columnIndex, rowIndex, value = null) {\n var cell = this.getCellElementAt(columnIndex, rowIndex);\n if (latte._undef(value))\n return cell.data('original-value');\n cell.data('original-value', value);\n return this;\n }", "function R(e,t,a){if(void 0===a&&(a=null),!(this instanceof R))return new R(e,t,a);this.line=e,this.ch=t,this.sticky=a}", "propagateDownFromRight(node, parentPos, rightSibling) {\n let parentElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, parentElement, node.parent, parentPos)\n );\n\n if (node.parent.hasLeftChildAt(parentPos)) {\n let nodeParentAtLeftChildOldValue = node.parent.at(parentPos).leftChild;\n node.parent.at(parentPos).leftChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent.at(parentPos).leftChild = nodeParentAtLeftChildOldValue;\n }\n )\n }\n\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = node.hasRightmostChild() ? node.getRightmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n );\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = null;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue;\n }\n );\n\n node.addLast(parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, node)\n );\n\n let nodeIsLeafOldValue = node.isLeaf;\n node.isLeaf = node.isLeaf && rightSibling.isLeaf;\n this.addAtLastIndexOfCallStack(\n () => {\n node.isLeaf = nodeIsLeafOldValue;\n }\n );\n\n this.mergeToLeft(node, rightSibling);\n\n\n if (node.parent === this.root && this.root.size() === 0) {\n let rootOldValue = this.root;\n this.root = node;\n this.addAtLastIndexOfCallStack(\n () => {\n this.root = rootOldValue;\n }\n )\n\n let nodeParentOldValue = node.parent;\n node.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent = nodeParentOldValue;\n }\n );\n }\n }", "clear() {\n if (this.buffer.ybase === 0 && this.buffer.y === 0) {\n // Don't clear if it's already clear\n return;\n }\n this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y));\n this.buffer.lines.length = 1;\n this.buffer.ydisp = 0;\n this.buffer.ybase = 0;\n this.buffer.y = 0;\n for (let i = 1; i < this.rows; i++) {\n this.buffer.lines.push(this.buffer.getBlankLine(DEFAULT_ATTR_DATA));\n }\n this.refresh(0, this.rows - 1);\n this._onScroll.fire(this.buffer.ydisp);\n }", "undoPos()\n {\n this.dot.undoPos();\n }", "function reverseMutate() {\n let newOnes = ones.slice().reverse();\n console.log(ones);\n console.log(newOnes);\n }", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "function removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}", "set(row, column, value) {\n const n = this._width * row + column;\n this._elements[n] = value;\n return this;\n }", "function SpreadFromLeft(tree) {\n\n return Spread(+tree.getAttribute(\"data-x\") - 1,\n +tree.getAttribute(\"data-y\"));\n\n}", "trimEmptyLines () {\n this.trimEmptyLinesAtBeginning()\n\n this.lines.reverse()\n this.trimEmptyLinesAtBeginning()\n this.lines.reverse()\n }", "function rewriteXY(newMatrix,rewX rewY, rewValue) {\n\t\tvar zwischenSpeicher = newMatrix[rewX];\n\t\tzwischenSpeicher[rewY] = rewValue;\n\t\tnewMatrix[rewX] = zwischenSpeicher;\n\t\treturn newMatrix;\t\n\t}", "function borrarRow2(e) {\n // console.log(e);\n e.target.parentNode.parentNode.removeChild(e.target.parentNode);\n document.querySelector('textarea').value = ej;\n}", "clearEol() {\n const {cursor, bg_color, size, font_attr} = this.proxy\n const {line, col} = cursor\n const clear_length = (size.cols - col) * font_attr.font_width\n log.debug(`Clear until EOL: ${line}:${col} length=${clear_length}`)\n this.drawBlock(line, col, 1, clear_length, bg_color)\n this.lines.clearEol(line, col)\n }", "function relaxRightToLeft(columns, alpha, beta) {\n for (var n = columns.length, i = n - 2; i >= 0; --i) {\n var column = columns[i];\n for (var _i = 0, column_2 = column; _i < column_2.length; _i++) {\n var source = column_2[_i];\n var y = 0;\n var w = 0;\n for (var _a = 0, _b = source.sourceLinks; _a < _b.length; _a++) {\n var _c = _b[_a], target = _c.target, value_2 = _c.value;\n var v = value_2 * (target.layer - source.layer);\n y += sourceTop(source, target) * v;\n w += v;\n }\n if (!(w > 0))\n continue;\n var dy_2 = (y / w - source.y0) * alpha;\n source.y0 += dy_2;\n source.y1 += dy_2;\n reorderNodeLinks(source);\n }\n if (sort === undefined)\n column.sort(ascendingBreadth);\n if (column.length)\n resolveCollisions(column, beta);\n }\n }", "function columnize($putInHere, $pullOutHere, $parentColumn, height){\n while($parentColumn.height() < height &&\n $pullOutHere[0].childNodes.length){\n $putInHere.append($pullOutHere[0].childNodes[0]);\n }\n if($putInHere[0].childNodes.length == 0) return;\n\n // now we're too tall, undo the last one\n var kids = $putInHere[0].childNodes;\n var lastKid = kids[kids.length-1];\n $putInHere[0].removeChild(lastKid);\n var $item = jQuery(lastKid);\n\n\n if($item[0].nodeType == 3){\n // it's a text node, split it up\n var oText = $item[0].nodeValue;\n var counter2 = options.width / 18;\n if(options.accuracy)\n counter2 = options.accuracy;\n var columnText;\n var latestTextNode = null;\n while($parentColumn.height() < height && oText.length){\n if (oText.indexOf(' ', counter2) != '-1') {\n columnText = oText.substring(0, oText.indexOf(' ', counter2));\n } else {\n columnText = oText;\n }\n latestTextNode = document.createTextNode(columnText);\n $putInHere.append(latestTextNode);\n\n if(oText.length > counter2){\n oText = oText.substring(oText.indexOf(' ', counter2));\n }else{\n oText = \"\";\n }\n }\n if($parentColumn.height() >= height && latestTextNode != null){\n // too tall :(\n $putInHere[0].removeChild(latestTextNode);\n oText = latestTextNode.nodeValue + oText;\n }\n if(oText.length){\n $item[0].nodeValue = oText;\n }else{\n return false; // we ate the whole text node, move on to the next node\n }\n }\n\n if($pullOutHere.children().length){\n $pullOutHere.prepend($item);\n }else{\n $pullOutHere.append($item);\n }\n\n return $item[0].nodeType == 3;\n }", "function operate() {\n var matrix = this.matrix,\n dataProvider = this.dataProvider;\n matrix.cellReferences.length = 0;\n (0, _array.arrayEach)(matrix.data, function (cell) {\n cell.setState(_value.default.STATE_OUT_OFF_DATE);\n cell.clearPrecedents();\n var row = cell.row,\n column = cell.column;\n var value = dataProvider.getSourceDataAtCell(row, column);\n\n if ((0, _utils.isFormulaExpression)(value)) {\n var prevRow = visualRows.get(cell);\n var expModifier = new _expressionModifier.default(value);\n expModifier.translate({\n row: dataProvider.t.toVisualRow(row) - prevRow\n });\n dataProvider.updateSourceData(row, column, expModifier.toString());\n }\n });\n visualRows = null;\n}", "function removePosition(node, force) {\n visit(node, force ? hard : soft);\n return node;\n}", "function toggleleft () {\n\n // grab the current column1 column and save it!\n old_column1 = document.getElementById(\"hello-world-column1\").innerHTML;\n\n // replace the screen contents of column1 column with new_text\n document.getElementById(\"hello-world-column1\").innerHTML = new_column1;\n\n\n console.log(\"-- updated by click --\");\n console.log(\"new_column1: \" + new_column1);\n console.log(\"old_column1: \" + old_column1);\n console.log(\"----------------------\\n\\n\\n\");\n\n // this allows the \"toggle\" - we swap the old for the new!\n new_column1 = old_column1;\n\n console.log(\"-- updated by \\\"toggle\\\" --\");\n console.log(\"new_column1: \" + new_column1);\n console.log(\"old_column1: \" + old_column1);\n console.log(\"*** NOTE: new_column1 == old_column1 now! ***\");\n console.log(\"-------------------------\\n\\n\\n\");\n }", "function consume() {\n // Line ending; assumes CR is not used (remark removes those).\n if (value.charCodeAt(index) === lineFeed) {\n place.line++\n place.column = 1\n }\n // Anything else.\n else {\n place.column++\n }\n\n index++\n\n place.offset++\n place.index = index\n }", "function undoMove(board, move) {\n board[move] = ' ';\n}", "function mirrorHorizontal(originalFunction){\n return function(parameter){\n var point = originalFunction(parameter);\n point[0] = -point[0];\n return point;\n }\n}", "pop()\n\t{\n\t\tthis.rows.pop();\n\t\t// Update the column count\n\t\tthis.width = this.rows.reduce(\n\t\t\t(width, row) => Math.max(row.type == 'full' ? 1 : row.data.length, width),\n\t\t\t0\n\t\t);\n\t}", "function colRev(col, rev){\n\tanimateCollapse(col);\n\tsetTimeout(animateReveal(rev), 1500);\n}", "function helper(change){\n let [row, col] = change\n for(let i = 0; i < matrix.length; i+=1){\n matrix[i][col] = 0\n }\n for(let j = 0; j < matrix[0].length; j+=1){\n matrix[row][j] = 0\n }\n }", "shiftLeft() {\n for (let line of this.cells) {\n for (let i = 0; i < line.length - 1; i++) {\n line[i].setType(line[i + 1].type);\n }\n line[line.length - 1].setType(BeadType.default);\n }\n }", "function resetRowContents()\r\n\t{\r\n\r\n\t\tvar theCell;\r\n\t\tvar thisRow;\r\n\r\n\t\tif ( editingRow !== -1 )\r\n\t\t{\r\n\t\t\t// get a reference to the Cell selected\r\n\t\t\ttheCell = document.getElementById('cell' + editingRow);\r\n\r\n\t\t\tthisRow = class_myRows[editingRow];\r\n\r\n\t\t\t// re-create the cell as it was before\r\n\t\t\tif ( thisRow.link.length > 0 )\r\n\t\t\t{\r\n\t\t\t\ttheCell.innerHTML= \"<A href=\\\"\" + thisRow.link + getOptionalParams( thisRow ) + \"\\\">\" + thisRow.name + \"</a> \" + fn_MenuStr( '', '', thisRow.dataId, '', imgSrc, LocString( 'Functions' ), '' ) + thisRow.modifiedImgs;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttheCell.innerHTML= \"&nbsp;\" + thisRow.name + fn_MenuStr( '', '', thisRow.dataId, '', imgSrc, LocString( 'Functions' ), '' ) + thisRow.modifiedImgs;\r\n\t\t\t}\r\n\t\t\teditingRow = -1;\r\n\t\t\tkillPopup();\r\n\t\t}\r\n\t}", "function r(e,t,n,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==o?null:o,null!=r&&this.add(r)}", "function flipCell(y, x) {\n if (x >= 0 && x < ncols && y >= 0 && y < nrows) {\n board[y][x] = !board[y][x];\n }\n }", "function break_up_node(read_node, $write_context) {\n \n // check type to determine how to break it\n if (read_node.nodeType == Node.TEXT_NODE) {\n \n // text nodes get chopped up by words\n $write_context = write_text_to_column($(read_node), $write_context);\n \n } else {\n \n // put an empty clone of it in the column (the same one the whole didn't fit into)\n // and trigger the recursion.\n var $write_sub_context = $(read_node).clone().empty().appendTo($write_context);\n $write_context = walk_read_nodes($(read_node), $write_sub_context);\n }\n return $write_context;\n }", "function SpreadFromRight(tree) {\n\n return Spread(+tree.getAttribute(\"data-x\") + 1,\n +tree.getAttribute(\"data-y\"));\n\n}", "restorePos(_x, _y)\n {\n this.x = _x;\n this.y = _y;\n }", "_undo() {\n for (const [k, v] of Object.entries(this._undos)) {\n if (v) {\n\tthis._cells[k] = v;\n }\n else {\n\tdelete this._cells[k];\n }\n }\n }", "revert() { }", "Rewind() {}", "undo() {\n if (this.canUndo()) {\n this.shouldSaveHistory = false;\n const { index, state } = this.stack[(this.position -= 1)];\n this.onUpdate();\n\n this.editor.blocks.render({ blocks: state }).then(() => this.editor.caret.setToBlock(index, \"end\"));\n }\n }", "function reverseRowsAndColumns(matrix) {\n let transformedMx = [];\n matrix.map((row) => {\n row.map((val, cIndex) => {\n if (!transformedMx[cIndex]) transformedMx.push([]);\n transformedMx[cIndex].push(val);\n});\n});\n return transformedMx;\n}", "restoreValue() {\n this.textInputNode.value = this.originalValue;\n }", "function redips_column(std){\n\tvar nrows = std.hall.nrows;\n\treturn nrows - 1 - (std.hall_position.charCodeAt(0) - 65); // 'A' is 65, 'B' is 66, .. Vertical offset -1\n}", "function backspace() {\n if (calcVals.cur.length > 0) {\n calcVals.cur = calcVals.cur.substring(0, calcVals.cur.length - 1);\n }\n if (calcVals.cur.length === 0) {\n calcVals.cur = \"0\";\n }\n calcVals.prevAttr = \"filler\";\n}", "function _overwrite(args, t) {\n var previous = _stack[_index].graph;\n if (_index > 0) {\n _index--;\n _stack.pop();\n }\n _stack = _stack.slice(0, _index + 1);\n var actionResult = _act(args, t);\n _stack.push(actionResult);\n _index++;\n return change(previous);\n }", "function changeLine(doc, handle, changeType, op) {\n\t\t var no = handle, line = handle;\n\t\t if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n\t\t else { no = lineNo(handle); }\n\t\t if (no == null) { return null }\n\t\t if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n\t\t return line\n\t\t }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }" ]
[ "0.7279967", "0.53816366", "0.5181726", "0.5181726", "0.5181726", "0.5181726", "0.5181726", "0.5181726", "0.518022", "0.5168249", "0.51546454", "0.5096495", "0.50748134", "0.49779323", "0.48814023", "0.48670864", "0.48515305", "0.48410198", "0.48259494", "0.4816414", "0.47779927", "0.47696638", "0.47500166", "0.47500166", "0.47500166", "0.47500166", "0.47500166", "0.4730854", "0.46875343", "0.46797904", "0.46763974", "0.46630433", "0.46574906", "0.46526486", "0.4651271", "0.46402553", "0.46313882", "0.46107623", "0.46094888", "0.4603389", "0.4596182", "0.45866966", "0.45780236", "0.45723143", "0.4560961", "0.4559861", "0.4543588", "0.4542743", "0.45310867", "0.45182443", "0.4513178", "0.4512272", "0.4512272", "0.4512272", "0.45052898", "0.4480448", "0.44678894", "0.44660395", "0.44643095", "0.4457684", "0.44576266", "0.44532427", "0.44470656", "0.44438514", "0.44390723", "0.44383502", "0.4425487", "0.44237363", "0.44203946", "0.44124344", "0.44118154", "0.4409773", "0.4403851", "0.43905437", "0.43903536", "0.4377511", "0.4370563", "0.4367479", "0.43667102", "0.43639556", "0.43628803", "0.4360203", "0.434648", "0.43464598", "0.43334365", "0.43270382", "0.43243802", "0.43208754", "0.43165198", "0.43165198", "0.43165198", "0.43165198", "0.43165198", "0.43165198", "0.43165198", "0.43165198" ]
0.71733314
5
Test the position, after eating, and reverse to a noteaten state.
function test() { var result = pos({}); line = current.line; column = current.column; value = subvalue + value; return result.position; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "backToPosition() {\n while (this.current_position != this.position) {\n this.closeDoors();\n if (this.current_position > this.position) {\n this.moveDown();\n console.log(this.current_position);\n } else if (this.current_position < this.position) {\n this.moveUp();\n }\n console.log(this.current_position);\n }\n this.openDoors = true;\n }", "function handleReversedCoordinates(){\n if (complexScope.aLeftUpper > complexScope.aRightBottom) {\n complexScope.changer = complexScope.aLeftUpper;\n complexScope.aLeftUpper = complexScope.aRightBottom;\n complexScope.aRightBottom = complexScope.changer;\n // if you create the new area from right to left\n }\n if (complexScope.bLeftUpper < complexScope.bRightBottom) {\n complexScope.changer = complexScope.bLeftUpper;\n complexScope.bLeftUpper = complexScope.bRightBottom;\n complexScope.bRightBottom = complexScope.changer;\n // if you create the new area from right to left\n }\n }", "eat(pos) {\n \tvar x = this.frame.x;\n var y = this.frame.y;\n if(x == pos.x && y == pos.y) {\n return true;\n }\n return false;\n }", "function updateFoodAcquiredState(){\n if(snake.history[0].x === food.x && snake.history[0].y === food.y){\n $(\"#success\").get(0).play();\n points = points + 10;\n $(\"#points\").html(points);\n snake.history.unshift({x:snake.history[0].x,y:snake.history[0].y});\n toBeClearedFields.push(food);\n food.x = Math.floor(Math.random() * size);\n food.y = Math.floor(Math.random() * size);\n }\n }", "markOff(){\n this.room.unmarkPosition(this.positionX, this.positionY);\n }", "eoi() { return this.pos==this.end }", "function inPosA2() {\n\trandomNum = Random.value * 10;\n\n\tif(targetDirF == true && randomNum < 6){\n\t\t//do nothing, go forward\n\t\tcalculatingMove = false;\n\t}else if(targetDirR == true){\n\t\t//turn right\n\t\tif(targetTurnR2 == 0){\n\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR1;\n\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t}else{\n\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR2;\n\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t}\n\t}else{\n\t\tif(targetDirF == true){\n\t\t\t//do nothing, go forward\n\t\t\tcalculatingMove = false;\n\t\t}else if(targetDirR == true){\n\t\t\t//turn right\n\t\t\tif(targetTurnR2 == 0){\n\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR1;\n\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t}else{\n\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR2;\n\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t}\n\t\t}else{\n\t\t\tDebug.Log(\"Error with turn selection, position A2\");\n\t\t\ttransform.GetComponent(aiStates).startAgain = true;\n\t\t}\n\t}\n}", "eat(pos){\n let x = this.body[this.body.length-1].x\n let y = this.body[this.body.length-1].y\n if (x == pos.x && y == pos.y){\n this.grow();\n return true;\n }\n else{\n false;\n }\n }", "click(e, position) {\n\t/*check if the positon in state.position is empty, else alert invalid*/\n if (this.state.positions[position] == \"\") {\n this.state.positions.splice(position, 1, this.state.toggle);\n this.setState({ positions: this.state.positions });\n this.winner()\n if (this.state.toggle == \"x\") {\n this.setState({ toggle: \"o\" })\n } else {\n this.setState({ toggle: \"x\" })\n };\n } else { alert(\"invalid\") }\n }", "function goBackward(rover) {\n switch (rover.direction) {\n case 'N':\n rover.position[0]--\n break;\n case 'E':\n rover.position[1]--\n break;\n case 'S':\n rover.position[0]++\n break;\n case 'W':\n rover.position[1]++\n break;\n };\n\t\tconsole.log(\"New Rover Position: [\" + rover.position[0] + \", \" + rover.position[1] + \"]\")\n}", "function check_arrow(event){\r\n\r\n const LEFT_KEY = 37;\r\n const RIGHT_KEY = 39;\r\n const UP_KEY = 38;\r\n const DOWN_KEY = 40;\r\n\r\n if(changing_direction) return;\r\n changing_direction = true;\r\n const keyPressed = event.keyCode;\r\n // Use this to check if the snake is moving in the reverse side\r\n const goingUp = dy === -10;\r\n const goingDown = dy === 10;\r\n const goingRight = dx === 10;\r\n const goingLeft = dx === -10;\r\n\r\n if(keyPressed === LEFT_KEY && !goingRight){\r\n dx = -10;\r\n dy = 0;\r\n }\r\n\r\n if(keyPressed === RIGHT_KEY && !goingLeft){\r\n dx = 10;\r\n dy = 0;\r\n }\r\n\r\n if(keyPressed === UP_KEY && !goingDown){\r\n dx = 0;\r\n dy = -10;\r\n }\r\n\r\n if(keyPressed === DOWN_KEY && !goingUp){\r\n dx = 0;\r\n dy = 10;\r\n }\r\n}", "function noteOff(noteNumber) { }", "function checkForTrick(trickEndPosition : Vector3)\n\t{\n\t\tvar xDifference : float = 0;\n\t\t\n\t\txDifference = trickEndPosition.x - trickStartPosition.x;\n\t\t\n\t\tif(xDifference < -180 || xDifference > 180)//they did a flip\n\t\t{\n\t\t\tvar didATrick : String = \"hi\";\n\t\t\txDifference = 2;\n\t\t}\n\t\t\n\t\ttrickStartPosition = new Vector3(0,0,0);\n\t}", "function downPropogate(){\n newPosition = ghostPosition + options[3]\n newGhostDirection = directions[3]\n if (!canMove()) {\n let randomIndex = Math.floor(Math.random()*2)+1\n newPosition = ghostPosition + options[randomIndex]\n newGhostDirection = directions[randomIndex]\n if (!canMove()){\n randomIndex = (randomIndex===1) ? 2:1\n newPosition = ghostPosition + options[randomIndex]\n newGhostDirection = directions[randomIndex]\n if (!canMove()){\n newPosition = ghostPosition + options[0]\n newGhostDirection = directions[0]\n }\n }\n }\n }", "function encloseRightState(){\n if(shipY < 0){\n shipY = 0;\n }\n if(shipY > height - 50){\n shipY = height - 50;\n }\n if(shipX > width - 40){\n shipX = width - 40;\n }\n}", "moveForward () {\n let posAux = Object.assign({}, this.position);\n switch (this.position.orientation) {\n case 'N':\n this.position.column++;\n break;\n case 'S':\n this.position.column--;\n break;\n case 'E':\n this.position.row--;\n break;\n case 'W':\n this.position.row++;\n break;\n default:\n break;\n }\n this.isLost(posAux);\n }", "function outOfSight(){\n\t\tif(snakeArr[0].x>99&&currentMove=='r'){\n\t\t\treturn 'rightExcede';\n\t\t}\n\t\telse if(snakeArr[0].x<0&&currentMove=='l'){\n\t\t\treturn 'leftExcede';\n\t\t}\n\t\telse if(snakeArr[0].y>45.5&&currentMove=='b'){\n\t\t\treturn 'bottomExcede';\n\t\t}\n\t\telse if(snakeArr[0].y<0&&currentMove=='t'){\n\t\t\treturn 'topExcede';\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "winner(){\n const msg = \" Winner is: \" + this.state.toggle;\n /*check from the central position */\n if(this.state.positions[4]!==\"\"){\n if(this.state.positions[0]===this.state.positions[4] && this.state.positions[4]===this.state.positions[8]||\n this.state.positions[2]===this.state.positions[4] && this.state.positions[4]===this.state.positions[6]||\n this.state.positions[1]===this.state.positions[4] && this.state.positions[4]===this.state.positions[7]||\n this.state.positions[3]===this.state.positions[4] && this.state.positions[4]===this.state.positions[5]\n ){\n alert(msg)\n this.setState({positions:[\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"]});\n this.setState({toggle:\"x\"});\n }\n /*check from the inicial position */\n \t}else if(this.state.positions[0]!==\"\"){\n \tif(this.state.positions[1]===this.state.positions[0] && this.state.positions[0]===this.state.positions[2]||\n this.state.positions[3]===this.state.positions[0] && this.state.positions[0]===this.state.positions[6]\n \t){\n alert(msg);\n this.setState({positions:[\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"]});\n this.setState({toggle:\"x\"});\n \t}\n \t/*check from the last position */\n \t}else if(this.state.positions[8]!==\"\")\n \tif(this.state.positions[2]===this.state.positions[8] && this.state.positions[8]===this.state.positions[5]||\n this.state.positions[6]===this.state.positions[8] && this.state.positions[8]===this.state.positions[7]\n \t){\n alert(msg);\n this.setState({positions:[\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"]});\n this.setState({toggle:\"x\"});\n \t}\n }", "function updateState(pos) {\n if ('NEWS'.indexOf(pos.val) > -1) {\n bender.direction = pos.val;\n }\n else if (pos.val === 'B') {\n bender.breaker = !bender.breaker;\n }\n else if (pos.val === 'X') {\n board[pos.row][pos.col] = ' ';\n }\n else if (pos.val === 'I') {\n bender.pattern = bender.pattern.split('').reverse().join('');\n }\n else if (pos.val === 'T') {\n teleport();\n }\n }", "function trackbackAlternations(originalPos, newPos) {\n var vp = getMaskSet()[\"validPositions\"][newPos],\n targetLocator = vp.locator,\n tll = targetLocator.length;\n\n for (var ps = originalPos; ps < newPos; ps++) {\n if (!isMask(ps)) {\n var tests = getTests(ps),\n bestMatch = tests[0], equality = -1;\n $.each(tests, function (ndx, tst) {\n for (var i = 0; i < tll; i++) {\n if (tst.locator[i] && checkAlternationMatch(tst.locator[i].toString().split(','), targetLocator[i].toString().split(',')) && equality < i) {\n equality = i;\n bestMatch = tst;\n }\n }\n });\n setValidPosition(ps, $.extend({}, bestMatch, { \"input\": bestMatch[\"match\"].def }), true)\n }\n }\n }", "if (!game.inEditorMode) {\n // revert pos\n this.pos = lastPos;\n }", "tellPositionInFrontY(){\n switch(this.orientation){\n case 0:\n return this.positionY - 1;\n case 2:\n return this.positionY + 1;\n }\n return this.positionY;\n }", "function trackbackAlternations(originalPos, newPos) {\n\t\t\t\tvar vp = getMaskSet().validPositions[newPos];\n\t\t\t\tif (vp) {\n\t\t\t\t\tvar targetLocator = vp.locator,\n\t\t\t\t\t\ttll = targetLocator.length;\n\n\t\t\t\t\tfor (var ps = originalPos; ps < newPos; ps++) {\n\t\t\t\t\t\tif (getMaskSet().validPositions[ps] === undefined && !isMask(ps, true)) {\n\t\t\t\t\t\t\tvar tests = getTests(ps).slice(),\n\t\t\t\t\t\t\t\tbestMatch = determineTestTemplate(tests, true),\n\t\t\t\t\t\t\t\tequality = -1;\n\t\t\t\t\t\t\tif (tests[tests.length - 1].match.def === \"\") tests.pop();\n\t\t\t\t\t\t\t$.each(tests, function (ndx, tst) { //find best matching\n\t\t\t\t\t\t\t\tfor (var i = 0; i < tll; i++) {\n\t\t\t\t\t\t\t\t\tif (tst.locator[i] !== undefined && checkAlternationMatch(tst.locator[i].toString().split(\",\"), targetLocator[i].toString().split(\",\"), tst.na)) {\n\t\t\t\t\t\t\t\t\t\tif (equality < i) {\n\t\t\t\t\t\t\t\t\t\t\tequality = i;\n\t\t\t\t\t\t\t\t\t\t\tbestMatch = tst;\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\t//check if alternationIndex is closer then the current bestmatch\n\t\t\t\t\t\t\t\t\t\tvar targetAI = targetLocator[i],\n\t\t\t\t\t\t\t\t\t\t\tbestMatchAI = bestMatch.locator[i],\n\t\t\t\t\t\t\t\t\t\t\ttstAI = tst.locator[i];\n\t\t\t\t\t\t\t\t\t\tif ((targetAI - bestMatchAI) > Math.abs(targetAI - tstAI)) {\n\t\t\t\t\t\t\t\t\t\t\tbestMatch = tst;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\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\tbestMatch = $.extend({}, bestMatch, {\n\t\t\t\t\t\t\t\t\"input\": getPlaceholder(ps, bestMatch.match, true) || bestMatch.match.def\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbestMatch.generatedInput = true;\n\t\t\t\t\t\t\tsetValidPosition(ps, bestMatch, true);\n\t\t\t\t\t\t\t//revalidate the new position to update the locator value\n\t\t\t\t\t\t\tgetMaskSet().validPositions[newPos] = undefined;\n\t\t\t\t\t\t\t_isValid(newPos, vp.input, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function elongateTopNote(noteIndex)\n{\n if(topNoteBlocks[noteIndex]){\n var newTop = - fallDownSpeed;\n topNoteBlocks[noteIndex].style.top = newTop;\n }\n \n}", "function reactionReverse () {\n direction = -direction; // Stromrichtung umkehren\n reset(); // Ausgangsstellung\n }", "function C012_AfterClass_Amanda_CheckNotes() {\n\tif (((ActorGetValue(ActorCloth) == \"\") || (ActorGetValue(ActorCloth) == \"Clothed\") || (ActorGetValue(ActorCloth) == \"Pajamas\")) && !ActorHasInventory(\"Collar\") && !ActorIsRestrained() && !ActorIsGagged()) ActorSetPose(\"CheckNotes\");\n\tLeaveIcon = \"Leave\";\n}", "function flip(mark) {\nif (mark ==\"X\")\n return 'O';\nreturn 'X';\n}", "function gameLogic() {\n\n // Check if pressed direction is opposite of current direction\n var isReverseDir =\n (nextDir === Directions.UP && snakeDir === Directions.DOWN) ||\n (nextDir === Directions.DOWN && snakeDir === Directions.UP) ||\n (nextDir === Directions.RIGHT && snakeDir === Directions.LEFT) ||\n (nextDir === Directions.LEFT && snakeDir === Directions.RIGHT);\n\n // Change snake dir only if pressed direction is not reverse\n if (!isReverseDir) {\n snakeDir = nextDir;\n }\n\n var oldHead = snake[0]; // Get the position of the head\n \n // Position new head depending on snake direction\n if (snakeDir === Directions.UP)\n var newHead = { x: oldHead.x, y: oldHead.y - 1 };\n else if (snakeDir === Directions.DOWN)\n var newHead = { x: oldHead.x, y: oldHead.y + 1 };\n else if (snakeDir === Directions.LEFT)\n var newHead = { x: oldHead.x - 1, y: oldHead.y };\n else if (snakeDir === Directions.RIGHT)\n var newHead = { x: oldHead.x + 1, y: oldHead.y };\n\n // Add the new head to the front of snake \n snake.unshift(newHead)\n \n // Check if food is eaten\n var ateFood = newHead.x === food.x && newHead.y === food.y;\n\n if (ateFood) { // If the food is eaten then reposition food randomly\n food = {\n x: (Math.random() * 40) | 0,\n y: (Math.random() * 40) | 0\n };\n } else { \n // Remove the last part of the snake - this moves the snake\n // if food is eaten then we skip this part. This is how the \n // snake grows.\n snake.pop();\n }\n\n // Check if snake is dead\n var isDead = false; // initial value\n // Check if newHead is on any other snake part\n for (var i = 1; i < snake.length; i++) {\n if (newHead.x === snake[i].x && newHead.y === snake[i].y) {\n isDead = true;\n break;\n }\n }\n\n\n // Check if snake is out of bounds\n if (newHead.x < 0 || newHead.y < 0 || newHead.x >= 40 || newHead.y >= 40) {\n isDead = true;\n }\n\n // Stop the game if player is dead\n if (isDead) gameRunning = false;\n}", "function trackbackAlternations(originalPos, newPos) {\n\t var vp = getMaskSet().validPositions[newPos],\n\t\t\t\t\t\ttargetLocator = vp.locator,\n\t\t\t\t\t\ttll = targetLocator.length;\n\n\t for (var ps = originalPos; ps < newPos; ps++) {\n\t if (getMaskSet().validPositions[ps] === undefined && !isMask(ps, true)) {\n\t var tests = getTests(ps),\n\t\t\t\t\t\t\t\tbestMatch = tests[0],\n\t\t\t\t\t\t\t\tequality = -1;\n\t $.each(tests, function (ndx, tst) { //find best matching\n\t for (var i = 0; i < tll; i++) {\n\t if (tst.locator[i] !== undefined && checkAlternationMatch(tst.locator[i].toString().split(\",\"), targetLocator[i].toString().split(\",\"))) {\n\t if (equality < i) {\n\t equality = i;\n\t bestMatch = tst;\n\t }\n\t } else break;\n\t }\n\t });\n\t setValidPosition(ps, $.extend({}, bestMatch, {\n\t \"input\": bestMatch.match.placeholder || bestMatch.match.def\n\t }), true);\n\t }\n\t }\n\t }", "function C012_AfterClass_Amanda_SetPose() {\n\tif (((ActorGetValue(ActorCloth) == \"\") || (ActorGetValue(ActorCloth) == \"Clothed\")) && !ActorIsRestrained() && !ActorIsGagged()) {\n\t\tvar Love = ActorGetValue(ActorLove);\n\t\tvar Sub = ActorGetValue(ActorSubmission);\n\t\tif ((Sub <= -10) && (Math.abs(Sub) >= Math.abs(Love))) ActorSetPose(\"Point\");\n\t\tif ((Sub >= 10) && (Math.abs(Sub) >= Math.abs(Love))) ActorSetPose(\"Shy\");\n\t\tif ((Love >= 10) && (Math.abs(Love) >= Math.abs(Sub))) ActorSetPose(\"Love\");\n\t\tif ((Love <= -10) && (Math.abs(Love) >= Math.abs(Sub))) ActorSetPose(\"Angry\");\n\t\tif (Common_ActorIsOwned) ActorSetPose(\"Shy\");\n\t} else {\n\t\tif ((ActorGetValue(ActorCloth) == \"Naked\") && !ActorIsRestrained() && !ActorIsGagged() && (ActorGetValue(ActorSubmission) >= 10)) ActorSetPose(\"Shy\");\n\t\tif ((ActorGetValue(ActorCloth) == \"Pajamas\") && !ActorIsRestrained() && !ActorIsGagged() && (ActorGetValue(ActorLove) >= 10)) ActorSetPose(\"Happy\");\n\t\telse ActorSetPose(\"\");\n\t}\n}", "function ELdown(){\n console.log(\"In eyes l arrow clicked\");\n eyes.destroy();\n eyeindex--;\n if(eyeindex<=0)\n {\n eyeindex = 0;\n eyes = game.add.image(970, 235, images.eyes[eyeindex].name);\n eyes.scale.setTo(0.1);\n be = bb.create(550, 55, images.eyes[eyeindex].name);\n be.scale.setTo(0.1);\n }\n else if (eyeindex >= images.eyes.length)\n {\n eyeindex = images.eyes.length -1;\n eyes = game.add.image(970, 235, images.eyes[eyeindex].name);\n eyes.scale.setTo(0.1);\n be = bb.create(550, 55, images.eyes[eyeindex].name);\n be.scale.setTo(0.1);\n }\n else\n {\n eyes = game.add.image(970, 235, images.eyes[eyeindex].name);\n eyes.scale.setTo(0.1);\n be = bb.create(550, 55, images.eyes[eyeindex].name);\n be.scale.setTo(0.1);\n }\n player.appearance.head.eye = images.eyes[eyeindex].name;\n\n}", "isTonic(note) {\n return (note % 12) == this.offset();\n }", "function C012_AfterClass_Amanda_TestLove() {\n\tif (!ActorIsGagged()) {\n\t\tif (!ActorIsRestrained() && !Common_PlayerRestrained) {\n\t\t\tif (!Common_PlayerNaked && (ActorGetValue(ActorCloth) != \"Naked\")) {\n\t\t\t\tif (ActorGetValue(ActorLove) >= 20) {\n\t\t\t\t\tActorSetPose(\"\");\n\t\t\t\t\tC012_AfterClass_Amanda_CurrentStage = 100;\n\t\t\t\t\tOverridenIntroText = \"\";\n\t\t\t\t}\n\t\t\t} else OverridenIntroText = GetText(\"CantDateWhileNaked\");\n\t\t} else OverridenIntroText = GetText(\"CantDateWhileRestrained\");\n\t} else C012_AfterClass_Amanda_GaggedAnswer();\n}", "function testCase(pos) {\n switch (pos) {\n case 0:\n thisPos = {Location: 'now', lng: 121.5552137, ret: 25.0851076};\n break;\n case 1:\n thisPos = {Location: 'now', lng: 121.5536283, ret: 25.0926443};\n break;\n case 2:\n thisPos = {Location: 'now', lng: 121.5575088, ret: 25.1077731};\n break;\n }\n gmap.onPositionChange();\n}", "function offCourse() {\n getCurrentPosition().then(function (position) {\n if (!routeExists()) {\n return;\n }\n var startPoint = turf.point([position.coords.longitude, position.coords.latitude]);\n var nextRoutePoint = turf.along(currentRoute.geom, currentRoute.stepped + stepLengthMiles, 'miles');\n var currentBearing = turf.bearing(startPoint, nextRoutePoint);\n var bearing = currentBearing + 90;\n if (bearing > 180) {\n bearing -= 360;\n }\n var reroutePoint = turf.destination(startPoint, stepLengthMiles * 2, bearing, 'miles');\n $rootScope.$broadcast(events.positionOffCourse, reroutePoint);\n });\n }", "getPosition(absState) {\n return absState % (this._w + 1);\n }", "function resetFood(){\n //to ensure the food position is not on surrent snake/resetPos\n function isFoodPosOK(x,y){\n //not on snake0\n for (var i = 0; i < snakes[0].body.length; i++){\n if (x == snakes[0].body[i][0] && y == snakes[0].body[i][1])\n return false;\n }\n //not on snake1\n for (var i = 0; i < snakes[1].body.length; i++){\n if (x == snakes[1].body[i][0] && y == snakes[1].body[i][1])\n return false;\n }\n return true;\n }\n \n //update position\n var x = Math.floor(Math.random()*18)+1;\n var y = Math.floor(Math.random()*18)+1;\n while (!isFoodPosOK(x,y)){\n x = Math.floor(Math.random()*18)+1;\n y = Math.floor(Math.random()*18)+1;\n } \n foodPos = [x,y,0];\n }", "function calculateDirectionToMoveAndUpdatePosition() {\n var NS, EW;\n\n if (TY < LY) {\n NS = 'S';\n TY += 1;\n }\n else if (TY > LY) {\n NS = 'N';\n TY -= 1;\n }\n else {\n NS = '';\n }\n\n if (TX < LX) {\n EW = 'E';\n TX += 1;\n }\n else if (TX > LX) {\n EW = 'W';\n TX -= 1;\n }\n else {\n EW = '';\n }\n\n return NS+EW;\n }", "function is_eating(w) {\n $rt_addContract(w, cd4e49798d42ac5a95f1a8edbd8ed8c01c, \"motion.ts(68,27)\");\n return (w.food).equals(w.snake.segs.x);\n }", "function resetSnake(i){\n //ensure reset position is not on the other sname nor on food\n function isSnakePosOK(x,y){\n //not on the other snake\n for (var k = 0; k < snakes[1-i].body.length; k++){\n if ((x == snakes[1-i].body[k][0] || x-1 == snakes[1-i].body[k][0] || x-2 == snakes[1-i].body[k][0]) && y == snakes[1-i].body[k][1])\n return false; \n }\n //not on food\n if ((x == foodPos[0] || x-1 == foodPos[0] || x-2 == foodPos[0]) && y == foodPos[1])\n return false;\n return true;\n }\n \n //update point\n if (i==0) {\n point = 0;\n document.getElementById(\"point\").innerHTML = point;\n }\n else {\n cpoint = 0;\n document.getElementById(\"cpoint\").innerHTML = cpoint;\n }\n\n //update position\n var x = Math.floor(Math.random()*15)+3;\n var y = Math.floor(Math.random()*18)+1;\n while (!isSnakePosOK(x,y)){\n x = Math.floor(Math.random()*15)+3;\n y = Math.floor(Math.random()*18)+1;\n } \n snakes[i].body = [[x,y,0],[x-1,y,0],[x-2,y,0]];\n snakes[i].direction=[\"right\", \"right\"];\n }", "function moveBackward(rover){\n console.log(`----${rover.name}----`);\n console.log(\"moveBackward was called\");\n switch (rover.direction) {\n case 'N':\n if (rover.y < 9) {\n rover.y++;\n if (rover1.x === rover2.x && rover1.y === rover2.y) {\n rover.y--\n console.log(`There is an other Rover at (${rover.x},${rover.y+1}). Change your way!`);\n } else if (grid[rover.y][rover.x] === o) {\n rover.y--;\n console.log(`There is an ${o} at (${rover.x},${rover.y+1}). Change your way!`)\n }\n } else {\n console.log(\"canceled command, you are on the grid limit!\");\n }\n break;\n case 'W':\n if (rover.x < 9) {\n rover.x++;\n if (rover1.x === rover2.x && rover1.y === rover2.y) {\n rover.x--\n console.log(`There is an other Rover at (${rover.x+1},${rover.y}). Change your way!`);\n } else if (grid[rover.y][rover.x] === o) {\n rover.x--;\n console.log(`There is an ${o} at (${rover.x+1},${rover.y}). Change your way!`)\n }\n } else {\n console.log(\"canceled command, you are on the grid limit!\");\n }\n break;\n case 'S':\n if (rover.y > 0) {\n rover.y--;\n if (rover1.x === rover2.x && rover1.y === rover2.y) {\n rover.y++\n console.log(`There is an other Rover at (${rover.x},${rover.y-1}). Change your way!`);\n } else if (grid[rover.y][rover.x] === o) {\n rover.y++;\n console.log(`There is an ${o} at (${rover.x},${rover.y-1}). Change your way!`)\n }\n } else {\n console.log(\"canceled command, you are on the grid limit!\");\n }\n break;\n case 'E':\n if (rover.x > 0) {\n rover.x--;\n if (rover1.x === rover2.x && rover1.y === rover2.y) {\n rover.x++\n console.log(`There is an other Rover at (${rover.x-1},${rover.y}). Change your way!`);\n } else if (grid[rover.y][rover.x] === o) {\n rover.x++;\n console.log(`There is an ${o} at (${rover.x-1},${rover.y}). Change your way!`)\n }\n } else {\n console.log(\"canceled command, you are on the grid limit!\");\n }\n break;\n }\n console.log(`Direction: ${rover.direction}`);\n console.log(`Position: (${rover.x},${rover.y})`);\n rover.travelLog.push({x: rover.x, y: rover.y});\n}", "reoderQuestion(up = true) {\n const {questionId, answerId} = this.props;\n up ? this.moveUp(questionId, answerId) : this.moveDown(questionId, answerId);\n }", "function stepApplyNewPosition () {\n\t\tvar state={\n\t\t\t\tediting: false,\n\t\t\t\tnode: false,\n\t\t\t\tdata: {\n\t\t\t\t\tx: 0,\n\t\t\t\t\ty: 0,\n\t\t\t\t\trotate: 0,\n\t\t\t\t\tscale: 0\n\t\t\t\t}\n\t\t },\n\t\tconfig= {\n\t\t\trotateStep: 3,\n\t\t\tscaleStep: 1,\n\t\t\tmoveStep: 50\n\t\t },\n\t\tdefaults= {\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\trotate: 0,\n\t\t\tscale: 1\n\t\t };\n\t\t \n\t /* $('body').on('mousedown','.step',function(e){\n\t\tstate.editing=true;\n\t\tstate.node=$(this);\n\t\tstate.node.fadeTo(0.6);\n\t\t});\n\t\t\n\t $('body').on('mouseup','.step',function(e){\n\t\tstate.editing=false;\n\t\tvar $t=$(this);\n\t\t$t.fadeTo(1);\n\t\t});\n\t*/\t\n\t\tstate.editing=true;\n\t\tstate.node=$(this);\n\t\t\n\t\tif(state.editing){\n\t\t var $t=state.node;\n\t\t for(var i in state.data){\n\t\t\tvar tmp=$t.attr('data-'+i);\n\t\t\tif(tmp===''){tmp=defaults[i]}\n\t\t\tstate.data[i]= ~~(tmp);\n\t\t\t}\n\t\t\t//console.log(['before...',state.data,state.node[0]]);\n\t\t \n\t\t switch(e.which){\n\t\t\tcase 113: //q\n\t\t\t state.data.rotate-=config.rotateStep;\n\t\t\t\tbreak;\n\t\t\tcase 119: //w\n\t\t\t state.data.y-=config.moveStep;\n\t\t\t\tbreak;\n\t\t\tcase 101: //e\n\t\t\t state.data.rotate+=config.rotateStep;\n\t\t\t\tbreak;\n\t\t\tcase 97: //a\n\t\t\t state.data.x-=config.moveStep;\n\t\t\t\tbreak;\n\t\t\tcase 115: //s\n\t\t\t state.data.y+=config.moveStep;\n\t\t\t\tbreak;\n\t\t\tcase 100: //d\n\t\t\t state.data.x+=config.moveStep;\n\t\t\t\tbreak;\n\t\t\tcase 122: //z\n\t\t\t state.data.scale+=config.scaleStep;\n\t\t\t\tbreak;\n\t\t\tcase 120: //x\n\t\t\t state.data.scale-=config.scaleStep;\n\t\t\t\tbreak;\n\t\t\t \n\t\t\tdefault:\n\t\t\t console.log(e.which);\n\t\t\t \n\t\t\t //yeah, I know, but it looks better when it's here\n\t\t\t break;\n\t\t \n\t\t \n\t\t\t}\n\t\t //console.log(['done...',state.data,state.node[0]]);\n\t\t //reapply all. damn slow \n\t\t for(var i in state.data){\n\t\t\t$t.attr('data-'+i,state.data[i]);\n\t\t\t}\n\t\t\t\n\t\t window['--drawSlideGlobalHandler'](state.node[0],'whatever')\n\t\t\t\n\t\t }\n\t}", "function moveDown() {\n undraw(); //undraw tetromino\n currentPosition += width; //change reference point to one row down\n draw(); //draw the tetromino \n freeze(); \n }", "function flip(mark) {\n if (mark ==\"X\")\n return 'O';\n return 'X';\n}", "checkCheatNotes() {\n let cheatKey = true\n let cheatTouch = true\n for (let posIdx = 1; posIdx <= this.noteToShow; posIdx++) {\n cheatKey = cheatKey && this.key.isDownVisually(this.key.pos[posIdx])\n }\n for (let posIdx = 1; posIdx <= this.noteToShow; posIdx++) {\n cheatTouch = cheatTouch && this.touch.isDownVisually(this.touch.pos[posIdx])\n }\n\n return cheatKey || cheatTouch\n }", "function palmPosition(hand, index) {\n if (!isLocked) {\n lateralTracking(hand.palmPosition[0]);\n }\n // console.log(hand);\n }", "noteOff() {\n this.keyRect.fill(this.displayOptions.color);\n grid.highlightPitch(this.pitch, false, this.displayOptions);\n audio.noteOff(this.pitch)\n }", "invertDirectionRandom() {\n let hasInverted = false;\n if (Math.random() < 0.5) {\n let temp = this.deltaY;\n this.deltaY = this.deltaX;\n this.deltaX = temp;\n hasInverted = true;\n }\n if (Math.random() < 0.5) {\n this.deltaX = -this.deltaX;\n hasInverted = true;\n }\n if (Math.random() < 0.5) {\n this.deltaY = -this.deltaY;\n hasInverted = true;\n }\n if (!hasInverted) {\n this.invertDirection();\n }\n this.updateHitboxes();\n }", "function onSnake(position){\n for (var i = 0; i < snake.length; ++i){ //Iterates through the snake\n if (position.x == snake[i].x && position.y == snake[i].y) { //if position of x & y is the same as the position of the snake x and y\n return true;\n }\n }\n return false; //Default false\n}", "function trash_down(trashy) {\n //trashy handles the movement of elements with the CSS atrributes\n var trash_current_top = parseInt(trashy.css('top'));\n var trash_current_bottom = parseInt(trashy.css('bottom'));\n var trash_current_left = parseInt(trashy.css('left'));\n var rb_area_height = parseInt(rb_area.height());\n var trash_in = rb_area_height-(rb_area_height*0.4); //.4 of the trash is inside the RB\n var trash_away = rb_area_height-(rb_area_height*0.7);//.7 of the trash is inside the RB\n \n setGameDimension();\n \n if(ft){ //sets the position of the first trash, \n var new_lane_pos = 0;\n var first_trash=Math.floor(Math.random() * max_lane);\n new_lane_pos = recycle_bins_container.dumpsters[first_trash].rb_coordinates;\n laneTracker = first_trash;\n trashy.css('left', new_lane_pos);\n ft=false;\n }\n \n \n //document.getElementById(\"myoutput\").innerHTML = \"GW: \"+ container_width + \" RB1:<i>\"+recycle_bins_container.dumpsters[0].rb_coordinates + \"</i> RB2:<i>\"+recycle_bins_container.dumpsters[1].rb_coordinates + \"</i> RB3:<i>\"+recycle_bins_container.dumpsters[2].rb_coordinates + \"</i> RB4:<i>\"+recycle_bins_container.dumpsters[3].rb_coordinates+\"</i>\";\n //document.getElementById(\"myoutput2\").innerHTML = \"L: \"+ trash_current_left + \" Speed: \"+speed +\" CL: \"+laneTracker+\" RBH: \"+rb_area_height +\" RBW:\"+ $(\"#image-rb-1\").width() +\" B: \"+ trash_current_bottom +\" T: \"+ trash_current_top;\n \n //635 this is near the RB \n if (parseInt(trashy.css('top'))>=container_height){ \n speed = 1;\n trash_info_status = true; //now it needs change because it has reached the RB... //I think I don't need this\n } \n if (trash_current_bottom <= trash_in && my_collision == false) {\n //trash bottom possition vs Recycle Bins Heights \n //once this validation has been done, then it won't be possible to move the trash! #todo\n my_collision = true;\n collision();\n\n }\n if (trash_current_bottom <= trash_away) {\n trash_current_top = -100;\n my_collision = false;\n trashy.css('left', newLane());//here is where the new Y position is being defined...\n nextTrash(); //sets the next current trash values\n }\n trashy.css('top', trash_current_top + speed); //this is what moves trash down.:\n }", "function C012_AfterClass_Jennifer_TestLove() {\n\tif (!ActorIsGagged()) {\n\t\tif (!ActorIsRestrained() && !Common_PlayerRestrained) {\n\t\t\tif (!Common_PlayerNaked && (ActorGetValue(ActorCloth) != \"Naked\")) {\n\t\t\t\tif (ActorGetValue(ActorLove) >= 20) {\n\t\t\t\t\tActorSetPose(\"\");\n\t\t\t\t\tC012_AfterClass_Jennifer_CurrentStage = 100;\n\t\t\t\t\tOverridenIntroText = \"\";\n\t\t\t\t}\n\t\t\t} else OverridenIntroText = GetText(\"CantDateWhileNaked\");\n\t\t} else OverridenIntroText = GetText(\"CantDateWhileRestrained\");\n\t} else C012_AfterClass_Jennifer_GaggedAnswer();\n}", "moveDown() {\n this.y<332?this.y+=83:false;\n }", "function checkPosition() {\n // Für Ameise Schwarz\n for (let i = 0; i < Sem.ant.length; i++) {\n let a = Sem.ant[i];\n // Wenn Ameisen Position auf X - Achse zwischen 567 & 750 \n if (a.x >= 567 && a.x <= 750) {\n // Wenn Ameisen Position auf Y - Achse zwischen 245 & 429\n if (a.y >= 245 && a.y <= 429) {\n // Ruft Funktion für Game Over Screen auf\n gameLost();\n }\n }\n }\n // Für Ameise Braun\n for (let i = 0; i < Sem.antBrown.length; i++) {\n let b = Sem.antBrown[i];\n // Wenn Ameisen Position auf X - Achse zwischen 567 & 750\n if (b.x >= 567 && b.x <= 750) {\n // Wenn Ameisen Position auf Y - Achse zwischen 245 & 429\n if (b.y >= 245 && b.y <= 429) {\n // Ruft Funktion für Game Over Screen auf\n gameLost();\n }\n }\n }\n // Für Ameise Rot\n for (let i = 0; i < Sem.antRed.length; i++) {\n let r = Sem.antRed[i];\n // Wenn Ameisen Position auf X - Achse zwischen 567 & 750\n if (r.x >= 567 && r.x <= 750) {\n // Wenn Ameisen Position auf Y - Achse zwischen 245 & 429\n if (r.y >= 245 && r.y <= 429) {\n // Ruft Funktion für Game Over Screen auf\n gameLost();\n }\n }\n }\n }", "function inPosA1() {\n\t//TWO LANE ROAD, POSITION A1\n\tif(coordOpt2 == 0 && coordOpt3 == 0){\n\t\trandomNum = Random.value * 10;\n\t\tif(targetDirF == true && randomNum <= 3){\n\t\t\t//do nothing, go forward\n\t\t\tcalculatingMove = false;\n\t\t}else if(targetDirL == true && randomNum > 3 && randomNum <= 6){\n\t\t\t//turn left\n\t\t\ttransform.GetComponent(aiStates).leftCoord = targetTurnL;\n\t\t\ttransform.GetComponent(aiStates).leftState = true;\n\t\t}else if(targetDirR == true && randomNum > 6){\n\t\t\t//turn right\n\t\t\tif(targetTurnR2 == 0){\n\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR1;\n\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t}else{\n\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR2;\n\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t}\n\t\t}else{\n\t\t\t//if none of the above, take first available option\n\t\t\tif(targetDirF == true){\n\t\t\t\t//do nothing, go forward\n\t\t\t\tcalculatingMove = false;\n\t\t\t}else if(targetDirL == true){\n\t\t\t\t//turn left\n\t\t\t\ttransform.GetComponent(aiStates).leftCoord = targetTurnL;\n\t\t\t\ttransform.GetComponent(aiStates).leftState = true;\n\t\t\t}else if(targetDirR == true){\n\t\t\t\t//turn right\n\t\t\t\tif(targetTurnR2 == 0){\n\t\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR1;\n\t\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t\t}else{\n\t\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR2;\n\t\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tDebug.Log(\"Error with turn selection 2ln road\");\n\t\t\t\ttransform.GetComponent(aiStates).startAgain = true;\n\t\t\t}\n\t\t}\n\t\t\n\t//THREE LANE ROAD, POSITION A1\n\t}else if(coordOpt2 == 0 && coordOpt3 != 0){\n\t\trandomNum = Random.value * 10;\n\t\tif(targetDirF == true && randomNum < 6){\n\t\t\t//do nothing, go forward\n\t\t\tcalculatingMove = false;\n\t\t}else if(targetDirR == true){\n\t\t\t//turn right\n\t\t\tif(targetTurnR2 == 0){\n\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR1;\n\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t}else{\n\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR2;\n\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t}\n\t\t}else{\n\t\t\tif(targetDirF == true){\n\t\t\t\t//do nothing, go forward\n\t\t\t\tcalculatingMove = false;\n\t\t\t}else if(targetDirR == true){\n\t\t\t\t//turn right\n\t\t\t\tif(targetTurnR2 == 0){\n\t\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR1;\n\t\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t\t}else{\n\t\t\t\t\ttransform.GetComponent(aiStates).rightCoord = targetTurnR2;\n\t\t\t\t\ttransform.GetComponent(aiStates).rightState = true;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tDebug.Log(\"Error with turn selection 3ln road\");\n\t\t\t\ttransform.GetComponent(aiStates).startAgain = true;\n\t\t\t}\n\t\t}\n\t\n\t//FOUR LANE ROAD, POSITION A1\n\t}else if(coordOpt3 == 0 && coordOpt2 != 0){\n\t\trandomNum = Random.value * 10;\n\t\tif(targetDirF == true && randomNum > 6){\n\t\t\t//do nothing, go forward\n\t\t\tcalculatingMove = false;\n\t\t}else if(targetDirL == true){\n\t\t\t//turn left\n\t\t\ttransform.GetComponent(aiStates).leftCoord = targetTurnL;\n\t\t\ttransform.GetComponent(aiStates).leftState = true;\n\t\t}else{\n\t\t\tif(targetDirF == true){\n\t\t\t\t//do nothing, go forward\n\t\t\t\tcalculatingMove = false;\n\t\t\t}else if(targetDirL == true){\n\t\t\t\t//turn left\n\t\t\t\ttransform.GetComponent(aiStates).leftCoord = targetTurnL;\n\t\t\t\ttransform.GetComponent(aiStates).leftState = true;\n\t\t\t}else{\n\t\t\t\tDebug.Log(\"Error with turn selection 4ln road\");\n\t\t\t\ttransform.GetComponent(aiStates).startAgain = true;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t//FIVE LANE ROAD, POSITION A1\n\t}else if(coordOpt2 != 0 && coordOpt3 != 0){\n\t\t//5ln road\n\t\t//MUST GO FORWARD\n\t\tcalculatingMove = false;\n\t\tif(targetDirF == false){\n\t\t\ttransform.GetComponent(aiStates).startAgain = true;\n\t\t}\n\t}\n}", "rotateBasedOnPositionOfLetter( letter, oppositeDay ) {\n var index = this.positionOfLetter( this.target, letter );\n\n if (oppositeDay) {\n // rotate back left based on where the letter used to be. how?\n if (index === 0) {\n index = 1;\n } else if (index === 1) {\n index = 1;\n } else {\n index = 4;\n }\n this.rotateSteps(\"left\", index );\n\n } else {\n if (index >= 4) {\n index++;\n }\n index++;\n this.rotateSteps(\"right\", index );\n }\n }", "function checkPosition(){\n if (i > (data.omicron.length - 1)) {\n i = 0;\n } else if (i < 0) {\n i = (data.omicron.length - 1);\n }\n }", "function C012_AfterClass_Amanda_TestPunish() {\n\n\t// The more love, the less chances the player will be punished\n\tif (EventRandomChance(\"Love\")) {\n\t\tC012_AfterClass_Amanda_CheckNotes();\n\t} else {\n\t\tActorSetPose(\"Angry\");\n\t\tOverridenIntroText = \"\";\n\t\tC012_AfterClass_Amanda_CurrentStage = 3900;\n\t}\n\n}", "moveCheck(direction, originalLocation) {\n const { dispatch } = this.props;\n let newLocationId;\n let newLocation;\n if(direction == \"north\") {\n newLocationId = originalLocation - 1;\n newLocation = this.props.currentLevel[newLocationId];\n if(newLocationId >= 0 && newLocation.value !== 'W') {\n return newLocationId;\n } else if (newLocation.isEnemy !== '' || newLocation.isProjectile || newLocation.value === 'L') {\n let knockBackDirection = this.reverseDirection(direction);\n dispatch(actions.knockBack(originalLocation, knockBackDirection));\n return false;\n } else {\n return false;\n }\n } else if (direction == \"east\") {\n newLocationId = originalLocation + 10;\n newLocation = this.props.currentLevel[newLocationId];\n if(newLocationId <= 100 && newLocation.value !== 'W') {\n return newLocationId;\n } else if (newLocation.isEnemy !== '' || newLocation.isProjectile || newLocation.value === 'L') {\n let knockBackDirection = this.reverseDirection(direction);\n dispatch(actions.knockBack(originalLocation, knockBackDirection));\n return false;\n } else {\n return false;\n }\n } else if (direction == \"south\") {\n newLocationId = originalLocation + 1;\n newLocation = this.props.currentLevel[newLocationId];\n if(newLocationId > 0 && newLocationId <= 100 && originalLocation % 10 !== 0 && newLocation.value !== 'W') {\n return newLocationId;\n } else if (newLocation.isEnemy !== '' || newLocation.isProjectile || newLocation.value === 'L') {\n let knockBackDirection = this.reverseDirection(direction);\n dispatch(actions.knockBack(originalLocation, knockBackDirection));\n return false;\n } else {\n return false;\n }\n } else if (direction == \"west\") {\n newLocationId = originalLocation - 10;\n newLocation = this.props.currentLevel[newLocationId];\n if(newLocationId >= 0 && newLocation.value !== 'W') {\n return newLocationId;\n } else if (newLocation.isEnemy !== '' || newLocation.isProjectile || newLocation.value === 'L') {\n let knockBackDirection = this.reverseDirection(direction);\n dispatch(actions.knockBack(originalLocation, knockBackDirection));\n return false;\n } else {\n return false;\n }\n }\n }", "function change_direction(){\n\tvar lastx = snake_array[snake_array.length-1].x;\n\tvar lasty = snake_array[snake_array.length-1].y;\n\tsnake_array[0] = {x: lastx, y: lasty, color: \"black\"};\n\tvar tail = snake_array.shift();\n\tif(d === \"left\"){\n\t\tsnake_array.push(tail);\n\t\tsnake_array[snake_array.length-1].x--;\n\t}\n\telse if(d === \"right\"){\n\t\tsnake_array.push(tail);\n\t\tsnake_array[snake_array.length-1].x++;\n\t}\n\telse if(d === \"up\"){\n\t\tsnake_array.push(tail);\n\t\tsnake_array[snake_array.length-1].y--;\n\t}\n\telse if(d === \"down\"){\n\t\tsnake_array.push(tail);\n\t\tsnake_array[snake_array.length-1].y++;\n\t}\n\thitItself(snake_array[snake_array.length-1]);\n\thitTheWall(snake_array[snake_array.length-1]);\n\tpaint_snake();\n\teat();\n\t// console.log(snake_array[snake_array.length - 1]);\n\n}", "function rePosition(){\r\n piece.pos.y = 0; // this and next line puts the next piece at the top centered\r\n piece.pos.x = ( (arena[0].length / 2) | 0) - ( (piece.matrix[0].length / 2) | 0);\r\n }", "if (move.endsWith(\"'\")) {\n // three turns\n completedRotation = -NINETY_DEGREES;\n }", "returnToLastPos() {\n if (this.previousPos) {\n this.x = this.previousPos.x\n this.y = this.previousPos.y\n }\n }", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "moveRight() {\n\n if (this.posX <= 670 && pause == false)\n this.posX = this.posX + 5;\n }", "function checkIfEatenR() {\n // Thanks Jeremy.\n //paintFood(Math.random()*300,Math.random()*300,\"blue\")\n // This works: moveRight() == paintFood(235,10,\"blue\")\n //moveRight == paintFood(235,10,\"blue\")\n \n if ( moveRight() == paintFood(235,10) ){\n console.log(\"Food updated.\")\n updateFood();\n console.log(\"Next food.\");\n nextFood();\n }\n}", "function updateSnakeMovement() {\n let newPos = {x: snake.history[0].x, y: snake.history[0].y};\n toBeClearedFields.push(snake.history.pop());\n if (command !== null) {\n switch (command) {\n case \"LEFT\":\n newPos.x--;\n break;\n case \"UP\":\n newPos.y--;\n break;\n case \"RIGHT\":\n newPos.x++;\n break;\n case \"DOWN\":\n newPos.y++;\n break;\n }\n }\n snake.history.unshift(newPos);\n }", "function decideSlideBead(beadSpot){ \n let x;\n spot = beadChecker(\"left\", \"left\");\n if (beadSpot === spot && canClick){\n moveBead(\"right\"); \n } else {\n spot= beadChecker(\"right\", \"right\"); \n if (beadSpot === spot && canClick){\n moveBead(\"left\"); \n }\n }\n}", "function stare() {\n\t\ttry {\n\t\t\tmoveEye(\".tally_eye_left\", \"stare\");\n\t\t\tmoveEye(\".tally_eye_right\", \"stare\");\n\t\t\tsetTimeout(function() {\n\t\t\t\tfollowCursor = true;\n\t\t\t}, 400);\n\t\t} catch (err) {\n\t\t\tconsole.error(err);\n\t\t}\n\t}", "resetState() {\n this._movements = 0;\n }", "offscreen() {\n if (this.xpos < -this.width) {\n return true;\n } else {\n return false;\n }\n }", "upgradePionToDameAdverse(posRow, colorPion, tailleDamier){\n let dame = false;\n if(colorPion == this.couleurJoueur){\n if(posRow == 0){\n dame = true;\n }\n } else {\n if(posRow+1 == tailleDamier){\n dame = true;\n }\n }\n return dame;\n }", "reverseFinished() {\n return (this.y < height / 2 + 0.5 && this.y > height / 2 - 0.5) || (this.x < width / 2 + 0.5 && this.x > width / 2 - 0.5)\n }", "function MoveNoteDown(noteIndex) {\n if (noteIndex > stateVars.itemArray.length - 2) {\n return;\n }\n\n var newNoteArray = [];\n if (stateVars.itemArray != null) {\n newNoteArray = stateVars.itemArray;\n }\n\n var placeholder = newNoteArray[noteIndex + 1];\n newNoteArray[noteIndex + 1] = newNoteArray[noteIndex];\n newNoteArray[noteIndex] = placeholder;\n\n setStateVars((prevState) => {\n return ({\n ...prevState,\n noteArray: newNoteArray,\n promptNewNote: false,\n editNoteIndex: noteIndex + 1,\n requireUpdate: true\n });\n });\n }", "function MoveDown()\n{\n mrRat.direction = 'down';\n\n if (gameData[mrRat.y + 1][mrRat.x] >= 10)\n {\n //The rat eats a cheese\n if (gameData[mrRat.y + 1][mrRat.x] === 12) {\n EatsCheese(false);\n }\n\n //The rats eats a random cheese\n if (gameData[mrRat.y + 1][mrRat.x] === 15) {\n EatsCheese(true);\n }\n\n //The rat hits the rat poison or rat trap\n if (gameData[mrRat.y + 1][mrRat.x] === 16 || gameData[mrRat.y + 1][mrRat.x] === 13) {\n TheRatDied();\n }\n\n gameData[mrRat.y][mrRat.x] = _GROUND;\n mrRat.y = mrRat.y + 1;\n gameData[mrRat.y][mrRat.x] = _RAT;\n\n //MrRat has reached the gool\n if (mrRat.x == 18 && mrRat.y == 14) {\n Goal();\n return;\n }\n\n DeleteMap();\n DrawMap();\n }\n}", "posZahtMet()\n {\n this.posZah=!this.posZah;\n }", "async reverse() {\n this.tl.pause();\n this.angle = 100;\n this._playShieldBounceSound();\n\n await gsap.to(this, {\n x: -50,\n y: 'random(-50,50)',\n duration: 1,\n });\n }", "Smotion(desloc)\n\t{\n\t\t// If the key A is pressed then moves the vehicle backward and turn left\n\t\tif (this.keysdirectionPress[0]){\n\t\t\tthis.angleDirection -= desloc/5;\n\t\t\tthis.position[2] -= desloc*Math.cos(this.angleDirection);\n\t\t\tthis.position[0] += desloc*Math.sin(this.angleDirection);\n\n\t\t\t// If the next position is out of limits or has altimetry other than 0 then revert the movement\n\t\t\tif ( ! this.checkNextPosition(this.position[0],this.position[2])){\n\t\t\t\tthis.angleDirection += desloc/5;\n\t\t\t\tthis.position[2] += desloc*Math.cos(this.angleDirection);\n\t\t\t\tthis.position[0] -= desloc*Math.sin(this.angleDirection);\n\t\t\t}\n\t\t\tthis.frontLeftWheel.update(desloc,5);\n\t\t\tthis.frontRightWheel.update(-desloc,5);\n\t\t\tthis.backLeftWheel.update(desloc,0);\n\t\t\tthis.backRightWheel.update(-desloc,0);\n\t\t} else \n\t\t\t// If the key D is pressed then moves the vehicle backward and turn rigth\n\t\t\tif (this.keysdirectionPress[1]){\n\t\t\t\tthis.angleDirection += desloc/5;\n\t\t\t\tthis.position[2] -= desloc*Math.cos(this.angleDirection);\n\t\t\t\tthis.position[0] += desloc*Math.sin(this.angleDirection);\n\n\t\t\t\t// If the next position is out of limits or has altimetry other than 0 then revert the movement\n\t\t\t\tif ( ! this.checkNextPosition(this.position[0],this.position[2])){\n\t\t\t\t\tthis.angleDirection -= desloc/5;\n\t\t\t\t\tthis.position[2] += desloc*Math.cos(this.angleDirection);\n\t\t\t\t\tthis.position[0] -= desloc*Math.sin(this.angleDirection);\n\t\t\t\t}\n\t\t\t\tthis.frontLeftWheel.update(desloc,-5);\n\t\t\t\tthis.frontRightWheel.update(-desloc,-5);\n\t\t\t\tthis.backLeftWheel.update(desloc,0);\n\t\t\t\tthis.backRightWheel.update(-desloc,0);\n\t\t\t}\n\n\t\t// If only key W is pressed then moves the vehicle backward straight\n\t\tif ( !(this.keysdirectionPress[0] || this.keysdirectionPress[1]) ){\n\t\t\tthis.position[2] -= desloc*Math.cos(this.angleDirection);\n\t\t\tthis.position[0] += desloc*Math.sin(this.angleDirection);\n\n\t\t\t// If the next position is out of limits or has altimetry other than 0 then revert the movement\n\t\t\tif ( ! this.checkNextPosition(this.position[0],this.position[2])){\n\t\t\t\tthis.position[2] += desloc*Math.cos(this.angleDirection);\n\t\t\t\tthis.position[0] -= desloc*Math.sin(this.angleDirection);\n\t\t\t}\n\t\t\tthis.frontLeftWheel.update(desloc,0);\n\t\t\tthis.frontRightWheel.update(-desloc,0);\n\t\t\tthis.backLeftWheel.update(desloc,0);\n\t\t\tthis.backRightWheel.update(-desloc,0);\n\t\t}\n\t}", "function test21() {\n reset();\n e = {key: 'z', preventDefault: function() {}}\n downkey(e)\n let swapCurr = copyPiece(currentPiece)\n let swapHeld = copyPiece(heldPiece)\n downkey(e)\n return currentPiece.equals(swapCurr) && heldPiece.equals(swapHeld);\n}", "static MoveTowards() {}", "hasStarted () {\r\n return Boolean(this._pastPos[this._pastPos.length-1])\r\n }", "get true_position() { return this.position.copy().rotateX(Ribbon.LATITUDE).rotateZ(Earth.rotation).rotateZ(Ribbon.LONGITUDE); }", "function movementLogic(ant) {\n if(grid[ant.x][ant.y] == 0) {\n ant.turnRight();\n grid[ant.x][ant.y] = 1;\n } else if (grid[ant.x][ant.y] == 1) {\n ant.turnLeft();\n grid[ant.x][ant.y] = 0;\n }\n stroke(color(255 * grid[ant.x][ant.y]));\n ant.moveForward();\n point(ant.x ,ant.y);\n}", "function answer(e) {\n clearInterval(counter);\n let y = e.path[1];\n let x = parseInt(e.path[1].dataset.num);\n if (x === currentQuote) {\n correct(y);\n } else {\n wrong(y);\n }\n }", "function moveRight() {\n undraw()\n const reachedRightEdge = curT.some(index => (curPos + index) % width === width - 1)\n if (!reachedRightEdge) curPos += 1\n if (curT.some(index => squares[curPos + index].classList.contains('taken'))) {\n // if the position has been taken by another figure, push the tetromino back\n curPos -= 1 \n }\n draw()\n }", "noteOff(pitch) {\n this.keys[pitch].noteOff()\n }", "function frame() {\n console.log(\"zaim\");\n if (pos == z) {\n clearInterval(id);\n } else {\n pos--; \n //elem.style.top = pos + 'px'; \n elemt.style.left = pos+\"px\"; \n x=pos;\n //console.log(`avancer pos ${tos}`);\n }\n }", "handleToggle(type, cursorToEnd, oldState) {\n const { noteTracker, tr, markType } = this;\n const { $cursor, from, to } = tr.selection;\n\n if ($cursor) {\n const note = this.currentNote;\n if (note) {\n const { start, end } = note;\n return this.removeRanges([{ from: start, to: end }]);\n } else if (this.hasPlaceholder(oldState)) {\n return tr.removeStoredMark(markType);\n }\n return this.startNote(type);\n } else {\n const note = noteTracker.noteCoveringRange(from, to, true);\n if (note) {\n const { start, end, meta } = note;\n\n const notes = [];\n notes.push({\n from: start,\n to: from,\n meta: cloneDeep(meta),\n });\n\n // If this is a not of a different type then split add it in\n // the middle\n if (note.meta.type && note.meta.type !== type) {\n notes.push({\n from,\n to,\n meta: {\n type,\n },\n });\n }\n\n notes.push({\n from: to,\n to: end,\n meta: cloneDeep(meta),\n });\n\n return this.rebuildRange(\n {\n from: start,\n to: end,\n },\n notes\n );\n }\n return this.addNotes([{ from, to, meta: { type } }], cursorToEnd);\n }\n }", "move(predicate) {\n //console.log(predicate);\n const moveBy = this.moveMap[this.state.heading];\n // console.log(moveBy);\n const nextPos = { x: this.state.pos.x, y: this.state.pos.y };\n //console.log(nextPos);\n // Set next position\n nextPos[moveBy.plane] += moveBy.amount;\n\n // Check if move is legal\n const isLegal = predicate(nextPos);\n\n if (isLegal) {\n this.state.pos = nextPos;\n }\n }", "function test20() {\n reset();\n let origCurr = copyPiece(currentPiece)\n heldPiece = getRandomPiece()\n let origHeld = copyPiece(heldPiece)\n e = {key: 'z', preventDefault: function() {}}\n downkey(e)\n return heldPiece.equals(origCurr) && currentPiece.equals(origHeld)\n}", "function toggleState (state) {\n scope.ytModel.open = state\n scope.ytModel.active = true\n return scope.ytModel.moveX = state ? boundary : 0\n }", "function moveRight()\r\n {\r\n undraw()\r\n const isAtRightEdge = currentTetromino.some(index => (currentPosition + index) % 10 === 9)\r\n\r\n if(!isAtRightEdge)\r\n currentPosition +=1\r\n if(currentTetromino.some(index => squares[currentPosition + index].classList.contains('taken')))\r\n currentPosition -= 1\r\n draw()\r\n }", "function swapDown(state) {\n let blankPOS = findBlankCell(state)\n return swap(state, { y: blankPOS.y + 1, x: blankPOS.x })\n}", "function encloseLeftState(){\n if(shipY < 0){\n shipY = 0;\n }\n if(shipY > height - 50){\n shipY = height - 50;\n }\n if(shipX < 0){\n shipX = 0;\n }\n}", "lookAt(target) {\n let orientation = (target.x - this.x < 0) ? 'left' : 'right';\n this.setOrientation(orientation);\n }", "function changeDirection(e) {\n if (e.keyCode == 37) {\n direction = 0;\n console.log(\"direction is left:\" + direction);\n updateSnakeList();\n } else if (e.keyCode == 38) {\n direction = 1;\n console.log(\"direction is up:\" + direction)\n } else if (e.keyCode == 39) {\n direction = 2;\n console.log(\"direction is right :\" + direction)\n } else if (e.keyCode == 40) {\n direction = 3;\n console.log(\"direction is down :\" + direction)\n }\n }" ]
[ "0.5746375", "0.55368257", "0.5535701", "0.5489478", "0.5477091", "0.5469835", "0.54641306", "0.54497474", "0.5448987", "0.539226", "0.5390116", "0.5381963", "0.53652453", "0.53529024", "0.5351886", "0.5329601", "0.5325161", "0.5320744", "0.53071916", "0.5306592", "0.5287621", "0.5286169", "0.5283802", "0.5273054", "0.5273044", "0.5267569", "0.52606094", "0.52589273", "0.52545124", "0.5247685", "0.5246867", "0.5241165", "0.52075136", "0.5185876", "0.5178525", "0.5177861", "0.5174727", "0.51672083", "0.5130888", "0.51289654", "0.5125024", "0.51223713", "0.5121743", "0.51209104", "0.5115355", "0.510903", "0.50911725", "0.5089565", "0.50858045", "0.5080913", "0.50764924", "0.50702506", "0.50615686", "0.5061346", "0.50490683", "0.5047999", "0.50474286", "0.5039269", "0.5034246", "0.5032372", "0.50281173", "0.5026628", "0.5023828", "0.50184506", "0.5015237", "0.50142765", "0.50138724", "0.5012199", "0.50015545", "0.50013864", "0.49974188", "0.4996339", "0.49852172", "0.49842376", "0.49801686", "0.49800706", "0.49777374", "0.49774614", "0.49718064", "0.49714184", "0.4966849", "0.4957113", "0.49546716", "0.49538618", "0.4947926", "0.49454927", "0.49373573", "0.49342746", "0.49342337", "0.49335197", "0.49329406", "0.4930901", "0.49282813", "0.49276", "0.49233007", "0.49201947" ]
0.49260256
98
Parse the bound file.
function parse() { var self = this; var value = String(self.file); var start = {line: 1, column: 1, offset: 0}; var content = xtend(start); var node; /* Clean non-unix newlines: `\r\n` and `\r` are all * changed to `\n`. This should not affect positional * information. */ value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE); if (value.charCodeAt(0) === 0xFEFF) { value = value.slice(1); content.column++; content.offset++; } node = { type: 'root', children: self.tokenizeBlock(value, content), position: { start: start, end: self.eof || xtend(start) } }; if (!self.options.position) { removePosition(node, true); } return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse(fileName) {\n\n var baseDir = path.dirname(fileName);\n\n var jsonData = parseFile(fileName);\n if (!jsonData) {\n return null;\n }\n\n jsonData = replace(baseDir, jsonData, 'segment');\n if (!jsonData) {\n return null;\n }\n\n\n if (jsonData.hasOwnProperty('segment')) {\n if (!Array.isArray(jsonData.segment)) {\n console.error('segment must be array');\n return null;\n }\n for (var i = 0; i < jsonData.segment.length; i++) {\n\n var segment = jsonData.segment[i];\n segment = replace(baseDir, segment, 'host');\n if (!segment) {\n return null;\n }\n segment = replace(baseDir, segment, 'gateway');\n if (!segment) {\n return null;\n }\n jsonData.segment[i] = segment;\n }\n }\n\n jsonData = replace(baseDir, jsonData, 'event');\n\n //console.log(JSON.stringify(jsonData));\n return jsonData;\n}", "function BinaryParser() {}", "function BinaryParser() {}", "function BinaryParser() {}", "function BinaryParser() {}", "function BinaryParser() {}", "function parse(file) {\n let names = [];\n let parts = file.split(':');\n parts[0].split('\\n').forEach(function(line) {\n if (line !== '') {\n names.push(line.split(',')[0]);\n }\n });\n let n = -1;\n parts[1].split('\\n').forEach(function(line) {\n if (n >= 0) {\n data[names[n]] = line;\n }\n n++;\n });\n}", "function parse( file ) {\n\t\treturn __awaiter( this, void 0, void 0, function () {\n\t\t\treturn __generator( this, function ( _a ) {\n\t\t\t\treturn [\n\t\t\t\t\t2,\n\t\t\t\t\t/*return*/\n\t\t\t\t\tnew Promise( function ( resolve, reject ) {\n\t\t\t\t\t\tfs.readFile( file, 'utf8', function ( err, data ) {\n\t\t\t\t\t\t\tif ( err ) {\n\t\t\t\t\t\t\t\treject( err );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tresolve( parseString( data ) );\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}", "function BinaryParser() { }", "function parseFile(event) {\n Papa.parse(event.target.files[0], {\n complete: function (results) {\n console.log(results.data)\n setParse(results.data);\n setIsReady(true)\n }\n })\n }", "function parseRawTagData() {\n\n\t// Pre-populate the `generators.all` store with\n\t// all of the generator names, so that they can\n\t// be referenced.\n\t_.each( rawTagData, function( gen, path ) {\n\t\tlet name = getGeneratorNameFromPath( path );\n\t\tgenerators.all[ name ] = null;\n\t});\n\n\t// Iterate over each file and its Dox data\n\t_.each( rawTagData, function( gen, path ) {\n\n\t\t// Resolve a name for the generator\n\t\tlet name = getGeneratorNameFromPath( path );\n\n\t\t// Initialize a generator info object\n\t\tlet item = {\n\t\t\tname: name,\n\t\t\ttype: \"partial\",\n\t\t\tisDefault: false,\n\t\t\tdescription: gen.description,\n\t\t\tauthor: null,\n\t\t\tcreated: null,\n\t\t\tpaths: {\n\t\t\t\tabs: path,\n\t\t\t\trel: getRelativeGeneratorPath( path )\n\t\t\t},\n\t\t\tuses: {},\n\t\t\tcreates: {},\n\t\t\toperations: [],\n\t\t\tpromptsFor: {},\n\t\t\texample: null\n\t\t};\n\n\t\t// Parse each tag object generated by Dox\n\t\t_.each( gen.doxData, function( tag ) {\n\t\t\tparseOneTag( item, tag );\n\t\t});\n\n\t\t// Persist the generator info object\n\t\tgenerators.all[ name ] = item;\n\t\tgenerators[ item.type ][ name ] = item;\n\n\t});\n\n}", "function parse(file) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2\n /*return*/\n , new Promise(function (resolve, reject) {\n fs.readFile(file, 'utf8', function (err, data) {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(parseString(data));\n });\n })];\n });\n });\n }", "parse() {\n /**\n * The first two bytes are a bitmask which states which features are present in the mapFile\n * The second two bytes are.. something?\n */\n const featureFlags = this.take(2, \"featureFlags\").readUInt16LE(0);\n this.take(2, \"unknown01\");\n if (featureFlags & 0b000000000000001) {\n this.robotStatus = this.take(0x2C, \"robot status\");\n }\n\n\n if (featureFlags & 0b000000000000010) {\n this.mapHead = this.take(0x28, \"map head\");\n this.parseImg();\n }\n if (featureFlags & 0b000000000000100) {\n let head = asInts(this.take(12, \"history\"));\n this.history = [];\n for (let i = 0; i < head[2]; i++) {\n // Convert from ±meters to mm. UI assumes center is at 20m\n let position = this.readFloatPosition(this.buf, this.offset + 1);\n // first byte may be angle or whether robot is in taxi mode/cleaning\n //position.push(this.buf.readUInt8(this.offset)); //TODO\n this.history.push(position[0], position[1]);\n this.offset += 9;\n }\n }\n if (featureFlags & 0b000000000001000) {\n // TODO: Figure out charge station location from this.\n let chargeStation = this.take(16, \"charge station\");\n this.chargeStation = {\n position: this.readFloatPosition(chargeStation, 4),\n orientation: chargeStation.readFloatLE(12)\n };\n }\n if (featureFlags & 0b000000000010000) {\n let head = asInts(this.take(12, \"virtual wall\"));\n\n this.virtual_wall = [];\n this.no_go_area = [];\n\n let wall_num = head[2];\n\n for (let i = 0; i < wall_num; i++) {\n this.take(12, \"virtual wall prefix\");\n let body = asFloat(this.take(32, \"Virtual walls coords\"));\n\n if (body[0] === body[2] && body[1] === body[3] && body[4] === body[6] && body[5] === body[7]) {\n //is wall\n let x1 = Math.round(ViomiMapParser.convertFloat(body[0]));\n let y1 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[1]));\n let x2 = Math.round(ViomiMapParser.convertFloat(body[4]));\n let y2 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[5]));\n\n this.virtual_wall.push([x1, y1, x2, y2]);\n } else {\n //is zone\n let x1 = Math.round(ViomiMapParser.convertFloat(body[0]));\n let y1 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[1]));\n let x2 = Math.round(ViomiMapParser.convertFloat(body[2]));\n let y2 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[3]));\n let x3 = Math.round(ViomiMapParser.convertFloat(body[4]));\n let y3 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[5]));\n let x4 = Math.round(ViomiMapParser.convertFloat(body[6]));\n let y4 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[7]));\n\n this.no_go_area.push([x1, y1, x2, y2, x3, y3, x4, y4]);\n }\n\n this.take(48, \"unknown48\");\n }\n }\n if (featureFlags & 0b000000000100000) {\n let head = asInts(this.take(12, \"area head\"));\n let area_num = head[2];\n\n this.clean_area = [];\n\n for (let i = 0; i < area_num; i++) {\n this.take(12, \"area prefix\");\n let body = asFloat(this.take(32, \"area coords\"));\n\n let x1 = Math.round(ViomiMapParser.convertFloat(body[0]));\n let y1 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[1]));\n let x2 = Math.round(ViomiMapParser.convertFloat(body[2]));\n let y2 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[3]));\n let x3 = Math.round(ViomiMapParser.convertFloat(body[4]));\n let y3 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[5]));\n let x4 = Math.round(ViomiMapParser.convertFloat(body[6]));\n let y4 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[7]));\n\n this.clean_area.push([x1, y1, x2, y2, x3, y3, x4, y4]);\n\n this.take(48, \"unknown48\");\n }\n }\n if (featureFlags & 0b000000001000000) {\n let navigateTarget = this.take(20, \"navigate\");\n this.navigateTarget = {position: this.readFloatPosition(navigateTarget, 8)};\n }\n if (featureFlags & 0b000000010000000) {\n let realtimePose = this.take(21, \"realtime\");\n this.realtimePose = {position: this.readFloatPosition(realtimePose, 9)};\n }\n\n if (featureFlags & 0b000100000000000) {\n //v6 example: 5b590f5f00000001\n //v7 example: e35a185e00000001\n this.take(8, \"unknown8\");\n this.parseRooms();\n // more stuff i don't understand\n this.take(50, \"unknown50\");\n this.take(5, \"unknown5\");\n this.points = [];\n try {\n this.parsePose();\n } catch (e) {\n Logger.warn(\"Unable to parse Pose\", e); //TODO\n }\n }\n this.take(this.buf.length - this.offset, \"trailing\");\n\n // TODO: one of them is just the room outline, not actual past navigation logic\n return this.convertToValetudoMap({\n image: this.img,\n zones: this.rooms,\n //TODO: at least according to all my sample files, this.points is never the path\n //Why is this here?\n //path: {points: this.points.length ? this.points : this.history},\n path: {points: this.history},\n goto_target: this.navigateTarget && this.navigateTarget.position,\n robot: this.realtimePose && this.realtimePose.position,\n charger: this.chargeStation && this.chargeStation.position,\n virtual_wall: this.virtual_wall,\n no_go_area: this.no_go_area,\n clean_area: this.clean_area\n });\n }", "load(file) {\n this._loading = file;\n\n // Read file and split into lines\n const map = {};\n\n const content = fs.readFileSync(file, 'ascii');\n const lines = content.split(/[\\r\\n]+/);\n\n lines.forEach(line => {\n // Clean up whitespace/comments, and split into fields\n const fields = line.replace(/\\s*#.*|^\\s*|\\s*$/g, '').split(/\\s+/);\n map[fields.shift()] = fields;\n });\n\n this.define(map);\n\n this._loading = null;\n }", "function parseFile(str) {\n\n\t\t// Verifying str type\n\t\tif (typeof str !== 'string') {\n\t\t\talert('Sorry... we had a uhh... error parsing?');\n\t\t\treturn;\n\t\t}\n\n\t\t// RegEx is a blast -_-\n\t\tlet newParsedArr = str.match(/['\"].*?['\"]/g).map(item => {\n\t\t\treturn item.replace(/['\"]/g, \"\");\n\t\t});\n\t\tformatPaths(newParsedArr);\n\t}", "function parseHBX(completePath)\n{\n\tnTodo++;\n\tlet fileName = path.parse(completePath).name\n\tvar ck = /DYNAMIC\\s+([_a-z0-9]+)/i;\n\tvar reader = readline.createInterface({input:fs.createReadStream(completePath,\"utf8\")});\n\treader.on(\"line\",l =>\n\t{\n\t\tvar m = l.match(ck);\n\t\tif(m && m[1])\n\t\t{\n\t\t\tstdMethods.push([m[1],fileName]);\n\t\t}\n\t});\n\treader.on(\"close\",() =>\n\t{\n\t\tnTodo--;\n\t\tif(nTodo==0)\n\t\t\tcreateDoc();\n\t})\n}", "parseFlsFile(baseFile) {\r\n this.extension.logger.addLogMessage('Parse fls file.');\r\n const rootDir = path.dirname(baseFile);\r\n const outDir = this.getOutDir(baseFile);\r\n const flsFile = path.resolve(rootDir, path.join(outDir, path.basename(baseFile, '.tex') + '.fls'));\r\n if (!fs.existsSync(flsFile)) {\r\n this.extension.logger.addLogMessage(`Cannot find fls file: ${flsFile}`);\r\n return;\r\n }\r\n this.extension.logger.addLogMessage(`Fls file found: ${flsFile}`);\r\n const ioFiles = this.parseFlsContent(fs.readFileSync(flsFile).toString(), rootDir);\r\n ioFiles.input.forEach((inputFile) => {\r\n // Drop files that are also listed as OUTPUT or should be ignored\r\n if (ioFiles.output.includes(inputFile) ||\r\n this.isExcluded(inputFile) ||\r\n !fs.existsSync(inputFile)) {\r\n return;\r\n }\r\n // Drop the current rootFile often listed as INPUT and drop any file that is already in the texFileTree\r\n if (baseFile === inputFile || inputFile in this.cachedContent) {\r\n return;\r\n }\r\n if (path.extname(inputFile) === '.tex') {\r\n // Parse tex files as imported subfiles.\r\n this.cachedContent[baseFile].children.push({\r\n index: Number.MAX_VALUE,\r\n file: inputFile\r\n });\r\n this.parseFileAndSubs(inputFile);\r\n }\r\n else if (this.fileWatcher && !this.filesWatched.includes(inputFile)) {\r\n // Watch non-tex files.\r\n this.fileWatcher.add(inputFile);\r\n this.filesWatched.push(inputFile);\r\n }\r\n });\r\n ioFiles.output.forEach((outputFile) => {\r\n if (path.extname(outputFile) === '.aux' && fs.existsSync(outputFile)) {\r\n this.parseAuxFile(fs.readFileSync(outputFile).toString(), path.dirname(outputFile).replace(outDir, rootDir));\r\n }\r\n });\r\n }", "function parse() {\n var self = this\n var value = String(self.file)\n var start = {line: 1, column: 1, offset: 0}\n var content = xtend(start)\n var node\n\n // Clean non-unix newlines: `\\r\\n` and `\\r` are all changed to `\\n`.\n // This should not affect positional information.\n value = value.replace(lineBreaksExpression, lineFeed)\n\n // BOM.\n if (value.charCodeAt(0) === 0xfeff) {\n value = value.slice(1)\n\n content.column++\n content.offset++\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {start: start, end: self.eof || xtend(start)}\n }\n\n if (!self.options.position) {\n removePosition(node, true)\n }\n\n return node\n}", "function parseAllGRIBs(inData) {\n // create the object to keep all the data in\n var weatherDB = new weatherDBObject();\n\n // loop through all the grib parts in the file\n var gribCount = 1;\n var starttime = +new Date();\n while (inData.byteLength > 0) {\n if (gribCount % 10 == 0) {\n\n var currentTime = +new Date();\n starttime = currentTime;\n }\n dbg(2, \" Starting GRIB Block \" + gribCount);\n gribCount++;\n var sect0 = new DataView(inData, 0, 16);\n // Make sure this is a grib file\n // first 4 characters should be GRIB. Must be a meteorological file (byte 7 = 0) and version 2 (byte 8 = 2). Max length supported is 2^32 (top 32 if length =0)\n\n if (sect0.getUint8(0) == 0x47 && sect0.getUint8(1) == 0x52 && sect0.getUint8(2) == 0x49 && sect0.getUint8(3) == 0x42 && sect0.getUint8(6) == 0x0 && sect0.getUint8(7) == 0x2 && sect0.getUint32(8) == 0) {\n\n // get the length of the grub file\n var griblength = sect0.getUint32(12);\n\n // trim off this grib\n var grib = inData.slice(0, griblength);\n inData = inData.slice(griblength);\n // at this point grib contains one of the multiple gribs in the source file\n // there is a separate grib for each parameter and pressure (alt)\n parseGRIB(grib, weatherDB);\n if (weatherDB.status < 0) {\n // error found, return\n return (weatherDB);\n }\n\n } else {\n // alert(\"ERROR: Not a grib file this parser understands\");\n dbg(0, \"ERROR: Not a grib file this parser understands\");\n weatherDB.statusMsg = \"ERROR: Not a grib file this parser understands\";\n weatherDB.status = -1;\n\t\t\tthrow error;\n return (weatherDB);\n }\n }\n // just keep the unique, sorted values for lats, longs, pressures, & params.\n weatherDB.lats = arrayUnique(weatherDB.lats);\n weatherDB.lats.sort(function (a, b) {\n return a - b\n });\n weatherDB.longs = arrayUnique(weatherDB.longs);\n weatherDB.longs.sort(function (a, b) {\n return a - b\n });\n weatherDB.pressures = arrayUnique(weatherDB.pressures);\n weatherDB.pressures.sort(function (a, b) {\n return a - b\n });\n weatherDB.params = arrayUnique(weatherDB.params);\n weatherDB.params.sort();\n weatherDB.status = 100; // say the data is valid\n return weatherDB;\n}", "parseFileAndSubs(file, onChange = false) {\r\n if (this.isExcluded(file)) {\r\n this.extension.logger.addLogMessage(`Ignoring ${file}`);\r\n return;\r\n }\r\n this.extension.logger.addLogMessage(`Parsing ${file}`);\r\n if (this.fileWatcher && !this.filesWatched.includes(file)) {\r\n // The file is first time considered by the extension.\r\n this.fileWatcher.add(file);\r\n this.filesWatched.push(file);\r\n }\r\n const content = this.getDirtyContent(file, onChange);\r\n this.cachedContent[file].children = [];\r\n this.cachedContent[file].bibs = [];\r\n this.cachedFullContent = undefined;\r\n this.parseInputFiles(content, file);\r\n this.parseBibFiles(content, file);\r\n // We need to parse the fls to discover file dependencies when defined by TeX macro\r\n // It happens a lot with subfiles, https://tex.stackexchange.com/questions/289450/path-of-figures-in-different-directories-with-subfile-latex\r\n this.parseFlsFile(file);\r\n }", "function readFile() {\n\t\tlet reader = new FileReader();\n\t\treader.addEventListener('loadend', () => {\n\t\t\tparseFile(reader.result);\n\t\t});\n\t\treader.readAsText(this.files[0]);\n\t}", "function parseFile(evt){\n let files = evt.target.files; // FileList object\n if(files.length === 0){ //if no files\n return;\n }\n let f = files[0];\n\n let pointsArray = [];\n fileFaces = [];\n let reader = new FileReader();\n reader.onload = (function(theFile) {\n return function(e) {\n let contents = atob(e.target.result.split(\"base64,\")[1]);\n contents = contents.split(/\\n/); //split contents into lines\n if(contents[0].replace(/\\s+/, \"\") === \"\"){ //if first line is blank\n contents.shift(); //delete it\n }\n if(contents[0].replace(/\\s+/, \"\") !== \"ply\"){ //if first line does not contain \"ply\"\n console.log(\"No Ply: \" + contents[0]); //do nothing with the file\n return;\n }\n\n let i = 1;\n let numVerts = 0;\n let numFaces = 0;\n\n while(contents[i].indexOf(\"end_header\") === -1){ //while we haven't hit the end of the header\n if(contents[i].indexOf(\"element vertex\") !== -1){ //if this line indicates # vertices\n let idx = contents[i].indexOf(\"element vertex\");\n numVerts = parseInt(contents[i].substring(idx+14)); //parse # of vertices\n } else if(contents[i].indexOf(\"element face\") !== -1){ //if this line indicates # of faces\n let idx = contents[i].indexOf(\"element face\");\n numFaces = parseInt(contents[i].substring(idx+12)); //parse # of faces\n }\n i++;\n }\n i++; //increment to line just after end_header\n let left = vec4(Number.MAX_VALUE, 0.0, 0.0, 0.0);\n let right = vec4(Number.MIN_VALUE, 0.0, 0.0, 0.0);\n let top = vec4(0.0, Number.MIN_VALUE, 0.0, 0.0);\n let bottom = vec4(0.0, Number.MAX_VALUE, 0.0, 0.0);\n let minZ = vec4(0.0, 0.0, Number.MAX_VALUE, 0.0);\n let maxZ = vec4(0.0, 0.0, Number.MIN_VALUE, 0.0); //initialize extents to easily-overridden values\n\n let j = 0;\n for(j = 0; j < numVerts; j++){ //for each vertex\n while(contents[i].replace(/\\s+/, \"\") === \"\"){ //ignore empty lines\n i++;\n }\n let points = contents[i].split(/\\s+/); //split along spaces\n if(points[0].replace(/\\s+/, \"\") === \"\"){ //ignore empty first element\n points.shift();\n }\n let x = parseFloat(points[0]);\n let y = parseFloat(points[1]);\n let z = parseFloat(points[2]);\n let thisPoint = vec4(x, y, z, 1.0);\n\n if(x < left[0]){ //if x is further left\n left = thisPoint;\n }\n if(x > right[0]){ //if x is further right\n right = thisPoint;\n }\n if(y < bottom[1]){ //if y is lower\n bottom = thisPoint;\n }\n if(y > top[1]){ //if y is higher\n top = thisPoint;\n }\n if(z < minZ[2]){ //if Z is further\n minZ = thisPoint;\n }\n if(z > maxZ[2]){ //if Z is closer\n maxZ = thisPoint;\n }\n pointsArray.push(thisPoint);\n i++;\n }\n\n let divisor = Math.max(right[0]-left[0], top[1]-bottom[1], maxZ[2]-minZ[2]) / 2; //calculate largest dimension\n let shiftX = (-(right[0] - (right[0]-left[0])/2))/divisor; //X axis translation to center at origin\n let shiftY = (-(top[1] - (top[1]-bottom[1])/2))/divisor; //Y axis translation to center at origin\n let shiftZ = (-(maxZ[2] - (maxZ[2]-minZ[2])/2))/divisor; //Z axis translation to center at origin\n for(j = 0; j < numFaces; j++){ //for each face\n while(contents[i].replace(/\\s+/, \"\") === \"\"){ //ignore empty lines\n i++;\n }\n let verts = contents[i].split(/\\s+/);\n if(verts[0].replace(/\\s+/, \"\") === \"\"){ //if empty first element\n verts.shift();\n }\n let vertLen = parseInt(verts[0]); //parse # vertices\n verts.shift();\n\n for(let k = 0; k < vertLen; k++){ //for # of vertices\n let currVert = pointsArray[verts[k]];\n fileFaces.push(vec4(currVert[0]/divisor + shiftX, currVert[1]/divisor + shiftY, currVert[2]/divisor + shiftZ, 1.0));\n //shift vertex so whole object is centered on origin and [-1, 1], push to face\n }\n i++;\n }\n let rightBB = right[0]/divisor + shiftX;\n let topBB = top[1]/divisor + shiftY;\n let maxZBB = maxZ[2]/divisor + shiftZ;\n\n //back face\n fileBB = generateBB(rightBB, topBB, maxZBB);\n\n fileUploaded = true;\n if(shapeArray.length === 3){ //if another file is already loaded\n shapeArray.pop(); //get rid of it\n }\n shapeArray.push(fileFaces); //push this file to shape array\n fileFlatNormal = fNormals(shapeArray[2]); //calculate flat normals\n fileGNormal = gNormals(shapeArray[2]); //calculate gouraud normals\n generateLines(); //regenerate lines to account fo new bounding box\n };\n })(f);\n reader.readAsDataURL(f);\n}", "function loadStructureHandler(text)\r\n\t{\r\n\t var content = text.split(\"\\n\");\r\n\t //console.log(content[1]);\r\n\t BuildStructure(name,content,callback, new ProgressDialog(\"Assimilating PDB file \"+name+\"...\"));\r\n\t}", "function parseText(file) {\n console.log(file);\n var lines = file.split(\"\\n\");\n var params = lines[0].split(\" \");\n if (params.length < 3) {\n console.log(\"File format error\");\n return false;\n }\n listType = params[0];\n rowSize = parseInt(params[1], 10);\n memSize = parseInt(params[2], 10);\n for (var i = 1; i < lines.length; i++) {\n //parse each line\n if (lines[i].length <= 0) break;\n if (lines[i].charAt(0) == '#') console.log(lines[i]);\n else {\n var args = lines[i].split(\" \");\n var addr;\n if (args.length == 2) {\n //this is a free block\n var block;\n freebls.push({\n address: addr = parseInt(args[0], 16),\n size: parseInt(args[1], 10),\n type: FREE\n });\n if (addr < memhead) memhead = addr;\n } else if (args.length == 3) {\n usedbls.push({\n address: addr = parseInt(args[0], 16),\n size: parseInt(args[1], 10),\n rsize: parseInt(args[2], 10),\n type: USED\n });\n if (addr < memhead) memhead = addr;\n } else {\n console.log(\"Error parsing file, line \" + i + \"has incorrect ammount of arguments\");\n return false;\n }\n }\n }\n\n if (listType == EXPLICIT) {\n // add link\n for (var i = 0; i < freebls.length - 1; i++) {\n freebls[i].next = freebls[i + 1].address;\n }\n }\n\n function compare(a, b) {\n return a.address > b.address;\n }\n freebls.sort(compare);\n if (listType == EXPLICIT) {\n for (var i = 0; i < freebls.length - 1; i++) {\n var diff = freebls[i + 1].address - freebls[i].address;\n if (diff > freebls[i].size) {\n //there is a used block\n usedbls.push({\n address: freebls[i].address + freebls[i].size,\n size: diff - freebls[i].size,\n type: USED\n })\n }\n }\n var lastfree = freebls[freebls.length - 1];\n var lastusedhead = lastfree.address + lastfree.size;\n if (memSize > lastfree.address + lastfree.size - memhead) {\n usedbls.push({\n address: lastfree.address + lastfree.size,\n size: memSize + memhead - lastusedhead,\n type: USED\n });\n }\n }\n bls = freebls.concat(usedbls);\n bls.sort(compare);\n\n // for (var i = 0; i < freebls.length - 1; i++) {\n // console.log(\"\" + freebls[i].address + \" \" + freebls[i].size);\n // }\n\n initBoxes();\n\n return true;\n}", "parseFile(file) {\r\n this._lines = [];\r\n this._currentLine = -1;\r\n this._resetStates();\r\n\r\n lineReader.eachLine(file, (line) => {\r\n this._lines.push(ParseUtil.clearCRLF(line));\r\n }).then(()=>{\r\n this._linesGenerator = this.lineReader();\r\n this._readNextLine();\r\n });\r\n }", "function parseFile(path, cvt, cb) {\n if (cvt == null) cvt = adapter;\n fs.readFile(path, (err, data) => {\n if (err) return cb(err);\n xml2js.parseString(data, (err, data) => {\n if (err) return cb(err);\n if (! data) return cb(null, null);\n const key = Object.keys(data)[0];\n if (! key) return cb(null, null);\n cb(null, cvt(data[key], key));\n });\n });\n}", "getDefinition(file, position) {\n // Overridden in XMLScope. Brs files use implementation in BrsFile\n return [];\n }", "function parseLiveFile(e) {\n if (e.document.isUntitled) {\n return;\n }\n if (e.document.languageId !== 'go') {\n return;\n }\n if (!goLiveErrorsEnabled()) {\n return;\n }\n if (runner != null) {\n clearTimeout(runner);\n }\n runner = setTimeout(() => {\n processFile(e);\n runner = null;\n }, config_1.getGoConfig(e.document.uri)['liveErrors']['delay']);\n}", "function parseFile(file) {\n\n if (window.File && window.FileReader && Window.FileList && window.Blob) {\n alert(\"File Reader APIs not up to date on current browser.\")\n return\n }\n \n //create file reader \n var reader = new FileReader()\n\n\n if(file.files && file.files[0]) {\n reader.onload = function (e) {\n parseInput(e.target.result)\n }\n\n reader.readAsText(file.files[0])\n }\n else {\n alert(\"Error reading file.\")\n }\n\n}", "function parseFile(err, contents) {\r\n const output = parse(contents, {\r\n columns: true,\r\n skip_empty_lines: true\r\n });\r\n\r\n // Call build function. Interpret and construct Org Chart\r\n buildOutput(output);\r\n}", "function BaseBodyParser() {\n\t}", "handleTheFile(event) {\n event.preventDefault();\n if (this.inputFile.current.files[0] === undefined) { return; }\n\n // Confirm file extension and read the data as text\n console.log('Reading the file...');\n let fileName = this.inputFile.current.files[0].name;\n if (!fileName.endsWith('.asc')) {\n console.error('Error opening the file: Invalid file extension, .asc expected.');\n return;\n }\n let file = this.inputFile.current.files[0];\n let reader = new FileReader();\n reader.onload = (event) => {\n console.log('Done.');\n this.ParseTheData(event.target.result);\n }\n reader.onerror = () => {\n console.error('Error opening the file: Cannot read file.');\n return;\n }\n reader.readAsText(file);\n }", "function metadataParser(file, callback, errback) {\n queue.push({file: file, callback: callback, errback: errback});\n if (!busy)\n processQueue();\n }", "function parsed_done() {\n\n\tconsole.log(fileParsed);\n\n}", "function parse(context, file) {\n var message\n\n if (stats(file).fatal) {\n return\n }\n\n if (context.treeIn) {\n debug('Not parsing already parsed document')\n\n try {\n context.tree = json(file.toString())\n } catch (error) {\n message = file.message(\n new Error('Cannot read file as JSON\\n' + error.message)\n )\n message.fatal = true\n }\n\n // Add the preferred extension to ensure the file, when serialized, is\n // correctly recognised.\n // Only add it if there is a path — not if the file is for example stdin.\n if (file.path) {\n file.extname = context.extensions[0]\n }\n\n file.contents = ''\n\n return\n }\n\n debug('Parsing `%s`', file.path)\n\n context.tree = context.processor.parse(file)\n\n debug('Parsed document')\n}", "function parse (fileName, text) {\n const reader = Reader.create(fileName, text)\n const fragments = []\n\n // loop through lines, building fragments\n while (true) {\n if (reader.atEnd()) break\n\n // get the first line of the next fragment\n reader.skipEmptyLines()\n\n const line = reader.read()\n if (line == null) break\n\n // push the fragment line back for fragment handler to process\n reader.pushBack()\n\n const fragment = getFragment(line)\n if (fragment.read(reader) == null) break\n\n fragments.push(fragment)\n }\n\n return fragments\n}", "parseFile(file) {\n\n var content = this.lire(file);\n\n var lines = content.split(/\\r?\\n/);\n\n //string that contains keys\n var header = lines[0];\n\n //array containing data separate with \";\"\n var dataLines = lines.slice(1);\n\n // data = dataLines.map(this.parser);\n\n var data = this.jsonifydata(header,dataLines);\n\n console.log(data);\n\n }", "function parse$a(context, file) {\n var message;\n\n if (stats$5(file).fatal) {\n return\n }\n\n if (context.treeIn) {\n debug$8('Not parsing already parsed document');\n\n try {\n context.tree = json$1(file.toString());\n } catch (error) {\n message = file.message(\n new Error('Cannot read file as JSON\\n' + error.message)\n );\n message.fatal = true;\n }\n\n // Add the preferred extension to ensure the file, when serialized, is\n // correctly recognised.\n // Only add it if there is a path — not if the file is for example stdin.\n if (file.path) {\n file.extname = context.extensions[0];\n }\n\n file.contents = '';\n\n return\n }\n\n debug$8('Parsing `%s`', file.path);\n\n context.tree = context.processor.parse(file);\n\n debug$8('Parsed document');\n}", "parseBitmap(buffer, parsed) {\r\n\r\n // file buffer\r\n this.buffer = buffer;\r\n\r\n // fileType\r\n this.type = buffer.toString('utf-8', 0, 2);\r\n // fileSize\r\n this.fileSize = buffer.readInt32LE(2);\r\n // Bytes Per Pixel\r\n this.bitsPerPixel = buffer.readInt16LE(28);\r\n // Height\r\n this.height = buffer.readInt32LE(22);\r\n // Width\r\n this.width = buffer.readInt32LE(18);\r\n // DIB Header size \r\n this.sizeOfTheDIBHeader = buffer.readInt32LE(14);\r\n // Start of color chart\r\n this.colorChart = (this.sizeOfTheDIBHeader + 14 + 12);\r\n // Start of pixels\r\n this.pixels = buffer.readInt32LE(10);\r\n\r\n parsed(this);\r\n }", "async parse() {\n const buffer = await readFile(`${this.file}`);\n // Create a naked object to model the bitmap properties\n const parsedBitmap = {};\n\n // Identify the offsets by reading the bitmap docs\n const FILE_SIZE_OFFSET = 2;\n const WIDTH_OFFSET = 18;\n const HEIGHT_OFFSET = 22;\n const BYTES_PER_PIXEL_OFFSET = 28;\n const COLOR_PALLET_OFFSET = 46;\n const COLOR_TABLE_OFFSET = 54;\n const PIXEL_ARRAY_OFFSET = 310;\n\n //------------------------------------------------------\n // READING INFORMATION FROM THE BITMAP FILE\n //------------------------------------------------------\n\n parsedBitmap.type = buffer.toString('utf-8', 0, 2);\n parsedBitmap.fileSize = buffer.readInt32LE(FILE_SIZE_OFFSET);\n parsedBitmap.bytesPerPixel = buffer.readInt16LE(BYTES_PER_PIXEL_OFFSET);\n parsedBitmap.height = buffer.readInt32LE(HEIGHT_OFFSET);\n parsedBitmap.width = buffer.readInt32LE(WIDTH_OFFSET);\n parsedBitmap.colorPallet = buffer.readInt32LE(COLOR_PALLET_OFFSET);\n parsedBitmap.colorTable = buffer.readInt32LE(COLOR_TABLE_OFFSET);\n parsedBitmap.pixelArray = buffer.readInt32LE(PIXEL_ARRAY_OFFSET);\n\n const colorTable = buffer.slice(PIXEL_ARRAY_OFFSET);\n const tableOfColors = buffer.slice(COLOR_TABLE_OFFSET, PIXEL_ARRAY_OFFSET);\n\n // Bottom left boundary = 1146\n // Top right boundary = buffer.length\n // Color table = 121 to 1145 (1145 - 4 * 256)\n // const num = 6111 - 3 * 112;\n // const blockheight = 400;\n\n // console.log(parsedBitmap);\n return parsedBitmap;\n }", "function parsedFile(lines) {\n let rounds = 0;\n let players = [];\n let root = {};\n\n lines.forEach((line) => {\n if (line.indexOf('InitGame') !== -1) {\n rounds = getInitGame(root, rounds);\n }\n\n if (line.indexOf('killed') !== -1) {\n kill(root[`game_${rounds}`], line);\n }\n\n if (line.indexOf('ClientUserinfoChanged') !== -1) {\n instancePlayers(root[`game_${rounds}`], line);\n }\n });\n return root;\n}", "static parseBpmn(filenames) {\n if (typeof filenames === 'string') {\n filenames = [filenames];\n }\n return filenames.map(filename => {\n const xmlData = fs.readFileSync(filename).toString();\n if (parser.validate(xmlData)) {\n return parser.parse(xmlData, BpmnParser.parserOptions);\n }\n return {};\n });\n }", "function parseFile(contents, fileName) {\n\t\ttry {\n\t\t\tif(typeof contents === 'string') {\n\t\t\t\tcontents = JSON.parse(contents);\n\t\t\t\tdataBase = contents;\n\t\t\t\tcheckData();\n\t\t\t\treturn;\n\t\t\t}\n\t\t} catch (e) { }\n\n\t\tif(contents instanceof Array) { // from slot set of \"FileContents\"\n\t\t\tdataBase = contents;\n\t\t\tcheckData();\n\t\t\treturn;\n\t\t}\n\n\t\tvar p = 0;\n\t\tvar lex = {\" \":0, \",\":0, \"\\t\":0, \"\\n\":0, \";\":0};\n\t\tvar best = \"\\n\";\n\t\tvar bestn = 0;\n\n\t\twhile (p < contents.length) {\n\t\t\tif(lex.hasOwnProperty(contents[p])) {\n\t\t\t\tlex[contents[p]] += 1;\n\n\t\t\t\tif(lex[contents[p]] > bestn) {\n\t\t\t\t\tbestn = lex[contents[p]];\n\t\t\t\t\tbest = contents[p];\n\t\t\t\t}\n\t\t\t}\n\t\t\tp++;\n\t\t}\n\n\t\tdataBase = [];\n\t\tp1 = 0;\n\t\tp2 = p1+1;\n\t\tvar firstRow = true;\n\n\t\twhile (p2 < contents.length) {\n\t\t\tif(contents[p2] == \"\\n\" || p2 == contents.length - 1) {\n\t\t\t\tif(p2 == contents.length - 1 && contents[p2] != \"\\n\") {\n\t\t\t\t\tp2++; // include last character too\n\t\t\t\t}\n\t\t\t\tvar thisRow = contents.substr(p1, p2 - p1);\n\t\t\t\tvar items = thisRow.split(best);\n\t\t\t\tvar name = items[0];\n\t\t\t\tvar vals = [];\n\t\t\t\tfor(var i = 1; i < items.length; i++) {\n\t\t\t\t\tvar val = parseFloat(items[i]);\n\n\t\t\t\t\tif(val !== null && val !== undefined && !isNaN(val)) {\n\t\t\t\t\t\tvals.push(val);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar data = [name, vals];\n\t\t\t\tif(vals.length > 0) {\n\t\t\t\t\tdataBase.push(data);\n\t\t\t\t}\n\n\t\t\t\tfirstRow = false;\n\n\t\t\t\twhile(contents[p2] == \"\\n\") {\n\t\t\t\t\tp2++;\n\t\t\t\t}\n\t\t\t\tp1 = p2;\n\t\t\t\tp2 = p1 + 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tp2++;\n\t\t\t}\n\t\t}\n\n\t\t$scope.set(\"FileContents\", dataBase);\n\t\t$scope.dataSetName = fileName;\n\t\tcheckData();\n\t}", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parseFile(fileUpload) {\n\n //Add error handling here.\n var status = 'good';\n \n \n //TODO: Insert parsing code here\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n //TODO: Insert parsing code here\n let glFile = csvGenerator(),\n wideFile = csvGenerator(),\n longFile = csvGenerator()\n \n if (status === 'good') {\n return {\n GL: glFile,\n Workorders_Wide: wideFile,\n Workorders_Long: longFile\n };\n } else {\n return null;\n }\n \n}", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "_parseCollection()\n {\n var that = this;\n fs.readFile(this.option.path, 'utf8', function (err, data) {\n if (err) throw err;\n that.collection = JSON.parse(data);\n that._serveCollection();\n })\n }", "function ReadPDBfile(file,callback)\r\n{\r\n\tvar self = this;\r\n\tvar name= PDButil.stripName(file.name);\r\n\t\r\n\t//Assigning Properties by reading the file\r\n\tvar pdbfileReader = new FileReader();\r\n\t\r\n\t//Reads the file\r\n\tpdbfileReader.readAsText(file);\r\n\t\r\n\t//When file is read, this function is called\r\n\tpdbfileReader.onload = loadStructureHandler;\r\n\tpdbfileReader.onerror = errorStructureHandler;\r\n\t\r\n\tfunction loadStructureHandler(event)\r\n\t{\r\n\t var content = event.target.result.split(\"\\n\");\r\n\t //console.log(content[1]);\r\n\t BuildStructure(name,content,callback, new ProgressDialog(\"Assimilating PDB file \"+name+\"...\"));\r\n\t};\r\n\r\n\tfunction errorStructureHandler(event)\r\n\t{\r\n\t console.log(\"Error while reading the file\");\r\n\t};\r\n \r\n}", "function parseFile(req, res, next){\n var filePath = req.files.file.path;\n console.log(filePath);\n function onNewRecord(record){\n console.log(record)\n }\n\n function onError(error){\n console.log(error)\n }\n\n function done(linesRead){\n res.send(200, linesRead)\n }\n\n var columns = true; \n parseCSVFile(filePath, columns, onNewRecord, onError, done);\n\n}", "function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function Parser(doc, file) {\n this.file = file;\n this.offset = {};\n this.options = xtend(this.options);\n this.setOptions({});\n\n this.inList = false;\n this.inBlock = false;\n this.inLink = false;\n this.atStart = true;\n\n this.toOffset = vfileLocation(file).toOffset;\n this.unescape = unescape(this, 'escape');\n this.decode = decode(this);\n}", "function r(e){e||(e={}),this._file=i.getArg(e,\"file\",null),this._sourceRoot=i.getArg(e,\"sourceRoot\",null),this._sources=new a,this._names=new a,this._mappings=[],this._sourcesContents=null}", "function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse();\n }\n\n return Parser(String(file), file); // eslint-disable-line new-cap\n }", "_parseMappings(aStr, aSourceRoot) {\n throw new Error('Subclasses must implement _parseMappings')\n }", "function parseFile(fileContents) {\n return fileContents.split('\\n').map(s => validate(s.trim()));\n}", "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "function readspacemetadata() {\n // Read the file and send to the callback\n fs.readFile(metadatapath, handleFile);\n}", "load(fname) {\n let s = fs.readFileSync(fname, \"utf8\");\n let memento = JSON.parse(s);\n this._results = memento.results;\n this._params = memento.params;\n this._combinations = memento.combinations;\n }", "parseSignatureFileBuffer(signatureFileBuffer) {\n const fileHashSize = 48; // number of bytes\n let index = 0;\n while (index < signatureFileBuffer.length) {\n const typeDelimiter = signatureFileBuffer[index++];\n\n switch (typeDelimiter) {\n case 4:\n // hash\n this.hash = signatureFileBuffer.subarray(index, index + fileHashSize);\n index += fileHashSize;\n break;\n case 3:\n // signature\n const signatureLength = signatureFileBuffer.readInt32BE(index);\n index += 4;\n this.signature = signatureFileBuffer.subarray(index, index + signatureLength);\n index += signatureLength;\n break;\n default:\n throw new Error(`Unexpected type delimiter '${typeDelimiter}' in signature file at index '${index - 1}'`);\n }\n }\n }", "function GeometryParser() {}", "function parseFileXML( xmlNode ) {\n\n\t\tgbjson = XML2jsobj( xmlNode );\n\t\t//console.log( 'gbjson', gbjson );\n\n\t\tparseGbJson( gbjson );\n\n\t\treturn gbjson;\n\n\t}", "function processInput() {\n\n\tvar boundaryInfo = getCourseBoundaries(fileContents);\n\tvar boundaries = boundaryInfo.boundaries;\n\tvar oneSection = RegExp( sectionChunk, 'gim' );\n\tvar j = 0;\n\tfor (var i = 0; i < boundaryInfo.boundaries.length ; ++i) {\n\t\tvar courseSection = fileContents.substring(boundaries[i], boundaries[i+1]);\n\t\twhile(true) {\n\t\t\tvar result = oneSection.exec(courseSection);\n\t\t\tif (!result) break;\n\t\t\tvar sectionInfo = { \n\t\t\t\ttimes : result[4].trim().split('\\n'),\n\t\t\t\trooms : result[5].trim().split('\\n'),\n\t\t\t\tinstructors : result[6].trim().split('\\n'),\n\t\t\t\tdates\t\t\t\t: result[7].trim().split('\\n'),\n\t\t\t};\n\t\t\tsections[j] = {\n\t\t\t\tname : boundaryInfo.courses[i].name,\n\t\t\t\tdisc : boundaryInfo.courses[i].disc,\n\t\t\t\tnum : boundaryInfo.courses[i].num,\n\t\t\t\tCFID : result[1],\n\t\t\t\tsectionName : result[2],\n\t\t\t\tsectionType : result[3],\n\t\t\t\tisFull : ( result[8].trim()[0] === 'O' ? false : true ), // Is it open? TODO: Make case insensitive.\n\t\t\t\tdays : getSessions( sectionInfo ),\n\t\t\t};\n\t\t\t++j;\n\t\t}\n\t\toneSection.lastIndex = 0;\n\t}\n\tconsole.log( JSON.stringify(sections, null, 1) ); // DEBUG\n}", "function parseGCTFile(fileContents)\n {\n var data = {\n sampleNames: [],\n rowNames: [],\n rowDescriptions: [],\n matrix: [[]]\n };\n var lines = fileContents.split(/\\r\\n|\\r|\\n/); //fileContents.split(/\\r|\\n/);\n\n if(lines.length >= 4 && lines[0].indexOf(\"#1.2\") != -1)\n {\n //The samples\n var sampleLines = lines[2];\n var samples = sampleLines.split(/\\t/);\n samples.splice(0, 2);\n data.sampleNames = samples;\n\n //the data starts on line 4 for a gct file\n for(var r=3;r<lines.length;r++)\n {\n var rowData = lines[r].split(/\\t/);\n data.rowNames.push(rowData[0]);\n data.rowDescriptions.push(rowData[1]);\n data.matrix[r-3] = rowData.slice(2).map(Number);\n }\n }\n else\n {\n throw new Error(\"Error parsing data: Unexpected number of lines \" + lines.length + \".\");\n }\n\n return data;\n }", "function TextParser() {}", "function TextParser() {}", "function n(e){e||(e={}),this._file=o.getArg(e,\"file\",null),this._sourceRoot=o.getArg(e,\"sourceRoot\",null),this._sources=new i,this._names=new i,this._mappings=[],this._sourcesContents=null}", "function parseTag (context, fname, ctype, valtype, pathfrags, fileScope, defaultScope, docstr, next) {\n if (docstr instanceof Array) {\n for (var i=0,j=Math.max (1, docstr.length); i<j; i++) {\n var workingDocstr = docstr[i] || '';\n workingDocstr = workingDocstr.match (/^[\\r\\n]*([^]*)[\\r\\n]*$/)[1];\n parseTag (\n context,\n fname,\n ctype,\n valtype,\n pathfrags,\n fileScope,\n defaultScope,\n workingDocstr,\n next\n );\n }\n return;\n }\n var tagScope;\n if (fileScope.length)\n tagScope = fileScope.concat (pathfrags);\n // tagScope = concatPaths (fileScope, pathfrags);\n else if (defaultScope.length && (ctype != 'module' || !pathfrags.length))\n tagScope = defaultScope.concat (pathfrags);\n // tagScope = concatPaths (defaultScope, pathfrags);\n else\n tagScope = pathfrags.concat();\n // tagScope = concatPaths (pathfrags);\n\n if (ctype == 'module')\n fileScope.push.apply (fileScope, pathfrags);\n else if (ctype == 'submodule')\n ctype = 'module';\n // convert @constuctor to @spare\n else if (ctype == 'constructor') {\n ctype = 'spare';\n pathfrags.push ([ '~', 'constructor' ]);\n }\n\n // consume modifiers\n var modifiers = [];\n docstr = consumeModifiers (fname, fileScope, tagScope, next, docstr, modifiers);\n\n // begin searching for inner tags\n var innerMatch = docstr ? docstr.match (Patterns.innerTag) : undefined;\n if (!innerMatch) {\n // the entire comment is one component\n try {\n lastComponent = context.submit (\n tagScope.length ? tagScope : fileScope,\n {\n ctype: ctype,\n valtype: valtype,\n // doc: { value:docstr, context:cloneArr(fileScope) },\n doc: { value:docstr, context:fileScope.concat() },\n modifiers: modifiers\n }\n );\n context.logger.trace ({\n type: ctype,\n file: fname,\n path: tagScope.map (function(a){ return a[0]+a[1]; }).join('')\n }, 'read declaration');\n return;\n } catch (err) {\n context.logger.error (err, 'parsing error');\n return;\n }\n }\n\n var argscope = tagScope.concat();\n var inpathstr = innerMatch[3];\n var inpathfrags = [];\n var insigargs;\n var pathMatch;\n var linkScope = fileScope.concat();\n var lastComponent;\n do {\n if (\n ctype == 'callback'\n || ctype == 'argument'\n || ctype == 'kwarg'\n || ctype == 'args'\n || ctype == 'kwargs'\n || ctype == 'returns'\n || ctype == 'signature'\n )\n submissionPath = argscope.concat (inpathfrags);\n // submissionPath = concatPaths (argscope, inpathfrags);\n else if (ctype != 'load')\n submissionPath = tagScope.concat (inpathfrags);\n // submissionPath = concatPaths (tagScope, inpathfrags);\n\n // any chance this is just a @load declaration?\n if (ctype == 'load') {\n var lookupPath =\n inpathfrags[0][1]\n || docstr.slice (0, innerMatch.index).replace (/^\\s*/, '').replace (/\\s*$/, '')\n ;\n var filename = pathLib.resolve (pathLib.dirname (fname), lookupPath);\n var loadedDoc;\n if (Object.hasOwnProperty.call (loadedDocuments, filename))\n loadedDoc = loadedDocuments[filename];\n else try {\n context.latency.log ('parsing');\n loadedDoc = fs.readFileSync (filename).toString();\n context.latency.log ('file system');\n } catch (err) {\n context.logger.warn (\n { filename:filename },\n '@load Declaration failed'\n );\n }\n if (loadedDoc)\n context.submit (\n submissionPath,\n { doc: { value:loadedDoc } }\n );\n } else\n // submit the previous match\n try {\n var inlineDocStr = docstr.slice (0, innerMatch.index);\n if (inlineDocStr.match (/^[\\s\\n]*$/))\n inlineDocStr = '';\n if (\n ctype != 'returns'\n || valtype.length\n || inlineDocStr\n || modifiers.length\n || insigargs\n || submissionPath[submissionPath.length-1][1]\n )\n lastComponent = context.submit (\n submissionPath,\n {\n ctype: ctype,\n valtype: valtype,\n doc: { value:inlineDocStr, context:linkScope },\n modifiers: modifiers,\n sigargs: insigargs\n }\n );\n context.logger.trace ({\n type: ctype,\n file: fname,\n path: submissionPath.map (function(a){ return a[0]+a[1]; }).join('')\n }, 'read declaration');\n } catch (err) {\n context.logger.error (err, 'parsing error');\n return;\n }\n\n // prepare the next submission\n if (ctype == 'returns') {\n if (!inpathstr && argscope.length > tagScope.length)\n argscope.pop();\n } else if (ctype == 'callback')\n argscope = argscope.concat (inpathfrags);\n // argscope = concatPaths (argscope, inpathfrags);\n else if (\n ctype != 'argument'\n && ctype != 'kwarg'\n && ctype != 'args'\n && ctype != 'kwargs'\n && ctype != 'returns'\n && ctype != 'signature'\n )\n argscope = tagScope.concat (inpathfrags);\n // argscope = concatPaths (cloneArr (tagScope), inpathfrags);\n\n linkScope = fileScope.concat();\n // linkScope = cloneArr (fileScope);\n modifiers = [];\n ctype = innerMatch[1];\n valtype = innerMatch[2];\n inpathstr = innerMatch[3];\n docstr = innerMatch[4];\n\n if (ctype == 'signature') {\n insigargs = [];\n var sigargSplit = inpathstr.slice(1).slice(0, -1).split (Patterns.signatureArgument);\n inpathstr = '';\n for (var i=1,j=sigargSplit.length; i<j; i+=3) {\n var sigvaltype = parseType (sigargSplit[i], fileScope.length ? fileScope : defaultScope);\n var sigvalname = parsePath (sigargSplit[i+1], fileScope);\n if (sigvalname && !sigvalname[0][0])\n sigvalname[0][0] = '(';\n var sigargargpath = tagScope.concat (sigvalname);\n // var sigargargpath = concatPaths (cloneArr (tagScope), sigvalname);\n var sigvalnameStr;\n if (sigvalname && sigvalname.length)\n sigvalnameStr = sigvalname.slice(-1)[0][1];\n insigargs.push ({\n name: sigvalnameStr,\n valtype: sigvaltype,\n path: sigargargpath\n });\n }\n inpathfrags = [ [ ] ];\n } else\n inpathfrags = parsePath (inpathstr, fileScope);\n\n if (inpathfrags[0] && !inpathfrags[0][0])\n if (inpathfrags.length == 1)\n inpathfrags[0][0] = Patterns.delimitersInverse[ctype] || '.';\n else\n inpathfrags[0][0] = '.';\n\n // direct-to-type syntax\n if (!Patterns.innerCtypes.hasOwnProperty (ctype)) {\n valtype = ctype;\n ctype = Patterns.delimiters[inpathfrags[inpathfrags.length-1][0]];\n }\n\n // convert @constuctor to @spare\n if (ctype == 'constructor') {\n ctype = 'spare';\n inpathfrags[inpathfrags.length-1][0] = '~';\n inpathfrags[inpathfrags.length-1][1] = 'constructor';\n }\n\n valtype = parseType (valtype, fileScope.length ? fileScope : defaultScope);\n\n // consume modifiers\n docstr = consumeModifiers (fname, fileScope, tagScope, next, docstr, modifiers);\n\n // some tags affect the scope\n if (ctype == 'module') {\n fileScope.push.apply (fileScope, inpathfrags);\n // tagScope.push.apply (tagScope, inpathfrags);\n }\n if (ctype == 'submodule')\n ctype = 'module';\n\n } while (docstr && (innerMatch = docstr.match (Patterns.innerTag)));\n\n // submit the final match from this tag\n var submissionPath;\n if (\n ctype == 'callback'\n || ctype == 'argument'\n || ctype == 'kwarg'\n || ctype == 'args'\n || ctype == 'kwargs'\n || ctype == 'returns'\n || ctype == 'signature'\n )\n submissionPath = argscope.concat (inpathfrags);\n // submissionPath = concatPaths (argscope, inpathfrags);\n else if (ctype != 'load')\n submissionPath = tagScope.concat (inpathfrags);\n // submissionPath = concatPaths (cloneArr (tagScope), inpathfrags);\n\n // consume modifiers\n docstr = consumeModifiers (fname, fileScope, tagScope, next, docstr, modifiers);\n\n // any chance this is just a @load declaration?\n if (ctype == 'load') {\n var lookupPath =\n inpathfrags[0][1]\n || docstr.replace (/^\\s*/, '').replace (/\\s*$/, '')\n ;\n var filename = pathLib.resolve (pathLib.dirname (fname), lookupPath);\n var loadedDoc;\n if (Object.hasOwnProperty.call (loadedDocuments, filename))\n loadedDoc = loadedDocuments[filename];\n else try {\n context.latency.log ('parsing');\n loadedDoc = fs.readFileSync (filename).toString();\n context.latency.log ('file system');\n } catch (err) {\n context.logger.warn (\n { filename:filename },\n '@load Declaration failed'\n );\n }\n if (loadedDoc)\n lastComponent = context.submit (\n submissionPath,\n { doc: { value:loadedDoc } }\n );\n } else {\n if (\n ctype != 'returns'\n || valtype.length\n || inlineDocStr\n || modifiers.length\n || insigargs\n || submissionPath[submissionPath.length-1][1]\n )\n try {\n lastComponent = context.submit (\n submissionPath,\n {\n ctype: ctype,\n valtype: valtype,\n doc: { value:docstr, context:linkScope },\n modifiers: modifiers,\n sigargs: insigargs\n }\n );\n context.logger.trace ({\n type: ctype,\n file: fname,\n path: submissionPath.map (function(a){ return a[0]+a[1]; }).join('')\n }, 'read declaration');\n } catch (err) {\n context.logger.error (err, 'parsing error');\n return;\n }\n }\n}", "function parseTopLevel() {\n parseBlockBody(TokenType.eof);\n state.scopes.push(new Scope(0, state.tokens.length, true));\n if (state.scopeDepth !== 0) {\n throw new Error(`Invalid scope depth at end of file: ${state.scopeDepth}`);\n }\n return new File(state.tokens, state.scopes);\n}", "doParse(content: string): any {\n let lines = this.getLines(content);\n return this.parseContent(lines);\n }", "function readFile (evt) {\r\n var files = evt.target.files;\r\n var file = files[0]; \r\n Papa.parse(file, {\r\n \tcomplete: function(results) {\r\n \t\tlog(results);\r\n \t}\r\n }, config);\r\n }", "function parse(file: string): ParserReturn {\n if (file.match(/\\.tsx?$/)) {\n return TypeScriptParser.parse(file);\n } else {\n return babylonParser(file);\n }\n}", "@memoize\n get parser() {\n return new TaskList({\n name: `Parsing ${this.type}: ${this.projectName}`,\n tasks: [\n new Task({\n name: `Loading ${this.type}`,\n run: (parentScope) => {\n this.resetCompiled()\n const scope = this.getScope(parentScope)\n this.setState(\"scope\", scope)\n return this.load()\n }\n }),\n TaskList.forEach({\n name: `Parsing imports`,\n list: () => this.activeImports,\n getTask: (file) =>\n new Task({\n name: `Parsing import: ${file.file}`,\n run: () => file.parse(this.scope)\n })\n })\n ]\n })\n }", "parse() {\n while (this.shouldContinue()) {\n const c = this.buffer.charCodeAt(this.index - this.offset);\n switch (this.state) {\n case Tokenizer_State.Text: {\n this.stateText(c);\n break;\n }\n case Tokenizer_State.SpecialStartSequence: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case Tokenizer_State.InSpecialTag: {\n this.stateInSpecialTag(c);\n break;\n }\n case Tokenizer_State.CDATASequence: {\n this.stateCDATASequence(c);\n break;\n }\n case Tokenizer_State.InAttributeValueDq: {\n this.stateInAttributeValueDoubleQuotes(c);\n break;\n }\n case Tokenizer_State.InAttributeName: {\n this.stateInAttributeName(c);\n break;\n }\n case Tokenizer_State.InCommentLike: {\n this.stateInCommentLike(c);\n break;\n }\n case Tokenizer_State.InSpecialComment: {\n this.stateInSpecialComment(c);\n break;\n }\n case Tokenizer_State.BeforeAttributeName: {\n this.stateBeforeAttributeName(c);\n break;\n }\n case Tokenizer_State.InTagName: {\n this.stateInTagName(c);\n break;\n }\n case Tokenizer_State.InClosingTagName: {\n this.stateInClosingTagName(c);\n break;\n }\n case Tokenizer_State.BeforeTagName: {\n this.stateBeforeTagName(c);\n break;\n }\n case Tokenizer_State.AfterAttributeName: {\n this.stateAfterAttributeName(c);\n break;\n }\n case Tokenizer_State.InAttributeValueSq: {\n this.stateInAttributeValueSingleQuotes(c);\n break;\n }\n case Tokenizer_State.BeforeAttributeValue: {\n this.stateBeforeAttributeValue(c);\n break;\n }\n case Tokenizer_State.BeforeClosingTagName: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case Tokenizer_State.AfterClosingTagName: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case Tokenizer_State.BeforeSpecialS: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case Tokenizer_State.InAttributeValueNq: {\n this.stateInAttributeValueNoQuotes(c);\n break;\n }\n case Tokenizer_State.InSelfClosingTag: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case Tokenizer_State.InDeclaration: {\n this.stateInDeclaration(c);\n break;\n }\n case Tokenizer_State.BeforeDeclaration: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case Tokenizer_State.BeforeComment: {\n this.stateBeforeComment(c);\n break;\n }\n case Tokenizer_State.InProcessingInstruction: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case Tokenizer_State.InNamedEntity: {\n this.stateInNamedEntity(c);\n break;\n }\n case Tokenizer_State.BeforeEntity: {\n this.stateBeforeEntity(c);\n break;\n }\n case Tokenizer_State.InHexEntity: {\n this.stateInHexEntity(c);\n break;\n }\n case Tokenizer_State.InNumericEntity: {\n this.stateInNumericEntity(c);\n break;\n }\n default: {\n // `this._state === State.BeforeNumericEntity`\n this.stateBeforeNumericEntity(c);\n }\n }\n this.index++;\n }\n this.cleanup();\n }", "function LevelParser(filename) {\n //Engine.Object.call(this);\n this.filename = filename;\n }", "function parseWithLocation(content, filename, locationKeyName) {\r\n return _parse(content, filename, locationKeyName);\r\n}", "function parseFile(fileToParse){\n var fs = require('fs');\n var decodedFile = {};\n\n var toDecode = fs.readFileSync(fileToParse);\n\n // pass the byte array into _parse for decoding\n decodedFile = _parse(toDecode).result;\n\n return decodedFile;\n}", "function reqListener() {\n console.log('File loaded: ' + sourceLocation);\n cm.setValue(this.responseText);\n engineStartup();\n }", "load() {\n this.completed = false;\n this.rendered = false;\n\n // Resets variables on load\n this.raw = [];\n this.header = [];\n this.selected = [];\n if (this.chart instanceof Chart) this.chart.destroy();\n\n let readRange = {};\n if (this.fileReadRange != null) readRange = this.getNumColsFromA1(this.fileReadRange);\n console.log(`Will read ${ readRange.numCols > 0 ? 'first ' + readRange.numCols : 'all'} columns and ${ readRange.numRows > 0 ? 'first ' + readRange.numRows : 'all'} rows.`);\n this.fileReadRange = readRange.col + (readRange.numRows > 0 ? readRange.numRows : '');\n \n const selectedFile = document.getElementById('myfile').files[0];\n console.log(selectedFile.name);\n this.fileName = selectedFile.name;\n Papa.parse(selectedFile, {\n skipEmptyLines: true,\n preview: readRange.numRows > 0 ? readRange.numRows : 0,\n complete: (results) => {\n console.log('Finished:', results.data);\n this.raw = results.data;\n this.limitColumns(readRange.numCols > 0 ? readRange.numCols : 0);\n this.header = Array.from(this.raw[0]); // problem: duplicated / null headers\n this.header.shift();\n this.refreshPreview();\n this.completed = true;\n console.log(this.completed);\n }\n });\n }", "function parseData(e) {\r\n const file = e.target.files[0];\r\n\r\n Papa.parse(file, {\r\n dynamicTyping: true,\r\n complete: function(results) {\r\n $('header').hide();\r\n $('main').prepend(`<h1 class=\"tableTitle\">Christopher Duerkes</h1>`);\r\n createTable(results.data);\r\n addEventListeners();\r\n }\r\n });\r\n}", "function FontParserSVG(rawData) {\n\t this.rawData = rawData;\n\t this._domParser = new DOMParser();\n\t this._document = this._domParser.parseFromString(rawData, 'application/xml');\n\t this._parseFontProperties();\n\t this._parseFontKerning();\n\t }", "function parseRawGeometry(asset, cfg, geometryId, ok) {\n /*\n Geometry format\n\n bytes : info\n [0.. 3]: uint32; file type identifer (= 0x11)\n [4.. 7]: uint32; byte-length of padded asset id\n [8..11]: uint32; byte-length of padded morph keys JSON\n [12..15]: uint32; byte-length of positions array\n [16..19]: uint32; byte-length of normals array\n [20..23]: uint32; byte-length of indices array\n [24..27]: uint32; byte-length of uv array\n [28..43]: unit32[4]; unused, reserved for future use\n [ .. ]: text; asset id (tail-padded with empty spaces, e.g. 0x20)\n [ .. ]: text; morph key JSON (tail-padded with 0x20)\n [ .. ]: float32[]; positions array\n [ .. ]: float32[]; normals array\n [ .. ]: int32[]; indices array\n [ .. ]: float32[]; uv array\n */\n\n var index = new Uint32Array(asset, 0, 11);\n\n var assetIdSize = index[1];\n var keysSize = index[2];\n var positionsSize = index[3];\n var normalsSize = index[4];\n var indicesSize = index[5];\n var uvsSize = index[6];\n // var unused = index[7 ... 10];\n\n var assetIdStart = 11 * Uint32Array.BYTES_PER_ELEMENT;\n var keysStart = assetIdStart + assetIdSize;\n var positionsStart = keysStart + keysSize;\n var normalsStart = positionsStart + positionsSize;\n var indicesStart = normalsStart + normalsSize;\n var uvsStart = indicesStart + indicesSize;\n\n var numVertices = 0;\n\n if (positionsSize > 0) {\n cfg.geometry.positions = new Float32Array(asset, positionsStart, positionsSize / Float32Array.BYTES_PER_ELEMENT);\n cfg.boundary = getBoundary(cfg.geometry.positions);\n numVertices = cfg.geometry.positions.length / 3;\n }\n\n if (normalsSize > 0) {\n cfg.geometry.normals = new Float32Array(asset, normalsStart, normalsSize / Float32Array.BYTES_PER_ELEMENT);\n }\n\n if (uvsSize > 0) {\n cfg.geometry.uv = new Float32Array(asset, uvsStart, uvsSize / Float32Array.BYTES_PER_ELEMENT);\n }\n\n if (indicesSize > 0) {\n cfg.geometry.indices = new Uint32Array(asset, indicesStart, indicesSize / Uint32Array.BYTES_PER_ELEMENT);\n if (numVertices <= 256) {\n cfg.geometry.indices = new Uint8Array(cfg.geometry.indices);\n } else if (numVertices <= 65536) {\n cfg.geometry.indices = new Uint16Array(cfg.geometry.indices);\n }\n }\n\n ok(HumanAssetsGeometries.createGeometry(geometryId, cfg));\n }", "parse() {\n return this.parseSection (this.pos);\n}", "function _readFile(evt) {\n //Retrieve the uploaded File\n const file = evt.target.files[0],\n fileReader = new FileReader();\n\n //callback once file loaded, the loaded file is in text format\n fileReader.onload = function(content) {\n\n // Step 1: convert the textfile to obtain HTML DOM object to access the info section\n let toHTMLDOM = convertToHTMLDOM(content);\n\n // Step 2: create a map for the bio obtained via DOM acceess\n fetchVCardData(toHTMLDOM);\n\n // branch to reset the page, when a second file is uploaded\n if (properties.container.childNodes.length > 0) {\n resetPage();\n }\n\n //Step 3: create the network\n createNetwork();\n }\n fileReader.readAsText(file);\n }", "function TextParser() { }", "async load (filePath) {\n console.log(`Deserializing from ${filePath}`)\n this.data = this.formatStrategy.deserialize(\n await fs.readFile(filePath, 'utf-8')\n )\n }", "*_parseLines(lines) {\n const reTag = /^:([0-9]{2}|NS)([A-Z])?:/;\n let tag = null;\n\n for (let i of lines) {\n\n // Detect new tag start\n const match = i.match(reTag);\n if (match || i.startsWith('-}') || i.startsWith('{')) {\n if (tag) {yield tag;} // Yield previous\n tag = match // Start new tag\n ? {\n id: match[1],\n subId: match[2] || '',\n data: [i.substr(match[0].length)]\n }\n : {\n id: 'MB',\n subId: '',\n data: [i.trim()],\n };\n } else { // Add a line to previous tag\n tag.data.push(i);\n }\n }\n\n if (tag) { yield tag; } // Yield last\n }" ]
[ "0.5563986", "0.5403343", "0.5403343", "0.5403343", "0.5403343", "0.5403343", "0.5381377", "0.53696966", "0.5363159", "0.53530675", "0.52683973", "0.5242919", "0.5242448", "0.5168644", "0.5167792", "0.51590085", "0.5139131", "0.5129", "0.51248896", "0.5115655", "0.51112175", "0.50963926", "0.50873923", "0.5036708", "0.5025361", "0.50186795", "0.50097734", "0.49976736", "0.49898064", "0.49802685", "0.49797356", "0.49553964", "0.49517724", "0.49458444", "0.49245977", "0.4917773", "0.48912376", "0.48820284", "0.4808414", "0.480763", "0.48047376", "0.47881132", "0.47784", "0.47745612", "0.47745612", "0.47745612", "0.47745612", "0.47745612", "0.47593567", "0.47555965", "0.47555965", "0.47555965", "0.4753869", "0.4753869", "0.47509325", "0.47455084", "0.47449046", "0.47295973", "0.4725655", "0.47176003", "0.47130138", "0.46912563", "0.46907294", "0.46795756", "0.46795756", "0.46752128", "0.46605977", "0.46530864", "0.46418598", "0.4624005", "0.46176028", "0.4617504", "0.46100754", "0.46100754", "0.4607091", "0.45995617", "0.45880508", "0.4576964", "0.45759892", "0.4569162", "0.45639366", "0.45539284", "0.45528585", "0.45423582", "0.4540557", "0.45386854", "0.45310065", "0.4527188", "0.4523248", "0.45228824", "0.4522108", "0.45193166", "0.45169547", "0.45096782", "0.45068234" ]
0.46091342
79
Remove `position`s from `tree`.
function removePosition(node, force) { visit(node, force ? hard : soft) return node }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeNodes(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n hanging = false,\n voids = false,\n mode = 'lowest'\n } = options;\n var {\n at = editor.selection,\n match\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n match = Path.isPath(at) ? matchPath(editor, at) : n => Editor.isBlock(editor, n);\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n var depths = Editor.nodes(editor, {\n at,\n match,\n mode,\n voids\n });\n var pathRefs = Array.from(depths, (_ref4) => {\n var [, p] = _ref4;\n return Editor.pathRef(editor, p);\n });\n\n for (var pathRef of pathRefs) {\n var path = pathRef.unref();\n\n if (path) {\n var [node] = Editor.node(editor, path);\n editor.apply({\n type: 'remove_node',\n path,\n node\n });\n }\n }\n });\n }", "function removePosition(node, force) {\n visit(node, force ? hard : soft);\n return node;\n}", "removeNodes(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n hanging = false,\n voids = false,\n mode = 'lowest'\n } = options;\n var {\n at = editor.selection,\n match\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n match = Path.isPath(at) ? matchPath(editor, at) : n => Editor.isBlock(editor, n);\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n var depths = Editor.nodes(editor, {\n at,\n match,\n mode,\n voids\n });\n var pathRefs = Array.from(depths, _ref4 => {\n var [, p] = _ref4;\n return Editor.pathRef(editor, p);\n });\n\n for (var pathRef of pathRefs) {\n var path = pathRef.unref();\n\n if (path) {\n var [node] = Editor.node(editor, path);\n editor.apply({\n type: 'remove_node',\n path,\n node\n });\n }\n }\n });\n }", "remove(tree){\n let replaceWith;\n if(this.left && this.right){\n const next = this.right.getLeftmostChild();\n this.low = next.low;\n this.high = next.high;\n this.intervals = next.intervals;\n this.removeUpdateLimits();\n next.handleRemoval(tree); \n }else{\n this.handleRemoval(tree);\n }\n }", "function removePositions(positionArray) {\n while (positionArray.length!=1) {\n positionArray.pop();\n }\n}", "function removeTag(val) {\n\t// hiding all position boxes\n\tvar posBox = document.querySelectorAll('.position-box');\n\tposBox.forEach((box) => {\n\t\tbox.style.display = 'none';\n\t});\n\n\t// remove tag from filter box\n\tval.parentElement.style.display = 'none';\n\tremovedTagName = val.parentElement.textContent;\n\n\t// splice the specific array element that is removed from selectedTagNameList\n\tfor (var i = 0; i < selectedTagNameList.length; i++) {\n\t\tconsole.log(selectedTagNameList[i]);\n\t\tif (selectedTagNameList[i] === removedTagName) {\n\t\t\tconsole.log(selectedTagNameList[i]);\n\t\t\tselectedTagNameList.splice(i, 1);\n\t\t}\n\t}\n\n\t// filter array after removing array of object without removed tag name\n\tvar afterRemovedArray = [];\n\tarray.map((f) => {\n\t\tvar count = 0;\n\t\tfor (skill of f.skills) {\n\t\t\tfor (i = 0; i < selectedTagNameList.length; i++) {\n\t\t\t\tif (selectedTagNameList[i] === skill) {\n\t\t\t\t\tcount = count + 1;\n\t\t\t\t\tif (count === selectedTagNameList.length) {\n\t\t\t\t\t\tafterRemovedArray.push(f);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\trenderBoxes(afterRemovedArray);\n\t// console.log(afterRemovedArray);\n\n\t// unhighlight tags in position boxes that is removed\n\tif (selectedTagNameList.length > 0) {\n\t\tvar allskills = document.querySelectorAll('.skill');\n\t\tselectedTagNameList.forEach((selectedTagName) => {\n\t\t\tfor (var i = 0; i < allskills.length; i++) {\n\t\t\t\tif (allskills[i].textContent === selectedTagName) {\n\t\t\t\t\thighlightTagToggle(allskills[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\tif (selectedTagNameList.length === 0) {\n\t\trenderBoxes(array);\n\t}\n}", "function checkAndRemove(shellPosition) {\n for (index = 0; index < columns[shellPosition].length; index++) {\n var temp = parseFloat(columns[shellPosition][index].style.top);\n //console.log(\"temp = \" + temp);\n //console.log(targetTop);\n if (temp === targetTop + 9) {\n destroyTarget(targetTop + 9, shellPosition, index);\n //when splicing the next element will have the same positoin as shellPosition\n index--;\n } else if (temp === targetTop) {\n destroyTarget(targetTop, shellPosition, index);\n index--;\n } else if (temp === targetTop - 9) {\n destroyTarget(targetTop - 9, shellPosition, index);\n index--;\n //break;\n }\n }\n }", "popPosition(position) {\n\t\tthis.positionContainer.pop();\n\t}", "removerPosicao(posicao){}", "function dropNodes(tree) {\n var _match3;\n\n return match(tree, (_match3 = {}, _match3[NODE] = function (node) {\n return node.data;\n }, _match3[OBJECT] = function (obj) {\n return mapValues(obj, dropNodes);\n }, _match3[ARRAY] = function (ar) {\n return ar.map(dropNodes);\n }, _match3[NULL] = function () {\n return null;\n }, _match3));\n}", "function removePosition(value){\n //Find the container with the role in\n var p = document.getElementById(\"p\"+value);\n //Removing the parent element also removes children (select etc.)\n p.parentElement.removeChild(p);\n //Re-add the position to the select, now at the end\n var select = document.getElementById(\"position\");\n select.options[select.options.length] = new Option(value, value, false, false);\n}", "function slurpDirt() {\n let index = dirtLeft.findIndex(\n (e) => JSON.stringify(e) === JSON.stringify(position)\n );\n if (index !== -1) {\n dirtLeft.splice(index, 1);\n dirtCleared++;\n }\n }", "function _callRemovalHooks(position) {\n var _arr = removalHooks[position];\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var fn = _arr[_i];\n if (fn(this, this.parentPath)) return true;\n }\n}", "function _callRemovalHooks(position) {\n var _arr = removalHooks[position];\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var fn = _arr[_i];\n if (fn(this, this.parentPath)) return true;\n }\n}", "function remove() {\n var index = Math.floor(Math.random() * values.length);\n console.log(\"DEL \" + values[index]);\n tree.remove(values[index]);\n values.splice(index, 1);\n}", "remove() {\n multiReplaceStatement({\n parent: this.parent,\n node: this.fullNode,\n replacements: [],\n });\n }", "REMOVE(state, { level, index }) {\n state[level].splice(index, 1);\n }", "cleanGarbage() {\n const self = this;\n this.forEveryElement(DOWN_TO_TOP, LEFT_TO_RIGHT, (elm, left, top, right, bottom) => {\n \n if(elm.position.isValid()){\n const {line, column} = elm.position;\n elm.cleanTemporaryData();\n self.data[line][column] = elm;\n } else {\n throw new Error('Cannot clean invalid position');\n }\n \n });\n }", "function removeAt(array, position) {\n var value = array[position];\n for (var index = position; index < array.length; index++) {\n var content = array[index + 1];\n array[index] = content;\n }\n array.length--;\n return value;\n}", "function deleteLastPosition() {\r\n\t//delete the trace of the block in the matrix\r\n\tmatrix[lastY][lastX] = 0;\r\n\tvar parent = document.getElementsByClassName('coll-' + lastX)[lastY - 1];\r\n\tparent.removeChild(parent.children[0]);\r\n}", "function removeTrash(arr) {\n arr.map(item => {\n item.children ? removeTrash(item.children) : item.children = [];\n delete(item.id);\n delete(item.x);\n delete(item.y);\n delete(item.depth);\n delete(item.parent);\n delete(item._children);\n delete(item._collapsed);\n })\n}", "function translator_resetPosition(position)\n{\n position += this.offsetAdj;\n this.parser.resetPosition(position);\n}", "removeNodeMark(pos, mark) {\n if (!(mark instanceof Mark$1)) {\n let node = this.doc.nodeAt(pos);\n if (!node)\n throw new RangeError(\"No node at position \" + pos);\n mark = mark.isInSet(node.marks);\n if (!mark)\n return this;\n }\n this.step(new RemoveNodeMarkStep(pos, mark));\n return this;\n }", "function _pruneOrOrphan(p) {\n\n var out = [];\n\n function _one(el, left, top) {\n var orphanedPosition = null;\n if (!_isInsideParent(el, [left, top])) {\n var group = el._jsPlumbGroup;\n if (prune) {\n _jsPlumb.remove(el);\n } else {\n orphanedPosition = _orphan(el);\n }\n\n group.remove(el);\n }\n\n return orphanedPosition;\n }\n\n for (var i = 0; i < p.selection.length; i++) {\n out.push(_one(p.selection[i][0], p.selection[i][1].left, p.selection[i][1].top));\n }\n\n return out.length === 1 ? out[0] : out;\n\n }", "function removePositionClass(obj){\n\tobj.removeClass('top');\n\tobj.removeClass('bottom');\n\tobj.removeClass('center');\n\tobj.removeClass('left');\n\tobj.removeClass('right');\n}", "removeFrom(position){\n if(position <= 0 || position > this.size+1)\n return;\n else if(position == 1){\n this.head = this.head.next;\n }\n else if(position == this.size){\n var current = this.head;\n var lastPrevNode;\n while(current.next){\n lastPrevNode = current;\n current = current.next;\n }\n lastPrevNode.next = null;\n }\n else{\n var current = this.head;\n\n for(var i=1; i<position-1; i++){\n current = current.next;\n }\n current.next = current.next.next;\n }\n\n this.size--;\n }", "function _callRemovalHooks(position) {\n\t var _arr = removalHooks[position];\n\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var fn = _arr[_i];\n\t if (fn(this, this.parentPath)) return true;\n\t }\n\t}", "function _callRemovalHooks(position) {\n\t var _arr = removalHooks[position];\n\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var fn = _arr[_i];\n\t if (fn(this, this.parentPath)) return true;\n\t }\n\t}", "clearTree() {\n // ******* TODO: PART VII *******\n\n // You only need two lines of code for this! No loops! \n }", "function multiRemove () {\n\t\t this.inserted = false\n\t\t var self = this\n\t\t var shouldCallRemove = _.inDoc(this.node)\n\t\t self.callHook(destroyChild)\n\t\t _.removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n\t\t if (shouldCallRemove) {\n\t\t self.callHook(detach)\n\t\t }\n\t\t self.destroy()\n\t\t })\n\t\t}", "function multiRemove() {\n\t this.inserted = false;\n\t var self = this;\n\t var shouldCallRemove = inDoc(this.node);\n\t self.callHook(destroyChild);\n\t removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n\t if (shouldCallRemove) {\n\t self.callHook(detach);\n\t }\n\t self.destroy();\n\t });\n\t}", "function remover(pos){\n lista.splice(pos,1)//remove um elemento na posição pos\n renderLista();\n}", "function removeCat(position) {\n cells[position].classList.remove(catClass)\n }", "function multiRemove() {\n this.inserted = false;\n var self = this;\n var shouldCallRemove = inDoc(this.node);\n self.callHook(destroyChild);\n removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n if (shouldCallRemove) {\n self.callHook(detach);\n }\n self.destroy();\n });\n}", "function removeTreeMap() {\r\n d3.select(\"#the_treeMap\").remove();\r\n d3.select(\"#the_toolTip\").remove();\r\n}", "remove(value) {\n this.root = this.removeVisitor(this.root, value)\n }", "function removeLevel() {\n\t\tnoLevels--;\n\t\tenableDisableAddRemove();\n\n\t\td3.select(\".box.side div.panel:last-of-type\")\n\t\t\t.remove();\n\t\t\n\t\ttree.removeLevel();\n\t}", "set_position(ui, position) {\n ui.cell_width_constraints.get(this.position.x).delete(this);\n ui.cell_height_constraints.get(this.position.y).delete(this);\n this.position = position;\n }", "destroyBetween(start, end) {\n if (start == end)\n return;\n for (let i = start; i < end; i++)\n this.top.children[i].destroy();\n this.top.children.splice(start, end - start);\n this.changed = true;\n }", "function clearTree() {\n\n // ******* TODO: PART VII *******\n \n\n}", "remove(data){\n this.children = this.children.filter(node=>{\n return node.data!==data;\n })\n }", "handleRemoval(tree){\n // Get the one child node, if there is one.\n const child = this.left || this.right;\n // Handle the case where this node is the root\n if(!this.parent){\n tree.root = child;\n if(child){\n child.parent = null;\n child.color = Black;\n }\n // Delete a red node (which by implication has no children)\n }else if(this.color === Red){\n this.makeOrphan();\n // Delete a black node with a red child\n }else if(child && child.color === Red){\n this.intervals = child.intervals;\n this.low = child.low;\n this.high = child.high;\n this.minimumLow = child.minimumLow;\n this.maximumLow = child.maximumLow;\n this.minimumHigh = child.minimumHigh;\n this.maximumHigh = child.maximumHigh;\n this.left = child.left;\n this.right = child.right;\n // Delete a black node with a black child\n // Note: This case should not actually be reachable?\n }else if(child){\n this.swapWithChild(child);\n child.removalFix(tree);\n this.makeOrphan();\n // Delete a black node with no children\n }else{\n this.removalFix(tree);\n this.makeOrphan();\n }\n // Update interval information\n if(this.parent){\n this.parent.removeUpdateLimits();\n // Note: A reference implementation used this behavior instead.\n // This change did not cause issues during extensive testing.\n // Still, if bugs occur, it may be because of this change.\n // this.parent.immediateUpdateLimits();\n // if(this.parent.parent) this.parent.parent.removeUpdateLimits();\n }\n }", "deleteWorldCubeAt(position) {\n delete this.worldCubes[toKey(position)]\n const upAndFlatNeighbors = this.getUpAndFlatNeighborsFor(position)\n upAndFlatNeighbors.forEach(neighbor => {\n if (this.hasCubeAt(neighbor)) {\n this.respawnCube(this.flowCubes[toKey(neighbor)])\n }\n })\n }", "removeNode (value) {\n this.nodes.delete(value)\n this.nodes.forEach(node => {\n if (node.includes(value)) {\n let newNodes = node.filter(item => item !== value)\n while (node.length > 0) {\n node.pop()\n }\n newNodes.forEach(item => node.push(item))\n }\n })\n }", "function hideLocation() {\n positionArray.clear()\n}", "function multiRemove() {\n this.inserted = false;\n var self = this;\n var shouldCallRemove = inDoc(this.node);\n this.beforeRemove();\n removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n if (shouldCallRemove) {\n self.callHook(detach);\n }\n self.destroy();\n });\n }", "function multiRemove() {\n this.inserted = false;\n var self = this;\n var shouldCallRemove = inDoc(this.node);\n this.beforeRemove();\n removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n if (shouldCallRemove) {\n self.callHook(detach);\n }\n self.destroy();\n });\n }", "function multiRemove() {\n this.inserted = false;\n var self = this;\n var shouldCallRemove = inDoc(this.node);\n this.beforeRemove();\n removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n if (shouldCallRemove) {\n self.callHook(detach);\n }\n self.destroy();\n });\n }", "removeAll() {\n this.nodes.forEach(node => node.parentNode.removeChild(node));\n this.nodes = [];\n this.component.resolveElements();\n }", "remove(value) {\n if (this.root === null) {\n console.log(`Tree is empty.`);\n return;\n } else {\n let currentNode = this.root;\n let parentNode = null;\n while (currentNode) {\n if (value < currentNode.value) {\n parentNode = currentNode;\n currentNode = currentNode.left;\n } else if (value > currentNode.value) {\n parentNode = currentNode;\n currentNode = currentNode.right;\n } else if (currentNode.value === value) {\n \n //a. If the node being removed does not have a right child it can be removed directly:\n if (currentNode.right === null) {\n //If parentNode is still null, it means the node being deleted is the root and, as there is no right tree, replace it with its left node.\n if (parentNode === null) {\n this.root = currentNode.left;\n }\n else {\n //if the value being removed is at the left of its parent, update its parent left reference to point to the node's left child (it doesn't matter if there is a left child or if it is null).\n if (currentNode.value < parentNode.value) {\n parentNode.left = currentNode.left;\n }\n //if the value being removed is at the right of its parent, update its parent right reference to point to the node's left child (it doesn't matter if there is a left child or if it is null).\n else if (currentNode.value > parentNode.value) {\n parentNode.right = currentNode.left;\n }\n }\n return;\n } \n //b. If the node being removed has a right child which DOES NOT have a left child, it can also be removed directly, but remember to update the references.\n else if (currentNode.right.left === null) {\n //since in this case \"currentNode\" will be replaced by \"currentNode.right\", the reference to \"currentNode.left\" must be updated to \"currentNode.right.left\" (it doesn't matter if there is a \"currentNode.left\" or if it is null), which is available.\n currentNode.right.left = currentNode.left;\n //If parentNode is still null, it means the node being deleted is the root and, as there is no right tree, replace it with its left node.\n if (parentNode === null) {\n this.root = currentNode.left;\n }\n else {\n //if the value being removed is at the left of its parent, update its parent left reference to point to the node's right child (it doesn't matter if there is a left child or if it is null).\n if (currentNode.value < parentNode.value) {\n parentNode.left = currentNode.right;\n }\n //if the value being removed is at the right of its parent, update its parent right reference to point to the node's right child (it doesn't matter if there is a left child or if it is null).\n else if (currentNode.value > parentNode.value) {\n parentNode.right = currentNode.right;\n }\n }\n return;\n }\n //c. If the node to be removed has a right child which DOES have a left child, we have to find its leftmost node and use replace the node being removed with this node. The tricky part here is to update the references correctly.\n else {\n //In this case, we need to keep track of the \"currentNode.right\" leftmost node, which will be used to replace the value being removed. Initially, this leftmost node is equal to \"currentNode.right.left\".\n let leftmost = currentNode.right.left;\n\n //As we'll need to update the references which point to the node that will be used to replace the node being removed, we also need to keep track of its parent node, which initially will be equal to \"currentNode.right\".\n let leftmostParent = currentNode.right;\n\n //Traverse the \"currentNode.right\" left tree until we find the leftmost node.\n while (leftmost.left !== null) {\n leftmostParent = leftmost;\n leftmost = leftmost.left;\n }\n\n //As we use the leftmost node value to replace the node being removed (currentNode), we still need to keep track of its right reference \"leftmost.right\" (it doesn't matter if there is a right child or if it is null). Therefore, we update the parent node left reference \"leftmostParent.left\" which now is free since we used \"leftmost\" to replace \"currentNode\" to point to \"leftmost.right\" so nothing is left out.\n leftmostParent.left = leftmost.right;\n\n //Now we can update the \"leftmost\" references to point to the \"currentNode\" references.\n leftmost.right = currentNode.right;\n leftmost.left = currentNode.left;\n\n //If parentNode is still null, it means the node being deleted is the root and, as there is no right tree, replace it with its left node.\n if (parentNode === null) {\n this.root = leftmost;\n }\n else {\n //if the value being removed is at the left of its parent, update its parent left reference to point to the node's left child.\n if (currentNode.value < parentNode.value) {\n parentNode.left = leftmost;\n }\n //if the value being removed is at the right of its parent, update its parent right reference to point to the node's left child.\n else if (currentNode.value > parentNode.value) {\n parentNode.right = leftmost;\n }\n }\n return;\n }\n }\n }\n }\n return `${value} is not in the tree.`;\n }", "removeBody(){\n\t\tlet length = this.body.length;\n\t\tfor (let i=length; i > 0; i--){\n \tthis.body.x.pop();\n \tthis.body.y.pop();\n\n \tlet snakeBody = document.querySelector('.snake_body');\n \tsnakeBody.parentNode.removeChild(snakeBody); \n \t}\n \tthis.body.length = 0;\n\t}", "removeObject(pos, classes) {\n this.grid[pos].classList.remove(...classes);\n }", "function multiRemove() {\n\t this.inserted = false;\n\t var self = this;\n\t var shouldCallRemove = inDoc(this.node);\n\t this.beforeRemove();\n\t removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n\t if (shouldCallRemove) {\n\t self.callHook(detach);\n\t }\n\t self.destroy();\n\t });\n\t}", "function multiRemove() {\n\t this.inserted = false;\n\t var self = this;\n\t var shouldCallRemove = inDoc(this.node);\n\t this.beforeRemove();\n\t removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n\t if (shouldCallRemove) {\n\t self.callHook(detach);\n\t }\n\t self.destroy();\n\t });\n\t}", "function multiRemove() {\n\t this.inserted = false;\n\t var self = this;\n\t var shouldCallRemove = inDoc(this.node);\n\t this.beforeRemove();\n\t removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n\t if (shouldCallRemove) {\n\t self.callHook(detach);\n\t }\n\t self.destroy();\n\t });\n\t}", "function multiRemove() {\n\t this.inserted = false;\n\t var self = this;\n\t var shouldCallRemove = inDoc(this.node);\n\t this.beforeRemove();\n\t removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n\t if (shouldCallRemove) {\n\t self.callHook(detach);\n\t }\n\t self.destroy();\n\t });\n\t}", "function multiRemove() {\n\t this.inserted = false;\n\t var self = this;\n\t var shouldCallRemove = inDoc(this.node);\n\t this.beforeRemove();\n\t removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n\t if (shouldCallRemove) {\n\t self.callHook(detach);\n\t }\n\t self.destroy();\n\t });\n\t}", "function multiRemove() {\n\t this.inserted = false;\n\t var self = this;\n\t var shouldCallRemove = inDoc(this.node);\n\t this.beforeRemove();\n\t removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n\t if (shouldCallRemove) {\n\t self.callHook(detach);\n\t }\n\t self.destroy();\n\t });\n\t}", "cleanMovePossible(){\n for(let i = this.placementsPossibles.length - 1; i >= 0; i--){\n if(i < this.placementsPossibles.length){\n let td = this.placementsPossibles[i]; \n let x = parseInt(td.id.charAt(4));\n let y = parseInt(td.id.charAt(5));\n let j = getPion(x,y);\n if(j != undefined){\n if(pions[j].color == this.color){\n this.placementsPossibles.splice(i, 1);\n }\n }\n }\n }\n }", "wipe() {\n\t\tfor (node of this.nodes) {\n\t\t\tfor (let box of node.boxes) {\n\t\t\t\tbox.destruct()\n\t\t\t}\n\t\t}\n\t\tthis.nodes = new Set()\n\t}", "function multiRemove() {\n this.inserted = false;\n var self = this;\n var shouldCallRemove = inDoc(this.node);\n this.beforeRemove();\n removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n if (shouldCallRemove) {\n self.callHook(detach);\n }\n self.destroy();\n });\n}", "function multiRemove() {\n this.inserted = false;\n var self = this;\n var shouldCallRemove = inDoc(this.node);\n this.beforeRemove();\n removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n if (shouldCallRemove) {\n self.callHook(detach);\n }\n self.destroy();\n });\n}", "function multiRemove() {\n this.inserted = false;\n var self = this;\n var shouldCallRemove = inDoc(this.node);\n this.beforeRemove();\n removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n if (shouldCallRemove) {\n self.callHook(detach);\n }\n self.destroy();\n });\n}", "function multiRemove() {\n this.inserted = false;\n var self = this;\n var shouldCallRemove = inDoc(this.node);\n this.beforeRemove();\n removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n if (shouldCallRemove) {\n self.callHook(detach);\n }\n self.destroy();\n });\n}", "function multiRemove() {\n this.inserted = false;\n var self = this;\n var shouldCallRemove = inDoc(this.node);\n this.beforeRemove();\n removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n if (shouldCallRemove) {\n self.callHook(detach);\n }\n self.destroy();\n });\n}", "function multiRemove() {\n this.inserted = false;\n var self = this;\n var shouldCallRemove = inDoc(this.node);\n this.beforeRemove();\n removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n if (shouldCallRemove) {\n self.callHook(detach);\n }\n self.destroy();\n });\n}", "function removeDistantNodes(){\n\t\t\tvar preload = grid.preload,\n\t\t\t\ttrashBin = put(\"div\");\n\t\t\twhile (preload.previous){\n\t\t\t\tpreload = preload.previous;\n\t\t\t}\n\t\t\twhile (preload){\n\t\t\t\t// This code will not remove blocks of rows that are not adjacent to a preload node,\n\t\t\t\t// however currently the only situation this happens is when they are between two loading nodes.\n\t\t\t\t// In this case they will be removed on the first scroll after one of the loading nodes' queries\n\t\t\t\t// has been resolved.\n\t\t\t\tremovePreloadDistantNodes(preload, \"previousSibling\", trashBin);\n\t\t\t\tremovePreloadDistantNodes(preload, \"nextSibling\", trashBin);\n\t\t\t\tpreload = preload.next;\n\t\t\t}\n\t\t\tsetTimeout(function(){\n\t\t\t\t// we can defer the destruction until later\n\t\t\t\tput(trashBin, \"!\");\n\t\t\t},1);\n\t\t}", "remove(data){\n //because doesn't modifu original array, would re-assign\n this.children = this.children.filter(node => {\n //for every node in array, do a check\n // if return true, want to keep, false to remove\n // this is why we used (!==) falsey operator\n return node.data !== data;\n });\n }", "unwrapNodes(editor, options) {\n Editor.withoutNormalizing(editor, () => {\n var {\n mode = 'lowest',\n split = false,\n voids = false\n } = options;\n var {\n at = editor.selection,\n match\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n match = Path.isPath(at) ? matchPath(editor, at) : n => Editor.isBlock(editor, n);\n }\n\n if (Path.isPath(at)) {\n at = Editor.range(editor, at);\n }\n\n var rangeRef = Range.isRange(at) ? Editor.rangeRef(editor, at) : null;\n var matches = Editor.nodes(editor, {\n at,\n match,\n mode,\n voids\n });\n var pathRefs = Array.from(matches, (_ref5) => {\n var [, p] = _ref5;\n return Editor.pathRef(editor, p);\n });\n\n var _loop = function _loop(pathRef) {\n var path = pathRef.unref();\n var [node] = Editor.node(editor, path);\n var range = Editor.range(editor, path);\n\n if (split && rangeRef) {\n range = Range.intersection(rangeRef.current, range);\n }\n\n Transforms.liftNodes(editor, {\n at: range,\n match: n => node.children.includes(n),\n voids\n });\n };\n\n for (var pathRef of pathRefs) {\n _loop(pathRef);\n }\n\n if (rangeRef) {\n rangeRef.unref();\n }\n });\n }", "remove(value) {\n this.root = this.removeNode(thisroot, value);\n }", "function destroyTarget(targetTop, shellPosition, targetposition) {\n targetsDestroyed++;\n scoreElement.innerText = \"Score:\" + targetsDestroyed;\n // console.log(targetsDestroyed);\n //console.log(columns[shellPosition][targetposition]);\n container.removeChild(columns[shellPosition][targetposition]);\n //check if target is explosive\n if (columns[shellPosition][targetposition].classList.contains(\"explosiveTarget\")) {\n //console.log(\"explosiveTarget\");\n columns[shellPosition].splice(targetposition, 1);\n if (shellPosition > 0) {\n //Destroy Left if existed\n //console.log(\"Left exists\");\n checkAndRemove(shellPosition - 1);\n }\n if (shellPosition < 10) {\n //Destroy Right if existed\n // console.log(\"Right exists\");\n checkAndRemove(shellPosition + 1);\n }\n if (columns[shellPosition].length > 0) {\n //check the above target\n //targetposition now is index of next element in column after removing current element\n //check if the removed element wasn't the highest target(nearset to the top)(last element in column)\n //in other word check if there exist an element after it\n if (targetposition < columns[shellPosition].length) {\n\n //console.log(\"exists above\");\n\n if (parseFloat(columns[shellPosition][targetposition].style.top) === targetTop - 9) {\n // console.log(\"Entered\");\n\n destroyTarget(targetTop - 9, shellPosition, targetposition);\n }\n }\n }\n //checking again as the length might change from previous condition\n if (columns[shellPosition].length > 0) {\n //check the below target\n //targetposition-1 now is index of previous element in column after removing current element\n //check if the removed element was not the lowest target(farethest from the top)(first element in column)\n //in other word check if there exist an element before it\n if (targetposition > 0) {\n if (parseFloat(columns[shellPosition][targetposition - 1].style.top) === targetTop + 9) {\n destroyTarget(targetTop + 9, shellPosition, targetposition - 1);\n\n }\n }\n }\n } else {\n columns[shellPosition].splice(targetposition, 1);\n }\n\n\n // columns[shellPosition].splice(targetposition, 1);\n // removing the shell type \n function checkAndRemove(shellPosition) {\n for (index = 0; index < columns[shellPosition].length; index++) {\n var temp = parseFloat(columns[shellPosition][index].style.top);\n //console.log(\"temp = \" + temp);\n //console.log(targetTop);\n if (temp === targetTop + 9) {\n destroyTarget(targetTop + 9, shellPosition, index);\n //when splicing the next element will have the same positoin as shellPosition\n index--;\n } else if (temp === targetTop) {\n destroyTarget(targetTop, shellPosition, index);\n index--;\n } else if (temp === targetTop - 9) {\n destroyTarget(targetTop - 9, shellPosition, index);\n index--;\n //break;\n }\n }\n }\n }", "removeNodeAtPosition(position) {\n\n if (position > this.length || position < 1 || this.length === 0) {\n throw new RangeError(`Position ${position} is not available in LinkedList of length ${this.length}`);\n }\n\n const medianPosition = Math.floor(this.length / 2);\n let currentNode, previousNode, nextNode, nodeToDelete, deletedNode;\n\n if (position === 1) {\n nodeToDelete = this.head;\n this.head = nodeToDelete.next;\n deletedNode = nodeToDelete;\n nodeToDelete = null;\n return deletedNode;\n } else if (position === this.length) {\n nodeToDelete = this.tail;\n this.tail = nodeToDelete.prev;\n deletedNode = nodeToDelete;\n nodeToDelete = null;\n return deletedNode;\n }\n\n if (position >= medianPosition) {\n currentNode = this.tail;\n currentPosition = this.length;\n\n while (currentPosition > position) {\n currentNode = currentNode.prev;\n currentPosition--;\n }\n\n } else {\n currentNode = this.head;\n currentPosition = 1;\n\n while (currentPosition < position) {\n currentNode = currentNode.next;\n currentPosition++;\n }\n }\n\n previousNode = currentNode.previous;\n nodeToDelete = currentNode;\n nextNode = currentNode.next;\n\n previousNode.next = nextNode;\n nextNode.previous = previousNode;\n deletedNode = nodeToDelete;\n nodeToDelete = null;\n return deletedNode;\n\n }", "function unselect(position) {\n $suggestionBox.find(\"li:eq(\" + position + \")\").removeClass('selected');\n }", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n this.updateMatrixWorld();\n }", "function mutation_remove(node, parent, suppressObservers) {\n if (dom_1.dom.rangeList.size !== 0) {\n /**\n * 1. Let index be node’s index.\n */\n const index = TreeAlgorithm_1.tree_index(node);\n /**\n * 2. For each live range whose start node is an inclusive descendant of\n * node, set its start to (parent, index).\n * 3. For each live range whose end node is an inclusive descendant of\n * node, set its end to (parent, index).\n */\n for (const range of dom_1.dom.rangeList) {\n if (TreeAlgorithm_1.tree_isDescendantOf(node, range._start[0], true)) {\n range._start = [parent, index];\n }\n if (TreeAlgorithm_1.tree_isDescendantOf(node, range._end[0], true)) {\n range._end = [parent, index];\n }\n if (range._start[0] === parent && range._start[1] > index) {\n range._start[1]--;\n }\n if (range._end[0] === parent && range._end[1] > index) {\n range._end[1]--;\n }\n }\n /**\n * 4. For each live range whose start node is parent and start offset is\n * greater than index, decrease its start offset by 1.\n * 5. For each live range whose end node is parent and end offset is greater\n * than index, decrease its end offset by 1.\n */\n for (const range of dom_1.dom.rangeList) {\n if (range._start[0] === parent && range._start[1] > index) {\n range._start[1] -= 1;\n }\n if (range._end[0] === parent && range._end[1] > index) {\n range._end[1] -= 1;\n }\n }\n }\n /**\n * 6. For each NodeIterator object iterator whose root’s node document is\n * node’s node document, run the NodeIterator pre-removing steps given node\n * and iterator.\n */\n if (dom_1.dom.features.steps) {\n for (const iterator of NodeIteratorAlgorithm_1.nodeIterator_iteratorList()) {\n if (iterator._root._nodeDocument === node._nodeDocument) {\n DOMAlgorithm_1.dom_runNodeIteratorPreRemovingSteps(iterator, node);\n }\n }\n }\n /**\n * 7. Let oldPreviousSibling be node’s previous sibling.\n * 8. Let oldNextSibling be node’s next sibling.\n */\n const oldPreviousSibling = node._previousSibling;\n const oldNextSibling = node._nextSibling;\n // set document element node\n if (util_1.Guard.isDocumentNode(parent) && util_1.Guard.isElementNode(node)) {\n parent._documentElement = null;\n }\n /**\n * 9. Remove node from its parent’s children.\n */\n node._parent = null;\n parent._children.delete(node);\n // assign siblings and children for quick lookups\n const prev = node._previousSibling;\n const next = node._nextSibling;\n node._previousSibling = null;\n node._nextSibling = null;\n if (prev)\n prev._nextSibling = next;\n if (next)\n next._previousSibling = prev;\n if (!prev)\n parent._firstChild = next;\n if (!next)\n parent._lastChild = prev;\n /**\n * 10. If node is assigned, then run assign slotables for node’s assigned\n * slot.\n */\n if (dom_1.dom.features.slots) {\n if (util_1.Guard.isSlotable(node) && node._assignedSlot !== null && ShadowTreeAlgorithm_1.shadowTree_isAssigned(node)) {\n ShadowTreeAlgorithm_1.shadowTree_assignSlotables(node._assignedSlot);\n }\n }\n /**\n * 11. If parent’s root is a shadow root, and parent is a slot whose\n * assigned nodes is the empty list, then run signal a slot change for\n * parent.\n */\n if (dom_1.dom.features.slots) {\n if (util_1.Guard.isShadowRoot(TreeAlgorithm_1.tree_rootNode(parent)) &&\n util_1.Guard.isSlot(parent) && util_2.isEmpty(parent._assignedNodes)) {\n ShadowTreeAlgorithm_1.shadowTree_signalASlotChange(parent);\n }\n }\n /**\n * 12. If node has an inclusive descendant that is a slot, then:\n * 12.1. Run assign slotables for a tree with parent's root.\n * 12.2. Run assign slotables for a tree with node.\n */\n if (dom_1.dom.features.slots) {\n const descendant = TreeAlgorithm_1.tree_getFirstDescendantNode(node, true, false, (e) => util_1.Guard.isSlot(e));\n if (descendant !== null) {\n ShadowTreeAlgorithm_1.shadowTree_assignSlotablesForATree(TreeAlgorithm_1.tree_rootNode(parent));\n ShadowTreeAlgorithm_1.shadowTree_assignSlotablesForATree(node);\n }\n }\n /**\n * 13. Run the removing steps with node and parent.\n */\n if (dom_1.dom.features.steps) {\n DOMAlgorithm_1.dom_runRemovingSteps(node, parent);\n }\n /**\n * 14. If node is custom, then enqueue a custom element callback\n * reaction with node, callback name \"disconnectedCallback\",\n * and an empty argument list.\n */\n if (dom_1.dom.features.customElements) {\n if (util_1.Guard.isCustomElementNode(node)) {\n CustomElementAlgorithm_1.customElement_enqueueACustomElementCallbackReaction(node, \"disconnectedCallback\", []);\n }\n }\n /**\n * 15. For each shadow-including descendant descendant of node,\n * in shadow-including tree order, then:\n */\n let descendant = TreeAlgorithm_1.tree_getFirstDescendantNode(node, false, true);\n while (descendant !== null) {\n /**\n * 15.1. Run the removing steps with descendant.\n */\n if (dom_1.dom.features.steps) {\n DOMAlgorithm_1.dom_runRemovingSteps(descendant, node);\n }\n /**\n * 15.2. If descendant is custom, then enqueue a custom element\n * callback reaction with descendant, callback name\n * \"disconnectedCallback\", and an empty argument list.\n */\n if (dom_1.dom.features.customElements) {\n if (util_1.Guard.isCustomElementNode(descendant)) {\n CustomElementAlgorithm_1.customElement_enqueueACustomElementCallbackReaction(descendant, \"disconnectedCallback\", []);\n }\n }\n descendant = TreeAlgorithm_1.tree_getNextDescendantNode(node, descendant, false, true);\n }\n /**\n * 16. For each inclusive ancestor inclusiveAncestor of parent, and\n * then for each registered of inclusiveAncestor's registered\n * observer list, if registered's options's subtree is true,\n * then append a new transient registered observer whose\n * observer is registered's observer, options is registered's\n * options, and source is registered to node's registered\n * observer list.\n */\n if (dom_1.dom.features.mutationObservers) {\n let inclusiveAncestor = TreeAlgorithm_1.tree_getFirstAncestorNode(parent, true);\n while (inclusiveAncestor !== null) {\n for (const registered of inclusiveAncestor._registeredObserverList) {\n if (registered.options.subtree) {\n node._registeredObserverList.push({\n observer: registered.observer,\n options: registered.options,\n source: registered\n });\n }\n }\n inclusiveAncestor = TreeAlgorithm_1.tree_getNextAncestorNode(parent, inclusiveAncestor, true);\n }\n }\n /**\n * 17. If suppress observers flag is unset, then queue a tree mutation\n * record for parent with « », « node », oldPreviousSibling, and\n * oldNextSibling.\n */\n if (dom_1.dom.features.mutationObservers) {\n if (!suppressObservers) {\n MutationObserverAlgorithm_1.observer_queueTreeMutationRecord(parent, [], [node], oldPreviousSibling, oldNextSibling);\n }\n }\n /**\n * 18. If node is a Text node, then run the child text content change steps\n * for parent.\n */\n if (dom_1.dom.features.steps) {\n if (util_1.Guard.isTextNode(node)) {\n DOMAlgorithm_1.dom_runChildTextContentChangeSteps(parent);\n }\n }\n}", "delete(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n reverse = false,\n unit = 'character',\n distance = 1,\n voids = false\n } = options;\n var {\n at = editor.selection,\n hanging = false\n } = options;\n\n if (!at) {\n return;\n }\n\n if (Range.isRange(at) && Range.isCollapsed(at)) {\n at = at.anchor;\n }\n\n if (Point.isPoint(at)) {\n var furthestVoid = Editor.void(editor, {\n at,\n mode: 'highest'\n });\n\n if (!voids && furthestVoid) {\n var [, voidPath] = furthestVoid;\n at = voidPath;\n } else {\n var opts = {\n unit,\n distance\n };\n var target = reverse ? Editor.before(editor, at, opts) || Editor.start(editor, []) : Editor.after(editor, at, opts) || Editor.end(editor, []);\n at = {\n anchor: at,\n focus: target\n };\n hanging = true;\n }\n }\n\n if (Path.isPath(at)) {\n Transforms.removeNodes(editor, {\n at,\n voids\n });\n return;\n }\n\n if (Range.isCollapsed(at)) {\n return;\n }\n\n if (!hanging) {\n var [, _end] = Range.edges(at);\n var endOfDoc = Editor.end(editor, []);\n\n if (!Point.equals(_end, endOfDoc)) {\n at = Editor.unhangRange(editor, at, {\n voids\n });\n }\n }\n\n var [start, end] = Range.edges(at);\n var startBlock = Editor.above(editor, {\n match: n => Editor.isBlock(editor, n),\n at: start,\n voids\n });\n var endBlock = Editor.above(editor, {\n match: n => Editor.isBlock(editor, n),\n at: end,\n voids\n });\n var isAcrossBlocks = startBlock && endBlock && !Path.equals(startBlock[1], endBlock[1]);\n var isSingleText = Path.equals(start.path, end.path);\n var startVoid = voids ? null : Editor.void(editor, {\n at: start,\n mode: 'highest'\n });\n var endVoid = voids ? null : Editor.void(editor, {\n at: end,\n mode: 'highest'\n }); // If the start or end points are inside an inline void, nudge them out.\n\n if (startVoid) {\n var before = Editor.before(editor, start);\n\n if (before && startBlock && Path.isAncestor(startBlock[1], before.path)) {\n start = before;\n }\n }\n\n if (endVoid) {\n var after = Editor.after(editor, end);\n\n if (after && endBlock && Path.isAncestor(endBlock[1], after.path)) {\n end = after;\n }\n } // Get the highest nodes that are completely inside the range, as well as\n // the start and end nodes.\n\n\n var matches = [];\n var lastPath;\n\n for (var entry of Editor.nodes(editor, {\n at,\n voids\n })) {\n var [node, path] = entry;\n\n if (lastPath && Path.compare(path, lastPath) === 0) {\n continue;\n }\n\n if (!voids && Editor.isVoid(editor, node) || !Path.isCommon(path, start.path) && !Path.isCommon(path, end.path)) {\n matches.push(entry);\n lastPath = path;\n }\n }\n\n var pathRefs = Array.from(matches, _ref => {\n var [, p] = _ref;\n return Editor.pathRef(editor, p);\n });\n var startRef = Editor.pointRef(editor, start);\n var endRef = Editor.pointRef(editor, end);\n\n if (!isSingleText && !startVoid) {\n var _point = startRef.current;\n var [_node] = Editor.leaf(editor, _point);\n var {\n path: _path\n } = _point;\n var {\n offset\n } = start;\n\n var text = _node.text.slice(offset);\n\n if (text.length > 0) editor.apply({\n type: 'remove_text',\n path: _path,\n offset,\n text\n });\n }\n\n for (var pathRef of pathRefs) {\n var _path2 = pathRef.unref();\n\n Transforms.removeNodes(editor, {\n at: _path2,\n voids\n });\n }\n\n if (!endVoid) {\n var _point2 = endRef.current;\n var [_node2] = Editor.leaf(editor, _point2);\n var {\n path: _path3\n } = _point2;\n\n var _offset = isSingleText ? start.offset : 0;\n\n var _text = _node2.text.slice(_offset, end.offset);\n\n if (_text.length > 0) editor.apply({\n type: 'remove_text',\n path: _path3,\n offset: _offset,\n text: _text\n });\n }\n\n if (!isSingleText && isAcrossBlocks && endRef.current && startRef.current) {\n Transforms.mergeNodes(editor, {\n at: endRef.current,\n hanging: true,\n voids\n });\n }\n\n var point = reverse ? startRef.unref() || endRef.unref() : endRef.unref() || startRef.unref();\n\n if (options.at == null && point) {\n Transforms.select(editor, point);\n }\n });\n }", "function remove (x,y,z,before,after=before) {\n if (!before[z][y][x].active) return before;\n runningTotal--;\n after[z][y][x].active = false;\n for (let layer = Math.max(z-1, 0); layer <= Math.min(z+1, before.length-1); layer++) {\n for (let row = Math.max(y-1, 0); row <= Math.min(y+1, before[0].length-1); row++) {\n for (let col = Math.max(x-1, 0); col <= Math.min(x+1, before[0][0].length-1); col++) {\n if (layer == z && row == y && col == x) continue;\n after[layer][row][col].nearby--\n }\n }\n }\n return after;\n}", "delete(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n reverse = false,\n unit = 'character',\n distance = 1,\n voids = false\n } = options;\n var {\n at = editor.selection,\n hanging = false\n } = options;\n\n if (!at) {\n return;\n }\n\n if (Range.isRange(at) && Range.isCollapsed(at)) {\n at = at.anchor;\n }\n\n if (Point.isPoint(at)) {\n var furthestVoid = Editor.void(editor, {\n at,\n mode: 'highest'\n });\n\n if (!voids && furthestVoid) {\n var [, voidPath] = furthestVoid;\n at = voidPath;\n } else {\n var opts = {\n unit,\n distance\n };\n var target = reverse ? Editor.before(editor, at, opts) || Editor.start(editor, []) : Editor.after(editor, at, opts) || Editor.end(editor, []);\n at = {\n anchor: at,\n focus: target\n };\n hanging = true;\n }\n }\n\n if (Path.isPath(at)) {\n Transforms.removeNodes(editor, {\n at,\n voids\n });\n return;\n }\n\n if (Range.isCollapsed(at)) {\n return;\n }\n\n if (!hanging) {\n at = Editor.unhangRange(editor, at, {\n voids\n });\n }\n\n var [start, end] = Range.edges(at);\n var startBlock = Editor.above(editor, {\n match: n => Editor.isBlock(editor, n),\n at: start,\n voids\n });\n var endBlock = Editor.above(editor, {\n match: n => Editor.isBlock(editor, n),\n at: end,\n voids\n });\n var isAcrossBlocks = startBlock && endBlock && !Path.equals(startBlock[1], endBlock[1]);\n var isSingleText = Path.equals(start.path, end.path);\n var startVoid = voids ? null : Editor.void(editor, {\n at: start,\n mode: 'highest'\n });\n var endVoid = voids ? null : Editor.void(editor, {\n at: end,\n mode: 'highest'\n }); // If the start or end points are inside an inline void, nudge them out.\n\n if (startVoid) {\n var before = Editor.before(editor, start);\n\n if (before && startBlock && Path.isAncestor(startBlock[1], before.path)) {\n start = before;\n }\n }\n\n if (endVoid) {\n var after = Editor.after(editor, end);\n\n if (after && endBlock && Path.isAncestor(endBlock[1], after.path)) {\n end = after;\n }\n } // Get the highest nodes that are completely inside the range, as well as\n // the start and end nodes.\n\n\n var matches = [];\n var lastPath;\n\n for (var entry of Editor.nodes(editor, {\n at,\n voids\n })) {\n var [node, path] = entry;\n\n if (lastPath && Path.compare(path, lastPath) === 0) {\n continue;\n }\n\n if (!voids && Editor.isVoid(editor, node) || !Path.isCommon(path, start.path) && !Path.isCommon(path, end.path)) {\n matches.push(entry);\n lastPath = path;\n }\n }\n\n var pathRefs = Array.from(matches, (_ref) => {\n var [, p] = _ref;\n return Editor.pathRef(editor, p);\n });\n var startRef = Editor.pointRef(editor, start);\n var endRef = Editor.pointRef(editor, end);\n\n if (!isSingleText && !startVoid) {\n var _point = startRef.current;\n var [_node] = Editor.leaf(editor, _point);\n var {\n path: _path\n } = _point;\n var {\n offset\n } = start;\n\n var text = _node.text.slice(offset);\n\n editor.apply({\n type: 'remove_text',\n path: _path,\n offset,\n text\n });\n }\n\n for (var pathRef of pathRefs) {\n var _path2 = pathRef.unref();\n\n Transforms.removeNodes(editor, {\n at: _path2,\n voids\n });\n }\n\n if (!endVoid) {\n var _point2 = endRef.current;\n var [_node2] = Editor.leaf(editor, _point2);\n var {\n path: _path3\n } = _point2;\n\n var _offset = isSingleText ? start.offset : 0;\n\n var _text = _node2.text.slice(_offset, end.offset);\n\n editor.apply({\n type: 'remove_text',\n path: _path3,\n offset: _offset,\n text: _text\n });\n }\n\n if (!isSingleText && isAcrossBlocks && endRef.current && startRef.current) {\n Transforms.mergeNodes(editor, {\n at: endRef.current,\n hanging: true,\n voids\n });\n }\n\n var point = endRef.unref() || startRef.unref();\n\n if (options.at == null && point) {\n Transforms.select(editor, point);\n }\n });\n }", "deleteAfter(position) {\n if (position === -1) {\n this.head = this.head.next\n return\n }\n\n let currentNode = this.find(position)\n if (currentNode && currentNode.next) {\n currentNode.next = currentNode.next.next\n } else if (currentNode && !currentNode.next) {\n /*\n if currentNode.next is `null`, we do nothing.\n */\n return\n } else {\n throw new Error(`Cannot delete at position ${position + 1}: unreachable position!`)\n }\n }", "clearTree() {\n // ******* TODO: PART VII *******\n\n // You only need two lines of code for this! No loops! \n d3.selectAll('.selected').classed('selected', false);\n d3.selectAll('.selectedLabel').classed('selectedLabel', false);\n \n }", "cleanBoard(treeCheck) {\n for (let cell of this.board) {\n if (!treeCheck.includes(cell.index)) {\n cell.hasTree = false;\n cell.myTree = false;\n cell.ennemyTree = false;\n }\n }\n }", "function removeDuplicateAndLogPosition() {\n resultsArray.pop();\n duplicatePositions.push(resultsArray.length);\n }", "_remove() {\n\t\tthis.parent._removeChildren( this.index );\n\t}", "function detractAllAbs(d){\n if('children' in d || '_children' in d){\n if(d.children){\n d._children = d.children;\n d.children = null;\n } else {\n }\n for(var i = 0;i<d._children.length;i++){\n detractAllAbs(d._children[i]);\n }\n }\n}", "clear() {\n let toRemove = [];\n for (let i = 0; i < this.scene.children.length; i++) {\n let obj = this.scene.children[i];\n if (obj.userData && obj.userData.isBodyElement) {\n toRemove.push(obj);\n }\n }\n for (let i = 0; i < toRemove.length; i++) {\n this.remove(toRemove[i]);\n }\n }", "function clearTree() {\n // ******* TODO: PART VII *******\n d3.selectAll(\".selected\").classed(\"selected\",false);\n d3.selectAll(\".selectedLabel\").classed(\"selectedLabel\",false);\n}", "clearTree() {\n d3.select(\"g#tree\").selectAll(\"text\").classed(\"selectedLabel\", false);\n d3.select(\"g#tree\").selectAll(\"path\").classed(\"selected\", false);\n // You only need two lines of code for this! No loops! \n }", "remove_child(node) {\n delete this.children[node.get_token_string()];\n this.notify_fragment_dirty();\n }", "removeAt(position){\n console.log('IN LL REMOVE AT!!! position should be 1 - ', position);\n console.log('length shoudl be 3? - ', this.length);\n if (position > -1 && position < this.length){\n console.log('1');\n var current = this.head;\n var previous;\n var counter = 0;\n if (position === 0){\n console.log('2');\n // if want to remove 1st element -> point head at 2nd element (element after this.head, cuz current == this.head)\n this.head = current.next;\n } else {\n console.log('3');\n // iterate until desired position...\n while (counter++ < position){\n // keep reference to previous, cuz will need to link it to new item...\n previous = current;\n // increment loop\n current = current.next;\n }\n // ***CUT CURRENT OUT OF THE LOOP -> take out element at position by creating new bridge from previous to current's next...\n previous.next = current.next;\n // ***this cuts current.element out of the linked-chain and forever gone from computer memory...\n\n }\n // for counting purposes...\n this.length--;\n console.log('4 removing (using removeAt) - ', current.element);\n return current.element;\n } else {\n console.log('5');\n return null;\n }\n }", "function popCoordinates() {\n coordinates.splice(0, 1);\n }", "function detachNodes() {\n /*jshint -W040:true*/\n var i, node, parent;\n for (i=0; i<this.length; i++) {\n node = this[i];\n parent = node.parentNode;\n if (parent) {\n parent.removeChild(node);\n }\n }\n }", "function detachNodes() {\n /*jshint -W040:true*/\n var i, node, parent;\n for (i=0; i<this.length; i++) {\n node = this[i];\n parent = node.parentNode;\n if (parent) {\n parent.removeChild(node);\n }\n }\n }", "function offsetTree(t, offset, offsetFunction) {\n for (var i = 0; i < t.length; i++) {\n var offsetpaths = offsetFunction(t[i], offset);\n if (offsetpaths.length == 1) {\n // replace array items in place\n Array.prototype.splice.apply(t[i], [0, t[i].length].concat(offsetpaths[0]));\n }\n\n if (t[i].childNodes && t[i].childNodes.length > 0) {\n offsetTree(t[i].childNodes, -offset, offsetFunction);\n }\n }\n }", "function drupalgap_remove_pages_from_dom() {\n try {\n var current_page_id = drupalgap_get_page_id(drupalgap_path_get());\n $.each(drupalgap.pages, function(index, page_id) {\n if (current_page_id != page_id) {\n $('#' + page_id).empty().remove();\n }\n });\n // Reset drupalgap.pages to only contain the current page id.\n drupalgap.pages = [current_page_id];\n }\n catch (error) { console.log('drupalgap_remove_pages_from_dom - ' + error); }\n}", "function deleteTodos(position) {\n todos.splice(position, 1);\n displayTodos();\n}", "updatePosition(position) {\n if (position == null)\n return;\n const positionNodes = parseExpressions(position)[0].terms;\n for (let i = 0; i < 3; ++i) {\n this.position.setComponent(i, normalizeUnit(positionNodes[i]).number);\n }\n }", "function deleteRecipe(position) {\n recipes.splice(position, 1);\n displayRecipes();\n}", "function strip(tree) {\n tree_forEach(tree, function(n) {\n delete n.tokenizer\n delete n.lineno\n delete n.start\n delete n.end\n delete n.target // break -> switch\n if (typeof n.type === 'number') n.type = tokens[n.type] + '(' + n.type + ')'\n })\n}" ]
[ "0.5964429", "0.5954956", "0.59464526", "0.59115714", "0.59062433", "0.54606396", "0.5458419", "0.5424383", "0.538081", "0.5371807", "0.532336", "0.5269275", "0.52399844", "0.52399844", "0.52332664", "0.52272236", "0.520304", "0.5202644", "0.51978296", "0.5182264", "0.5175965", "0.51728696", "0.51688886", "0.5167942", "0.5160971", "0.5156726", "0.5118569", "0.5118569", "0.50984776", "0.5093804", "0.50933063", "0.50698143", "0.5062059", "0.5059247", "0.5045831", "0.50318885", "0.5013238", "0.49964872", "0.4988792", "0.498357", "0.49807888", "0.49733913", "0.49691263", "0.4964613", "0.49622643", "0.49526405", "0.49526405", "0.49526405", "0.49132484", "0.49071476", "0.49020034", "0.49017006", "0.48896614", "0.48896614", "0.48896614", "0.48896614", "0.48896614", "0.48896614", "0.4885824", "0.48733598", "0.4872461", "0.4872461", "0.4872461", "0.4872461", "0.4872461", "0.4872461", "0.48707902", "0.48575178", "0.48525265", "0.4850722", "0.4846119", "0.48437232", "0.48390388", "0.48382097", "0.48307475", "0.48254332", "0.48222923", "0.4820876", "0.48191538", "0.4805323", "0.48047072", "0.47996575", "0.47959936", "0.47790238", "0.47748226", "0.4765322", "0.47583914", "0.4744881", "0.47382787", "0.47351092", "0.4732699", "0.4732699", "0.47280905", "0.47279012", "0.47233972", "0.4720227", "0.47194204", "0.4718762" ]
0.60244095
2
Visit a single node.
function one(node, index, parents) { var result if (!test || is(test, node, index, parents[parents.length - 1] || null)) { result = visitor(node, parents) if (result === EXIT) { return result } } if (node.children && result !== SKIP) { return all(node.children, parents.concat(node)) === EXIT ? EXIT : result } return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "visitNode(node) { }", "visit() {\n if(this.state) this.state = Node.VISITED;\n }", "function node(){}", "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 }", "function visit(node, fn) {\n if (!node.visited) {\n define(node, 'visited', true);\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n return node;\n}", "function visit(node, fn) {\n if (!node.visited) {\n define(node, 'visited', true);\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n\n return node;\n}", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "function visit(node, fn) {\n if (!node.visited) {\n _define(node, 'visited', true);\n\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n\n return node;\n}", "function visit(node, fn) {\n if (!node.visited) {\n defineProperty$7(node, 'visited', true);\n return node.nodes ? mapVisit$1(node.nodes, fn) : fn(node);\n }\n return node;\n}", "function traverseNodes(node, visitor) {\n traverse(node, null, visitor);\n}", "function one(node) {\n if (node.type === type) {\n callback.call(context, node);\n }\n\n var children = node.children;\n var index = -1;\n var length = children ? children.length : 0;\n\n while (++index < length) {\n one(children[index]);\n }\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function node() {\n invoke(this);\n }", "function visitedNode(url) {\n\tvar nodeIndex = getNodeIndex(url);\n\tvar node = dataHolder.nodes[nodeIndex];\n\tnode.visited = true;\n}", "function Node() {}", "get node() { return this._node; }", "function Node(){}", "visit(){\n this.visited = true ;\n }", "trackNodeBy(index, node) {\n return node.id;\n }", "function printNode (value) {\n console.log('Visisted vertex: ' + value)\n}", "function xpath_single_node(context_node, xpath) {\n return document.evaluate( \n xpath + '[1]', \n context_node, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null\n ).singleNodeValue;\n }", "traverse() {\n this.root.visit(this.root);\n }", "function acceptNode()\n {\n return NodeFilter.FILTER_ACCEPT;\n }", "function RNode(){}", "function RNode() {}", "function RNode() {}", "function RNode() {}", "function selectNode() {\n if ((graphTypes[selected] == \"material\") || (graphTypes[selected] == \"process\")) {\n updateAttributes(this);\n } else if (graphTypes[selected] == \"link\") {\n addEdge(this);\n } else if (graphTypes[selected] == \"delete\") {\n deleteNode(this.id);\n }\n}", "visit(node) {\n node.state = 1 /* IN_PROGRESS */;\n for (const edge of Object.values(node.dependencies)) {\n const target = this.nodes[edge.to];\n switch (target.state) {\n case 2 /* VISITED */: break; // Do nothing, since node was already visited\n case 1 /* IN_PROGRESS */:\n this.visitOpenNode(node, target, edge);\n break;\n case 0 /* NOT_VISITED */: this.visit(target);\n }\n }\n if (node.state !== 2 /* VISITED */) {\n node.state = 2 /* VISITED */;\n this.sortedNodeList.push(node.hash);\n }\n }", "function highlightSingleNode(node) {\n d3.select('#type' + node.type + '-group' + node.id)\n .transition()\n .style('opacity', DEFAULT_NODE_EDGE_OPACITY);\n }", "function Visitor(doc) {\n\tthis.stack = [];\n\tthis.parent = doc; //always a list item\n\tthis.node = doc.head();\n\tthis.index = 0;\n\tthis.point = 1;\n\tthis.retained = 0;\n\tthis.ops = []; //to get to the doc\n}", "function VNode() {}", "function TNode() {}", "function TNode() {}", "function TNode() {}", "function TNode(){}", "function visit(node) {\n // Only consider exported nodes\n if (!isNodeExported(node))\n return;\n if (node.kind === ts.SyntaxKind.EnumDeclaration) {\n var enNode = node;\n var symbol = checker.getSymbolAtLocation(enNode.name);\n if (!!symbol && generateDts) {\n visitEnumNode(enNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.FunctionDeclaration) {\n var fnNode = node;\n var symbol = checker.getSymbolAtLocation(fnNode.name);\n if (!!symbol && generateDts) {\n visitFunctionNode(fnNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.VariableStatement) {\n var vsNode = node;\n if (vsNode.declarationList.declarations.length > 0) {\n var varNode = vsNode.declarationList.declarations[0];\n var symbol = checker.getSymbolAtLocation(varNode.name);\n if (!!symbol && (generateDts || isSymbolHasComments(symbol))) {\n visitVariableNode(varNode, symbol);\n }\n }\n }\n else if (node.kind === ts.SyntaxKind.ClassDeclaration) {\n // This is a top level class, get its symbol\n var symbol = checker.getSymbolAtLocation(node.name);\n if (!symbol)\n return;\n if (generateDts || isSymbolHasComments(symbol)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.InterfaceDeclaration) {\n // This is a top level class, get its symbol\n var name_1 = node.name;\n var symbol = checker.getSymbolAtLocation(name_1);\n if (generateDts || isSymbolHasComments(symbol) || isOptionsInterface(name_1.text)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.ModuleDeclaration) {\n // This is a namespace, visit its children\n ts.forEachChild(node, visit);\n }\n else if (node.kind === ts.SyntaxKind.ExportDeclaration) {\n visitExportDeclarationNode(node);\n }\n }", "function markIt(node, modeljsav) {\n node.addClass(\"visited\");\n modeljsav.umsg(\"Add node \" + node.value() + \" to the MST\");\n node.highlight();\n }", "function highlightNode(nodeId) {\n var node = myDiagram.findNodeForKey(nodeId++);\n // console.log(node);\n if (node !== null) {\n // make sure the selected node is in the viewport\n myDiagram.scrollToRect(node.actualBounds);\n // move the large yellow node behind the selected node to highlight it\n highlighter.location = new go.Point(\n node.location.x + 40,\n node.location.y + 40\n );\n // console.log(node.location)\n // console.log(highlighter.location)\n }\n}", "function NodeHandler() { }", "function visit(node) {\r\n if (visited.has(node)) {\r\n return;\r\n }\r\n visited.add(node);\r\n var children = graph.get(node);\r\n if (children) {\r\n children.forEach(visit);\r\n }\r\n sorted.push(node);\r\n }", "function get_node(id)\n {\n return indexbyid[id];\n }", "function NodeDef() {}", "function NodeDef() {}", "function NodeDef() {}", "function node(v) {\n\t\t\t\tif (!v.firstChild ||\n\t\t\t\t\tv.firstChild.nodeName === \"#text\") {\n\t\t\t\t\tv = v.textContent.match(/[^\\n]+/);\n\n\t\t\t\t\treturn v != null ? v[0] : \"\";\n\t\t\t\t}\n\n\t\t\t\treturn node(v.firstChild);\n\t\t\t}", "function markIt(node, av) {\n var edge;\n step++;\n node.addedStep = step;\n node.addClass(\"visited\");\n if (av) {\n av.umsg(\"Visit node \" + node.value());\n }\n node.highlight();\n if (av) {\n av.step();\n if (node.prev) {\n av.umsg(\"Add edge (\" + node.prev.value() + \",\" + node.value() +\n \") to the DFS graph\");\n edge = node.edgeFrom(node.prev).css({\"stroke-width\": \"4\", \"stroke\": \"red\"});\n edge.added = true;\n av.step();\n }\n av.stepOption('grade', true);\n }\n }", "function traverseNodes(node) {\n if (node.value) {\n cb(node.value);\n }\n if (node.left) {\n traverseNodes(node.left);\n }\n if (node.right) {\n traverseNodes(node.right);\n }\n }", "function Node() {\r\n this.className = 'Node';\r\n this.id = null;\r\n this.serverId = null;\r\n this.name = null;\r\n this.date = null;\r\n this.duration = null;\r\n this.state = \"closed\";\r\n this.checked = false;\r\n this.traverseToken = null;\r\n // Means node has no children.\r\n this.leaf = false;\r\n // for editing node: information source\r\n this.source = null;\r\n // the flag is this node belongs to user\r\n this.belongsToUser = false;\r\n // this node is currently edited\r\n this.edited = false;\r\n // key which would be shared\r\n this.shareId = null;\r\n}", "function Node() {\n}", "function RNode() { }", "function RNode() { }", "function markIt(node, av) {\n var edge;\n step++;\n node.addedStep = step;\n node.addClass(\"visited\");\n if (av) {\n av.umsg(\"Visit node \" + node.value());\n }\n node.highlight();\n if (av) {\n av.step();\n if (node.prev) {\n av.umsg(\"Add edge (\" + node.prev.value() + \",\" + node.value() +\n \") to the DFS graph\");\n edge = node.edgeFrom(node.prev).css({\"stroke-width\": \"4\", \"stroke\": \"red\"});\n edge.added = true;\n av.step();\n }\n av.stepOption('grade', true);\n }\n }", "link() {\n //the act of walking causes the nodes to be linked\n this.walk(() => { }, {\n walkMode: visitors_1.WalkMode.visitAllRecursive\n });\n }", "function Node() {\n }", "function NodeDef(){}", "function VertexNode( point ) {\n\n\t\tthis.point = point;\n\t\tthis.prev = null;\n\t\tthis.next = null;\n\t\tthis.face = null; // the face that is able to see this vertex\n\n\t}", "getNodeValue() {}", "function visit() {\n if (this.isBlacklisted()) return false;\n if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false;\n\n this.call(\"enter\");\n\n if (this.shouldSkip) {\n return this.shouldStop;\n }\n\n var node = this.node;\n var opts = this.opts;\n\n if (node) {\n if (Array.isArray(node)) {\n // traverse over these replacement nodes we purposely don't call exitNode\n // as the original node has been destroyed\n for (var i = 0; i < node.length; i++) {\n _index2[\"default\"].node(node[i], opts, this.scope, this.state, this, this.skipKeys);\n }\n } else {\n _index2[\"default\"].node(node, opts, this.scope, this.state, this, this.skipKeys);\n this.call(\"exit\");\n }\n }\n\n return this.shouldStop;\n}", "function node(val){\n\tthis.val = val;\n\tthis.next = null;\n}", "function Node(){\n\t\tthis.setup();\n\t\tthis;\n\t}", "function VertexNode( point ) {\n\n\t\t\tthis.point = point;\n\t\t\tthis.prev = null;\n\t\t\tthis.next = null;\n\t\t\tthis.face = null; // the face that is able to see this vertex\n\n\t\t}", "function visit(node, visitor) {\n const visitor_ = initVisitor(visitor);\n if (identity.isDocument(node)) {\n const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));\n if (cd === REMOVE)\n node.contents = null;\n }\n else\n visit_(null, node, visitor_, Object.freeze([]));\n}", "function SelectNode(nodeId){\n var nodeObj = $(\"#\"+nodeId).val();\n $(\"#divTree\").jstree(\"select_node\", nodeObj, null, null); \n}", "function node(x, y, parent_index, g, h, f)\n{\n\tthis.x = x;\n\tthis.y = y;\n\tthis.parent_index = parent_index;\n\tthis.g = g;\n\tthis.h = h;\n\tthis.f = f;\n}", "function Node(data) {\n this.data = data;\n}", "function highlightGraphNode( node, on )\n {\n //if( d3.event.shiftKey ) on = false; // for debugging\n\n // If we are to activate a movie, and there's already one active,\n // first switch that one off\n if( on && activeMovie !== undefined ) {\n \t highlightGraphNode( nodeArray[activeMovie], false );\n }\n\n // locate the SVG nodes: circle & label group\n circle = d3.select( '#c' + node.index );\n label = d3.select( '#l' + node.index );\n\n // activate/deactivate the node itself\n circle\n\t.classed( 'main', on );\n label\n\t.classed( 'on', on || currentZoom >= SHOW_THRESHOLD );\n label.selectAll('text')\n\t.classed( 'main', on );\n\n // activate all siblings\n Object(node.links).forEach( function(id) {\n\td3.select(\"#c\"+id).classed( 'sibling', on );\n\tlabel = d3.select('#l'+id);\n\tlabel.classed( 'on', on || currentZoom >= SHOW_THRESHOLD );\n\tlabel.selectAll('text.nlabel')\n\t .classed( 'sibling', on );\n } );\n\n // set the value for the current active movie\n activeMovie = on ? node.index : undefined;\n }", "function Node(value) {\n\n this.value = value;\n this.edges = [];\n this.searched = false;\n this.parent = null;\n\n\n }", "function NodeVisitor() {\n _classCallCheck(this, NodeVisitor);\n\n this[path] = [];\n }", "function visit(node, visitor) {\n const visitor_ = initVisitor(visitor);\n if (isDocument(node)) {\n const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));\n if (cd === REMOVE)\n node.contents = null;\n }\n else\n visit_(null, node, visitor_, Object.freeze([]));\n }", "function visit() {\n\t if (this.isBlacklisted()) return false;\n\t if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false;\n\n\t this.call(\"enter\");\n\n\t if (this.shouldSkip) {\n\t return this.shouldStop;\n\t }\n\n\t var node = this.node;\n\t var opts = this.opts;\n\n\t if (node) {\n\t if (Array.isArray(node)) {\n\t // traverse over these replacement nodes we purposely don't call exitNode\n\t // as the original node has been destroyed\n\t for (var i = 0; i < node.length; i++) {\n\t _index2[\"default\"].node(node[i], opts, this.scope, this.state, this, this.skipKeys);\n\t }\n\t } else {\n\t _index2[\"default\"].node(node, opts, this.scope, this.state, this, this.skipKeys);\n\t this.call(\"exit\");\n\t }\n\t }\n\n\t return this.shouldStop;\n\t}", "function visit() {\n\t if (this.isBlacklisted()) return false;\n\t if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false;\n\n\t this.call(\"enter\");\n\n\t if (this.shouldSkip) {\n\t return this.shouldStop;\n\t }\n\n\t var node = this.node;\n\t var opts = this.opts;\n\n\t if (node) {\n\t if (Array.isArray(node)) {\n\t // traverse over these replacement nodes we purposely don't call exitNode\n\t // as the original node has been destroyed\n\t for (var i = 0; i < node.length; i++) {\n\t _index2[\"default\"].node(node[i], opts, this.scope, this.state, this, this.skipKeys);\n\t }\n\t } else {\n\t _index2[\"default\"].node(node, opts, this.scope, this.state, this, this.skipKeys);\n\t this.call(\"exit\");\n\t }\n\t }\n\n\t return this.shouldStop;\n\t}", "function Node(value){\n this.value =value;\n this.next = null;\n this.id = null;\n}", "function selectSingleNode(xPath,params){\r\n\t\tparams=params||{}; params['type']=9;\r\n\t\treturn selectNodes(xPath,params).singleNodeValue;\r\n\t}", "function selectSingleNode(xPath,params){\r\n\t\tparams=params||{}; params['type']=9;\r\n\t\treturn selectNodes(xPath,params).singleNodeValue;\r\n\t}", "function selectSingleNode(xPath,params){\r\n\t\tparams=params||{}; params['type']=9;\r\n\t\treturn selectNodes(xPath,params).singleNodeValue;\r\n\t}", "function NodeDef() { }", "function NodeDef() { }", "function Node (value) {\n this.value = value;\n this.next = null;\n}", "function handleMouseClickNode(d) {\n var data = data_display.getNearLinksAndNodes(d, links);\n data_display.highlightElements(data, d, svg);\n data_display.getInfoForSelectedNode($element, d);\n exposeSiblingNodes(data.nodes);\n }", "function printOne(v) {\n if (visited[v] == 0) {\n\n dfs(v);\n }\n }", "getNode() {\n throw new Error(\"Must be implemented\");\n }", "function Node(value) {\n this.value = value;\n this.next = null;\n}", "function depthFirst(node, visited = new Set()) {\n if (visited.has(node.val)) return; //base case\n visited.add(node.val);\n console.log(node.val);\n node.neighbors.forEach((neighbor) => depthFirst(neighbor, visted));\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}" ]
[ "0.7660978", "0.64456815", "0.6444978", "0.6280553", "0.6108867", "0.60755324", "0.60506946", "0.60506946", "0.60448086", "0.59708697", "0.59514207", "0.5924221", "0.59024817", "0.59024817", "0.59024817", "0.59024817", "0.5810606", "0.5810606", "0.5810606", "0.5810606", "0.5810606", "0.5810606", "0.56386995", "0.5636397", "0.5624829", "0.5620238", "0.5609939", "0.56052655", "0.5579237", "0.54747874", "0.54192936", "0.53958875", "0.538487", "0.53554887", "0.5321697", "0.5321697", "0.5321697", "0.52729166", "0.5266448", "0.5263826", "0.52436215", "0.5202084", "0.51918083", "0.51918083", "0.51918083", "0.5167329", "0.5164406", "0.51320624", "0.51310074", "0.51283836", "0.5115769", "0.5077438", "0.5065739", "0.5065739", "0.5065739", "0.5058315", "0.5055018", "0.5046881", "0.50458896", "0.5040416", "0.50381565", "0.50381565", "0.5033152", "0.5023444", "0.5016373", "0.5014408", "0.5013703", "0.5009375", "0.49915746", "0.497626", "0.49589893", "0.4955111", "0.495246", "0.49171278", "0.4915561", "0.49151736", "0.49151498", "0.49146846", "0.49129757", "0.49116093", "0.49058506", "0.49058506", "0.49031526", "0.48951626", "0.48951626", "0.48951626", "0.4890204", "0.4890204", "0.4872656", "0.48640004", "0.485656", "0.4854197", "0.4849764", "0.48483548", "0.48372233", "0.48372233", "0.48372233", "0.48372233", "0.48372233" ]
0.5601799
29
Visit children in `parent`.
function all(children, parents) { var min = -1 var step = reverse ? -1 : 1 var index = (reverse ? children.length : min) + step var child var result while (index > min && index < children.length) { child = children[index] result = child && one(child, index, parents) if (result === EXIT) { return result } index = typeof result === 'number' ? result : index + step } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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}", "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}", "allWithChildren(parent) {\n\t\treturn this.all(parent, true);\n\t}", "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 }", "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}", "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 }", "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}", "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}", "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}", "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}", "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}", "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}", "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 }", "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}", "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}", "forEach(callback) {\n callback(this);\n for (const child of this.children) {\n child.forEach(callback);\n }\n }", "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 }", "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 }", "function processNode(node){\n processChild(node);\n for( i in node.children )\n processNode(node.children[i]);\n }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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}", "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}", "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 }", "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}", "children() {\n return new ChildrenIterator(this, this.keys);\n }", "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}", "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}", "*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 }", "*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 }", "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}", "initChildren() {\n this.nodes.forEach(node => {\n node.parent = this\n })\n }", "childrenIteration(_processFunc) {\n return this.children.map(_processFunc);\n }", "children() {\n return new types_List(map(this.node.children, function (node) {\n return adopt(node);\n }));\n }", "function appendChildren(parent, ...children) {\r\n children.forEach(child => parent.appendChild(child));\r\n}", "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", "function treeForEachChild(tree, action) {\n each(tree.node.children, function (child, childTree) {\n action(new Tree(child, tree, childTree));\n });\n}", "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}", "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}", "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}", "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}", "getAllChildren() {\n const children = this.jq.wrapper.find(this.jq.child)\n return children\n }", "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 }", "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}", "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}", "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}", "function deleteAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "function appendChildren(parent, children) {\n children.forEach(function(child) {\n parent.appendChild(child);\n })\n}", "traverse() {\n this.root.visit(this.root);\n }", "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}", "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}", "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}", "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 }", "function addSiblings(parent) {\n while (parent != null) {\n parent.siblings++;\n parent = parent.parent;\n }\n}", "function markAsDynamicChildren(children) {\n FromIteration.set(children, 1);\n }", "function markAsDynamicChildren(children) {\n FromIteration.set(children, 1);\n }", "function appendChildren(parent, children) {\n for (let ele of children) {\n parent.appendChild(ele);\n }\n return parent;\n}", "function appendChildren(parent, children) {\n for (let ele of children) {\n parent.appendChild(ele);\n }\n return parent;\n}", "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}", "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 }", "function getChildren(el) {\n\n }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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}", "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}", "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}", "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 }", "addChildren(value) {}", "get children() {\n return this._children;\n }", "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}", "get childNodes () {\n return childNodes(this._data).map(data => createNode(data));\n }", "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 }", "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 }", "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 }", "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}", "async readChildren () {\n return this._children\n }", "async readChildren () {\n return this._children\n }", "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 }", "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}", "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 }", "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 }", "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 }", "forEach(visitor) {\n this.tree_walk(this.root, (node) => visitor(node.item.key, node.item.value));\n }", "*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 }", "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}" ]
[ "0.79614055", "0.79312193", "0.7884905", "0.78685194", "0.78685194", "0.78685194", "0.77841", "0.72736555", "0.676731", "0.6584016", "0.6529354", "0.62057847", "0.6133546", "0.6133546", "0.6120903", "0.6087371", "0.6087371", "0.6032075", "0.60211647", "0.60132015", "0.60132015", "0.600705", "0.5885762", "0.5865207", "0.58483535", "0.57666314", "0.57666314", "0.57666314", "0.57666314", "0.57666314", "0.57666314", "0.5738852", "0.57376444", "0.57112795", "0.56983024", "0.56863636", "0.56406665", "0.5611981", "0.5611182", "0.5611182", "0.56068873", "0.5600739", "0.55962986", "0.553433", "0.5523341", "0.55146444", "0.5509102", "0.5499688", "0.5495388", "0.54919827", "0.54900104", "0.5466297", "0.5464709", "0.5459188", "0.54565513", "0.5438189", "0.5434946", "0.5434379", "0.5433057", "0.54300094", "0.54273534", "0.54273534", "0.54221565", "0.5420298", "0.54166913", "0.54166913", "0.54128283", "0.54128283", "0.54113793", "0.5407789", "0.54032737", "0.53938687", "0.53720856", "0.53720856", "0.53718835", "0.53715557", "0.5361395", "0.53507376", "0.53507376", "0.5348885", "0.5345127", "0.5332694", "0.5323068", "0.53214544", "0.5305404", "0.53046066", "0.53046066", "0.53046066", "0.53016806", "0.528991", "0.528991", "0.5288243", "0.5287705", "0.5279676", "0.5271194", "0.5257083", "0.52535516", "0.5247469", "0.5244017" ]
0.53865093
73
Assert if `test` passes for `node`. When a `parent` node is known the `index` of node
function is(test, node, index, parent, context) { var hasParent = parent !== null && parent !== undefined var hasIndex = index !== null && index !== undefined var check = convert(test) if ( hasIndex && (typeof index !== 'number' || index < 0 || index === Infinity) ) { throw new Error('Expected positive finite index or child node') } if (hasParent && (!is(null, parent) || !parent.children)) { throw new Error('Expected parent node') } if (!node || !node.type || typeof node.type !== 'string') { return false } if (hasParent !== hasIndex) { throw new Error('Expected both parent and index') } return Boolean(check.call(context, node, index, parent)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hc_nodelistindexnotzero() {\n var success;\n var doc;\n var elementList;\n var employeeNode;\n var employeeList;\n var child;\n var childName;\n doc = load(\"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(2);\n employeeList = employeeNode.childNodes;\n\n child = employeeList.item(3);\n childName = child.nodeName;\n\n \n\tif(\n\t(\"#text\" == childName)\n\t) {\n\tassertEquals(\"childName_space\",\"#text\",childName);\n \n\t}\n\t\n\t\telse {\n\t\t\tassertEqualsAutoCase(\"element\", \"childName_strong\",\"strong\",childName);\n \n\t\t}\n\t\n}", "function one(node, index, parents) {\n var result\n\n if (!test || is(test, node, index, parents[parents.length - 1] || null)) {\n result = visitor(node, parents)\n\n if (result === EXIT) {\n return result\n }\n }\n\n if (node.children && result !== SKIP) {\n return all(node.children, parents.concat(node)) === EXIT ? EXIT : result\n }\n\n return result\n }", "function one(node, index, parents) {\n var result\n\n if (!test || is(test, node, index, parents[parents.length - 1] || null)) {\n result = visitor(node, parents)\n\n if (result === EXIT) {\n return result\n }\n }\n\n if (node.children && result !== SKIP) {\n return all(node.children, parents.concat(node)) === EXIT ? EXIT : result\n }\n\n return result\n }", "function nodeTest(assert) { \n let name = nodeStore.address[assert.loc.toString()].name; \n let index = nodeStore.address[assert.loc.toString()].index; \n let result = `${oneSpace}expect(wrapper.find('${name}').at(${index}).props().${assert.property}).`;\n result += evalTest(assert); \n return result;\n}", "findNodeMatch(node, outerDeco, innerDeco, index) {\n let found2 = -1, targetDesc;\n if (index >= this.preMatch.index && (targetDesc = this.preMatch.matches[index - this.preMatch.index]).parent == this.top && targetDesc.matchesNode(node, outerDeco, innerDeco)) {\n found2 = this.top.children.indexOf(targetDesc, this.index);\n } else {\n for (let i = this.index, e = Math.min(this.top.children.length, i + 5); i < e; i++) {\n let child = this.top.children[i];\n if (child.matchesNode(node, outerDeco, innerDeco) && !this.preMatch.matched.has(child)) {\n found2 = i;\n break;\n }\n }\n }\n if (found2 < 0)\n return false;\n this.destroyBetween(this.index, found2);\n this.index++;\n return true;\n }", "function UpdateExpression(node, parent) {\n if (t.isMemberExpression(parent) && parent.object === node) {\n // (foo++).test()\n return true;\n }\n}", "check_if_passed() {\n const passed = this.node.value === this.correct;\n if (!passed) {\n console.error(this.describe() + \" failed!\");\n }\n return passed;\n }", "function UpdateExpression(node, parent) {\n\t if (t.isMemberExpression(parent) && parent.object === node) {\n\t // (foo++).test()\n\t return true;\n\t }\n\t}", "function UpdateExpression(node, parent) {\n\t if (t.isMemberExpression(parent) && parent.object === node) {\n\t // (foo++).test()\n\t return true;\n\t }\n\t}", "_hasLeftChild(parentIndex) {\n const leftChildIndex = (parentIndex * 2) + 1;\n return leftChildIndex < this.size();\n }", "function logBlockIndex(target) {\n let childNodes = parentNode.querySelectorAll(`.${PARENT_BLOCK_CLASS}`);\n\n for (let i = 0; i < childNodes.length; i++) {\n if (target === childNodes[i]) {\n console.log(i);\n }\n }\n}", "function ancestoryTest(node1, node2) {\n var tmp = node1;\n while (tmp) {\n if (tmp === node2) return true;\n tmp = tmp.parent;\n }\n tmp = node2;\n while (tmp) {\n if (tmp === node1) return true;\n tmp = tmp.parent;\n }\n return false;\n }", "function getIndex(node) {\n var childs = node.parentNode.childNodes;\n var count = 0;\n for (var i = 0; i < childs.length; i++) {\n if (node === childs[i]) break;\n if (childs[i].toString() !== '[object Text]') count++;\n }\n return count;\n}", "function hasParent(el, test) {\n\twhile (test) {\n\t\tif (test === el.parentElement) {\n\t\t\treturn true;\n\t\t}\n\t\ttest = test.parentElement;\n\t}\n\treturn false;\n}", "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 }", "function isChildOf(node, parent) {\n\t\twhile (node) {\n\t\t\tif (parent === node) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tnode = node.parentNode;\n\t\t}\n\n\t\treturn false;\n\t}", "function isChildOf(node, parent) {\n\t\twhile (node) {\n\t\t\tif (parent === node) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tnode = node.parentNode;\n\t\t}\n\n\t\treturn false;\n\t}", "function isChildOf(node, parent) {\n\t\twhile (node) {\n\t\t\tif (parent === node) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tnode = node.parentNode;\n\t\t}\n\n\t\treturn false;\n\t}", "validateIndex() {\n // handle null apex condition and verify empty tree and nodes\n if (!this.apex) {\n if (Object.keys(this.nodes).length !== 0) {\n return false;\n }\n return true;\n }\n // ensure apex has no parent\n if (this.nodes[this.apex].parent !== null) {\n return false;\n }\n // high level verification - retrieve all node ids ordered by their values\n let result = this.collateIds(this.nodes[this.apex]);\n let nc = Object.keys(this.nodes).length;\n // verify the inorder traversal returned same number of elements as nodes hashmap\n if (result.length !== nc) {\n return false;\n }\n // if only one result\n if (result.length === 1) {\n if (this.nodes[result[0]].parent !== null)\n return false;\n if (this.nodes[result[0]].left !== null)\n return false;\n if (this.nodes[result[0]].right !== null)\n return false;\n return true;\n }\n // iterate results and ensure next value is greater or equal to current\n for (let i = 0; i < result.length - 1; i++) {\n if (this.comparator.compare(this.nodes[result[i]].value, this.nodes[result[i + 1]].value) === 1) {\n return false;\n }\n }\n return this.validateNode(this.nodes[this.apex]);\n }", "function hc_nodeparentnode() {\n var success;\n var doc;\n var elementList;\n var employeeNode;\n var parentNode;\n var parentName;\n doc = load(\"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n parentNode = employeeNode.parentNode;\n\n parentName = parentNode.nodeName;\n\n assertEqualsAutoCase(\"element\", \"parentNodeName\",\"body\",parentName);\n \n}", "function test_parentPath() {\n assert_equals(\"/a/b\", xpath(\"xp:parentPath('/a/b/c.txt')\", <a/>), \"XPath function xp:parentPath\");\n}", "function checkNode(node, prefix) {\n if (node instanceof Bucket) {\n var contacts = node.obtain();\n for (var i = 0; i < contacts.length; ++i) {\n for (var j = 0; j < prefix.length; ++j) {\n contacts[i].id.at(j).should.equal(prefix[j]);\n }\n }\n } else {\n checkNode(node.left, prefix.concat(false));\n checkNode(node.right, prefix.concat(true));\n }\n}", "function one(node, index, parents) {\n var result = []\n var subresult\n\n if (!test || is(test, node, index, parents[parents.length - 1] || null)) {\n result = toResult(visitor(node, parents))\n\n if (result[0] === EXIT) {\n return result\n }\n }\n\n if (node.children && result[0] !== SKIP) {\n subresult = toResult(all(node.children, parents.concat(node)))\n return subresult[0] === EXIT ? subresult : result\n }\n\n return result\n }", "_hasRightChild(parentIndex) {\n const rightChildIndex = (parentIndex * 2) + 2;\n return rightChildIndex < this.size();\n }", "_compareChildrenOf(parentIndex) {\n if (!this._hasLeftChild(parentIndex) && !this._hasRightChild(parentIndex)) {\n return -1;\n }\n\n const leftChildIndex = (parentIndex * 2) + 1;\n const rightChildIndex = (parentIndex * 2) + 2;\n\n if (!this._hasLeftChild(parentIndex)) {\n return rightChildIndex;\n }\n\n if (!this._hasRightChild(parentIndex)) {\n return leftChildIndex;\n }\n\n const compare = this._compareAt(leftChildIndex, rightChildIndex);\n return compare > 0 ? rightChildIndex : leftChildIndex;\n }", "checkIsBST () {\n this.checkNodeOrdering()\n this.checkInternalPointers()\n if (this.parent) throw new Error(\"The root shouldn't have a parent\")\n }", "function findNodeAround(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n try {\n (function c(node, st, override) {\n var type = override || node.type;\n if (node.start > pos || node.end < pos) { return }\n baseVisitor[type](node, st, c);\n if (test(type, node)) { throw new Found(node, st) }\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n }", "function findNodeAround(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n try {\n (function c(node, st, override) {\n var type = override || node.type;\n if (node.start > pos || node.end < pos) { return }\n baseVisitor[type](node, st, c);\n if (test(type, node)) { throw new Found(node, st) }\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n }", "function testFunction(node){\n console.log(`${node.nodeName} tag with ${node.childNodes.length} children and style: ${node.style}`);\n return;\n}", "function findNodeAround(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n try {\n (function c(node, st, override) {\n var type = override || node.type;\n if (node.start > pos || node.end < pos) { return }\n baseVisitor[type](node, st, c);\n if (test(type, node)) { throw new Found(node, st) }\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n}", "function containsNode(parent, child) {\n if (parent === child) return true;\n child = child.parentNode;\n while (child) {\n if (child === parent) return true;\n child = child.parentNode;\n }\n\n return false;\n }", "isElementContained(parent, event) {\n var node = event.target?.parentNode;\n while (node != null) {\n if (node === parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n }", "function verifyMembers(t, sess, addresses, tests, parent, next) {\n const arr = Object.keys(addresses);\n\n function verifyProperty(t, sess, addresses, index, subIndex) {\n if (index >= arr.length) {\n return next(t, sess);\n }\n\n const name = arr[index];\n const test = tests[name];\n // We are in the middle of in test.validators\n if (subIndex !== undefined) {\n const validators = test.validators;\n if (subIndex >= validators.length) {\n return verifyProperty(t, sess, addresses, index + 1);\n }\n validators[subIndex](t, sess, addresses, name, (err) => {\n t.error(err, `${parent}${test.desc} validator #${subIndex} should complete`);\n verifyProperty(t, sess, addresses, index, subIndex + 1);\n });\n return;\n }\n\n if (test.validator) { // Single validator\n test.validator(t, sess, addresses, name, (err) => {\n t.error(err, `${parent}${test.desc} validator should complete`);\n verifyProperty(t, sess, addresses, index + 1);\n });\n } else if (test.validators) { // Multiple validator\n verifyProperty(t, sess, addresses, index, 0);\n } else { // No validator\n verifyProperty(t, sess, addresses, index + 1);\n }\n }\n\n // Kickoff\n verifyProperty(t, sess, addresses, 0);\n}", "function expectTestIDPropExists(tree, prop) {\n let treefindWhere;\n if (tree instanceof enzyme_1.ReactWrapper)\n treefindWhere = tree.findWhere(node => node.prop(\"testID\") === prop);\n else treefindWhere = tree.findWhere(node => node.prop(\"testID\") === prop);\n expect(treefindWhere.exists()).toEqual(true);\n}", "checkAllNodesFullfillCondition (test) {\n if (!Object.prototype.hasOwnProperty.call(this, 'key')) return\n\n test(this.key, this.data)\n if (this.left) this.left.checkAllNodesFullfillCondition(test)\n if (this.right) this.right.checkAllNodesFullfillCondition(test)\n }", "has_parent_node(){\n return this.parent_node != null;\n }", "function _crossCheck (node) {\n if (!ecma.util.isa(node, CNode)) {\n throw new Error('child is not a data node');\n }\n if (node.parentNode !== this) {\n throw new Error('child belongs to another parent');\n }\n }", "function testElement(options, node) {\n const test = compileTest(options);\n return test ? test(node) : true;\n}", "async function checkNode(node) {\n\n // check left\n if(node.left !== null) {\n await sleep(2);\n treeArr.push('[left] ' + node.left.value);\n // repeat function from left node's children\n checkNode(node.left);\n }\n\n // check right\n if(node.right !== null) {\n await sleep(1);\n treeArr.push('[right] ' + node.right.value);\n checkNode(node.right);\n }\n }", "updateNextNode(node, outerDeco, innerDeco, view, index) {\n for (let i = this.index; i < this.top.children.length; i++) {\n let next = this.top.children[i];\n if (next instanceof NodeViewDesc) {\n let preMatch2 = this.preMatch.matched.get(next);\n if (preMatch2 != null && preMatch2 != index)\n return false;\n let nextDOM = next.dom;\n let locked = this.isLocked(nextDOM) && !(node.isText && next.node && next.node.isText && next.nodeDOM.nodeValue == node.text && next.dirty != NODE_DIRTY && sameOuterDeco(outerDeco, next.outerDeco));\n if (!locked && next.update(node, outerDeco, innerDeco, view)) {\n this.destroyBetween(this.index, i);\n if (next.dom != nextDOM)\n this.changed = true;\n this.index++;\n return true;\n }\n break;\n }\n }\n return false;\n }", "function findChild(node, test) {\n if (!node)\n return;\n if (test(node))\n return node;\n return node.forEachChild(function (child) { return findChild(child, test); });\n}", "function traverse(node, item, offset) {\n\t\tif(overlaps(node, item)) {\n\t\t\tif(iterate(siblingIndex.get(offset+1), item, offset+1)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tappend(node, item, offset);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function getChildNumber(node) {\r\n return Array.prototype.indexOf.call(node.parentNode.children, node);\r\n}", "_compareChildrenBefore(index, leftChildIndex, rightChildIndex) {\n const compare = this._compareAt(rightChildIndex, leftChildIndex);\n\n if (compare <= 0 && rightChildIndex < index) {\n return rightChildIndex;\n }\n\n return leftChildIndex;\n }", "function nodeIndex(node) {\r\n assert(isElement(node), 'pklib.dom.index: @node is not HTMLElement');\r\n\r\n var i, childrenInstance = children(parent(node)), len = children.length;\r\n\r\n for (i = 0; i < len; ++i) {\r\n if (childrenInstance[i] === node) {\r\n return i;\r\n }\r\n }\r\n return null;\r\n }", "function elemIndexInspektor(node)\n{\n for (let i = 0; i < allLi.length; i++)\n {\n if (allLi[i] === node)\n return i;\n }\n}", "function goalTest(problem, node){\n if(problem.x == node.x && problem.y == node.y){\n return true;\n }\n\n return false;\n}", "validateNode(node) {\n // should never have parent or child pointers reference self\n if ([node.parent, node.left, node.right].indexOf(node.id) !== -1) {\n return false;\n }\n // validate height and balance\n let hl = (node.left) ? this.nodes[node.left].height : -1;\n let hr = (node.right) ? this.nodes[node.right].height : -1;\n let eh = 1 + Math.max(hl, hr);\n if (node.height !== eh) {\n return false;\n }\n if (node.balance !== hr - hl) {\n return false;\n }\n // verify any siblings parent back to self\n if (node.siblings.length > 0) {\n for (let sid of node.siblings) {\n if (this.nodes[sid].parent !== node.id)\n return false;\n }\n }\n // if there is a left child, verify it parents to self and recurse it\n if (node.left) {\n if (this.nodes[node.left].parent !== node.id) {\n return false;\n }\n if (!this.validateNode(this.nodes[node.left])) {\n return false;\n }\n }\n // if there is a right child, verify it parents to self and recurse it\n if (node.right) {\n if (this.nodes[node.right].parent !== node.id) {\n return false;\n }\n if (!this.validateNode(this.nodes[node.right])) {\n return false;\n }\n }\n return true;\n }", "function parentMatches(predicateFn) {\n return function (node) {\n let parent = node.parentNode;\n while (parent !== undefined) {\n if (predicateFn(parent)) {\n return true;\n }\n parent = parent.parentNode;\n }\n return false;\n };\n}", "function one(node, index, parents) {\n var result = []\n var subresult\n\n if (!test || is(node, index, parents[parents.length - 1] || null)) {\n result = toResult(visitor(node, parents))\n\n if (result[0] === EXIT) {\n return result\n }\n }\n\n if (node.children && result[0] !== SKIP) {\n subresult = toResult(all(node.children, parents.concat(node)))\n return subresult[0] === EXIT ? subresult : result\n }\n\n return result\n }", "function one(node, index, parents) {\n var result = []\n var subresult\n\n if (!test || is(node, index, parents[parents.length - 1] || null)) {\n result = toResult(visitor(node, parents))\n\n if (result[0] === EXIT) {\n return result\n }\n }\n\n if (node.children && result[0] !== SKIP) {\n subresult = toResult(all(node.children, parents.concat(node)))\n return subresult[0] === EXIT ? subresult : result\n }\n\n return result\n }", "function hc_nodehaschildnodes() {\n var success;\n var doc;\n var elementList;\n var employeeNode;\n var state;\n doc = load(\"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n state = employeeNode.hasChildNodes();\n assertTrue(\"nodeHasChildAssert1\",state);\n\n}", "function findNodeAround(node, pos, test, base, state) {\n test = makeTest(test);\n if (!base) { base = exports.base; }\n try {\n (function c(node, st, override) {\n var type = override || node.type;\n if (node.start > pos || node.end < pos) { return }\n base[type](node, st, c);\n if (test(type, node)) { throw new Found(node, st) }\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n}", "function isPosterityNode(parent, child) {\n if (!isNode(parent) || !isNode(child)) {\n return false;\n }\n while (child.parentNode) {\n child = child.parentNode;\n if (child === parent) {\n return true;\n }\n }\n return false;\n }", "function updateIndex(parent){\r\n\t\tif((indexes = parent.querySelectorAll('.index')).length == 0) return false;\r\n\t\tfor(var i=0; i<indexes.length; i++)\tindexes[i].innerHTML = i+1;\r\n}", "function isLetInitable(node, parent) {\n return !t.isFor(parent) || !t.isFor(parent, { left: node });\n}", "function childIndex(child) {\n var elem = parentNode(child);\n var children = elem.childNodes;\n var len = children.length;\n for (var i = 0; i < len; i++) {\n if (children[i] === child) {\n return i;\n }\n }\n\n assert(false, 'not parent-child:', elem, child);\n}", "function checkNode(row, col, curr, checker, seen, counter) {\n if (row >= 0 && col >= 0 && row <= 9 && col <= 9) {\n let node = document.querySelector(`div[row=\"${row}\"][col=\"${col}\"]`);\n\n let cost = Math.min(\n parseInt(curr.getAttribute('cost')) +\n parseInt(node.getAttribute('weight')),\n node.getAttribute('cost')\n );\n\n if (cost < node.getAttribute('cost')) {\n node.setAttribute(\n 'parent',\n curr.getAttribute('row') + '|' + curr.getAttribute('col')\n );\n node.setAttribute('cost', cost);\n }\n\n changeColor(node, counter, cost);\n changeColor(curr, counter, false);\n\n if (!seen.includes(node)) {\n checker.push(node);\n }\n\n seen.push(node);\n\n return node;\n } else {\n return false;\n }\n}", "index(element) {\n return [].slice.call(this.node.childNodes).indexOf(element.node);\n }", "checkStructure() {\n let numRepr = 0;\n\n this.parents.forEach((parent, i) => {\n const rank = this.ranks[i];\n const size = this.sizes[i];\n const isRepr = parent === i;\n\n if (isRepr) {\n numRepr++;\n }\n\n const isParentInRange = 0 <= parent && parent < this.parents.length;\n const isReprRelevant = (isRepr || rank < this.ranks[parent]) &&\n (!isRepr && size === 0 || isRepr && size >= (1 << rank));\n const noAssertion = isParentInRange && isReprRelevant && 0 <= rank ;\n\n if (!noAssertion) {\n throw \"Assertion error\";\n }\n });\n\n if (!(0 <= this.numSets && this.numSets === numRepr && this.numSets <= this.parents.length)) {\n throw \"Assertion error\";\n }\n }", "function isPosterityNode(parent, child) {\n if (!isNode(parent) || !isNode(child)) {\n return false;\n }\n while (child.parentNode) {\n child = child.parentNode;\n if (child === parent) {\n return true;\n }\n }\n return false;\n }", "function enter(node, index, parents) {\n\t\n\tif (! query.is_type(node, 'expression')) return\n\tif (! query.is_type_value(node.value[0], 'symbol', 'else')) return\n\tif (! query.is_type_value(node.value[1], 'symbol', 'if')) return\n}", "function uunodehas(node, // @param Node: child node\r\n context) { // @param Node: context(parent) node\r\n // @return Boolean:\r\n for (var c = node; c && c !== context;) {\r\n c = c.parentNode;\r\n }\r\n return node !== context && c === context;\r\n}", "function isVisited(child_index) {\n cell = grid.children[child_index];\n search_image = cell.firstChild;\n return search_image.style.visibility == \"visible\";\n}", "function isChildOf(parent, child) { \r\n\r\n let node = child.parentNode; \r\n \r\n // keep iterating unless null \r\n while (node != null) { \r\n \tif (node == parent) { \r\n\r\n return true; \r\n } \r\n node = node.parentNode; \r\n } \r\n return false; \r\n}", "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 }", "function existsOne(test, nodes) {\n return nodes.some((checked) => node_isTag(checked) &&\n (test(checked) || existsOne(test, checked.children)));\n}", "function testFromBlock (node) {\n return {\n test: function(userBlock) {\n // Encode userBlock while ignoring child statements\n var userElement = Blockly.Xml.blockToDom_(userBlock, true);\n return elementsEquivalent(node, userElement);\n },\n blockDisplayXML: xml.serialize(node)\n };\n}", "function testIntegrityParent(){\n testIntegrity({\n pName:'IP2',\n chName:'ICH2',\n p_id:'ip2',\n ch_id:'ich2',\n relation:{\n description: 'ICH2 [parent] --> IP2.childIds [children]',\n opts:{\n maintainIntegrity: true,\n required: true,\n bulkRemove: false\n }\n },\n afterCreate: function(pDoc, cDoc){\n assert.ok('ich2' === cDoc.getData().id);\n assert.deepEqual(['ich2'], pDoc.getData().childIds);\n assert.ok('ip2' === pDoc.getData().id);\n },\n afterUpdate: function(err, cDoc){\n if(err) throw err;\n assert.ok(cDoc.parentId === 'fake_parent_id');\n },\n onRemove: function(parent, child, next){\n child.remove(function(err){\n if(err) throw err;\n \n parent.constructor.collection().findId(parent.id).one(function(err, pDoc){\n if(err) throw err;\n \n assert.ok(pDoc.childIds.length === 0);\n next();\n });\n \n });\n }\n },\n function(){\n console.log('relations integrity, key on Parent - OK');\n });\n}", "function assert (test, message, test_number) {\n if (!test) {\n console.log(test_number + \"false\")\n throw \"error:\" + message\n } \n console.log(test_number + \"true\")\n return true\n}", "function walkTree(tree) {\n if(tree.value === target) {\n result = true;\n }\n for(var i = 0; i < tree.children.length; i +=1) {\n walkTree(tree.children[i]);\n }\n return result;\n }", "function queueComponentIndexForCheck(previousOrParentTNode){ngDevMode&&assertEqual(getFirstTemplatePass(),true,'Should only be called in first template pass.');var tView=getLView()[TVIEW];(tView.components||(tView.components=[])).push(previousOrParentTNode.index);}", "function generateTree_TestCase(root, _testCase, YAHOO) {\r\n\ttry{\r\n\t\tvar testCaseName = _testCase[\"name\"];\r\n\t\tvar nodeTestCase = new YAHOO.widget.TextNode(testCaseName, root, false);\r\n\t\tfor(var propName in _testCase) {\r\n\t\t\t//ignore property _should \r\n\t\t\tif((propName != '_should') && (propName.indexOf('should') >= 0)){\r\n\t\t\t\t// add each test into tree by looking for the friendly name\r\n\t\t\t\tvar nodeTest = new YAHOO.widget.TextNode(propName, nodeTestCase, true);\r\n\t\t\t\t// The default status of the test node is set to checked\r\n\t\t\t\tnodeTest.highlightState = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// The default status of the testcase node is set to checked\r\n\t\tnodeTestCase.highlightState = 1;\r\n\t}\r\n\tcatch(err){\r\n\t\talert(err);\r\n\t}\r\n}", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }", "function topWalker(node, testFunc, lastParent) {\n while (node && node !== lastParent) {\n if (testFunc(node)) {\n return node;\n }\n node = node.parentNode;\n }\n }", "function check(index)\n\t{\n\t\tif(index < levels.length)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }", "function shouldExamineNode(n) {\n return !(ts.isBlock(n) || ts.isModuleBlock(n) || ts.isModuleDeclaration(n) ||\n ts.isSourceFile(n) || (n.parent && ts.isTypeNode(n.parent)) ||\n ts.isJSDoc(n) || isInStockLibraries(n));\n}", "sameParent(other) {\n return this.pos - this.parentOffset == other.pos - other.parentOffset;\n }", "function getActiveChildIndex(node) {\n\t\tvar i = 0;\n\t\twhile (node = node.previousElementSibling)\n\t\t\ti++;\n\t\treturn i;\n\t}", "function findInChildren(n, test) {\n let toExplore = [n];\n let cur;\n while (cur = toExplore.pop()) {\n if (test(cur)) {\n return true;\n }\n // Recurse\n toExplore = toExplore.concat(cur.getChildren());\n }\n return false;\n}", "function verifyPassed(item, index, list){\r\n\t\t\tif (list.length > 0 && list[index].innerHTML.localeCompare(\"passed\") != 0) {flag = false}\r\n\t\t}", "function UnaryLike(node, parent) {\n return t.isMemberExpression(parent) && parent.object === node;\n}", "function isLetInitable(node, parent) {\n\t return !t.isFor(parent) || !t.isFor(parent, { left: node });\n\t}", "function isLetInitable(node, parent) {\n\t return !t.isFor(parent) || !t.isFor(parent, { left: node });\n\t}", "function assert(test, test_number) {\n if (test) {\n console.log(test_number + \"false\");\n }\n else{\n\t console.log(test_number + \"true\");\n \treturn true;\n\t}\n}", "function inOrderTraversal(node) {}", "function isSub(index1, index2) {\r\n\tvar result = false;\r\n\tvar i = index1;\r\n\t\r\n\twhile (i != -1 && nodes[i].parentID != 'root' && result == false) {\r\n\t\tif(nodes[i].parentID==nodes[index2].id) result = true;\r\n\t\ti = getItemIndex(nodes[i].parentID);\t\t\r\n\t}\r\n\r\n\treturn result;\r\n}", "function nodeIndex(node) {\n let index = 0;\n for (index; index < boxs.length; index++) {\n if(node == boxs[index])\n break;\n }\n return index;\n}", "function testFor(parent, name, required, boolValue, prefixes, prefixFn) {\n if (parent && (name in parent)) {\n report.push([name, kGood, '(unprefixed)']);\n found[name] = boolValue ? true : parent[name];\n } else {\n for (var i = 0; i < prefixes.length; ++i) {\n var name2 = prefixFn(prefixes[i], name);\n if (parent && (name2 in parent)) {\n report.push([name, kInfo, prefixes[i]]);\n found[name] = boolValue ? true : parent[name2];\n break;\n }\n }\n if (i == prefixes.length) {\n report.push([name, required ? kBad : kInfo, '(not found)']);\n }\n }\n}", "function assertNodeDetails(convertedNode, jenkinsNode) {\n assert.equal(convertedNode.name, jenkinsNode.displayName, 'name');\n assert.equal(convertedNode.id, jenkinsNode.id, 'id');\n}", "trackNodeBy(index, node) {\n return node.id;\n }", "function isChildNode(parent, child) {\n if (!isNode(parent) || !isNode(child)) {\n return false;\n }\n return child.parentNode === parent;\n }", "function hasParent(node) {\n if (_.isEmpty(node.parentLink))\n return false;\n\n var link = node.parentLink;\n if (link.endsWith('workspace/vdbs'))\n return false;\n\n return true;\n }" ]
[ "0.5934694", "0.5916615", "0.5916615", "0.58997786", "0.57375354", "0.5579333", "0.55362296", "0.55297947", "0.55297947", "0.5520433", "0.54580474", "0.54539543", "0.5440975", "0.5426031", "0.5399161", "0.53722084", "0.53722084", "0.53722084", "0.5353079", "0.5337234", "0.530793", "0.52906346", "0.5274795", "0.5268149", "0.5259859", "0.52493286", "0.52250075", "0.52250075", "0.51997536", "0.5188321", "0.5176005", "0.5174025", "0.51385707", "0.51157117", "0.51114", "0.51058847", "0.5100472", "0.5098001", "0.5088385", "0.50727224", "0.5055242", "0.50292677", "0.50258726", "0.5012799", "0.49845278", "0.4984017", "0.49838752", "0.49828663", "0.49698505", "0.4959906", "0.4959906", "0.49469393", "0.49396107", "0.49367303", "0.49273673", "0.49100274", "0.4904065", "0.48942965", "0.48883817", "0.48762378", "0.48744515", "0.48700362", "0.4867267", "0.48654896", "0.48592076", "0.48377466", "0.48263484", "0.48157093", "0.48097947", "0.4807017", "0.480381", "0.4793383", "0.47809857", "0.47779366", "0.47779366", "0.47779366", "0.47779366", "0.47779366", "0.4777793", "0.47760758", "0.47717488", "0.47701997", "0.47596136", "0.47552067", "0.47549823", "0.47528565", "0.4751352", "0.47459537", "0.47459537", "0.4744671", "0.4743559", "0.4740117", "0.47387245", "0.47340208", "0.4732873", "0.47323716", "0.4724563", "0.4722712" ]
0.74535584
2
Utility assert each property in `test` is represented in `node`, and each values are strictly equal.
function matchesFactory(test) { return matches function matches(node) { var key for (key in test) { if (node[key] !== test[key]) { return false } } return true } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertObjectsEqual(actual, expected, testName) {\n // your code here\n var check = 0;\n if ( Object.keys(actual).length === Object.keys(expected).length) {\n for ( var key in actual ) {\n if( actual[key] === expected[key] ) {\n check ++;\n }\n }\n if( Object.keys(actual).length === check ) {\n console.log('passed');\n }\n }\n console.log('FAILED ' + testName + ' expected: ' + JSON.stringify(expected) + ' instead got ' + JSON.stringify(actual));\n}", "function createMultiplePropertyTest(testFunc) {\n return function (o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function createMultiplePropertyTest(testFunc) {\r\n return function(o, props) {\r\n var i = props.length;\r\n while (i--) {\r\n if (!testFunc(o, props[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n }", "function createMultiplePropertyTest(testFunc) {\r\n return function(o, props) {\r\n var i = props.length;\r\n while (i--) {\r\n if (!testFunc(o, props[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n }", "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function createMultiplePropertyTest(testFunc) {\n return function(o, props) {\n var i = props.length;\n while (i--) {\n if (!testFunc(o, props[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function everyNodeTheSame(nodes) {\n // This could potentially be made more performant by mapping every term\n // to their value and using native JS comparisons, assuming every node is\n // either a Blank or a Named Node.\n return nodes.every(otherNode => nodes.every(anotherNode => otherNode.equals(anotherNode)));\n }", "function check_equal(actual, expected, stack)\n {\n stack.push(actual);\n\n var p;\n for (p in actual)\n {\n assert(expected.hasOwnProperty(p), \"assert_object_equals\", description,\n \"unexpected property ${p}\", {p:p});\n\n if (typeof actual[p] === \"object\" && actual[p] !== null)\n {\n if (stack.indexOf(actual[p]) === -1)\n {\n check_equal(actual[p], expected[p], stack);\n }\n }\n else\n {\n assert(same_value(actual[p], expected[p]), \"assert_object_equals\", description,\n \"property ${p} expected ${expected} got ${actual}\",\n {p:p, expected:expected, actual:actual});\n }\n }\n for (p in expected)\n {\n assert(actual.hasOwnProperty(p),\n \"assert_object_equals\", description,\n \"expected property ${p} missing\", {p:p});\n }\n stack.pop();\n }", "function test_hasProperty_null (){ assertFalse( compare.hasProperty( null, 'a' ) ) }", "function areEqualNodes(node1, node2) {\n return node1.row === node2.row && node1.column === node2.column;\n}", "function check_equal(expected, actual, stack)\n {\n stack.push(actual);\n\n for (p in actual)\n {\n var message = make_message(\n \"assert_object_equals\", description,\n \"unexpected property ${p}\", {p:p});\n\n assert(expected.hasOwnProperty(p), message);\n\n if (typeof actual[p] === \"object\" && actual[p] !== null)\n {\n if (stack.indexOf(actual[p]) === -1)\n {\n check_equal(actual[p], expected[p], stack);\n }\n }\n else\n {\n message = make_message(\n \"assert_object_equals\", description,\n \"property ${p} expected ${expected} got ${actual}\",\n {p:p, expected:expected, actual:actual});\n\n assert(actual[p] === expected[p], message);\n }\n }\n for (p in expected)\n {\n var message = make_message(\n \"assert_object_equals\", description,\n \"expected property ${p} missing\", {p:p});\n\n assert(actual.hasOwnProperty(p), message);\n }\n stack.pop();\n }", "function validateNode(node) {\n return [\n node.type === \"AssignmentExpression\" && node.left.type === \"MemberExpression\"\n ];\n}", "areNodesEqual(nodeA, nodeB) {\n if (!nodeA && !nodeB) return true;\n if ((!nodeA && nodeB) || (nodeA && !nodeB)) return false;\n return (\n nodeA.key === nodeB.key &&\n nodeA.value === nodeB.value &&\n nodeA.isActive === nodeB.isActive\n );\n }", "function allSame(actual, expected){\n\t\tfor(var l = expected.length; l--;){\n\t\t\tassert.same(expected[l], actual[l]);\n\t\t}\n\t}", "function allSame(actual, expected){\n\t\tfor(var l = expected.length; l--;){\n\t\t\tassert.same(expected[l], actual[l]);\n\t\t}\n\t}", "deepEqual(a, b) {\n // If two \n if(a === b) {\n return true\n }; \n\n // Check for any condition that would cause args not to be equal\n if(a === null || b === null || typeof a != 'object' || typeof b != 'object') {\n return false\n };\n\n // Check for equality in number of properties and properties themselves\n var propsA = 0, \n propsB = 0;\n\n for(var prop in a) {\n propsA += 1;\n\n for (var prop in b) {\n propsB += 1;\n if (!(prop in a) || !this.deepEqual(a[prop], b[prop])) {\n return false;\n }\n }\n }\n\n return propsInA == propsInB;\n }", "function allFactory(test) {\n return all\n\n function all(node) {\n var key;\n\n for (key in test) {\n if (node[key] !== test[key]) return false\n }\n\n return true\n }\n}", "function allFactory(test) {\n return all\n\n function all(node) {\n var key\n\n for (key in test) {\n if (node[key] !== test[key]) return false\n }\n\n return true\n }\n}", "function allFactory(test) {\n return all\n\n function all(node) {\n var key\n\n for (key in test) {\n if (node[key] !== test[key]) return false\n }\n\n return true\n }\n}", "function allFactory(test) {\n return all\n\n function all(node) {\n var key\n\n for (key in test) {\n if (node[key] !== test[key]) return false\n }\n\n return true\n }\n}", "function do_check_property(aTest, aURI, aPropertyName, aTestFunctor) {\n\n if (aTest[aPropertyName]) {\n var comp;\n var expectedVal = aTestFunctor\n ? aTestFunctor(aTest[aPropertyName])\n : aTest[aPropertyName];\n \n try {\n comp=aURI[aPropertyName];\n } catch(e) {\n var url=aTest.relativeURI ? (aTest.spec +\"<\"+aTest.relativeURI) : aTest.spec;\n dump(\"\\n{\\\"url\\\":\\\"\"+url+\"\\\", \\\"error\\\":{\\\"component\\\":\\\"\"+aPropertyName+\"\\\", \\\"expected\\\":\\\"\"+expectedVal +\"\\\", \\\"actual\\\":\\\"\"+e.name+\" \" + e.result+\"\\\"}}\"); \n do_throw(e.result);\n }\n\n if (aURI[aPropertyName] != expectedVal){ //needed to display custom format, adding assertion message spams output\n var url=aTest.relativeURI ? (aTest.spec +\"<\"+aTest.relativeURI) : aTest.spec;\n dump(\"\\n{\\\"url\\\":\\\"\"+ url+\"\\\", \\\"error\\\":{\\\"component\\\":\\\"\"+aPropertyName+\"\\\", \\\"expected\\\":\\\"\"+expectedVal +\"\\\", \\\"actual\\\":\\\"\"+aURI[aPropertyName]+\"\\\"}}\"); \n do_throw(\"componens do not match\");\n }\n\n Assert.equal(aURI[aPropertyName], expectedVal);\n\n }\n}", "function assertEquivalentNodes(previousNodes, nodes) {\n if (previousNodes.length !== nodes.length) {\n throw new Error('The number of i18n message children changed between first and second pass.');\n }\n if (previousNodes.some((node, i) => nodes[i].constructor !== node.constructor)) {\n throw new Error('The types of the i18n message children changed between first and second pass.');\n }\n}", "function assertEquivalentNodes(previousNodes, nodes) {\n if (previousNodes.length !== nodes.length) {\n throw new Error('The number of i18n message children changed between first and second pass.');\n }\n if (previousNodes.some((node, i) => nodes[i].constructor !== node.constructor)) {\n throw new Error('The types of the i18n message children changed between first and second pass.');\n }\n}", "function assertEquivalentNodes(previousNodes, nodes) {\n if (previousNodes.length !== nodes.length) {\n throw new Error('The number of i18n message children changed between first and second pass.');\n }\n\n if (previousNodes.some(function (node, i) {\n return nodes[i].constructor !== node.constructor;\n })) {\n throw new Error('The types of the i18n message children changed between first and second pass.');\n }\n}", "function validate (objectNodes = {} ) {\n\n //keys of each\n return Object.keys(objectNodes).length === 1\n\n\n}", "function nodeTest(assert) { \n let name = nodeStore.address[assert.loc.toString()].name; \n let index = nodeStore.address[assert.loc.toString()].index; \n let result = `${oneSpace}expect(wrapper.find('${name}').at(${index}).props().${assert.property}).`;\n result += evalTest(assert); \n return result;\n}", "function arePropertiesEqual(p1, p2) {\n if (Array.isArray(p1) && Array.isArray(p2)) {\n if (p1.length != p2.length) {\n return false;\n }\n\n for (var i = 0; i < p1.length; i++) {\n var found = false;\n for (var j = 0; j < p2.length; j++) {\n if (arePropertiesEqual(p1[i], p2[j])) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n return false;\n }\n }\n\n return true;\n }\n else if (typeof p1 == 'object' && typeof p2 == 'object') {\n var areEqual = (p1 != null);\n if (areEqual) {\n radiant.each(p1, function (k, v) {\n if (!areEqual) {\n return;\n }\n areEqual = arePropertiesEqual(v, p2 && p2[k]);\n });\n }\n\n return areEqual;\n }\n\n return p1 == p2;\n}", "function test_props_all( prop, callback ) {\n \n var uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),\n props = (prop + ' ' + domPrefixes.join(uc_prop + ' ') + uc_prop).split(' ');\n\n return !!test_props( props, callback );\n }", "function assertEquals(obj1, obj2) {\n checkEquals(obj1, obj2, \"(top)\");\n\n function checkEquals(obj1, obj2, objName) {\n var t1 = typeFunctions.type(obj1);\n var t2 = typeFunctions.type(obj2);\n\n if (t1 != t2) {\n throw new Exception(\"at \" + objName + \" \" + t1 + \" .vs. \" + t2);\n }\n switch (t1) {\n case \"object\":\n for (var name in obj1) {\n if (hasValue(obj1[name]) && !hasValue(obj2[name])) {\n throw new Exception(name + \".\" + namet1 + \" .is missing\");\n }\n }\n for (var name in obj2) {\n if (hasValue(obj2[name]) && !hasValue(obj1[name])) {\n throw new Exception(name + \".\" + namet1 + \" .is missing\");\n }\n checkEquals(obj1[name], obj2[name], objName + \".\" + name);\n }\n break;\n\n case 'array':\n if (obj1.length != obj2.length) {\n throw new Exception(\"different array lengths at \" + objName);\n }\n obj1.forEach(function(row, index) {\n checkEquals(row, obj2[index], objName + \"[\" + index + \"]\");\n })\n break;\n\n default:\n if (obj1 != obj2) {\n throw new Exception(\"at \" + objName + \" \" + obj1 + \" .vs. \" + obj2);\n }\n break;\n }\n }\n}", "function t1() {\n function testRange(start, end) {\n let arr = [];\n\n for (i = start; i < end; i++) {\n arr[i] = i;\n }\n\n let obj = { ...arr\n };\n end - start === Object.keys(obj).length;\n\n for (var propName in obj) {\n propValue = obj[propName];\n propName === propValue.toString();\n }\n }\n\n ;\n testRange(2 ** 31 - 100, 2 ** 31 + 100);\n testRange(2 ** 32 - 100, 2 ** 32 + 100);\n}", "function assertSimilar(actual, expected, message) {\n assertOk(JSON.stringify(actual) === JSON.stringify(expected), message);\n }", "function testGetNodes() {\r\n\tvar testStencilSet = new ORYX.Core.StencilSet.StencilSet(\"TestStencilSet\")\r\n\r\n\tvar nodes = testStencilSet.nodes()\r\n\r\n\t// SequenceFlow is the only edge in this stencil set\r\n\tvar nodeStencils = testStencilSet._availableStencils\r\n\tnodeStencils.remove('http://b3mn.org/stencilset/testB#SequenceFlow')\r\n\r\n\tassertEquals(\"Both sets should have the same quantity.\", nodes.size(), nodeStencils.size())\r\n\r\n\tnodes.each(function(nodeA) {\r\n\t\t\t\tvar node = nodeStencils.find(function(nodeB) {\r\n\t\t\t\t\t\t\treturn nodeA == nodeB.value\r\n\t\t\t\t\t\t})\r\n\t\t\t\tassertNotUndefined(\"The node should exist.\", node)\r\n\t\t\t\tdelete node\r\n\t\t\t})\r\n}", "function nodesEqualOnto(node1,node2){\n node1.each(function(d){\n node2.each(function(d1){\n return d.index==d1.index;\n });\n });\n}", "function deepEqual(x, y){\n //console.log('x '+x+'y '+y);\n//if x equals y in value and typeof then return true\n if(x===y){\n return true;\n//if x and y are both objects then\n }else if (typeof(x)===\"object\" && typeof(y)===\"object\"){\n // x = {here: \"an\", abhi: \"neely\"}\n // y = {here: \"an\", abhi: \"neely\"}\n//for loop through the properties and values of x and y (property names and values should be the same if they are equal)\n for(var key in x) {\n x_value = x[key];\n y_value = y[key];\n //console.log('xvalue '+x_value +'yvalue '+ y_value);\n////recursive function to see if the values inside the object are objects and equal and will return true and false\n return deepEqual(x_value, y_value);\n }\n } else {\n return false;\n }\n}", "function equal(expected, actual, _errors, _path) {\t\n\tvar errors = _errors || [];\n\tvar initialErrors = errors.length;\n\tvar path = _path || [\"root\"];\n\tif(typeof path == 'string')\n\t path = [path];\n\tfunction getPathString(path) {\n\t\tvar pathString = \"\";\n\t\tfor(var i=0; i<path.length; i++) {\n\t\t\tpathString += path[i];\n\t\t}\n\t\treturn pathString;\n\t}\n\t\n\tif(typeof expected != typeof actual) {\n\t\terrors.push(\"Actual type '\"+typeof actual+\"' doesn't match expected type '\"+typeof expected+\"' at \"+getPathString(path));\n\t}\t\n\tif(expected instanceof Array) {\n\t\tif(expected.length!=actual.length)\n\t\t\terrors.push(\"Actual array has length: \"+actual.length+\" but expected length is: \"+expected.length+\" at \"+getPathString(path));\n\t\telse {\n\t\t\tfor(var i=0; i<expected.length; i++) {\n\t\t\t\tpath.push(\"[\"+i+\"]\");\n\t\t\t\tequal(expected[i], actual[i], errors, path);\n\t\t\t\tpath.pop();\n\t\t\t}\n\t\t}\n\t}\n\telse if(typeof expected=='object') {\n\t\tfor(var p in expected) {\n\t\t\tpath.push(\".\"+p);\n\t\t\tif(actual.hasOwnProperty(p))\n\t\t\t\tequal(expected[p], actual[p], errors, path);\n\t\t\telse {\n\t\t\t \terrors.push(\"Object is missing expected property '\"+p+\"' at \"+getPathString(path));\n\t\t\t}\n\t\t\tpath.pop();\n\t\t}\n\t}\n\telse if(expected!==actual) {\n\t\terrors.push(\"Actual value (\"+actual+\") doesn't match expected value (\"+expected+\") at \"+getPathString(path));\n\t}\n\treturn !errors.length>initialErrors;\n}", "function checkNode(node, prefix) {\n if (node instanceof Bucket) {\n var contacts = node.obtain();\n for (var i = 0; i < contacts.length; ++i) {\n for (var j = 0; j < prefix.length; ++j) {\n contacts[i].id.at(j).should.equal(prefix[j]);\n }\n }\n } else {\n checkNode(node.left, prefix.concat(false));\n checkNode(node.right, prefix.concat(true));\n }\n}", "function checkUniformDistribution(pg: PagerankGraph) {\n const nodes = Array.from(pg.nodes());\n for (const {score} of nodes) {\n expect(score).toEqual(1 / nodes.length);\n }\n }", "function assertEquals(p1,p2){\nif (p1===p2)\n\t// return true\n\nconsole.log(\"Ok\");\nelse {\n\tconsole.log( \"the two values are not the same:\")\n\tconsole.log( \"p1-->\", p1)\n\tconsole.log( \"p2-->\", p2)\n}\n\n}", "function assertNodeDetails(convertedNode, jenkinsNode) {\n assert.equal(convertedNode.name, jenkinsNode.displayName, 'name');\n assert.equal(convertedNode.id, jenkinsNode.id, 'id');\n}", "function childrenEquivalent(expected, given) {\n var children1 = expected.childNodes;\n var children2 = given.childNodes;\n if (children1.length !== children2.length) {\n return false;\n }\n for (var i = 0; i < children1.length; i++) {\n if (!elementsEquivalent(children1[i], children2[i])) {\n return false;\n }\n }\n return true;\n}", "function ancestoryTest(node1, node2) {\n var tmp = node1;\n while (tmp) {\n if (tmp === node2) return true;\n tmp = tmp.parent;\n }\n tmp = node2;\n while (tmp) {\n if (tmp === node1) return true;\n tmp = tmp.parent;\n }\n return false;\n }", "function testItem(item, allPropertiesRequireds) {\n const prepareToPropTest = Object.entries(allPropertiesRequireds);\n return prepareToPropTest.every(singleRequire => {\n const propertyNameInJSON = singleRequire[0];\n const singlePropValueRequired = singleRequire[1];\n if(singlePropValueRequired === '') return true; // pass if input field is blank\n const singlePropValue = item[propertyNameInJSON];\n return testSinglePropertyOfItem(singlePropValue, singlePropValueRequired);\n });\n}", "function getAssertPropsHas(data, path, control){\n\t\texpect(data, 'given data array is empty!').to.be.an('array').that.has.lengthOf.above(0);\n\t\t\n\t\tlet props = utils.get(data, path);\n\t\t// log(`${__line()} '${path}' gathered properties: `, props);\n\t\t\n\t\texpect(props, chalk`\\n'${path}' props isn't an array or it is empty! \\n{green.italic (the given path could be wrong and not getting the expected properties or the actual records don't exist. check path and fixtures.)}\\nGiven data: \\n${data}\\n`).to.be.an('array').that.has.lengthOf.above(0);\n\n\t\t// go thru each one\n\t\tfor (let prop of props){\n\t\t\t\tif (control) {\n\t\t\t\t\t\t// prop should be same as the control\n\t\t\t\t\t\texpect(prop, `'${path}' property ${prop} isn't equal to ${control}!`).to.be.equal(control);\n\t\t\t\t} else {\n\t\t\t\t\t\texpect(prop, `'${path}' property ${prop} isn't ok!`).to.be.ok;\n\t\t\t\t}\n\t\t}\n}", "function assertEquals (p1,p2){\n if (p1 === p2){\n console.log(\"ok->\" + p1);\n return true;\n }\n console.log(\"The two values are not the same.\" );\n console.log(\"p1--> \" + p1);\n console.log(\"p2--> \" + p2);\n return false;\n}", "function deepEqual(el1, el2)\n{\n if ((typeof el1) == (typeof el2))\n {\n if ((typeof el1) === 'object')\n {\n if ((el1 == null) && (el2 == null))\n {\n console.log(\"Both null\");\n return true;\n }\n else\n {\n //compares number of properties from each object\n if (Object.keys(el1).length != Object.keys(el2).length)\n {\n return false;\n }\n\n var match = true;\n for (var elem in el1)\n {\n //makes sure that the property is from object, not from prototype\n if (el1.hasOwnProperty(elem) && (el2[elem] != undefined))\n {\n if (el1[elem] != el2[elem])\n {\n match = false;\n }\n }\n }\n return match;\n }\n }\n else\n {\n return el1 === el2;\n }\n }\n else\n {\n console.log(\"Not the same type\");\n return false;\n }\n}", "matches(element, props) {\n for (var key in props) {\n if (key === 'children') {\n continue;\n }\n\n if (element[key] !== props[key]) {\n return false;\n }\n }\n\n return true;\n }", "matches(element, props) {\n for (var key in props) {\n if (key === 'children') {\n continue;\n }\n\n if (element[key] !== props[key]) {\n return false;\n }\n }\n\n return true;\n }", "assertEqual(expected, actual)\n {\n Tester.valid(expected, 'mixed')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (\n Tester.is(expected, 'object') &&\n Tester.is(actual, 'object') ||\n Tester.is(expected, 'array') &&\n Tester.is(actual, 'array')\n ) {\n expected = JSON.stringify(Object.keys(expected).sort())\n actual = JSON.stringify(Object.keys(actual).sort())\n } else if (\n Tester.is(expected, 'function') &&\n Tester.is(actual, 'function') ||\n Tester.is(expected, 'regexp') &&\n Tester.is(actual, 'regexp')\n ) {\n expected = expected.toString()\n actual = actual.toString()\n }\n\n if (expected != actual) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function check(actual, expected) {\n assertEq(actual.length, expected.length);\n for (var i = 0; i < expected.length; i++)\n assertEq(actual[i], expected[i]);\n}", "function assert_style_value_array_equals(a, b) {\n assert_equals(a.length, b.length);\n for (let i = 0; i < a.length; i++) {\n assert_style_value_equals(a[i], b[i]);\n }\n}", "function assertEqualParsed(assert, testName, actual, expectedNumber, expectedEndOffset) {\n var expected = {\n number: expectedNumber,\n endOffset: expectedEndOffset\n };\n \n assert.deepEqual(actual, expected, testName);\n}", "checkAllNodesFullfillCondition (test) {\n if (!Object.prototype.hasOwnProperty.call(this, 'key')) return\n\n test(this.key, this.data)\n if (this.left) this.left.checkAllNodesFullfillCondition(test)\n if (this.right) this.right.checkAllNodesFullfillCondition(test)\n }", "function assertStatusCounts(t, actual, expected) {\n var keys = _.union(_.keys(actual), _.keys(expected));\n var failed = false;\n _.each(keys, function (status) {\n t.equal(actual[status] || 0, expected[status] || 0, 'check number of ' + status + ' nodes');\n failed |= (actual[status] || 0) !== (expected[status] || 0);\n });\n\n return !failed;\n}", "function compare(expected, result){\n for(var key in expected){\n if(expected.hasOwnProperty(key)){\n if(!result.hasOwnProperty(key) || result[key] !== expected[key]){ \n return false;\n }\n }\n }\n return true;\n}", "function shallowEqual(actual, expected) {\n var keys = Object.keys(expected);\n\n var _arr2 = keys;\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var key = _arr2[_i2];\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}", "function equalOwnProperties(left, right, equalityComparer) {\n if (left === right)\n return true;\n if (!left || !right)\n return false;\n for (var key in left)\n if (hasOwnProperty.call(left, key)) {\n if (!hasOwnProperty.call(right, key) === undefined)\n return false;\n if (equalityComparer ? !equalityComparer(left[key], right[key]) : left[key] !== right[key])\n return false;\n }\n for (var key in right)\n if (hasOwnProperty.call(right, key)) {\n if (!hasOwnProperty.call(left, key))\n return false;\n }\n return true;\n }", "function assert_r(obj, exp, detectExtraKeys) {\r\n\tif(detectExtraKeys)\r\n\t\tdetect_extra_keys(obj, exp);\r\n\tfor (var prop in exp)\r\n\t\tif ( typeOf(exp[prop]) == \"object\" )\r\n\t\t\tassert_r(obj[prop], exp[prop], detectExtraKeys);\r\n\t\telse {\r\n\t\t\tvar passed = false;\r\n\t\t\tvar funResult = null;\r\n\t\t\t\r\n\t\t\tif ( typeOf(exp[prop]) == \"function\" ) { \r\n\t\t\t\t/* If exp[prop] is a function, then get the object\r\n\t\t\t\t\treturned from that function. */\r\n\t\t\t\tfunResult = exp[prop](obj[prop]);\r\n\t\t\t\tpassed = funResult.success;\r\n\t\t } else if ( typeOf(exp[prop]) == \"array\" ) {\r\n\t\t \t/* If exp[prop] is an array, then assert each object in that array\r\n\t\t \t\tTODO: Make it work for arrays that contain primitive values (none currently defined in spec) */\r\n\t\t\t\tfor(var i = 0; i < exp[prop].length; i++) \r\n\t\t\t\t\tassert_r(obj[prop][i], exp[prop][i], detectExtraKeys);\r\n\t\t\t\tpassed = true;\r\n\t\t\t} else \r\n\t\t\t\tpassed = obj[prop] == exp[prop];\t\t\t\t\t\r\n\t\t\tif(!passed) {\r\n\t\t\t\ttestPassed = false;\r\n\t\t\t\tvar expectedVal = (funResult) ? funResult.msg : exp[prop];\r\n\t\t\t\tfailures.push(\"\\t\\t\"+prop + \": Expected \" +expectedVal+ \", got \" +obj[prop]+ \"\\n\");\r\n\t\t\t}\r\n\t\t}\r\n}", "function deepEqual(a,b) \n{\n//two inputs ob ojects\n\tif (a === b) return true; //this is true when these share same value prop.\n\tif (a == null || typeof a !=\"object\" || b == null || typeof b !=\"object\" ) //Null =/ null\n\t\treturn false; //this checks if they dont equal\n\n\tvar a_count = 0, b_count = 0; //counters for loop iteration\n\tfor(var properties in a)\n\t\ta_count++;\n\tfor( var properties in b) \n\t{\n\t\tb_count++;\n\t\n\tif(!(properties in a) || !deepEqual(a[properties], b[properties]))\n\t\treturn false;\n\t}\nreturn a_count === b_count;\n}", "function deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (typeof Buffer !== \"undefined\" && Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {\n if (actual.length !== expected.length) {\n return false;\n }\n for (var i = 0; i < actual.length; i++) {\n if (actual[i] !== expected[i]) {\n return false;\n }\n }\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (isString(actual) && isString(expected) && actual !== expected) {\n return false;\n } else if (typeof actual !== 'object' && typeof expected !== 'object') {\n return actual === expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n }", "function deepEqual(value1, value2) {\n if (value1 === value2) {\n return true;\n }\n if (value1 == null || typeof value1 != \"object\" ||\n value2 == null || typeof value2 != \"object\") {\n return false;\n }\n // The Object.keys() method returns an array of a given object's own property names, in the same order as we get with a normal loop. Example below:\n // const object1 = {\n // a: 'somestring',\n // b: 42,\n // c: false\n // };\n\n // console.log(Object.keys(object1));\n // expected output: Array [\"a\", \"b\", \"c\"]\n // basically runs a for loop thru each object and creates an array of those values\n let keysA = Object.keys(value1);\n let keysB = Object.keys(value2);\n\n if (keysA.length != keysB.length) {\n return false;\n }\n\n for (let key of keysA) {\n if (!keysB.includes(key) || !deepEqual(value1[key], value2[key])) {\n return false;\n }\n }\n \n return true;\n}", "function equalProp(obj1,obj2) {\n if (Object.keys(obj1).length === Object.keys(obj2).length) {\n for (let prop in obj1) {\n if (!obj2.hasOwnProperty(prop) || !areEqual(obj1[prop],obj2[prop])) return false;\n }\n return true;\n } else {\n return false;\n }\n}", "function shallowEqual(actual, expected) {\n\t var keys = Object.keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var key = _arr2[_i2];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function shallowEqual(actual, expected) {\n\t var keys = Object.keys(expected);\n\n\t var _arr2 = keys;\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var key = _arr2[_i2];\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function shallowEqual(actual, expected) {\n\t var keys = _Object$keys(expected);\n\n\t for (var _iterator3 = keys, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {\n\t var _ref3;\n\n\t if (_isArray3) {\n\t if (_i3 >= _iterator3.length) break;\n\t _ref3 = _iterator3[_i3++];\n\t } else {\n\t _i3 = _iterator3.next();\n\t if (_i3.done) break;\n\t _ref3 = _i3.value;\n\t }\n\n\t var key = _ref3;\n\n\t if (actual[key] !== expected[key]) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function getAssertPropsContains(data, path, control){\n\t\texpect(data, 'given data array is empty!').to.be.an('array').that.has.lengthOf.above(0);\n\t\t\n\t\tlet props = utils.get(data, path);\n\t\t// log(`${__line()} '${path}' gathered properties: `, props);\n\t\t\n\t\texpect(props, chalk`\\n'${path}' props isn't an array or it is empty! \\n{green.italic (the given path could be wrong and not getting the expected properties or the actual records don't exist. check path and fixtures.)}\\nGiven data: \\n${nodeUtil.format(data)}\\n`).to.be.an('array').that.has.lengthOf.above(0);\n\n\t\t// go thru each one\n\t\tfor (let prop of props){\n\t\t\t\tif (control) {\n\t\t\t\t\t\t// prop should be same as the control\n\t\t\t\t\t\texpect(prop, `'${path}' property ${prop} doesn't contain ${control}!`).to.contain(control);\n\t\t\t\t} else {\n\t\t\t\t\t\texpect(prop, `'${path}' property ${prop} isn't ok!`).to.be.ok;\n\t\t\t\t}\n\t\t}\n}", "checkStructure() {\n let numRepr = 0;\n\n this.parents.forEach((parent, i) => {\n const rank = this.ranks[i];\n const size = this.sizes[i];\n const isRepr = parent === i;\n\n if (isRepr) {\n numRepr++;\n }\n\n const isParentInRange = 0 <= parent && parent < this.parents.length;\n const isReprRelevant = (isRepr || rank < this.ranks[parent]) &&\n (!isRepr && size === 0 || isRepr && size >= (1 << rank));\n const noAssertion = isParentInRange && isReprRelevant && 0 <= rank ;\n\n if (!noAssertion) {\n throw \"Assertion error\";\n }\n });\n\n if (!(0 <= this.numSets && this.numSets === numRepr && this.numSets <= this.parents.length)) {\n throw \"Assertion error\";\n }\n }", "function assert_style_value_equals(a, b) {\n if (a == null || b == null) {\n assert_equals(a, b);\n return;\n }\n\n assert_equals(a.constructor.name, b.constructor.name);\n const className = a.constructor.name;\n switch (className) {\n case 'CSSStyleValue':\n assert_equals(a.toString(), b.toString());\n break;\n case 'CSSKeywordValue':\n assert_equals(a.value, b.value);\n break;\n case 'CSSUnitValue':\n assert_approx_equals(a.value, b.value, 1e-6);\n assert_equals(a.unit, b.unit);\n break;\n case 'CSSMathSum':\n case 'CSSMathProduct':\n case 'CSSMathMin':\n case 'CSSMathMax':\n assert_style_value_array_equals(a.values, b.values);\n break;\n case 'CSSMathClamp':\n assert_style_value_equals(a.lower, b.lower);\n assert_style_value_equals(a.value, b.value);\n assert_style_value_equals(a.upper, b.upper);\n break;\n case 'CSSMathInvert':\n case 'CSSMathNegate':\n assert_style_value_equals(a.value, b.value);\n break;\n case 'CSSUnparsedValue':\n assert_style_value_array_equals(a, b);\n break;\n case 'CSSVariableReferenceValue':\n assert_equals(a.variable, b.variable);\n assert_style_value_equals(a.fallback, b.fallback);\n break;\n case 'CSSTransformValue':\n assert_style_value_array_equals(a, b);\n break;\n case 'CSSRotate':\n assert_style_value_equals(a.angle, b.angle);\n // fallthrough\n case 'CSSTranslate':\n case 'CSSScale':\n assert_style_value_equals(a.x, b.x);\n assert_style_value_equals(a.y, b.y);\n assert_style_value_equals(a.z, b.z);\n assert_style_value_equals(a.is2D, b.is2D);\n break;\n case 'CSSSkew':\n assert_style_value_equals(a.ax, b.ax);\n assert_style_value_equals(a.ay, b.ay);\n break;\n case 'CSSSkewX':\n assert_style_value_equals(a.ax, b.ax);\n break;\n case 'CSSSkewY':\n assert_style_value_equals(a.ay, b.ay);\n break;\n case 'CSSPerspective':\n assert_style_value_equals(a.length, b.length);\n break;\n case 'CSSMatrixComponent':\n assert_matrix_approx_equals(a.matrix, b.matrix, 1e-6);\n break;\n default:\n assert_equals(a, b);\n break;\n }\n}", "function verifyMembers(t, sess, addresses, tests, parent, next) {\n const arr = Object.keys(addresses);\n\n function verifyProperty(t, sess, addresses, index, subIndex) {\n if (index >= arr.length) {\n return next(t, sess);\n }\n\n const name = arr[index];\n const test = tests[name];\n // We are in the middle of in test.validators\n if (subIndex !== undefined) {\n const validators = test.validators;\n if (subIndex >= validators.length) {\n return verifyProperty(t, sess, addresses, index + 1);\n }\n validators[subIndex](t, sess, addresses, name, (err) => {\n t.error(err, `${parent}${test.desc} validator #${subIndex} should complete`);\n verifyProperty(t, sess, addresses, index, subIndex + 1);\n });\n return;\n }\n\n if (test.validator) { // Single validator\n test.validator(t, sess, addresses, name, (err) => {\n t.error(err, `${parent}${test.desc} validator should complete`);\n verifyProperty(t, sess, addresses, index + 1);\n });\n } else if (test.validators) { // Multiple validator\n verifyProperty(t, sess, addresses, index, 0);\n } else { // No validator\n verifyProperty(t, sess, addresses, index + 1);\n }\n }\n\n // Kickoff\n verifyProperty(t, sess, addresses, 0);\n}", "function testEqualStencilSets() {\r\n\tvar testStencilSet1 = new ORYX.Core.StencilSet.StencilSet(\"StencilSetWithoutRoot\")\r\n\tvar testStencilSet2 = new ORYX.Core.StencilSet.StencilSet(\"StencilSetWithoutRoot\")\r\n\tassertTrue(\"The two stencil sets should be equal.\", testStencilSet1\r\n\t\t\t\t\t.equals(testStencilSet2))\r\n}", "function assertAllTokensDifferent(tokens) {\n var length = tokens.length;\n var j, k;\n ok(tokens.length > 0);\n\n // compare all tokens\n for (j = 0; j < length; j++)\n for (k = j + 1; k < length; k++)\n ok(tokens[j] !== tokens[k]);\n\n equal(j, length);\n equal(k, length);\n }", "function hasSameProperties(a, b) {\n var aProps = Object.getOwnPropertyNames(a);\n var bProps = Object.getOwnPropertyNames(b);\n if (aProps.length !== bProps.length) {\n return false;\n }\n for (var i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n if (a[propName] !== b[propName]) {\n return false;\n }\n }\n return true;\n}", "function hasSameProperties(a, b) {\n var aProps = Object.getOwnPropertyNames(a);\n var bProps = Object.getOwnPropertyNames(b);\n if (aProps.length !== bProps.length) {\n return false;\n }\n for (var i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n if (a[propName] !== b[propName]) {\n return false;\n }\n }\n return true;\n}", "function compare (matches, urls) {\n matches = matches.map(({ node, propertyName, url }) =>\n ({ tag: node.tagName, prop: propertyName, url })\n );\n\n try {\n expect(matches).to.have.lengthOf(urls.length);\n for (let [index, match] of matches.entries()) {\n let url = urls[index];\n expect(match.tag).to.equal(url.tag);\n expect(match.prop).to.equal(url.prop);\n expect(match.url).to.equal(url.url);\n }\n }\n catch (error) {\n let message = error.message + \"\\n\\n\";\n\n for (let i = 0; i < Math.max(matches.length, urls.length); i++) {\n let actual = format(matches[i]);\n let expected = format(urls[i]);\n\n if (actual === expected) {\n message += `✔ ${expected}\\n`;\n }\n else {\n message +=\n `\\n❌ Expected: ${expected}\\n` +\n ` Actual: ${actual}\\n\\n`;\n }\n }\n\n throw new Error(message);\n }\n}", "function verifyGraph(graph) {\n const nodes = new Set(Object.keys(graph));\n for (const [node, edges] of Object.entries(graph)) {\n for (const edge of edges) {\n if (!nodes.has(edge)) {\n throw new Error(\n `Graph edge ${edge} of node ${node} not found in the graph`);\n }\n }\n }\n}", "function assertEqualsOneOf(actual, ...expected) {\n assert(expected.length > 0)\n for (let i = 0; i < expected.length; i++) {\n try {\n assert.deepStrictEqual(actual, expected[i])\n return // if we get here without an exception, that means success\n } catch (e) {\n if (!e.name.match(/^AssertionError/) || i === expected.length - 1) throw e\n }\n }\n}", "function shallowEqual(actual, expected) {\n var keys = _Object$keys(expected);\n\n var _arr2 = keys;\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var key = _arr2[_i3];\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}", "function equalStyle(a, b) {\n var keys = []\n for (var key in a) {\n if (\"\" + parseInt(key, 10) === key) {\n continue\n } else {\n keys.push(key)\n }\n }\n\n keys.sort()\n\n for (var i = 0; i < keys.length; i++) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}", "function allEqual(args) {\n for (var i = 1; i < args.length; i++) {\n if (args[i] != args[0])\n return false;\n }\n return true;\n}", "function assertEquals(a,b) {\n\tif (a === b) {\n\t\treturn true;\n\t} \n\t\n\tconsole.log(\"***the two values are not the same\", \"\\n p1-->\"+a, \"\\n p2-->\" +b);\n\treturn false;\n\n}", "function run_test() {\n const checks =\n [\n { addrs: \"[email protected]\",\n otherAddrs: \"\",\n expectedResult: \"[email protected]\" },\n { addrs: \"foo bar <[email protected]>\",\n otherAddrs: \"\",\n expectedResult: \"foo bar <[email protected]>\" },\n { addrs: \"foo bar <[email protected]>, [email protected]\",\n otherAddrs: \"\",\n expectedResult: \"foo bar <[email protected]>, [email protected]\" },\n { addrs: \"foo bar <[email protected]>, [email protected], test <[email protected]>\",\n otherAddrs: \"\",\n expectedResult: \"foo bar <[email protected]>, [email protected]\" },\n { addrs: \"foo bar <[email protected]>\",\n otherAddrs: \"[email protected]\",\n expectedResult: \"foo bar <[email protected]>\" },\n { addrs: \"foo bar <[email protected]>\",\n otherAddrs: \"foo bar <[email protected]>\",\n expectedResult: null },\n { addrs: \"foo bar <[email protected]>, [email protected]\",\n otherAddrs: \"foo bar <[email protected]>\",\n expectedResult: \"[email protected]\" },\n { addrs: \"foo bar <[email protected]>, [email protected]\",\n otherAddrs: \"[email protected]\",\n expectedResult: \"foo bar <[email protected]>\" },\n { addrs: \"foo bar <[email protected]>, [email protected], test <[email protected]>\",\n otherAddrs: \"[email protected]\",\n expectedResult: \"foo bar <[email protected]>\" },\n // UTF-8 names\n { addrs: \"foo\\u00D0 bar <[email protected]>, \\u00F6foo <[email protected]>\",\n otherAddrs: \"\",\n expectedResult: \"foo\\u00D0 bar <[email protected]>, \\u00F6foo <[email protected]>\" },\n { addrs: \"foo\\u00D0 bar <[email protected]>, \\u00F6foo <[email protected]>\",\n otherAddrs: \"foo\\u00D0 bar <[email protected]>\",\n expectedResult: \"\\u00F6foo <[email protected]>\" },\n { addrs: \"foo\\u00D0 bar <[email protected]>, \\u00F6foo <[email protected]>, foo\\u00D0 bar <[email protected]>\",\n otherAddrs: \"\\u00F6foo <[email protected]>\",\n expectedResult: \"foo\\u00D0 bar <[email protected]>\" }\n ];\n\n // Test - empty strings\n\n var parser = Components.classes[\"@mozilla.org/messenger/headerparser;1\"]\n .getService(Components.interfaces.nsIMsgHeaderParser);\n\n do_check_eq(parser.removeDuplicateAddresses(\"\", \"\"), \"\");\n do_check_eq(parser.removeDuplicateAddresses(\"\", \"[email protected]\"), \"\");\n\n // Test - removeDuplicateAddresses\n\n for (let i = 0; i < checks.length; ++i) {\n dump(\"Test \" + i + \"\\n\");\n do_check_eq(parser.removeDuplicateAddresses(checks[i].addrs,\n\t\t\t\t\t\tchecks[i].otherAddrs),\n\t\tchecks[i].expectedResult);\n }\n}", "haveOwnProperty() {\n this._processArguments(arguments);\n\n return this._assert(\n this._actual.hasOwnProperty(this._expected),\n '${actual} has an own property of \"${expected}\".',\n '${actual} does not own the property of \"${expected}\".');\n }", "function testcase() {\n var literal = {a: 1};\n var keysBefore = Object.keys(literal);\n if (keysBefore[0] != 'a') return false;\n keysBefore[0] = 'x';\n var keysAfter = Object.keys(literal);\n return (keysBefore[0] == 'x') && (keysAfter[0] == 'a');\n }", "function compare (expected, actual) {\n return () => {\n deepEqual(expected, actual)\n }\n}", "function startUnitTestValidator()\n{\n var emptyObject = {};\n var obj =\n {\n badBoolOrNumber:'test',\n badString:emptyObject,\n badPointObject: { x:0, z:4 },\n badPointObjectX: { x:'test' },\n badNumberRange:15\n }\n // missing value tests\n processUnitTestFail('missing bool', validateBoolProperty, emptyObject, 'z');\n processUnitTestFail('missing number', validateNumberProperty, emptyObject, 'z');\n processUnitTestFail('missing string', validateStringProperty, emptyObject, 'z');\n processUnitTestFail('missing point', validatePointObject, emptyObject, 'z');\n processUnitTestFail('missing array', validateArrayProperty, emptyObject, 'z');\n processUnitTestFail('missing media', validateMediaFile, emptyObject, 'z');\n processUnitTestFail('missing font', validateFontFile, emptyObject, 'z');\n\n // bad values tests\n processUnitTestFail('bad bool', validateBoolProperty, obj, 'badBoolOrNumber');\n processUnitTestFail('bad number', validateNumberProperty, obj, 'badBoolOrNumber');\n processUnitTestFail('bad bool', validateStringProperty, obj, 'badString');\n processUnitTestFail('bad point', validatePointObject, obj, 'badPointObject');\n processUnitTestFail('bad pointX', validatePointObject, obj, 'badPointObjectX');\n processUnitTestFail('bad range (low)', validateNumberProperty, obj, 'badNumberRange', false, 0, 14);\n processUnitTestFail('bad range (high)', validateNumberProperty, obj, 'badNumberRange', false, 16, 20);\n}", "function deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == \"object\",\n // equivalence is determined by ==.\n } else if (typeof actual != 'object' && typeof expected != 'object') {\n return actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical \"prototype\" property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n }", "testAdvanced() {\n var a = 3;\n var b = a;\n this.assertIdentical(a, b, \"A rose by any other name is still a rose\");\n this.assertInRange(\n 3,\n 1,\n 10,\n \"You must be kidding, 3 can never be outside [1,10]!\"\n );\n }", "function testFromBlock (node) {\n return {\n test: function(userBlock) {\n // Encode userBlock while ignoring child statements\n var userElement = Blockly.Xml.blockToDom_(userBlock, true);\n return elementsEquivalent(node, userElement);\n },\n blockDisplayXML: xml.serialize(node)\n };\n}", "function getFinalTestVertices() {\n\n //init some testing vertices\n var node0 = { \"label\": \"node0\", \"layer\": 0, \"layerX\": 0, \"xCoordinate\": 3, \"neighbors\": [\"node1\", \"node2\"], \"freeX\": 0, \"freeY\": 0, \"height\": 70, \"width\": 60, \"type\": \"rectangle\" };\n var node1 = { \"label\": \"node1\", \"layer\": 1, \"layerX\": 0, \"xCoordinate\": 2, \"neighbors\": [\"node3\"], \"freeX\": 0, \"freeY\": 0, \"height\": 70, \"width\": 60, \"type\": \"rectangle\" };\n var node2 = { \"label\": \"node2\", \"layer\": 1, \"layerX\": 1, \"xCoordinate\": 4, \"neighbors\": [\"node4\", \"node8\"], \"freeX\": 0, \"freeY\": 0, \"height\": 70, \"width\": 60, \"type\": \"rectangle\" };\n var node3 = { \"label\": \"node3\", \"layer\": 2, \"layerX\": 0, \"xCoordinate\": 2, \"neighbors\": [\"node5\", \"node7\"], \"freeX\": 0, \"freeY\": 0, \"height\": 70, \"width\": 60, \"type\": \"rectangle\" };\n var node4 = { \"label\": \"node4\", \"layer\": 2, \"layerX\": 1, \"xCoordinate\": 5, \"neighbors\": [\"node6\"], \"freeX\": 0, \"freeY\": 0, \"height\": 70, \"width\": 60, \"type\": \"rectangle\" };\n var node5 = { \"label\": \"node5\", \"layer\": 3, \"layerX\": 0, \"xCoordinate\": 1, \"neighbors\": [\"node7\"], \"freeX\": 0, \"freeY\": 0, \"height\": 70, \"width\": 60, \"type\": \"rectangle\" };\n var node6 = { \"label\": \"node6\", \"layer\": 3, \"layerX\": 1, \"xCoordinate\": 5, \"neighbors\": [\"node8\", \"node9\"], \"freeX\": 0, \"freeY\": 0, \"height\": 70, \"width\": 60, \"type\": \"rectangle\" };\n var node7 = { \"label\": \"node7\", \"layer\": 4, \"layerX\": 0, \"xCoordinate\": 2, \"neighbors\": [\"node11\"], \"freeX\": 0, \"freeY\": 0, \"height\": 70, \"width\": 60, \"type\": \"rectangle\" };\n var node8 = { \"label\": \"node8\", \"layer\": 4, \"layerX\": 1, \"xCoordinate\": 4, \"neighbors\": [\"node10\"], \"freeX\": 0, \"freeY\": 0, \"height\": 70, \"width\": 60, \"type\": \"rectangle\" };\n var node9 = { \"label\": \"node9\", \"layer\": 4, \"layerX\": 2, \"xCoordinate\": 5, \"neighbors\": [\"node6\", \"node10\"], \"freeX\": 0, \"freeY\": 0, \"height\": 70, \"width\": 60, \"type\": \"rectangle\" };\n var node10 = { \"label\": \"node10\", \"layer\": 5, \"layerX\": 0, \"xCoordinate\": 4, \"neighbors\": [\"node11\"], \"freeX\": 0, \"freeY\": 0, \"height\": 70, \"width\": 60, \"type\": \"rectangle\" };\n var node11 = { \"label\": \"node11\", \"layer\": 6, \"layerX\": 0, \"xCoordinate\": 3, \"neighbors\": [], \"freeX\": 0, \"freeY\": 0, \"height\": 70, \"width\": 60, \"type\": \"rectangle\" };\n\n var init_vertices = [node0, node1, node2, node3, node4, node5, node6, node7, node8, node9, node10, node11];\n return init_vertices;\n}" ]
[ "0.5930918", "0.5843045", "0.58396417", "0.58396417", "0.5833019", "0.5833019", "0.5833019", "0.5833019", "0.5833019", "0.5833019", "0.5833019", "0.5833019", "0.5833019", "0.5833019", "0.5689097", "0.5685757", "0.5666196", "0.56645775", "0.56365645", "0.55471885", "0.5543608", "0.54749966", "0.54749966", "0.54429215", "0.5428199", "0.54073375", "0.54073375", "0.54073375", "0.54001445", "0.5328665", "0.5328665", "0.5281535", "0.5252156", "0.5229487", "0.52113056", "0.518249", "0.51407117", "0.5083053", "0.50530005", "0.50529677", "0.5046656", "0.5044081", "0.5011071", "0.50042105", "0.49981263", "0.4980788", "0.49774188", "0.49501944", "0.49178472", "0.49020374", "0.48854327", "0.48813742", "0.48586443", "0.4853481", "0.4853481", "0.48435757", "0.48388556", "0.48357463", "0.4830371", "0.48266658", "0.48218244", "0.48073316", "0.47950467", "0.47900158", "0.47895303", "0.47858563", "0.4767079", "0.47564057", "0.47409323", "0.47401175", "0.47401175", "0.4736309", "0.47342387", "0.47325882", "0.4725518", "0.4720085", "0.4713866", "0.47111553", "0.47089773", "0.47089773", "0.4708354", "0.46980196", "0.46979427", "0.46916714", "0.46895927", "0.46842846", "0.46822435", "0.4682082", "0.46803978", "0.4679364", "0.4675217", "0.46732005", "0.4671963", "0.46609506", "0.46559086", "0.46547827" ]
0.49062204
52
Utility to return true.
function ok() { return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "isValid() {\n return true;\n }", "isValid() {\n return true;\n }", "bool() {\n this.throw_if_less_than(1);\n let val = this.buffer[this.pos];\n this.pos += 1;\n return val === 1;\n }", "function always () { return true }", "other () { return true }", "other () { return true }", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function always(){return true}", "function isTrue(bool){\n \n return (Object.is(true,bool));\n\n }", "function isTtrue(bool){\n return true;\n }", "isValid() {\n if (this.value) {\n return true;\n } else {\n return false;\n }\n }", "beTrue() {\n return this._assert(\n this._actual === true, '${actual} is true.',\n '${actual} is not true.');\n }", "function isSomethingTrue(x){\n return x;\n}", "function ok() {\n return true\n }", "function ok() {\n return true\n }", "equals() {\n return false;\n }", "equals() {\n return false;\n }", "function isTrue(bool) {\n return bool;\n }", "valid() {\r\n return true\r\n }", "function checkTrue(matches) {\n return matches == true;\n}", "test() {\n return true\n }", "isValidElement() {\n return !!this.getAdUrl();\n }", "function Boolean() {}", "function bool(aValue) {\n return (aValue != 0);\n }", "function T(){\n\treturn true;\n}", "isTrue(instance) {\n const validStyler = this.checkType('styler', instance);\n const validState = this.checkType('state', instance);\n const validProps = this.checkType('props', instance);\n const validContext = this.checkType('context', instance);\n let validFunction = true;\n\n if (this.func !== null) {\n validFunction = this.func(instance);\n }\n\n return validStyler && validState & validProps && validContext && validFunction;\n }", "function isTrue(boolean){\n return boolean == 1;\n}", "isValid() {\n return this.getSize() != 0\n }", "function functionX() {\n return true;\n}", "function myBoolean() {\n return true;\n}", "function d3_true() {\n return true;\n}", "function boolean(val) {\n\t return !!val;\n\t}", "function boolean(val) {\n\t return !!val;\n\t}", "getBoolean() {\n return (this.getUint8() & 1) === 1;\n }", "function boolean (data) {\n return data === false || data === true;\n }", "function testFunction() {\n\t\t\treturn true;\n\t\t}", "function testFunction() {\n\t\t\treturn true;\n\t\t}", "function isTrue(value) {\n return value == \"true\" || value == true;\n }", "is_true(val) {\n return ['true', 'yes', '1', 1, true].includes(val);\n }", "isOn() {\n\t\treturn !!this.at;\n\t}", "function lua_true(op) {\n return op != null && op !== false;\n}", "function boolean (data) {\n return data === false || data === true;\n }", "isValid() {\n\t\treturn this.ref_id !== 'null' && this.ref_id !== undefined;\n\t}", "function _boolean($a) {\n if ((0, _xvseq._isEmpty)($a)) return false;\n var a = (0, _xvseq._first)($a);\n if ($a.size > 1 && !_isNode(a)) {\n throw (0, _xverr.error)(\"err:FORG0006\");\n }\n return !!a.valueOf();\n}", "isDone() {\n return this.single.length == 0 ? true : false\n }", "function returnFalse() {\n\t\treturn false;\n\t}", "function isOk(val) {\r\n return typeof val === \"boolean\" && val;\r\n }", "puzzleIsValid() {\r\n\t\ttry {\r\n\t\t\tthis.fullHouse(false, false);\r\n\t\t} catch {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function validate() {\n var isValid = true;\n return isValid;\n}", "exists(){}", "function trueOrFalse() {\n if (todayWeather === undefined) {\n return false;\n } else {\n return true;\n }\n }", "function is(a,b){ return (typeof a == b) ? true : false; }", "static isExist(value) {\n\n if (value === true || value === false) {\n return true;\n }\n\n if (value === 0) {\n return true;\n }\n\n if (value) {\n return true;\n }\n\n return false;\n }", "static exists(obj) {\r\n if (\r\n !!obj &&\r\n obj !== null &&\r\n typeof(obj) !== 'undefined' &&\r\n (obj.trim ? obj.trim() !== C.ST.E : obj !== C.ST.E)\r\n ) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function has() {\n return true;\n }", "isValid() {\n return this.hash === this.createHash();\n }", "function returnFalse() {\n\treturn false;\n}", "function mustBeTrue(boo){\n if(boo === true){\n return true;\n }else{\n return false;\n }\n}", "function asBoolean$4(r) {\n\t if(isDomNode(r)) return !!asString$6(r).trim();\n\t switch(r.t) {\n\t case 'arr': return !!r.v.length;\n\t case 'date': return !isNaN(r.v); // TODO should be handled in an extension rather than core code\n\t default: return !!r.v;\n\t }\n\t}", "isActive() {\n return (this.flags & 0x10) !== 0;\n }", "isOk() {\n return this.value !== void 0\n }", "_shallExecute() {\n\t\treturn !_.isEmpty(this.robot);\n\t}", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }", "valid() {\n return true\n }", "isIntact () {\n return false;\n }", "function returnFalse() {\n return false;\n }", "function shortFunction(arg) {\n if (arg) {\n console.log(true)\n }\n return true\n}", "function trueOrFalse() {\n if (fiveDayWeather === undefined) {\n return false;\n } else {\n return true;\n }\n }", "isBoolean(val) {\n return typeof val === 'boolean';\n }" ]
[ "0.734517", "0.734517", "0.734517", "0.734517", "0.6982932", "0.6982932", "0.6877149", "0.67819715", "0.65770674", "0.65770674", "0.6514151", "0.6514151", "0.6514151", "0.6514151", "0.6514151", "0.6514151", "0.6514151", "0.6514151", "0.6514151", "0.6514151", "0.6514151", "0.6514151", "0.6514151", "0.64804924", "0.64187336", "0.6399869", "0.6313609", "0.6270287", "0.62354964", "0.6220518", "0.6190381", "0.6190381", "0.6180399", "0.6167026", "0.61612993", "0.6153255", "0.61480385", "0.61437917", "0.6128105", "0.6111577", "0.60854805", "0.6083331", "0.608183", "0.6067722", "0.60612184", "0.60463107", "0.60335785", "0.60335785", "0.6027963", "0.6022628", "0.6015725", "0.6015725", "0.60115147", "0.5997494", "0.599395", "0.59912425", "0.59886134", "0.5982282", "0.5974183", "0.5973833", "0.59696084", "0.5958258", "0.5953471", "0.59516764", "0.5949941", "0.59430534", "0.59429336", "0.59385705", "0.5917458", "0.591388", "0.591388", "0.59129924", "0.5912573", "0.5909829", "0.59014446", "0.58969504", "0.5896827", "0.5895856", "0.5892556", "0.5887982", "0.5887982", "0.5887982", "0.5887982", "0.5879047", "0.58757937", "0.58749324", "0.58689463", "0.5868165", "0.58663857", "0.58608663" ]
0.60580045
54
Create a listitem using overly simple mechanics.
function pedanticListItem(ctx, value, position) { var offsets = ctx.offset; var line = position.line; /* Remove the list-item’s bullet. */ value = value.replace(EXPRESSION_PEDANTIC_BULLET, replacer); /* The initial line was also matched by the below, so * we reset the `line`. */ line = position.line; return value.replace(EXPRESSION_INITIAL_INDENT, replacer); /* A simple replacer which removed all matches, * and adds their length to `offset`. */ function replacer($0) { offsets[line] = (offsets[line] || 0) + $0.length; line++; return ''; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ListItem() {}", "function ListItem() {}", "function ListItem() {}", "function listItem() {\n // To do: remove `loose` in next major.\n return {type: LIST_ITEM, loose: false, spread: false, children: []}\n}", "function createListItem(item) {\n text += '<li>' + item + '</li>\\n';\n}", "function createListItemDefault(item, idx) {\n var listItem = document.createElement('li');\n listItem.innerHTML = '<span class=\"br-icon icon-glyph-' + item.glyph + '\"></span> ' + item.name;\n listItem.className = 'br-listlink'\n return listItem;\n }", "function createListItemDefault(item, idx)\n {\n var listItem = document.createElement('li');\n listItem.innerHTML = '<span class=\"br-icon icon-glyph-' + item.glyph + '\"></span> ' + item.name;\n listItem.className = 'br-listlink'\n return listItem;\n }", "function ListItem() { }", "function createListItem(item) {\n const ul = document.getElementById(\"item-list\");\n const listItem = extractItemTemplate();\n const deleteBtn = listItem.getElementById(\"delete-btn\");\n const editBtn = listItem.getElementById(\"edit-btn\");\n const itemContainer = listItem.getElementById(\"item-container\");\n itemContainer.innerText = JSON.stringify(item, null, 4);\n\n deleteBtn.addEventListener(\"click\", () => deleteItem(item));\n editBtn.addEventListener(\"click\", () => displayForm(item));\n\n ul.append(listItem);\n}", "createListViewItem() {\n var item = new latte.ListViewItem(this.explorer.listView);\n var columns = this.getColumns();\n item.tag = this;\n this._listViewItem = item;\n // Name column\n item.addColumn(150);\n this.syncUI();\n return item;\n }", "function buildListItem(obj){\n let listItem = document.createElement('li')\n listItem.classList.add('app__list-item')\n\n let title = document.createElement('h3')\n title.innerText = \"WebSite: \"+obj.title\n listItem.appendChild(title)\n\n let username = document.createElement('p')\n username.innerText = \"Username: \"+obj.username\n listItem.appendChild(username)\n\n let password = document.createElement('p')\n password.innerText = \"Password: \"+obj.password\n password.setAttribute('data-pass', obj.password)\n listItem.appendChild(password)\n\n let cross = document.createElement('div')\n cross.classList.add(\"app__list-item__cross\")\n cross.innerText = \"X\"\n listItem.appendChild(cross)\n\n return listItem\n}", "function ListItem(title, body) {\n this.id = Date.now();\n this.title = title;\n this.body = body;\n this.importance = 'Normal';\n this.complete = null;\n}", "function createLI(n)\r\n{\r\n var li = document.createElement('li'); //<li></li>\r\n li.setAttribute('class', 'list-item'); //<li class=\"list-item\"></li>\r\n li.innerText = `List Item ${n}`;\r\n\r\n return li;\r\n}", "function MakeLiItems() {\n var listItems = $();\n for(var i = 0; i < 5; i++) {\n listItems = listItems.add($('<li>', { text: \"New List Item\" + (i + 1) }));\n }\n return listItems;\n }", "function Item(listItem) {\n this.listItem = listItem\n}", "function newItem(todo) {\n var listItem = document.createElement(\"li\");\n listItem.textContent = todo;\n list.appendChild(listItem);\n}", "static createListItem (text) {\n const li = document.createElement(\"li\");\n \n li.textContent = text;\n\n return li;\n }", "addNewItemToList(list, initDescription, initDueDate, initStatus) {\n let newItem = new ToDoListItem(this.nextListItemId++);\n newItem.setDescription(initDescription);\n newItem.setDueDate(initDueDate);\n newItem.setStatus(initStatus);\n list.addItem(newItem);\n if (this.currentList) {\n this.view.refreshList(list);\n }\n }", "function createListItemBlock(listItem) {\n if (listItem === void 0) { listItem = null; }\n return {\n startElement: listItem,\n endElement: listItem,\n insertPositionNode: null,\n listItemContainers: listItem ? [listItem] : [],\n };\n}", "function liCreator(itemText, itemID, toDoStatus, classArray=[]) \n{\n\tlet list;\t\n\tlet newToDoItem = document.createElement(\"li\");\n\tlet liTextContainer = document.createElement(\"span\");\n\n\tliTextContainer.textContent = itemText;\n\tnewToDoItem.appendChild(liTextContainer);\n\n\tfor(let i = 0; i < classArray.length; i++) {\n\t\tnewToDoItem.classList.add(classArray[i]);\n\t}\n\tnewToDoItem.setAttribute(\"id\", itemID);\n\n\n\tif(toDoStatus === \"In Progress\")\n\t{\n\n\t\tnewToDoItem.classList.add(\"to-do-list-item\");\n\t\tlist = document.querySelector(\"#toDoUL\");\n\t\tlist.appendChild(newToDoItem);\n\t\tcheckboxCreator(itemID);\n\t}\n\telse\n\t{\n\t\tnewToDoItem.classList.add(\"done-list-item\");\n\t\tlist = document.querySelector(\"#doneUL\");\n\t\tlist.appendChild(newToDoItem);\n\t}\n}", "function createLi( n, list, listtype, cls, text )\n{\n let li = document.createElement(\"li\");\n\n // List entry?\n if (listtype !== \"sep\")\n {\n // Delete button (or space for it for the add entry)\n let span = document.createElement(\"span\");\n span.className = \"for-delete-button\";\n span.appendChild( document.createTextNode(\"✖\") );\n li.appendChild( span );\n if (listtype !== \"add\")\n {\n li.draggable = true;\n setDeletable( li );\n }\n\n // Entry itself\n let entry = document.createElement(\"span\");\n entry.className = \"entry\";\n entry.appendChild( document.createTextNode(text) );\n li.appendChild( entry );\n\n // Drag button\n if (listtype !== \"add\")\n addThumb( li );\n }\n else\n {\n // Separator: span in a div in a li\n let div = document.createElement(\"div\");\n let span = document.createElement(\"span\");\n span.appendChild( document.createTextNode(\" \") );\n div.appendChild( span );\n li.appendChild( div );\n }\n\n // And the rest of the attributes; drag stuff if it's not the \"add\" line\n li.className = cls;\n li.id = list + n + listtype;\n\n return li;\n}", "function createListItem(data) {\n const listItem = document.createElement('li');\n listItem.innerHTML = data.name;\n\n let paragraph = document.createElement('p');\n paragraph.innerHTML = \"Discharge (cubic feet per second): \" + data.discharge;\n\n listItem.appendChild(paragraph);\n\n return listItem;\n}", "function createNewListItem() {\r\n const animalsList = document.querySelector(\"li\");\r\n const parrots = document.createElement(\"li\");\r\n parrots.innerText = \"Parrots\";\r\n parrots.className = \"parrots\";\r\n parrots.before(\"elephants\");\r\n animalsList.appendChild(parrots);\r\n}", "function generateLiInUl( modelItem, mapper ) {\n // const listType = modelItem.getAttribute( 'type' ) == 'numbered' ? 'ol' : 'ul';\n // const listType = 'eftouch';\n const listType = 'p';\n const viewItem = new ViewListItemElement();\n\n const imageUrl = modelItem.getAttribute('imageUrl')\n const attrs = { 'imageUrl': imageUrl}\n // const viewList = new ViewContainerElement( listType, null );\n const viewList = new ViewContainerElement( listType, attrs );\n viewList.appendChildren( viewItem );\n\n mapper.bindElements( modelItem, viewItem );\n\n return viewItem;\n}", "function buildLi(item, par) {\n var newLi = document.createElement('li');\n var liAnchor = document.createElement('a');\n if (par) {\n newLi.className = 'parent';\n }\n liAnchor.href = '#';\n liAnchor.target = '_top';\n liAnchor.textContent = item.title;\n newLi.appendChild(liAnchor);\n return newLi;\n }", "function ListItem(text, id){\r\n this.text = text;\r\n this.isHighlighted = false;\r\n this.isChecked = false;\r\n this.uniqueValue = id;\r\n}", "function generateListItem(itemJson){\n\n var itemList = document.createElement(\"li\");\n itemList.classList.add(\"productLine\");\n\n itemList.appendChild(formatListItem(itemJson.imagem, \"productImage\"));\n itemList.appendChild(formatListItem(itemJson.titulo, \"productHeader\"));\n itemList.appendChild(formatListItem(itemJson.descricao, \"productParagraph\"));\n\n return itemList;\n\n}", "function createListItem(inputValue) {\n // Create li item\n const newlistItem = document.createElement('li');\n const taskText = document.createElement('span');\n // Get input value and add it to the li\n taskText.innerHTML = inputValue;\n // Create a complete task icon\n let newListCompleteIcon = document.createElement('img');\n newListCompleteIcon.src = \"assets/img/checked.svg\";\n newListCompleteIcon.className = 'task-icon';\n // Add checkbox to the li\n newlistItem.prepend(taskText);\n newlistItem.prepend(newListCompleteIcon);\n // Return list item to the handler\n return newlistItem;\n}", "function createLi () {\n\n const createItem = document.createElement('li');\n createItem.textContent = js_input.value;\n\n const btnDelete = document.createElement('button');\n btnDelete.classList.add('js-delete_btn');\n btnDelete.textContent = 'X';\n\n js_list.addEventListener('click', event => {\n if (event.target.nodeName === 'BUTTON') {\n event.target.parentNode.remove(createItem);\n }\n });\n\n createItem.append(btnDelete);\n js_list.append(createItem);\n }", "function createListItems(e) {\n /*jshint validthis: true*/\n this.classList.toggle('active');\n var currentSlide = document.querySelector('.present');\n\n if (this.classList.contains('active')) {\n if (getSelectionHtml() === \"\") {\n var li = document.createElement('li');\n li.innerHTML = 'List item';\n currentSlide.appendChild(li);\n } else {\n replaceSelectionWithHtml('<li>' + getSelectionHtml() + '</li>');\n this.classList.remove('active');\n }\n } else {\n var br = document.createElement('br');\n currentSlide.appendChild(br);\n }\n}", "function createLiElement(itemvalue, state=\"pending\"){\n var li = document.createElement('li');//li\n \n var checkbox = document.createElement('input');\n checkbox.type = \"checkbox\";\n checkbox.setAttribute(\"class\", \"itemcheck\");\n \n li.appendChild(checkbox);\n li.appendChild(document.createTextNode(itemvalue));\n li.setAttribute(\"class\", state);\n ul.appendChild(li);\n addItemToStorage(itemvalue, state);\n pendingToComplete();\n}", "addListItem(itemName, itemPrice) {\n this.listItems.push(new listItem(itemName, itemPrice));\n }", "function listItem(name, taskId, isDone){\n this.name = name;\n this.id = taskId;\n this.done = isDone;\n this.getHtml = function(){\n var li = document.createElement(\"li\");\n var t = document.createTextNode(this.name);\n li.appendChild(t);\n var span = document.createElement(\"SPAN\");\n var txt = document.createTextNode(\"\\u00D7\");\n span.className = \"close\";\n span.appendChild(txt);\n span.onclick = clickOnDelete;\n li.appendChild(span);\n var cb = document.createElement( \"input\" );\n cb.type = \"checkbox\";\n cb.onclick\t= toggleChecked;\n if (isDone) {\n cb.checked = true;\n li.classList.toggle('checked');\n }\n else cb.checked = false;\n cb.id = taskId;\n li.appendChild(cb);\n document.getElementById(\"myUL\").appendChild(li);\n }\n}", "function ListItem(name, count) \r\n{\r\n\tthis.name = name;\r\n\tthis.count = count;\r\n}", "function _factoryItem (title, start, end, options) {\n\t\t\treturn this.items[this.items.length] = new Item(this, title, start, end, options);\n\t\t}", "createListViewItem() {\n var item = super.createListViewItem();\n // // var item = new ListViewItem();\n // var columns: string[] = this.getColumns();\n //\n // item.icon = this.getIcon();\n //\n // for (var i = 0; i < columns.length; i++) {\n // var s:string = columns[i];\n //\n // item.addColumn(this.getColumnWithFor(s));\n // item.setItem(i, this.getItemForColumn(s));\n // }\n return item;\n }", "function createListItem(text1) {\n let li1 = document.createElement(\"li\");\n let text = document.createTextNode(text1 + ' ');\n li1.appendChild(text);\n li1.appendChild(createDeleteButton());\n return li1;\n}", "function createListItem(){\r\n //use createElement to create all the buttons \r\n console.log(\"create a item...\");\r\n\tvar listItem=document.createElement(\"li\");\r\n\tvar checkBox=document.createElement(\"input\");\r\n\tvar label=document.createElement(\"label\");\r\n\tvar inputText=document.createElement(\"input\");\r\n\tvar editButton=document.createElement(\"button\");\r\n\tvar deleteButton=document.createElement(\"button\");\r\n\t\r\n\r\n\t//set type information\r\n\tcheckBox.type=\"checkbox\";\r\n\tinputText.type=\"text\";\r\n\teditButton.className=\"edit\";\r\n\tdeleteButton.className=\"delete\";\r\n\teditButton.innerText=\"Edit\";\r\n\tdeleteButton.innerText=\"Delete\";\r\n label.innerText=input.value;\r\n\r\n\t//append buttons to listItem\r\n\t//well,have to follow the order- -!\r\n\tlistItem.appendChild(checkBox);\r\n\tlistItem.appendChild(label);\r\n\tlistItem.appendChild(inputText);\r\n\tlistItem.appendChild(editButton);\r\n\tlistItem.appendChild(deleteButton);\r\n\t\r\n\r\n\treturn listItem;\r\n\t\r\n\r\n}", "function createListItem(product, jar) {\n\tvar temp = null;\n\tvar container = document.createElement('div');\n\t\tcontainer.setAttribute('id', product.attr('id'));\n\t\tcontainer.setAttribute('class', 'item');\n\t\ttemp = createItemLinkDiv(product); \n\t\tcontainer.appendChild(temp);\n\t\ttemp = createMiniImgDiv(product);\n\t\tcontainer.appendChild(temp);\t\n\t\ttemp = createExtraIteminfo(product);\n\t\tcontainer.appendChild(temp);\n\t\t\n\tjar.appendChild(container);\n\treturn jar;\n}", "function addNewItem() {\r\n // create a new LI tag and some text to go with it.\r\n var oLINode = document.createElement(\"li\");\r\n var oLIText = document.createTextNode(\"New Item\");\r\n // Add the text to the LI tag\r\n oLINode.appendChild(oLIText);\r\n // Add the finished LI tag to the UL\r\n gTheList.appendChild(oLINode);\r\n}", "function createListItem(className,imageSource, name, message, url) {\r\n var listItem = createNode(\"li\");\r\n listItem.setAttribute(\"class\", \"streamer\");\r\n \r\n var div = createNode(\"div\");\r\n div.setAttribute(\"class\", className);\r\n var image = createNode(\"img\");\r\n image.setAttribute(\"id\", name );\r\n image.setAttribute(\"src\", imageSource); \r\n append(div, image); \r\n\r\n var a = createNode(\"a\");\r\n a.setAttribute(\"href\", url);\r\n if (url === \"#\") {\r\n a.setAttribute(\"class\", \"inactiveLink\");\r\n }\r\n else { \r\n a.setAttribute(\"target\", \"_blank\");\r\n } \r\n var text = createText(name);\r\n append(a, text);\r\n append(div, a);\r\n\r\n var p = createNode(\"p\");\r\n text = createText(message);\r\n append(p, text);\r\n append(div, p);\r\n append(listItem, div);\r\n \r\n return listItem;\r\n}", "function CreateItem(item) {\n var li = document.createElement('li');\n var t = document.createTextNode(item);\n var span = document.createElement('span');\n var spantext = document.createTextNode('\\u00D7');\n\n li.className = 'list-group-item';\n li.appendChild(t); /****** \"li\" is a parent element of this \"t\" *********/\n list.appendChild(li); /*** list \"<ul>\" is a parent element of this \"li\" */\n span.classList.add('close');\n span.appendChild(spantext);\n li.appendChild(span);\n\n span.onclick = function () {\n var li = this.parentElement;\n li.style.display = 'none';\n li.classList.remove('checked');\n }\n}", "function createItem(attrs) {\n var units = '';\n if (attrs.units) {\n units = ' ('\n + attrs.units\n + ' ud'\n + (attrs.units != 1 ? 's' : '')\n + '.)';\n }\n\n var kind = '';\n if (attrs.kind) {\n kind = '<span class=\"kind\" style=\"background:'\n + kinds[attrs.kind].color\n + '\">' + kinds[attrs.kind].name + \"</span>\";\n }\n\n $(\"#itemlist\").append($('<div class=\"item selectable\"> <span class=\"icon\"> <img alt=\"\" src=\"objects/' + attrs.icon + '\"></span> <div class=\"text\"><span class=\"description\">'+kind+attrs.description + '</span> <span class=\"location\">' + attrs.location + units + '</span> <input type=\"hidden\" class=\"roomNo\" value=\"' + attrs.room + '\"> <input type=\"hidden\" class=\"id\" value=\"' + attrs.id + '\"> </div> </div>').css(\"opacity\", \"0.2\"));\n}", "function addListItem() {\n let list = document.querySelector('#items');\n let newItem = document.createElement('li');\n newItem.classList.add('list-group-item');\n let text = document.querySelector('#newItem').value;\n let textnode = document.createTextNode(text);\n newItem.appendChild(textnode);\n items.appendChild(newItem);\n}", "function ItemList(_ref) {\n var items = _ref.items,\n curIndex = _ref.curIndex,\n onSelect = _ref.onSelect,\n rest = ItemList_objectWithoutProperties(_ref, [\"items\", \"curIndex\", \"onSelect\"]);\n\n var $items = items.map(function (i, index) {\n var name = i.name;\n return /*#__PURE__*/react_default.a.createElement(ItemList_Item, {\n py: \"3\",\n pl: \"4\",\n name: name,\n key: index,\n active: index === curIndex,\n onClick: function onClick() {\n return onSelect(index);\n }\n });\n });\n return /*#__PURE__*/react_default.a.createElement(src[\"l\" /* Flex */], ItemList_extends({\n flex: \"1\",\n flexDirection: \"column\",\n color: \"text.primary\",\n bold: true,\n children: $items,\n style: {\n overflow: \"auto\"\n }\n }, rest));\n}", "function newLi (id){\n var newLi = document.createElement('li');\n newLi.id = id;\n newLi.textContent = 'The Fox';\n return newLi;\n}", "_createNewListItem(e) {\n e.preventDefault();\n\n const itemName = itemNameInput.value;\n const dueDate = itemDueDateInput.value;\n const timeDue = itemTimeDueInput.value;\n const description = itemDescriptionInput.value;\n const priority = itemPriorityInput.value;\n\n // Creating new listItem Obj\n const listItem = new ListItem(\n itemName,\n dueDate,\n timeDue,\n description,\n priority\n );\n\n // Adding new list item to obj in listCollection\n this.listCollection[this._findObjectAlgo()].listItems.push(listItem);\n // Altering the curList\n this.curList = this.listCollection[this._findObjectAlgo()];\n\n this._insertionSort();\n this._setLocalStorage();\n\n // Clears input fields\n this._clearForm();\n\n // Reset listItemsParent and re-render sorted list items\n listItemsParent.innerHTML = \"\";\n this.curList.listItems.forEach((item) => this._renderListItem(item));\n\n // Shows and hides success message\n successMessage.classList.remove(\"hidden\");\n setTimeout(function () {\n successMessage.classList.add(\"hidden\");\n }, 750);\n }", "addNewItem(itemId) {\n if(!itemId){\n itemId = this.nextListItemId++;\n }\n let newItem = new ToDoListItem(itemId);\n this.currentList.items.push(newItem);\n this.view.viewList(this.currentList);\n this.enableItemControls();\n return newItem;\n }", "function createLi(obj) {\n let liTag = document.createElement('li');\n let spanTag = document.createElement('span');\n let iTag = document.createElement('i');\n liTag.addEventListener(\"click\", toggleListener)\n liTag.setAttribute('id', `${obj._id}`);\n // liTag.classList.add('visible')\n spanTag.addEventListener(\"click\", removeLi)\n spanTag.appendChild(iTag);\n iTag.setAttribute('class', `fas fa-trash`);\n liTag.appendChild(spanTag);\n liTag.appendChild(document.createTextNode(`${obj.item}`));\n return liTag\n }", "function createTodoListItem(todo) {\n var checkbox = document.createElement('input');\n checkbox.className = 'toggle';\n checkbox.type = 'checkbox';\n checkbox.addEventListener('change', checkboxChanged.bind(this, todo));\n\n var label = document.createElement('label');\n label.appendChild( document.createTextNode(todo.title));\n label.addEventListener('dblclick', todoDblClicked.bind(this, todo));\n\n var deleteLink = document.createElement('button');\n deleteLink.className = 'destroy';\n deleteLink.addEventListener( 'click', deleteButtonPressed.bind(this, todo));\n\n var divDisplay = document.createElement('div');\n divDisplay.className = 'view';\n divDisplay.appendChild(checkbox);\n divDisplay.appendChild(label);\n divDisplay.appendChild(deleteLink);\n\n var inputEditTodo = document.createElement('input');\n inputEditTodo.id = 'input_' + todo._id;\n inputEditTodo.className = 'edit';\n inputEditTodo.value = todo.title;\n inputEditTodo.addEventListener('keypress', todoKeyPressed.bind(this, todo));\n inputEditTodo.addEventListener('blur', todoBlurred.bind(this, todo));\n\n var li = document.createElement('li');\n li.id = 'li_' + todo._id;\n li.appendChild(divDisplay);\n li.appendChild(inputEditTodo);\n\n if (todo.completed) {\n li.className += 'complete';\n checkbox.checked = true;\n }\n\n return li;\n }", "function createListItem(viewModelObject) {\n if(typeof viewModelObject.expanded == \"undefined\"){\n viewModelObject.expanded = false;\n }\n\n var listItem = jQuery(\"<li></li>\");\n viewModelObject.element = listItem;\n listItem.addClass(\"jqcTreeListItemCollapsed\");\n\n var listItemExpandHandle = jQuery(\"<div class='jqcTreeListItemExpandHandle'>+</div>\");\n var listItemCollapseHandle = jQuery(\"<div class='jqcTreeListItemCollapseHandle'>&ndash;</div>\");\n var listItemEmptyHandle = jQuery(\"<div class='jqcTreeListItemEmptyHandle'> </div>\");\n\n viewModelObject.expandHandle = listItemExpandHandle;\n viewModelObject.collapseHandle = listItemCollapseHandle;\n viewModelObject.emptyHandle = listItemEmptyHandle;\n\n\n listItemExpandHandle.click(function() {\n viewModelObject.expanded = true;\n listItemExpandHandle.hide();\n listItemCollapseHandle.show();\n listItem.find(\">ul\").show();\n });\n\n listItemCollapseHandle.click(function() {\n viewModelObject.expanded = false;\n listItemExpandHandle.show();\n listItemCollapseHandle.hide();\n listItem.find(\">ul\").hide();\n });\n\n\n listItem.append(listItemExpandHandle);\n listItem.append(listItemCollapseHandle);\n listItem.append(listItemEmptyHandle);\n\n var listItemText = jQuery(\"<span></span>\");\n listItemText.text(viewModelObject.dataObject[labelField]);\n listItem.append(listItemText);\n listItemText.click(function() {\n if(typeof viewModelObject.selected === 'undefined' || viewModelObject.selected === false) {\n if(!event.ctrlKey){\n treeList.unselectAllItems();\n }\n treeList.selectItem(viewModelObject);\n } else {\n treeList.unselectItem(viewModelObject);\n }\n\n eventManager.fireEvent(\"click-item\", function(listener) {\n listener.listenerFunction(event, listItem, viewModelObject);\n })\n });\n\n var childList = jQuery(\"<ul></ul>\");\n listItem.append(childList);\n childList.hide();\n\n if(treeList.viewModel.parentIdField() != null) {\n var parentId = viewModelObject.dataObject[treeList.viewModel.parentIdField()];\n if(parentId != null) {\n\n // 1. find parent view model object\n var parentViewModelObject = treeList.viewModel.getViewModelObjectById(parentId);\n\n // 2. find parent element, and then its <ul> element.\n var parentChildList = parentViewModelObject.element.find(\">ul\");\n\n //3. add this list item to the parent element ul list.\n parentChildList.append(listItem);\n } else {\n treeList.jqc.element.append(listItem);\n }\n\n }\n }", "function createItemEl(columnEl, column, item, index) {\r\n // List Item\r\n const listEl = document.createElement(\"li\");\r\n listEl.classList.add(\"drag-item\");\r\n listEl.textContent = item;\r\n listEl.draggable = true;\r\n listEl.setAttribute(\"ondragstart\", \"drag(event)\");\r\n listEl.contentEditable = true;\r\n listEl.setAttribute(\"onfocusout\", `updateItem(${column},${index})`);\r\n\r\n columnEl.append(listEl);\r\n }", "function createItem(itemName, id, done, trash) {\n const position = \"beforeend\";\n const check = \"fa-check-circle\";\n const uncheck = \"fa-circle\";\n const line = \"lineThrough\";\n const opacity = \"item-checked\";\n\n const iconStyle = done ? check : uncheck;\n const textStyle = done ? line : \"\";\n const itemOpacity = done ? opacity : \"\";\n\n const itemHtml = `<li class=\"item ${itemOpacity}\">\n <i class=\"far ${iconStyle} complete\" id=\"${id}\"></i>\n <p class=\"text ${textStyle}\">${itemName}</p>\n <i class=\"far fa-trash-alt delete\" id=\"${id}\"></i>\n </li>`;\n\n listElement.insertAdjacentHTML(position, itemHtml);\n}", "function appendToUl(ul, item) {\n ul.append(liTemplate(item.id, item.name, item.details));\n}", "function createItemEl(columnEl, column, item, index) {\n // List Item\n const listEl = document.createElement('li')\n listEl.classList.add('drag-item')\n listEl.textContent = item\n listEl.draggable = true\n listEl.setAttribute('ondragstart', 'drag(event)')\n listEl.contentEditable = true\n listEl.id = index\n listEl.setAttribute('onfocusout', `updateItem(${index}, ${column})`)\n // Append\n columnEl.appendChild(listEl)\n}", "function addItem () {\n\tvar newLi = document.createElement('li');\n\tnewLi.innerText = 'Hello';\n\tlist = document.getElementById('toDoList');\n\tlist.appendChild(newLi)\n}", "function createListItem(textLink, textString, hasHyperlink, classType) {\n let listItem = document.createElement(\"li\");\n listItem.className = classType;\n if (hasHyperlink) {\n let hyperlink = createHyperlink(textLink, textString)\n listItem.appendChild(hyperlink);\n }\n return listItem;\n}", "function AppendItemsToList() {\n var item1 = $(\"<li></li>\").text(\"Item 1\");\n var item2 = \"<li>Item 2</li>\";\n var item3 = document.createElement(\"li\");\n item3.innerHTML = \"Item 3\";\n\n $(\"#olTestList2\").append(item1, item2, item3);\n}", "function createListElement() {\n\tvar listelement = document.createElement(\"li\");\n\t\tlistelement.appendChild(document.createTextNode(input.value));\n\t\tunorderedelement.appendChild(listelement);\n\t\tinput.value = \"\";\n}", "createListWithListItems(numberOfListItems) {\n for (let i = 0; i < numberOfListItems; i++) {\n this.createListItem.click();\n this.addNewListItem(\n \"Add a new list item\",\n `List item ${i}`,\n `Help text ${i}`,\n `${i}`\n );\n }\n }", "function renderList(item1, item2, item3) {\n const newList = document.createElement('ul')\n newList.appendChild(renderListItem(\"Name\", item1))\n newList.appendChild(renderListItem(\"Age\", item2))\n newList.appendChild(renderListItem(\"Favorite Color\", item3))\n\n return newList\n}", "function createItemEl(columnEl, column, item, index) {\r\n // List Item\r\n const listEl = document.createElement('li');\r\n listEl.textContent = item;\r\n listEl.id = index;\r\n listEl.classList.add('drag-item');\r\n listEl.draggable = true;\r\n listEl.setAttribute('onfocusout', `updateItem(${index}, ${column})`);\r\n listEl.setAttribute('ondragstart', 'drag(event)');\r\n listEl.contentEditable = true;\r\n // Append\r\n columnEl.appendChild(listEl);\r\n}", "function newListelement(){\r\n let newListItem = document.createElement('li');\r\n let textNode = document.createTextNode(currentInput);\r\n newListItem.appendChild(textNode);\r\n return newListItem;\r\n}", "function createLi(text) {\n\t\t\t\tfunction createElement(elementName, property, value) {\n\t\t\t\t\t\tconst element = document.createElement(elementName);\n\t\t\t\t\t\telement[property] = value;\n\t\t\t\t\t\treturn element;\n\t\t\t\t}\n\t\t\t\tfunction appendToLI(elementName, property, value) {\n\t\t\t\t\t\tconst element = createElement(elementName, property, value);\n\t\t\t\t\t\tli.appendChild(element);\n\t\t\t\t\t\treturn element;\n\t\t\t\t}\n\t\t\t\tconst li = document.createElement('li'); \n\t\t\t\tappendToLI('span', 'textContent', text);\n\t\t\t\tappendToLI('label', 'textContent', 'Confirm')\n\t\t\t\t\t\t.appendChild(appendToLI('input', 'type', 'checkbox'));\n\t\t\t\tappendToLI('button', 'textContent', 'edit');\n\t\t\t\tappendToLI('button', 'textContent', 'remove');\n\t\t\t\treturn li;\n\t\t}", "function createListElement() {\n /*Creates the DOM elements for the new item:*/\n let li = document.createElement(\"li\"),\n inp1 = document.createElement(\"input\"),\n inp2 = document.createElement(\"input\"),\n div = document.createElement(\"div\");\n\n /*Increases the counter of the list elemnts and gives the new element an unique name:*/\n labelMapLength ++;\n inp1.id = `isLbl${labelMapLength}`;\n inp2.id = `toLbl${labelMapLength}`;\n inp1.placeholder = \"hat Label\";\n inp2.placeholder = \"Label umbenennen zu...\";\n\n /*Adds the autocomplete function to the new element:*/\n div.classList.add(\"autocomplete\");\n div.appendChild(inp2);\n li.append(inp1);\n li.append(div);\n\n labelList.appendChild(li);\n labelList.appendChild(elemById(\"addLabel\"));\n\n autocomplete(elemById(`toLbl${labelMapLength}`), autocompletionTerms);\n}", "function createListElement() {\n // Create element & text\n var newElement = document.createElement(\"li\");\n var newText = document.createTextNode(input.value);\n // Add text to element\n newElement.appendChild(newText);\n // Update DOM\n ul.appendChild(newElement);\n // Clear input box\n input.value = \"\";\n}", "function createItemEl(columnEl, column, item, index) {\n // List Item\n const listEl = document.createElement('li');\n listEl.classList.add('drag-item');\n listEl.textContent = item;\n // make the item draggable\n listEl.setAttribute(\"draggable\", true);\n // what should happen when the element is dragged.\n listEl.setAttribute(\"ondragstart\", \"drag(event)\");\n // Make list item editable\n listEl.setAttribute(\"contenteditable\", true);\n // Set Id of each list item\n listEl.id = index;\n // Set focusOut attribute on each list item\n listEl.setAttribute(\"onfocusout\", `updateItem(${index}, ${column})`);\n // Append to Column\n columnEl.appendChild(listEl);\n}", "function addListItem(value) {\n var newItem = document.createElement(\"li\");\n newItem.innerHTML = value;\n var list = document.getElementById('list');\n list.appendChild(newItem);\n}", "function createLI(title, content) {\n let li = document.createElement('li');\n li.textContent = title + \": \" + content;\n return li;\n }", "function createListItem() {\n const item = document.createElement(\"li\");\n // Injection userinput into li element\n item.innerHTML = userInput.value;\n // Appeding li element below ul element\n ul.appendChild(item);\n // Resets userInput to empty string\n userInput.value = \"\";\n\n // Toggle effect to mark to dos as done\n function markAsDone() {\n item.classList.toggle(\"done\");\n }\n\n item.addEventListener(\"click\", markAsDone);\n\n // Creating button to delete li elements\n const deleteButton = document.createElement(\"button\");\n deleteButton.appendChild(document.createTextNode(`X`));\n item.appendChild(deleteButton);\n deleteButton.addEventListener(\"click\", deleteListItem);\n\n // Makes it possible to delete li elements with the button\n function deleteListItem() {\n item.remove();\n }\n}", "function createListItem(bookDesc, index) {\n let item = document.createElement('li');\n item.setAttribute(\"data-index\", index)\n item.id = index\n item.textContent = bookDesc;\n let readButton = document.createElement(\"input\");\n readButton.type = \"button\";\n readButton.classList.add(\"toggleRead\");\n readButton.value = \"Change read status\";\n readButton.addEventListener('click', event => {\n myLibrary.toggleRead(event.target.parentElement.getAttribute(\"data-index\"));\n let toggledText = createListItem(createBookItem(myLibrary[index]), index);\n let currentText = document.getElementById(index)\n currentText.parentNode.replaceChild(toggledText, currentText);\n })\n item.appendChild(readButton);\n let deleteButton = document.createElement(\"input\");\n deleteButton.type = \"button\";\n deleteButton.classList.add(\"delete\");\n deleteButton.value = \"Remove from library\";\n deleteButton.addEventListener('click', event => {\n myLibrary.deleteBook(event.target.parentElement.getAttribute(\"data-index\"));\n event.target.parentElement.parentElement.removeChild(event.target.parentElement);\n })\n item.appendChild(deleteButton)\n return item\n}", "function addNewLi(item) {\n let todoLi = document.createElement('li');\n todoLi.id = item.id;\n if (item.status) {\n todoLi.classList.add(\"completed\");\n }\n let todoLiDiv = document.createElement('div');\n todoLiDiv.classList.add(\"view\");\n\n let todoLiDivInputCheck = document.createElement('input');\n todoLiDivInputCheck.classList.add(\"toggle\");\n todoLiDivInputCheck.type = \"checkbox\";\n todoLiDivInputCheck.checked = item.status;\n\n\n let todoLiDivLabel = document.createElement('label');\n todoLiDivLabel.innerText = item.message;\n\n let todoLiDivButton = document.createElement('button');\n todoLiDivButton.classList.add(\"destroy\");\n\n let todoLiDivInputEdit = document.createElement('input');\n todoLiDivInputEdit.classList.add(\"edit\");\n todoLiDivInputEdit.value = item.message;\n\n todoLiDiv.appendChild(todoLiDivInputCheck);\n todoLiDiv.appendChild(todoLiDivLabel);\n todoLiDiv.appendChild(todoLiDivButton);\n todoLi.appendChild(todoLiDiv);\n todoLi.appendChild(todoLiDivInputEdit);\n todo_list.appendChild(todoLi);\n }", "function createNewUpsaleItem(item ,price) {\n\t\t\t\tvar new_portion_li = document.createElement(\"li\");\n\t\t\t\tnew_portion_li.className = \"food_item_info_li substitutions_and_extras\";\n\t\t\t\tnew_portion_li.innerHTML = '<span class=\"food_item_info_span_L substitutions_and_extras\">'+\n\t\t\t\t\t\t\t\t\t\t\t\tenterHtml(item)+\n\t\t\t\t\t\t\t\t\t\t '</span>'+\n\t\t\t\t \t\t\t '<span class=\"food_item_info_span_R substitutions_and_extras\">'+\n\t\t\t\t \t\t\t \t\tenterHtml(price)+\n\t\t\t\t \t\t\t \t'</span>';\n\t\t\t\t \n\t\t\t\treturn new_portion_li;\n\t\t\t}", "function createCalendarDomItem(\n itemDate, itemWhat, itemWith, itemPhone, itemWhere, itemNotes\n){\n const itemElement = document.createElement('li');\n\n // tag name date for date\n\n // tag name h2 for title\n\n // tag name with for with\n\n // tag name phone for phone number\n\n // tag name where for address\n\n // tag name notes for notes\n\n\n calendarElement.appendChild(itemElement);\n}", "function createListElement() {\n\n\tvar span = document.createElement(\"span\");\n\n\tspan.appendChild(document.createTextNode(input.value));\n\tspan.id = input.value;\n\tspan.value = span.id;\n\tspan.onclick = ChangeDoneStatusForCreatedItems;\n\n\tvar li = document.createElement(\"li\");\n\n\tli.className = \"toDo\";\n\tul.appendChild( li );\n\tli.appendChild( span );\n\n\tvar delBtn = document.createElement( \"button\" );\n\tdelBtn.appendChild(document.createTextNode(\"Delete\"));\n\tdelBtn.className = \"delete\";\n\tdelBtn.onclick = DeleteListElement;\n\tli.insertBefore( delBtn, span );\n\n\tul.appendChild( li );\n\n\tinput.value = \"\";\n\n}", "function addItem(){\n var input = document.getElementById('input');\n var item = input.value;\n ul = document.getElementById('list');\n var textnode = document.createTextNode(item);\n \n if(item === ''){\n return false;\n }else{\n li = document.createElement('li');\n \n \n //defining the attributes\n var checkbox = document.createElement('input');\n checkbox.type = 'checkbox';\n checkbox.setAttribute('id','check');\n \n var label = document.createElement('label');\n label.setAttribute('for','item');\n \n ul.appendChild(label);\n\n //adding sub-child to the parent\n li.appendChild(checkbox);\n label.appendChild(textnode);\n li.appendChild(label);\n ul.insertBefore(li, ul.childNodes[0]);\n \n \n //timeout functionality for animation effect while adding the data\n setTimeout(function(){\n li.className = 'visual';\n },20)\n \n input.value = '';\n \n }\n }", "function createListItem(side, value, attribute) {\n var listItem = document.createElement('li');\n listItem.textContent = attribute;\n // Change the below widths for list element widths\n if(side) {\n listItem.style.width = \"150px\";\n }\n else {\n listItem.style.width = \"140px\";\n }\n\n // Creates the proper identifier in the list, particularly the exchange has to be shortened to fit inside the tooltip\n var valueHolder = document.createElement('span');\n valueHolder.style.float = \"right\";\n if(typeof value == 'number') {\n value = convertValue(value);\n }\n else if(attribute == \"Exchange\") {\n value = value.toString();\n if(value.includes(\"Nasdaq\")) {\n value = \"NASDAQ\";\n }\n console.log(value);\n } \n \n // Place the text content into the list which will be added to the tooltip on return\n valueHolder.textContent = value;\n listItem.appendChild(valueHolder);\n return listItem;\n}", "function newListEntry(entry) {\n var listEntry = newElement('li');\n var listText = newElement('span');\n var actionContainer = newElement('div');\n var runButton = createIconButton('power-off', true, null, entry, _run);\n var editButton = createIconButton('edit', true, null, entry, _edit);\n var deleteButton = createIconButton('trash', true, null, entry, _delete);\n listText.innerHTML = entry.name;\n actionContainer.appendChild(runButton);\n actionContainer.appendChild(editButton);\n actionContainer.appendChild(deleteButton);\n listEntry.appendChild(listText);\n listEntry.appendChild(actionContainer);\n return listEntry;\n}", "function createItemEl(columnEl, columnIndex, item, itemIndex) {\n // List Item\n const listEl = document.createElement('li');\n listEl.classList.add('drag-item');\n listEl.id = itemIndex;\n listEl.textContent = item;\n listEl.contentEditable = true;\n listEl.setAttribute('onfocusout', `updateItem(${columnIndex}, ${itemIndex})`);\n\n listEl.draggable = true;\n listEl.setAttribute('ondragstart', 'drag(event)');\n\n columnEl.append(listEl);\n}", "function createTodoListItem(todo) {\n // var checkbox = document.createElement('input');\n // checkbox.className = 'toggle';\n // checkbox.type = 'checkbox';\n // checkbox.addEventListener('change', checkboxChanged.bind(this, todo));\n\n var label = document.createElement('label');\n label.innerHTML = todo.title;\n //label.addEventListener('dblclick', todoDblClicked.bind(this, todo));\n\n // var deleteLink = document.createElement('button');\n // deleteLink.className = 'destroy';\n // deleteLink.addEventListener( 'click', deleteButtonPressed.bind(this, todo));\n\n var divDisplay = document.createElement('div');\n divDisplay.className = 'view';\n // divDisplay.appendChild(checkbox);\n divDisplay.appendChild(label);\n // divDisplay.appendChild(deleteLink);\n\n // var inputEditTodo = document.createElement('input');\n // inputEditTodo.id = 'input_' + todo._id;\n // inputEditTodo.className = 'edit';\n // inputEditTodo.value = todo.title;\n // inputEditTodo.addEventListener('keypress', todoKeyPressed.bind(this, todo));\n // inputEditTodo.addEventListener('blur', todoBlurred.bind(this, todo));\n\n var li = document.createElement('li');\n li.id = 'li_' + todo._id;\n li.appendChild(divDisplay);\n // li.appendChild(inputEditTodo);\n\n if (todo.completed) {\n li.className += 'complete';\n checkbox.checked = true;\n }\n\n return li;\n}", "function createListElement(text) {\n const liElement = document.createElement('li');\n liElement.innerText = text;\n return liElement;\n}", "function createListElement(text) {\n const liElement = document.createElement('li');\n liElement.innerText = text;\n return liElement;\n}", "function createListElement(text) {\n const liElement = document.createElement('li');\n liElement.innerText = text;\n return liElement;\n}", "function createListElement(text) {\n const liElement = document.createElement('li');\n liElement.innerText = text;\n return liElement;\n}", "function create_item( s ){\n\n\tlet this_item = template_item_dom.cloneNode(true);\n\tthis_item.id = \"item\" + (now_item_top);\n\tthis_item.children[1].textContent = s ;\n\tthis_item.children[2].id = now_item_top + '_img' ;\n\tthis_item.children[0].children[0].id = \"\" + (now_item_top);\n\tthis_item.children[0].children[1].htmlFor = \"\" + (now_item_top);\n\n\tif ( now_mode != 'Completed' ){\n\t\t\n\t\tthis_item.children[1].style['opacity']='0';\n\t\tthis_item.children[0].style['opacity']='0';\n\t\tlet item_main = document.getElementById(\"todo-list\");\n\t\tlet temp_li = document.createElement(\"LI\");\n\t\ttemp_li.classList.add('todo-app__item_2');\n\t\ttemp_li.classList.add('heightTranslate');\n\t\titem_main.prepend(temp_li);\n\t\ttemp_li.style['min-height'] = 0;\n\t\tsetTimeout(function(){\n\t\t\ttemp_li.style['min-height'] = '5em';\n\t\t\tsetTimeout(function(){\n\t\t\t\titem_main.prepend(this_item);\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tthis_item.children[1].style['opacity']='1';\n\t\t\t\t\tthis_item.children[0].style['opacity']='1';\n\t\t\t\t},100)\n\t\t\t\titem_main.removeChild(temp_li);\n\t\t\t},1500)\n\t\t},300);\n\t}\n\tnow_exist_items[now_item_top] = this_item;\n\tnow_item_top ++ ;\n\tupdate_left();\n}", "function NewList() {\r\n}", "function createItem(checkBox, tag, index, identifier, term) {\n return $(\"<li>\").text(tag).addClass(\"dd-options\").append(checkBox)\n .data(\"event\", iterateCourse(index, identifier, term));\n }", "function createItemEl(columnEl, column, item, index) {\n // console.log(\"columnEl:\", columnEl);\n // console.log(\"column:\", column);\n // console.log(\"item:\", item);\n // console.log(\"index:\", index);\n // List Item\n const listEl = document.createElement(\"li\");\n listEl.classList.add(\"drag-item\");\n listEl.textContent = item;\n listEl.draggable = true;\n listEl.setAttribute(\"ondragstart\", \"drag(event)\");\n listEl.contentEditable = true;\n listEl.id = `${column}_${index}`;\n listEl.setAttribute(\"onfocusout\", `updateItem(${index},${column})`);\n // Append\n columnEl.appendChild(listEl);\n}", "function ListBuilder() {\r\n}", "function populateListView(listview,icon) {\n\t/* TODO: doesn't work anymore since the arrays .. are DIFFERENT! :-O\n for (var i = 0; i < list.entries.length; i++) {\n\t\tvar listItem = document.createElement('li');\n listItem.setAttribute('id','li'+i);\n listItem.setAttribute('data-icon',icon);\n listItem.setAttribute('data-corners',\"false\");\n listItem.setAttribute('data-shadow',\"false\");\n listItem.setAttribute('data-iconshadow',\"true\");\n listItem.setAttribute('data-wrapperels',\"div\");\n listItem.setAttribute('data-iconpos',\"right\");\n listItem.setAttribute('data-theme',\"c\");\n listItem.innerHTML = \"<a>\"+list.entries[i].name+\"</a>\";\n \n listview.appendChild(listItem);\n //$('listview').listview();\n //$('listview').listview('refresh');\n\t}*/\n\t//$(\"#shopping\").trigger(\"create\");\n}", "function createNoteLiItem(note) {\n const li = $('<li class=\"list-group-item\">');\n const noteBody = $('<p>').text(note.body);\n const deleteNoteBtn = $('<button class=\"btn btn-danger delete-note\">').text('Delete Note');\n deleteNoteBtn.attr('data-note-id', note._id);\n li.append(noteBody, deleteNoteBtn);\n notesElem.append(li);\n }", "function newLiButtonClicked(){\n createListItem();\n }", "function createElement() {\n\tvar li = document.createElement(\"li\");\n\t\tli.appendChild(document.createTextNode(input.value));\n\t\t\tui.appendChild(li);\n\t\t\tinput.value = \"\";\n\n\t// Create delete button for each new list item\n\tvar btn = document.createElement(\"button\");\n\t\t\tbtn.appendChild(document.createTextNode(\"Delete\"));\n\t\t\tli.appendChild(btn);\n\t\t\tbtn.onclick = removeParent;\n}", "function createListElement() {\n\tvar li = document.createElement(\"li\"); // create an li\n\tli.appendChild(document.createTextNode(input.value)); //append a child with the value of input\n\tassignDoneToggle(li); // assign an event listener \n\tul.appendChild(li); // append the li to the ul\n\taddDeleteButton(li); //item has delete button\n\tinput.value = \"\"; // reset the input field to empty\n\n}", "function ListItem(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n content = props.content,\n description = props.description,\n disabled = props.disabled,\n header = props.header,\n icon = props.icon,\n image = props.image,\n value = props.value;\n\n\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"c\" /* getElementType */])(ListItem, props);\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(active, 'active'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(disabled, 'disabled'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(ElementType !== 'li', 'item'), className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"b\" /* getUnhandledProps */])(ListItem, props);\n var valueProp = ElementType === 'li' ? { value: value } : { 'data-value': value };\n\n if (!__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, valueProp, { role: 'listitem', className: classes }),\n children\n );\n }\n\n var iconElement = __WEBPACK_IMPORTED_MODULE_10__ListIcon__[\"a\" /* default */].create(icon);\n var imageElement = __WEBPACK_IMPORTED_MODULE_6__elements_Image__[\"a\" /* default */].create(image);\n\n // See description of `content` prop for explanation about why this is necessary.\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_react__[\"isValidElement\"])(content) && __WEBPACK_IMPORTED_MODULE_1_lodash_isPlainObject___default()(content)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, valueProp, { role: 'listitem', className: classes }),\n iconElement || imageElement,\n __WEBPACK_IMPORTED_MODULE_7__ListContent__[\"a\" /* default */].create(content, { header: header, description: description })\n );\n }\n\n var headerElement = __WEBPACK_IMPORTED_MODULE_9__ListHeader__[\"a\" /* default */].create(header);\n var descriptionElement = __WEBPACK_IMPORTED_MODULE_8__ListDescription__[\"a\" /* default */].create(description);\n\n if (iconElement || imageElement) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, valueProp, { role: 'listitem', className: classes }),\n iconElement || imageElement,\n (content || headerElement || descriptionElement) && __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_7__ListContent__[\"a\" /* default */],\n null,\n headerElement,\n descriptionElement,\n content\n )\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, valueProp, { role: 'listitem', className: classes }),\n headerElement,\n descriptionElement,\n content\n );\n}", "function createListElement() {\n currentMaxId += 1; //index of this inserted element\n\tvar li = document.createElement(\"li\");\n //Create a span text with class and unique id\n var span = document.createElement(\"span\");\n span.appendChild(document.createTextNode(input.value + \" \"));\n span.setAttribute(\"class\", \"todo-item\");\n span.setAttribute(\"id\", \"todo-\"+currentMaxId);\n //Create a remove button with correct attributes and unique id\n var btn = document.createElement(\"button\");\n btn.appendChild(document.createTextNode(\"Remove\"));\n btn.setAttribute(\"class\", \"remove-button\");\n btn.setAttribute(\"type\", \"button\");\n btn.setAttribute(\"name\", \"rm-button\");\n btn.setAttribute(\"id\", \"rm-\"+currentMaxId);\n //Set the HTML of the list item (Ref: https://stackoverflow.com/a/36798273)\n\tli.innerHTML += span.outerHTML + btn.outerHTML;\n //Set attribute of the current list item\n li.setAttribute(\"id\", \"li-\"+currentMaxId);\n\tul.appendChild(li);\n //Add event listener to this newly created list item\n document.getElementById(\"todo-\"+currentMaxId).addEventListener(\"click\", toggleDone(currentMaxId));\n document.getElementById(\"rm-\"+currentMaxId).addEventListener(\"click\", removeListAfterClick);\n\tinput.value = \"\"; //Reset the input value\n}", "function addItem() {\n var contents = document.getElementById('newTask').value;\n var item = new listItem(Date.now(), contents, false);\n masterList.push(item);\n showList(masterList);\n saveList();\n}", "function createLI(text) {\n function createElement(elementName, property, value) {\n const element = document.createElement(elementName); \n element[property] = value; \n return element;\n }\n function appendToLI(elementName, property, value) {\n const element = createElement(elementName, property, value); \n li.appendChild(element); \n return element;\n }\n const li = document.createElement('li');\n appendToLI('span', 'textContent', text); \n\n //add a notes paragraph and set styling\n const notes = document.createElement('span');\n notes.style.fontSize = '.9em';\n notes.style.padding = '.5em';\n notes.textContent = 'Notes: ';\n li.appendChild(notes);\n\n appendToLI('label', 'textContent', 'Confirm')\n .appendChild(createElement('input', 'type', 'checkbox'));\n\n //add a select for not attending\n li.appendChild(createElement('br'));\n const notAttending = document.createElement('select');\n notAttending.name = 'notAttending';\n li.appendChild(notAttending);\n const option1 = document.createElement('option');\n option1.textContent = 'Attending?';\n option1.value = 'maybe';\n notAttending.appendChild(option1);\n const option2 = document.createElement('option');\n option2.textContent = 'Not Attending';\n option2.value = 'no';\n notAttending.appendChild(option2);\n li.appendChild(createElement('br'));\n\n appendToLI('button', 'textContent', 'edit');\n appendToLI('button', 'textContent', 'remove');\n \n return li;\n }", "function loadList() {\n newToDoItem(\"Buy milk\", true)\n newToDoItem(\"Do dishes\", false)\n newToDoItem(\"Feed Tito\", true)\n}", "function createItem(options) {\n\n\n var deferred = $q.defer();\n\n var defObject = {\n listName: false,\n data: false,\n fields: false\n };\n\n var settings = $.extend({}, defObject, options);\n\n if ((!settings.listName) && (!settings.data) && (!settings.fields)) {\n deferred.reject();\n return deferred.promise;\n }\n\n\n var context = SP.ClientContext.get_current();\n\n var oList = context.get_web().get_lists().getByTitle(settings.listName);\n\n var itemCreateInfo = new SP.ListItemCreationInformation();\n var oListItem = oList.addItem(itemCreateInfo);\n\n settings.data = helperService.parse(settings.data, settings.fields.mappingToSP);\n\n\n //Bulk create list items\n $.each(settings.data, function (key, value) {\n // check if mutiple lookup\n if (Object.prototype.toString.call(value) === '[object Array]') {\n var lookups = [];\n $.each(value, function (i, lid) {\n var lookup = new SP.FieldLookupValue();\n lookup.set_lookupId(lid);\n lookups.push(lookup);\n });\n oListItem.set_item(key, lookups);\n } else {\n oListItem.set_item(key, value);\n }\n });\n\n\n oListItem.update();\n\n\n context.load(oListItem);\n context.executeQueryAsync(success, fail);\n\n function success() {\n // load query details to json object\n var taskEntry = oListItem.get_fieldValues();\n deferred.resolve(helperService.parse(taskEntry, settings.fields.mappingFromSP));\n }\n\n function fail(sender, args) {\n deferred.reject(args);\n }\n\n return deferred.promise;\n\n }", "function makeNavItem(item){\n const listItem = document.createElement(\"LI\");\n const anchor = document.createElement(\"A\");\n const sectionId = item.getAttribute(\"id\");\n anchor.setAttribute(\"class\", \"menu__link\");\n anchor.setAttribute(\"href\", `#${sectionId}`);\n anchor.textContent = item.getAttribute(\"data-nav\");\n anchor.onclick = (e) => {\n e.preventDefault();\n smoothScroll(sectionId);\n };\n listItem.appendChild(anchor);\n return listItem;\n}" ]
[ "0.7933701", "0.7933701", "0.7933701", "0.7513478", "0.7332212", "0.7329313", "0.73014504", "0.72095823", "0.71312386", "0.7061145", "0.705334", "0.7006667", "0.6954094", "0.6950646", "0.6912602", "0.6853206", "0.68186045", "0.68030655", "0.6799364", "0.67781395", "0.67691636", "0.6766386", "0.6747515", "0.67398864", "0.67000705", "0.6680774", "0.66650456", "0.6661971", "0.665804", "0.66567624", "0.6631196", "0.6611882", "0.66116315", "0.65981627", "0.6595423", "0.6582927", "0.65813905", "0.6572273", "0.6568048", "0.65607023", "0.65458816", "0.6538685", "0.65372324", "0.6516059", "0.64970946", "0.64857024", "0.6484983", "0.6482238", "0.64750427", "0.64694315", "0.64576876", "0.6454982", "0.6451696", "0.6449542", "0.64488", "0.64442235", "0.64428926", "0.64380944", "0.64213157", "0.6417035", "0.64049333", "0.63992435", "0.6393732", "0.6390673", "0.63894", "0.63871056", "0.6381468", "0.6373092", "0.6367979", "0.636371", "0.6359172", "0.6357617", "0.6355628", "0.6354392", "0.63446736", "0.6339908", "0.6330901", "0.6327234", "0.6323994", "0.63193816", "0.631821", "0.631821", "0.631821", "0.631821", "0.6307585", "0.62982035", "0.62730354", "0.6267282", "0.62663794", "0.62362623", "0.62343717", "0.6224666", "0.62160254", "0.6213977", "0.62101823", "0.62073237", "0.6187792", "0.61811036", "0.617994", "0.61713845", "0.61652267" ]
0.0
-1
A simple replacer which removed all matches, and adds their length to `offset`.
function replacer($0) { offsets[line] = (offsets[line] || 0) + $0.length; line++; return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replacer($0) {\n offsets[line] = (offsets[line] || 0) + $0.length\n line++\n\n return ''\n }", "function replacer(match, p1, p2, p3, offset, string) {\n // p1 is nondigits, p2 digits, and p3 non-alphanumerics\n return [p1, p2, p3].join(' - ');\n}", "function replacer(match, p1, p2, p3, offset, string){\n // p1 is nondigits, p2 digits, and p3 non-alphanumerics\n return [p1, p2, p3].join(' - ');\n}", "function replacer(match, p1, p2, p3, offset, string) {\n // p1 is nondigits, p2 digits, and p3 non-alphanumerics\n return [p1, p2, p3].join(' - ');\n }", "function replaceWithOffset(text, offset, STATE) {\r\n if (offset < 0) {\r\n text = text\r\n .replace(/\\t/g, ' '.repeat(STATE.CONFIG.tabSize))\r\n .replace(new RegExp(\"^ {\" + Math.abs(offset) + \"}\"), '');\r\n if (!STATE.CONFIG.insertSpaces) {\r\n text = replaceSpacesOrTabs(text, STATE, false);\r\n }\r\n }\r\n else {\r\n text = text.replace(/^/, STATE.CONFIG.insertSpaces ? ' '.repeat(offset) : '\\t'.repeat(offset / STATE.CONFIG.tabSize));\r\n }\r\n return text;\r\n}", "patchAsExpression() {\n let indexStart = this.getIndexStartSourceToken();\n // `a[0..1]` → `a.slice(0..1]`\n // ^ ^^^^^^^\n this.overwrite(indexStart.start, indexStart.end, '.slice(');\n if (this.left) {\n this.left.patch();\n } else if (this.right) {\n // `a.slice(..1]` → `a.slice(0..1]`\n // ^\n this.insert(indexStart.end, '0');\n }\n let slice = this.getSliceSourceToken();\n let inclusive = slice.end - slice.start === '..'.length;\n let right = this.right;\n if (right) {\n // `a.slice(0..1]` → `a.slice(0, 1]`\n // ^^ ^^\n this.overwrite(slice.start, slice.end, ', ');\n if (inclusive) {\n if (right.node.type === 'Int') {\n this.overwrite(\n right.contentStart,\n right.contentEnd,\n `${right.node.data + 1}`\n );\n } else {\n right.patch();\n this.insert(right.outerEnd, ' + 1');\n }\n } else {\n right.patch();\n }\n } else {\n // `a.slice(0..]` → `a.slice(0]`\n // ^^\n this.overwrite(slice.start, slice.end, '');\n }\n let indexEnd = this.getIndexEndSourceToken();\n // `a.slice(0, 1]` → `a.slice(0, 1)`\n // ^ ^\n this.overwrite(indexEnd.start, indexEnd.end, ')');\n }", "function prefixer(match, p1, offset, string) {\n\t\t\t\t\treturn ('00000000000000000000'+match).substr(-20);\n\t\t\t\t}", "function prefixer(match, p1, offset, string) {\n return ('00000000000000000000' + match).substr(-20);\n }", "static normalizeOffset(src, offset) {\n const ch = src[offset];\n return !ch ? offset : ch !== '\\n' && src[offset - 1] === '\\n' ? offset - 1 : Node.endOfWhiteSpace(src, offset);\n }", "static normalizeOffset(src, offset) {\n const ch = src[offset];\n return !ch ? offset : ch !== '\\n' && src[offset - 1] === '\\n' ? offset - 1 : Node.endOfWhiteSpace(src, offset);\n }", "static normalizeOffset(src, offset) {\n const ch = src[offset];\n return !ch ? offset : ch !== '\\n' && src[offset - 1] === '\\n' ? offset - 1 : Node.endOfWhiteSpace(src, offset);\n }", "static normalizeOffset(src, offset) {\n const ch = src[offset];\n return !ch ? offset : ch !== '\\n' && src[offset - 1] === '\\n' ? offset - 1 : Node.endOfWhiteSpace(src, offset);\n }", "static normalizeOffset(src, offset) {\n const ch = src[offset];\n return !ch ? offset : ch !== '\\n' && src[offset - 1] === '\\n' ? offset - 1 : Node.endOfWhiteSpace(src, offset);\n }", "_remap(map, start, end, len) {\n /* IDEA BEHIND MAP ADJUSTMENT:\n * 1) Maintain two parallel strings, `msg0` (original) and `msg` (final).\n * 2) Maintain the following invariant:\n * a) msg0.indexOf(\"substr\") === map[msg.indexOf(\"substr\")]\n * b) msg0[idx] === msg1[map[idx]]\n * Exceptions:\n * If msg0[idx] is part of a formatted entity; msg[map[idx]] may not be\n * the same character.\n * Usage:\n * The map allows for formatting the final message based on where items\n * appear in the original message.\n */\n let mstart = map[start];\n let mend = map[end];\n for (let idx = start; idx < end; ++idx) {\n /* Set values within the range to the end */\n map[idx] = mend + len;\n }\n for (let idx = end; idx < map.length; ++idx) {\n /* Adjust values beyond the range by length */\n map[idx] += len - (mend - mstart);\n }\n }", "function replacer(match) {\n if (match === from) {\n return to;\n } else {\n return match;\n }\n }", "function offsetSpaces (offset) {\n var res = '' , i;\n for (i = 0; i < offset; i += 1) { res += spacer; }\n return res;\n}", "adjusted(offset) {\n return new ProgramAnnotation(this.text, this.begin + offset, this.end + offset);\n }", "function adjustOffset(textarea, offset) {\n const val = textarea.value;\n let newOffset = offset;\n\n if (val.indexOf('\\r\\n') > -1) {\n const matches = val.replace(/\\r\\n/g, '\\n').slice(0, offset).match(/\\n/g);\n newOffset += matches ? matches.length : 0;\n }\n\n return newOffset;\n}", "function adjustPos(orig, folded, pos) {\n if (orig.length == folded.length) return pos;\n for (var pos1 = Math.min(pos, orig.length);;) {\n var len1 = orig.slice(0, pos1).toLowerCase().length;\n if (len1 < pos) ++pos1;else if (len1 > pos) --pos1;else return pos1;\n }\n }", "function adjustPos(orig, folded, pos) {\n if (orig.length == folded.length) return pos;\n for (var pos1 = Math.min(pos, orig.length);;) {\n var len1 = orig.slice(0, pos1).toLowerCase().length;\n if (len1 < pos) ++pos1;\n else if (len1 > pos) --pos1;\n else return pos1;\n }\n }", "function adjustPos(orig, folded, pos) {\n if (orig.length == folded.length) return pos;\n for (var pos1 = Math.min(pos, orig.length);;) {\n var len1 = orig.slice(0, pos1).toLowerCase().length;\n if (len1 < pos) ++pos1;\n else if (len1 > pos) --pos1;\n else return pos1;\n }\n }", "function adjustPos(orig, folded, pos) {\n if (orig.length == folded.length) return pos;\n for (var pos1 = Math.min(pos, orig.length);;) {\n var len1 = orig.slice(0, pos1).toLowerCase().length;\n if (len1 < pos) ++pos1;\n else if (len1 > pos) --pos1;\n else return pos1;\n }\n }", "wordReplacedByEmoji(newText, oldText, difference, startPoint, lastPoint) {\n let d = oldText.slice(startPoint, lastPoint).split(' ')[0]\n console.log(\"d: \" + d + \" len: \" + d.length + \" start: \" + startPoint + \" end: \" + lastPoint + \" lenOld: \" + oldText.length + \" lenNew: \" + newText.length)\n return d.length\n }", "deleteValueAtOffset(offset) {\n if (offset < 0 || offset > this.length) {\n throw new Error(`Invalid offset \"${offset}\"`);\n }\n const [ left, right ] = [\n this.value.slice(0, offset),\n this.value.slice(offset+1)\n ];\n this.value = left + right;\n }", "function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var pos1 = Math.min(pos, orig.length);;) {\n var len1 = foldFunc(orig.slice(0, pos1)).length\n if (len1 < pos) ++pos1\n else if (len1 > pos) --pos1\n else return pos1\n }\n }", "function replacer(match) {\n let len = match.length;\n\n // This is completely arbitrary but just demonstrating\n // you can make up your own logic\n if (len == 3) {\n // Make the word upper case\n return match.toUpperCase();\n } else if (len == 4) {\n // Pick a random word from the array\n let index = floor(random(0, four.length));\n return four[index];\n } else if (len == 5) {\n // Pick a random word from the array\n let index = floor(random(0, five.length));\n return five[index];\n }\n\n }", "function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\r\n let linesCount = 0;\r\n let lastNewLinePos = -1;\r\n for (let i = 0; i < numberOfCharacters; i++) {\r\n if (source.charCodeAt(i) === 10 /* newline char code */) {\r\n linesCount++;\r\n lastNewLinePos = i;\r\n }\r\n }\r\n pos.offset += numberOfCharacters;\r\n pos.line += linesCount;\r\n pos.column =\r\n lastNewLinePos === -1\r\n ? pos.column + numberOfCharacters\r\n : numberOfCharacters - lastNewLinePos;\r\n return pos;\r\n}", "function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\r\n let linesCount = 0;\r\n let lastNewLinePos = -1;\r\n for (let i = 0; i < numberOfCharacters; i++) {\r\n if (source.charCodeAt(i) === 10 /* newline char code */) {\r\n linesCount++;\r\n lastNewLinePos = i;\r\n }\r\n }\r\n pos.offset += numberOfCharacters;\r\n pos.line += linesCount;\r\n pos.column =\r\n lastNewLinePos === -1\r\n ? pos.column + numberOfCharacters\r\n : numberOfCharacters - lastNewLinePos;\r\n return pos;\r\n}", "function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\n let linesCount = 0;\n let lastNewLinePos = -1;\n for (let i = 0; i < numberOfCharacters; i++) {\n if (source.charCodeAt(i) === 10 /* newline char code */) {\n linesCount++;\n lastNewLinePos = i;\n }\n }\n pos.offset += numberOfCharacters;\n pos.line += linesCount;\n pos.column =\n lastNewLinePos === -1\n ? pos.column + numberOfCharacters\n : numberOfCharacters - lastNewLinePos;\n return pos;\n}", "function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\n let linesCount = 0;\n let lastNewLinePos = -1;\n for (let i = 0; i < numberOfCharacters; i++) {\n if (source.charCodeAt(i) === 10 /* newline char code */) {\n linesCount++;\n lastNewLinePos = i;\n }\n }\n pos.offset += numberOfCharacters;\n pos.line += linesCount;\n pos.column =\n lastNewLinePos === -1\n ? pos.column + numberOfCharacters\n : numberOfCharacters - lastNewLinePos;\n return pos;\n}", "function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\n let linesCount = 0;\n let lastNewLinePos = -1;\n for (let i = 0; i < numberOfCharacters; i++) {\n if (source.charCodeAt(i) === 10 /* newline char code */) {\n linesCount++;\n lastNewLinePos = i;\n }\n }\n pos.offset += numberOfCharacters;\n pos.line += linesCount;\n pos.column =\n lastNewLinePos === -1\n ? pos.column + numberOfCharacters\n : numberOfCharacters - lastNewLinePos;\n return pos;\n}", "function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\n let linesCount = 0;\n let lastNewLinePos = -1;\n for (let i = 0; i < numberOfCharacters; i++) {\n if (source.charCodeAt(i) === 10 /* newline char code */) {\n linesCount++;\n lastNewLinePos = i;\n }\n }\n pos.offset += numberOfCharacters;\n pos.line += linesCount;\n pos.column =\n lastNewLinePos === -1\n ? pos.column + numberOfCharacters\n : numberOfCharacters - lastNewLinePos;\n return pos;\n}", "function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\n let linesCount = 0;\n let lastNewLinePos = -1;\n for (let i = 0; i < numberOfCharacters; i++) {\n if (source.charCodeAt(i) === 10 /* newline char code */) {\n linesCount++;\n lastNewLinePos = i;\n }\n }\n pos.offset += numberOfCharacters;\n pos.line += linesCount;\n pos.column =\n lastNewLinePos === -1\n ? pos.column + numberOfCharacters\n : numberOfCharacters - lastNewLinePos;\n return pos;\n}", "function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\n let linesCount = 0;\n let lastNewLinePos = -1;\n for (let i = 0; i < numberOfCharacters; i++) {\n if (source.charCodeAt(i) === 10 /* newline char code */) {\n linesCount++;\n lastNewLinePos = i;\n }\n }\n pos.offset += numberOfCharacters;\n pos.line += linesCount;\n pos.column =\n lastNewLinePos === -1\n ? pos.column + numberOfCharacters\n : numberOfCharacters - lastNewLinePos;\n return pos;\n}", "function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\n\t let linesCount = 0;\n\t let lastNewLinePos = -1;\n\t for (let i = 0; i < numberOfCharacters; i++) {\n\t if (source.charCodeAt(i) === 10 /* newline char code */) {\n\t linesCount++;\n\t lastNewLinePos = i;\n\t }\n\t }\n\t pos.offset += numberOfCharacters;\n\t pos.line += linesCount;\n\t pos.column =\n\t lastNewLinePos === -1\n\t ? pos.column + numberOfCharacters\n\t : numberOfCharacters - lastNewLinePos;\n\t return pos;\n\t}", "function rjust(s, targetLen, padding) {\n while (s.length < targetLen)\n s = padding + s\n return s\n}", "function substitute(arg){\r\n let mapped = [];\r\n let i = 0;\r\n mapArray(arg, function (el) {\r\n if (el > 30) {\r\n mapped[i] = el;\r\n } else {\r\n mapped[i] = '*';\r\n }\r\n i++;\r\n });\r\n return mapped;\r\n}", "function replaceFunc(f) {\n return (...args) => { // args are [match, group1, group2, ..., offset, whole string, (some browsers:) named groups obj]\n const info = { // replace function will be called with this object\n match: args[0], // full matching string\n groups: [args[0]], // matched groups per index and, if available, by name\n offset: -1, // offset of match in all\n all: '', // full text in which match was found\n };\n let i=1;\n while(i<args.length && 'number' !== typeof args[i]) info.groups.push(args[i++]);\n info.offset = args[i];\n info.all = args[i+1];\n Object.entries(args[i+2] || {}).forEach(([k,v]) => info.groups[k] = v);\n return f.call(null, info);\n };\n}", "withOffsetY(offset) {\n this._positionStrategy.withDefaultOffsetY(offset);\n return this;\n }", "function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1\n var len = foldFunc(orig.slice(0, mid)).length\n if (len == pos) return mid\n else if (len > pos) max = mid\n else min = mid + 1\n }\n }", "function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1\n var len = foldFunc(orig.slice(0, mid)).length\n if (len == pos) return mid\n else if (len > pos) max = mid\n else min = mid + 1\n }\n }", "function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1\n var len = foldFunc(orig.slice(0, mid)).length\n if (len == pos) return mid\n else if (len > pos) max = mid\n else min = mid + 1\n }\n }", "function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1\n var len = foldFunc(orig.slice(0, mid)).length\n if (len == pos) return mid\n else if (len > pos) max = mid\n else min = mid + 1\n }\n }", "function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1\n var len = foldFunc(orig.slice(0, mid)).length\n if (len == pos) return mid\n else if (len > pos) max = mid\n else min = mid + 1\n }\n }", "function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1\n var len = foldFunc(orig.slice(0, mid)).length\n if (len == pos) return mid\n else if (len > pos) max = mid\n else min = mid + 1\n }\n }", "function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos;\n\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min;\n var mid = min + max >> 1;\n var len = foldFunc(orig.slice(0, mid)).length;\n if (len == pos) return mid;else if (len > pos) max = mid;else min = mid + 1;\n }\n }", "function offsetStringCharacters(string, offset) {\r\n let offsetString1 = \"\";\r\n let offsetString2 = \"\";\r\n\r\n for (let i = 0; i < string.length; i++) {\r\n if (i >= offset) {\r\n offsetString2 += string[i];\r\n } else {\r\n offsetString1 += string[i];\r\n }\r\n }\r\n return offsetString2 + offsetString1;\r\n}", "function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1;\n var len = foldFunc(orig.slice(0, mid)).length;\n if (len == pos) return mid\n else if (len > pos) max = mid;\n else min = mid + 1;\n }\n }", "function replace_values(match, offset, s){\n var idx = parseInt(match.slice(2, -2), 10) - 1;\n if (match[0] === '{'){\n return expressionValues[idx] || 'null';\n }else{\n return childValues[idx] || '/* do nothing */';\n }\n }", "setOffset(offset) {\n if (Array.isArray(offset)) {\n this.offset = () => offset;\n }\n else {\n this.offset = offset;\n }\n }", "setOffset(offset) {\n if (Array.isArray(offset)) {\n this.offset = () => offset;\n }\n else {\n this.offset = offset;\n }\n }", "setOffset(offset) {\n if (Array.isArray(offset)) {\n this.offset = () => offset;\n }\n else {\n this.offset = offset;\n }\n }", "setOffset(offset) {\n if (Array.isArray(offset)) {\n this.offset = () => offset;\n }\n else {\n this.offset = offset;\n }\n }", "setOffset(offset) {\n if (Array.isArray(offset)) {\n this.offset = () => offset;\n }\n else {\n this.offset = offset;\n }\n }", "setOffset(offset) {\n if (Array.isArray(offset)) {\n this.offset = () => offset;\n } else {\n this.offset = offset;\n }\n }", "positionAt(offset) {\n const before = this.textDocument.slice(0, offset);\n const newLines = before.match(/\\n/g);\n const line = newLines ? newLines.length : 0;\n const preCharacters = before.match(/(\\n|^).*$/g);\n return new tokenizer_1.Position(line, preCharacters ? preCharacters[0].length : 0);\n }", "function genReplacer(nodeName) {\n var makeReplacementNode;\n\n if (typeof nodeName !== 'function') {\n var stencilNode = nodeName.nodeType ? nodeName : doc.createElement(nodeName);\n\n makeReplacementNode = function (fill, matchIndex) {\n var clone = stencilNode.cloneNode(false);\n\n clone.setAttribute('data-mce-index', matchIndex);\n\n if (fill) {\n clone.appendChild(doc.createTextNode(fill));\n }\n\n return clone;\n };\n } else {\n makeReplacementNode = nodeName;\n }\n\n return function (range) {\n var before, after, parentNode, startNode = range.startNode,\n endNode = range.endNode, matchIndex = range.matchIndex;\n\n if (startNode === endNode) {\n var node = startNode;\n\n parentNode = node.parentNode;\n if (range.startNodeIndex > 0) {\n // Add `before` text node (before the match)\n before = doc.createTextNode(node.data.substring(0, range.startNodeIndex));\n parentNode.insertBefore(before, node);\n }\n\n // Create the replacement node:\n var el = makeReplacementNode(range.match[0], matchIndex);\n parentNode.insertBefore(el, node);\n if (range.endNodeIndex < node.length) {\n // Add `after` text node (after the match)\n after = doc.createTextNode(node.data.substring(range.endNodeIndex));\n parentNode.insertBefore(after, node);\n }\n\n node.parentNode.removeChild(node);\n\n return el;\n }\n\n // Replace startNode -> [innerNodes...] -> endNode (in that order)\n before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));\n after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));\n var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);\n var innerEls = [];\n\n for (var i = 0, l = range.innerNodes.length; i < l; ++i) {\n var innerNode = range.innerNodes[i];\n var innerEl = makeReplacementNode(innerNode.data, matchIndex);\n innerNode.parentNode.replaceChild(innerEl, innerNode);\n innerEls.push(innerEl);\n }\n\n var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);\n\n parentNode = startNode.parentNode;\n parentNode.insertBefore(before, startNode);\n parentNode.insertBefore(elA, startNode);\n parentNode.removeChild(startNode);\n\n parentNode = endNode.parentNode;\n parentNode.insertBefore(elB, endNode);\n parentNode.insertBefore(after, endNode);\n parentNode.removeChild(endNode);\n\n return elB;\n };\n }", "replace(start, deleteCount, items = EMPTY_ARRAY) {\n assert('The third argument to replace needs to be an array.', Array.isArray(items));\n\n replaceInNativeArray(this, start, deleteCount, items);\n\n return this;\n }", "function markAdder(match, p1, offset, inputString){\n var mark = currentMarkAndToolTip\n return mark.concat(match, \"</mark>\")\n}", "function replace_values(match, offset, s){\n var idx = parseInt(match.slice(2, -2), 10) - 1;\n if (match[0] === '{'){\n return expressionValues[idx] || 'null';\n }else{\n return childValues || '/* do nothing */';\n }\n }", "function replaceIndex(string, at, repl) {\n return string.replace(/\\S/g, function(match, i) {\n if( i === at ) return repl;\n return match;\n });\n }", "constructor(offset, length) {\n super(offset, length);\n }", "function cipher(string, offset) {\n // since I don't have uppercase and lowercase in my alphabet, this makes the string all lowercase\n let cleanString = string.toLowerCase();\n const alphabet = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"];\n let newString = \"\";\n for (let character of cleanString) {\n // could be changed to see if character is in alphabet. If so, then do the offsetting. Else, return the character. Catches more errors\n if (character === \" \") {\n newString += \" \";\n } else {\n // from inside out, finds the alphabet index of the character in the string, adds the offset amount, converts this new number to a number inside the range of the alphabet ( % 26), then finds what new letter in the alphabet is at that position, then adds it to the new string.\n newString += alphabet[(alphabet.indexOf(character) + offset) % 26];\n }\n }\n return newString;\n}", "function normalizeOffset(textNode, offset) {\n if (textNode.nodeType !== 3) {\n return -1;\n }\n // Find entry in textmap array (using binary search)\n var textmap = textMap,\n iEntry = textmap.length,\n entry;\n while (iEntry-- > 0) {\n entry = textmap[iEntry];\n if (textNode === entry.n) {\n //alert(entry.i+offset);\n return entry.i + offset;\n }\n }\n return -1;\n}", "function repmatch(matched, before, word, after) {\r\n\tchanges++;\r\n\treturn before + '<span class=\"' + classes[curpat] + '\">' + word + '</span>' + after;\r\n }", "function deflate_internal(buff, off, buff_size) {\n\t\tvar n;\n\n\t\tif (!initflag) {\n\t\t\tinit_deflate();\n\t\t\tinitflag = true;\n\t\t\tif (lookahead === 0) { // empty\n\t\t\t\tcomplete = true;\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tn = qcopy(buff, off, buff_size);\n\t\tif (n === buff_size) {\n\t\t\treturn buff_size;\n\t\t}\n\n\t\tif (complete) {\n\t\t\treturn n;\n\t\t}\n\n\t\tif (compr_level <= 3) {\n\t\t\t// optimized for speed\n\t\t\tdeflate_fast();\n\t\t} else {\n\t\t\tdeflate_better();\n\t\t}\n\n\t\tif (lookahead === 0) {\n\t\t\tif (match_available) {\n\t\t\t\tct_tally(0, window[strstart - 1] & 0xff);\n\t\t\t}\n\t\t\tflush_block(1);\n\t\t\tcomplete = true;\n\t\t}\n\n\t\treturn n + qcopy(buff, n + off, buff_size - n);\n\t}", "offset(val) {\n this._offset = val;\n return this;\n }", "_prepareMatches(matchesWithLength, matches, matchesLength) {\n function isSubTerm(currentIndex) {\n const currentElem = matchesWithLength[currentIndex];\n const nextElem = matchesWithLength[currentIndex + 1];\n\n // Check for cases like \"TAMEd TAME\".\n if (\n currentIndex < matchesWithLength.length - 1 &&\n currentElem.match === nextElem.match\n ) {\n currentElem.skipped = true;\n return true;\n }\n\n // Check for cases like \"thIS IS\".\n for (let i = currentIndex - 1; i >= 0; i--) {\n const prevElem = matchesWithLength[i];\n if (prevElem.skipped) {\n continue;\n }\n if (prevElem.match + prevElem.matchLength < currentElem.match) {\n break;\n }\n if (\n prevElem.match + prevElem.matchLength >=\n currentElem.match + currentElem.matchLength\n ) {\n currentElem.skipped = true;\n return true;\n }\n }\n return false;\n }\n\n // Sort the array of `{ match: <match>, matchLength: <matchLength> }`\n // objects on increasing index first and on the length otherwise.\n matchesWithLength.sort(function (a, b) {\n return a.match === b.match\n ? a.matchLength - b.matchLength\n : a.match - b.match;\n });\n for (let i = 0, len = matchesWithLength.length; i < len; i++) {\n if (isSubTerm(i)) {\n continue;\n }\n matches.push(matchesWithLength[i].match);\n matchesLength.push(matchesWithLength[i].matchLength);\n }\n }", "function getPaddedReplacement(match, template) {\n\tconst paddingLength = Math.max(match.length - template.length - 2, 0);\n\tconst padding = '_'.repeat(paddingLength);\n\n\treturn ID_START + template + padding + ID_END;\n}", "replaceTextWithMatch (suggestion) {\n if (this.editor == null) { return }\n\n const cursors = this.editor.getCursors()\n if (cursors == null) { return }\n\n return this.editor.transact(() => {\n for (let i = 0; i < cursors.length; i++) {\n const cursor = cursors[i]\n const endPosition = cursor.getBufferPosition()\n const beginningPosition = [endPosition.row, endPosition.column - suggestion.replacementPrefix.length]\n\n if (this.editor.getTextInBufferRange([beginningPosition, endPosition]) === suggestion.replacementPrefix) {\n const suffix = this.consumeSuffix ? this.getSuffix(this.editor, endPosition, suggestion) : ''\n if (suffix.length) { cursor.moveRight(suffix.length) }\n cursor.selection.selectLeft(suggestion.replacementPrefix.length + suffix.length)\n\n if ((suggestion.snippet != null) && (this.snippetsManager != null)) {\n this.snippetsManager.insertSnippet(suggestion.snippet, this.editor, cursor)\n } else {\n cursor.selection.insertText(suggestion.text != null ? suggestion.text : suggestion.snippet, {\n autoIndentNewline: this.editor.shouldAutoIndent(),\n autoDecreaseIndent: this.editor.shouldAutoIndent()\n })\n }\n }\n }\n }\n )\n }", "function padRight(val, len, offset, char) {\n /* istanbul ignore if */\n if (!is_1.isValue(val) || !is_1.isString(val))\n return null;\n // If offset is a string\n // count its length.\n if (is_1.isString(offset))\n offset = offset.length;\n char = char || ' ';\n while (len--) {\n val += char;\n }\n if (offset)\n val += padRight('', offset, null, char);\n return val;\n}", "function replacer(i, obj) {\n if (i == 'marker') {\n return null;\n }\n return obj;\n }", "setRenderedContentOffset(offset, to = 'to-start') {\n // For a horizontal viewport in a right-to-left language we need to translate along the x-axis\n // in the negative direction.\n const isRtl = this.dir && this.dir.value == 'rtl';\n const isHorizontal = this.orientation == 'horizontal';\n const axis = isHorizontal ? 'X' : 'Y';\n const axisDirection = isHorizontal && isRtl ? -1 : 1;\n let transform = `translate${axis}(${Number(axisDirection * offset)}px)`; // in appendOnly, we always start from the top\n\n offset = this.appendOnly && to === 'to-start' ? 0 : offset;\n this._renderedContentOffset = offset;\n\n if (to === 'to-end') {\n transform += ` translate${axis}(-100%)`; // The viewport should rewrite this as a `to-start` offset on the next render cycle. Otherwise\n // elements will appear to expand in the wrong direction (e.g. `mat-expansion-panel` would\n // expand upward).\n\n this._renderedContentOffsetNeedsRewrite = true;\n }\n\n if (this._renderedContentTransform != transform) {\n // We know this value is safe because we parse `offset` with `Number()` before passing it\n // into the string.\n this._renderedContentTransform = transform;\n\n this._markChangeDetectionNeeded(() => {\n if (this._renderedContentOffsetNeedsRewrite) {\n this._renderedContentOffset -= this.measureRenderedContentSize();\n this._renderedContentOffsetNeedsRewrite = false;\n this.setRenderedContentOffset(this._renderedContentOffset);\n } else {\n this._scrollStrategy.onRenderedOffsetChanged();\n }\n });\n }\n }", "replace(idx, amt, objects) {\n // if we replaced exactly the same number of items, then pass only the\n // replaced range. Otherwise, pass the full remaining array length\n // since everything has shifted\n var len = objects ? objects.length : 0;\n this.arrayContentWillChange(idx, amt, len);\n\n if (len === 0) {\n this.splice(idx, amt);\n } else {\n replace(this, idx, amt, objects);\n }\n\n this.arrayContentDidChange(idx, amt, len);\n return this;\n }", "calculateOffset(offset) {\n\n // Note: vec3 has the same alignment as vec4\n let alignment = this.byteSize <= 8 ? this.byteSize : 16;\n\n // arrays have vec4 alignments\n if (this.count)\n alignment = 16;\n\n // align the start offset\n offset = math.roundUp(offset, alignment);\n this.offset = offset / 4;\n }", "modify_mark(marker) {\n if (!marker.offset_handled) {\n marker.start_pos += this.offset;\n marker.end_pos += this.offset;\n }\n return marker;\n }", "translate (offset) {\n this.position = this.tempPosition.plus(offset);\n }", "replaceWith(from2, to, content) {\n return this.replace(from2, to, new Slice(Fragment.from(content), 0, 0));\n }", "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n} ////////////////////////////////////////////////////////////////////////////////", "function arrayReplaceAt(src, pos, newElements) {\n\t return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n\t}", "[SWAP_OLD_LENGTH](newLength) {\n const result = this[OLD_LENGTH];\n this[OLD_LENGTH] = newLength;\n return result;\n }", "onRemove(position, length) {\n const previous = this.snapshot.replace(/\\r\\n/g, '\\n');\n this.replaceText(previous.slice(0, position) + previous.slice(position + length));\n }", "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n }", "findAndReplace(string, target, replacement) {\n for (var i = 0; i < string.length; i++) {\n var s = string.replace(target, replacement);\n };\n return s;\n}", "reconsume() {\n this.pos_ -= 1;\n // TODO(johannes): Oddly, adding the following breaks the test with\n // internal errors. Investigate.\n // this.code_ = this.codepoint(this.pos_);\n }", "static applyOffset(src, target, selector) {\n const rv = JSON.parse(JSON.stringify(selector));\n rv.staff += target.staff - src.staff;\n rv.measure += target.measure - src.measure;\n rv.voice += target.voice - src.voice;\n rv.note += target.staff - src.staff;\n return rv;\n }", "squeeze(trits, offset, length) {\r\n do {\r\n const limit = length < Curl.HASH_LENGTH ? length : Curl.HASH_LENGTH;\r\n trits.set(this._state.subarray(0, limit), offset);\r\n this.transform();\r\n length -= Curl.HASH_LENGTH;\r\n offset += limit;\r\n } while (length > 0);\r\n }", "function patch(nodes, location, offset) {\n var index = -1\n var start = offset\n var end\n var node\n\n while (++index < nodes.length) {\n node = nodes[index]\n\n if (node.children) {\n patch(node.children, location, start)\n }\n\n end = start + toString(node).length\n\n node.position = {\n start: location.toPoint(start),\n end: location.toPoint(end)\n }\n\n start = end\n }\n\n return nodes\n }", "function upperToHyphenLower(match, offset, string) {\n return (offset ? '-' : '') + match.toLowerCase();\n }", "function fixTopDictIndexOffsets(baseSize, topDictIndex, charset, encoding, charStringIndex, privateDict) {\n var ch_off, en_off, cs_off, pd_off, o_ch_off, o_en_off, o_cs_off, o_pd_off, base, pd_size = privateDict.sizeOf();\n // \"old\" values\n o_ch_off = o_en_off = o_cs_off = o_pd_off = -1;\n // \"current\" values\n ch_off = en_off = cs_off = pd_off = 0;\n while(ch_off !== o_ch_off && en_off !== o_en_off && cs_off !== o_cs_off && pd_off !== o_pd_off) {\n o_ch_off = ch_off; o_en_off = en_off; o_cs_off = cs_off; o_pd_off = pd_off;\n base = baseSize + topDictIndex.sizeOf();\n ch_off = base;\n en_off = ch_off + charset.sizeOf();\n cs_off = en_off + encoding.sizeOf();\n pd_off = cs_off + charStringIndex.sizeOf();\n topDictIndex.set(\"charset\", ch_off);\n topDictIndex.set(\"Encoding\", en_off);\n topDictIndex.set(\"CharStrings\", cs_off);\n topDictIndex.set(\"Private\", [pd_size, pd_off]);\n topDictIndex.finalise();\n }\n}", "function replaceSymbol(match: any, source: any, line, col: number) {\n var original = consumer.originalPositionFor({\n line: add1(line - 1),\n column: add0(col),\n });\n return [original.source, original.line, original.column].join(':');\n }", "move() {\n this._offset = (this._offset + 1) % plainAlphabet.length\n }", "updateZone(offset) {\n const {\n delta, variable, getVarOvers, size, remain,\n } = this;\n let overs = variable ? getVarOvers(offset) : Math.floor(offset / size);\n // if scroll up, we'd better decrease it's numbers.\n if (delta.direction === 'U') {\n overs = (overs - remain) + 1;\n }\n\n const zone = this.getZone(overs);\n const bench = this.bench || remain;\n // for better performance, if scroll pass items within now bench, do not update.\n // and if overs is going to reach last item, we should render next zone immediately.\n const shouldRenderNextZone = Math.abs(overs - delta.start - bench) === 1;\n if (\n !shouldRenderNextZone\n && (overs - delta.start <= bench)\n && !zone.isLast && (overs > delta.start)\n ) {\n return;\n }\n\n // we'd better make sure forceRender calls as less as possible.\n if (\n shouldRenderNextZone\n || zone.start !== delta.start\n || zone.end !== delta.end\n ) {\n delta.end = zone.end;\n delta.start = zone.start;\n this.forceRender();\n }\n }", "function dotsReplacer(match) {\n if (match.length > 1) return match;\n return '';\n}", "prepareOffsetQuery(offset) {\n if (Number.isInteger(offset)) {\n return offset;\n }\n return 0;\n }" ]
[ "0.6296207", "0.559481", "0.55830425", "0.5538571", "0.5422427", "0.5382617", "0.5370716", "0.53604054", "0.5274566", "0.52705044", "0.52705044", "0.52705044", "0.52705044", "0.50347", "0.49950847", "0.49840543", "0.49545303", "0.49316037", "0.49072933", "0.4901916", "0.4901916", "0.4901916", "0.4892268", "0.48895258", "0.4887197", "0.48835024", "0.4825059", "0.4825059", "0.48206514", "0.48206514", "0.48206514", "0.48206514", "0.48206514", "0.48206514", "0.47969797", "0.47363815", "0.47059366", "0.4705147", "0.4700685", "0.4683835", "0.4683835", "0.4683835", "0.4683835", "0.4683835", "0.4683835", "0.46746975", "0.4672292", "0.46586707", "0.46499568", "0.4648316", "0.4648316", "0.4648316", "0.4648316", "0.4648316", "0.4642087", "0.46372914", "0.46093488", "0.4584041", "0.45558432", "0.4553873", "0.4526559", "0.4520396", "0.45198146", "0.45123816", "0.4507218", "0.45044783", "0.45040625", "0.44992948", "0.44989404", "0.4478133", "0.44767427", "0.44761539", "0.44652486", "0.44540527", "0.44435555", "0.44301742", "0.44250852", "0.44064128", "0.44036758", "0.44017527", "0.4396687", "0.4386497", "0.43747413", "0.43604144", "0.43601218", "0.43440795", "0.43392664", "0.43371418", "0.4333437", "0.42986107", "0.42916963", "0.4290454", "0.42849582", "0.42815894", "0.42756706" ]
0.6274156
6
Create a listitem using sane mechanics.
function normalListItem(ctx, value, position) { var offsets = ctx.offset; var line = position.line; var max; var bullet; var rest; var lines; var trimmedLines; var index; var length; /* Remove the list-item’s bullet. */ value = value.replace(EXPRESSION_BULLET, replacer); lines = value.split(C_NEWLINE); trimmedLines = removeIndent(value, getIndent(max).indent).split(C_NEWLINE); /* We replaced the initial bullet with something * else above, which was used to trick * `removeIndentation` into removing some more * characters when possible. However, that could * result in the initial line to be stripped more * than it should be. */ trimmedLines[0] = rest; offsets[line] = (offsets[line] || 0) + bullet.length; line++; index = 0; length = lines.length; while (++index < length) { offsets[line] = (offsets[line] || 0) + lines[index].length - trimmedLines[index].length; line++; } return trimmedLines.join(C_NEWLINE); function replacer($0, $1, $2, $3, $4) { bullet = $1 + $2 + $3; rest = $4; /* Make sure that the first nine numbered list items * can indent with an extra space. That is, when * the bullet did not receive an extra final space. */ if (Number($2) < 10 && bullet.length % 2 === 1) { $2 = C_SPACE + $2; } max = $1 + repeat(C_SPACE, $2.length) + $3; return max + rest; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ListItem() {}", "function ListItem() {}", "function ListItem() {}", "function listItem() {\n // To do: remove `loose` in next major.\n return {type: LIST_ITEM, loose: false, spread: false, children: []}\n}", "function createListItem(item) {\n text += '<li>' + item + '</li>\\n';\n}", "function createListItem(item) {\n const ul = document.getElementById(\"item-list\");\n const listItem = extractItemTemplate();\n const deleteBtn = listItem.getElementById(\"delete-btn\");\n const editBtn = listItem.getElementById(\"edit-btn\");\n const itemContainer = listItem.getElementById(\"item-container\");\n itemContainer.innerText = JSON.stringify(item, null, 4);\n\n deleteBtn.addEventListener(\"click\", () => deleteItem(item));\n editBtn.addEventListener(\"click\", () => displayForm(item));\n\n ul.append(listItem);\n}", "function createListItemDefault(item, idx) {\n var listItem = document.createElement('li');\n listItem.innerHTML = '<span class=\"br-icon icon-glyph-' + item.glyph + '\"></span> ' + item.name;\n listItem.className = 'br-listlink'\n return listItem;\n }", "function buildListItem(obj){\n let listItem = document.createElement('li')\n listItem.classList.add('app__list-item')\n\n let title = document.createElement('h3')\n title.innerText = \"WebSite: \"+obj.title\n listItem.appendChild(title)\n\n let username = document.createElement('p')\n username.innerText = \"Username: \"+obj.username\n listItem.appendChild(username)\n\n let password = document.createElement('p')\n password.innerText = \"Password: \"+obj.password\n password.setAttribute('data-pass', obj.password)\n listItem.appendChild(password)\n\n let cross = document.createElement('div')\n cross.classList.add(\"app__list-item__cross\")\n cross.innerText = \"X\"\n listItem.appendChild(cross)\n\n return listItem\n}", "function createListItemDefault(item, idx)\n {\n var listItem = document.createElement('li');\n listItem.innerHTML = '<span class=\"br-icon icon-glyph-' + item.glyph + '\"></span> ' + item.name;\n listItem.className = 'br-listlink'\n return listItem;\n }", "function ListItem() { }", "createListViewItem() {\n var item = new latte.ListViewItem(this.explorer.listView);\n var columns = this.getColumns();\n item.tag = this;\n this._listViewItem = item;\n // Name column\n item.addColumn(150);\n this.syncUI();\n return item;\n }", "function ListItem(title, body) {\n this.id = Date.now();\n this.title = title;\n this.body = body;\n this.importance = 'Normal';\n this.complete = null;\n}", "function buildLi(item, par) {\n var newLi = document.createElement('li');\n var liAnchor = document.createElement('a');\n if (par) {\n newLi.className = 'parent';\n }\n liAnchor.href = '#';\n liAnchor.target = '_top';\n liAnchor.textContent = item.title;\n newLi.appendChild(liAnchor);\n return newLi;\n }", "function createLi( n, list, listtype, cls, text )\n{\n let li = document.createElement(\"li\");\n\n // List entry?\n if (listtype !== \"sep\")\n {\n // Delete button (or space for it for the add entry)\n let span = document.createElement(\"span\");\n span.className = \"for-delete-button\";\n span.appendChild( document.createTextNode(\"✖\") );\n li.appendChild( span );\n if (listtype !== \"add\")\n {\n li.draggable = true;\n setDeletable( li );\n }\n\n // Entry itself\n let entry = document.createElement(\"span\");\n entry.className = \"entry\";\n entry.appendChild( document.createTextNode(text) );\n li.appendChild( entry );\n\n // Drag button\n if (listtype !== \"add\")\n addThumb( li );\n }\n else\n {\n // Separator: span in a div in a li\n let div = document.createElement(\"div\");\n let span = document.createElement(\"span\");\n span.appendChild( document.createTextNode(\" \") );\n div.appendChild( span );\n li.appendChild( div );\n }\n\n // And the rest of the attributes; drag stuff if it's not the \"add\" line\n li.className = cls;\n li.id = list + n + listtype;\n\n return li;\n}", "function Item(listItem) {\n this.listItem = listItem\n}", "function liCreator(itemText, itemID, toDoStatus, classArray=[]) \n{\n\tlet list;\t\n\tlet newToDoItem = document.createElement(\"li\");\n\tlet liTextContainer = document.createElement(\"span\");\n\n\tliTextContainer.textContent = itemText;\n\tnewToDoItem.appendChild(liTextContainer);\n\n\tfor(let i = 0; i < classArray.length; i++) {\n\t\tnewToDoItem.classList.add(classArray[i]);\n\t}\n\tnewToDoItem.setAttribute(\"id\", itemID);\n\n\n\tif(toDoStatus === \"In Progress\")\n\t{\n\n\t\tnewToDoItem.classList.add(\"to-do-list-item\");\n\t\tlist = document.querySelector(\"#toDoUL\");\n\t\tlist.appendChild(newToDoItem);\n\t\tcheckboxCreator(itemID);\n\t}\n\telse\n\t{\n\t\tnewToDoItem.classList.add(\"done-list-item\");\n\t\tlist = document.querySelector(\"#doneUL\");\n\t\tlist.appendChild(newToDoItem);\n\t}\n}", "function createListItemBlock(listItem) {\n if (listItem === void 0) { listItem = null; }\n return {\n startElement: listItem,\n endElement: listItem,\n insertPositionNode: null,\n listItemContainers: listItem ? [listItem] : [],\n };\n}", "function newItem(todo) {\n var listItem = document.createElement(\"li\");\n listItem.textContent = todo;\n list.appendChild(listItem);\n}", "_createNewListItem(e) {\n e.preventDefault();\n\n const itemName = itemNameInput.value;\n const dueDate = itemDueDateInput.value;\n const timeDue = itemTimeDueInput.value;\n const description = itemDescriptionInput.value;\n const priority = itemPriorityInput.value;\n\n // Creating new listItem Obj\n const listItem = new ListItem(\n itemName,\n dueDate,\n timeDue,\n description,\n priority\n );\n\n // Adding new list item to obj in listCollection\n this.listCollection[this._findObjectAlgo()].listItems.push(listItem);\n // Altering the curList\n this.curList = this.listCollection[this._findObjectAlgo()];\n\n this._insertionSort();\n this._setLocalStorage();\n\n // Clears input fields\n this._clearForm();\n\n // Reset listItemsParent and re-render sorted list items\n listItemsParent.innerHTML = \"\";\n this.curList.listItems.forEach((item) => this._renderListItem(item));\n\n // Shows and hides success message\n successMessage.classList.remove(\"hidden\");\n setTimeout(function () {\n successMessage.classList.add(\"hidden\");\n }, 750);\n }", "function generateLiInUl( modelItem, mapper ) {\n // const listType = modelItem.getAttribute( 'type' ) == 'numbered' ? 'ol' : 'ul';\n // const listType = 'eftouch';\n const listType = 'p';\n const viewItem = new ViewListItemElement();\n\n const imageUrl = modelItem.getAttribute('imageUrl')\n const attrs = { 'imageUrl': imageUrl}\n // const viewList = new ViewContainerElement( listType, null );\n const viewList = new ViewContainerElement( listType, attrs );\n viewList.appendChildren( viewItem );\n\n mapper.bindElements( modelItem, viewItem );\n\n return viewItem;\n}", "function createItem(attrs) {\n var units = '';\n if (attrs.units) {\n units = ' ('\n + attrs.units\n + ' ud'\n + (attrs.units != 1 ? 's' : '')\n + '.)';\n }\n\n var kind = '';\n if (attrs.kind) {\n kind = '<span class=\"kind\" style=\"background:'\n + kinds[attrs.kind].color\n + '\">' + kinds[attrs.kind].name + \"</span>\";\n }\n\n $(\"#itemlist\").append($('<div class=\"item selectable\"> <span class=\"icon\"> <img alt=\"\" src=\"objects/' + attrs.icon + '\"></span> <div class=\"text\"><span class=\"description\">'+kind+attrs.description + '</span> <span class=\"location\">' + attrs.location + units + '</span> <input type=\"hidden\" class=\"roomNo\" value=\"' + attrs.room + '\"> <input type=\"hidden\" class=\"id\" value=\"' + attrs.id + '\"> </div> </div>').css(\"opacity\", \"0.2\"));\n}", "function createLI(n)\r\n{\r\n var li = document.createElement('li'); //<li></li>\r\n li.setAttribute('class', 'list-item'); //<li class=\"list-item\"></li>\r\n li.innerText = `List Item ${n}`;\r\n\r\n return li;\r\n}", "static createListItem (text) {\n const li = document.createElement(\"li\");\n \n li.textContent = text;\n\n return li;\n }", "function createListItem(inputValue) {\n // Create li item\n const newlistItem = document.createElement('li');\n const taskText = document.createElement('span');\n // Get input value and add it to the li\n taskText.innerHTML = inputValue;\n // Create a complete task icon\n let newListCompleteIcon = document.createElement('img');\n newListCompleteIcon.src = \"assets/img/checked.svg\";\n newListCompleteIcon.className = 'task-icon';\n // Add checkbox to the li\n newlistItem.prepend(taskText);\n newlistItem.prepend(newListCompleteIcon);\n // Return list item to the handler\n return newlistItem;\n}", "addNewItemToList(list, initDescription, initDueDate, initStatus) {\n let newItem = new ToDoListItem(this.nextListItemId++);\n newItem.setDescription(initDescription);\n newItem.setDueDate(initDueDate);\n newItem.setStatus(initStatus);\n list.addItem(newItem);\n if (this.currentList) {\n this.view.refreshList(list);\n }\n }", "function createLiElement(itemvalue, state=\"pending\"){\n var li = document.createElement('li');//li\n \n var checkbox = document.createElement('input');\n checkbox.type = \"checkbox\";\n checkbox.setAttribute(\"class\", \"itemcheck\");\n \n li.appendChild(checkbox);\n li.appendChild(document.createTextNode(itemvalue));\n li.setAttribute(\"class\", state);\n ul.appendChild(li);\n addItemToStorage(itemvalue, state);\n pendingToComplete();\n}", "function MakeLiItems() {\n var listItems = $();\n for(var i = 0; i < 5; i++) {\n listItems = listItems.add($('<li>', { text: \"New List Item\" + (i + 1) }));\n }\n return listItems;\n }", "function createListItem(data) {\n const listItem = document.createElement('li');\n listItem.innerHTML = data.name;\n\n let paragraph = document.createElement('p');\n paragraph.innerHTML = \"Discharge (cubic feet per second): \" + data.discharge;\n\n listItem.appendChild(paragraph);\n\n return listItem;\n}", "function createLi () {\n\n const createItem = document.createElement('li');\n createItem.textContent = js_input.value;\n\n const btnDelete = document.createElement('button');\n btnDelete.classList.add('js-delete_btn');\n btnDelete.textContent = 'X';\n\n js_list.addEventListener('click', event => {\n if (event.target.nodeName === 'BUTTON') {\n event.target.parentNode.remove(createItem);\n }\n });\n\n createItem.append(btnDelete);\n js_list.append(createItem);\n }", "function createListItems(e) {\n /*jshint validthis: true*/\n this.classList.toggle('active');\n var currentSlide = document.querySelector('.present');\n\n if (this.classList.contains('active')) {\n if (getSelectionHtml() === \"\") {\n var li = document.createElement('li');\n li.innerHTML = 'List item';\n currentSlide.appendChild(li);\n } else {\n replaceSelectionWithHtml('<li>' + getSelectionHtml() + '</li>');\n this.classList.remove('active');\n }\n } else {\n var br = document.createElement('br');\n currentSlide.appendChild(br);\n }\n}", "function createListElement() {\n\tvar listelement = document.createElement(\"li\");\n\t\tlistelement.appendChild(document.createTextNode(input.value));\n\t\tunorderedelement.appendChild(listelement);\n\t\tinput.value = \"\";\n}", "function createListItem(){\r\n //use createElement to create all the buttons \r\n console.log(\"create a item...\");\r\n\tvar listItem=document.createElement(\"li\");\r\n\tvar checkBox=document.createElement(\"input\");\r\n\tvar label=document.createElement(\"label\");\r\n\tvar inputText=document.createElement(\"input\");\r\n\tvar editButton=document.createElement(\"button\");\r\n\tvar deleteButton=document.createElement(\"button\");\r\n\t\r\n\r\n\t//set type information\r\n\tcheckBox.type=\"checkbox\";\r\n\tinputText.type=\"text\";\r\n\teditButton.className=\"edit\";\r\n\tdeleteButton.className=\"delete\";\r\n\teditButton.innerText=\"Edit\";\r\n\tdeleteButton.innerText=\"Delete\";\r\n label.innerText=input.value;\r\n\r\n\t//append buttons to listItem\r\n\t//well,have to follow the order- -!\r\n\tlistItem.appendChild(checkBox);\r\n\tlistItem.appendChild(label);\r\n\tlistItem.appendChild(inputText);\r\n\tlistItem.appendChild(editButton);\r\n\tlistItem.appendChild(deleteButton);\r\n\t\r\n\r\n\treturn listItem;\r\n\t\r\n\r\n}", "function createNewListItem() {\r\n const animalsList = document.querySelector(\"li\");\r\n const parrots = document.createElement(\"li\");\r\n parrots.innerText = \"Parrots\";\r\n parrots.className = \"parrots\";\r\n parrots.before(\"elephants\");\r\n animalsList.appendChild(parrots);\r\n}", "function CreateItem(item) {\n var li = document.createElement('li');\n var t = document.createTextNode(item);\n var span = document.createElement('span');\n var spantext = document.createTextNode('\\u00D7');\n\n li.className = 'list-group-item';\n li.appendChild(t); /****** \"li\" is a parent element of this \"t\" *********/\n list.appendChild(li); /*** list \"<ul>\" is a parent element of this \"li\" */\n span.classList.add('close');\n span.appendChild(spantext);\n li.appendChild(span);\n\n span.onclick = function () {\n var li = this.parentElement;\n li.style.display = 'none';\n li.classList.remove('checked');\n }\n}", "addNewItem(itemId) {\n if(!itemId){\n itemId = this.nextListItemId++;\n }\n let newItem = new ToDoListItem(itemId);\n this.currentList.items.push(newItem);\n this.view.viewList(this.currentList);\n this.enableItemControls();\n return newItem;\n }", "function ListItem(text, id){\r\n this.text = text;\r\n this.isHighlighted = false;\r\n this.isChecked = false;\r\n this.uniqueValue = id;\r\n}", "function _factoryItem (title, start, end, options) {\n\t\t\treturn this.items[this.items.length] = new Item(this, title, start, end, options);\n\t\t}", "function createListItem(viewModelObject) {\n if(typeof viewModelObject.expanded == \"undefined\"){\n viewModelObject.expanded = false;\n }\n\n var listItem = jQuery(\"<li></li>\");\n viewModelObject.element = listItem;\n listItem.addClass(\"jqcTreeListItemCollapsed\");\n\n var listItemExpandHandle = jQuery(\"<div class='jqcTreeListItemExpandHandle'>+</div>\");\n var listItemCollapseHandle = jQuery(\"<div class='jqcTreeListItemCollapseHandle'>&ndash;</div>\");\n var listItemEmptyHandle = jQuery(\"<div class='jqcTreeListItemEmptyHandle'> </div>\");\n\n viewModelObject.expandHandle = listItemExpandHandle;\n viewModelObject.collapseHandle = listItemCollapseHandle;\n viewModelObject.emptyHandle = listItemEmptyHandle;\n\n\n listItemExpandHandle.click(function() {\n viewModelObject.expanded = true;\n listItemExpandHandle.hide();\n listItemCollapseHandle.show();\n listItem.find(\">ul\").show();\n });\n\n listItemCollapseHandle.click(function() {\n viewModelObject.expanded = false;\n listItemExpandHandle.show();\n listItemCollapseHandle.hide();\n listItem.find(\">ul\").hide();\n });\n\n\n listItem.append(listItemExpandHandle);\n listItem.append(listItemCollapseHandle);\n listItem.append(listItemEmptyHandle);\n\n var listItemText = jQuery(\"<span></span>\");\n listItemText.text(viewModelObject.dataObject[labelField]);\n listItem.append(listItemText);\n listItemText.click(function() {\n if(typeof viewModelObject.selected === 'undefined' || viewModelObject.selected === false) {\n if(!event.ctrlKey){\n treeList.unselectAllItems();\n }\n treeList.selectItem(viewModelObject);\n } else {\n treeList.unselectItem(viewModelObject);\n }\n\n eventManager.fireEvent(\"click-item\", function(listener) {\n listener.listenerFunction(event, listItem, viewModelObject);\n })\n });\n\n var childList = jQuery(\"<ul></ul>\");\n listItem.append(childList);\n childList.hide();\n\n if(treeList.viewModel.parentIdField() != null) {\n var parentId = viewModelObject.dataObject[treeList.viewModel.parentIdField()];\n if(parentId != null) {\n\n // 1. find parent view model object\n var parentViewModelObject = treeList.viewModel.getViewModelObjectById(parentId);\n\n // 2. find parent element, and then its <ul> element.\n var parentChildList = parentViewModelObject.element.find(\">ul\");\n\n //3. add this list item to the parent element ul list.\n parentChildList.append(listItem);\n } else {\n treeList.jqc.element.append(listItem);\n }\n\n }\n }", "function listItem(name, taskId, isDone){\n this.name = name;\n this.id = taskId;\n this.done = isDone;\n this.getHtml = function(){\n var li = document.createElement(\"li\");\n var t = document.createTextNode(this.name);\n li.appendChild(t);\n var span = document.createElement(\"SPAN\");\n var txt = document.createTextNode(\"\\u00D7\");\n span.className = \"close\";\n span.appendChild(txt);\n span.onclick = clickOnDelete;\n li.appendChild(span);\n var cb = document.createElement( \"input\" );\n cb.type = \"checkbox\";\n cb.onclick\t= toggleChecked;\n if (isDone) {\n cb.checked = true;\n li.classList.toggle('checked');\n }\n else cb.checked = false;\n cb.id = taskId;\n li.appendChild(cb);\n document.getElementById(\"myUL\").appendChild(li);\n }\n}", "function generateListItem(itemJson){\n\n var itemList = document.createElement(\"li\");\n itemList.classList.add(\"productLine\");\n\n itemList.appendChild(formatListItem(itemJson.imagem, \"productImage\"));\n itemList.appendChild(formatListItem(itemJson.titulo, \"productHeader\"));\n itemList.appendChild(formatListItem(itemJson.descricao, \"productParagraph\"));\n\n return itemList;\n\n}", "function createTodoListItem(todo) {\n var checkbox = document.createElement('input');\n checkbox.className = 'toggle';\n checkbox.type = 'checkbox';\n checkbox.addEventListener('change', checkboxChanged.bind(this, todo));\n\n var label = document.createElement('label');\n label.appendChild( document.createTextNode(todo.title));\n label.addEventListener('dblclick', todoDblClicked.bind(this, todo));\n\n var deleteLink = document.createElement('button');\n deleteLink.className = 'destroy';\n deleteLink.addEventListener( 'click', deleteButtonPressed.bind(this, todo));\n\n var divDisplay = document.createElement('div');\n divDisplay.className = 'view';\n divDisplay.appendChild(checkbox);\n divDisplay.appendChild(label);\n divDisplay.appendChild(deleteLink);\n\n var inputEditTodo = document.createElement('input');\n inputEditTodo.id = 'input_' + todo._id;\n inputEditTodo.className = 'edit';\n inputEditTodo.value = todo.title;\n inputEditTodo.addEventListener('keypress', todoKeyPressed.bind(this, todo));\n inputEditTodo.addEventListener('blur', todoBlurred.bind(this, todo));\n\n var li = document.createElement('li');\n li.id = 'li_' + todo._id;\n li.appendChild(divDisplay);\n li.appendChild(inputEditTodo);\n\n if (todo.completed) {\n li.className += 'complete';\n checkbox.checked = true;\n }\n\n return li;\n }", "function createListItem() {\n const item = document.createElement(\"li\");\n // Injection userinput into li element\n item.innerHTML = userInput.value;\n // Appeding li element below ul element\n ul.appendChild(item);\n // Resets userInput to empty string\n userInput.value = \"\";\n\n // Toggle effect to mark to dos as done\n function markAsDone() {\n item.classList.toggle(\"done\");\n }\n\n item.addEventListener(\"click\", markAsDone);\n\n // Creating button to delete li elements\n const deleteButton = document.createElement(\"button\");\n deleteButton.appendChild(document.createTextNode(`X`));\n item.appendChild(deleteButton);\n deleteButton.addEventListener(\"click\", deleteListItem);\n\n // Makes it possible to delete li elements with the button\n function deleteListItem() {\n item.remove();\n }\n}", "function createItemEl(columnEl, column, item, index) {\n // List Item\n const listEl = document.createElement('li')\n listEl.classList.add('drag-item')\n listEl.textContent = item\n listEl.draggable = true\n listEl.setAttribute('ondragstart', 'drag(event)')\n listEl.contentEditable = true\n listEl.id = index\n listEl.setAttribute('onfocusout', `updateItem(${index}, ${column})`)\n // Append\n columnEl.appendChild(listEl)\n}", "function createListItem(product, jar) {\n\tvar temp = null;\n\tvar container = document.createElement('div');\n\t\tcontainer.setAttribute('id', product.attr('id'));\n\t\tcontainer.setAttribute('class', 'item');\n\t\ttemp = createItemLinkDiv(product); \n\t\tcontainer.appendChild(temp);\n\t\ttemp = createMiniImgDiv(product);\n\t\tcontainer.appendChild(temp);\t\n\t\ttemp = createExtraIteminfo(product);\n\t\tcontainer.appendChild(temp);\n\t\t\n\tjar.appendChild(container);\n\treturn jar;\n}", "function createItemEl(columnEl, column, item, index) {\r\n // List Item\r\n const listEl = document.createElement(\"li\");\r\n listEl.classList.add(\"drag-item\");\r\n listEl.textContent = item;\r\n listEl.draggable = true;\r\n listEl.setAttribute(\"ondragstart\", \"drag(event)\");\r\n listEl.contentEditable = true;\r\n listEl.setAttribute(\"onfocusout\", `updateItem(${column},${index})`);\r\n\r\n columnEl.append(listEl);\r\n }", "function createListItem(bookDesc, index) {\n let item = document.createElement('li');\n item.setAttribute(\"data-index\", index)\n item.id = index\n item.textContent = bookDesc;\n let readButton = document.createElement(\"input\");\n readButton.type = \"button\";\n readButton.classList.add(\"toggleRead\");\n readButton.value = \"Change read status\";\n readButton.addEventListener('click', event => {\n myLibrary.toggleRead(event.target.parentElement.getAttribute(\"data-index\"));\n let toggledText = createListItem(createBookItem(myLibrary[index]), index);\n let currentText = document.getElementById(index)\n currentText.parentNode.replaceChild(toggledText, currentText);\n })\n item.appendChild(readButton);\n let deleteButton = document.createElement(\"input\");\n deleteButton.type = \"button\";\n deleteButton.classList.add(\"delete\");\n deleteButton.value = \"Remove from library\";\n deleteButton.addEventListener('click', event => {\n myLibrary.deleteBook(event.target.parentElement.getAttribute(\"data-index\"));\n event.target.parentElement.parentElement.removeChild(event.target.parentElement);\n })\n item.appendChild(deleteButton)\n return item\n}", "function createItem(itemName, id, done, trash) {\n const position = \"beforeend\";\n const check = \"fa-check-circle\";\n const uncheck = \"fa-circle\";\n const line = \"lineThrough\";\n const opacity = \"item-checked\";\n\n const iconStyle = done ? check : uncheck;\n const textStyle = done ? line : \"\";\n const itemOpacity = done ? opacity : \"\";\n\n const itemHtml = `<li class=\"item ${itemOpacity}\">\n <i class=\"far ${iconStyle} complete\" id=\"${id}\"></i>\n <p class=\"text ${textStyle}\">${itemName}</p>\n <i class=\"far fa-trash-alt delete\" id=\"${id}\"></i>\n </li>`;\n\n listElement.insertAdjacentHTML(position, itemHtml);\n}", "function createListElement() {\n // Create element & text\n var newElement = document.createElement(\"li\");\n var newText = document.createTextNode(input.value);\n // Add text to element\n newElement.appendChild(newText);\n // Update DOM\n ul.appendChild(newElement);\n // Clear input box\n input.value = \"\";\n}", "function createListItem(text1) {\n let li1 = document.createElement(\"li\");\n let text = document.createTextNode(text1 + ' ');\n li1.appendChild(text);\n li1.appendChild(createDeleteButton());\n return li1;\n}", "function createListElement() {\n\n\tvar span = document.createElement(\"span\");\n\n\tspan.appendChild(document.createTextNode(input.value));\n\tspan.id = input.value;\n\tspan.value = span.id;\n\tspan.onclick = ChangeDoneStatusForCreatedItems;\n\n\tvar li = document.createElement(\"li\");\n\n\tli.className = \"toDo\";\n\tul.appendChild( li );\n\tli.appendChild( span );\n\n\tvar delBtn = document.createElement( \"button\" );\n\tdelBtn.appendChild(document.createTextNode(\"Delete\"));\n\tdelBtn.className = \"delete\";\n\tdelBtn.onclick = DeleteListElement;\n\tli.insertBefore( delBtn, span );\n\n\tul.appendChild( li );\n\n\tinput.value = \"\";\n\n}", "function createListItem(textLink, textString, hasHyperlink, classType) {\n let listItem = document.createElement(\"li\");\n listItem.className = classType;\n if (hasHyperlink) {\n let hyperlink = createHyperlink(textLink, textString)\n listItem.appendChild(hyperlink);\n }\n return listItem;\n}", "function createCalendarDomItem(\n itemDate, itemWhat, itemWith, itemPhone, itemWhere, itemNotes\n){\n const itemElement = document.createElement('li');\n\n // tag name date for date\n\n // tag name h2 for title\n\n // tag name with for with\n\n // tag name phone for phone number\n\n // tag name where for address\n\n // tag name notes for notes\n\n\n calendarElement.appendChild(itemElement);\n}", "function addListItem() {\n let list = document.querySelector('#items');\n let newItem = document.createElement('li');\n newItem.classList.add('list-group-item');\n let text = document.querySelector('#newItem').value;\n let textnode = document.createTextNode(text);\n newItem.appendChild(textnode);\n items.appendChild(newItem);\n}", "function createListItem(className,imageSource, name, message, url) {\r\n var listItem = createNode(\"li\");\r\n listItem.setAttribute(\"class\", \"streamer\");\r\n \r\n var div = createNode(\"div\");\r\n div.setAttribute(\"class\", className);\r\n var image = createNode(\"img\");\r\n image.setAttribute(\"id\", name );\r\n image.setAttribute(\"src\", imageSource); \r\n append(div, image); \r\n\r\n var a = createNode(\"a\");\r\n a.setAttribute(\"href\", url);\r\n if (url === \"#\") {\r\n a.setAttribute(\"class\", \"inactiveLink\");\r\n }\r\n else { \r\n a.setAttribute(\"target\", \"_blank\");\r\n } \r\n var text = createText(name);\r\n append(a, text);\r\n append(div, a);\r\n\r\n var p = createNode(\"p\");\r\n text = createText(message);\r\n append(p, text);\r\n append(div, p);\r\n append(listItem, div);\r\n \r\n return listItem;\r\n}", "function createItemEl(columnEl, column, item, index) {\r\n // List Item\r\n const listEl = document.createElement('li');\r\n listEl.textContent = item;\r\n listEl.id = index;\r\n listEl.classList.add('drag-item');\r\n listEl.draggable = true;\r\n listEl.setAttribute('onfocusout', `updateItem(${index}, ${column})`);\r\n listEl.setAttribute('ondragstart', 'drag(event)');\r\n listEl.contentEditable = true;\r\n // Append\r\n columnEl.appendChild(listEl);\r\n}", "function newListelement(){\r\n let newListItem = document.createElement('li');\r\n let textNode = document.createTextNode(currentInput);\r\n newListItem.appendChild(textNode);\r\n return newListItem;\r\n}", "function appendToUl(ul, item) {\n ul.append(liTemplate(item.id, item.name, item.details));\n}", "createListViewItem() {\n var item = super.createListViewItem();\n // // var item = new ListViewItem();\n // var columns: string[] = this.getColumns();\n //\n // item.icon = this.getIcon();\n //\n // for (var i = 0; i < columns.length; i++) {\n // var s:string = columns[i];\n //\n // item.addColumn(this.getColumnWithFor(s));\n // item.setItem(i, this.getItemForColumn(s));\n // }\n return item;\n }", "function createItemEl(columnEl, column, item, index) {\n // List Item\n const listEl = document.createElement('li');\n listEl.classList.add('drag-item');\n listEl.textContent = item;\n // make the item draggable\n listEl.setAttribute(\"draggable\", true);\n // what should happen when the element is dragged.\n listEl.setAttribute(\"ondragstart\", \"drag(event)\");\n // Make list item editable\n listEl.setAttribute(\"contenteditable\", true);\n // Set Id of each list item\n listEl.id = index;\n // Set focusOut attribute on each list item\n listEl.setAttribute(\"onfocusout\", `updateItem(${index}, ${column})`);\n // Append to Column\n columnEl.appendChild(listEl);\n}", "function createListItem(side, value, attribute) {\n var listItem = document.createElement('li');\n listItem.textContent = attribute;\n // Change the below widths for list element widths\n if(side) {\n listItem.style.width = \"150px\";\n }\n else {\n listItem.style.width = \"140px\";\n }\n\n // Creates the proper identifier in the list, particularly the exchange has to be shortened to fit inside the tooltip\n var valueHolder = document.createElement('span');\n valueHolder.style.float = \"right\";\n if(typeof value == 'number') {\n value = convertValue(value);\n }\n else if(attribute == \"Exchange\") {\n value = value.toString();\n if(value.includes(\"Nasdaq\")) {\n value = \"NASDAQ\";\n }\n console.log(value);\n } \n \n // Place the text content into the list which will be added to the tooltip on return\n valueHolder.textContent = value;\n listItem.appendChild(valueHolder);\n return listItem;\n}", "function createItemEl(columnEl, columnIndex, item, itemIndex) {\n // List Item\n const listEl = document.createElement('li');\n listEl.classList.add('drag-item');\n listEl.id = itemIndex;\n listEl.textContent = item;\n listEl.contentEditable = true;\n listEl.setAttribute('onfocusout', `updateItem(${columnIndex}, ${itemIndex})`);\n\n listEl.draggable = true;\n listEl.setAttribute('ondragstart', 'drag(event)');\n\n columnEl.append(listEl);\n}", "function addItem(){\n var input = document.getElementById('input');\n var item = input.value;\n ul = document.getElementById('list');\n var textnode = document.createTextNode(item);\n \n if(item === ''){\n return false;\n }else{\n li = document.createElement('li');\n \n \n //defining the attributes\n var checkbox = document.createElement('input');\n checkbox.type = 'checkbox';\n checkbox.setAttribute('id','check');\n \n var label = document.createElement('label');\n label.setAttribute('for','item');\n \n ul.appendChild(label);\n\n //adding sub-child to the parent\n li.appendChild(checkbox);\n label.appendChild(textnode);\n li.appendChild(label);\n ul.insertBefore(li, ul.childNodes[0]);\n \n \n //timeout functionality for animation effect while adding the data\n setTimeout(function(){\n li.className = 'visual';\n },20)\n \n input.value = '';\n \n }\n }", "function addNewItem() {\r\n // create a new LI tag and some text to go with it.\r\n var oLINode = document.createElement(\"li\");\r\n var oLIText = document.createTextNode(\"New Item\");\r\n // Add the text to the LI tag\r\n oLINode.appendChild(oLIText);\r\n // Add the finished LI tag to the UL\r\n gTheList.appendChild(oLINode);\r\n}", "function addNewLi(item) {\n let todoLi = document.createElement('li');\n todoLi.id = item.id;\n if (item.status) {\n todoLi.classList.add(\"completed\");\n }\n let todoLiDiv = document.createElement('div');\n todoLiDiv.classList.add(\"view\");\n\n let todoLiDivInputCheck = document.createElement('input');\n todoLiDivInputCheck.classList.add(\"toggle\");\n todoLiDivInputCheck.type = \"checkbox\";\n todoLiDivInputCheck.checked = item.status;\n\n\n let todoLiDivLabel = document.createElement('label');\n todoLiDivLabel.innerText = item.message;\n\n let todoLiDivButton = document.createElement('button');\n todoLiDivButton.classList.add(\"destroy\");\n\n let todoLiDivInputEdit = document.createElement('input');\n todoLiDivInputEdit.classList.add(\"edit\");\n todoLiDivInputEdit.value = item.message;\n\n todoLiDiv.appendChild(todoLiDivInputCheck);\n todoLiDiv.appendChild(todoLiDivLabel);\n todoLiDiv.appendChild(todoLiDivButton);\n todoLi.appendChild(todoLiDiv);\n todoLi.appendChild(todoLiDivInputEdit);\n todo_list.appendChild(todoLi);\n }", "function ListItem(name, count) \r\n{\r\n\tthis.name = name;\r\n\tthis.count = count;\r\n}", "addListItem(itemName, itemPrice) {\n this.listItems.push(new listItem(itemName, itemPrice));\n }", "function createListElement() {\n currentMaxId += 1; //index of this inserted element\n\tvar li = document.createElement(\"li\");\n //Create a span text with class and unique id\n var span = document.createElement(\"span\");\n span.appendChild(document.createTextNode(input.value + \" \"));\n span.setAttribute(\"class\", \"todo-item\");\n span.setAttribute(\"id\", \"todo-\"+currentMaxId);\n //Create a remove button with correct attributes and unique id\n var btn = document.createElement(\"button\");\n btn.appendChild(document.createTextNode(\"Remove\"));\n btn.setAttribute(\"class\", \"remove-button\");\n btn.setAttribute(\"type\", \"button\");\n btn.setAttribute(\"name\", \"rm-button\");\n btn.setAttribute(\"id\", \"rm-\"+currentMaxId);\n //Set the HTML of the list item (Ref: https://stackoverflow.com/a/36798273)\n\tli.innerHTML += span.outerHTML + btn.outerHTML;\n //Set attribute of the current list item\n li.setAttribute(\"id\", \"li-\"+currentMaxId);\n\tul.appendChild(li);\n //Add event listener to this newly created list item\n document.getElementById(\"todo-\"+currentMaxId).addEventListener(\"click\", toggleDone(currentMaxId));\n document.getElementById(\"rm-\"+currentMaxId).addEventListener(\"click\", removeListAfterClick);\n\tinput.value = \"\"; //Reset the input value\n}", "function createTodoListItem(todo) {\n // var checkbox = document.createElement('input');\n // checkbox.className = 'toggle';\n // checkbox.type = 'checkbox';\n // checkbox.addEventListener('change', checkboxChanged.bind(this, todo));\n\n var label = document.createElement('label');\n label.innerHTML = todo.title;\n //label.addEventListener('dblclick', todoDblClicked.bind(this, todo));\n\n // var deleteLink = document.createElement('button');\n // deleteLink.className = 'destroy';\n // deleteLink.addEventListener( 'click', deleteButtonPressed.bind(this, todo));\n\n var divDisplay = document.createElement('div');\n divDisplay.className = 'view';\n // divDisplay.appendChild(checkbox);\n divDisplay.appendChild(label);\n // divDisplay.appendChild(deleteLink);\n\n // var inputEditTodo = document.createElement('input');\n // inputEditTodo.id = 'input_' + todo._id;\n // inputEditTodo.className = 'edit';\n // inputEditTodo.value = todo.title;\n // inputEditTodo.addEventListener('keypress', todoKeyPressed.bind(this, todo));\n // inputEditTodo.addEventListener('blur', todoBlurred.bind(this, todo));\n\n var li = document.createElement('li');\n li.id = 'li_' + todo._id;\n li.appendChild(divDisplay);\n // li.appendChild(inputEditTodo);\n\n if (todo.completed) {\n li.className += 'complete';\n checkbox.checked = true;\n }\n\n return li;\n}", "function createItem(checkBox, tag, index, identifier, term) {\n return $(\"<li>\").text(tag).addClass(\"dd-options\").append(checkBox)\n .data(\"event\", iterateCourse(index, identifier, term));\n }", "function createRow(item) {\n var listOption = $(\"<option>\");\n listOption.attr(\"value\", item);\n listOption.text(item);\n return listOption;\n }", "function createLi(text) {\n\t\t\t\tfunction createElement(elementName, property, value) {\n\t\t\t\t\t\tconst element = document.createElement(elementName);\n\t\t\t\t\t\telement[property] = value;\n\t\t\t\t\t\treturn element;\n\t\t\t\t}\n\t\t\t\tfunction appendToLI(elementName, property, value) {\n\t\t\t\t\t\tconst element = createElement(elementName, property, value);\n\t\t\t\t\t\tli.appendChild(element);\n\t\t\t\t\t\treturn element;\n\t\t\t\t}\n\t\t\t\tconst li = document.createElement('li'); \n\t\t\t\tappendToLI('span', 'textContent', text);\n\t\t\t\tappendToLI('label', 'textContent', 'Confirm')\n\t\t\t\t\t\t.appendChild(appendToLI('input', 'type', 'checkbox'));\n\t\t\t\tappendToLI('button', 'textContent', 'edit');\n\t\t\t\tappendToLI('button', 'textContent', 'remove');\n\t\t\t\treturn li;\n\t\t}", "function createInfoLi(label, item, valueType, isSelionItem) {\n // sanitize known values which mean the proxy did not provide any data.\n function supported(something) {\n if (proxyClass === 'SeLionRemoteProxy') {\n return something;\n }\n if (something && (something !== -1)) {\n return something;\n }\n return 'not supported';\n }\n\n if (isSelionItem === undefined) {\n isSelionItem = false;\n }\n if (valueType === undefined) {\n valueType = '';\n }\n if (isSelionItem && (supported(item) === 'not supported')) {\n return '';\n }\n return $('<li><b>' + label + '</b>: ' + item + ' ' + valueType + ' </li>');\n }", "function createListElement() {\n /*Creates the DOM elements for the new item:*/\n let li = document.createElement(\"li\"),\n inp1 = document.createElement(\"input\"),\n inp2 = document.createElement(\"input\"),\n div = document.createElement(\"div\");\n\n /*Increases the counter of the list elemnts and gives the new element an unique name:*/\n labelMapLength ++;\n inp1.id = `isLbl${labelMapLength}`;\n inp2.id = `toLbl${labelMapLength}`;\n inp1.placeholder = \"hat Label\";\n inp2.placeholder = \"Label umbenennen zu...\";\n\n /*Adds the autocomplete function to the new element:*/\n div.classList.add(\"autocomplete\");\n div.appendChild(inp2);\n li.append(inp1);\n li.append(div);\n\n labelList.appendChild(li);\n labelList.appendChild(elemById(\"addLabel\"));\n\n autocomplete(elemById(`toLbl${labelMapLength}`), autocompletionTerms);\n}", "_addItemToList(e) {\n if (\n this.shadowRoot.querySelector(\"#itemtext\").value != \"\" &&\n typeof this.shadowRoot.querySelector(\"#itemtext\").value !==\n typeof undefined\n ) {\n this.push(\"items\", {\n label: this.shadowRoot.querySelector(\"#itemtext\").value,\n value: false,\n disabled: this.disabledList,\n id: \"item-id-\" + this.items.length\n });\n this.shadowRoot.querySelector(\"#itemtext\").value = \"\";\n }\n }", "function createLi(obj) {\n let liTag = document.createElement('li');\n let spanTag = document.createElement('span');\n let iTag = document.createElement('i');\n liTag.addEventListener(\"click\", toggleListener)\n liTag.setAttribute('id', `${obj._id}`);\n // liTag.classList.add('visible')\n spanTag.addEventListener(\"click\", removeLi)\n spanTag.appendChild(iTag);\n iTag.setAttribute('class', `fas fa-trash`);\n liTag.appendChild(spanTag);\n liTag.appendChild(document.createTextNode(`${obj.item}`));\n return liTag\n }", "function createNewUpsaleItem(item ,price) {\n\t\t\t\tvar new_portion_li = document.createElement(\"li\");\n\t\t\t\tnew_portion_li.className = \"food_item_info_li substitutions_and_extras\";\n\t\t\t\tnew_portion_li.innerHTML = '<span class=\"food_item_info_span_L substitutions_and_extras\">'+\n\t\t\t\t\t\t\t\t\t\t\t\tenterHtml(item)+\n\t\t\t\t\t\t\t\t\t\t '</span>'+\n\t\t\t\t \t\t\t '<span class=\"food_item_info_span_R substitutions_and_extras\">'+\n\t\t\t\t \t\t\t \t\tenterHtml(price)+\n\t\t\t\t \t\t\t \t'</span>';\n\t\t\t\t \n\t\t\t\treturn new_portion_li;\n\t\t\t}", "function createItemEl(columnEl, column, item, index) {\n // console.log(\"columnEl:\", columnEl);\n // console.log(\"column:\", column);\n // console.log(\"item:\", item);\n // console.log(\"index:\", index);\n // List Item\n const listEl = document.createElement(\"li\");\n listEl.classList.add(\"drag-item\");\n listEl.textContent = item;\n listEl.draggable = true;\n listEl.setAttribute(\"ondragstart\", \"drag(event)\");\n listEl.contentEditable = true;\n listEl.id = `${column}_${index}`;\n listEl.setAttribute(\"onfocusout\", `updateItem(${index},${column})`);\n // Append\n columnEl.appendChild(listEl);\n}", "function renderList(item1, item2, item3) {\n const newList = document.createElement('ul')\n newList.appendChild(renderListItem(\"Name\", item1))\n newList.appendChild(renderListItem(\"Age\", item2))\n newList.appendChild(renderListItem(\"Favorite Color\", item3))\n\n return newList\n}", "function buildItem (post, ul) {\n var data = postInfo(post);\n var header = headerItem(data);\n var content = contentRow(data);\n var itemFrag = document.createRange().createContextualFragment(\n '<li class=\"activity-type-discussion rda-entry\">' +\n header +\n '<table class=\"wallfeed\">' +\n '<tbody>' +\n content +\n '</tbody>' +\n '</table>' +\n '</li>'\n );\n var li = itemFrag.firstChild;\n var tbody = li.getElementsByTagName('tbody')[0];\n // Functions that will add extra rows if needed\n imageRow(data.image, tbody);\n openGraphRow(data.openGraph, tbody);\n statusRow(data, tbody);\n // Appends the element to the list\n ul.appendChild(itemFrag);\n }", "function newListEntry(entry) {\n var listEntry = newElement('li');\n var listText = newElement('span');\n var actionContainer = newElement('div');\n var runButton = createIconButton('power-off', true, null, entry, _run);\n var editButton = createIconButton('edit', true, null, entry, _edit);\n var deleteButton = createIconButton('trash', true, null, entry, _delete);\n listText.innerHTML = entry.name;\n actionContainer.appendChild(runButton);\n actionContainer.appendChild(editButton);\n actionContainer.appendChild(deleteButton);\n listEntry.appendChild(listText);\n listEntry.appendChild(actionContainer);\n return listEntry;\n}", "function createElement() {\n\tvar li = document.createElement(\"li\");\n\t\tli.appendChild(document.createTextNode(input.value));\n\t\t\tui.appendChild(li);\n\t\t\tinput.value = \"\";\n\n\t// Create delete button for each new list item\n\tvar btn = document.createElement(\"button\");\n\t\t\tbtn.appendChild(document.createTextNode(\"Delete\"));\n\t\t\tli.appendChild(btn);\n\t\t\tbtn.onclick = removeParent;\n}", "function createLI(text) {\n function createElement(elementName, property, value) {\n const element = document.createElement(elementName); \n element[property] = value; \n return element;\n }\n function appendToLI(elementName, property, value) {\n const element = createElement(elementName, property, value); \n li.appendChild(element); \n return element;\n }\n const li = document.createElement('li');\n appendToLI('span', 'textContent', text); \n\n //add a notes paragraph and set styling\n const notes = document.createElement('span');\n notes.style.fontSize = '.9em';\n notes.style.padding = '.5em';\n notes.textContent = 'Notes: ';\n li.appendChild(notes);\n\n appendToLI('label', 'textContent', 'Confirm')\n .appendChild(createElement('input', 'type', 'checkbox'));\n\n //add a select for not attending\n li.appendChild(createElement('br'));\n const notAttending = document.createElement('select');\n notAttending.name = 'notAttending';\n li.appendChild(notAttending);\n const option1 = document.createElement('option');\n option1.textContent = 'Attending?';\n option1.value = 'maybe';\n notAttending.appendChild(option1);\n const option2 = document.createElement('option');\n option2.textContent = 'Not Attending';\n option2.value = 'no';\n notAttending.appendChild(option2);\n li.appendChild(createElement('br'));\n\n appendToLI('button', 'textContent', 'edit');\n appendToLI('button', 'textContent', 'remove');\n \n return li;\n }", "function createListElement() {\n\tvar li = document.createElement(\"li\"); // create an li\n\tli.appendChild(document.createTextNode(input.value)); //append a child with the value of input\n\tassignDoneToggle(li); // assign an event listener \n\tul.appendChild(li); // append the li to the ul\n\taddDeleteButton(li); //item has delete button\n\tinput.value = \"\"; // reset the input field to empty\n\n}", "function listMake(ctx) {\n let contents = [];\n let stk = ctx.stack;\n while (stk.length > 0) {\n let e = stk.pop();\n if (isBookend(e)) break;\n contents.unshift(e);\n }\n stk.push(resListItem(contents));\n}", "function create_item( s ){\n\n\tlet this_item = template_item_dom.cloneNode(true);\n\tthis_item.id = \"item\" + (now_item_top);\n\tthis_item.children[1].textContent = s ;\n\tthis_item.children[2].id = now_item_top + '_img' ;\n\tthis_item.children[0].children[0].id = \"\" + (now_item_top);\n\tthis_item.children[0].children[1].htmlFor = \"\" + (now_item_top);\n\n\tif ( now_mode != 'Completed' ){\n\t\t\n\t\tthis_item.children[1].style['opacity']='0';\n\t\tthis_item.children[0].style['opacity']='0';\n\t\tlet item_main = document.getElementById(\"todo-list\");\n\t\tlet temp_li = document.createElement(\"LI\");\n\t\ttemp_li.classList.add('todo-app__item_2');\n\t\ttemp_li.classList.add('heightTranslate');\n\t\titem_main.prepend(temp_li);\n\t\ttemp_li.style['min-height'] = 0;\n\t\tsetTimeout(function(){\n\t\t\ttemp_li.style['min-height'] = '5em';\n\t\t\tsetTimeout(function(){\n\t\t\t\titem_main.prepend(this_item);\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tthis_item.children[1].style['opacity']='1';\n\t\t\t\t\tthis_item.children[0].style['opacity']='1';\n\t\t\t\t},100)\n\t\t\t\titem_main.removeChild(temp_li);\n\t\t\t},1500)\n\t\t},300);\n\t}\n\tnow_exist_items[now_item_top] = this_item;\n\tnow_item_top ++ ;\n\tupdate_left();\n}", "createItemNode(item, typeMap, orderedTypes) {\n let li = document.createElement('li');\n li.className = ITEM_CLASS;\n // Set the raw, un-marked up value as a data attribute.\n li.setAttribute('data-value', item.raw);\n let matchNode = document.createElement('code');\n matchNode.className = 'jp-Completer-match';\n // Use innerHTML because search results include <mark> tags.\n matchNode.innerHTML = apputils_1.defaultSanitizer.sanitize(item.text, {\n allowedTags: ['mark']\n });\n // If there are types provided add those.\n if (!coreutils_1.JSONExt.deepEqual(typeMap, {})) {\n let typeNode = document.createElement('span');\n let type = typeMap[item.raw] || '';\n typeNode.textContent = (type[0] || '').toLowerCase();\n let colorIndex = (orderedTypes.indexOf(type) % N_COLORS) + 1;\n typeNode.className = 'jp-Completer-type';\n typeNode.setAttribute(`data-color-index`, colorIndex.toString());\n li.title = type;\n let typeExtendedNode = document.createElement('code');\n typeExtendedNode.className = 'jp-Completer-typeExtended';\n typeExtendedNode.textContent = type.toLocaleLowerCase();\n li.appendChild(typeNode);\n li.appendChild(matchNode);\n li.appendChild(typeExtendedNode);\n }\n else {\n li.appendChild(matchNode);\n }\n return li;\n }", "function addListItem() {\n if (checkInputLen() > 0) {\n createLi();\n }\n}", "function ItemList(_ref) {\n var items = _ref.items,\n curIndex = _ref.curIndex,\n onSelect = _ref.onSelect,\n rest = ItemList_objectWithoutProperties(_ref, [\"items\", \"curIndex\", \"onSelect\"]);\n\n var $items = items.map(function (i, index) {\n var name = i.name;\n return /*#__PURE__*/react_default.a.createElement(ItemList_Item, {\n py: \"3\",\n pl: \"4\",\n name: name,\n key: index,\n active: index === curIndex,\n onClick: function onClick() {\n return onSelect(index);\n }\n });\n });\n return /*#__PURE__*/react_default.a.createElement(src[\"l\" /* Flex */], ItemList_extends({\n flex: \"1\",\n flexDirection: \"column\",\n color: \"text.primary\",\n bold: true,\n children: $items,\n style: {\n overflow: \"auto\"\n }\n }, rest));\n}", "function ListItem(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n content = props.content,\n description = props.description,\n disabled = props.disabled,\n header = props.header,\n icon = props.icon,\n image = props.image,\n value = props.value;\n\n\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"c\" /* getElementType */])(ListItem, props);\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(active, 'active'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(disabled, 'disabled'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(ElementType !== 'li', 'item'), className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"b\" /* getUnhandledProps */])(ListItem, props);\n var valueProp = ElementType === 'li' ? { value: value } : { 'data-value': value };\n\n if (!__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, valueProp, { role: 'listitem', className: classes }),\n children\n );\n }\n\n var iconElement = __WEBPACK_IMPORTED_MODULE_10__ListIcon__[\"a\" /* default */].create(icon);\n var imageElement = __WEBPACK_IMPORTED_MODULE_6__elements_Image__[\"a\" /* default */].create(image);\n\n // See description of `content` prop for explanation about why this is necessary.\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_react__[\"isValidElement\"])(content) && __WEBPACK_IMPORTED_MODULE_1_lodash_isPlainObject___default()(content)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, valueProp, { role: 'listitem', className: classes }),\n iconElement || imageElement,\n __WEBPACK_IMPORTED_MODULE_7__ListContent__[\"a\" /* default */].create(content, { header: header, description: description })\n );\n }\n\n var headerElement = __WEBPACK_IMPORTED_MODULE_9__ListHeader__[\"a\" /* default */].create(header);\n var descriptionElement = __WEBPACK_IMPORTED_MODULE_8__ListDescription__[\"a\" /* default */].create(description);\n\n if (iconElement || imageElement) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, valueProp, { role: 'listitem', className: classes }),\n iconElement || imageElement,\n (content || headerElement || descriptionElement) && __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_7__ListContent__[\"a\" /* default */],\n null,\n headerElement,\n descriptionElement,\n content\n )\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, valueProp, { role: 'listitem', className: classes }),\n headerElement,\n descriptionElement,\n content\n );\n}", "function createNoteLiItem(note) {\n const li = $('<li class=\"list-group-item\">');\n const noteBody = $('<p>').text(note.body);\n const deleteNoteBtn = $('<button class=\"btn btn-danger delete-note\">').text('Delete Note');\n deleteNoteBtn.attr('data-note-id', note._id);\n li.append(noteBody, deleteNoteBtn);\n notesElem.append(li);\n }", "function newLi (id){\n var newLi = document.createElement('li');\n newLi.id = id;\n newLi.textContent = 'The Fox';\n return newLi;\n}", "function makeNavItem(item){\n const listItem = document.createElement(\"LI\");\n const anchor = document.createElement(\"A\");\n const sectionId = item.getAttribute(\"id\");\n anchor.setAttribute(\"class\", \"menu__link\");\n anchor.setAttribute(\"href\", `#${sectionId}`);\n anchor.textContent = item.getAttribute(\"data-nav\");\n anchor.onclick = (e) => {\n e.preventDefault();\n smoothScroll(sectionId);\n };\n listItem.appendChild(anchor);\n return listItem;\n}", "function AppendItemsToList() {\n var item1 = $(\"<li></li>\").text(\"Item 1\");\n var item2 = \"<li>Item 2</li>\";\n var item3 = document.createElement(\"li\");\n item3.innerHTML = \"Item 3\";\n\n $(\"#olTestList2\").append(item1, item2, item3);\n}", "function createListElement(){\r\n//The item element consists of\r\n\tconst line = document.createElement(\"div\");\r\n\tline.setAttribute(\"class\", \"listElement\");\r\n//a checkbox\r\n\tconst check = document.createElement(\"input\");\r\n\tcheck.type = \"checkbox\";\r\n\tcheck.setAttribute(\"onchange\", \"itemCheck(this)\");\r\n//name of an item\r\n\tconst myItem = document.createElement(\"div\");\r\n\tmyItem.setAttribute(\"class\",\"itemName\") \r\n\tmyItem.innerHTML = item.value;\r\n//and a \"delete\" button. \r\n\tconst deleteButton = document.createElement(\"button\");\r\n\tdeleteButton.setAttribute(\"onclick\", \"deleteListElement(this)\");\r\n\tdeleteButton.setAttribute(\"class\", \"del\");\r\n\tdeleteButton.innerHTML = \"X\";\r\n\r\n//The item can not be added if inputbox is empty \r\n//because of checking function on \"add\" button\r\n\t\r\n\tlistBox.appendChild(line);\r\n\r\n\tline.appendChild(check);\r\n\r\n\tline.appendChild(myItem);\r\n\r\n\tline.appendChild(deleteButton);\r\n\t\r\n}", "function createListElement(text) {\n const liElement = document.createElement('li');\n liElement.innerText = text;\n return liElement;\n}", "function createListElement(text) {\n const liElement = document.createElement('li');\n liElement.innerText = text;\n return liElement;\n}", "function createListElement(text) {\n const liElement = document.createElement('li');\n liElement.innerText = text;\n return liElement;\n}", "function createListElement(text) {\n const liElement = document.createElement('li');\n liElement.innerText = text;\n return liElement;\n}", "function addListItem(value) {\n var newItem = document.createElement(\"li\");\n newItem.innerHTML = value;\n var list = document.getElementById('list');\n list.appendChild(newItem);\n}", "function addItem() {\n var contents = document.getElementById('newTask').value;\n var item = new listItem(Date.now(), contents, false);\n masterList.push(item);\n showList(masterList);\n saveList();\n}", "function listItem(node, parent, position, bullet, ordered) {\n var self = this\n var style = self.options.listItemIndent\n var marker = `\\\\item` || self.options.bullet // bullet\n var spread = node.spread == null ? true : node.spread\n var checked = node.checked\n var children = node.children\n var length = children.length\n var values = []\n var index = -1\n var value\n var indent\n var spacing = space\n\n while (++index < length) {\n values[index] = self.visit(children[index], node)\n }\n\n value = values.join(lineFeed)\n\n if (typeof checked === 'boolean') {\n // Note: I’d like to be able to only add the space between the check and\n // the value, but unfortunately github does not support empty list-items\n // with a checkbox :(\n value =\n (checked ? `[\\\\done] ` : ' ') +\n value\n } else {\n marker += ' '\n }\n\n indent = marker.length + 1\n\n return marker + value\n}" ]
[ "0.7538813", "0.7538813", "0.7538813", "0.72953385", "0.7107234", "0.70372385", "0.69638634", "0.6959297", "0.69405633", "0.6763425", "0.6760879", "0.6736523", "0.67340475", "0.67221624", "0.6704038", "0.668557", "0.6667603", "0.6602694", "0.65954953", "0.65859795", "0.6581092", "0.65655935", "0.6549328", "0.6539983", "0.6535515", "0.6520007", "0.6472068", "0.6463664", "0.64506066", "0.6444699", "0.6438516", "0.64193046", "0.6419013", "0.641704", "0.64106524", "0.64072454", "0.64037246", "0.6397361", "0.63796794", "0.63754267", "0.63741523", "0.63470316", "0.63431686", "0.63425654", "0.63394403", "0.6323545", "0.6312643", "0.63123393", "0.6308284", "0.63043016", "0.63021755", "0.6300571", "0.62894136", "0.6285653", "0.6284997", "0.62742656", "0.6273139", "0.62730414", "0.62686116", "0.62676364", "0.62527436", "0.6238717", "0.6237198", "0.62258744", "0.62251055", "0.6216578", "0.62081933", "0.6207761", "0.620097", "0.61996114", "0.6184808", "0.6170265", "0.6167262", "0.6165124", "0.61632854", "0.6159071", "0.6157967", "0.615717", "0.6157056", "0.6151353", "0.61472565", "0.6143298", "0.6137977", "0.6136488", "0.61311024", "0.61245376", "0.6124246", "0.61150783", "0.6110555", "0.6077553", "0.60727715", "0.606889", "0.606833", "0.60627884", "0.60577595", "0.60577595", "0.60577595", "0.60577595", "0.6055923", "0.6045616", "0.60416836" ]
0.0
-1
Remove the minimum indent from every line in `value`. Supports both tab, spaced, and mixed indentation (as well as possible).
function indentation(value, maximum) { var values = value.split(C_NEWLINE); var position = values.length + 1; var minIndent = Infinity; var matrix = []; var index; var indentation; var stops; var padding; values.unshift(repeat(C_SPACE, maximum) + '!'); while (position--) { indentation = getIndent(values[position]); matrix[position] = indentation.stops; if (trim(values[position]).length === 0) { continue; } if (indentation.indent) { if (indentation.indent > 0 && indentation.indent < minIndent) { minIndent = indentation.indent; } } else { minIndent = Infinity; break; } } if (minIndent !== Infinity) { position = values.length; while (position--) { stops = matrix[position]; index = minIndent; while (index && !(index in stops)) { index--; } if ( trim(values[position]).length !== 0 && minIndent && index !== minIndent ) { padding = C_TAB; } else { padding = ''; } values[position] = padding + values[position].slice( index in stops ? stops[index] + 1 : 0 ); } } values.shift(); return values.join(C_NEWLINE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function indentation(value, maximum) {\n var values = value.split(lineFeed)\n var position = values.length + 1\n var minIndent = Infinity\n var matrix = []\n var index\n var indentation\n var stops\n\n values.unshift(repeat(space, maximum) + exclamationMark)\n\n while (position--) {\n indentation = getIndent(values[position])\n\n matrix[position] = indentation.stops\n\n if (trim(values[position]).length === 0) {\n continue\n }\n\n if (indentation.indent) {\n if (indentation.indent > 0 && indentation.indent < minIndent) {\n minIndent = indentation.indent\n }\n } else {\n minIndent = Infinity\n\n break\n }\n }\n\n if (minIndent !== Infinity) {\n position = values.length\n\n while (position--) {\n stops = matrix[position]\n index = minIndent\n\n while (index && !(index in stops)) {\n index--\n }\n\n values[position] = values[position].slice(stops[index] + 1)\n }\n }\n\n values.shift()\n\n return values.join(lineFeed)\n}", "function indentation(value) {\n var index = 0\n var indent = 0\n var character = value.charAt(index)\n var stops = {}\n var size\n var lastIndent = 0\n\n while (character === tab || character === space) {\n size = character === tab ? tabSize : spaceSize\n\n indent += size\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size\n }\n\n while (lastIndent < indent) {\n stops[++lastIndent] = index\n }\n\n character = value.charAt(++index)\n }\n\n return {indent: indent, stops: stops}\n}", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n\t\tvar tokens = value.match(rnothtmlwhite) || [];\n\t\treturn tokens.join(\" \");\n\t}", "function stripAndCollapse(value) {\n\t\tvar tokens = value.match(rnothtmlwhite) || [];\n\t\treturn tokens.join(\" \");\n\t}", "function stripAndCollapse(value) {\n\t\tvar tokens = value.match(rnothtmlwhite) || [];\n\t\treturn tokens.join(\" \");\n\t}", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse( value ) {\n var tokens = value.match( rnothtmlwhite ) || [];\n return tokens.join( \" \" );\n }", "function stripAndCollapse( value ) {\r\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\r\n\t\treturn tokens.join( \" \" );\r\n\t}", "function stripAndCollapse( value ) {\n var tokens = value.match( rnothtmlwhite ) || [];\n return tokens.join( \" \" );\n }", "function formatValue(value, indent) {\n if (!indent) {\n indent = 0;\n }\n\n return util\n .inspect(value, {\n colors: true,\n depth: null,\n breakLength: 30\n })\n .split(/\\r?\\n/g)\n .map(function (line, i) {\n // don't indent first line\n var padding = i > 0 ?\n Array(indent).join(\" \") :\n \"\";\n return padding + line;\n })\n .join(OS.EOL);\n }", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}" ]
[ "0.6819278", "0.6252711", "0.6243119", "0.6243119", "0.6243119", "0.62121075", "0.62121075", "0.62121075", "0.6201936", "0.6201936", "0.6201936", "0.6201936", "0.6201936", "0.6201936", "0.6201936", "0.6201936", "0.61912143", "0.6183628", "0.61608905", "0.61590254", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465", "0.61565465" ]
0.6607347
5
collapse(' \t\nbar \nbaz\t'); // ' bar baz '
function collapse(value) { return String(value).replace(/\s+/g, ' ') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collapse(value) {\n return String(value).replace(/\\s+/g, ' ');\n}", "function collapseWhitespace(s) {\n return s.replace(/([ \\t]|\\r\\n)+/g, ' ').replace(/^\\s*/, '').replace(/\\s*$/, '');\n }", "function collapseWhitespace(s) {\n return s.replace(/([ \\t]|\\r\\n)+/g, ' ').replace(/^\\s*/, '').replace(/\\s*$/, '');\n }", "function collapseWhitespace(s) {\n return s.replace(/([ \\t]|\\r\\n)+/g, ' ').replace(/^\\s*/, '').replace(/\\s*$/, '');\n }", "function collapseWhitespace(s) {\n return s.replace(/([ \\t]|\\r\\n)+/g, ' ').replace(/^\\s*/, '').replace(/\\s*$/, '');\n }", "function qctrim(s) {\r\n\ts = s.replace(/(^\\s*)|(\\s*$)/gi,\"\");\r\n\ts = s.replace(/[ ]{2,}/gi,\" \");\r\n\ts = s.replace(/\\n /,\"\\n\");\r\n\treturn s;\r\n}", "function elimine2Spaces(str) {\n\tvar s = str.replace(/\\t+/g, ' ');\n\ts = s.replace(/\\s\\s+/g, ' ');\n\treturn s;\n}", "function elimineSpaces(str) {\n\tvar s = str.replace(/\\s+/g, '');\n\ts = s.replace(/\\t+/g, '');\n\treturn s;\n}", "function space(str) {\n return str.split('').join(' ');\n}", "function outdent(str) {\n\treturn str.replace(RegExp('^'+(str.match(/^(\\t| )+/) || '')[0], 'gm'), '');\n}", "function fillWhitespace(thing) {\n var txt = $(thing).text();\n var txt2 = \"\";\n var i = 0;\n for(i = 0; i < txt.length; i++) {\n if(txt[i] == \" \") {\n txt2 += \"&nbsp;\";\n }\n else\n txt2 += txt[i];\n }\n return txt2;\n}", "function formatSpaces (str) {\n return str.trim().replace(/ +/g, \" \");\n}", "function trimWithSingleSpace(string) {\n return string.replace(/^[ \\t\\xA0]{2,}/, ' ').\n replace(/[ \\t\\xA0]{2,}$/, ' ').replace(/^\\s+$/, '');\n}", "function trimWithSingleSpace(string) {\n return string.replace(/^[ \\t\\xA0]{2,}/, ' ').\n replace(/[ \\t\\xA0]{2,}$/, ' ').replace(/^\\s+$/, '');\n}", "function collapseString(str) {\n var result = \"\"\n\n for (var i = 0; i < str.length; i += 1) {\n var current_char = str[i];\n var next_char = str[i + 1];\n\n if (current_char !== next_char) {\n result += current_char;\n }\n }\n\n return result;\n}", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function squeeze(string) {\n return string.replace(/\\s+/g, ' ');\n }", "function reduceDoubleSpaces( string ) {\n\tstring = string.replace( \" \", \" \" );\n\tif ( string.search( \" \" ) > 0 ) {\n\t\treturn reduceDoubleSpaces( string );\n\t}\n\treturn string;\n}", "function noSpace(x) {\n let x1 = x.split(\" \");\n console.log(x1);\n return x1.join(\"\");\n}", "function noSpace(x) {\n let newStr = x.split(\" \").join(\"\");\n return newStr;\n}", "function oneLine (str) {\n return str.replace(/\\s+/g, ' ')\n}", "function replaceSpaces(value) {\n var pattern = new RegExp(\" \", \"g\");\n return value.replace(pattern, '&nbsp;');\n}", "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "function noSpace(x){\n return x.split(\"\").filter(el => {return el!==\" \"}).join(\"\")\n }", "function imtrim(s) \n{\n s = s.replace(/(^\\s*)|(\\s*$)/gi,\"\");\n s = s.replace(/[ ]{2,}/gi,\" \");\n s = s.replace(/\\n /,\"\\n\");\n return s;\n}", "function stripAndCollapse(value) {\n\t\tvar tokens = value.match(rnothtmlwhite) || [];\n\t\treturn tokens.join(\" \");\n\t}", "function stripAndCollapse(value) {\n\t\tvar tokens = value.match(rnothtmlwhite) || [];\n\t\treturn tokens.join(\" \");\n\t}", "function stripAndCollapse(value) {\n\t\tvar tokens = value.match(rnothtmlwhite) || [];\n\t\treturn tokens.join(\" \");\n\t}", "function removeSpaces(string) \n{\n return string.split(' ').join('');\n}", "function removeSpaces(string) \n{\n return string.split(' ').join('');\n}", "function wrapSpace(s){\n if (s === \" \"){\n return \"' '\";\n }\n else {\n return s;\n }\n}", "function stripAndCollapse( value ) {\n var tokens = value.match( rnothtmlwhite ) || [];\n return tokens.join( \" \" );\n }", "function noSpace(x){\n return x.replace(/\\s/g,\"\");\n}", "function noSpace(test){\r\n return test.replace(/\\s+/g,\"\");\r\n \r\n }", "function removeSpaces(string){\r\n return string.split(' ').join('');\r\n}", "function squeeze(string) {\n\t\treturn string.replace(/\\s+/g, ' ');\n\t}", "function makeSpaceStr(numberOfSpaces) {\n let res = [];\n for (let i = 0; i < numberOfSpaces; i++) {\n res.push(' ');\n }\n return res.join('');\n }", "function nonBreakingSpaces(str) {\n return str.replace(/ /g, \"&nbsp;\");\n}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}" ]
[ "0.73472404", "0.7040277", "0.7040277", "0.7040277", "0.7040277", "0.650207", "0.6448741", "0.6361119", "0.63314426", "0.6300574", "0.6049739", "0.60479444", "0.60167855", "0.60167855", "0.60126156", "0.5958536", "0.5958536", "0.5958536", "0.5958536", "0.5958536", "0.5958536", "0.5958536", "0.5958536", "0.59404135", "0.5933438", "0.5911802", "0.590312", "0.5887864", "0.5886103", "0.58653504", "0.58653504", "0.58653504", "0.5859843", "0.5859843", "0.5859843", "0.5830239", "0.5829234", "0.58291775", "0.58291775", "0.58291775", "0.5828117", "0.5828117", "0.58171576", "0.5813333", "0.5812107", "0.58053476", "0.5785291", "0.575593", "0.573425", "0.57046455", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003", "0.57038003" ]
0.738729
5
Check if `character` can be inside an enclosed URI.
function isEnclosedURLCharacter(character) { return character !== C_GT && character !== C_BRACKET_OPEN && character !== C_BRACKET_CLOSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isEnclosedURLCharacter(character) {\n return (\n character !== greaterThan &&\n character !== leftSquareBracket &&\n character !== rightSquareBracket\n )\n}", "function isUnclosedURLCharacter(character) {\n return (\n character !== leftSquareBracket &&\n character !== rightSquareBracket &&\n !whitespace(character)\n )\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function isUnclosedURLCharacter(character) {\n return character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE &&\n !whitespace(character);\n}", "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "function needsHexEscape(character) {\n\t return !((0x00020 <= character && character <= 0x00007E) ||\n\t (character === 0x00085) ||\n\t (0x000A0 <= character && character <= 0x00D7FF) ||\n\t (0x0E000 <= character && character <= 0x00FFFD) ||\n\t (0x10000 <= character && character <= 0x10FFFF));\n\t}", "function resemblesURL(str) {\n return typeof str === 'string' && (str === '' || str.charAt(0) === '/');\n }", "static valid_url(value) {\n if (!value) return false;\n\n // check for illegal characters\n if (/[^a-z0-9:/?#[\\]@!$&'()*+,;=.\\-_~%]/i.test(value)) return false;\n\n // check for hex escapes that aren't complete\n if (/%[^0-9a-f]/i.test(value)) return false;\n if (/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value)) return false;\n\n return this.check_url_fragments(value);\n }", "function resemblesURL(str) {\n return typeof str === 'string' && (str === '' || str[0] === '/');\n }", "function resemblesURL(str) {\n return typeof str === 'string' && (str === '' || str[0] === '/');\n }", "function isEscapeable(char){\n\tif(char == ','\n\t|| char == '(' || char == ')'\n\t|| char == '[' || char == ']'\n\t|| char == '{' || char == '}'){\n\t\treturn true;\n\t}\n\treturn false;\n}", "function validateURI(uri) {\n return uri.slice(-4) === '.xml' || /^http_{3}/.test(uri);\n}", "function hasEntityReference(input)\n{\n\tvar andLocation = input.indexOf('&');\n\tvar code;\n\tif (andLocation != -1 && andLocation + 1 < input.length) //if you found a & and the next thing that follows is an alpha\n\t{\n\t\tcode = input.charCodeAt(andLocation + 1);\n\t\tif ((code > 64 && code < 91) || // upper alpha (A-Z)\n \t(code > 96 && code < 123)) // lower alpha (a-z)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n}", "function shouldDecode(content: string, encoded: string): boolean {\n const div = document.createElement('div')\n div.innerHTML = `<div a=\"${content}\">`\n return div.innerHTML.indexOf(encoded) > 0\n}", "function isValidCharacter(char){\n return (char >= 'a' && char <= 'z') || char === '\\'';\n}", "function charSuitableForTagName(char) {\n return /[.\\-_a-z0-9\\u00B7\\u00C0-\\uFFFD]/i.test(char);\n} // it flips all brackets backwards and puts characters in the opposite order", "function validURI(uri) {\n return uri.match(/^(http|ftp)s?:\\/\\/[\\w.-]+\\.\\w+(\\/.*)?/);\n}", "function validateSpecialChars(input_val) {\n var re = /[\\/\\\\#,+!^()$~%.\":*?<>{}]/g;\n return re.test(input_val);\n}", "function validateSpecialCharacter(x) {\n var validateSpecialChar = /^[A-Za-z0-9\\_\\-]+$/;\n\n if (x.match(validateSpecialChar)) {\n return true;\n }\n else {\n return false;\n }\n}", "function checkSpecialChar(data){\n\tvar iChars = \"!@#$%^&*()+=-[]\\\\\\';,./{}|\\\":<>?~_\";\n\tisvalid=true;\n\tfor (var i = 0; i < data.length; i++) {\n\t\tif (iChars.indexOf(data.charAt(i)) != -1) {isvalid=false;}\n\t}return isvalid;\n}", "function areValidChars(char){\n for(var i=0; i<char.length; i++){\n if(alphabet.indexOf(char[i]) == -1 && char[i] != '_' && char[i] != '\\\\'){\n return char[i];\n }\n }\n return true;\n}", "function valid_url(url) {\n\tvar reg =/^([\\x20-\\x21]|[\\x23-\\x5b]|[\\x5d-\\x7e])*$/;\n\tif (!reg.test(url)) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "function isURL(str){\n\t\tif(typeof str === 'string'){\n\t\t\tif(str.indexOf('http') >= 0) return true;\n\t\t}\n\t\treturn false;\n\t}", "function validURL(str) {\r\n var pattern = new RegExp('^(https?:\\\\/\\\\/)?'+ // protocol\r\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|'+ // domain name\r\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))'+ // OR ip (v4) address\r\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*'+ // port and path\r\n '(\\\\?[;&a-z\\\\d%_.~+=-]*)?'+ // query string\r\n '(\\\\#[-a-z\\\\d_]*)?$','i'); // fragment locator\r\n return !!pattern.test(str);\r\n }", "function isClosed(char) {\n return char === '/' || char === '>';\n}", "function validURL(str) {\n var pattern = new RegExp('^(https?:\\\\/\\\\/)?' + // protocol\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|' + // domain name\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))' + // OR ip (v4) address\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*' + // port and path\n '(\\\\?[;&a-z\\\\d%_.~+=-]*)?' + // query string\n '(\\\\#[-a-z\\\\d_]*)?$', 'i'); // fragment locator\n return !!pattern.test(str);\n}", "function validURL(str) {\n var pattern = new RegExp('^(https?:\\\\/\\\\/)?' + // protocol\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|' + // domain name\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))' + // OR ip (v4) address\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*' + // port and path\n '(\\\\?[;&a-z\\\\d%_.~+=-]*)?' + // query string\n '(\\\\#[-a-z\\\\d_]*)?$', 'i'); // fragment locator\n return !!pattern.test(str);\n}", "function checkForCorrectURLStructure(data) {\n\t\tvar urlCheck = data.url.split('/');\n\t\treturn Boolean(urlCheck[1] === 'c');\n\t}", "validURL(str) {\n var pattern = new RegExp('^(https?:\\\\/\\\\/)?'+ // protocol\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|'+ // domain name\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))'+ // OR ip (v4) address\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*'+ // port and path\n '(\\\\?[;&a-z\\\\d%_.~+=-]*)?'+ // query string\n '(\\\\#[-a-z\\\\d_]*)?$','i'); // fragment locator\n return !!pattern.test(str);\n }", "function isURL( string )\n {\n \tvar substr1;\n \tvar substr2;\n \t\n \tsubstr1 = string.substr( 0, 5 );\n \tsubstr2 = string.substr( 0, 6 );\n \t\n \tif ( substr1 == \"http:\" || substr2 == \"https:\" )\n \t\treturn true;\n \telse\n \t\treturn false;\n }", "function validURL(str) {\n var pattern = new RegExp(\n \"^(https?:\\\\/\\\\/)?\" + // protocol\n \"((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|\" + // domain name\n \"((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))\" + // OR ip (v4) address\n \"(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*\" + // port and path\n \"(\\\\?[;&a-z\\\\d%_.~+=-]*)?\" + // query string\n \"(\\\\#[-a-z\\\\d_]*)?$\",\n \"i\"\n ); // fragment locator\n return !!pattern.test(str);\n}", "function simpleChar(character) {\n return CHAR_TAB !== character &&\n CHAR_LINE_FEED !== character &&\n CHAR_CARRIAGE_RETURN !== character &&\n CHAR_COMMA !== character &&\n CHAR_LEFT_SQUARE_BRACKET !== character &&\n CHAR_RIGHT_SQUARE_BRACKET !== character &&\n CHAR_LEFT_CURLY_BRACKET !== character &&\n CHAR_RIGHT_CURLY_BRACKET !== character &&\n CHAR_SHARP !== character &&\n CHAR_AMPERSAND !== character &&\n CHAR_ASTERISK !== character &&\n CHAR_EXCLAMATION !== character &&\n CHAR_VERTICAL_LINE !== character &&\n CHAR_GREATER_THAN !== character &&\n CHAR_SINGLE_QUOTE !== character &&\n CHAR_DOUBLE_QUOTE !== character &&\n CHAR_PERCENT !== character &&\n CHAR_COLON !== character &&\n !ESCAPE_SEQUENCES[character] &&\n !needsHexEscape(character);\n}", "function validateUriPartsDashSeparatedLowercase(data) {\n // eslint-disable-next-line no-param-reassign\n data = data.toValue();\n\n if (!data) {\n return false;\n }\n\n const parsed = parseUriTemplate(data);\n const literalParts = [];\n\n if (!parsed.expressions) {\n return false;\n }\n\n for (const expression of parsed.expressions) {\n if (expression.literal) {\n literalParts.push(expression.literal);\n }\n }\n for (const part of literalParts) {\n if (!_isDowncasedDashSeparated(part)) {\n return `Uri part \"${part}\" is not lowercased or dash separated.`;\n }\n }\n return true;\n}", "function simpleChar(character) {\n\t return CHAR_TAB !== character &&\n\t CHAR_LINE_FEED !== character &&\n\t CHAR_CARRIAGE_RETURN !== character &&\n\t CHAR_COMMA !== character &&\n\t CHAR_LEFT_SQUARE_BRACKET !== character &&\n\t CHAR_RIGHT_SQUARE_BRACKET !== character &&\n\t CHAR_LEFT_CURLY_BRACKET !== character &&\n\t CHAR_RIGHT_CURLY_BRACKET !== character &&\n\t CHAR_SHARP !== character &&\n\t CHAR_AMPERSAND !== character &&\n\t CHAR_ASTERISK !== character &&\n\t CHAR_EXCLAMATION !== character &&\n\t CHAR_VERTICAL_LINE !== character &&\n\t CHAR_GREATER_THAN !== character &&\n\t CHAR_SINGLE_QUOTE !== character &&\n\t CHAR_DOUBLE_QUOTE !== character &&\n\t CHAR_PERCENT !== character &&\n\t CHAR_COLON !== character &&\n\t !ESCAPE_SEQUENCES[character] &&\n\t !needsHexEscape(character);\n\t}", "function checkURL(str) {\n var pattern = /[-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:%_\\+.~#?&//=]*)?/gi;\n return pattern.test(str)\n }", "validURL(str) {\n var pattern = new RegExp('^(https?:\\\\/\\\\/)?'+ // protocol\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|'+ // domain name\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))'+ // OR ip (v4) address\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*'+ // port and path\n '(\\\\?[;&a-z\\\\d%_.~+=-]*)?'+ // query string\n '(\\\\#[-a-z\\\\d_]*)?$','i'); // fragment locator\n return !!pattern.test(str);\n }", "function illegalCharsFound(checkString)\n{\n //var specialCharacters = \"<>@!#$%^&*()_+[]{}?:;|'\\\"\\\\,./~`-=\";\n var specialCharacters = \"<>~`\";\n var result = false;\n if (checkString.indexOf('>')!=-1 || checkString.indexOf('<')!=-1 ) // dan is het gevonden\n {\n result = true; \n }\n\n return result;\n}", "function checkArticleUrl(articleUrl) {\n if (validUrl.isUri(articleUrl)) {\n return true;\n } else {\n return false;\n }\n}", "function areSimboluri(sir){\n\tvar simboluri=\"!@#$%^&*()_+=<>?|\";\n\t\n\tfor(var i=0;i<sir.length;i++){\n\t\tfor(var j=0;j<simboluri.length;j++){\n\t\t\tif(sir.includes(simboluri.charAt(j))){\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "valid(c) { return Character.isAlphabetic(c) || c=='+'||c=='/' }", "static isFetchableUri(uri) {\r\n return (\r\n C.RECOG_RGX.PROTOCOL.test(uri)\r\n );\r\n }", "function validURL(str) {\n var regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n return regexp.test(str);\n}", "function isUrlValid(userInput) {\n\t var res = userInput.match(/(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/g);\n\t if(res == null)\n\t return false;\n\t else\n\t return true;\n\t}", "function characterSuitableForNames(char) {\n return /[-_A-Za-z0-9]/.test(char); // notice, there's no dot or hash!\n }", "function isValidUrl(str: string): boolean {\n const isRelative = str.indexOf('://') === -1;\n try {\n new URL(str, isRelative ? 'http://example.com' : undefined);\n return true;\n } catch (_) {\n return false;\n }\n}", "function is_path(str) {\n let curr_char\n for (let i = 0; i < str.length; i ++) {\n curr_char = str.charCodeAt(i)\n if (!(curr_char == 95) &&\n !(curr_char > 45 && curr_char < 58) &&\n !(curr_char > 64 && curr_char < 91) &&\n !(curr_char > 96 && curr_char < 123)) {\n return false\n }\n }\n return true\n}", "function doesURLContainMatch(url, word){\n if(url.contains(word)){\n return true;\n }\n}", "function validateSpecialCharacters(sender, args)\n{\n args.IsValid = true;\n\n var iChars = \"!@$%^&*+=[]\\\\\\';.{}|\\\":<>\";\n for (var i = 0; i < args.Value.length; i++)\n {\n if (iChars.indexOf(args.Value.charAt(i)) != -1)\n {\n args.IsValid = false;\n\n return false;\n }\n }\n\n return args.IsValid;\n}", "function valid() {\n\t\treturn !(this.string.search(/^[!-~ ]+$/) === -1);\n\t}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function isChar(c) {\n return (c >= 0x0001 && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function checkIntegrity(input) {\n\tvar okayChars = /[A-Za-z_0-9\\\\\\/<>\\-~()\\s\\&\\|\\=\\!\\u2227\\u2228\\u2192\\u2194\\u22A4\\u22A5\\u00AC]/;\n\tfor (var i = 0; i < input.length; i++) {\n\t\tif (!okayChars.test(input.charAt(i))) {\n\t\t\tscannerFail(\"Illegal character\", i, i + 1);\n\t\t}\n\t}\n}", "function isValidHTTPToken (characters) {\n if (!characters || typeof characters !== 'string') {\n return false\n }\n for (let i = 0; i < characters.length; ++i) {\n const c = characters.charCodeAt(i)\n if (c > 0x7f || !isTokenChar(c)) {\n return false\n }\n }\n return true\n}", "function hasCharacters(string,chars){\n finded = false;\n chars = escapeRegExp(chars);\n var pattern = new RegExp(\"[\"+chars+\"]\",\"g\");\n var finded = string.match(pattern);\n return finded;\n }", "function hasCharacters(string,chars){\n finded = false;\n chars = escapeRegExp(chars);\n var pattern = new RegExp(\"[\"+chars+\"]\",\"g\");\n var finded = string.match(pattern);\n return finded;\n }", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\"/>\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\"/>\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\"/>\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\"/>\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\"/>\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\"/>\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\"/>\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\"/>\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\"/>\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function shouldDecode (content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\"/>\";\n return div.innerHTML.indexOf(encoded) > 0\n}", "function containsSpecialChars(name) {\n let pattern = new RegExp(/[~`!#$%\\^&*+=\\-\\[\\]\\\\';,/{}|\\\\\":<>\\?]/);\n return pattern.test(name);\n }", "function anchorIsValid(anchor) {\n if (/[\\x00-\\x19\\s,[\\]{}]/.test(anchor)) {\n const sa = JSON.stringify(anchor);\n const msg = `Anchor must not contain whitespace or control characters: ${sa}`;\n throw new Error(msg);\n }\n return true;\n}", "function shouldDecode(content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\"/>\";\n return div.innerHTML.indexOf(encoded) > 0;\n}", "function shouldDecode(content, encoded) {\n var div = document.createElement('div');\n div.innerHTML = \"<div a=\\\"\" + content + \"\\\"/>\";\n return div.innerHTML.indexOf(encoded) > 0;\n}", "function anchorIsValid(anchor) {\n if (/[\\x00-\\x19\\s,[\\]{}]/.test(anchor)) {\n const sa = JSON.stringify(anchor);\n const msg = `Anchor must not contain whitespace or control characters: ${sa}`;\n throw new Error(msg);\n }\n return true;\n }", "function isHashtagTextChar(char) {\n return char === '_' || regex_lib_1.alphaNumericAndMarksRe.test(char);\n}", "function strchk_unicode(str)\n{\n\tvar strlen=str.length;\n\tif(strlen>0)\n\t{\n\t\tvar c = '';\n\t\tfor(var i=0;i<strlen;i++)\n\t\t{\n\t\t\tc = escape(str.charAt(i));\n\t\t\tif(c.charAt(0) == '%' && c.charAt(1)=='u')\n\t\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "validateInput(char) {\n if ((new RegExp(`^${'[\\x00-\\x5F\\xC8-\\xCF]'}+$`)).test(char)) {\n return undefined;\n }\n else {\n return 'Supports only ASCII characters 00 to 95 (0–9, A–Z and control codes) and special characters.';\n }\n }", "function isSingleQuotable(node) {\n return node.body.every((part) => part.type === \"@tstring_content\" && !part.body.includes(\"'\"));\n}", "function isDataURI(filename){return hasPrefix(filename,dataURIPrefix);}", "function isCharUnsafe(compareChar) {\nvar unsafeString = \"\\\"<>%\\\\^[]`\\+\\$\\,='#&@.:\\t\";\n\tif ( unsafeString.indexOf(compareChar) == -1 && compareChar.charCodeAt(0) >= 32\n\t\t&& compareChar.charCodeAt(0) < 123 )\n\t\treturn false; // found no unsafe chars, return false\n\treturn true;\n}", "function nameCheck(name) {\n if (name.indexOf('\\\\') !== -1) {\n return false;\n }\n\n var reg = new RegExp('[*:/?<>\\\"|\\\\x5c]', 'g');\n if (reg.test(name)) {\n // invalid file or folder name.\n return false;\n }\n return true;\n}", "function is_url(str) {\n\t\treturn starts_with(str, 'http://') || starts_with(str, 'https://') || starts_with(str, '//');\n\t}", "function isExtglobChar(ch) {\n return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+';\n}" ]
[ "0.8148286", "0.75004035", "0.7145794", "0.7145794", "0.7145794", "0.7145794", "0.7145794", "0.7145794", "0.63356864", "0.62859356", "0.6084301", "0.6061681", "0.58914745", "0.58914745", "0.5885102", "0.58735883", "0.57816184", "0.57632244", "0.5762444", "0.57483834", "0.57417023", "0.57093304", "0.56707054", "0.56604755", "0.56448925", "0.5624595", "0.558081", "0.5578983", "0.55772763", "0.5540206", "0.5540206", "0.55197203", "0.55073225", "0.5474818", "0.54676586", "0.5467365", "0.5465613", "0.54457617", "0.5444666", "0.5415708", "0.54104227", "0.54078805", "0.54018855", "0.5393075", "0.5392583", "0.5377292", "0.5363596", "0.53247344", "0.5324354", "0.53202873", "0.5301434", "0.52954537", "0.5294305", "0.5269413", "0.5269413", "0.5269413", "0.5269413", "0.5269413", "0.5269413", "0.5269413", "0.5269413", "0.5269413", "0.5269413", "0.5269413", "0.5269413", "0.5269413", "0.5269355", "0.5266443", "0.5264949", "0.52638507", "0.52638507", "0.5259892", "0.5259892", "0.5259892", "0.5259892", "0.5259892", "0.5259892", "0.5259892", "0.5259892", "0.5259892", "0.5259892", "0.52587944", "0.5257381", "0.5250737", "0.5250737", "0.52274734", "0.5224698", "0.5222411", "0.52130604", "0.5212977", "0.52084947", "0.5197289", "0.5196725", "0.5195573", "0.5194061" ]
0.7969781
6
Check if `character` can be inside an unclosed URI.
function isUnclosedURLCharacter(character) { return character !== C_BRACKET_OPEN && character !== C_BRACKET_CLOSE && !whitespace(character); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isUnclosedURLCharacter(character) {\n return (\n character !== leftSquareBracket &&\n character !== rightSquareBracket &&\n !whitespace(character)\n )\n}", "function isEnclosedURLCharacter(character) {\n return (\n character !== greaterThan &&\n character !== leftSquareBracket &&\n character !== rightSquareBracket\n )\n}", "function isEnclosedURLCharacter(character) {\n return character !== C_GT &&\n character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE;\n}", "function isEnclosedURLCharacter(character) {\n return character !== C_GT &&\n character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE;\n}", "function isEnclosedURLCharacter(character) {\n return character !== C_GT &&\n character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE;\n}", "function isEnclosedURLCharacter(character) {\n return character !== C_GT &&\n character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE;\n}", "function isEnclosedURLCharacter(character) {\n return character !== C_GT &&\n character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE;\n}", "function isEnclosedURLCharacter(character) {\n return character !== C_GT &&\n character !== C_BRACKET_OPEN &&\n character !== C_BRACKET_CLOSE;\n}", "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "function needsHexEscape(character) {\n\t return !((0x00020 <= character && character <= 0x00007E) ||\n\t (character === 0x00085) ||\n\t (0x000A0 <= character && character <= 0x00D7FF) ||\n\t (0x0E000 <= character && character <= 0x00FFFD) ||\n\t (0x10000 <= character && character <= 0x10FFFF));\n\t}", "function isClosed(char) {\n return char === '/' || char === '>';\n}", "function validateURI(uri) {\n return uri.slice(-4) === '.xml' || /^http_{3}/.test(uri);\n}", "function resemblesURL(str) {\n return typeof str === 'string' && (str === '' || str.charAt(0) === '/');\n }", "function checkSpecialChar(data){\n\tvar iChars = \"!@#$%^&*()+=-[]\\\\\\';,./{}|\\\":<>?~_\";\n\tisvalid=true;\n\tfor (var i = 0; i < data.length; i++) {\n\t\tif (iChars.indexOf(data.charAt(i)) != -1) {isvalid=false;}\n\t}return isvalid;\n}", "static valid_url(value) {\n if (!value) return false;\n\n // check for illegal characters\n if (/[^a-z0-9:/?#[\\]@!$&'()*+,;=.\\-_~%]/i.test(value)) return false;\n\n // check for hex escapes that aren't complete\n if (/%[^0-9a-f]/i.test(value)) return false;\n if (/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value)) return false;\n\n return this.check_url_fragments(value);\n }", "function resemblesURL(str) {\n return typeof str === 'string' && (str === '' || str[0] === '/');\n }", "function resemblesURL(str) {\n return typeof str === 'string' && (str === '' || str[0] === '/');\n }", "function charSuitableForTagName(char) {\n return /[.\\-_a-z0-9\\u00B7\\u00C0-\\uFFFD]/i.test(char);\n} // it flips all brackets backwards and puts characters in the opposite order", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function areValidChars(char){\n for(var i=0; i<char.length; i++){\n if(alphabet.indexOf(char[i]) == -1 && char[i] != '_' && char[i] != '\\\\'){\n return char[i];\n }\n }\n return true;\n}", "function validURI(uri) {\n return uri.match(/^(http|ftp)s?:\\/\\/[\\w.-]+\\.\\w+(\\/.*)?/);\n}", "function simpleChar(character) {\n return CHAR_TAB !== character &&\n CHAR_LINE_FEED !== character &&\n CHAR_CARRIAGE_RETURN !== character &&\n CHAR_COMMA !== character &&\n CHAR_LEFT_SQUARE_BRACKET !== character &&\n CHAR_RIGHT_SQUARE_BRACKET !== character &&\n CHAR_LEFT_CURLY_BRACKET !== character &&\n CHAR_RIGHT_CURLY_BRACKET !== character &&\n CHAR_SHARP !== character &&\n CHAR_AMPERSAND !== character &&\n CHAR_ASTERISK !== character &&\n CHAR_EXCLAMATION !== character &&\n CHAR_VERTICAL_LINE !== character &&\n CHAR_GREATER_THAN !== character &&\n CHAR_SINGLE_QUOTE !== character &&\n CHAR_DOUBLE_QUOTE !== character &&\n CHAR_PERCENT !== character &&\n CHAR_COLON !== character &&\n !ESCAPE_SEQUENCES[character] &&\n !needsHexEscape(character);\n}", "function simpleChar(character) {\n\t return CHAR_TAB !== character &&\n\t CHAR_LINE_FEED !== character &&\n\t CHAR_CARRIAGE_RETURN !== character &&\n\t CHAR_COMMA !== character &&\n\t CHAR_LEFT_SQUARE_BRACKET !== character &&\n\t CHAR_RIGHT_SQUARE_BRACKET !== character &&\n\t CHAR_LEFT_CURLY_BRACKET !== character &&\n\t CHAR_RIGHT_CURLY_BRACKET !== character &&\n\t CHAR_SHARP !== character &&\n\t CHAR_AMPERSAND !== character &&\n\t CHAR_ASTERISK !== character &&\n\t CHAR_EXCLAMATION !== character &&\n\t CHAR_VERTICAL_LINE !== character &&\n\t CHAR_GREATER_THAN !== character &&\n\t CHAR_SINGLE_QUOTE !== character &&\n\t CHAR_DOUBLE_QUOTE !== character &&\n\t CHAR_PERCENT !== character &&\n\t CHAR_COLON !== character &&\n\t !ESCAPE_SEQUENCES[character] &&\n\t !needsHexEscape(character);\n\t}", "function valid() {\n\t\treturn !(this.string.search(/^[!-~ ]+$/) === -1);\n\t}", "function valid_url(url) {\n\tvar reg =/^([\\x20-\\x21]|[\\x23-\\x5b]|[\\x5d-\\x7e])*$/;\n\tif (!reg.test(url)) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "function isNsChar(c) {\n return isPrintable$1(c) && !isWhitespace$1(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN$1\n && c !== CHAR_LINE_FEED$1;\n}", "function checkIfNoIllegalCharacters ( name ) {\n return ( name.indexOf(\".\") === -1 ) &&\n ( name.indexOf(\"/\") === -1 ) &&\n ( name.indexOf(\":\") === -1) &&\n ( name.indexOf(\"*\") === -1 );\n }", "function testNormalCombinationOfSurrogates()\n{\n return \"\\uD800\\uDC00\".codePointAt(0) === 65536 && \"\\uD800\\uDC00\".codePointAt(1) === 56320 && \"\\uD800\\uDC00\".codePointAt(2) === undefined;\n}", "function validateSpecialCharacter(x) {\n var validateSpecialChar = /^[A-Za-z0-9\\_\\-]+$/;\n\n if (x.match(validateSpecialChar)) {\n return true;\n }\n else {\n return false;\n }\n}", "function testTrailSurrogateOutOfbounds()\n{\n return (\"\\uD800\\uDBFF\".codePointAt(0) === 0xd800 && \"\\uD800\\uDBFF\".codePointAt(1) === 0xdbff && \"\\uD800\\uDBFF\".codePointAt(2) === undefined\n && \"\\uD800\\uE000\".codePointAt(0) === 0xd800 && \"\\uD800\\uE000\".codePointAt(1) === 0xe000 && \"\\uD800\\uE000\".codePointAt(2) === undefined)\n}", "function illegalCharsFound(checkString)\n{\n //var specialCharacters = \"<>@!#$%^&*()_+[]{}?:;|'\\\"\\\\,./~`-=\";\n var specialCharacters = \"<>~`\";\n var result = false;\n if (checkString.indexOf('>')!=-1 || checkString.indexOf('<')!=-1 ) // dan is het gevonden\n {\n result = true; \n }\n\n return result;\n}", "function strchk_unicode(str)\n{\n\tvar strlen=str.length;\n\tif(strlen>0)\n\t{\n\t\tvar c = '';\n\t\tfor(var i=0;i<strlen;i++)\n\t\t{\n\t\t\tc = escape(str.charAt(i));\n\t\t\tif(c.charAt(0) == '%' && c.charAt(1)=='u')\n\t\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function validateSpecialChars(input_val) {\n var re = /[\\/\\\\#,+!^()$~%.\":*?<>{}]/g;\n return re.test(input_val);\n}", "function isPlainSafe(c, prev) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n // /* An ns-char preceding */ \"#\"\n && c !== CHAR_COLON\n && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));\n}", "function isPlainSafe(c, prev) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n // /* An ns-char preceding */ \"#\"\n && c !== CHAR_COLON\n && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));\n}", "function isPlainSafe(c, prev) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n // /* An ns-char preceding */ \"#\"\n && c !== CHAR_COLON\n && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));\n}", "function isPlainSafe(c, prev) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n // /* An ns-char preceding */ \"#\"\n && c !== CHAR_COLON\n && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));\n}", "function isPlainSafe(c, prev) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n // /* An ns-char preceding */ \"#\"\n && c !== CHAR_COLON\n && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));\n}", "function isPlainSafe(c, prev) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n // /* An ns-char preceding */ \"#\"\n && c !== CHAR_COLON\n && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));\n}", "function isPlainSafe(c, prev) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n // /* An ns-char preceding */ \"#\"\n && c !== CHAR_COLON\n && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));\n}", "function isPlainSafe(c, prev) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n // /* An ns-char preceding */ \"#\"\n && c !== CHAR_COLON\n && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));\n}", "function isPlainSafe(c, prev) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n // /* An ns-char preceding */ \"#\"\n && c !== CHAR_COLON\n && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));\n}", "function checkForCorrectURLStructure(data) {\n\t\tvar urlCheck = data.url.split('/');\n\t\treturn Boolean(urlCheck[1] === 'c');\n\t}", "function isCharAndNotRestricted(c) {\n return (c === 0x9) ||\n (c === 0xA) ||\n (c === 0xD) ||\n (c > 0x1F && c < 0x7F) ||\n (c === 0x85) ||\n (c > 0x9F && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function isForbiddenUrl(url) {\n return /^chrome:\\/\\/.*/.test(url)\n}", "function isValidCharacter(char){\n return (char >= 'a' && char <= 'z') || char === '\\'';\n}", "function is_path(str) {\n let curr_char\n for (let i = 0; i < str.length; i ++) {\n curr_char = str.charCodeAt(i)\n if (!(curr_char == 95) &&\n !(curr_char > 45 && curr_char < 58) &&\n !(curr_char > 64 && curr_char < 91) &&\n !(curr_char > 96 && curr_char < 123)) {\n return false\n }\n }\n return true\n}", "function hasEntityReference(input)\n{\n\tvar andLocation = input.indexOf('&');\n\tvar code;\n\tif (andLocation != -1 && andLocation + 1 < input.length) //if you found a & and the next thing that follows is an alpha\n\t{\n\t\tcode = input.charCodeAt(andLocation + 1);\n\t\tif ((code > 64 && code < 91) || // upper alpha (A-Z)\n \t(code > 96 && code < 123)) // lower alpha (a-z)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n}", "function isCharUnsafe(compareChar) {\nvar unsafeString = \"\\\"<>%\\\\^[]`\\+\\$\\,='#&@.:\\t\";\n\tif ( unsafeString.indexOf(compareChar) == -1 && compareChar.charCodeAt(0) >= 32\n\t\t&& compareChar.charCodeAt(0) < 123 )\n\t\treturn false; // found no unsafe chars, return false\n\treturn true;\n}", "function checkIntegrity(input) {\n\tvar okayChars = /[A-Za-z_0-9\\\\\\/<>\\-~()\\s\\&\\|\\=\\!\\u2227\\u2228\\u2192\\u2194\\u22A4\\u22A5\\u00AC]/;\n\tfor (var i = 0; i < input.length; i++) {\n\t\tif (!okayChars.test(input.charAt(i))) {\n\t\t\tscannerFail(\"Illegal character\", i, i + 1);\n\t\t}\n\t}\n}", "static isFetchableUri(uri) {\r\n return (\r\n C.RECOG_RGX.PROTOCOL.test(uri)\r\n );\r\n }", "function isPlainSafe$1(c, prev) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable$1(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA$3\n && c !== CHAR_LEFT_SQUARE_BRACKET$3\n && c !== CHAR_RIGHT_SQUARE_BRACKET$3\n && c !== CHAR_LEFT_CURLY_BRACKET$1\n && c !== CHAR_RIGHT_CURLY_BRACKET$1\n // - \":\" - \"#\"\n // /* An ns-char preceding */ \"#\"\n && c !== CHAR_COLON$1\n && ((c !== CHAR_SHARP$1) || (prev && isNsChar(prev)));\n}", "function isPlainSafeFirst(c) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part\n return isPrintable(c) && c !== CHAR_BOM\n && !isWhitespace(c) // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n && c !== CHAR_MINUS\n && c !== CHAR_QUESTION\n && c !== CHAR_COLON\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “\"”\n && c !== CHAR_SHARP\n && c !== CHAR_AMPERSAND\n && c !== CHAR_ASTERISK\n && c !== CHAR_EXCLAMATION\n && c !== CHAR_VERTICAL_LINE\n && c !== CHAR_EQUALS\n && c !== CHAR_GREATER_THAN\n && c !== CHAR_SINGLE_QUOTE\n && c !== CHAR_DOUBLE_QUOTE\n // | “%” | “@” | “`”)\n && c !== CHAR_PERCENT\n && c !== CHAR_COMMERCIAL_AT\n && c !== CHAR_GRAVE_ACCENT;\n}", "function isPlainSafeFirst(c) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part\n return isPrintable(c) && c !== CHAR_BOM\n && !isWhitespace(c) // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n && c !== CHAR_MINUS\n && c !== CHAR_QUESTION\n && c !== CHAR_COLON\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “\"”\n && c !== CHAR_SHARP\n && c !== CHAR_AMPERSAND\n && c !== CHAR_ASTERISK\n && c !== CHAR_EXCLAMATION\n && c !== CHAR_VERTICAL_LINE\n && c !== CHAR_EQUALS\n && c !== CHAR_GREATER_THAN\n && c !== CHAR_SINGLE_QUOTE\n && c !== CHAR_DOUBLE_QUOTE\n // | “%” | “@” | “`”)\n && c !== CHAR_PERCENT\n && c !== CHAR_COMMERCIAL_AT\n && c !== CHAR_GRAVE_ACCENT;\n}", "function isPlainSafeFirst(c) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part\n return isPrintable(c) && c !== CHAR_BOM\n && !isWhitespace(c) // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n && c !== CHAR_MINUS\n && c !== CHAR_QUESTION\n && c !== CHAR_COLON\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “\"”\n && c !== CHAR_SHARP\n && c !== CHAR_AMPERSAND\n && c !== CHAR_ASTERISK\n && c !== CHAR_EXCLAMATION\n && c !== CHAR_VERTICAL_LINE\n && c !== CHAR_EQUALS\n && c !== CHAR_GREATER_THAN\n && c !== CHAR_SINGLE_QUOTE\n && c !== CHAR_DOUBLE_QUOTE\n // | “%” | “@” | “`”)\n && c !== CHAR_PERCENT\n && c !== CHAR_COMMERCIAL_AT\n && c !== CHAR_GRAVE_ACCENT;\n}", "function isPlainSafeFirst(c) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part\n return isPrintable(c) && c !== CHAR_BOM\n && !isWhitespace(c) // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n && c !== CHAR_MINUS\n && c !== CHAR_QUESTION\n && c !== CHAR_COLON\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “\"”\n && c !== CHAR_SHARP\n && c !== CHAR_AMPERSAND\n && c !== CHAR_ASTERISK\n && c !== CHAR_EXCLAMATION\n && c !== CHAR_VERTICAL_LINE\n && c !== CHAR_EQUALS\n && c !== CHAR_GREATER_THAN\n && c !== CHAR_SINGLE_QUOTE\n && c !== CHAR_DOUBLE_QUOTE\n // | “%” | “@” | “`”)\n && c !== CHAR_PERCENT\n && c !== CHAR_COMMERCIAL_AT\n && c !== CHAR_GRAVE_ACCENT;\n}", "function isChar(c) {\n return (c >= 0x0001 && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function isUnicodeFraction(character) {\n\tvar unicode = character.charCodeAt(0);\n\treturn ((unicode >= 188 && unicode <= 190) || (unicode >= 8531 && unicode <= 8542));\n}", "function isInvalidChar(str) {\n var ch = toStr(str);\n return ch === '\\\\' || ch === '[' || ch === ']' || ch === '^' || ch === '(' || ch === ')' || ch === '`';\n}", "function isnotSpecial(str){\n\tstringSpecialCheck=\"!#$%^&*()+|<>?/=~,;:][{}\"+\"\\\\\";\n\n\n\n\n\n\n\n\tf4=1;\n\tfor(j=0;j<str.length;j++){\n\t\tif(stringSpecialCheck.indexOf(str.charAt(j))!=-1){\n\t\t\tf4=0;\n\t\t}\n\t}\n\tif(f4==0){\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "function isValidUrl(str: string): boolean {\n const isRelative = str.indexOf('://') === -1;\n try {\n new URL(str, isRelative ? 'http://example.com' : undefined);\n return true;\n } catch (_) {\n return false;\n }\n}", "consumeTheRemnantsOfABadURL() {\n while (true) {\n this.consume();\n if (this.code_ === /* '-' */ 0x2d || this.eof()) {\n return;\n } else if (this./*OK*/ startsWithAValidEscape()) {\n this.consumeEscape();\n }\n }\n }", "function isPlainSafe(c) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n && c !== CHAR_COLON\n && c !== CHAR_SHARP;\n}", "function isPlainSafe(c) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n && c !== CHAR_COLON\n && c !== CHAR_SHARP;\n}", "function isPlainSafe(c) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n && c !== CHAR_COLON\n && c !== CHAR_SHARP;\n}", "function isPlainSafe(c) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n && c !== CHAR_COLON\n && c !== CHAR_SHARP;\n}", "function isPlainSafe(c) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n && c !== CHAR_COLON\n && c !== CHAR_SHARP;\n}", "function isPlainSafe(c) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n && c !== CHAR_COLON\n && c !== CHAR_SHARP;\n}", "function isPlainSafe(c) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n && c !== CHAR_COLON\n && c !== CHAR_SHARP;\n}", "function isPlainSafe(c) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n && c !== CHAR_COLON\n && c !== CHAR_SHARP;\n}", "function isPlainSafe(c) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n && c !== CHAR_COLON\n && c !== CHAR_SHARP;\n}", "function isPlainSafe(c) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n && c !== CHAR_COLON\n && c !== CHAR_SHARP;\n}", "function isPlainSafe(c) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n && c !== CHAR_COLON\n && c !== CHAR_SHARP;\n}", "function areSimboluri(sir){\n\tvar simboluri=\"!@#$%^&*()_+=<>?|\";\n\t\n\tfor(var i=0;i<sir.length;i++){\n\t\tfor(var j=0;j<simboluri.length;j++){\n\t\t\tif(sir.includes(simboluri.charAt(j))){\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "function isInvalidChar(str) {\n var ch = toStr(str);\n return ch === '\\\\'\n || ch === '['\n || ch === ']'\n || ch === '^'\n || ch === '('\n || ch === ')'\n || ch === '`';\n}", "function isInvalidChar(str) {\n var ch = toStr(str);\n return ch === '\\\\'\n || ch === '['\n || ch === ']'\n || ch === '^'\n || ch === '('\n || ch === ')'\n || ch === '`';\n}", "function invalid__CHARACTER__ERR_ques_(domException) /* (domException : domException) -> bool */ {\n return (domException === 5);\n}", "function isPlainSafe(c) {\n\t // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n\t // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n\t return isPrintable(c) && c !== 0xFEFF\n\t // - c-flow-indicator\n\t && c !== CHAR_COMMA\n\t && c !== CHAR_LEFT_SQUARE_BRACKET\n\t && c !== CHAR_RIGHT_SQUARE_BRACKET\n\t && c !== CHAR_LEFT_CURLY_BRACKET\n\t && c !== CHAR_RIGHT_CURLY_BRACKET\n\t // - \":\" - \"#\"\n\t && c !== CHAR_COLON\n\t && c !== CHAR_SHARP;\n\t}", "function isPlainSafe(c) {\n\t // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n\t // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n\t return isPrintable(c) && c !== 0xFEFF\n\t // - c-flow-indicator\n\t && c !== CHAR_COMMA\n\t && c !== CHAR_LEFT_SQUARE_BRACKET\n\t && c !== CHAR_RIGHT_SQUARE_BRACKET\n\t && c !== CHAR_LEFT_CURLY_BRACKET\n\t && c !== CHAR_RIGHT_CURLY_BRACKET\n\t // - \":\" - \"#\"\n\t && c !== CHAR_COLON\n\t && c !== CHAR_SHARP;\n\t}", "function isPlainSafe(c) {\n\t // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n\t // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n\t return isPrintable(c) && c !== 0xFEFF\n\t // - c-flow-indicator\n\t && c !== CHAR_COMMA\n\t && c !== CHAR_LEFT_SQUARE_BRACKET\n\t && c !== CHAR_RIGHT_SQUARE_BRACKET\n\t && c !== CHAR_LEFT_CURLY_BRACKET\n\t && c !== CHAR_RIGHT_CURLY_BRACKET\n\t // - \":\" - \"#\"\n\t && c !== CHAR_COLON\n\t && c !== CHAR_SHARP;\n\t}", "function isEscapeable(char){\n\tif(char == ','\n\t|| char == '(' || char == ')'\n\t|| char == '[' || char == ']'\n\t|| char == '{' || char == '}'){\n\t\treturn true;\n\t}\n\treturn false;\n}", "valid(c) { return Character.isAlphabetic(c) || c=='+'||c=='/' }", "checkEscapeChar(){\n\t\tif(!this.buffer.length) return;\n\t\tif(this.buffer[this.buffer.length - 1] === \"\\\\\"){\n\t\t\tthis.escaped = !this.escaped;\n\t\t}else{\n\t\t\tthis.escaped = false;\n\t\t}\n\t}", "checkEscapeChar(){\n\t\tif(!this.buffer.length) return;\n\t\tif(this.buffer[this.buffer.length - 1] === \"\\\\\"){\n\t\t\tthis.escaped = !this.escaped;\n\t\t}else{\n\t\t\tthis.escaped = false;\n\t\t}\n\t}", "function validURL(str) {\r\n var pattern = new RegExp('^(https?:\\\\/\\\\/)?'+ // protocol\r\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|'+ // domain name\r\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))'+ // OR ip (v4) address\r\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*'+ // port and path\r\n '(\\\\?[;&a-z\\\\d%_.~+=-]*)?'+ // query string\r\n '(\\\\#[-a-z\\\\d_]*)?$','i'); // fragment locator\r\n return !!pattern.test(str);\r\n }", "function isDataURL(s) {\n return !!s.match(isDataURL.regex);\n}", "function nameCheck(name) {\n if (name.indexOf('\\\\') !== -1) {\n return false;\n }\n\n var reg = new RegExp('[*:/?<>\\\"|\\\\x5c]', 'g');\n if (reg.test(name)) {\n // invalid file or folder name.\n return false;\n }\n return true;\n}" ]
[ "0.83408904", "0.81213295", "0.8058062", "0.8058062", "0.8058062", "0.8058062", "0.8058062", "0.8058062", "0.6533353", "0.6472987", "0.6284194", "0.6104877", "0.6047299", "0.59952676", "0.58667606", "0.58416814", "0.58416814", "0.5814853", "0.5802503", "0.5802503", "0.5802503", "0.5802503", "0.5802503", "0.5802503", "0.5802503", "0.5802503", "0.5802503", "0.5800736", "0.58001316", "0.5763273", "0.57606304", "0.5756406", "0.57509696", "0.5749876", "0.5742126", "0.5733787", "0.5688375", "0.5686453", "0.56792706", "0.5671433", "0.5652083", "0.5648587", "0.5648587", "0.5648587", "0.5648587", "0.5648587", "0.5648587", "0.5648587", "0.5648587", "0.5648587", "0.5648439", "0.5611492", "0.5607968", "0.5604023", "0.56031346", "0.55506045", "0.55487514", "0.5542829", "0.55209106", "0.551626", "0.55008334", "0.55008334", "0.55008334", "0.55008334", "0.5495891", "0.5486571", "0.54816437", "0.5470706", "0.54550266", "0.5446815", "0.54461867", "0.54461867", "0.54461867", "0.54461867", "0.54461867", "0.54461867", "0.54461867", "0.54461867", "0.54461867", "0.54461867", "0.54461867", "0.5446076", "0.5445665", "0.5445665", "0.54381853", "0.54318845", "0.54318845", "0.54318845", "0.54162014", "0.54113424", "0.5407988", "0.5407988", "0.5405726", "0.53914213", "0.5389915" ]
0.81635445
6
Check if the given character code, or the character code at the first character, is a word character.
function wordCharacter(character) { return re.test( typeof character === 'number' ? fromCode(character) : character.charAt(0) ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isWord(str){\n\n\tlet out = true;\n\tif (str.search(/[^\\w\\s]/) != -1){\n\n\t\tout = false;\n\t};\n\treturn out\n}", "function isWord(str) {\n var alphaNumericFound = false;\n for (var i = 0; i < str.length; i++) {\n var code = str.charCodeAt(i);\n if ((code > 47 && code < 58) || // numeric (0-9)\n (code > 64 && code < 91) || // upper alpha (A-Z)\n (code > 96 && code < 123)) { // lower alpha (a-z)\n alphaNumericFound = true;\n return alphaNumericFound;\n }\n }\n return alphaNumericFound;\n }", "function checkWords(letter) {\n let regex = /^[a-z]{1}$/;\n let bon = regex.test(letter);\n if (!bon) {\n return false;\n } else if (bon) {\n return true;\n }\n}", "function latinWordStartCheck(contextParams) {\r\n\t const char = contextParams.current;\r\n\t const prevChar = contextParams.get(-1);\r\n\t return (\r\n\t // ? latin first char\r\n\t (prevChar === null && isLatinChar(char)) ||\r\n\t // ? latin char preceded with a non latin char\r\n\t (!isLatinChar(prevChar) && isLatinChar(char))\r\n\t );\r\n\t}", "checkIfWordHasLetter(letter) {\r\n return this.text.includes(letter);\r\n }", "function singleWord(){\n var s = ch;\n while (next() && \": \\t\\n\\r-+={(}[])'\\\"\".indexOf(ch)==-1) {s+= ch}\n return s;\n }", "function validWord(str){\n\tif (!str) return false;\n\n\tstr = str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n\tif(!str || str == '' || str == ' '){\n\t\treturn false;\n\t}\n\treturn true;\n}", "function checkWord(word) {\n const wval = word.value.trim(); // how much we have of the current word.\n\n let current = $(\".current-word\")[0];\n let currentString = current.innerHTML; // check if we have any typing errors and\n // make sure there is a real word to check\n // https://github.com/anschwa/typing-test/issues/2\n\n const noMatch = wval !== currentString;\n const emptyWords = wval === '' || currentString === '';\n\n if (noMatch || emptyWords) {\n current.classList.add(\"incorrect-word-bg\");\n return false;\n } else {\n current.classList.remove(\"incorrect-word-bg\");\n return true;\n }\n}", "function checkWord(word) {\n var wlen = word.value.length;\n // how much we have of the current word.\n var current = $(\".current-word\")[0];\n var currentSubstring = current.innerHTML.substring(0, wlen);\n // check if we have any typing errors\n if (word.value.trim() != currentSubstring) {\n current.classList.add(\"incorrect-word-bg\");\n return false;\n } else {\n current.classList.remove(\"incorrect-word-bg\");\n return true;\n }\n}", "function verifyWord(word) {\n return (word.length > 1 && word.length < 26)\n}", "function isLetterInWord(word,letter){\r\n \r\n for (var i=0; i<word.length; i++){\r\n if (word[i] == letter) return true;\r\n }\r\n \r\n return false;\r\n}", "function matchNonWordCharacter(e) {\n return (e.match(/^(?=.*[_\\W]).+$/) === null) ? true : false;\n }", "function wordCharacters() {\n return this.flags.WORDCHARS || null\n}", "function isWordReg(s) {\n return WORD_REG.has(s.toLowerCase());\n}", "function isWordReg(s) {\n return WORD_REG.has(s.toLowerCase());\n}", "function isWord (cm, from, to) {\n\t\tvar str = cm.getRange(from, to);\n\t\tif (str.match(/^\\w+$/) !== null) {\n\t\t\tvar pos, chr;\n\t\t\tif (from.ch > 0) {\n\t\t\t\tpos = {line: from.line, ch: from.ch - 1};\n\t\t\t\tchr = cm.getRange(pos, from);\n\t\t\t\tif (chr.match(/\\W/) === null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (to.ch < cm.getLine(from.line).length) {\n\t\t\t\tpos = {line: to.line, ch: to.ch + 1};\n\t\t\t\tchr = cm.getRange(to, pos);\n\t\t\t\tif (chr.match(/\\W/) === null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function checkWord (word) {\n return (dict[word.toLowerCase()] ? true : false);\n}", "function hasOnlyLowerCaseChars(word = '') {\n return new RegExp('^[a-z]+$', 'g').test(word);\n}", "function BOT_wordIsStr(word) {\r\n\tif(BOT_member(BOT_stresserList,word)) return(true)\r\n\treturn (false)\r\n}", "function checkFirstLetterCapitalized( word ){\n\tif(word[0] === word[0].toUpperCase()){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function word() {\n return wrap('word', or(atom, quotedString)());\n }", "function word() {\n return wrap('word', or(atom, quotedString)());\n }", "function word() {\n return wrap('word', or(atom, quotedString)());\n }", "function word() {\n return wrap('word', or(atom, quotedString)());\n }", "checkLetter(letter) {\n return this.phrase.includes(letter.textContent);\n }", "function matchChar() {\n\t\tvar pattern = /^[a-z]/;\n\t\tvar x = lexString.match(pattern);\n\t\tif(x !== null) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function checkOutsideLetters( word ){\n\tvar last = word.length-1\n\tif(word[0] === word[last]){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "_isEntireWord(content, startIdx, length) {\n if (startIdx > 0) {\n const first = content.charCodeAt(startIdx);\n const limit = content.charCodeAt(startIdx - 1);\n if (getCharacterType(first) === getCharacterType(limit)) {\n return false;\n }\n }\n const endIdx = startIdx + length - 1;\n if (endIdx < content.length - 1) {\n const last = content.charCodeAt(endIdx);\n const limit = content.charCodeAt(endIdx + 1);\n if (getCharacterType(last) === getCharacterType(limit)) {\n return false;\n }\n }\n return true;\n }", "function isLetter(code) {\n return isUppercaseLetter(code) || isLowercaseLetter(code);\n}", "function spaceTester() {\n if (getUniqueLetters().includes(\" \")) {\n return true;\n } else {\n return false;\n }\n}", "function isChar (code) {\n\t// http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes\n\treturn code === 32 || (code > 46 && !(code >= 91 && code <= 123) && code !== 144 && code !== 145);\n}", "function validWord(word) {\n return dictarray[word] ? true : false;\n}", "function isChar(c) {\n return (c >= SPACE && c <= 0xD7FF) ||\n c === NL || c === CR || c === TAB ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function isLowerCased(word) {\n for (var i = 0; i < word.length; i++) {\n if (word[i] !== word[i].toLowerCase()) {\n return false;\n }\n }\n return true;\n}", "function isLowerCased(word) {\n for (var i = 0; i < word.length; i++) {\n if (word[i] !== word[i].toLowerCase()) {\n return false;\n }\n }\n return true;\n}", "function getFirstWordLength( string ) { // 5726\n return string.match( /\\w+/ )[ 0 ].length // 5727\n } // 5728", "function insideWord(check, state$1, from, to) {\n return check(state$1.sliceDoc(from, from + 1)) == state.CharCategory.Word\n && check(state$1.sliceDoc(to - 1, to)) == state.CharCategory.Word;\n}", "function ContainWord(str, w) {\n\tvar temp = str.indexOf(w);\n\treturn (temp != -1);\n}", "function wordInString(s, word){\n return new RegExp( '\\\\b' + word + '\\\\b', 'i').test(s);\n}", "function classifyCharacter(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return 1\n }\n\n if (unicodePunctuation(code)) {\n return 2\n }\n}", "function classifyCharacter(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return 1\n }\n\n if (unicodePunctuation(code)) {\n return 2\n }\n}", "function skipWord() {\n while (_base.state.pos < _base.input.length) {\n const ch = _base.input.charCodeAt(_base.state.pos);\n if (_identifier.IS_IDENTIFIER_CHAR[ch]) {\n _base.state.pos++;\n } else if (ch === _charcodes.charCodes.backslash) {\n // \\u\n _base.state.pos += 2;\n if (_base.input.charCodeAt(_base.state.pos) === _charcodes.charCodes.leftCurlyBrace) {\n while (\n _base.state.pos < _base.input.length &&\n _base.input.charCodeAt(_base.state.pos) !== _charcodes.charCodes.rightCurlyBrace\n ) {\n _base.state.pos++;\n }\n _base.state.pos++;\n }\n } else {\n break;\n }\n }\n}", "function BOT_wordIsPss(word) {\r\n\tif(word == \"of\") return(true) \r\n}", "checkLetter(e){\n const phraseJoin = this.phrase.join('');\n return phraseJoin.includes(e.toLowerCase()) ? true : false;\n }", "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n }", "function firstWord (text) {\n let firstBlank = text.indexOf(' ');\n \n let fWord = text.substr(0, firstBlank);\n return fWord;\n}", "_isCharWordSeparator(cell) {\n // Zero width characters are never separators as they are always to the\n // right of wide characters\n if (cell.getWidth() === 0) {\n return false;\n }\n return this._optionsService.options.wordSeparator.indexOf(cell.getChars()) >= 0;\n }", "function stringBlank(word) {\n if (word === \" \") {\n return true;\n } else {\n return false;\n }\n}", "function areCharsOrLetters(theString) {\n var regSpecialChar = /[`!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?~]/\n var isChar = regSpecialChar.test(theString)\n var isLetter = theString.match(/[a-z]/i)\n if (isChar != false && isLetter != null) {\n return true\n } else if (isLetter != null) {\n return true\n } else if (isChar != false) {\n return true\n } else {\n return false\n }\n}", "function isWord(word){\n return trie.contains(word);\n}", "function isAlphabetCharacter(letter) {\n return (letter.length === 1) && /[a-z]/i.test(letter);\n}", "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n}", "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n}", "function isUperCase({word}, alphabet){\r\n\tstr = word[0]\r\n\tfor(i in alphabet){\r\n\t\tif(alphabet[i]===str){\t\r\n\t\t return true\t\t\r\n\t\t}\r\n\t}\r\n\treturn false\r\n}", "function isLetter(str, pos) {\n\t if (pos < 0 || pos >= str.length) { return false; }\n\t return !PUNCT_RE.test(str[pos]);\n\t}", "function isLetter(str, pos) {\n\t if (pos < 0 || pos >= str.length) { return false; }\n\t return !PUNCT_RE.test(str[pos]);\n\t}", "function isLetter(str, pos) {\n\t if (pos < 0 || pos >= str.length) { return false; }\n\t return !PUNCT_RE.test(str[pos]);\n\t}", "function Words(w) {\n\tvar arr = w.split(\" \");\n\treturn arr.length;\n}", "function hasWord(string, word) {\nreturn string.includes(word);\n}", "function isLetter(char) {\r\n return char.match(/[a-z]/i);\r\n}", "function isAlpha(c){\r\n return /^\\w$/.test(c) && /^\\D$/.test(c);\r\n}", "function countWord(word) {\n if (typeof word !== 'string'){\n return 'error input bukan string';\n } else if (word === \"\") {\n return '';\n } else {\n let count = 1\n for (let j = 0; j < word.length; j++) {\n if (word[j] === ' ' && word[j+1] !== ' ') {\n count++\n }\n }\n if (word === '') return '' \n else return count\n }\n}", "function isLetter(char){\n\treturn char.match(/[a-z]/i);\n}", "function isLetter(c) {\n\treturn isUppercase(c) || isLowercase(c) || c==32;\n}", "function containsUppercaseLetter(word) {\n\tfor (var i = 0; i < word.length; i++) {\n\t\tvar char = word[i];\n\t\t\tif (char.toUpperCase() === char && char.toLowerCase() !== char) {\n\t\t\t\treturn true;\n\t\t\t}\n\t}\n\treturn false;\n}", "checkLetter(char) {\r\n if (this.phrase.includes(char)) {\r\n return char;\r\n }\r\n return null;\r\n }", "function convertToWord(char) {\n switch (char) {\n case \"r\":\n return \"Tosh\"\n case \"s\":\n return \"Qaychi\";\n }\n return \"Qog'oz\";\n}", "uc_words(str) {\n if (typeof str !== 'string') return false;\n var words = str.split(' ');\n if (!this.is_array(words)) return this.uc_first(str);\n words.forEach((word, idx) => {\n words[idx] = this.uc_first(word);\n });\n return words.join(' ');\n }", "function getLetter(word) {\n if (word.charAt(0) === 'a') {\n return word.charAt(1);\n } else if (word.charAt(0) === 'b') {\n return word.charAt(2);\n } else if (word.charAt(0) === 'c') {\n return word.charAt(3);\n } else if (word.charAt(0) === 'd') {\n return word.charAt(4);\n } else {\n return ' ';\n }\n}", "function readWord() {\n let treePos = 0;\n let code = 0;\n let pos = state.pos;\n while (pos < input.length) {\n code = input.charCodeAt(pos);\n if (code < charCodes.lowercaseA || code > charCodes.lowercaseZ) {\n break;\n }\n const next = READ_WORD_TREE[treePos + (code - charCodes.lowercaseA) + 1];\n if (next === -1) {\n break;\n } else {\n treePos = next;\n pos++;\n }\n }\n\n const keywordValue = READ_WORD_TREE[treePos];\n if (keywordValue > -1 && !IS_IDENTIFIER_CHAR[code]) {\n state.pos = pos;\n if (keywordValue & 1) {\n finishToken(keywordValue >>> 1);\n } else {\n finishToken(TokenType.name, keywordValue >>> 1);\n }\n return;\n }\n\n while (pos < input.length) {\n const ch = input.charCodeAt(pos);\n if (IS_IDENTIFIER_CHAR[ch]) {\n pos++;\n } else if (ch === charCodes.backslash) {\n // \\u\n pos += 2;\n if (input.charCodeAt(pos) === charCodes.leftCurlyBrace) {\n while (pos < input.length && input.charCodeAt(pos) !== charCodes.rightCurlyBrace) {\n pos++;\n }\n pos++;\n }\n } else if (ch === charCodes.atSign && input.charCodeAt(pos + 1) === charCodes.atSign) {\n pos += 2;\n } else {\n break;\n }\n }\n state.pos = pos;\n finishToken(TokenType.name);\n}", "function hasWord(string, word) {\n return string.includes(word);\n}", "function hasWord(string, word) {\n return string.includes(word);\n}", "function letterCheck(str, letter) { return str.includes(letter) }", "function classifyCharacter$2(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace$8(code) ||\n unicodeWhitespace$1(code)\n ) {\n return 1\n }\n\n if (unicodePunctuation$1(code)) {\n return 2\n }\n}", "function isLetter(c) {\n return (c.toUpperCase() != c.toLowerCase());\n}", "function singleWord() {\n //Capture input value\n wordStr = elements.wordInput.value;\n if(regex.test(wordStr)) {\n consoleDisplay(\"single\")\n //keep status at 0\n gamestatus = 0;\n } else {\n //Set game status to 1\n gamestatus = 1;\n }\n}", "function lexicator(word) {\n return Word.check(word);\n\n}", "checkLetter(letter) {\r\n return !(this.phrase.indexOf(letter) == -1);\r\n }", "function isChar( i, r, c ) {\n return board[r][c] === word[i];\n }", "function isFullLetter(char)\n{\n\tif ((char < 'a' || char > 'z') && (char <'A' || char > 'Z') && char != \" \")\n\t{\n\t\treturn false;\n\t}\n\treturn true;\n}", "function skipWord() {\n while (state.pos < input.length) {\n const ch = input.charCodeAt(state.pos);\n if (IS_IDENTIFIER_CHAR[ch]) {\n state.pos++;\n } else if (ch === charCodes.backslash) {\n // \\u\n state.pos += 2;\n if (input.charCodeAt(state.pos) === charCodes.leftCurlyBrace) {\n while (\n state.pos < input.length &&\n input.charCodeAt(state.pos) !== charCodes.rightCurlyBrace\n ) {\n state.pos++;\n }\n state.pos++;\n }\n } else {\n break;\n }\n }\n}", "function getFirstWordLength( string ) {\n\t return string.match( /\\w+/ )[ 0 ].length\n\t }", "function firstWord(a, b) {\n // Find the first word in a given text using RegExp match() method.\n var word = a.match(/[A-Za-z']+/)[0];\n\n return word;\n}", "checkLetter(letter) {\n let status = false;\n for (let i = 0; i < this.phrase.length; i++) {\n if (letter === this.phrase[i].toLowerCase()) {\n status = true;\n }\n }\n return status;\n }", "function isLetter( character ) {\n\treturn character.toLowerCase() != character.toUpperCase();\n}", "function isLetter(ch) {\n if (ch.match(/[a-zA-Z]/i)) {\n return true;\n } else {\n return false;\n }\n}", "function sc_isChar(c) {\n return (c instanceof sc_Char);\n}", "function wordCheck(letter) {\n var WordLetters = false;\n for (var i = 0; i < nameLength; i++) {\n if (chosenName[i] === letter) {\n WordLetters = true;\n }\n }\n\n if (WordLetters) {\n for (var i = 0; i < nameLength; i++) {\n if (chosenName[i] === letter) {\n emptyWord[i] = letter;\n }\n }\n }\n\n else (chosenName[i] !== letter); {\n incorrectGuess.push(letter);\n incorrect--;\n }\n\n \n}", "function countLetter(word) {\n const sContainer = selectElement(\".secret-word\");\n for (let i = 0; i < word.length; i++) {\n if (word[i] == \" \") {\n sContainer.textContent += \" \";\n }\n else {\n sContainer.textContent += \"_\";\n }\n }\n}", "function AtSpace(inword, i, gix) {\n\tif (gix == -1) {\n\t\t// Before _ this must match beginning of word\n\t\tif (i == 0 || inword.charAt(i-1) == ' ')\n\t\t\treturn true;\n\t} else {\n\t\t// After _ this must match end of word\n\t\tif (i == inword.length || inword.charAt(i) == ' ')\n\t\t\treturn true;\n\t}\n\treturn false;\n}", "function getFirstWordLength( string ) {\n return string.match( /\\w+/ )[ 0 ].length\n }", "function getFirstWordLength( string ) {\n return string.match( /\\w+/ )[ 0 ].length\n }", "function getFirstWordLength( string ) {\n return string.match( /\\w+/ )[ 0 ].length\n }", "function getFirstWordLength( string ) {\n return string.match( /\\w+/ )[ 0 ].length\n }", "function getFirstWordLength( string ) {\n return string.match( /\\w+/ )[ 0 ].length\n }" ]
[ "0.72252107", "0.6977966", "0.69345456", "0.65612113", "0.6549606", "0.65157354", "0.6493537", "0.6350567", "0.62914944", "0.62824345", "0.6246255", "0.6213352", "0.62027997", "0.61801505", "0.61801505", "0.6117986", "0.61055684", "0.6033244", "0.6031746", "0.6029927", "0.60191154", "0.60191154", "0.60191154", "0.60191154", "0.59901243", "0.59667015", "0.59621036", "0.59600604", "0.5952987", "0.5942606", "0.59187734", "0.5890822", "0.5882112", "0.5834611", "0.5834611", "0.5825535", "0.5824318", "0.5806206", "0.5794359", "0.5773644", "0.5773644", "0.5764254", "0.57588", "0.5756977", "0.57558894", "0.57537186", "0.5749147", "0.5745594", "0.5742609", "0.57238483", "0.5711422", "0.570969", "0.570969", "0.57084054", "0.5704613", "0.5704613", "0.5704613", "0.5698082", "0.56970066", "0.56850845", "0.567984", "0.5672849", "0.5672509", "0.56702954", "0.5669123", "0.56676465", "0.56641996", "0.56587", "0.5648206", "0.5642672", "0.56392854", "0.56392854", "0.56375074", "0.56366724", "0.5625368", "0.5617539", "0.5615917", "0.56129825", "0.56108916", "0.560842", "0.56074804", "0.55952305", "0.5592392", "0.5591292", "0.55901307", "0.5588187", "0.5587661", "0.5585981", "0.55859596", "0.5585334", "0.5583879", "0.5583879", "0.5583879", "0.5583879", "0.5583879" ]
0.7577229
5
Visit a single node.
function one(node) { var result if (!type || node.type === type) { result = visitor(node, stack.concat()) } if (node.children && result !== false) { return all(node.children, node) } return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "visitNode(node) { }", "visit() {\n if(this.state) this.state = Node.VISITED;\n }", "function node(){}", "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 }", "function visit(node, fn) {\n if (!node.visited) {\n define(node, 'visited', true);\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n return node;\n}", "function visit(node, fn) {\n if (!node.visited) {\n define(node, 'visited', true);\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n\n return node;\n}", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "function visit(node, fn) {\n if (!node.visited) {\n _define(node, 'visited', true);\n\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n\n return node;\n}", "function visit(node, fn) {\n if (!node.visited) {\n defineProperty$7(node, 'visited', true);\n return node.nodes ? mapVisit$1(node.nodes, fn) : fn(node);\n }\n return node;\n}", "function traverseNodes(node, visitor) {\n traverse(node, null, visitor);\n}", "function one(node) {\n if (node.type === type) {\n callback.call(context, node);\n }\n\n var children = node.children;\n var index = -1;\n var length = children ? children.length : 0;\n\n while (++index < length) {\n one(children[index]);\n }\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function node() {\n invoke(this);\n }", "function visitedNode(url) {\n\tvar nodeIndex = getNodeIndex(url);\n\tvar node = dataHolder.nodes[nodeIndex];\n\tnode.visited = true;\n}", "function Node() {}", "get node() { return this._node; }", "function Node(){}", "visit(){\n this.visited = true ;\n }", "function one(node, index, parents) {\n var result\n\n if (!test || is(test, node, index, parents[parents.length - 1] || null)) {\n result = visitor(node, parents)\n\n if (result === EXIT) {\n return result\n }\n }\n\n if (node.children && result !== SKIP) {\n return all(node.children, parents.concat(node)) === EXIT ? EXIT : result\n }\n\n return result\n }", "function one(node, index, parents) {\n var result\n\n if (!test || is(test, node, index, parents[parents.length - 1] || null)) {\n result = visitor(node, parents)\n\n if (result === EXIT) {\n return result\n }\n }\n\n if (node.children && result !== SKIP) {\n return all(node.children, parents.concat(node)) === EXIT ? EXIT : result\n }\n\n return result\n }", "trackNodeBy(index, node) {\n return node.id;\n }", "function printNode (value) {\n console.log('Visisted vertex: ' + value)\n}", "function xpath_single_node(context_node, xpath) {\n return document.evaluate( \n xpath + '[1]', \n context_node, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null\n ).singleNodeValue;\n }", "traverse() {\n this.root.visit(this.root);\n }", "function acceptNode()\n {\n return NodeFilter.FILTER_ACCEPT;\n }", "function RNode(){}", "function RNode() {}", "function RNode() {}", "function RNode() {}", "function selectNode() {\n if ((graphTypes[selected] == \"material\") || (graphTypes[selected] == \"process\")) {\n updateAttributes(this);\n } else if (graphTypes[selected] == \"link\") {\n addEdge(this);\n } else if (graphTypes[selected] == \"delete\") {\n deleteNode(this.id);\n }\n}", "visit(node) {\n node.state = 1 /* IN_PROGRESS */;\n for (const edge of Object.values(node.dependencies)) {\n const target = this.nodes[edge.to];\n switch (target.state) {\n case 2 /* VISITED */: break; // Do nothing, since node was already visited\n case 1 /* IN_PROGRESS */:\n this.visitOpenNode(node, target, edge);\n break;\n case 0 /* NOT_VISITED */: this.visit(target);\n }\n }\n if (node.state !== 2 /* VISITED */) {\n node.state = 2 /* VISITED */;\n this.sortedNodeList.push(node.hash);\n }\n }", "function highlightSingleNode(node) {\n d3.select('#type' + node.type + '-group' + node.id)\n .transition()\n .style('opacity', DEFAULT_NODE_EDGE_OPACITY);\n }", "function Visitor(doc) {\n\tthis.stack = [];\n\tthis.parent = doc; //always a list item\n\tthis.node = doc.head();\n\tthis.index = 0;\n\tthis.point = 1;\n\tthis.retained = 0;\n\tthis.ops = []; //to get to the doc\n}", "function VNode() {}", "function TNode() {}", "function TNode() {}", "function TNode() {}", "function TNode(){}", "function visit(node) {\n // Only consider exported nodes\n if (!isNodeExported(node))\n return;\n if (node.kind === ts.SyntaxKind.EnumDeclaration) {\n var enNode = node;\n var symbol = checker.getSymbolAtLocation(enNode.name);\n if (!!symbol && generateDts) {\n visitEnumNode(enNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.FunctionDeclaration) {\n var fnNode = node;\n var symbol = checker.getSymbolAtLocation(fnNode.name);\n if (!!symbol && generateDts) {\n visitFunctionNode(fnNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.VariableStatement) {\n var vsNode = node;\n if (vsNode.declarationList.declarations.length > 0) {\n var varNode = vsNode.declarationList.declarations[0];\n var symbol = checker.getSymbolAtLocation(varNode.name);\n if (!!symbol && (generateDts || isSymbolHasComments(symbol))) {\n visitVariableNode(varNode, symbol);\n }\n }\n }\n else if (node.kind === ts.SyntaxKind.ClassDeclaration) {\n // This is a top level class, get its symbol\n var symbol = checker.getSymbolAtLocation(node.name);\n if (!symbol)\n return;\n if (generateDts || isSymbolHasComments(symbol)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.InterfaceDeclaration) {\n // This is a top level class, get its symbol\n var name_1 = node.name;\n var symbol = checker.getSymbolAtLocation(name_1);\n if (generateDts || isSymbolHasComments(symbol) || isOptionsInterface(name_1.text)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.ModuleDeclaration) {\n // This is a namespace, visit its children\n ts.forEachChild(node, visit);\n }\n else if (node.kind === ts.SyntaxKind.ExportDeclaration) {\n visitExportDeclarationNode(node);\n }\n }", "function markIt(node, modeljsav) {\n node.addClass(\"visited\");\n modeljsav.umsg(\"Add node \" + node.value() + \" to the MST\");\n node.highlight();\n }", "function highlightNode(nodeId) {\n var node = myDiagram.findNodeForKey(nodeId++);\n // console.log(node);\n if (node !== null) {\n // make sure the selected node is in the viewport\n myDiagram.scrollToRect(node.actualBounds);\n // move the large yellow node behind the selected node to highlight it\n highlighter.location = new go.Point(\n node.location.x + 40,\n node.location.y + 40\n );\n // console.log(node.location)\n // console.log(highlighter.location)\n }\n}", "function NodeHandler() { }", "function visit(node) {\r\n if (visited.has(node)) {\r\n return;\r\n }\r\n visited.add(node);\r\n var children = graph.get(node);\r\n if (children) {\r\n children.forEach(visit);\r\n }\r\n sorted.push(node);\r\n }", "function get_node(id)\n {\n return indexbyid[id];\n }", "function NodeDef() {}", "function NodeDef() {}", "function NodeDef() {}", "function node(v) {\n\t\t\t\tif (!v.firstChild ||\n\t\t\t\t\tv.firstChild.nodeName === \"#text\") {\n\t\t\t\t\tv = v.textContent.match(/[^\\n]+/);\n\n\t\t\t\t\treturn v != null ? v[0] : \"\";\n\t\t\t\t}\n\n\t\t\t\treturn node(v.firstChild);\n\t\t\t}", "function markIt(node, av) {\n var edge;\n step++;\n node.addedStep = step;\n node.addClass(\"visited\");\n if (av) {\n av.umsg(\"Visit node \" + node.value());\n }\n node.highlight();\n if (av) {\n av.step();\n if (node.prev) {\n av.umsg(\"Add edge (\" + node.prev.value() + \",\" + node.value() +\n \") to the DFS graph\");\n edge = node.edgeFrom(node.prev).css({\"stroke-width\": \"4\", \"stroke\": \"red\"});\n edge.added = true;\n av.step();\n }\n av.stepOption('grade', true);\n }\n }", "function traverseNodes(node) {\n if (node.value) {\n cb(node.value);\n }\n if (node.left) {\n traverseNodes(node.left);\n }\n if (node.right) {\n traverseNodes(node.right);\n }\n }", "function Node() {\r\n this.className = 'Node';\r\n this.id = null;\r\n this.serverId = null;\r\n this.name = null;\r\n this.date = null;\r\n this.duration = null;\r\n this.state = \"closed\";\r\n this.checked = false;\r\n this.traverseToken = null;\r\n // Means node has no children.\r\n this.leaf = false;\r\n // for editing node: information source\r\n this.source = null;\r\n // the flag is this node belongs to user\r\n this.belongsToUser = false;\r\n // this node is currently edited\r\n this.edited = false;\r\n // key which would be shared\r\n this.shareId = null;\r\n}", "function Node() {\n}", "function RNode() { }", "function RNode() { }", "function markIt(node, av) {\n var edge;\n step++;\n node.addedStep = step;\n node.addClass(\"visited\");\n if (av) {\n av.umsg(\"Visit node \" + node.value());\n }\n node.highlight();\n if (av) {\n av.step();\n if (node.prev) {\n av.umsg(\"Add edge (\" + node.prev.value() + \",\" + node.value() +\n \") to the DFS graph\");\n edge = node.edgeFrom(node.prev).css({\"stroke-width\": \"4\", \"stroke\": \"red\"});\n edge.added = true;\n av.step();\n }\n av.stepOption('grade', true);\n }\n }", "link() {\n //the act of walking causes the nodes to be linked\n this.walk(() => { }, {\n walkMode: visitors_1.WalkMode.visitAllRecursive\n });\n }", "function Node() {\n }", "function NodeDef(){}", "function VertexNode( point ) {\n\n\t\tthis.point = point;\n\t\tthis.prev = null;\n\t\tthis.next = null;\n\t\tthis.face = null; // the face that is able to see this vertex\n\n\t}", "getNodeValue() {}", "function visit() {\n if (this.isBlacklisted()) return false;\n if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false;\n\n this.call(\"enter\");\n\n if (this.shouldSkip) {\n return this.shouldStop;\n }\n\n var node = this.node;\n var opts = this.opts;\n\n if (node) {\n if (Array.isArray(node)) {\n // traverse over these replacement nodes we purposely don't call exitNode\n // as the original node has been destroyed\n for (var i = 0; i < node.length; i++) {\n _index2[\"default\"].node(node[i], opts, this.scope, this.state, this, this.skipKeys);\n }\n } else {\n _index2[\"default\"].node(node, opts, this.scope, this.state, this, this.skipKeys);\n this.call(\"exit\");\n }\n }\n\n return this.shouldStop;\n}", "function node(val){\n\tthis.val = val;\n\tthis.next = null;\n}", "function Node(){\n\t\tthis.setup();\n\t\tthis;\n\t}", "function VertexNode( point ) {\n\n\t\t\tthis.point = point;\n\t\t\tthis.prev = null;\n\t\t\tthis.next = null;\n\t\t\tthis.face = null; // the face that is able to see this vertex\n\n\t\t}", "function visit(node, visitor) {\n const visitor_ = initVisitor(visitor);\n if (identity.isDocument(node)) {\n const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));\n if (cd === REMOVE)\n node.contents = null;\n }\n else\n visit_(null, node, visitor_, Object.freeze([]));\n}", "function SelectNode(nodeId){\n var nodeObj = $(\"#\"+nodeId).val();\n $(\"#divTree\").jstree(\"select_node\", nodeObj, null, null); \n}", "function node(x, y, parent_index, g, h, f)\n{\n\tthis.x = x;\n\tthis.y = y;\n\tthis.parent_index = parent_index;\n\tthis.g = g;\n\tthis.h = h;\n\tthis.f = f;\n}", "function Node(data) {\n this.data = data;\n}", "function highlightGraphNode( node, on )\n {\n //if( d3.event.shiftKey ) on = false; // for debugging\n\n // If we are to activate a movie, and there's already one active,\n // first switch that one off\n if( on && activeMovie !== undefined ) {\n \t highlightGraphNode( nodeArray[activeMovie], false );\n }\n\n // locate the SVG nodes: circle & label group\n circle = d3.select( '#c' + node.index );\n label = d3.select( '#l' + node.index );\n\n // activate/deactivate the node itself\n circle\n\t.classed( 'main', on );\n label\n\t.classed( 'on', on || currentZoom >= SHOW_THRESHOLD );\n label.selectAll('text')\n\t.classed( 'main', on );\n\n // activate all siblings\n Object(node.links).forEach( function(id) {\n\td3.select(\"#c\"+id).classed( 'sibling', on );\n\tlabel = d3.select('#l'+id);\n\tlabel.classed( 'on', on || currentZoom >= SHOW_THRESHOLD );\n\tlabel.selectAll('text.nlabel')\n\t .classed( 'sibling', on );\n } );\n\n // set the value for the current active movie\n activeMovie = on ? node.index : undefined;\n }", "function Node(value) {\n\n this.value = value;\n this.edges = [];\n this.searched = false;\n this.parent = null;\n\n\n }", "function NodeVisitor() {\n _classCallCheck(this, NodeVisitor);\n\n this[path] = [];\n }", "function visit(node, visitor) {\n const visitor_ = initVisitor(visitor);\n if (isDocument(node)) {\n const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));\n if (cd === REMOVE)\n node.contents = null;\n }\n else\n visit_(null, node, visitor_, Object.freeze([]));\n }", "function visit() {\n\t if (this.isBlacklisted()) return false;\n\t if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false;\n\n\t this.call(\"enter\");\n\n\t if (this.shouldSkip) {\n\t return this.shouldStop;\n\t }\n\n\t var node = this.node;\n\t var opts = this.opts;\n\n\t if (node) {\n\t if (Array.isArray(node)) {\n\t // traverse over these replacement nodes we purposely don't call exitNode\n\t // as the original node has been destroyed\n\t for (var i = 0; i < node.length; i++) {\n\t _index2[\"default\"].node(node[i], opts, this.scope, this.state, this, this.skipKeys);\n\t }\n\t } else {\n\t _index2[\"default\"].node(node, opts, this.scope, this.state, this, this.skipKeys);\n\t this.call(\"exit\");\n\t }\n\t }\n\n\t return this.shouldStop;\n\t}", "function visit() {\n\t if (this.isBlacklisted()) return false;\n\t if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false;\n\n\t this.call(\"enter\");\n\n\t if (this.shouldSkip) {\n\t return this.shouldStop;\n\t }\n\n\t var node = this.node;\n\t var opts = this.opts;\n\n\t if (node) {\n\t if (Array.isArray(node)) {\n\t // traverse over these replacement nodes we purposely don't call exitNode\n\t // as the original node has been destroyed\n\t for (var i = 0; i < node.length; i++) {\n\t _index2[\"default\"].node(node[i], opts, this.scope, this.state, this, this.skipKeys);\n\t }\n\t } else {\n\t _index2[\"default\"].node(node, opts, this.scope, this.state, this, this.skipKeys);\n\t this.call(\"exit\");\n\t }\n\t }\n\n\t return this.shouldStop;\n\t}", "function Node(value){\n this.value =value;\n this.next = null;\n this.id = null;\n}", "function selectSingleNode(xPath,params){\r\n\t\tparams=params||{}; params['type']=9;\r\n\t\treturn selectNodes(xPath,params).singleNodeValue;\r\n\t}", "function selectSingleNode(xPath,params){\r\n\t\tparams=params||{}; params['type']=9;\r\n\t\treturn selectNodes(xPath,params).singleNodeValue;\r\n\t}", "function selectSingleNode(xPath,params){\r\n\t\tparams=params||{}; params['type']=9;\r\n\t\treturn selectNodes(xPath,params).singleNodeValue;\r\n\t}", "function NodeDef() { }", "function NodeDef() { }", "function Node (value) {\n this.value = value;\n this.next = null;\n}", "function handleMouseClickNode(d) {\n var data = data_display.getNearLinksAndNodes(d, links);\n data_display.highlightElements(data, d, svg);\n data_display.getInfoForSelectedNode($element, d);\n exposeSiblingNodes(data.nodes);\n }", "function printOne(v) {\n if (visited[v] == 0) {\n\n dfs(v);\n }\n }", "getNode() {\n throw new Error(\"Must be implemented\");\n }", "function Node(value) {\n this.value = value;\n this.next = null;\n}", "function depthFirst(node, visited = new Set()) {\n if (visited.has(node.val)) return; //base case\n visited.add(node.val);\n console.log(node.val);\n node.neighbors.forEach((neighbor) => depthFirst(neighbor, visted));\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}", "function doVisitFull(visit, node) {\n if(node.left) {\n var v = doVisitFull(visit, node.left)\n if(v) { return v }\n }\n var v = visit(node.key, node.value)\n if(v) { return v }\n if(node.right) {\n return doVisitFull(visit, node.right)\n }\n}" ]
[ "0.7660978", "0.64456815", "0.6444978", "0.6280553", "0.6108867", "0.60755324", "0.60506946", "0.60506946", "0.60448086", "0.59708697", "0.59514207", "0.5924221", "0.59024817", "0.59024817", "0.59024817", "0.59024817", "0.56386995", "0.5636397", "0.5624829", "0.5620238", "0.5609939", "0.56052655", "0.5601799", "0.5601799", "0.5579237", "0.54747874", "0.54192936", "0.53958875", "0.538487", "0.53554887", "0.5321697", "0.5321697", "0.5321697", "0.52729166", "0.5266448", "0.5263826", "0.52436215", "0.5202084", "0.51918083", "0.51918083", "0.51918083", "0.5167329", "0.5164406", "0.51320624", "0.51310074", "0.51283836", "0.5115769", "0.5077438", "0.5065739", "0.5065739", "0.5065739", "0.5058315", "0.5055018", "0.5046881", "0.50458896", "0.5040416", "0.50381565", "0.50381565", "0.5033152", "0.5023444", "0.5016373", "0.5014408", "0.5013703", "0.5009375", "0.49915746", "0.497626", "0.49589893", "0.4955111", "0.495246", "0.49171278", "0.4915561", "0.49151736", "0.49151498", "0.49146846", "0.49129757", "0.49116093", "0.49058506", "0.49058506", "0.49031526", "0.48951626", "0.48951626", "0.48951626", "0.4890204", "0.4890204", "0.4872656", "0.48640004", "0.485656", "0.4854197", "0.4849764", "0.48483548", "0.48372233", "0.48372233", "0.48372233", "0.48372233", "0.48372233" ]
0.5810606
20
Visit children in `parent`.
function all(children, parent) { var length = children.length var index = -1 var child stack.push(parent) while (++index < length) { child = children[index] if (child && one(child) === false) { return false } } stack.pop() return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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}", "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}", "allWithChildren(parent) {\n\t\treturn this.all(parent, true);\n\t}", "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 }", "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}", "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 }", "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}", "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}", "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}", "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}", "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}", "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}", "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 }", "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}", "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}", "forEach(callback) {\n callback(this);\n for (const child of this.children) {\n child.forEach(callback);\n }\n }", "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 }", "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 }", "function processNode(node){\n processChild(node);\n for( i in node.children )\n processNode(node.children[i]);\n }", "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}", "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}", "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 }", "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}", "children() {\n return new ChildrenIterator(this, this.keys);\n }", "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}", "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}", "*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 }", "*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 }", "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}", "initChildren() {\n this.nodes.forEach(node => {\n node.parent = this\n })\n }", "childrenIteration(_processFunc) {\n return this.children.map(_processFunc);\n }", "children() {\n return new types_List(map(this.node.children, function (node) {\n return adopt(node);\n }));\n }", "function appendChildren(parent, ...children) {\r\n children.forEach(child => parent.appendChild(child));\r\n}", "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", "function treeForEachChild(tree, action) {\n each(tree.node.children, function (child, childTree) {\n action(new Tree(child, tree, childTree));\n });\n}", "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}", "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}", "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}", "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}", "getAllChildren() {\n const children = this.jq.wrapper.find(this.jq.child)\n return children\n }", "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 }", "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}", "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}", "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}", "function deleteAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "function appendChildren(parent, children) {\n children.forEach(function(child) {\n parent.appendChild(child);\n })\n}", "traverse() {\n this.root.visit(this.root);\n }", "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}", "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}", "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}", "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 }", "function addSiblings(parent) {\n while (parent != null) {\n parent.siblings++;\n parent = parent.parent;\n }\n}", "function markAsDynamicChildren(children) {\n FromIteration.set(children, 1);\n }", "function markAsDynamicChildren(children) {\n FromIteration.set(children, 1);\n }", "function appendChildren(parent, children) {\n for (let ele of children) {\n parent.appendChild(ele);\n }\n return parent;\n}", "function appendChildren(parent, children) {\n for (let ele of children) {\n parent.appendChild(ele);\n }\n return parent;\n}", "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}", "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 }", "function getChildren(el) {\n\n }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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}", "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}", "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}", "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 }", "addChildren(value) {}", "get children() {\n return this._children;\n }", "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}", "get childNodes () {\n return childNodes(this._data).map(data => createNode(data));\n }", "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 }", "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 }", "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 }", "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}", "async readChildren () {\n return this._children\n }", "async readChildren () {\n return this._children\n }", "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 }", "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}", "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 }", "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 }", "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 }", "forEach(visitor) {\n this.tree_walk(this.root, (node) => visitor(node.item.key, node.item.value));\n }", "*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 }", "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}" ]
[ "0.79614055", "0.79312193", "0.7884905", "0.78685194", "0.78685194", "0.78685194", "0.77841", "0.72736555", "0.676731", "0.6584016", "0.6529354", "0.62057847", "0.6133546", "0.6133546", "0.6120903", "0.6087371", "0.6087371", "0.6032075", "0.60211647", "0.60132015", "0.60132015", "0.600705", "0.5885762", "0.5865207", "0.58483535", "0.5738852", "0.57376444", "0.57112795", "0.56983024", "0.56863636", "0.56406665", "0.5611981", "0.5611182", "0.5611182", "0.56068873", "0.5600739", "0.55962986", "0.553433", "0.5523341", "0.55146444", "0.5509102", "0.5499688", "0.5495388", "0.54919827", "0.54900104", "0.5466297", "0.5464709", "0.5459188", "0.54565513", "0.5438189", "0.5434946", "0.5434379", "0.5433057", "0.54300094", "0.54273534", "0.54273534", "0.54221565", "0.5420298", "0.54166913", "0.54166913", "0.54128283", "0.54128283", "0.54113793", "0.5407789", "0.54032737", "0.53938687", "0.53865093", "0.53865093", "0.53720856", "0.53720856", "0.53718835", "0.53715557", "0.5361395", "0.53507376", "0.53507376", "0.5348885", "0.5345127", "0.5332694", "0.5323068", "0.53214544", "0.5305404", "0.53046066", "0.53046066", "0.53046066", "0.53016806", "0.528991", "0.528991", "0.5288243", "0.5287705", "0.5279676", "0.5271194", "0.5257083", "0.52535516", "0.5247469", "0.5244017" ]
0.57666314
29
Core highlighting function. Accepts a language name, or an alias, and a string with the code to highlight. Returns an object with the following properties: relevance (int) value (an HTML string with highlighting markup)
function highlight(name, value, ignore_illegals, continuation) { function escapeRe(value) { return new RegExp(value.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'm'); } function subMode(lexeme, mode) { var i, length; for (i = 0, length = mode.contains.length; i < length; i++) { if (testRe(mode.contains[i].beginRe, lexeme)) { if (mode.contains[i].endSameAsBegin) { mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] ); } return mode.contains[i]; } } } function endOfMode(mode, lexeme) { if (testRe(mode.endRe, lexeme)) { while (mode.endsParent && mode.parent) { mode = mode.parent; } return mode; } if (mode.endsWithParent) { return endOfMode(mode.parent, lexeme); } } function isIllegal(lexeme, mode) { return !ignore_illegals && testRe(mode.illegalRe, lexeme); } function keywordMatch(mode, match) { var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0]; return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str]; } function buildSpan(classname, insideSpan, leaveOpen, noPrefix) { var classPrefix = noPrefix ? '' : options.classPrefix, openSpan = '<span class="' + classPrefix, closeSpan = leaveOpen ? '' : spanEndTag openSpan += classname + '">'; return openSpan + insideSpan + closeSpan; } function processKeywords() { var keyword_match, last_index, match, result; if (!top.keywords) return escape(mode_buffer); result = ''; last_index = 0; top.lexemesRe.lastIndex = 0; match = top.lexemesRe.exec(mode_buffer); while (match) { result += escape(mode_buffer.substring(last_index, match.index)); keyword_match = keywordMatch(top, match); if (keyword_match) { relevance += keyword_match[1]; result += buildSpan(keyword_match[0], escape(match[0])); } else { result += escape(match[0]); } last_index = top.lexemesRe.lastIndex; match = top.lexemesRe.exec(mode_buffer); } return result + escape(mode_buffer.substr(last_index)); } function processSubLanguage() { var explicit = typeof top.subLanguage === 'string'; if (explicit && !languages[top.subLanguage]) { return escape(mode_buffer); } var result = explicit ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined); // Counting embedded language score towards the host language may be disabled // with zeroing the containing mode relevance. Usecase in point is Markdown that // allows XML everywhere and makes every XML snippet to have a much larger Markdown // score. if (top.relevance > 0) { relevance += result.relevance; } if (explicit) { continuations[top.subLanguage] = result.top; } return buildSpan(result.language, result.value, false, true); } function processBuffer() { result += (top.subLanguage != null ? processSubLanguage() : processKeywords()); mode_buffer = ''; } function startNewMode(mode) { result += mode.className? buildSpan(mode.className, '', true): ''; top = Object.create(mode, {parent: {value: top}}); } function processLexeme(buffer, lexeme) { mode_buffer += buffer; if (lexeme == null) { processBuffer(); return 0; } var new_mode = subMode(lexeme, top); if (new_mode) { if (new_mode.skip) { mode_buffer += lexeme; } else { if (new_mode.excludeBegin) { mode_buffer += lexeme; } processBuffer(); if (!new_mode.returnBegin && !new_mode.excludeBegin) { mode_buffer = lexeme; } } startNewMode(new_mode, lexeme); return new_mode.returnBegin ? 0 : lexeme.length; } var end_mode = endOfMode(top, lexeme); if (end_mode) { var origin = top; if (origin.skip) { mode_buffer += lexeme; } else { if (!(origin.returnEnd || origin.excludeEnd)) { mode_buffer += lexeme; } processBuffer(); if (origin.excludeEnd) { mode_buffer = lexeme; } } do { if (top.className) { result += spanEndTag; } if (!top.skip && !top.subLanguage) { relevance += top.relevance; } top = top.parent; } while (top !== end_mode.parent); if (end_mode.starts) { if (end_mode.endSameAsBegin) { end_mode.starts.endRe = end_mode.endRe; } startNewMode(end_mode.starts, ''); } return origin.returnEnd ? 0 : lexeme.length; } if (isIllegal(lexeme, top)) throw new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '<unnamed>') + '"'); /* Parser should not reach this point as all types of lexemes should be caught earlier, but if it does due to some bug make sure it advances at least one character forward to prevent infinite looping. */ mode_buffer += lexeme; return lexeme.length || 1; } var language = getLanguage(name); if (!language) { throw new Error('Unknown language: "' + name + '"'); } compileLanguage(language); var top = continuation || language; var continuations = {}; // keep continuations for sub-languages var result = '', current; for(current = top; current !== language; current = current.parent) { if (current.className) { result = buildSpan(current.className, '', true) + result; } } var mode_buffer = ''; var relevance = 0; try { var match, count, index = 0; while (true) { top.terminators.lastIndex = index; match = top.terminators.exec(value); if (!match) break; count = processLexeme(value.substring(index, match.index), match[0]); index = match.index + count; } processLexeme(value.substr(index)); for(current = top; current.parent; current = current.parent) { // close dangling modes if (current.className) { result += spanEndTag; } } return { relevance: relevance, value: result, language: name, top: top }; } catch (e) { if (e.message && e.message.indexOf('Illegal') !== -1) { return { relevance: 0, value: escape(value) }; } else { throw e; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _highlight(languageName, code, ignore_illegals, continuation) {\n var codeToHighlight = code;\n\n function endOfMode(mode, lexeme) {\n if (startsWith(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, buf;\n\n if (!top.keywords) {\n emitter.addText(mode_buffer);\n return;\n }\n\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n buf = \"\";\n\n while (match) {\n buf += mode_buffer.substring(last_index, match.index);\n keyword_match = keywordMatch(top, match);\n var kind = null;\n if (keyword_match) {\n emitter.addText(buf);\n buf = \"\";\n\n relevance += keyword_match[1];\n kind = keyword_match[0];\n emitter.addKeyword(match[0], kind);\n } else {\n buf += match[0];\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n buf += mode_buffer.substr(last_index);\n emitter.addText(buf);\n }\n\n function processSubLanguage() {\n if (mode_buffer === \"\") return;\n\n var explicit = typeof top.subLanguage === 'string';\n\n if (explicit && !languages[top.subLanguage]) {\n emitter.addText(mode_buffer);\n return;\n }\n\n var result = explicit ?\n _highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Use case in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n emitter.addSublanguage(result.emitter, result.language);\n }\n\n function processBuffer() {\n if (top.subLanguage != null)\n processSubLanguage();\n else\n processKeywords();\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n if (mode.className) {\n emitter.openNode(mode.className);\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function doIgnore(lexeme) {\n if (top.matcher.regexIndex === 0) {\n // no more regexs to potentially match here, so we move the cursor forward one\n // space\n mode_buffer += lexeme[0];\n return 1;\n } else {\n // no need to move the cursor, we still have additional regexes to try and\n // match at this very spot\n continueScanAtSamePosition = true;\n return 0;\n }\n }\n\n function doBeginMatch(match) {\n var lexeme = match[0];\n var new_mode = match.rule;\n\n if (new_mode.__onBegin) {\n let res = new_mode.__onBegin(match) || {};\n if (res.ignoreMatch)\n return doIgnore(lexeme);\n }\n\n if (new_mode && new_mode.endSameAsBegin) {\n new_mode.endRe = escape( lexeme );\n }\n\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n function doEndMatch(match) {\n var lexeme = match[0];\n var matchPlusRemainder = codeToHighlight.substr(match.index);\n var end_mode = endOfMode(top, matchPlusRemainder);\n if (!end_mode) { return; }\n\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n emitter.closeNode();\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts);\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n function processContinuations() {\n var list = [];\n for(var current = top; current !== language; current = current.parent) {\n if (current.className) {\n list.unshift(current.className);\n }\n }\n list.forEach(item => emitter.openNode(item));\n }\n\n var lastMatch = {};\n function processLexeme(text_before_match, match) {\n\n var err;\n var lexeme = match && match[0];\n\n // add non-matched text to the current mode buffer\n mode_buffer += text_before_match;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n\n\n // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n if (lastMatch.type==\"begin\" && match.type==\"end\" && lastMatch.index == match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n mode_buffer += codeToHighlight.slice(match.index, match.index + 1);\n if (!SAFE_MODE) {\n err = new Error('0 width match regex');\n err.languageName = languageName;\n err.badRule = lastMatch.rule;\n throw(err);\n }\n return 1;\n }\n lastMatch = match;\n\n if (match.type===\"begin\") {\n return doBeginMatch(match);\n } else if (match.type===\"illegal\" && !ignore_illegals) {\n // illegal match, we do not continue processing\n err = new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n err.mode = top;\n throw err;\n } else if (match.type===\"end\") {\n var processed = doEndMatch(match);\n if (processed != undefined)\n return processed;\n }\n\n // edge case for when illegal matches $ (end of line) which is technically\n // a 0 width match but not a begin/end match so it's not caught by the\n // first handler (when ignoreIllegals is true)\n if (match.type === \"illegal\" && lexeme === \"\") {\n // advance so we aren't stuck in an infinite loop\n return 1;\n }\n\n // infinite loops are BAD, this is a last ditch catch all. if we have a\n // decent number of iterations yet our index (cursor position in our\n // parsing) still 3x behind our index then something is very wrong\n // so we bail\n if (iterations > 100000 && iterations > match.index * 3) {\n const err = new Error('potential infinite loop, way more iterations than matches');\n throw err;\n }\n\n /*\n Why might be find ourselves here? Only one occasion now. An end match that was\n triggered but could not be completed. When might this happen? When an `endSameasBegin`\n rule sets the end rule to a specific match. Since the overall mode termination rule that's\n being used to scan the text isn't recompiled that means that any match that LOOKS like\n the end (but is not, because it is not an exact match to the beginning) will\n end up here. A definite end match, but when `doEndMatch` tries to \"reapply\"\n the end rule and fails to match, we wind up here, and just silently ignore the end.\n\n This causes no real harm other than stopping a few times too many.\n */\n\n mode_buffer += lexeme;\n return lexeme.length;\n }\n\n var language = getLanguage(languageName);\n if (!language) {\n console.error(LANGUAGE_NOT_FOUND.replace(\"{}\", languageName));\n throw new Error('Unknown language: \"' + languageName + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result;\n var emitter = new options.__emitter(options);\n processContinuations();\n var mode_buffer = '';\n var relevance = 0;\n var match;\n var processedCount;\n var index = 0;\n var iterations = 0;\n var continueScanAtSamePosition = false;\n\n try {\n top.matcher.considerAll();\n\n for (;;) {\n iterations++;\n if (continueScanAtSamePosition) {\n continueScanAtSamePosition = false;\n // only regexes not matched previously will now be\n // considered for a potential match\n } else {\n top.matcher.lastIndex = index;\n top.matcher.considerAll();\n }\n match = top.matcher.exec(codeToHighlight);\n // console.log(\"match\", match[0], match.rule && match.rule.begin)\n if (!match)\n break;\n let beforeMatch = codeToHighlight.substring(index, match.index);\n processedCount = processLexeme(beforeMatch, match);\n index = match.index + processedCount;\n }\n processLexeme(codeToHighlight.substr(index));\n emitter.closeAllNodes();\n emitter.finalize();\n result = emitter.toHTML();\n\n return {\n relevance: relevance,\n value: result,\n language: languageName,\n illegal: false,\n emitter: emitter,\n top: top\n };\n } catch (err) {\n if (err.message && err.message.includes('Illegal')) {\n return {\n illegal: true,\n illegalBy: {\n msg: err.message,\n context: codeToHighlight.slice(index-100,index+100),\n mode: err.mode\n },\n sofar: result,\n relevance: 0,\n value: escape$1(codeToHighlight),\n emitter: emitter,\n };\n } else if (SAFE_MODE) {\n return {\n relevance: 0,\n value: escape$1(codeToHighlight),\n emitter: emitter,\n language: languageName,\n top: top,\n errorRaised: err\n };\n } else {\n throw err;\n }\n }\n }", "function highlight(language_name, value) {\n\n function subMode(lexem, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n var match = mode.contains[i].beginRe.exec(lexem);\n if (match && match.index == 0) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode_index, lexem) {\n if (modes[mode_index].end && modes[mode_index].endRe.test(lexem))\n return 1;\n if (modes[mode_index].endsWithParent) {\n var level = endOfMode(mode_index - 1, lexem);\n return level ? level + 1 : 0;\n }\n return 0;\n }\n\n function isIllegal(lexem, mode) {\n return mode.illegal && mode.illegalRe.test(lexem);\n }\n\n function eatModeChunk(value, index) {\n var mode = modes[modes.length - 1];\n if (mode.terminators) {\n mode.terminators.lastIndex = index;\n return mode.terminators.exec(value);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n var value = mode.keywords[match_str];\n if (value && value instanceof Array)\n return value;\n return false;\n }\n\n function processKeywords(buffer, mode) {\n buffer = escape(buffer);\n if (!mode.keywords)\n return buffer;\n var result = '';\n var last_index = 0;\n mode.lexemsRe.lastIndex = 0;\n var match = mode.lexemsRe.exec(buffer);\n while (match) {\n result += buffer.substr(last_index, match.index - last_index);\n var keyword_match = keywordMatch(mode, match);\n if (keyword_match) {\n keyword_count += keyword_match[1];\n result += '<span class=\"'+ keyword_match[0] +'\">' + match[0] + '</span>';\n } else {\n result += match[0];\n }\n last_index = mode.lexemsRe.lastIndex;\n match = mode.lexemsRe.exec(buffer);\n }\n return result + buffer.substr(last_index);\n }\n\n function processSubLanguage(buffer, mode) {\n var result;\n if (mode.subLanguage == '') {\n result = highlightAuto(buffer);\n } else {\n result = highlight(mode.subLanguage, buffer);\n }\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (mode.relevance > 0) {\n keyword_count += result.keyword_count;\n relevance += result.relevance;\n }\n return '<span class=\"' + result.language + '\">' + result.value + '</span>';\n }\n\n function processBuffer(buffer, mode) {\n if (mode.subLanguage && languages[mode.subLanguage] || mode.subLanguage == '') {\n return processSubLanguage(buffer, mode);\n } else {\n return processKeywords(buffer, mode);\n }\n }\n\n function startNewMode(mode, lexem) {\n var markup = mode.className? '<span class=\"' + mode.className + '\">': '';\n if (mode.returnBegin) {\n result += markup;\n mode.buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexem) + markup;\n mode.buffer = '';\n } else {\n result += markup;\n mode.buffer = lexem;\n }\n modes.push(mode);\n relevance += mode.relevance;\n }\n\n function processModeInfo(buffer, lexem) {\n var current_mode = modes[modes.length - 1];\n if (lexem === undefined) {\n result += processBuffer(current_mode.buffer + buffer, current_mode);\n return;\n }\n\n var new_mode = subMode(lexem, current_mode);\n if (new_mode) {\n result += processBuffer(current_mode.buffer + buffer, current_mode);\n startNewMode(new_mode, lexem);\n return new_mode.returnBegin;\n }\n\n var end_level = endOfMode(modes.length - 1, lexem);\n if (end_level) {\n var markup = current_mode.className?'</span>':'';\n if (current_mode.returnEnd) {\n result += processBuffer(current_mode.buffer + buffer, current_mode) + markup;\n } else if (current_mode.excludeEnd) {\n result += processBuffer(current_mode.buffer + buffer, current_mode) + markup + escape(lexem);\n } else {\n result += processBuffer(current_mode.buffer + buffer + lexem, current_mode) + markup;\n }\n while (end_level > 1) {\n markup = modes[modes.length - 2].className?'</span>':'';\n result += markup;\n end_level--;\n modes.length--;\n }\n var last_ended_mode = modes[modes.length - 1];\n modes.length--;\n modes[modes.length - 1].buffer = '';\n if (last_ended_mode.starts) {\n startNewMode(last_ended_mode.starts, '');\n }\n return current_mode.returnEnd;\n }\n\n if (isIllegal(lexem, current_mode))\n throw 'Illegal';\n }\n\n var language = languages[language_name];\n compileLanguage(language);\n var modes = [language];\n language.buffer = '';\n var relevance = 0;\n var keyword_count = 0;\n var result = '';\n try {\n var match, index = 0;\n while (true) {\n match = eatModeChunk(value, index);\n if (!match)\n break;\n var return_lexem = processModeInfo(value.substr(index, match.index - index), match[0]);\n index = match.index + (return_lexem ? 0 : match[0].length);\n }\n processModeInfo(value.substr(index), undefined);\n return {\n relevance: relevance,\n keyword_count: keyword_count,\n value: result,\n language: language_name\n };\n } catch (e) {\n if (e == 'Illegal') {\n return {\n relevance: 0,\n keyword_count: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function coreHighlight(name, value, ignore, prefix, continuation) {\n var lastMatch = {}\n var continuations = {}\n var stack = []\n var modeBuffer = ''\n var relevance = 0\n var language\n var top\n var current\n var currentChildren\n var offset\n var count\n var match\n var children\n\n if (typeof name !== 'string') {\n throw fault('Expected `string` for name, got `%s`', name)\n }\n\n if (typeof value !== 'string') {\n throw fault('Expected `string` for value, got `%s`', value)\n }\n\n language = getLanguage(name)\n top = continuation || language\n children = []\n\n current = top\n currentChildren = children\n\n if (!language) {\n throw fault('Unknown language: `%s` is not registered', name)\n }\n\n compileLanguage(language)\n\n try {\n top.terminators.lastIndex = 0\n offset = 0\n match = top.terminators.exec(value)\n\n while (match) {\n count = processLexeme(value.slice(offset, match.index), match)\n offset = match.index + count\n top.terminators.lastIndex = offset\n match = top.terminators.exec(value)\n }\n\n processLexeme(value.slice(offset))\n current = top\n\n while (current.parent) {\n if (current.className) {\n pop()\n }\n\n current = current.parent\n }\n\n return {\n relevance: relevance,\n value: currentChildren,\n illegal: false,\n language: name,\n top: top\n }\n } catch (error) {\n /* istanbul ignore if - Catch-all */\n if (error.message.indexOf('Illegal') === -1) {\n throw error\n }\n\n return {relevance: 0, illegal: true, value: addText(value, [])}\n }\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm')\n }\n\n function doBeginMatch(match) {\n var lexeme = match[0]\n var newMode = match.rule\n\n if (newMode && newMode.endSameAsBegin) {\n newMode.endRe = escapeRe(lexeme)\n }\n\n if (newMode.skip) {\n modeBuffer += lexeme\n } else {\n if (newMode.excludeBegin) {\n modeBuffer += lexeme\n }\n\n addSiblings(processBuffer(), currentChildren)\n\n if (!newMode.returnBegin && !newMode.excludeBegin) {\n modeBuffer = lexeme\n }\n }\n\n startNewMode(newMode)\n\n return newMode.returnBegin ? 0 : lexeme.length\n }\n\n function doEndMatch(match) {\n var lexeme = match[0]\n var matchPlusRemainder = value.slice(match.index)\n var endMode = endOfMode(top, matchPlusRemainder)\n\n if (!endMode) {\n return\n }\n\n var origin = top\n\n if (origin.skip) {\n modeBuffer += lexeme\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n modeBuffer += lexeme\n }\n\n addSiblings(processBuffer(), currentChildren)\n\n if (origin.excludeEnd) {\n modeBuffer = lexeme\n }\n }\n\n do {\n if (top.className) {\n pop()\n }\n\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance\n }\n\n top = top.parent\n } while (top !== endMode.parent)\n\n if (endMode.starts) {\n /* istanbul ignore if - hljs 9.16 added support for this but didn’t use it yet. */\n if (endMode.endSameAsBegin) {\n endMode.starts.endRe = endMode.endRe\n }\n\n startNewMode(endMode.starts)\n }\n\n return origin.returnEnd ? 0 : lexeme.length\n }\n\n function processLexeme(textBeforeMatch, match) {\n var lexeme = match && match[0]\n var processed\n\n // Add non-matched text to the current mode buffer\n modeBuffer += textBeforeMatch\n\n if (lexeme === undefined) {\n addSiblings(processBuffer(), currentChildren)\n return 0\n }\n\n // We've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n /* istanbul ignore if - Unknown what this fixes or which case fixes it */\n if (\n lastMatch.type === 'begin' &&\n match.type === 'end' &&\n lastMatch.index === match.index &&\n lexeme === ''\n ) {\n // Spit the “skipped” character that our regex choked on back into the output sequence\n modeBuffer += value.slice(match.index, match.index + 1)\n return 1\n }\n\n lastMatch = match\n\n if (match.type === 'begin') {\n return doBeginMatch(match)\n }\n\n if (match.type === 'end') {\n processed = doEndMatch(match)\n\n if (processed !== undefined) {\n return processed\n }\n }\n\n if (match.type === 'illegal' && !ignore) {\n // Illegal match, we do not continue processing\n throw fault(\n 'Illegal lexeme \"%s\" for mode \"%s\"',\n lexeme,\n top.className || '<unnamed>'\n )\n }\n\n // Why might be find ourselves here?\n // Only one occasion now.\n // An end match that was triggered but could not be completed.\n // When might this happen?\n // When an `endSameasBegin` rule sets the end rule to a specific match.\n // Since the overall mode termination rule that’s being used to scan the\n // text isn’t recompiled that means that any match that LOOKS like the end\n // (but is not, because it is not an exact match to the beginning) will end\n // up here.\n // A definite end match, but when `doEndMatch` tries to “reapply” the end\n // rule and fails to match, we wind up here, and just silently ignore the\n // end.\n // This causes no real harm other than stopping a few times too many.\n modeBuffer += lexeme\n\n return lexeme.length\n }\n\n // Start a new mode with a `lexeme` to process.\n function startNewMode(mode) {\n var node\n\n if (mode.className) {\n node = build(mode.className, [])\n }\n\n // Enter a new mode.\n if (node) {\n currentChildren.push(node)\n stack.push(currentChildren)\n currentChildren = node.children\n }\n\n top = Object.create(mode, {parent: {value: top}})\n }\n\n // Process the buffer.\n function processBuffer() {\n var result = top.subLanguage ? processSubLanguage() : processKeywords()\n modeBuffer = ''\n return result\n }\n\n // Process a sublanguage (returns a list of nodes).\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string'\n var subvalue\n\n /* istanbul ignore if - support non-loaded sublanguages */\n if (explicit && !languages[top.subLanguage]) {\n return addText(modeBuffer, [])\n }\n\n if (explicit) {\n subvalue = coreHighlight(\n top.subLanguage,\n modeBuffer,\n true,\n prefix,\n continuations[top.subLanguage]\n )\n } else {\n subvalue = autoHighlight(modeBuffer, {\n subset: top.subLanguage.length === 0 ? undefined : top.subLanguage,\n prefix: prefix\n })\n }\n\n // If we couldn’t highlight, for example because the requests subset isn’t\n // loaded, return a text node.\n if (!subvalue.language) {\n return [buildText(modeBuffer)]\n }\n\n // Counting embedded language score towards the host language may be\n // disabled with zeroing the containing mode relevance.\n // Usecase in point is Markdown that allows XML everywhere and makes every\n // XML snippet to have a much larger Markdown score.\n if (top.relevance > 0) {\n relevance += subvalue.relevance\n }\n\n if (explicit) {\n continuations[top.subLanguage] = subvalue.top\n }\n\n return [build(subvalue.language, subvalue.value, true)]\n }\n\n // Process keywords. Returns nodes.\n function processKeywords() {\n var nodes = []\n var lastIndex\n var keyword\n var node\n var submatch\n\n if (!top.keywords) {\n return addText(modeBuffer, nodes)\n }\n\n lastIndex = 0\n\n top.lexemesRe.lastIndex = 0\n\n keyword = top.lexemesRe.exec(modeBuffer)\n\n while (keyword) {\n addText(modeBuffer.slice(lastIndex, keyword.index), nodes)\n\n submatch = keywordMatch(top, keyword)\n\n if (submatch) {\n relevance += submatch[1]\n\n node = build(submatch[0], [])\n\n nodes.push(node)\n\n addText(keyword[0], node.children)\n } else {\n addText(keyword[0], nodes)\n }\n\n lastIndex = top.lexemesRe.lastIndex\n keyword = top.lexemesRe.exec(modeBuffer)\n }\n\n addText(modeBuffer.slice(lastIndex), nodes)\n\n return nodes\n }\n\n // Add siblings.\n function addSiblings(siblings, nodes) {\n var length = siblings.length\n var index = -1\n var sibling\n\n while (++index < length) {\n sibling = siblings[index]\n\n if (sibling.type === 'text') {\n addText(sibling.value, nodes)\n } else {\n nodes.push(sibling)\n }\n }\n }\n\n // Add a text.\n function addText(value, nodes) {\n var tail\n\n if (value) {\n tail = nodes[nodes.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += value\n } else {\n nodes.push(buildText(value))\n }\n }\n\n return nodes\n }\n\n // Build a text.\n function buildText(value) {\n return {type: 'text', value: value}\n }\n\n // Build a span.\n function build(name, contents, noPrefix) {\n return {\n type: 'element',\n tagName: 'span',\n properties: {\n className: [(noPrefix ? '' : prefix) + name]\n },\n children: contents\n }\n }\n\n // Check if the first word in `keywords` is a keyword.\n function keywordMatch(mode, keywords) {\n var keyword = keywords[0]\n\n if (language[keyInsensitive]) {\n keyword = keyword.toLowerCase()\n }\n\n return own.call(mode.keywords, keyword) && mode.keywords[keyword]\n }\n\n // Check if `lexeme` ends `mode`.\n function endOfMode(mode, lexeme) {\n if (test(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent\n }\n\n return mode\n }\n\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme)\n }\n }\n\n // Exit the current context.\n function pop() {\n /* istanbul ignore next - removed in hljs 9.3 */\n currentChildren = stack.pop() || children\n }\n}", "function highlight(name, value, options) {\n var before = high.configure({})\n var settings = options || {}\n var prefix = settings.prefix\n var result\n\n if (typeof name !== 'string') {\n throw fault('Expected `string` for name, got `%s`', name)\n }\n\n if (!high.getLanguage(name)) {\n throw fault('Unknown language: `%s` is not registered', name)\n }\n\n if (typeof value !== 'string') {\n throw fault('Expected `string` for value, got `%s`', value)\n }\n\n if (prefix === null || prefix === undefined) {\n prefix = defaultPrefix\n }\n\n high.configure({__emitter: Emitter, classPrefix: prefix})\n\n result = high.highlight(name, value, true)\n\n high.configure(before || {})\n\n /* istanbul ignore if - Highlight.js seems to use this (currently) for broken\n * grammars, so let’s keep it in there just to be sure. */\n if (result.errorRaised) {\n throw result.errorRaised\n }\n\n return {\n relevance: result.relevance,\n language: result.language,\n value: result.emitter.rootNode.children\n }\n}", "function highlight(name, value, ignore_illegals, continuation) {\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n\n return mode;\n }\n\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(className, insideSpan, leaveOpen, noPrefix) {\n if (!leaveOpen && insideSpan === '') return '';\n if (!className) return insideSpan;\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n openSpan += className + '\">';\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n if (!top.keywords) return escape(mode_buffer);\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined); // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Use case in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += top.subLanguage != null ? processSubLanguage() : processKeywords();\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className ? buildSpan(mode.className, '', true) : '';\n top = Object.create(mode, {\n parent: {\n value: top\n }\n });\n }\n\n function doBeginMatch(match) {\n var lexeme = match[0];\n var new_mode = match.rule;\n\n if (new_mode && new_mode.endSameAsBegin) {\n new_mode.endRe = escapeRe(lexeme);\n }\n\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n\n processBuffer();\n\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n\n startNewMode(new_mode);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n function doEndMatch(match) {\n var lexeme = match[0];\n var matchPlusRemainder = value.substr(match.index);\n var end_mode = endOfMode(top, matchPlusRemainder);\n\n if (!end_mode) {\n return;\n }\n\n var origin = top;\n\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n\n processBuffer();\n\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n\n do {\n if (top.className) {\n result += spanEndTag;\n }\n\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n\n top = top.parent;\n } while (top !== end_mode.parent);\n\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n\n startNewMode(end_mode.starts);\n }\n\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n var lastMatch = {};\n\n function processLexeme(text_before_match, match) {\n var lexeme = match && match[0]; // add non-matched text to the current mode buffer\n\n mode_buffer += text_before_match;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n } // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n\n\n if (lastMatch.type == \"begin\" && match.type == \"end\" && lastMatch.index == match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n mode_buffer += value.slice(match.index, match.index + 1);\n return 1;\n }\n\n lastMatch = match;\n\n if (match.type === \"begin\") {\n return doBeginMatch(match);\n } else if (match.type === \"illegal\" && !ignore_illegals) {\n // illegal match, we do not continue processing\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n } else if (match.type === \"end\") {\n var processed = doEndMatch(match);\n if (processed != undefined) return processed;\n }\n /*\n Why might be find ourselves here? Only one occasion now. An end match that was\n triggered but could not be completed. When might this happen? When an `endSameasBegin`\n rule sets the end rule to a specific match. Since the overall mode termination rule that's\n being used to scan the text isn't recompiled that means that any match that LOOKS like\n the end (but is not, because it is not an exact match to the beginning) will\n end up here. A definite end match, but when `doEndMatch` tries to \"reapply\"\n the end rule and fails to match, we wind up here, and just silently ignore the end.\n This causes no real harm other than stopping a few times too many.\n */\n\n\n mode_buffer += lexeme;\n return lexeme.length;\n }\n\n var language = getLanguage(name);\n\n if (!language) {\n console.error(LANGUAGE_NOT_FOUND.replace(\"{}\", name));\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n\n var result = '',\n current;\n\n for (current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n\n var mode_buffer = '';\n var relevance = 0;\n\n try {\n var match,\n count,\n index = 0;\n\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match) break;\n count = processLexeme(value.substring(index, match.index), match);\n index = match.index + count;\n }\n\n processLexeme(value.substr(index));\n\n for (current = top; current.parent; current = current.parent) {\n // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n\n return {\n relevance: relevance,\n value: result,\n illegal: false,\n language: name,\n top: top\n };\n } catch (err) {\n if (err.message && err.message.indexOf('Illegal') !== -1) {\n return {\n illegal: true,\n relevance: 0,\n value: escape(value)\n };\n } else if (SAFE_MODE) {\n return {\n relevance: 0,\n value: escape(value),\n language: name,\n top: top,\n errorRaised: err\n };\n } else {\n throw err;\n }\n }\n }", "function $380d7edc2604b455$var$highlight(name, value, options) {\n var before = $03b62e45aee69014$exports.configure({});\n var settings = options || {};\n var prefix = settings.prefix;\n var result;\n if (typeof name !== \"string\") throw $4aa8a9bf31969fd6$exports(\"Expected `string` for name, got `%s`\", name);\n if (!$03b62e45aee69014$exports.getLanguage(name)) throw $4aa8a9bf31969fd6$exports(\"Unknown language: `%s` is not registered\", name);\n if (typeof value !== \"string\") throw $4aa8a9bf31969fd6$exports(\"Expected `string` for value, got `%s`\", value);\n if (prefix === null || prefix === undefined) prefix = $380d7edc2604b455$var$defaultPrefix;\n $03b62e45aee69014$exports.configure({\n __emitter: $380d7edc2604b455$var$Emitter,\n classPrefix: prefix\n });\n result = $03b62e45aee69014$exports.highlight(name, value, true);\n $03b62e45aee69014$exports.configure(before || {});\n /* istanbul ignore if - Highlight.js seems to use this (currently) for broken\n * grammars, so let’s keep it in there just to be sure. */ if (result.errorRaised) throw result.errorRaised;\n return {\n relevance: result.relevance,\n language: result.language,\n value: result.emitter.rootNode.children\n };\n}", "function highlight(name, value, ignore_illegals, continuation) {\n function subMode(lexeme, mode) {\n var i, length;\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix, openSpan = '<span class=\"' + classPrefix, closeSpan = leaveOpen ? '' : spanEndTag;\n openSpan += classname + '\">';\n return openSpan + insideSpan + closeSpan;\n }\n function processKeywords() {\n var keyword_match, last_index, match, result;\n if (!top.keywords)\n return escape(mode_buffer);\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n }\n else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n function startNewMode(mode) {\n result += mode.className ? buildSpan(mode.className, '', true) : '';\n top = Object.create(mode, { parent: { value: top } });\n }\n function processLexeme(buffer, lexeme) {\n mode_buffer += buffer;\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n }\n else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n }\n else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts);\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for (current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for (current = top; current.parent; current = current.parent) {\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n }\n catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n }\n else {\n throw e;\n }\n }\n}", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function (name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n}", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n if (!leaveOpen && insideSpan === '') return '';\n if (!classname) return insideSpan;\n\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n\n function doBeginMatch(match) {\n var lexeme = match[0];\n var new_mode = match.rule;\n\n if (new_mode && new_mode.endSameAsBegin) {\n new_mode.endRe = escapeRe( lexeme );\n }\n\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n function doEndMatch(match) {\n var lexeme = match[0];\n var end_mode = endOfMode(top, lexeme);\n if (!end_mode) { return; }\n\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n var lastMatch = {};\n function processLexeme(text_before_match, match) {\n\n var lexeme = match && match[0];\n\n // add non-matched text to the current mode buffer\n mode_buffer += text_before_match;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n if (lastMatch.type==\"begin\" && match.type==\"end\" && lastMatch.index == match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n mode_buffer += value.slice(match.index, match.index + 1)\n return 1;\n }\n lastMatch = match;\n\n if (match.type===\"begin\") {\n return doBeginMatch(match);\n } else if (match.type===\"illegal\" && !ignore_illegals) {\n // illegal match, we do not continue processing\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n } else if (match.type===\"end\") {\n var processed = doEndMatch(match);\n if (processed != undefined)\n return processed;\n }\n\n /*\n Why might be find ourselves here? Only one occasion now. An end match that was\n triggered but could not be completed. When might this happen? When an `endSameasBegin`\n rule sets the end rule to a specific match. Since the overall mode termination rule that's\n being used to scan the text isn't recompiled that means that any match that LOOKS like\n the end (but is not, because it is not an exact match to the beginning) will\n end up here. A definite end match, but when `doEndMatch` tries to \"reapply\"\n the end rule and fails to match, we wind up here, and just silently ignore the end.\n\n This causes no real harm other than stopping a few times too many.\n */\n\n mode_buffer += lexeme;\n return lexeme.length;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n illegal:false,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n illegal: true,\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n if (!leaveOpen && insideSpan === '') return '';\n if (!classname) return insideSpan;\n\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n\n function doBeginMatch(match) {\n var lexeme = match[0];\n var new_mode = match.rule;\n\n if (new_mode && new_mode.endSameAsBegin) {\n new_mode.endRe = escapeRe( lexeme );\n }\n\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n function doEndMatch(match) {\n var lexeme = match[0];\n var end_mode = endOfMode(top, lexeme);\n if (!end_mode) { return; }\n\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n var lastMatch = {};\n function processLexeme(text_before_match, match) {\n\n var lexeme = match && match[0];\n\n // add non-matched text to the current mode buffer\n mode_buffer += text_before_match;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n if (lastMatch.type==\"begin\" && match.type==\"end\" && lastMatch.index == match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n mode_buffer += value.slice(match.index, match.index + 1)\n return 1;\n }\n lastMatch = match;\n\n if (match.type===\"begin\") {\n return doBeginMatch(match);\n } else if (match.type===\"illegal\" && !ignore_illegals) {\n // illegal match, we do not continue processing\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n } else if (match.type===\"end\") {\n var processed = doEndMatch(match);\n if (processed != undefined)\n return processed;\n }\n\n /*\n Why might be find ourselves here? Only one occasion now. An end match that was\n triggered but could not be completed. When might this happen? When an `endSameasBegin`\n rule sets the end rule to a specific match. Since the overall mode termination rule that's\n being used to scan the text isn't recompiled that means that any match that LOOKS like\n the end (but is not, because it is not an exact match to the beginning) will\n end up here. A definite end match, but when `doEndMatch` tries to \"reapply\"\n the end rule and fails to match, we wind up here, and just silently ignore the end.\n\n This causes no real harm other than stopping a few times too many.\n */\n\n mode_buffer += lexeme;\n return lexeme.length;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n illegal:false,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n illegal: true,\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlightAuto(code, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = justTextHighlightResult(code);\n var second_best = result;\n languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) {\n var current = _highlight(name, code, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '';\n for(var current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(var current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n };\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '';\n for(var current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(var current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n };\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, top.continuation.top) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n top.continuation.top = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var result = '';\n for(var current = top; current != language; current = current.parent) {\n if (current.className) {\n result += buildSpan(current.className, result, true);\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(var current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n };\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, top.continuation.top) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n top.continuation.top = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var result = '';\n for(var current = top; current != language; current = current.parent) {\n if (current.className) {\n result += buildSpan(current.className, result, true);\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(var current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n };\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlightAuto(text, languageSubset) {\n\t languageSubset = languageSubset || options.languages || Object.keys(languages);\n\t var result = {\n\t relevance: 0,\n\t value: escape(text)\n\t };\n\t var second_best = result;\n\t languageSubset.forEach(function(name) {\n\t if (!getLanguage(name)) {\n\t return;\n\t }\n\t var current = highlight(name, text, false);\n\t current.language = name;\n\t if (current.relevance > second_best.relevance) {\n\t second_best = current;\n\t }\n\t if (current.relevance > result.relevance) {\n\t second_best = result;\n\t result = current;\n\t }\n\t });\n\t if (second_best.language) {\n\t result.second_best = second_best;\n\t }\n\t return result;\n\t }", "function highlightAuto(text, languageSubset) {\n\t languageSubset = languageSubset || options.languages || Object.keys(languages);\n\t var result = {\n\t relevance: 0,\n\t value: escape(text)\n\t };\n\t var second_best = result;\n\t languageSubset.forEach(function(name) {\n\t if (!getLanguage(name)) {\n\t return;\n\t }\n\t var current = highlight(name, text, false);\n\t current.language = name;\n\t if (current.relevance > second_best.relevance) {\n\t second_best = current;\n\t }\n\t if (current.relevance > result.relevance) {\n\t second_best = result;\n\t result = current;\n\t }\n\t });\n\t if (second_best.language) {\n\t result.second_best = second_best;\n\t }\n\t return result;\n\t }", "function highlightAuto(text, languageSubset) {\n\t languageSubset = languageSubset || options.languages || Object.keys(languages);\n\t var result = {\n\t relevance: 0,\n\t value: escape(text)\n\t };\n\t var second_best = result;\n\t languageSubset.forEach(function(name) {\n\t if (!getLanguage(name)) {\n\t return;\n\t }\n\t var current = highlight(name, text, false);\n\t current.language = name;\n\t if (current.relevance > second_best.relevance) {\n\t second_best = current;\n\t }\n\t if (current.relevance > result.relevance) {\n\t second_best = result;\n\t result = current;\n\t }\n\t });\n\t if (second_best.language) {\n\t result.second_best = second_best;\n\t }\n\t return result;\n\t }", "function highlightAuto(text, languageSubset) {\n\t languageSubset = languageSubset || options.languages || Object.keys(languages);\n\t var result = {\n\t relevance: 0,\n\t value: escape(text)\n\t };\n\t var second_best = result;\n\t languageSubset.forEach(function(name) {\n\t if (!getLanguage(name)) {\n\t return;\n\t }\n\t var current = highlight(name, text, false);\n\t current.language = name;\n\t if (current.relevance > second_best.relevance) {\n\t second_best = current;\n\t }\n\t if (current.relevance > result.relevance) {\n\t second_best = result;\n\t result = current;\n\t }\n\t });\n\t if (second_best.language) {\n\t result.second_best = second_best;\n\t }\n\t return result;\n\t }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function (name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n\t languageSubset = languageSubset || options.languages || objectKeys(languages);\n\t var result = {\n\t relevance: 0,\n\t value: escape(text)\n\t };\n\t var second_best = result;\n\t languageSubset.filter(getLanguage).forEach(function(name) {\n\t var current = highlight(name, text, false);\n\t current.language = name;\n\t if (current.relevance > second_best.relevance) {\n\t second_best = current;\n\t }\n\t if (current.relevance > result.relevance) {\n\t second_best = result;\n\t result = current;\n\t }\n\t });\n\t if (second_best.language) {\n\t result.second_best = second_best;\n\t }\n\t return result;\n\t }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function (name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className ? buildSpan(mode.className, '', true) : '';\n top = Object.create(mode, { parent: { value: top } });\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for (current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for (current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t for (var i = 0; i < mode.contains.length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : '</span>';\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\t var result = '';\n\t var last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t var match = top.lexemesRe.exec(mode_buffer);\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t var keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage == 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n\t }\n\n\t function startNewMode(mode, lexeme) {\n\t var markup = mode.className? buildSpan(mode.className, '', true): '';\n\t if (mode.returnBegin) {\n\t result += markup;\n\t mode_buffer = '';\n\t } else if (mode.excludeBegin) {\n\t result += escape(lexeme) + markup;\n\t mode_buffer = '';\n\t } else {\n\t result += markup;\n\t mode_buffer = lexeme;\n\t }\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\t if (lexeme === undefined) {\n\t result += processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t result += processBuffer();\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t result += processBuffer();\n\t do {\n\t if (top.className) {\n\t result += '</span>';\n\t }\n\t relevance += top.relevance;\n\t top = top.parent;\n\t } while (top != end_mode.parent);\n\t if (origin.excludeEnd) {\n\t result += escape(lexeme);\n\t }\n\t mode_buffer = '';\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current != language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += '</span>';\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message.indexOf('Illegal') != -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t for (var i = 0; i < mode.contains.length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : '</span>';\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\t var result = '';\n\t var last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t var match = top.lexemesRe.exec(mode_buffer);\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t var keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage == 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n\t }\n\n\t function startNewMode(mode, lexeme) {\n\t var markup = mode.className? buildSpan(mode.className, '', true): '';\n\t if (mode.returnBegin) {\n\t result += markup;\n\t mode_buffer = '';\n\t } else if (mode.excludeBegin) {\n\t result += escape(lexeme) + markup;\n\t mode_buffer = '';\n\t } else {\n\t result += markup;\n\t mode_buffer = lexeme;\n\t }\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\t if (lexeme === undefined) {\n\t result += processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t result += processBuffer();\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t result += processBuffer();\n\t do {\n\t if (top.className) {\n\t result += '</span>';\n\t }\n\t relevance += top.relevance;\n\t top = top.parent;\n\t } while (top != end_mode.parent);\n\t if (origin.excludeEnd) {\n\t result += escape(lexeme);\n\t }\n\t mode_buffer = '';\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current != language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += '</span>';\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message.indexOf('Illegal') != -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t for (var i = 0; i < mode.contains.length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : '</span>';\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\t var result = '';\n\t var last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t var match = top.lexemesRe.exec(mode_buffer);\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t var keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage == 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n\t }\n\n\t function startNewMode(mode, lexeme) {\n\t var markup = mode.className? buildSpan(mode.className, '', true): '';\n\t if (mode.returnBegin) {\n\t result += markup;\n\t mode_buffer = '';\n\t } else if (mode.excludeBegin) {\n\t result += escape(lexeme) + markup;\n\t mode_buffer = '';\n\t } else {\n\t result += markup;\n\t mode_buffer = lexeme;\n\t }\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\t if (lexeme === undefined) {\n\t result += processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t result += processBuffer();\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t result += processBuffer();\n\t do {\n\t if (top.className) {\n\t result += '</span>';\n\t }\n\t relevance += top.relevance;\n\t top = top.parent;\n\t } while (top != end_mode.parent);\n\t if (origin.excludeEnd) {\n\t result += escape(lexeme);\n\t }\n\t mode_buffer = '';\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current != language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += '</span>';\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message.indexOf('Illegal') != -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t for (var i = 0; i < mode.contains.length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : '</span>';\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\t var result = '';\n\t var last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t var match = top.lexemesRe.exec(mode_buffer);\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t var keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage == 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n\t }\n\n\t function startNewMode(mode, lexeme) {\n\t var markup = mode.className? buildSpan(mode.className, '', true): '';\n\t if (mode.returnBegin) {\n\t result += markup;\n\t mode_buffer = '';\n\t } else if (mode.excludeBegin) {\n\t result += escape(lexeme) + markup;\n\t mode_buffer = '';\n\t } else {\n\t result += markup;\n\t mode_buffer = lexeme;\n\t }\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\t if (lexeme === undefined) {\n\t result += processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t result += processBuffer();\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t result += processBuffer();\n\t do {\n\t if (top.className) {\n\t result += '</span>';\n\t }\n\t relevance += top.relevance;\n\t top = top.parent;\n\t } while (top != end_mode.parent);\n\t if (origin.excludeEnd) {\n\t result += escape(lexeme);\n\t }\n\t mode_buffer = '';\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current != language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += '</span>';\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message.indexOf('Illegal') != -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "function highlight(language, value, options) {\n var settings = options || {}\n var prefix = settings.prefix\n\n if (prefix === null || prefix === undefined) {\n prefix = defaultPrefix\n }\n\n return normalize(coreHighlight(language, value, true, prefix))\n}", "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t var i, length;\n\n\t for (i = 0, length = mode.contains.length; i < length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : spanEndTag\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t var keyword_match, last_index, match, result;\n\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\n\t result = '';\n\t last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t match = top.lexemesRe.exec(mode_buffer);\n\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage === 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n\t mode_buffer = '';\n\t }\n\n\t function startNewMode(mode) {\n\t result += mode.className? buildSpan(mode.className, '', true): '';\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\n\t if (lexeme == null) {\n\t processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t if (new_mode.skip) {\n\t mode_buffer += lexeme;\n\t } else {\n\t if (new_mode.excludeBegin) {\n\t mode_buffer += lexeme;\n\t }\n\t processBuffer();\n\t if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n\t mode_buffer = lexeme;\n\t }\n\t }\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (origin.skip) {\n\t mode_buffer += lexeme;\n\t } else {\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t processBuffer();\n\t if (origin.excludeEnd) {\n\t mode_buffer = lexeme;\n\t }\n\t }\n\t do {\n\t if (top.className) {\n\t result += spanEndTag;\n\t }\n\t if (!top.skip) {\n\t relevance += top.relevance;\n\t }\n\t top = top.parent;\n\t } while (top !== end_mode.parent);\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current !== language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += spanEndTag;\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message && e.message.indexOf('Illegal') !== -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className ? buildSpan(mode.className, '', true) : '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {\n parent: {\n value: top\n }\n });\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '',\n current;\n for (current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for (current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).filter(autoDetection).forEach(function (name) {\n var current = highlight(name, text, false);\n current.language = name;\n\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n\n if (second_best.language) {\n result.second_best = second_best;\n }\n\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n r: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.r > second_best.r) {\n second_best = current;\n }\n if (current.r > result.r) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function Highlight(){\n if (!(this instanceof Highlight)) return new Highlight();\n this.languages = {};\n this.prefix('Highlight-');\n}", "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] );\n }\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n if (!classname) return insideSpan;\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] );\n }\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlightAuto(text) {\n var result = {\n keyword_count: 0,\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n for (var key in languages) {\n if (!languages.hasOwnProperty(key))\n continue;\n var current = highlight(key, text);\n current.language = key;\n if (current.keyword_count + current.relevance > second_best.keyword_count + second_best.relevance) {\n second_best = current;\n }\n if (current.keyword_count + current.relevance > result.keyword_count + result.relevance) {\n second_best = result;\n result = current;\n }\n }\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.c.length; i++) {\n if (testRe(mode.c[i].bR, lexeme)) {\n return mode.c[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.eR, lexeme)) {\n return mode;\n }\n if (mode.eW) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.iR, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.cI ? match[0].toLowerCase() : match[0];\n return mode.k.hasOwnProperty(match_str) && mode.k[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.k)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lR.lastIndex = 0;\n var match = top.lR.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n r += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lR.lastIndex;\n match = top.lR.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.sL && !languages[top.sL]) {\n return escape(mode_buffer);\n }\n var result = top.sL ? highlight(top.sL, mode_buffer, true, top.continuation.top) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode r. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.r > 0) {\n r += result.r;\n }\n if (top.subLanguageMode == 'continuous') {\n top.continuation.top = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.sL !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.cN? buildSpan(mode.cN, '', true): '';\n if (mode.rB) {\n result += markup;\n mode_buffer = '';\n } else if (mode.eB) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.rB ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.rE || origin.eE)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.cN) {\n result += '</span>';\n }\n r += top.r;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.eE) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.rE ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.cN || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var result = '';\n for(var current = top; current != language; current = current.parent) {\n if (current.cN) {\n result += buildSpan(current.cN, result, true);\n }\n }\n var mode_buffer = '';\n var r = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.t.lastIndex = index;\n match = top.t.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(var current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.cN) {\n result += '</span>';\n }\n };\n return {\n r: r,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n r: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function localSearchHighlight(searchStr, singleWordSearch, doc) \n{\n var MAX_WORDS = 50; //limit for words to search, if unlimited, browser may crash\n doc = typeof(doc) != 'undefined' ? doc : document;\n \n if (!doc.createElement) \n {\n return;\n }\n \n // Trim leading and trailing spaces after unescaping\n searchstr = unescape(searchStr).replace(/^\\s+|\\s+$/g, \"\");\n \n if( searchStr == '' ) \n {\n return;\n }\n \n //majgis: Single search option\n if(singleWordSearch)\n {\n phrases = searchStr.replace(/\\+/g,' ').split(/\\\"/);\n }\n else\n {\n phrases = [\"\",searchStr];\n }\n \n var hinodes = [];\n colorgen = colorGenerator(singleWordSearch || !clearBetweenSelections);\n \n for(p=0; p < phrases.length; p++) \n {\n phrases[p] = unescape(phrases[p]).replace(/^\\s+|\\s+$/g, \"\");\n \n if( phrases[p] == '' ) \n {\n continue;\n }\n \n if( p % 2 == 0 ) \n {\n words = phrases[p].replace(/([+,()]|%(29|28)|\\W+(AND|OR)\\W+)/g,' ').split(/\\s+/);\n }\n else \n { \n words=Array(1); \n words[0] = phrases[p]; \n }\n \n //limit length to prevent crashing browser\n if (words.length > MAX_WORDS)\n {\n words.splice(MAX_WORDS - 1, phrases.length - MAX_WORDS);\n }\n \n for (w=0; w < words.length; w++) \n {\n if( words[w] == '' ) \n {\n continue;\n }\n \n hinodes = highlightWord(doc.getElementsByTagName(\"body\")[0], words[w], doc);\n }\n }\n \n selection.removeAllRanges();\n var oldSelection = document.getElementById(\"mySelectedSpan\");\n var reselectRange = document.createRange();\n reselectRange.selectNode(oldSelection);\n selection.addRange(reselectRange);\n}", "function justTextHighlightResult(code) {\n const result = {\n relevance: 0,\n emitter: new options.__emitter(options),\n value: escape$1(code),\n illegal: false,\n top: PLAINTEXT_LANGUAGE\n };\n result.emitter.addText(code);\n return result;\n }", "function highlight(str, lang) {\n if (lang && hljs.getLanguage(lang)) {\n return hljs.highlight(lang, str, true).value;\n }\n\n return '';\n}", "function AlgoliaExplainResults(e,t,n){function r(e,t){var n=[];if(typeof e==\"object\"&&\"matchedWords\"in e&&\"value\"in e){var i=!1;for(var s=0;s<e.matchedWords.length;++s){var o=e.matchedWords[s];o in t||(t[o]=1,i=!0)}i&&n.push(e.value)}else if(Object.prototype.toString.call(e)===\"[object Array]\")for(var u=0;u<e.length;++u){var a=r(e[u],t);n=n.concat(a)}else if(typeof e==\"object\")for(var f in e)e.hasOwnProperty(f)&&(n=n.concat(r(e[f],t)));return n}function i(e,t,n){var s=e._highlightResult||e;if(n.indexOf(\".\")===-1)return n in s?r(s[n],t):[];var o=n.split(\".\"),u=s;for(var a=0;a<o.length;++a){if(Object.prototype.toString.call(u)===\"[object Array]\"){var f=[];for(var l=0;l<u.length;++l)f=f.concat(i(u[l],t,o.slice(a).join(\".\")));return f}if(!(o[a]in u))return[];u=u[o[a]]}return r(u,t)}var s={},o={},u=i(e,o,t);s.title=u.length>0?u[0]:\"\",s.subtitles=[];if(typeof n!=\"undefined\")for(var a=0;a<n.length;++a){var f=i(e,o,n[a]);for(var l=0;l<f.length;++l)s.subtitles.push({attr:n[a],value:f[l]})}return s}", "function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) \r\n{\r\n // the highlightStartTag and highlightEndTag parameters are optional\r\n if ((!highlightStartTag) || (!highlightEndTag)) {\r\n highlightStartTag = \"<font style='color:blue; background-color:yellow;'>\";\r\n highlightEndTag = \"</font>\";\r\n }\r\n \r\n // find all occurences of the search term in the given text,\r\n // and add some \"highlight\" tags to them (we're not using a\r\n // regular expression search, because we want to filter out\r\n // matches that occur within HTML tags and script blocks, so\r\n // we have to do a little extra validation)\r\n var newText = \"\";\r\n var i = -1;\r\n var lcSearchTerm = searchTerm.toLowerCase();\r\n var lcBodyText = bodyText.toLowerCase();\r\n \r\n while (bodyText.length > 0) {\r\n i = lcBodyText.indexOf(lcSearchTerm, i+1);\r\n if (i < 0) {\r\n newText += bodyText;\r\n bodyText = \"\";\r\n } else {\r\n // skip anything inside an HTML tag\r\n if (bodyText.lastIndexOf(\">\", i) >= bodyText.lastIndexOf(\"<\", i)) {\r\n // skip anything inside a <script> block\r\n if (lcBodyText.lastIndexOf(\"/script>\", i) >= lcBodyText.lastIndexOf(\"<script\", i)) {\r\n subName= returnSubName(searchTerm);\r\n \r\n newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + subName + highlightEndTag;\r\n bodyText = bodyText.substr(i + searchTerm.length);\r\n lcBodyText = bodyText.toLowerCase();\r\n i = -1;\r\n }\r\n }\r\n }\r\n }\r\n \r\n return newText;\r\n}", "highlight(code, lang) {\n if (code.match(/^graph/) || code.match(/^sequenceDiagram/) || code.match(/^gantt/)) {\n return `<div class=\"mermaid\">${code}</div>`\n }\n\n if (lang && hljs.getLanguage(lang)) {\n try {\n return `<pre class=\"hljs\"><code>${hljs.highlight(lang, code, true).value}</code></pre>`\n } catch (err) {\n // Ignore error\n }\n }\n\n return `<pre class=\"hljs\"><code>${md.utils.escapeHtml(code)}</code></pre>`\n }", "function highlight() {\n var code_blocks = document.body.getElementsByClassName(\"language-c\");\n var keywords = [\n \"auto\", \"break\", \"case\", \"char\", \"const\", \"continue\", \"default\",\n \"do\", \"double\", \"else\", \"enum\", \"extern\", \"float\", \"for\", \"goto\",\n \"if\", \"inline\", \"int\", \"long\", \"register\", \"restrict\", \"return\",\n \"short\", \"signed\", \"sizeof\", \"static\", \"struct\", \"switch\",\n \"typedef\", \"union\", \"unsigned\", \"void\", \"volatile\", \"while\",\n ];\n var regex_var = /\\b[A-z][A-z0-9]*/;\n var regex_number = /\\b0[xX][0-9a-fA-F]+\\b|\\b[0-9]*\\.[0-9]+\\b|\\b[0-9]*\\b/;\n var regex_string = /\"[^\"]*\"/;\n var regex_symbol = /&gt;|&lt;|\\ |\\(|\\)|;|-/;\n for (var i = 0; i < code_blocks.length; i++) {\n var element = code_blocks.item(i);\n var code_lines = element.innerHTML.split('\\n');\n var cursor = 0;\n\n var parts = [];\n var insert_index = 0;\n function insert_at(index, insertable) {\n if (index < insert_index) console.error(\"inserting before last insert!!\");\n parts.push(element.innerHTML.substr(insert_index, index - insert_index));\n parts.push(insertable);\n insert_index = index;\n }\n\n var in_block_comment = false;\n\n for (var j = 0; j < code_lines.length; j++) {\n var words = code_lines[j].split(regex_symbol);\n var in_line_comment = false;\n\n for (var k = 0; k < words.length; k++) {\n var word = words[k];\n\n // Special case for < and >, because they're escaped in\n // innerHTML.\n var to_be_processed_html = element.innerHTML.substr(cursor);\n if (to_be_processed_html.startsWith(\"lt;\") ||\n to_be_processed_html.startsWith(\"gt;\")) {\n cursor += 3;\n }\n\n if (in_block_comment) {\n if (word == \"*/\") {\n in_block_comment = false;\n insert_at(cursor + word.length, \"</span>\"); // close comment block\n }\n } else {\n if (!in_line_comment) {\n if (word == \"//\") {\n in_line_comment = true;\n insert_at(cursor, \"<span class='syntax-comment'>\"); // open comment line\n }\n if (word == \"/*\") {\n in_block_comment = true;\n insert_at(cursor, \"<span class='syntax-comment'>\"); // open comment block\n }\n }\n\n if (!in_line_comment && !in_block_comment) {\n if (keywords.indexOf(word) != -1) {\n insert_at(cursor, \"<span class='syntax-keyword'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_string.test(word)) {\n insert_at(cursor, \"<span class='syntax-string'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_var.test(word) && element.innerHTML.substr(cursor + word.length, 1) == \"(\") {\n insert_at(cursor, \"<span class='syntax-call'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_var.test(word)) {\n insert_at(cursor, \"<span class='syntax-variable'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_number.test(word)) {\n insert_at(cursor, \"<span class='syntax-number'>\");\n insert_at(cursor + word.length, \"</span>\");\n }\n }\n }\n\n cursor += word.length + 1;\n }\n\n if (in_line_comment) {\n insert_at(cursor, \"</span>\"); // close comment line\n }\n }\n\n parts.push(element.innerHTML.substr(insert_index));\n element.innerHTML = parts.join('');\n\n // When processing, using &lt; and &gt; is forced upon us. Now we\n // can fix that to allow for good copypasting.\n element.innerHTML.replace(/&lt;/g, \"<\");\n element.innerHTML.replace(/&gt;/g, \">\");\n }\n}", "function $809574c62832013e$var$highlight(language, value, sheet) {\n var result = $809574c62832013e$var$high.call(this, language, value);\n result.value = $809574c62832013e$var$all(sheet || $809574c62832013e$var$defaultSheet, result.value);\n return result;\n}", "function highlightify(source,output,highlightRegExp)\n{\n\tif(source && source != \"\")\n\t\t{\n\t\tvar wikifier = new Wikifier(source,formatter,highlightRegExp,null);\n\t\twikifier.outputText(output,0,source.length);\n\t\t}\n}", "function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) \r\n{\r\n // the highlightStartTag and highlightEndTag parameters are optional\r\n if ((!highlightStartTag) || (!highlightEndTag)) {\r\n highlightStartTag = \"<font style='color:blue; background-color:#00B2EE;'>\";\r\n highlightEndTag = \"</font>\";\r\n }\r\n \r\n // find all occurences of the search term in the given text,\r\n // and add some \"highlight\" tags to them (we're not using a\r\n // regular expression search, because we want to filter out\r\n // matches that occur within HTML tags and script blocks, so\r\n // we have to do a little extra validation)\r\n var newText = \"\";\r\n var i = -1;\r\n var lcSearchTerm = searchTerm.toLowerCase();\r\n var lcBodyText = bodyText.toLowerCase();\r\n \r\n while (bodyText.length > 0) {\r\n i = lcBodyText.indexOf(lcSearchTerm, i+1);\r\n if (i < 0) {\r\n newText += bodyText;\r\n bodyText = \"\";\r\n } else {\r\n // skip anything inside an HTML tag\r\n if (bodyText.lastIndexOf(\">\", i) >= bodyText.lastIndexOf(\"<\", i)) {\r\n // skip anything inside a <script> block\r\n if (lcBodyText.lastIndexOf(\"/script>\", i) >= lcBodyText.lastIndexOf(\"<script\", i)) {\r\n newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;\r\n bodyText = bodyText.substr(i + searchTerm.length);\r\n lcBodyText = bodyText.toLowerCase();\r\n i = -1;\r\n }\r\n }\r\n }\r\n }\r\n \r\n return newText;\r\n}", "function l(e,a,r,f){function o(e,t){var a,r;for(a=0,r=t.contains.length;a<r;a++)if(n(t.contains[a].beginRe,e))return t.contains[a]}function i(e,t){if(n(e.endRe,t)){for(;e.endsParent&&e.parent;)e=e.parent;return e}if(e.endsWithParent)return i(e.parent,t)}function s(e,t){return!r&&n(t.illegalRe,e)}function c(e,t){var a=y.case_insensitive?t[0].toLowerCase():t[0];return e.keywords.hasOwnProperty(a)&&e.keywords[a]}function _(e,t,a,n){var r=n?\"\":O.classPrefix,f='<span class=\"'+r,o=a?\"\":M;return(f+=e+'\">')+t+o}function m(){var e,a,n,r;if(!x.keywords)return t(k);for(r=\"\",a=0,x.lexemesRe.lastIndex=0,n=x.lexemesRe.exec(k);n;)r+=t(k.substring(a,n.index)),e=c(x,n),e?(T+=e[1],r+=_(e[0],t(n[0]))):r+=t(n[0]),a=x.lexemesRe.lastIndex,n=x.lexemesRe.exec(k);return r+t(k.substr(a))}function p(){var e=\"string\"==typeof x.subLanguage;if(e&&!S[x.subLanguage])return t(k);var a=e?l(x.subLanguage,k,!0,E[x.subLanguage]):d(k,x.subLanguage.length?x.subLanguage:void 0);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n return x.relevance>0&&(T+=a.relevance),e&&(E[x.subLanguage]=a.top),_(a.language,a.value,!1,!0)}function g(){C+=null!=x.subLanguage?p():m(),k=\"\"}function h(e){C+=e.className?_(e.className,\"\",!0):\"\",x=Object.create(e,{parent:{value:x}})}function b(e,t){if(k+=e,null==t)return g(),0;var a=o(t,x);if(a)return a.skip?k+=t:(a.excludeBegin&&(k+=t),g(),a.returnBegin||a.excludeBegin||(k=t)),h(a,t),a.returnBegin?0:t.length;var n=i(x,t);if(n){var r=x;r.skip?k+=t:(r.returnEnd||r.excludeEnd||(k+=t),g(),r.excludeEnd&&(k=t));do{x.className&&(C+=M),x.skip||(T+=x.relevance),x=x.parent}while(x!==n.parent);return n.starts&&h(n.starts,\"\"),r.returnEnd?0:t.length}if(s(t,x))throw new Error('Illegal lexeme \"'+t+'\" for mode \"'+(x.className||\"<unnamed>\")+'\"');/*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n return k+=t,t.length||1}var y=w(e);if(!y)throw new Error('Unknown language: \"'+e+'\"');u(y);var v,x=f||y,E={},C=\"\";for(v=x;v!==y;v=v.parent)v.className&&(C=_(v.className,\"\",!0)+C);var k=\"\",T=0;try{for(var N,D,A=0;;){if(x.terminators.lastIndex=A,!(N=x.terminators.exec(a)))break;D=b(a.substring(A,N.index),N[0]),A=N.index+D}for(b(a.substr(A)),v=x;v.parent;v=v.parent)// close dangling modes\n v.className&&(C+=M);return{relevance:T,value:C,language:e,top:x}}catch(e){if(e.message&&-1!==e.message.indexOf(\"Illegal\"))return{relevance:0,value:t(a)};throw e}}", "function runHightlightJs(content, language) {\n return hljs.highlight(language || 'html', content, options.ignoreSyntax).value;\n }", "function highlightcheck(language, lengaugestring){\n if (language === 0) {\n removehighlight(lengaugestring);\n } else if (language === 1){\n removehighlight(lengaugestring);\n $(\"div#\" + lengaugestring).addClass(\"highlightrow\");\n } else if (language === 2){\n removehighlight(lengaugestring);\n $(\"div#\" + lengaugestring).addClass(\"highlightrow1\");\n } else {\n removehighlight(lengaugestring);\n $(\"div#\" + lengaugestring).addClass(\"highlightrow2\");\n };\n }", "function highlight() {\n\t\t$('pre code').each(function(i, e) {\n\t\t hljs.highlightBlock(e)\n\t\t});\n\t}", "function highlightMatches (text, query) {\n // Sort terms length, so that the longest are highlighted first.\n const terms = tokenize(query).sort((term1, term2) => term2.length - term1.length)\n return highlightTerms(text, terms)\n}", "function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) {\n // the highlightStartTag and highlightEndTag parameters are optional\n if ((!highlightStartTag) || (!highlightEndTag)) {\n highlightStartTag = \"<font style='color:blue; background-color:yellow;'>\";\n highlightEndTag = \"</font>\";\n }\n \n // find all occurences of the search term in the given text,\n // and add some \"highlight\" tags to them (we're not using a\n // regular expression search, because we want to filter out\n // matches that occur within HTML tags and script blocks, so\n // we have to do a little extra validation)\n var newText = \"\";\n var i = -1;\n var lcSearchTerm = searchTerm.toLowerCase();\n var lcBodyText = bodyText.toLowerCase();\n \n while (bodyText.length > 0) {\n i = lcBodyText.indexOf(lcSearchTerm, i+1);\n if (i < 0) {\n newText += bodyText;\n bodyText = \"\";\n } else {\n // skip anything inside an HTML tag\n if (bodyText.lastIndexOf(\">\", i) >= bodyText.lastIndexOf(\"<\", i)) {\n // skip anything inside a <script> block\n if (lcBodyText.lastIndexOf(\"/script>\", i) >= lcBodyText.lastIndexOf(\"<script\", i)) {\n newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;\n bodyText = bodyText.substr(i + searchTerm.length);\n lcBodyText = bodyText.toLowerCase();\n i = -1;\n }\n }\n }\n }\n \n return newText;\n}", "function highlightSyntax(targetDocument, syntaxHighlighter, codeText, codeLanguage) {\n var codeElem, preElem, textNode;\n\n // highlight.js requires a `<code>` element to be passed in that has a\n // `<pre>` parent element.\n\n preElem = targetDocument.createElement('pre');\n codeElem = targetDocument.createElement('code');\n textNode = targetDocument.createTextNode(codeText);\n codeElem.appendChild(textNode);\n preElem.appendChild(codeElem);\n\n // If we're told the language, set it as a class so that the highlighter\n // doesn't have to guess it. This is part of the HTML5 standard. See:\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-code-element\n if (codeLanguage && codeLanguage.length > 0) {\n codeElem.setAttribute('class', 'language-'+codeLanguage);\n }\n else {\n codeElem.setAttribute('class', 'no-highlight');\n }\n\n syntaxHighlighter.highlightBlock(codeElem);\n\n return codeElem.innerHTML;\n }", "function resultHighlight(text, term) {\n var terms = term.split(\" \");\n\n $.each(terms, function (key, term) {\n if (term.length >= 3) {\n term = term.replace(/(\\s+)/, \"(<[^>]+>)*$1(<[^>]+>)*\");\n var pattern = new RegExp(\"(\" + term + \")\", \"gi\");\n\n text = text.replace(pattern, \"<mark>$1</mark>\");\n }\n });\n\n return text;\n //remove the mark tag if needed\n //srcstr = srcstr.replace(/(<mark>[^<>]*)((<[^>]+>)+)([^<>]*<\\/mark>)/, \"$1</mark>$2<mark>$4\");\n }", "async function highlightText({ reObj, color = \"yellow\", hint = undefined, link = undefined, className = undefined }, rootElem = document) {\n\n if (!className || !className.length) {\n className = reObj.toString().replace(/\\s/g, \"\");\n }\n\n let wrapElem = document.createElement(\"a\");\n wrapElem.classList.add(className);\n wrapElem.classList.add(LABEL.classHighlight);\n wrapElem.classList.add(LABEL.classWhiteList);\n wrapElem.style.backgroundColor = color;\n\n if (link && link.length) {\n wrapElem.href = link;\n }\n\n let hintFlag, hintElement;\n if (hint && hint.length) {\n hintFlag = true;\n hintElement = document.createElement(\"div\");\n hintElement.classList.add(LABEL.classHint);\n hintElement.classList.add(LABEL.classWhiteList);\n hintElement.innerText = hint;\n document.body.append(hintElement);\n }\n\n return getTextNodeArray(rootElem)\n .then(textNodeArray => {\n return wrapMatchedTextInNodes(reObj, textNodeArray, wrapElem);\n })\n .then(countArray => {\n let elements = document.getElementsByClassName(className);\n for (let curElem of elements) {\n if (hintFlag) {\n curElem.onmouseover = event => {\n hintElement.style.left = event.pageX + 1 + \"px\";\n hintElement.style.top = event.pageY + 1 + \"px\";\n hintElement.style.display = \"block\";\n };\n curElem.onmouseout = () => {\n hintElement.style.display = \"none\";\n };\n }\n }\n\n let count = countArray.reduce((pre, cur) => pre + cur, 0);\n return {\n count,\n className,\n };\n });\n}", "function highlight2(code) {\n return code.replace(/(F+)/g,'<span style=\"color: pink\">$1</span>').\n replace(/(L+)/g,'<span style=\"color: red\">$1</span>').\n replace(/(R+)/g,'<span style=\"color: green\">$1</span>').\n replace(/(\\d+)/g,'<span style=\"color: orange\">$1</span>');\n}", "function highlightSearchTerms(searchText, treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag)\r\n{\r\n // if the treatAsPhrase parameter is true, then we should search for \r\n // the entire phrase that was entered; otherwise, we will split the\r\n // search string so that each word is searched for and highlighted\r\n // individually\r\n if (treatAsPhrase) {\r\n searchArray = [searchText];\r\n } else {\r\n searchArray = searchText.split(\" \");\r\n }\r\n \r\n if (!document.body || typeof(document.body.innerHTML) == \"undefined\") {\r\n if (warnOnFailure) {\r\n alert(\"Por alguna razon el texto de esta pagina no se encuentra disponible, por lo que la busqueda no servira.\");\r\n }\r\n return false;\r\n }\r\n \r\n var bodyText = document.body.innerHTML;\r\n for (var i = 0; i < searchArray.length; i++) {\r\n bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);\r\n }\r\n \r\n document.body.innerHTML = bodyText;\r\n return true;\r\n}", "highlightCode() {\n hljs.highlightElement(this.el);\n }", "function highlight_words() {\n\n // YOUR CODE GOES HERE\n}", "highlight(query) {\n const tokens = this.tokenizer.tokenize(query);\n let token;\n let ret = '';\n let position = 0;\n // eslint-disable-next-line no-cond-assign\n while (token = tokens[position++]) {\n ret += this.highlightToken(token.type, token.value);\n }\n return ret;\n }", "function getHighlights(url) {\n $.get(baseUrl + \"/tags/highlights\", {\n \"url\": url,\n }).done(function(res) {\n if (res.success) {\n for (var h in res.highlights) {\n var hl = decodeURIComponent(h);\n var hl_id = res.highlights[h].id;\n\n var max_tag = res.highlights[h].max_tag;\n var is_owner = res.highlights[h].is_owner;\n var entire_highlight_present = true;\n var html = $.parseHTML(hl);\n\n var all_eligible = $.merge($(\"p\"), $(\"div\"));\n var last = null;\n\n if ($(\"body\").html().indexOf(hl) === -1) {\n all_eligible.filter(function () {\n if (/&nbsp;/gi.test($(this).html())) {\n if ($(this).html().replace(/&nbsp;/gi,'').indexOf(hl) > -1) {\n if (last === null || $(this).children().length < last.children().length) {\n last = $(this);\n }\n }\n }\n });\n last.html(last.html().replace(hl, \"<div class='highlight-annote' highlight='\" + hl_id + \"'>\"+hl+\"</div>\")); \n } else {\n var base = $('p:contains(\"' + html[0].textContent + '\"):last');\n base.html(base.html().replace(hl, \"<div class='highlight-annote' highlight='\" + hl_id + \"'>\"+hl+\"</div>\"));\n }\n\n $(\".highlight-annote[highlight='\"+hl_id+\"']\").css({\n \"background-color\": muteColor(max_tag[1]),\n \"display\": \"inline\",\n });\n $(\".highlight-annote[highlight='\"+hl_id+\"']\").attr(\"color\", muteColor(max_tag[1]));\n\n highlight_colors[hl_id] = muteColor(max_tag[1]);\n\n $(\".highlight-annote\").attr(\"is_owner\", is_owner);\n }\n } \n });\n}", "function cmtxHighlightCode() {\n if (typeof(hljs) != 'undefined' && typeof(hljs.highlightElement) != 'undefined') {\n jQuery('.cmtx_code_box, .cmtx_php_box').each(function(i, el) {\n hljs.highlightElement(el);\n });\n }\n}", "function _highlightSource() {\n const srcLanguage = (selected.id === 'css') ? 'css' :\n (selected.id === 'smil') ? 'markup' : 'javascript';\n srcCodeEl.className = '';\n srcCodeEl.classList.add('language-' + srcLanguage);\n\n Prism.highlightAll();\n}", "highlightElement(code, languages) {\n // Set code text before highlighting\n this.setTextContent(code);\n this._hljs.highlightAuto(code, languages).subscribe((res) => {\n // Set highlighted code\n this.setInnerHTML(res.value);\n // Check if user want to show line numbers\n if (this.lineNumbers && this._options && this._options.lineNumbersLoader) {\n this.addLineNumbers();\n }\n // Forward highlight response to the highlighted output\n this.highlighted.emit(res);\n });\n }", "highlightSync (param) {\n if (param == null) { param = {} }\n let { filePath, fileContents, scopeName } = param\n this.loadGrammarsSync()\n\n if (filePath) { if (fileContents == null) { fileContents = fs.readFileSync(filePath, 'utf8') } }\n\n return this._highlightCommon({ filePath, fileContents, scopeName })\n }", "function highlight(concept) {\n var the_map = {\n opinions:\"chartreuse\",\n life:\"yellow\",\n }\n return the_map[concept]\n}", "function highlightSelection(e) \n{\n selection = window.getSelection();\n \n //Skip this section if mouse event is undefined\n if (e != undefined)\n {\n \n //Ignore right clicks; avoids odd behavior with CTRL key\n if (e.button == 2)\n {\n return;\n }\n\n //Exit if CTRL key is held while auto highlight is checked on\n if(imedBool && e.ctrlKey)\n {\n return;\n }\n \n //Exit if CTRL key not held and auto highlight is checked off\n if(!imedBool && !e.ctrlKey)\n {\n return;\n }\n }\n \n var selectionTagName;\n //Avoid inputs like the plague..\n try {\n selectionTagName = selection.anchorNode.childNodes[0].tagName.toLowerCase();\n } catch (err) {\n //fail silently :-D\n }\n if (selectionTagName == \"input\") {\n return;\n }\n \n // Clear all highlights if requested\n if (clearBetweenSelections && highlightedPage == true)\n {\n clearHighlightsOnPage();\n }\n \n var selectedText = window.getSelection().toString().replace(/^\\s+|\\s+$/g, \"\");\n var testText = selectedText.toLowerCase();\n \n //Exit if selection is whitespace or what was previously selected\n if (selectedText == '' || lastText == testText)\n {\n return;\n }\n \n if (selection.toString() != '') {\n var mySpan = document.createElement(\"span\");\n var prevSpan = document.getElementById(\"mySelectedSpan\");\n if (prevSpan != null) {\n prevSpan.removeAttribute(\"id\");\n }\n mySpan.id = \"mySelectedSpan\";\n var range = selection.getRangeAt(0).cloneRange();\n mySpan.appendChild(range.extractContents());\n range.insertNode(mySpan);\n }\n \n //Perform highlighting\n localSearchHighlight(selectedText, singleSearch);\n highlightedPage = true;\n \n //Store processed selection for next time this method is called\n lastText = testText;\n if (selection.toString() != '') {\n if (!triggeredOnce) {\n triggeredOnce = !triggeredOnce;\n }\n }\n}", "function FMCClearSearch( win )\n{\n var highlights\t= FMCGetElementsByClassRoot( win.document.body, \"highlight\" );\n \n for ( var i = 0; i < highlights.length; i++ )\n {\n\t\tvar highlight\t= highlights[i];\n\t\tvar innerSpan\t= FMCGetChildNodeByTagName( highlight, \"SPAN\", 0 );\n var text\t\t= win.document.createTextNode( innerSpan.innerHTML );\n \n highlight.parentNode.replaceChild( text, highlight );\n }\n \n gColorIndex = 0;\n gFirstHighlight = null;\n \n // At this point, highlight nodes got replaced by text nodes. This causes nodes that were once single text nodes to\n // become divided into multiple text nodes. Future attempts to highlight multi-character strings may not work\n // because they may have been divided into multiple text nodes. To solve this, we merge adjacent text nodes.\n \n FMCMergeTextNodes( win.document.body );\n}" ]
[ "0.7377656", "0.72873604", "0.69761133", "0.6795165", "0.67158353", "0.6704457", "0.66818535", "0.66816354", "0.6653529", "0.6653529", "0.6653529", "0.6653529", "0.6653529", "0.6653529", "0.6653529", "0.6651905", "0.6651905", "0.66511744", "0.66511744", "0.66511744", "0.66511744", "0.66511744", "0.66511744", "0.6642122", "0.6641653", "0.6641653", "0.6641653", "0.66315293", "0.66315293", "0.66315293", "0.66315293", "0.66315293", "0.66315293", "0.66315293", "0.66315293", "0.66211367", "0.66211367", "0.6603373", "0.6603373", "0.6603373", "0.6603373", "0.66032475", "0.66032475", "0.66032475", "0.66032475", "0.66030467", "0.65903527", "0.65835524", "0.65268856", "0.65248513", "0.65248513", "0.65248513", "0.65248513", "0.6518926", "0.6508471", "0.6482837", "0.6482837", "0.6482837", "0.6482837", "0.6482837", "0.645469", "0.638554", "0.6381388", "0.6332207", "0.6255571", "0.625016", "0.6205493", "0.61523426", "0.612417", "0.60488266", "0.5883901", "0.5792699", "0.57506734", "0.5710634", "0.5682434", "0.56532985", "0.5650401", "0.5646156", "0.56332475", "0.56277585", "0.55477077", "0.5489285", "0.5440774", "0.5438684", "0.5438671", "0.5429702", "0.5426997", "0.5412513", "0.5410092", "0.53855973", "0.5376408", "0.5356599", "0.53135717", "0.5308886", "0.5286565", "0.5273229", "0.526095", "0.5258881", "0.5249005", "0.5241567" ]
0.6249571
66
Highlighting with language detection. Accepts a string with the code to highlight. Returns an object with the following properties: language (detected language) relevance (int) value (an HTML string with highlighting markup) second_best (object with the same structure for secondbest heuristically detected language, may be absent)
function highlightAuto(text, languageSubset) { languageSubset = languageSubset || options.languages || objectKeys(languages); var result = { relevance: 0, value: escape(text) }; var second_best = result; languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) { var current = highlight(name, text, false); current.language = name; if (current.relevance > second_best.relevance) { second_best = current; } if (current.relevance > result.relevance) { second_best = result; result = current; } }); if (second_best.language) { result.second_best = second_best; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function(name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function (name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n}", "function highlightAuto(text) {\n var result = {\n keyword_count: 0,\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n for (var key in languages) {\n if (!languages.hasOwnProperty(key))\n continue;\n var current = highlight(key, text);\n current.language = key;\n if (current.keyword_count + current.relevance > second_best.keyword_count + second_best.relevance) {\n second_best = current;\n }\n if (current.keyword_count + current.relevance > result.keyword_count + result.relevance) {\n second_best = result;\n result = current;\n }\n }\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n\t languageSubset = languageSubset || options.languages || Object.keys(languages);\n\t var result = {\n\t relevance: 0,\n\t value: escape(text)\n\t };\n\t var second_best = result;\n\t languageSubset.forEach(function(name) {\n\t if (!getLanguage(name)) {\n\t return;\n\t }\n\t var current = highlight(name, text, false);\n\t current.language = name;\n\t if (current.relevance > second_best.relevance) {\n\t second_best = current;\n\t }\n\t if (current.relevance > result.relevance) {\n\t second_best = result;\n\t result = current;\n\t }\n\t });\n\t if (second_best.language) {\n\t result.second_best = second_best;\n\t }\n\t return result;\n\t }", "function highlightAuto(text, languageSubset) {\n\t languageSubset = languageSubset || options.languages || Object.keys(languages);\n\t var result = {\n\t relevance: 0,\n\t value: escape(text)\n\t };\n\t var second_best = result;\n\t languageSubset.forEach(function(name) {\n\t if (!getLanguage(name)) {\n\t return;\n\t }\n\t var current = highlight(name, text, false);\n\t current.language = name;\n\t if (current.relevance > second_best.relevance) {\n\t second_best = current;\n\t }\n\t if (current.relevance > result.relevance) {\n\t second_best = result;\n\t result = current;\n\t }\n\t });\n\t if (second_best.language) {\n\t result.second_best = second_best;\n\t }\n\t return result;\n\t }", "function highlightAuto(text, languageSubset) {\n\t languageSubset = languageSubset || options.languages || Object.keys(languages);\n\t var result = {\n\t relevance: 0,\n\t value: escape(text)\n\t };\n\t var second_best = result;\n\t languageSubset.forEach(function(name) {\n\t if (!getLanguage(name)) {\n\t return;\n\t }\n\t var current = highlight(name, text, false);\n\t current.language = name;\n\t if (current.relevance > second_best.relevance) {\n\t second_best = current;\n\t }\n\t if (current.relevance > result.relevance) {\n\t second_best = result;\n\t result = current;\n\t }\n\t });\n\t if (second_best.language) {\n\t result.second_best = second_best;\n\t }\n\t return result;\n\t }", "function highlightAuto(text, languageSubset) {\n\t languageSubset = languageSubset || options.languages || Object.keys(languages);\n\t var result = {\n\t relevance: 0,\n\t value: escape(text)\n\t };\n\t var second_best = result;\n\t languageSubset.forEach(function(name) {\n\t if (!getLanguage(name)) {\n\t return;\n\t }\n\t var current = highlight(name, text, false);\n\t current.language = name;\n\t if (current.relevance > second_best.relevance) {\n\t second_best = current;\n\t }\n\t if (current.relevance > result.relevance) {\n\t second_best = result;\n\t result = current;\n\t }\n\t });\n\t if (second_best.language) {\n\t result.second_best = second_best;\n\t }\n\t return result;\n\t }", "function highlightAuto(text, languageSubset) {\n\t languageSubset = languageSubset || options.languages || objectKeys(languages);\n\t var result = {\n\t relevance: 0,\n\t value: escape(text)\n\t };\n\t var second_best = result;\n\t languageSubset.filter(getLanguage).forEach(function(name) {\n\t var current = highlight(name, text, false);\n\t current.language = name;\n\t if (current.relevance > second_best.relevance) {\n\t second_best = current;\n\t }\n\t if (current.relevance > result.relevance) {\n\t second_best = result;\n\t result = current;\n\t }\n\t });\n\t if (second_best.language) {\n\t result.second_best = second_best;\n\t }\n\t return result;\n\t }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).forEach(function (name) {\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function (name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(code, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = justTextHighlightResult(code);\n var second_best = result;\n languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) {\n var current = _highlight(name, code, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n r: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.r > second_best.r) {\n second_best = current;\n }\n if (current.r > result.r) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }", "function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || objectKeys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.filter(getLanguage).filter(autoDetection).forEach(function (name) {\n var current = highlight(name, text, false);\n current.language = name;\n\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n\n if (second_best.language) {\n result.second_best = second_best;\n }\n\n return result;\n }", "function d(e,a){a=a||O.languages||E(S);var n={relevance:0,value:t(e)},r=n;return a.filter(w).forEach(function(t){var a=l(t,e,!1);a.language=t,a.relevance>r.relevance&&(r=a),a.relevance>n.relevance&&(r=n,n=a)}),r.language&&(n.second_best=r),n}", "function _highlight(languageName, code, ignore_illegals, continuation) {\n var codeToHighlight = code;\n\n function endOfMode(mode, lexeme) {\n if (startsWith(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, buf;\n\n if (!top.keywords) {\n emitter.addText(mode_buffer);\n return;\n }\n\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n buf = \"\";\n\n while (match) {\n buf += mode_buffer.substring(last_index, match.index);\n keyword_match = keywordMatch(top, match);\n var kind = null;\n if (keyword_match) {\n emitter.addText(buf);\n buf = \"\";\n\n relevance += keyword_match[1];\n kind = keyword_match[0];\n emitter.addKeyword(match[0], kind);\n } else {\n buf += match[0];\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n buf += mode_buffer.substr(last_index);\n emitter.addText(buf);\n }\n\n function processSubLanguage() {\n if (mode_buffer === \"\") return;\n\n var explicit = typeof top.subLanguage === 'string';\n\n if (explicit && !languages[top.subLanguage]) {\n emitter.addText(mode_buffer);\n return;\n }\n\n var result = explicit ?\n _highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Use case in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n emitter.addSublanguage(result.emitter, result.language);\n }\n\n function processBuffer() {\n if (top.subLanguage != null)\n processSubLanguage();\n else\n processKeywords();\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n if (mode.className) {\n emitter.openNode(mode.className);\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function doIgnore(lexeme) {\n if (top.matcher.regexIndex === 0) {\n // no more regexs to potentially match here, so we move the cursor forward one\n // space\n mode_buffer += lexeme[0];\n return 1;\n } else {\n // no need to move the cursor, we still have additional regexes to try and\n // match at this very spot\n continueScanAtSamePosition = true;\n return 0;\n }\n }\n\n function doBeginMatch(match) {\n var lexeme = match[0];\n var new_mode = match.rule;\n\n if (new_mode.__onBegin) {\n let res = new_mode.__onBegin(match) || {};\n if (res.ignoreMatch)\n return doIgnore(lexeme);\n }\n\n if (new_mode && new_mode.endSameAsBegin) {\n new_mode.endRe = escape( lexeme );\n }\n\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n function doEndMatch(match) {\n var lexeme = match[0];\n var matchPlusRemainder = codeToHighlight.substr(match.index);\n var end_mode = endOfMode(top, matchPlusRemainder);\n if (!end_mode) { return; }\n\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n emitter.closeNode();\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts);\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n function processContinuations() {\n var list = [];\n for(var current = top; current !== language; current = current.parent) {\n if (current.className) {\n list.unshift(current.className);\n }\n }\n list.forEach(item => emitter.openNode(item));\n }\n\n var lastMatch = {};\n function processLexeme(text_before_match, match) {\n\n var err;\n var lexeme = match && match[0];\n\n // add non-matched text to the current mode buffer\n mode_buffer += text_before_match;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n\n\n // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n if (lastMatch.type==\"begin\" && match.type==\"end\" && lastMatch.index == match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n mode_buffer += codeToHighlight.slice(match.index, match.index + 1);\n if (!SAFE_MODE) {\n err = new Error('0 width match regex');\n err.languageName = languageName;\n err.badRule = lastMatch.rule;\n throw(err);\n }\n return 1;\n }\n lastMatch = match;\n\n if (match.type===\"begin\") {\n return doBeginMatch(match);\n } else if (match.type===\"illegal\" && !ignore_illegals) {\n // illegal match, we do not continue processing\n err = new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n err.mode = top;\n throw err;\n } else if (match.type===\"end\") {\n var processed = doEndMatch(match);\n if (processed != undefined)\n return processed;\n }\n\n // edge case for when illegal matches $ (end of line) which is technically\n // a 0 width match but not a begin/end match so it's not caught by the\n // first handler (when ignoreIllegals is true)\n if (match.type === \"illegal\" && lexeme === \"\") {\n // advance so we aren't stuck in an infinite loop\n return 1;\n }\n\n // infinite loops are BAD, this is a last ditch catch all. if we have a\n // decent number of iterations yet our index (cursor position in our\n // parsing) still 3x behind our index then something is very wrong\n // so we bail\n if (iterations > 100000 && iterations > match.index * 3) {\n const err = new Error('potential infinite loop, way more iterations than matches');\n throw err;\n }\n\n /*\n Why might be find ourselves here? Only one occasion now. An end match that was\n triggered but could not be completed. When might this happen? When an `endSameasBegin`\n rule sets the end rule to a specific match. Since the overall mode termination rule that's\n being used to scan the text isn't recompiled that means that any match that LOOKS like\n the end (but is not, because it is not an exact match to the beginning) will\n end up here. A definite end match, but when `doEndMatch` tries to \"reapply\"\n the end rule and fails to match, we wind up here, and just silently ignore the end.\n\n This causes no real harm other than stopping a few times too many.\n */\n\n mode_buffer += lexeme;\n return lexeme.length;\n }\n\n var language = getLanguage(languageName);\n if (!language) {\n console.error(LANGUAGE_NOT_FOUND.replace(\"{}\", languageName));\n throw new Error('Unknown language: \"' + languageName + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result;\n var emitter = new options.__emitter(options);\n processContinuations();\n var mode_buffer = '';\n var relevance = 0;\n var match;\n var processedCount;\n var index = 0;\n var iterations = 0;\n var continueScanAtSamePosition = false;\n\n try {\n top.matcher.considerAll();\n\n for (;;) {\n iterations++;\n if (continueScanAtSamePosition) {\n continueScanAtSamePosition = false;\n // only regexes not matched previously will now be\n // considered for a potential match\n } else {\n top.matcher.lastIndex = index;\n top.matcher.considerAll();\n }\n match = top.matcher.exec(codeToHighlight);\n // console.log(\"match\", match[0], match.rule && match.rule.begin)\n if (!match)\n break;\n let beforeMatch = codeToHighlight.substring(index, match.index);\n processedCount = processLexeme(beforeMatch, match);\n index = match.index + processedCount;\n }\n processLexeme(codeToHighlight.substr(index));\n emitter.closeAllNodes();\n emitter.finalize();\n result = emitter.toHTML();\n\n return {\n relevance: relevance,\n value: result,\n language: languageName,\n illegal: false,\n emitter: emitter,\n top: top\n };\n } catch (err) {\n if (err.message && err.message.includes('Illegal')) {\n return {\n illegal: true,\n illegalBy: {\n msg: err.message,\n context: codeToHighlight.slice(index-100,index+100),\n mode: err.mode\n },\n sofar: result,\n relevance: 0,\n value: escape$1(codeToHighlight),\n emitter: emitter,\n };\n } else if (SAFE_MODE) {\n return {\n relevance: 0,\n value: escape$1(codeToHighlight),\n emitter: emitter,\n language: languageName,\n top: top,\n errorRaised: err\n };\n } else {\n throw err;\n }\n }\n }", "function highlight(language_name, value) {\n\n function subMode(lexem, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n var match = mode.contains[i].beginRe.exec(lexem);\n if (match && match.index == 0) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode_index, lexem) {\n if (modes[mode_index].end && modes[mode_index].endRe.test(lexem))\n return 1;\n if (modes[mode_index].endsWithParent) {\n var level = endOfMode(mode_index - 1, lexem);\n return level ? level + 1 : 0;\n }\n return 0;\n }\n\n function isIllegal(lexem, mode) {\n return mode.illegal && mode.illegalRe.test(lexem);\n }\n\n function eatModeChunk(value, index) {\n var mode = modes[modes.length - 1];\n if (mode.terminators) {\n mode.terminators.lastIndex = index;\n return mode.terminators.exec(value);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n var value = mode.keywords[match_str];\n if (value && value instanceof Array)\n return value;\n return false;\n }\n\n function processKeywords(buffer, mode) {\n buffer = escape(buffer);\n if (!mode.keywords)\n return buffer;\n var result = '';\n var last_index = 0;\n mode.lexemsRe.lastIndex = 0;\n var match = mode.lexemsRe.exec(buffer);\n while (match) {\n result += buffer.substr(last_index, match.index - last_index);\n var keyword_match = keywordMatch(mode, match);\n if (keyword_match) {\n keyword_count += keyword_match[1];\n result += '<span class=\"'+ keyword_match[0] +'\">' + match[0] + '</span>';\n } else {\n result += match[0];\n }\n last_index = mode.lexemsRe.lastIndex;\n match = mode.lexemsRe.exec(buffer);\n }\n return result + buffer.substr(last_index);\n }\n\n function processSubLanguage(buffer, mode) {\n var result;\n if (mode.subLanguage == '') {\n result = highlightAuto(buffer);\n } else {\n result = highlight(mode.subLanguage, buffer);\n }\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (mode.relevance > 0) {\n keyword_count += result.keyword_count;\n relevance += result.relevance;\n }\n return '<span class=\"' + result.language + '\">' + result.value + '</span>';\n }\n\n function processBuffer(buffer, mode) {\n if (mode.subLanguage && languages[mode.subLanguage] || mode.subLanguage == '') {\n return processSubLanguage(buffer, mode);\n } else {\n return processKeywords(buffer, mode);\n }\n }\n\n function startNewMode(mode, lexem) {\n var markup = mode.className? '<span class=\"' + mode.className + '\">': '';\n if (mode.returnBegin) {\n result += markup;\n mode.buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexem) + markup;\n mode.buffer = '';\n } else {\n result += markup;\n mode.buffer = lexem;\n }\n modes.push(mode);\n relevance += mode.relevance;\n }\n\n function processModeInfo(buffer, lexem) {\n var current_mode = modes[modes.length - 1];\n if (lexem === undefined) {\n result += processBuffer(current_mode.buffer + buffer, current_mode);\n return;\n }\n\n var new_mode = subMode(lexem, current_mode);\n if (new_mode) {\n result += processBuffer(current_mode.buffer + buffer, current_mode);\n startNewMode(new_mode, lexem);\n return new_mode.returnBegin;\n }\n\n var end_level = endOfMode(modes.length - 1, lexem);\n if (end_level) {\n var markup = current_mode.className?'</span>':'';\n if (current_mode.returnEnd) {\n result += processBuffer(current_mode.buffer + buffer, current_mode) + markup;\n } else if (current_mode.excludeEnd) {\n result += processBuffer(current_mode.buffer + buffer, current_mode) + markup + escape(lexem);\n } else {\n result += processBuffer(current_mode.buffer + buffer + lexem, current_mode) + markup;\n }\n while (end_level > 1) {\n markup = modes[modes.length - 2].className?'</span>':'';\n result += markup;\n end_level--;\n modes.length--;\n }\n var last_ended_mode = modes[modes.length - 1];\n modes.length--;\n modes[modes.length - 1].buffer = '';\n if (last_ended_mode.starts) {\n startNewMode(last_ended_mode.starts, '');\n }\n return current_mode.returnEnd;\n }\n\n if (isIllegal(lexem, current_mode))\n throw 'Illegal';\n }\n\n var language = languages[language_name];\n compileLanguage(language);\n var modes = [language];\n language.buffer = '';\n var relevance = 0;\n var keyword_count = 0;\n var result = '';\n try {\n var match, index = 0;\n while (true) {\n match = eatModeChunk(value, index);\n if (!match)\n break;\n var return_lexem = processModeInfo(value.substr(index, match.index - index), match[0]);\n index = match.index + (return_lexem ? 0 : match[0].length);\n }\n processModeInfo(value.substr(index), undefined);\n return {\n relevance: relevance,\n keyword_count: keyword_count,\n value: result,\n language: language_name\n };\n } catch (e) {\n if (e == 'Illegal') {\n return {\n relevance: 0,\n keyword_count: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function discoverLanguageFromExampleText(code) {\n if (code.includes(\"html`\")) {\n return \"javascript\";\n }\n if (code.match(/<\\S/)) {\n return \"html\";\n }\n return \"javascript\";\n}", "function coreHighlight(name, value, ignore, prefix, continuation) {\n var lastMatch = {}\n var continuations = {}\n var stack = []\n var modeBuffer = ''\n var relevance = 0\n var language\n var top\n var current\n var currentChildren\n var offset\n var count\n var match\n var children\n\n if (typeof name !== 'string') {\n throw fault('Expected `string` for name, got `%s`', name)\n }\n\n if (typeof value !== 'string') {\n throw fault('Expected `string` for value, got `%s`', value)\n }\n\n language = getLanguage(name)\n top = continuation || language\n children = []\n\n current = top\n currentChildren = children\n\n if (!language) {\n throw fault('Unknown language: `%s` is not registered', name)\n }\n\n compileLanguage(language)\n\n try {\n top.terminators.lastIndex = 0\n offset = 0\n match = top.terminators.exec(value)\n\n while (match) {\n count = processLexeme(value.slice(offset, match.index), match)\n offset = match.index + count\n top.terminators.lastIndex = offset\n match = top.terminators.exec(value)\n }\n\n processLexeme(value.slice(offset))\n current = top\n\n while (current.parent) {\n if (current.className) {\n pop()\n }\n\n current = current.parent\n }\n\n return {\n relevance: relevance,\n value: currentChildren,\n illegal: false,\n language: name,\n top: top\n }\n } catch (error) {\n /* istanbul ignore if - Catch-all */\n if (error.message.indexOf('Illegal') === -1) {\n throw error\n }\n\n return {relevance: 0, illegal: true, value: addText(value, [])}\n }\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm')\n }\n\n function doBeginMatch(match) {\n var lexeme = match[0]\n var newMode = match.rule\n\n if (newMode && newMode.endSameAsBegin) {\n newMode.endRe = escapeRe(lexeme)\n }\n\n if (newMode.skip) {\n modeBuffer += lexeme\n } else {\n if (newMode.excludeBegin) {\n modeBuffer += lexeme\n }\n\n addSiblings(processBuffer(), currentChildren)\n\n if (!newMode.returnBegin && !newMode.excludeBegin) {\n modeBuffer = lexeme\n }\n }\n\n startNewMode(newMode)\n\n return newMode.returnBegin ? 0 : lexeme.length\n }\n\n function doEndMatch(match) {\n var lexeme = match[0]\n var matchPlusRemainder = value.slice(match.index)\n var endMode = endOfMode(top, matchPlusRemainder)\n\n if (!endMode) {\n return\n }\n\n var origin = top\n\n if (origin.skip) {\n modeBuffer += lexeme\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n modeBuffer += lexeme\n }\n\n addSiblings(processBuffer(), currentChildren)\n\n if (origin.excludeEnd) {\n modeBuffer = lexeme\n }\n }\n\n do {\n if (top.className) {\n pop()\n }\n\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance\n }\n\n top = top.parent\n } while (top !== endMode.parent)\n\n if (endMode.starts) {\n /* istanbul ignore if - hljs 9.16 added support for this but didn’t use it yet. */\n if (endMode.endSameAsBegin) {\n endMode.starts.endRe = endMode.endRe\n }\n\n startNewMode(endMode.starts)\n }\n\n return origin.returnEnd ? 0 : lexeme.length\n }\n\n function processLexeme(textBeforeMatch, match) {\n var lexeme = match && match[0]\n var processed\n\n // Add non-matched text to the current mode buffer\n modeBuffer += textBeforeMatch\n\n if (lexeme === undefined) {\n addSiblings(processBuffer(), currentChildren)\n return 0\n }\n\n // We've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n /* istanbul ignore if - Unknown what this fixes or which case fixes it */\n if (\n lastMatch.type === 'begin' &&\n match.type === 'end' &&\n lastMatch.index === match.index &&\n lexeme === ''\n ) {\n // Spit the “skipped” character that our regex choked on back into the output sequence\n modeBuffer += value.slice(match.index, match.index + 1)\n return 1\n }\n\n lastMatch = match\n\n if (match.type === 'begin') {\n return doBeginMatch(match)\n }\n\n if (match.type === 'end') {\n processed = doEndMatch(match)\n\n if (processed !== undefined) {\n return processed\n }\n }\n\n if (match.type === 'illegal' && !ignore) {\n // Illegal match, we do not continue processing\n throw fault(\n 'Illegal lexeme \"%s\" for mode \"%s\"',\n lexeme,\n top.className || '<unnamed>'\n )\n }\n\n // Why might be find ourselves here?\n // Only one occasion now.\n // An end match that was triggered but could not be completed.\n // When might this happen?\n // When an `endSameasBegin` rule sets the end rule to a specific match.\n // Since the overall mode termination rule that’s being used to scan the\n // text isn’t recompiled that means that any match that LOOKS like the end\n // (but is not, because it is not an exact match to the beginning) will end\n // up here.\n // A definite end match, but when `doEndMatch` tries to “reapply” the end\n // rule and fails to match, we wind up here, and just silently ignore the\n // end.\n // This causes no real harm other than stopping a few times too many.\n modeBuffer += lexeme\n\n return lexeme.length\n }\n\n // Start a new mode with a `lexeme` to process.\n function startNewMode(mode) {\n var node\n\n if (mode.className) {\n node = build(mode.className, [])\n }\n\n // Enter a new mode.\n if (node) {\n currentChildren.push(node)\n stack.push(currentChildren)\n currentChildren = node.children\n }\n\n top = Object.create(mode, {parent: {value: top}})\n }\n\n // Process the buffer.\n function processBuffer() {\n var result = top.subLanguage ? processSubLanguage() : processKeywords()\n modeBuffer = ''\n return result\n }\n\n // Process a sublanguage (returns a list of nodes).\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string'\n var subvalue\n\n /* istanbul ignore if - support non-loaded sublanguages */\n if (explicit && !languages[top.subLanguage]) {\n return addText(modeBuffer, [])\n }\n\n if (explicit) {\n subvalue = coreHighlight(\n top.subLanguage,\n modeBuffer,\n true,\n prefix,\n continuations[top.subLanguage]\n )\n } else {\n subvalue = autoHighlight(modeBuffer, {\n subset: top.subLanguage.length === 0 ? undefined : top.subLanguage,\n prefix: prefix\n })\n }\n\n // If we couldn’t highlight, for example because the requests subset isn’t\n // loaded, return a text node.\n if (!subvalue.language) {\n return [buildText(modeBuffer)]\n }\n\n // Counting embedded language score towards the host language may be\n // disabled with zeroing the containing mode relevance.\n // Usecase in point is Markdown that allows XML everywhere and makes every\n // XML snippet to have a much larger Markdown score.\n if (top.relevance > 0) {\n relevance += subvalue.relevance\n }\n\n if (explicit) {\n continuations[top.subLanguage] = subvalue.top\n }\n\n return [build(subvalue.language, subvalue.value, true)]\n }\n\n // Process keywords. Returns nodes.\n function processKeywords() {\n var nodes = []\n var lastIndex\n var keyword\n var node\n var submatch\n\n if (!top.keywords) {\n return addText(modeBuffer, nodes)\n }\n\n lastIndex = 0\n\n top.lexemesRe.lastIndex = 0\n\n keyword = top.lexemesRe.exec(modeBuffer)\n\n while (keyword) {\n addText(modeBuffer.slice(lastIndex, keyword.index), nodes)\n\n submatch = keywordMatch(top, keyword)\n\n if (submatch) {\n relevance += submatch[1]\n\n node = build(submatch[0], [])\n\n nodes.push(node)\n\n addText(keyword[0], node.children)\n } else {\n addText(keyword[0], nodes)\n }\n\n lastIndex = top.lexemesRe.lastIndex\n keyword = top.lexemesRe.exec(modeBuffer)\n }\n\n addText(modeBuffer.slice(lastIndex), nodes)\n\n return nodes\n }\n\n // Add siblings.\n function addSiblings(siblings, nodes) {\n var length = siblings.length\n var index = -1\n var sibling\n\n while (++index < length) {\n sibling = siblings[index]\n\n if (sibling.type === 'text') {\n addText(sibling.value, nodes)\n } else {\n nodes.push(sibling)\n }\n }\n }\n\n // Add a text.\n function addText(value, nodes) {\n var tail\n\n if (value) {\n tail = nodes[nodes.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += value\n } else {\n nodes.push(buildText(value))\n }\n }\n\n return nodes\n }\n\n // Build a text.\n function buildText(value) {\n return {type: 'text', value: value}\n }\n\n // Build a span.\n function build(name, contents, noPrefix) {\n return {\n type: 'element',\n tagName: 'span',\n properties: {\n className: [(noPrefix ? '' : prefix) + name]\n },\n children: contents\n }\n }\n\n // Check if the first word in `keywords` is a keyword.\n function keywordMatch(mode, keywords) {\n var keyword = keywords[0]\n\n if (language[keyInsensitive]) {\n keyword = keyword.toLowerCase()\n }\n\n return own.call(mode.keywords, keyword) && mode.keywords[keyword]\n }\n\n // Check if `lexeme` ends `mode`.\n function endOfMode(mode, lexeme) {\n if (test(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent\n }\n\n return mode\n }\n\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme)\n }\n }\n\n // Exit the current context.\n function pop() {\n /* istanbul ignore next - removed in hljs 9.3 */\n currentChildren = stack.pop() || children\n }\n}", "function p(e){var t,a,n,o,c,u=f(e);r(u)||(O.useBR?(t=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\"),t.innerHTML=e.innerHTML.replace(/\\n/g,\"\").replace(/<br[ \\/]*>/g,\"\\n\")):t=e,c=t.textContent,n=u?l(u,c,!0):d(c),a=i(t),a.length&&(o=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\"),o.innerHTML=n.value,n.value=s(a,i(o),c)),n.value=_(n.value),e.innerHTML=n.value,e.className=m(e.className,u,n.language),e.result={language:n.language,re:n.relevance},n.second_best&&(e.second_best={language:n.second_best.language,re:n.second_best.relevance}))}", "function highlight(name, value, ignore_illegals, continuation) {\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n\n return mode;\n }\n\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(className, insideSpan, leaveOpen, noPrefix) {\n if (!leaveOpen && insideSpan === '') return '';\n if (!className) return insideSpan;\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n openSpan += className + '\">';\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n if (!top.keywords) return escape(mode_buffer);\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined); // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Use case in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += top.subLanguage != null ? processSubLanguage() : processKeywords();\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className ? buildSpan(mode.className, '', true) : '';\n top = Object.create(mode, {\n parent: {\n value: top\n }\n });\n }\n\n function doBeginMatch(match) {\n var lexeme = match[0];\n var new_mode = match.rule;\n\n if (new_mode && new_mode.endSameAsBegin) {\n new_mode.endRe = escapeRe(lexeme);\n }\n\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n\n processBuffer();\n\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n\n startNewMode(new_mode);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n function doEndMatch(match) {\n var lexeme = match[0];\n var matchPlusRemainder = value.substr(match.index);\n var end_mode = endOfMode(top, matchPlusRemainder);\n\n if (!end_mode) {\n return;\n }\n\n var origin = top;\n\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n\n processBuffer();\n\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n\n do {\n if (top.className) {\n result += spanEndTag;\n }\n\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n\n top = top.parent;\n } while (top !== end_mode.parent);\n\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n\n startNewMode(end_mode.starts);\n }\n\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n var lastMatch = {};\n\n function processLexeme(text_before_match, match) {\n var lexeme = match && match[0]; // add non-matched text to the current mode buffer\n\n mode_buffer += text_before_match;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n } // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n\n\n if (lastMatch.type == \"begin\" && match.type == \"end\" && lastMatch.index == match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n mode_buffer += value.slice(match.index, match.index + 1);\n return 1;\n }\n\n lastMatch = match;\n\n if (match.type === \"begin\") {\n return doBeginMatch(match);\n } else if (match.type === \"illegal\" && !ignore_illegals) {\n // illegal match, we do not continue processing\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n } else if (match.type === \"end\") {\n var processed = doEndMatch(match);\n if (processed != undefined) return processed;\n }\n /*\n Why might be find ourselves here? Only one occasion now. An end match that was\n triggered but could not be completed. When might this happen? When an `endSameasBegin`\n rule sets the end rule to a specific match. Since the overall mode termination rule that's\n being used to scan the text isn't recompiled that means that any match that LOOKS like\n the end (but is not, because it is not an exact match to the beginning) will\n end up here. A definite end match, but when `doEndMatch` tries to \"reapply\"\n the end rule and fails to match, we wind up here, and just silently ignore the end.\n This causes no real harm other than stopping a few times too many.\n */\n\n\n mode_buffer += lexeme;\n return lexeme.length;\n }\n\n var language = getLanguage(name);\n\n if (!language) {\n console.error(LANGUAGE_NOT_FOUND.replace(\"{}\", name));\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n\n var result = '',\n current;\n\n for (current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n\n var mode_buffer = '';\n var relevance = 0;\n\n try {\n var match,\n count,\n index = 0;\n\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match) break;\n count = processLexeme(value.substring(index, match.index), match);\n index = match.index + count;\n }\n\n processLexeme(value.substr(index));\n\n for (current = top; current.parent; current = current.parent) {\n // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n\n return {\n relevance: relevance,\n value: result,\n illegal: false,\n language: name,\n top: top\n };\n } catch (err) {\n if (err.message && err.message.indexOf('Illegal') !== -1) {\n return {\n illegal: true,\n relevance: 0,\n value: escape(value)\n };\n } else if (SAFE_MODE) {\n return {\n relevance: 0,\n value: escape(value),\n language: name,\n top: top,\n errorRaised: err\n };\n } else {\n throw err;\n }\n }\n }", "function getLanguage(selectedText){\r\n\r\n\t// Detect the language of the passed in text\r\n\tvar selectedTextLanguage;\r\n\tguessLanguage.detect(selectedText, function(language) {\r\n\t\tselectedTextLanguage = language;\t\t\r\n \t//console.log('Detected language of provided text is [' + language + ']');\r\n \t});\r\n\t\r\n\tvar language = {};\r\n\tlanguage.shortname = selectedTextLanguage;\r\n\tlanguage.isrighttoleft = false;\r\n\tlanguage.pattern = 'en-us';\r\n\t\r\n\tswitch(selectedTextLanguage)\r\n\t{\r\n\t\tcase 'en':\r\n\t \t\tlanguage.fullname = 'English';\r\n\t \t\tbreak;\r\n\t\tcase 'ab':\r\n\t \t\tlanguage.fullname = 'Abkhazian';\r\n\t \t\tbreak;\r\n\t\tcase 'af':\r\n\t \t\tlanguage.fullname = 'Afrikaans';\r\n\t \t\tbreak;\r\n\t\tcase 'ar':\r\n\t \t\tlanguage.fullname = 'Arabic';\r\n\t\t\tlanguage.isrighttoleft = true;\r\n\t \t\tbreak;\r\n\t\tcase 'az':\r\n\t \t\tlanguage.fullname = 'Azeri';\r\n\t \t\tbreak;\r\n\t\tcase 'be':\r\n\t \t\tlanguage.fullname = 'Belarusian';\r\n\t\t\tlanguage.pattern = 'be';\r\n\t \t\tbreak;\r\n\t\tcase 'bg':\r\n\t \t\tlanguage.fullname = 'Bulgarian';\r\n\t \t\tbreak;\r\n\t\tcase 'bn':\r\n\t \t\tlanguage.fullname = 'Bengali';\r\n\t\t\tlanguage.pattern = 'bn';\r\n\t \t\tbreak;\r\n\t\tcase 'bo':\r\n\t \t\tlanguage.fullname = 'Tibetan';\r\n\t \t\tbreak;\r\n\t\tcase 'br':\r\n\t \t\tlanguage.fullname = 'Breton';\r\n\t \t\tbreak;\r\n\t\tcase 'ca':\r\n\t \t\tlanguage.fullname = 'Catalan';\r\n\t\t\tlanguage.pattern = 'ca';\r\n\t \t\tbreak;\r\n\t\tcase 'ceb':\r\n\t \t\tlanguage.fullname = 'Cebuano';\r\n\t \t\tbreak;\r\n\t\tcase 'cs':\r\n\t \t\tlanguage.fullname = 'Czech';\r\n\t\t\tlanguage.pattern = 'cz';\r\n\t \t\tbreak;\r\n\t\tcase 'cy':\r\n\t \t\tlanguage.fullname = 'Welsh';\r\n\t \t\tbreak;\r\n\t\tcase 'da':\r\n\t \t\tlanguage.fullname = 'Danish';\r\n\t\t\tlanguage.pattern = 'da';\r\n\t \t\tbreak;\r\n\t\tcase 'de':\r\n\t \t\tlanguage.fullname = 'German';\r\n\t\t\tlanguage.pattern = 'de';\r\n\t \t\tbreak;\r\n\t\tcase 'el':\r\n\t \t\tlanguage.fullname = 'Greek';\r\n\t \t\tbreak;\r\n\t\tcase 'eo':\r\n\t \t\tlanguage.fullname = 'Esperanto';\r\n\t \t\tbreak;\r\n\t\tcase 'es':\r\n\t \t\tlanguage.fullname = 'Spanish';\r\n\t\t\tlanguage.pattern = 'es';\r\n\t \t\tbreak;\r\n\t\tcase 'et':\r\n\t \t\tlanguage.fullname = 'Estonian';\r\n\t \t\tbreak;\r\n\t\tcase 'eu':\r\n\t \t\tlanguage.fullname = 'Basque';\r\n\t \t\tbreak;\r\n\t\tcase 'fa':\r\n\t \t\tlanguage.fullname = 'Farsi';\r\n\t \t\tbreak;\r\n\t\tcase 'fi':\r\n\t \t\tlanguage.fullname = 'Finnish';\r\n\t\t\tlanguage.pattern = 'fi';\r\n\t \t\tbreak;\r\n\t\tcase 'fo':\r\n\t \t\tlanguage.fullname = 'Faroese';\r\n\t \t\tbreak;\r\n\t\tcase 'fr':\r\n\t \t\tlanguage.fullname = 'French';\r\n\t\t\tlanguage.pattern = 'fr';\r\n\t \t\tbreak;\r\n\t\tcase 'fy':\r\n\t \t\tlanguage.fullname = 'Frisian';\r\n\t \t\tbreak;\r\n\t\tcase 'gd':\r\n\t \t\tlanguage.fullname = 'Scots Gaelic';\r\n\t \t\tbreak;\r\n\t\tcase 'gl':\r\n\t \t\tlanguage.fullname = 'Galician';\r\n\t \t\tbreak;\r\n\t\tcase 'gu':\r\n\t \t\tlanguage.fullname = 'Gujarati';\r\n\t\t\tlanguage.pattern = 'gu';\r\n\t \t\tbreak;\r\n\t\tcase 'ha':\r\n\t \t\tlanguage.fullname = 'Hausa';\r\n\t \t\tbreak;\r\n\t\tcase 'haw':\r\n\t \t\tlanguage.fullname = 'Hawaiian';\r\n\t \t\tbreak;\r\n\t\tcase 'he':\r\n\t \t\tlanguage.fullname = 'Hebrew';\r\n\t\t\tlanguage.isrighttoleft = true;\r\n\t \t\tbreak;\r\n\t\tcase 'hi':\r\n\t \t\tlanguage.fullname = 'Hindi';\r\n\t\t\tlanguage.pattern = 'hi';\r\n\t \t\tbreak;\r\n\t\tcase 'hr':\r\n\t \t\tlanguage.fullname = 'Croatian';\r\n\t \t\tbreak;\r\n\t\tcase 'hu':\r\n\t \t\tlanguage.fullname = 'Hungarian';\r\n\t\t\tlanguage.pattern = 'hu';\r\n\t \t\tbreak;\r\n\t\tcase 'hy':\r\n\t \t\tlanguage.fullname = 'Armenian';\r\n\t\t\tlanguage.pattern = 'hy';\r\n\t \t\tbreak;\r\n\t\tcase 'id':\r\n\t \t\tlanguage.fullname = 'Indonesian';\r\n\t \t\tbreak;\r\n\t\tcase 'is':\r\n\t \t\tlanguage.fullname = 'Icelandic';\r\n\t \t\tbreak;\r\n\t\tcase 'it':\r\n\t \t\tlanguage.fullname = 'Italian';\r\n\t\t\tlanguage.pattern = 'it';\r\n\t \t\tbreak;\r\n\t\tcase 'ja':\r\n\t \t\tlanguage.fullname = 'Japanese';\r\n\t \t\tbreak;\r\n\t\tcase 'ka':\r\n\t \t\tlanguage.fullname = 'Georgian';\r\n\t \t\tbreak;\r\n\t\tcase 'kk':\r\n\t \t\tlanguage.fullname = 'Kazakh';\r\n\t \t\tbreak;\r\n\t\tcase 'km':\r\n\t \t\tlanguage.fullname = 'Cambodian';\r\n\t \t\tbreak;\r\n\t\tcase 'ko':\r\n\t \t\tlanguage.fullname = 'Korean';\r\n\t \t\tbreak;\r\n\t\tcase 'ku':\r\n\t \t\tlanguage.fullname = 'Kurdish';\r\n\t\t\tlanguage.isrighttoleft = true;\r\n\t \t\tbreak;\r\n\t\tcase 'ky':\r\n\t \t\tlanguage.fullname = 'Kyrgyz';\r\n\t \t\tbreak;\r\n\t\tcase 'la':\r\n\t \t\tlanguage.fullname = 'Latin';\r\n\t\t\tlanguage.pattern = 'la';\r\n\t \t\tbreak;\r\n\t\tcase 'lt':\r\n\t \t\tlanguage.fullname = 'Lithuanian';\r\n\t\t\tlanguage.pattern = 'lt';\r\n\t \t\tbreak;\r\n\t\tcase 'lv':\r\n\t \t\tlanguage.fullname = 'Latvian';\r\n\t\t\tlanguage.pattern = 'lv';\r\n\t \t\tbreak;\r\n\t\tcase 'mg':\r\n\t \t\tlanguage.fullname = 'Malagasy';\r\n\t \t\tbreak;\r\n\t\tcase 'mk':\r\n\t \t\tlanguage.fullname = 'Macedonian';\r\n\t \t\tbreak;\r\n\t\tcase 'ml':\r\n\t \t\tlanguage.fullname = 'Malayalam';\r\n\t\t\tlanguage.pattern = 'ml';\r\n\t \t\tbreak;\r\n\t\tcase 'mn':\r\n\t \t\tlanguage.fullname = 'Mongolian';\r\n\t \t\tbreak;\r\n\t\tcase 'mr':\r\n\t \t\tlanguage.fullname = 'Marathi';\r\n\t \t\tbreak;\r\n\t\tcase 'ms':\r\n\t \t\tlanguage.fullname = 'Malay';\r\n\t \t\tbreak;\r\n\t\tcase 'nd':\r\n\t \t\tlanguage.fullname = 'Ndebele';\r\n\t \t\tbreak;\r\n\t\tcase 'ne':\r\n\t \t\tlanguage.fullname = 'Nepali';\r\n\t \t\tbreak;\r\n\t\tcase 'nl':\r\n\t \t\tlanguage.fullname = 'Dutch';\r\n\t\t\tlanguage.pattern = 'nl';\r\n\t \t\tbreak;\r\n\t\tcase 'nn':\r\n\t \t\tlanguage.fullname = 'Nynorsk';\r\n\t \t\tbreak;\r\n\t\tcase 'no':\r\n\t \t\tlanguage.fullname = 'Norwegian';\r\n\t\t\tlanguage.pattern = 'nb-no';\r\n\t \t\tbreak;\r\n\t\tcase 'nso':\r\n\t \t\tlanguage.fullname = 'Sepedi';\r\n\t \t\tbreak;\r\n\t\tcase 'pa':\r\n\t \t\tlanguage.fullname = 'Punjabi';\r\n\t\t\tlanguage.isrighttoleft = true;\r\n\t\t\tlanguage.pattern = 'pa';\r\n\t \t\tbreak;\r\n\t\tcase 'pl':\r\n\t \t\tlanguage.fullname = 'Polish';\r\n\t\t\tlanguage.pattern = 'pl';\r\n\t \t\tbreak;\r\n\t\tcase 'ps':\r\n\t \t\tlanguage.fullname = 'Pashto';\r\n\t\t\tlanguage.isrighttoleft = true;\r\n\t \t\tbreak;\r\n\t\tcase 'pt':\r\n\t \t\tlanguage.fullname = 'Portuguese';\r\n\t\t\tlanguage.pattern = 'pt';\r\n\t \t\tbreak;\r\n\t\tcase 'pt_PT':\r\n\t \t\tlanguage.fullname = 'Portuguese (Portugal)';\r\n\t\t\tlanguage.pattern = 'pt';\r\n\t \t\tbreak;\r\n\t\tcase 'pt_BR':\r\n\t \t\tlanguage.fullname = 'Portuguese (Brazil)';\r\n\t\t\tlanguage.pattern = 'pt';\r\n\t \t\tbreak;\r\n\t\tcase 'ro':\r\n\t \t\tlanguage.fullname = 'Romanian';\r\n\t \t\tbreak;\r\n\t\tcase 'ru':\r\n\t \t\tlanguage.fullname = 'Russian';\r\n\t\t\tlanguage.pattern = 'ru';\r\n\t \t\tbreak;\r\n\t\tcase 'sa':\r\n\t \t\tlanguage.fullname = 'Sanskrit';\r\n\t \t\tbreak;\r\n\t\tcase 'sh':\r\n\t \t\tlanguage.fullname = 'Serbo-Croatian';\r\n\t \t\tbreak;\r\n\t\tcase 'sk':\r\n\t \t\tlanguage.fullname = 'Slovak';\r\n\t\t\tlanguage.pattern = 'sk';\r\n\t\t\tlanguage.isrighttoleft = false;\r\n\t \t\tbreak;\r\n\t\tcase 'sl':\r\n\t \t\tlanguage.fullname = 'Slovene';\r\n\t\t\tlanguage.pattern = 'sl';\r\n\t \t\tbreak;\r\n\t\tcase 'so':\r\n\t \t\tlanguage.fullname = 'Somali';\r\n\t \t\tbreak;\r\n\t\tcase 'sq':\r\n\t \t\tlanguage.fullname = 'Albanian';\r\n\t \t\tbreak;\r\n\t\tcase 'sr':\r\n\t \t\tlanguage.fullname = 'Serbian';\r\n\t \t\tbreak;\r\n\t\tcase 'sv':\r\n\t \t\tlanguage.fullname = 'Swedish';\r\n\t\t\tlanguage.pattern = 'sv';\r\n\t \t\tbreak;\r\n\t\tcase 'sw':\r\n\t \t\tlanguage.fullname = 'Swahili';\r\n\t \t\tbreak;\r\n\t\tcase 'ta':\r\n\t \t\tlanguage.fullname = 'Tamil';\r\n\t\t\tlanguage.pattern = 'ta';\r\n\t \t\tbreak;\r\n\t\tcase 'te':\r\n\t \t\tlanguage.fullname = 'Telugu';\r\n\t\t\tlanguage.pattern = 'te';\r\n\t \t\tbreak;\r\n\t\tcase 'th':\r\n\t \t\tlanguage.fullname = 'Thai';\r\n\t \t\tbreak;\r\n\t\tcase 'tl':\r\n\t \t\tlanguage.fullname = 'Tagalog';\r\n\t \t\tbreak;\r\n\t\tcase 'tlh':\r\n\t \t\tlanguage.fullname = 'Klingon';\r\n\t \t\tbreak;\r\n\t\tcase 'tn':\r\n\t \t\tlanguage.fullname = 'Setswana';\r\n\t \t\tbreak;\r\n\t\tcase 'tr':\r\n\t \t\tlanguage.fullname = 'Turkish';\r\n\t\t\tlanguage.pattern = 'tr';\r\n\t \t\tbreak;\r\n\t\tcase 'ts':\r\n\t \t\tlanguage.fullname = 'Tsonga';\r\n\t \t\tbreak;\r\n\t\tcase 'tw':\r\n\t \t\tlanguage.fullname = 'Tiwi';\r\n\t \t\tbreak;\r\n\t\tcase 'uk':\r\n\t \t\tlanguage.fullname = 'Ukrainian';\r\n\t\t\tlanguage.pattern = 'uk';\r\n\t \t\tbreak;\r\n\t\tcase 'ur':\r\n\t \t\tlanguage.fullname = 'Urdu';\r\n\t\t\tlanguage.isrighttoleft = true;\r\n\t \t\tbreak;\r\n\t\tcase 'uz':\r\n\t \t\tlanguage.fullname = 'Uzbek';\r\n\t \t\tbreak;\r\n\t\tcase 've':\r\n\t \t\tlanguage.fullname = 'Venda';\r\n\t \t\tbreak;\r\n\t\tcase 'vi':\r\n\t \t\tlanguage.fullname = 'Vietnamese';\r\n\t \t\tbreak;\r\n\t\tcase 'xh':\r\n\t \t\tlanguage.fullname = 'Xhosa';\r\n\t \t\tbreak;\r\n\t\tcase 'zh':\r\n\t \t\tlanguage.fullname = 'Chinese';\r\n\t \t\tbreak;\r\n\t\tcase 'zh_TW':\r\n\t \t\tlanguage.fullname = 'Traditional Chinese (Taiwan)';\r\n\t \t\tbreak;\r\n\t\tdefault:\r\n\t \t\tlanguage.fullname = \"\";\r\n\t}\r\n\t\r\n\t// load the pattern script\r\n\tvar patternJS = '../lib/guess_language/language_patterns/' + language.pattern + '.js'\r\n\t$.ajax({\r\n\t\tasync: false,\r\n\t \turl: patternJS,\r\n\t \tdataType: \"script\"\r\n\t});\r\n\r\n\treturn language;\r\n}", "function highlight(str, lang) {\n if (lang && hljs.getLanguage(lang)) {\n return hljs.highlight(lang, str, true).value;\n }\n\n return '';\n}", "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n if (!leaveOpen && insideSpan === '') return '';\n if (!classname) return insideSpan;\n\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n\n function doBeginMatch(match) {\n var lexeme = match[0];\n var new_mode = match.rule;\n\n if (new_mode && new_mode.endSameAsBegin) {\n new_mode.endRe = escapeRe( lexeme );\n }\n\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n function doEndMatch(match) {\n var lexeme = match[0];\n var end_mode = endOfMode(top, lexeme);\n if (!end_mode) { return; }\n\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n var lastMatch = {};\n function processLexeme(text_before_match, match) {\n\n var lexeme = match && match[0];\n\n // add non-matched text to the current mode buffer\n mode_buffer += text_before_match;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n if (lastMatch.type==\"begin\" && match.type==\"end\" && lastMatch.index == match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n mode_buffer += value.slice(match.index, match.index + 1)\n return 1;\n }\n lastMatch = match;\n\n if (match.type===\"begin\") {\n return doBeginMatch(match);\n } else if (match.type===\"illegal\" && !ignore_illegals) {\n // illegal match, we do not continue processing\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n } else if (match.type===\"end\") {\n var processed = doEndMatch(match);\n if (processed != undefined)\n return processed;\n }\n\n /*\n Why might be find ourselves here? Only one occasion now. An end match that was\n triggered but could not be completed. When might this happen? When an `endSameasBegin`\n rule sets the end rule to a specific match. Since the overall mode termination rule that's\n being used to scan the text isn't recompiled that means that any match that LOOKS like\n the end (but is not, because it is not an exact match to the beginning) will\n end up here. A definite end match, but when `doEndMatch` tries to \"reapply\"\n the end rule and fails to match, we wind up here, and just silently ignore the end.\n\n This causes no real harm other than stopping a few times too many.\n */\n\n mode_buffer += lexeme;\n return lexeme.length;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n illegal:false,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n illegal: true,\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n if (!leaveOpen && insideSpan === '') return '';\n if (!classname) return insideSpan;\n\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n\n function doBeginMatch(match) {\n var lexeme = match[0];\n var new_mode = match.rule;\n\n if (new_mode && new_mode.endSameAsBegin) {\n new_mode.endRe = escapeRe( lexeme );\n }\n\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n function doEndMatch(match) {\n var lexeme = match[0];\n var end_mode = endOfMode(top, lexeme);\n if (!end_mode) { return; }\n\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n var lastMatch = {};\n function processLexeme(text_before_match, match) {\n\n var lexeme = match && match[0];\n\n // add non-matched text to the current mode buffer\n mode_buffer += text_before_match;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n if (lastMatch.type==\"begin\" && match.type==\"end\" && lastMatch.index == match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n mode_buffer += value.slice(match.index, match.index + 1)\n return 1;\n }\n lastMatch = match;\n\n if (match.type===\"begin\") {\n return doBeginMatch(match);\n } else if (match.type===\"illegal\" && !ignore_illegals) {\n // illegal match, we do not continue processing\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n } else if (match.type===\"end\") {\n var processed = doEndMatch(match);\n if (processed != undefined)\n return processed;\n }\n\n /*\n Why might be find ourselves here? Only one occasion now. An end match that was\n triggered but could not be completed. When might this happen? When an `endSameasBegin`\n rule sets the end rule to a specific match. Since the overall mode termination rule that's\n being used to scan the text isn't recompiled that means that any match that LOOKS like\n the end (but is not, because it is not an exact match to the beginning) will\n end up here. A definite end match, but when `doEndMatch` tries to \"reapply\"\n the end rule and fails to match, we wind up here, and just silently ignore the end.\n\n This causes no real harm other than stopping a few times too many.\n */\n\n mode_buffer += lexeme;\n return lexeme.length;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n illegal:false,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n illegal: true,\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, options) {\n var before = high.configure({})\n var settings = options || {}\n var prefix = settings.prefix\n var result\n\n if (typeof name !== 'string') {\n throw fault('Expected `string` for name, got `%s`', name)\n }\n\n if (!high.getLanguage(name)) {\n throw fault('Unknown language: `%s` is not registered', name)\n }\n\n if (typeof value !== 'string') {\n throw fault('Expected `string` for value, got `%s`', value)\n }\n\n if (prefix === null || prefix === undefined) {\n prefix = defaultPrefix\n }\n\n high.configure({__emitter: Emitter, classPrefix: prefix})\n\n result = high.highlight(name, value, true)\n\n high.configure(before || {})\n\n /* istanbul ignore if - Highlight.js seems to use this (currently) for broken\n * grammars, so let’s keep it in there just to be sure. */\n if (result.errorRaised) {\n throw result.errorRaised\n }\n\n return {\n relevance: result.relevance,\n language: result.language,\n value: result.emitter.rootNode.children\n }\n}", "function localSearchHighlight(searchStr, singleWordSearch, doc) \n{\n var MAX_WORDS = 50; //limit for words to search, if unlimited, browser may crash\n doc = typeof(doc) != 'undefined' ? doc : document;\n \n if (!doc.createElement) \n {\n return;\n }\n \n // Trim leading and trailing spaces after unescaping\n searchstr = unescape(searchStr).replace(/^\\s+|\\s+$/g, \"\");\n \n if( searchStr == '' ) \n {\n return;\n }\n \n //majgis: Single search option\n if(singleWordSearch)\n {\n phrases = searchStr.replace(/\\+/g,' ').split(/\\\"/);\n }\n else\n {\n phrases = [\"\",searchStr];\n }\n \n var hinodes = [];\n colorgen = colorGenerator(singleWordSearch || !clearBetweenSelections);\n \n for(p=0; p < phrases.length; p++) \n {\n phrases[p] = unescape(phrases[p]).replace(/^\\s+|\\s+$/g, \"\");\n \n if( phrases[p] == '' ) \n {\n continue;\n }\n \n if( p % 2 == 0 ) \n {\n words = phrases[p].replace(/([+,()]|%(29|28)|\\W+(AND|OR)\\W+)/g,' ').split(/\\s+/);\n }\n else \n { \n words=Array(1); \n words[0] = phrases[p]; \n }\n \n //limit length to prevent crashing browser\n if (words.length > MAX_WORDS)\n {\n words.splice(MAX_WORDS - 1, phrases.length - MAX_WORDS);\n }\n \n for (w=0; w < words.length; w++) \n {\n if( words[w] == '' ) \n {\n continue;\n }\n \n hinodes = highlightWord(doc.getElementsByTagName(\"body\")[0], words[w], doc);\n }\n }\n \n selection.removeAllRanges();\n var oldSelection = document.getElementById(\"mySelectedSpan\");\n var reselectRange = document.createRange();\n reselectRange.selectNode(oldSelection);\n selection.addRange(reselectRange);\n}", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n function subMode(lexeme, mode) {\n var i, length;\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix, openSpan = '<span class=\"' + classPrefix, closeSpan = leaveOpen ? '' : spanEndTag;\n openSpan += classname + '\">';\n return openSpan + insideSpan + closeSpan;\n }\n function processKeywords() {\n var keyword_match, last_index, match, result;\n if (!top.keywords)\n return escape(mode_buffer);\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n }\n else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n function startNewMode(mode) {\n result += mode.className ? buildSpan(mode.className, '', true) : '';\n top = Object.create(mode, { parent: { value: top } });\n }\n function processLexeme(buffer, lexeme) {\n mode_buffer += buffer;\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n }\n else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n }\n else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts);\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for (current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for (current = top; current.parent; current = current.parent) {\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n }\n catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n }\n else {\n throw e;\n }\n }\n}", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '';\n for(var current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(var current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n };\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '';\n for(var current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(var current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n };\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, top.continuation.top) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n top.continuation.top = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var result = '';\n for(var current = top; current != language; current = current.parent) {\n if (current.className) {\n result += buildSpan(current.className, result, true);\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(var current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n };\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, top.continuation.top) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n top.continuation.top = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var result = '';\n for(var current = top; current != language; current = current.parent) {\n if (current.className) {\n result += buildSpan(current.className, result, true);\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(var current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n };\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "parse(language, code) {\n\n let languageObj = this.languages[language],\n replacementStorage = [],\n replaceKey = this.replacerID,\n keyIncrement = 0,\n regex = this.regex;\n\n if (!languageObj || language === 'ignore') {\n return code;\n }\n\n let {\n matchers,\n keywords,\n specials\n } = languageObj;\n\n // saves instances of '<' and '>'\n let parsedCode = htmlSwap(code);\n\n //Go through the matchers, matching each case\n //if matcher has internal expressions to match, go through those too.\n matchers.forEach(matcherToParse => {\n if(matcherToParse in regex) {\n\n let expression = regex[matcherToParse]\n , internalParse = false;\n\n if(expression.outer) {\n internalParse = expression.inner;\n expression = expression.outer;\n }\n\n parsedCode = parsedCode.replace(expression, match => {\n let uniqueReplacementKey = replaceKey + keyIncrement++;\n\n if( !!internalParse && typeof internalParse === 'object' ) {\n\n for(let internalRegex in internalParse) {\n match = simpleParse(match, internalParse[internalRegex], matcherToParse + '-' + internalRegex);\n }\n\n }\n\n //if this match spans over multiple lines we must make sure our spans are closed and re-opened.\n if(expression.multiline) {\n match = match.replace(/(\\r?\\n)/g, '</span>$1<span class=\"panda-' + matcherToParse + '\">');\n }\n\n replacementStorage.push([ uniqueReplacementKey , spanWrap(matcherToParse, match) ]);\n\n return uniqueReplacementKey;\n })\n\n }\n })\n //all \"matcher\" regular expressions have now been matched and replaced with unique keys.\n\n //match keywords\n if(keywords.length > 0) {\n parsedCode = simpleParse(parsedCode, RegExp('\\\\b(?:' + keywords.join('|') + ')\\\\b', 'g'), 'keyword');\n }\n\n //match all special words\n if(specials.length > 0) {\n parsedCode = simpleParse(parsedCode, RegExp('\\\\b(?:' + specials.join('|') + ')\\\\b', 'g'), 'special');\n }\n\n //replace all integers now that strings are removed?\n parsedCode = parsedCode.replace(regex.int, integer => spanWrap('int', integer))\n\n //replace all unique replacmeents with their counter parts\n for(let i = replacementStorage.length, token; (token = replacementStorage[--i]); ) {\n parsedCode = parsedCode.replace( token[0], token[1] );\n }\n\n //add line numbers\n parsedCode = specialCharacters(parsedCode);\n parsedCode = addLines(parsedCode);\n\n\n return parsedCode;\n\n }", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "identifyLanguage(codeElement) {\n let regex = /(?:\\s|^)panda[_-](\\w+)(?:\\s|$)/;\n\n if (regex.test(codeElement.className)) {\n return regex.exec(codeElement.className)[1];\n }\n\n return 'default'\n }", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';');\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className ? buildSpan(mode.className, '', true) : '';\n top = Object.create(mode, { parent: { value: top } });\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for (current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for (current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function highlight(language, value, options) {\n var settings = options || {}\n var prefix = settings.prefix\n\n if (prefix === null || prefix === undefined) {\n prefix = defaultPrefix\n }\n\n return normalize(coreHighlight(language, value, true, prefix))\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n var prefix = match[1],\n suffix = match[2],\n full = prefix;\n if (suffix) full += \"-\" + suffix;\n var q = 1;\n\n if (match[3]) {\n var params = match[3].split(';');\n\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1]\n var suffix = match[2]\n var full = prefix\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1];\n var suffix = match[2];\n var full = prefix;\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';');\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}", "function parseLanguage(str,i){var match=simpleLanguageRegExp.exec(str);if(!match)return null;var prefix=match[1],suffix=match[2],full=prefix;if(suffix)full+=\"-\"+suffix;var q=1;if(match[3]){var params=match[3].split(';');for(var i=0;i<params.length;i++){var p=params[i].split('=');if(p[0]==='q')q=parseFloat(p[1]);}}return{prefix:prefix,suffix:suffix,q:q,i:i,full:full};}", "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t for (var i = 0; i < mode.contains.length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : '</span>';\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\t var result = '';\n\t var last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t var match = top.lexemesRe.exec(mode_buffer);\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t var keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage == 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n\t }\n\n\t function startNewMode(mode, lexeme) {\n\t var markup = mode.className? buildSpan(mode.className, '', true): '';\n\t if (mode.returnBegin) {\n\t result += markup;\n\t mode_buffer = '';\n\t } else if (mode.excludeBegin) {\n\t result += escape(lexeme) + markup;\n\t mode_buffer = '';\n\t } else {\n\t result += markup;\n\t mode_buffer = lexeme;\n\t }\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\t if (lexeme === undefined) {\n\t result += processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t result += processBuffer();\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t result += processBuffer();\n\t do {\n\t if (top.className) {\n\t result += '</span>';\n\t }\n\t relevance += top.relevance;\n\t top = top.parent;\n\t } while (top != end_mode.parent);\n\t if (origin.excludeEnd) {\n\t result += escape(lexeme);\n\t }\n\t mode_buffer = '';\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current != language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += '</span>';\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message.indexOf('Illegal') != -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t for (var i = 0; i < mode.contains.length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : '</span>';\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\t var result = '';\n\t var last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t var match = top.lexemesRe.exec(mode_buffer);\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t var keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage == 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n\t }\n\n\t function startNewMode(mode, lexeme) {\n\t var markup = mode.className? buildSpan(mode.className, '', true): '';\n\t if (mode.returnBegin) {\n\t result += markup;\n\t mode_buffer = '';\n\t } else if (mode.excludeBegin) {\n\t result += escape(lexeme) + markup;\n\t mode_buffer = '';\n\t } else {\n\t result += markup;\n\t mode_buffer = lexeme;\n\t }\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\t if (lexeme === undefined) {\n\t result += processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t result += processBuffer();\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t result += processBuffer();\n\t do {\n\t if (top.className) {\n\t result += '</span>';\n\t }\n\t relevance += top.relevance;\n\t top = top.parent;\n\t } while (top != end_mode.parent);\n\t if (origin.excludeEnd) {\n\t result += escape(lexeme);\n\t }\n\t mode_buffer = '';\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current != language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += '</span>';\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message.indexOf('Illegal') != -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t for (var i = 0; i < mode.contains.length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : '</span>';\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\t var result = '';\n\t var last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t var match = top.lexemesRe.exec(mode_buffer);\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t var keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage == 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n\t }\n\n\t function startNewMode(mode, lexeme) {\n\t var markup = mode.className? buildSpan(mode.className, '', true): '';\n\t if (mode.returnBegin) {\n\t result += markup;\n\t mode_buffer = '';\n\t } else if (mode.excludeBegin) {\n\t result += escape(lexeme) + markup;\n\t mode_buffer = '';\n\t } else {\n\t result += markup;\n\t mode_buffer = lexeme;\n\t }\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\t if (lexeme === undefined) {\n\t result += processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t result += processBuffer();\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t result += processBuffer();\n\t do {\n\t if (top.className) {\n\t result += '</span>';\n\t }\n\t relevance += top.relevance;\n\t top = top.parent;\n\t } while (top != end_mode.parent);\n\t if (origin.excludeEnd) {\n\t result += escape(lexeme);\n\t }\n\t mode_buffer = '';\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current != language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += '</span>';\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message.indexOf('Illegal') != -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t for (var i = 0; i < mode.contains.length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : '</span>';\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\t var result = '';\n\t var last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t var match = top.lexemesRe.exec(mode_buffer);\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t var keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage == 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n\t }\n\n\t function startNewMode(mode, lexeme) {\n\t var markup = mode.className? buildSpan(mode.className, '', true): '';\n\t if (mode.returnBegin) {\n\t result += markup;\n\t mode_buffer = '';\n\t } else if (mode.excludeBegin) {\n\t result += escape(lexeme) + markup;\n\t mode_buffer = '';\n\t } else {\n\t result += markup;\n\t mode_buffer = lexeme;\n\t }\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\t if (lexeme === undefined) {\n\t result += processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t result += processBuffer();\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t result += processBuffer();\n\t do {\n\t if (top.className) {\n\t result += '</span>';\n\t }\n\t relevance += top.relevance;\n\t top = top.parent;\n\t } while (top != end_mode.parent);\n\t if (origin.excludeEnd) {\n\t result += escape(lexeme);\n\t }\n\t mode_buffer = '';\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current != language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += '</span>';\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message.indexOf('Illegal') != -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "function selectLanguage(lang) {\n var loweredLang = (lang === null || lang === void 0 ? void 0 : lang.toLowerCase()) || '';\n var _a = checkIncludingDiff(loweredLang), isDiff = _a.isDiff, langNormalized = _a.lang;\n var langAlias = fallbackLanguages[langNormalized];\n var langToUse = langAlias || langNormalized;\n var prismLang = loadPrismLang(langToUse);\n return {\n langToUse: langToUse,\n grammer: prismLang,\n isDiff: isDiff,\n };\n}", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className ? buildSpan(mode.className, '', true) : '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {\n parent: {\n value: top\n }\n });\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '',\n current;\n for (current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for (current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function highlightBlock(block, tabReplace, useBR) {\n var text = blockText(block, useBR);\n var language = blockLanguage(block);\n var result, pre;\n if (language == 'no-highlight')\n return;\n if (language) {\n result = highlight(language, text);\n } else {\n result = highlightAuto(text);\n language = result.language;\n }\n var original = nodeStream(block);\n if (original.length) {\n pre = document.createElement('pre');\n pre.innerHTML = result.value;\n result.value = mergeStreams(original, nodeStream(pre), text);\n }\n result.value = fixMarkup(result.value, tabReplace, useBR);\n\n var class_name = block.className;\n if (!class_name.match('(\\\\s|^)(language-)?' + language + '(\\\\s|$)')) {\n class_name = class_name ? (class_name + ' ' + language) : language;\n }\n if (is_old_IE && block.tagName == 'CODE' && block.parentNode.tagName == 'PRE') {\n // This is for backwards compatibility only. IE needs this strange\n // hack becasue it cannot just cleanly replace <code> block contents.\n pre = block.parentNode;\n var container = document.createElement('div');\n container.innerHTML = '<pre><code>' + result.value + '</code></pre>';\n block = container.firstChild.firstChild;\n container.firstChild.className = pre.className;\n pre.parentNode.replaceChild(container.firstChild, pre);\n } else {\n block.innerHTML = result.value;\n }\n block.className = class_name;\n block.result = {\n language: language,\n kw: result.keyword_count,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n kw: result.second_best.keyword_count,\n re: result.second_best.relevance\n };\n }\n }", "function highlightSyntax(targetDocument, syntaxHighlighter, codeText, codeLanguage) {\n var codeElem, preElem, textNode;\n\n // highlight.js requires a `<code>` element to be passed in that has a\n // `<pre>` parent element.\n\n preElem = targetDocument.createElement('pre');\n codeElem = targetDocument.createElement('code');\n textNode = targetDocument.createTextNode(codeText);\n codeElem.appendChild(textNode);\n preElem.appendChild(codeElem);\n\n // If we're told the language, set it as a class so that the highlighter\n // doesn't have to guess it. This is part of the HTML5 standard. See:\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-code-element\n if (codeLanguage && codeLanguage.length > 0) {\n codeElem.setAttribute('class', 'language-'+codeLanguage);\n }\n else {\n codeElem.setAttribute('class', 'no-highlight');\n }\n\n syntaxHighlighter.highlightBlock(codeElem);\n\n return codeElem.innerHTML;\n }", "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t var i, length;\n\n\t for (i = 0, length = mode.contains.length; i < length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : spanEndTag\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t var keyword_match, last_index, match, result;\n\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\n\t result = '';\n\t last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t match = top.lexemesRe.exec(mode_buffer);\n\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage === 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n\t mode_buffer = '';\n\t }\n\n\t function startNewMode(mode) {\n\t result += mode.className? buildSpan(mode.className, '', true): '';\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\n\t if (lexeme == null) {\n\t processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t if (new_mode.skip) {\n\t mode_buffer += lexeme;\n\t } else {\n\t if (new_mode.excludeBegin) {\n\t mode_buffer += lexeme;\n\t }\n\t processBuffer();\n\t if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n\t mode_buffer = lexeme;\n\t }\n\t }\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (origin.skip) {\n\t mode_buffer += lexeme;\n\t } else {\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t processBuffer();\n\t if (origin.excludeEnd) {\n\t mode_buffer = lexeme;\n\t }\n\t }\n\t do {\n\t if (top.className) {\n\t result += spanEndTag;\n\t }\n\t if (!top.skip) {\n\t relevance += top.relevance;\n\t }\n\t top = top.parent;\n\t } while (top !== end_mode.parent);\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current !== language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += spanEndTag;\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message && e.message.indexOf('Illegal') !== -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.c.length; i++) {\n if (testRe(mode.c[i].bR, lexeme)) {\n return mode.c[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.eR, lexeme)) {\n return mode;\n }\n if (mode.eW) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.iR, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.cI ? match[0].toLowerCase() : match[0];\n return mode.k.hasOwnProperty(match_str) && mode.k[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.k)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lR.lastIndex = 0;\n var match = top.lR.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n r += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lR.lastIndex;\n match = top.lR.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.sL && !languages[top.sL]) {\n return escape(mode_buffer);\n }\n var result = top.sL ? highlight(top.sL, mode_buffer, true, top.continuation.top) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode r. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.r > 0) {\n r += result.r;\n }\n if (top.subLanguageMode == 'continuous') {\n top.continuation.top = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.sL !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.cN? buildSpan(mode.cN, '', true): '';\n if (mode.rB) {\n result += markup;\n mode_buffer = '';\n } else if (mode.eB) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.rB ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.rE || origin.eE)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.cN) {\n result += '</span>';\n }\n r += top.r;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.eE) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.rE ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.cN || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var result = '';\n for(var current = top; current != language; current = current.parent) {\n if (current.cN) {\n result += buildSpan(current.cN, result, true);\n }\n }\n var mode_buffer = '';\n var r = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.t.lastIndex = index;\n match = top.t.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(var current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.cN) {\n result += '</span>';\n }\n };\n return {\n r: r,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n r: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "function parseLanguage(str, i) {\n\t var match = simpleLanguageRegExp.exec(str);\n\t if (!match) return null;\n\n\t var prefix = match[1],\n\t suffix = match[2],\n\t full = prefix;\n\n\t if (suffix) full += \"-\" + suffix;\n\n\t var q = 1;\n\t if (match[3]) {\n\t var params = match[3].split(';')\n\t for (var i = 0; i < params.length; i ++) {\n\t var p = params[i].split('=');\n\t if (p[0] === 'q') q = parseFloat(p[1]);\n\t }\n\t }\n\n\t return {\n\t prefix: prefix,\n\t suffix: suffix,\n\t q: q,\n\t i: i,\n\t full: full\n\t };\n\t}", "function l(e,a,r,f){function o(e,t){var a,r;for(a=0,r=t.contains.length;a<r;a++)if(n(t.contains[a].beginRe,e))return t.contains[a]}function i(e,t){if(n(e.endRe,t)){for(;e.endsParent&&e.parent;)e=e.parent;return e}if(e.endsWithParent)return i(e.parent,t)}function s(e,t){return!r&&n(t.illegalRe,e)}function c(e,t){var a=y.case_insensitive?t[0].toLowerCase():t[0];return e.keywords.hasOwnProperty(a)&&e.keywords[a]}function _(e,t,a,n){var r=n?\"\":O.classPrefix,f='<span class=\"'+r,o=a?\"\":M;return(f+=e+'\">')+t+o}function m(){var e,a,n,r;if(!x.keywords)return t(k);for(r=\"\",a=0,x.lexemesRe.lastIndex=0,n=x.lexemesRe.exec(k);n;)r+=t(k.substring(a,n.index)),e=c(x,n),e?(T+=e[1],r+=_(e[0],t(n[0]))):r+=t(n[0]),a=x.lexemesRe.lastIndex,n=x.lexemesRe.exec(k);return r+t(k.substr(a))}function p(){var e=\"string\"==typeof x.subLanguage;if(e&&!S[x.subLanguage])return t(k);var a=e?l(x.subLanguage,k,!0,E[x.subLanguage]):d(k,x.subLanguage.length?x.subLanguage:void 0);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n return x.relevance>0&&(T+=a.relevance),e&&(E[x.subLanguage]=a.top),_(a.language,a.value,!1,!0)}function g(){C+=null!=x.subLanguage?p():m(),k=\"\"}function h(e){C+=e.className?_(e.className,\"\",!0):\"\",x=Object.create(e,{parent:{value:x}})}function b(e,t){if(k+=e,null==t)return g(),0;var a=o(t,x);if(a)return a.skip?k+=t:(a.excludeBegin&&(k+=t),g(),a.returnBegin||a.excludeBegin||(k=t)),h(a,t),a.returnBegin?0:t.length;var n=i(x,t);if(n){var r=x;r.skip?k+=t:(r.returnEnd||r.excludeEnd||(k+=t),g(),r.excludeEnd&&(k=t));do{x.className&&(C+=M),x.skip||(T+=x.relevance),x=x.parent}while(x!==n.parent);return n.starts&&h(n.starts,\"\"),r.returnEnd?0:t.length}if(s(t,x))throw new Error('Illegal lexeme \"'+t+'\" for mode \"'+(x.className||\"<unnamed>\")+'\"');/*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n return k+=t,t.length||1}var y=w(e);if(!y)throw new Error('Unknown language: \"'+e+'\"');u(y);var v,x=f||y,E={},C=\"\";for(v=x;v!==y;v=v.parent)v.className&&(C=_(v.className,\"\",!0)+C);var k=\"\",T=0;try{for(var N,D,A=0;;){if(x.terminators.lastIndex=A,!(N=x.terminators.exec(a)))break;D=b(a.substring(A,N.index),N[0]),A=N.index+D}for(b(a.substr(A)),v=x;v.parent;v=v.parent)// close dangling modes\n v.className&&(C+=M);return{relevance:T,value:C,language:e,top:x}}catch(e){if(e.message&&-1!==e.message.indexOf(\"Illegal\"))return{relevance:0,value:t(a)};throw e}}", "function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string'\n var subvalue\n\n /* istanbul ignore if - support non-loaded sublanguages */\n if (explicit && !languages[top.subLanguage]) {\n return addText(modeBuffer, [])\n }\n\n if (explicit) {\n subvalue = coreHighlight(\n top.subLanguage,\n modeBuffer,\n true,\n prefix,\n continuations[top.subLanguage]\n )\n } else {\n subvalue = autoHighlight(modeBuffer, {\n subset: top.subLanguage.length === 0 ? undefined : top.subLanguage,\n prefix: prefix\n })\n }\n\n // If we couldn’t highlight, for example because the requests subset isn’t\n // loaded, return a text node.\n if (!subvalue.language) {\n return [buildText(modeBuffer)]\n }\n\n // Counting embedded language score towards the host language may be\n // disabled with zeroing the containing mode relevance.\n // Usecase in point is Markdown that allows XML everywhere and makes every\n // XML snippet to have a much larger Markdown score.\n if (top.relevance > 0) {\n relevance += subvalue.relevance\n }\n\n if (explicit) {\n continuations[top.subLanguage] = subvalue.top\n }\n\n return [build(subvalue.language, subvalue.value, true)]\n }", "function highlight() {\n var code_blocks = document.body.getElementsByClassName(\"language-c\");\n var keywords = [\n \"auto\", \"break\", \"case\", \"char\", \"const\", \"continue\", \"default\",\n \"do\", \"double\", \"else\", \"enum\", \"extern\", \"float\", \"for\", \"goto\",\n \"if\", \"inline\", \"int\", \"long\", \"register\", \"restrict\", \"return\",\n \"short\", \"signed\", \"sizeof\", \"static\", \"struct\", \"switch\",\n \"typedef\", \"union\", \"unsigned\", \"void\", \"volatile\", \"while\",\n ];\n var regex_var = /\\b[A-z][A-z0-9]*/;\n var regex_number = /\\b0[xX][0-9a-fA-F]+\\b|\\b[0-9]*\\.[0-9]+\\b|\\b[0-9]*\\b/;\n var regex_string = /\"[^\"]*\"/;\n var regex_symbol = /&gt;|&lt;|\\ |\\(|\\)|;|-/;\n for (var i = 0; i < code_blocks.length; i++) {\n var element = code_blocks.item(i);\n var code_lines = element.innerHTML.split('\\n');\n var cursor = 0;\n\n var parts = [];\n var insert_index = 0;\n function insert_at(index, insertable) {\n if (index < insert_index) console.error(\"inserting before last insert!!\");\n parts.push(element.innerHTML.substr(insert_index, index - insert_index));\n parts.push(insertable);\n insert_index = index;\n }\n\n var in_block_comment = false;\n\n for (var j = 0; j < code_lines.length; j++) {\n var words = code_lines[j].split(regex_symbol);\n var in_line_comment = false;\n\n for (var k = 0; k < words.length; k++) {\n var word = words[k];\n\n // Special case for < and >, because they're escaped in\n // innerHTML.\n var to_be_processed_html = element.innerHTML.substr(cursor);\n if (to_be_processed_html.startsWith(\"lt;\") ||\n to_be_processed_html.startsWith(\"gt;\")) {\n cursor += 3;\n }\n\n if (in_block_comment) {\n if (word == \"*/\") {\n in_block_comment = false;\n insert_at(cursor + word.length, \"</span>\"); // close comment block\n }\n } else {\n if (!in_line_comment) {\n if (word == \"//\") {\n in_line_comment = true;\n insert_at(cursor, \"<span class='syntax-comment'>\"); // open comment line\n }\n if (word == \"/*\") {\n in_block_comment = true;\n insert_at(cursor, \"<span class='syntax-comment'>\"); // open comment block\n }\n }\n\n if (!in_line_comment && !in_block_comment) {\n if (keywords.indexOf(word) != -1) {\n insert_at(cursor, \"<span class='syntax-keyword'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_string.test(word)) {\n insert_at(cursor, \"<span class='syntax-string'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_var.test(word) && element.innerHTML.substr(cursor + word.length, 1) == \"(\") {\n insert_at(cursor, \"<span class='syntax-call'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_var.test(word)) {\n insert_at(cursor, \"<span class='syntax-variable'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_number.test(word)) {\n insert_at(cursor, \"<span class='syntax-number'>\");\n insert_at(cursor + word.length, \"</span>\");\n }\n }\n }\n\n cursor += word.length + 1;\n }\n\n if (in_line_comment) {\n insert_at(cursor, \"</span>\"); // close comment line\n }\n }\n\n parts.push(element.innerHTML.substr(insert_index));\n element.innerHTML = parts.join('');\n\n // When processing, using &lt; and &gt; is forced upon us. Now we\n // can fix that to allow for good copypasting.\n element.innerHTML.replace(/&lt;/g, \"<\");\n element.innerHTML.replace(/&gt;/g, \">\");\n }\n}", "function highlightBlock(block) {\n var language = blockLanguage(block);\n if (/no(-?)highlight/.test(language))\n return;\n\n var node;\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n var text = node.textContent;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n var originalStream = nodeStream(node);\n if (originalStream.length) {\n var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var language = blockLanguage(block);\n if (/no(-?)highlight/.test(language))\n return;\n\n var node;\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n var text = node.textContent;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n var originalStream = nodeStream(node);\n if (originalStream.length) {\n var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }" ]
[ "0.70028955", "0.70028955", "0.70028955", "0.70028955", "0.70028955", "0.70028955", "0.70028955", "0.6996582", "0.6996582", "0.6996582", "0.6996582", "0.6996582", "0.6996582", "0.6996582", "0.6996582", "0.69835204", "0.6980433", "0.697656", "0.697656", "0.697656", "0.697656", "0.6960124", "0.6912293", "0.69112563", "0.6858613", "0.68554795", "0.6775404", "0.65848446", "0.6281799", "0.62051713", "0.5952109", "0.5911424", "0.5818432", "0.5802331", "0.57326525", "0.5711243", "0.5657164", "0.5657164", "0.56175375", "0.5536817", "0.55000955", "0.55000955", "0.55000955", "0.54911304", "0.54911304", "0.54911304", "0.54911304", "0.54911304", "0.54911304", "0.54906046", "0.5485625", "0.5485625", "0.5485625", "0.5485625", "0.5471976", "0.5471976", "0.546539", "0.54056555", "0.54056555", "0.54056555", "0.54056555", "0.54056555", "0.54056555", "0.54056555", "0.54056555", "0.5403043", "0.53903264", "0.5382399", "0.53816885", "0.53816885", "0.53816885", "0.53816885", "0.53816885", "0.53816885", "0.53816885", "0.5375145", "0.5374337", "0.537088", "0.5369949", "0.53677815", "0.5367199", "0.5367199", "0.5367199", "0.5367199", "0.53657085", "0.536453", "0.5342949", "0.5333095", "0.5320314", "0.5313133", "0.52697104", "0.5232515", "0.52238345", "0.5169447", "0.5166136", "0.5166136" ]
0.6820056
29
Postprocessing of the highlighted markup: replace TABs with something more useful replace real linebreaks with '' for nonpre containers
function fixMarkup(value) { return !(options.tabReplace || options.useBR) ? value : value.replace(fixMarkupRe, function(match, p1) { if (options.useBR && match === '\n') { return '<br>'; } else if (options.tabReplace) { return p1.replace(/\t/g, options.tabReplace); } return ''; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixMarkup(value) {\n\t if (options.tabReplace) {\n\t value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1 /*..., offset, s*/) {\n\t return p1.replace(/\\t/g, options.tabReplace);\n\t });\n\t }\n\t if (options.useBR) {\n\t value = value.replace(/\\n/g, '<br>');\n\t }\n\t return value;\n\t }", "function fixMarkup(value) {\n\t if (options.tabReplace) {\n\t value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1 /*..., offset, s*/) {\n\t return p1.replace(/\\t/g, options.tabReplace);\n\t });\n\t }\n\t if (options.useBR) {\n\t value = value.replace(/\\n/g, '<br>');\n\t }\n\t return value;\n\t }", "function fixMarkup(value) {\n\t if (options.tabReplace) {\n\t value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1 /*..., offset, s*/) {\n\t return p1.replace(/\\t/g, options.tabReplace);\n\t });\n\t }\n\t if (options.useBR) {\n\t value = value.replace(/\\n/g, '<br>');\n\t }\n\t return value;\n\t }", "function fixMarkup(value) {\n\t if (options.tabReplace) {\n\t value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1 /*..., offset, s*/) {\n\t return p1.replace(/\\t/g, options.tabReplace);\n\t });\n\t }\n\t if (options.useBR) {\n\t value = value.replace(/\\n/g, '<br>');\n\t }\n\t return value;\n\t }", "function regularSyntaxColoringAndAutoIndent(event){\n\n \t\tvar sbwin = Chickenfoot.getSidebarWindow(chromeWindow);\n \tvar ed = sbwin.getSelectedBuffer().editor;\n \tvar doc = ed.contentDocument;\n \tvar pre = doc.getElementById(\"pre\"); \n \tvar anchorNodeCaret = sbwin.getSelectedBuffer().api.selection.anchorNode;\n \tvar anchorOffsetCaret = sbwin.getSelectedBuffer().api.selection.anchorOffset;\n \t\n \t//count characters\n \tvar chars=0;\n \t/*\n \tif (event.keyCode ==13 & anchorNodeCaret.nodeName==\"SPAN\") {\n \t\tdebug(\"charCount SPAN BR\");\n \t\tchars=charCountSpanBr(anchorNodeCaret,pre.childNodes);\n \t}else{\n \t\tchars=charCount(anchorNodeCaret,anchorOffsetCaret,pre.childNodes);\n \t}*/\n \tchars=charCount(anchorNodeCaret,anchorOffsetCaret,pre.childNodes);\n \t\n \t//eliminate spans, specifically:\n \t//<span style=\"color: blue;\">\n \t//<span style=\"color: purple;\">\n\t\t//<span style=\"color: green;\">\n\t\t//</span>\n\t\t\n\t\tvar spanRegEx = /(<span style=\"color: purple;\">|<span style=\"color: blue;\">|<span style=\"color: green;\">|<\\/span>)/gm;\n \t\n \tpre.innerHTML=pre.innerHTML.replace(spanRegEx,\"\");\n \t//recolor\n \tsyntaxColor(pre, CF_JAVASCRIPT_RULES); \n \t\n\t\t//replace caret\n\t\tcaretPlacement(chars,pre,sbwin);\n\t\t\n\t\t//autoIndent : only on return, } , and ctrl+tab\n \tvar pre2 = doc.getElementById(\"pre\"); \n \t//debug('event.keyCode');\n \t//debug(event.keyCode);\n \t//if(false){\n \tif(event.keyCode==13||event.keyCode==221||(event.ctrlKey && event.keyCode==9)){\n \t\tvar lines = makeLines(pre2);\n \t\t//debug('lines');\n \t\t//debug(lines);\n \t\tfor (i in lines){\n \t\t//debug(lines[i]);\n \t\t}\n \t\tvar anchorNodeCaret2 = sbwin.getSelectedBuffer().api.selection.focusNode;\n \t\tvar anchorOffsetCaret2 = sbwin.getSelectedBuffer().api.selection.focusOffset;\n \t\t\tvar lineNum=findNodeInLines(lines,anchorNodeCaret2,anchorOffsetCaret2);\n \t\t\t//debug('lineNum= '+lineNum);\n\t\t\t//this is how many spaces we need to indent our line by\n\t\t\t\n\t\t\tif (lines[lineNum][0].parentNode.nodeName==\"SPAN\"){\n\t\t\t\t//do nothing\n\t\t\t\t//debug('inside a span node, dont change indent');\n\t\t\t}else{\n\t\t\t\tvar indents=calculateIndents(lines,lineNum);\n\t\t\t\t\n\t\t\t\t//debug('INDENTS: '+indents)\n\t\t\t\t/*\n\t\t\t\tdebug(\"event.keycode\");\n\t\t\t\tdebug(lines[lineNum]);\n\t\t\t\tdebug(doc);\n\t\t\t\tdebug(pre);\n\t\t\t\tdebug(sbwin);\n\t\t\t\tdebug(anchorNodeCaret2);\n\t\t\t\tdebug(anchorOffsetCaret2);\n\t\t\t\tdebug(\"event.keycode\");\n\t\t\t\t*/\n\t\t\t\t//debug(\"changeIndent\");\n\t\t\t\tchangeIndent(lines[lineNum],indents,doc,pre,sbwin,anchorNodeCaret2,anchorOffsetCaret2);\n\t\t\t}\n\t\t}\n\t\t/*\n\t\tvar pre2 = doc.getElementById(\"pre\"); \n \tvar anchorNodeCaret2 = sbwin.getSelectedBuffer().api.selection.focusNode;\n \tvar anchorOffsetCaret2 = sbwin.getSelectedBuffer().api.selection.focusOffset;\n\t\t\n\t\tdebug('pre');\n \tdebug(pre.childNodes);\n \tdebug(anchorNodeCaret2.data+\"+end\");\n \tdebug(anchorNodeCaret2);\n \tdebug(anchorOffsetCaret2);\n \t//debug(pre.innerHTML)\n \t*/\n \t//debug(\"FINISHED\");\n \t\n \t\n}", "function fixMarkup(value) {\n if (options.tabReplace) {\n value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1 /*..., offset, s*/) {\n return p1.replace(/\\t/g, options.tabReplace);\n });\n }\n if (options.useBR) {\n value = value.replace(/\\n/g, '<br>');\n }\n return value;\n }", "function fixMarkup(value) {\n if (options.tabReplace) {\n value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1 /*..., offset, s*/) {\n return p1.replace(/\\t/g, options.tabReplace);\n });\n }\n if (options.useBR) {\n value = value.replace(/\\n/g, '<br>');\n }\n return value;\n }", "function fixMarkup(value) {\n if (options.tabReplace) {\n value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1 /*..., offset, s*/) {\n return p1.replace(/\\t/g, options.tabReplace);\n });\n }\n if (options.useBR) {\n value = value.replace(/\\n/g, '<br>');\n }\n return value;\n }", "function formatPage() {\n $('.marked').each(function () {\n var text = $(this).text();\n text = text.replace(new RegExp('(\\\\\\\\n)', 'g'), \" \");\n text = text.replace(new RegExp('(\\\\\\\\\")', 'g'), \"\");\n $(this).html(marked(text));\n });\n $('.pre code').each(function(i, block) {\n hljs.highlightBlock(block);\n });\n }", "function fixMarkup(value) {\n if (options.tabReplace) {\n value = value.replace(/^((<[^>]+>|\\t)+)/gm, function (match, p1 /*..., offset, s*/) {\n return p1.replace(/\\t/g, options.tabReplace);\n });\n }\n if (options.useBR) {\n value = value.replace(/\\n/g, '<br>');\n }\n return value;\n }", "function fixMarkup(value) {\n if (options.tabReplace) {\n value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1, offset, s) {\n return p1.replace(/\\t/g, options.tabReplace);\n });\n }\n if (options.useBR) {\n value = value.replace(/\\n/g, '<br>');\n }\n return value;\n }", "function fixMarkup(value) {\n if (options.tabReplace) {\n value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1, offset, s) {\n return p1.replace(/\\t/g, options.tabReplace);\n });\n }\n if (options.useBR) {\n value = value.replace(/\\n/g, '<br>');\n }\n return value;\n }", "function fixMarkup(value) {\n if (options.tabReplace) {\n value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1, offset, s) {\n return p1.replace(/\\t/g, options.tabReplace);\n });\n }\n if (options.useBR) {\n value = value.replace(/\\n/g, '<br>');\n }\n return value;\n }", "function fixMarkup(value) {\n if (options.tabReplace) {\n value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1, offset, s) {\n return p1.replace(/\\t/g, options.tabReplace);\n });\n }\n if (options.useBR) {\n value = value.replace(/\\n/g, '<br>');\n }\n return value;\n }", "function fixMarkup(value) {\n if (options.tabReplace) {\n value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1, offset, s) {\n return p1.replace(/\\t/g, options.tabReplace);\n });\n }\n if (options.useBR) {\n value = value.replace(/\\n/g, '<br>');\n }\n return value;\n }", "function fixMarkup(value) {\n return !(options.tabReplace || options.useBR)\n ? value\n : value.replace(fixMarkupRe, function (match, p1) {\n if (options.useBR && match === '\\n') {\n return '<br>';\n } else if (options.tabReplace) {\n return p1.replace(/\\t/g, options.tabReplace);\n }\n });\n }", "function fixMarkup(value) {\n\t return !(options.tabReplace || options.useBR)\n\t ? value\n\t : value.replace(fixMarkupRe, function(match, p1) {\n\t if (options.useBR && match === '\\n') {\n\t return '<br>';\n\t } else if (options.tabReplace) {\n\t return p1.replace(/\\t/g, options.tabReplace);\n\t }\n\t });\n\t }", "function fixMarkup(value) {\n if (!(options.tabReplace || options.useBR)) {\n return value;\n }\n\n return value.replace(fixMarkupRe, function (match, p1) {\n if (options.useBR && match === '\\n') {\n return '<br>';\n } else if (options.tabReplace) {\n return p1.replace(/\\t/g, options.tabReplace);\n }\n\n return '';\n });\n }", "function fixMarkup(value) {\n return !(options.tabReplace || options.useBR)\n ? value\n : value.replace(fixMarkupRe, function(match, p1) {\n if (options.useBR && match === '\\n') {\n return '<br>';\n } else if (options.tabReplace) {\n return p1.replace(/\\t/g, options.tabReplace);\n }\n });\n }", "function fixMarkup(value) {\n return !(options.tabReplace || options.useBR)\n ? value\n : value.replace(fixMarkupRe, function(match, p1) {\n if (options.useBR && match === '\\n') {\n return '<br>';\n } else if (options.tabReplace) {\n return p1.replace(/\\t/g, options.tabReplace);\n }\n });\n }", "function fixMarkup(value) {\n return !(options.tabReplace || options.useBR)\n ? value\n : value.replace(fixMarkupRe, function(match, p1) {\n if (options.useBR && match === '\\n') {\n return '<br>';\n } else if (options.tabReplace) {\n return p1.replace(/\\t/g, options.tabReplace);\n }\n });\n }", "function fixMarkup(value) {\n if (!(options.tabReplace || options.useBR)) {\n return value;\n }\n\n return value.replace(fixMarkupRe, function(match, p1) {\n if (options.useBR && match === '\\n') {\n return '<br>';\n } else if (options.tabReplace) {\n return p1.replace(/\\t/g, options.tabReplace);\n }\n return '';\n });\n }", "function preKiProcess(tree, end_tag)\n {\n if (tree.content[0])\n {\n if (isNotEmtyStr(tree.content[0].strKiContentPreLtDelim))\n strKiAppend(tree.content[0].strKiContentPreLtDelim);\n\n if (isNotEmtyStr(tree.content[0].strLeftDelim))\n strKiAppend(tree.content[0].strLeftDelim);\n\n if (typeof(tree.content[0]) == 'string')\n strKiAppend(tree.content[0]); // we want the original content, not the one after escape lookup\n }\n }", "function highlightMultilinePres() {\n var pres = document.querySelectorAll('pre');\n \n for (var i = 0; i < pres.length; ++i) {\n var pre = pres[i];\n\n // only all text pres are desired to be fixed\n if (pre.children.length > 0)\n continue;\n \n // only multi-line pres\n if (!pre.textContent.includes(\"\\n\"))\n continue;\n \n var code = document.createElement(\"CODE\");\n code.innerHTML = pre.innerHTML;\n pre.innerHTML = \"\";\n pre.appendChild(code);\n \n hightlightCodeBlock(code, pre);\n }\n}", "_removeBRinStyleText() {\n const afterRange = this.wwe.getRange();\n const { startContainer, startOffset } = afterRange;\n\n let styleNode;\n\n if (startContainer.nodeName === 'TD') {\n // This case is <i>TEST<br></i>|<br>\n styleNode = domUtils.getChildNodeByOffset(startContainer, startOffset - 1);\n } else {\n styleNode = domUtils.getParentUntil(startContainer, 'TD');\n }\n\n const brNode = styleNode.querySelector('br');\n\n if (!brNode) {\n return;\n }\n\n const { parentNode: tdNode, nodeName } = styleNode;\n\n if (nodeName === 'CODE' && !brNode.previousSibling) {\n // cursor is located in the start of text\n // Before Enter : <code>|TEST</code>\n // After Enter : <code><br>|TEST</code>\n // TO BE : <br><code>|TEST</code>\n tdNode.insertBefore(brNode, styleNode);\n afterRange.setStart(styleNode, 0);\n } else if (nodeName === 'CODE' && !brNode.nextSibling) {\n // cursor is located in the end of text\n // Before Enter : <code>TEST|</code>\n // After Enter : <code>TEST<br>|</code>\n // TO BE : <code>TEST</code><br>|\n tdNode.insertBefore(brNode, styleNode.nextSibling);\n afterRange.setStart(tdNode, domUtils.getNodeOffsetOfParent(brNode) + 1);\n } else {\n // [Case 1] cursor is located in the middle of text\n // Before Enter : <i>TE|ST</i>\n // After Enter : <i>TE<br>|ST</i>\n // TO BE : <i>TE</i><br><i>|ST</i>\n // [Case 2] cursor is located in the start of text\n // Before Enter : <i>|TEST</i>\n // After Enter : <i><br>|TEST</i>\n // TO BE : <i>|</i><br><i>TEST</i>\n // [Case 3] cursor is located in the end of text\n // Before Enter : <i>TEST|</i>\n // After Enter : <i>TEST<br>|</i>\n // TO BE : <i>TEST</i><br><i>|</i>\n const newNode = this._splitByBR(styleNode, brNode);\n\n afterRange.setStart(newNode, 0);\n }\n\n afterRange.collapse(true);\n this.wwe.getEditor().setSelection(afterRange);\n }", "function _(e){return O.tabReplace||O.useBR?e.replace(N,function(e,t){return O.useBR&&\"\\n\"===e?\"<br>\":O.tabReplace?t.replace(/\\t/g,O.tabReplace):\"\"}):e}", "function autoEdExtraBreaks(str) { //MAIN FUNCTION describes list of fixes\n \n//Usually unneeded BR tags from ends of image descriptions and wikilinks (]]), templates (}}), template parameters (|)\nstr = str.replace(/[\\t ]*<[\\s\\/\\.]*br[\\s\\/\\.]*>[\\t ]*([\\t\\n ]*?)(\\]\\]|}}|\\|)/gim, '$1$2');\n//BR tag before a list item\nstr = str.replace(/[\\t ]*<[\\s\\/\\.]*br[\\s\\/\\.]*>[\\t ]*([\\s]*?[\\n]\\*)/gim, '$1');\n//BR tag followed by at least two newlines\nstr = str.replace(/[\\t ]*<[\\s\\/\\.]*br[\\s\\/\\.]*>[\\t ]*([\\n])[\\t ]*([\\n])/gim, '$1$2');\n \nreturn str;\n}", "function preCode(selector) {\n\n var els = Array.prototype.slice.call(document.querySelectorAll(selector), 0);\n\n els.forEach(function(el, idx, arr){\n var txt = el.textContent\n .replace(/^[\\r\\n]+/, \"\")\t// strip leading newline\n .replace(/\\s+$/g, \"\");\t\t// strip trailing whitespace\n\n if (/^\\S/gm.test(txt)) {\n el.textContent = txt;\n return;\n }\n\n var mat, str, re = /^[\\t ]+/gm, len, min = 1e3;\n\n while (mat = re.exec(txt)) {\n len = mat[0].length;\n\n if (len < min) {\n min = len;\n str = mat[0];\n }\n }\n\n if (min == 1e3) return;\n\n el.textContent = txt.replace(new RegExp(\"^\" + str, 'gm'), \"\");\n });\n }", "autoIndentNewLine (start, end) {\n for (var i = start, scopeDiff = 0; i > 0; i--) {\n let char = this.text[i - 1];\n if (char === '\\n') {\n break;\n } else if (scopeDiff === 0) {\n if (char === \"}\") {\n scopeDiff = -1;\n } if (char === \"{\") {\n scopeDiff = 1;\n }\n }\n }\n\n let result = initialWhiteSpace.exec(this.text.substring(i, start));\n let indentation = result ? result[0] : \"\";\n \n if (scopeDiff === 1) {\n initialCloseParen.lastIndex = end;\n let suffix = initialCloseParen.exec(this.text) ? \"\\n\" + indentation : \"\";\n this.replaceText(start, end, \"\\n\\t\" + indentation + suffix, -suffix.length);\n } else {\n this.replaceText(start, end, \"\\n\" + indentation);\n }\n }", "function autoEdWhitespace(str) { //MAIN FUNCTION describes list of fixes\n \n str = str.replace(/\\t/g, \" \");\n \n str = str.replace(/^ ? ? \\n/gm, \"\\n\");\n str = str.replace(/(\\n\\n)\\n+/g, \"$1\");\n str = str.replace(/== ? ?\\n\\n==/g, \"== \\n ==\");\n str = str.replace(/\\n\\n(\\* ?\\[?http)/g, \"\\n$1\");\n \n str = str.replace(/^ ? ? \\n/gm, \"\\n\");\n str = str.replace(/\\n\\n\\*/g, \"\\n*\");\n str = str.replace(/[ \\t][ \\t]+/g, \" \");\n str = str.replace(/([=\\n]\\n)\\n+/g, \"$1\");\n str = str.replace(/ \\n/g, \"\\n\");\n \n //* bullet points\n str = str.replace(/^([\\*#]+:*) /gm, \"$1\");\n str = str.replace(/^([\\*#]+:*)/gm, \"$1 \");\n \n //==Headings==\n str = str.replace(/^(={1,4}) ?(.*?) ?(={1,4})$/gm, \"$1 $2 $3\");\n return str;\n}", "function highlight() {\n var code_blocks = document.body.getElementsByClassName(\"language-c\");\n var keywords = [\n \"auto\", \"break\", \"case\", \"char\", \"const\", \"continue\", \"default\",\n \"do\", \"double\", \"else\", \"enum\", \"extern\", \"float\", \"for\", \"goto\",\n \"if\", \"inline\", \"int\", \"long\", \"register\", \"restrict\", \"return\",\n \"short\", \"signed\", \"sizeof\", \"static\", \"struct\", \"switch\",\n \"typedef\", \"union\", \"unsigned\", \"void\", \"volatile\", \"while\",\n ];\n var regex_var = /\\b[A-z][A-z0-9]*/;\n var regex_number = /\\b0[xX][0-9a-fA-F]+\\b|\\b[0-9]*\\.[0-9]+\\b|\\b[0-9]*\\b/;\n var regex_string = /\"[^\"]*\"/;\n var regex_symbol = /&gt;|&lt;|\\ |\\(|\\)|;|-/;\n for (var i = 0; i < code_blocks.length; i++) {\n var element = code_blocks.item(i);\n var code_lines = element.innerHTML.split('\\n');\n var cursor = 0;\n\n var parts = [];\n var insert_index = 0;\n function insert_at(index, insertable) {\n if (index < insert_index) console.error(\"inserting before last insert!!\");\n parts.push(element.innerHTML.substr(insert_index, index - insert_index));\n parts.push(insertable);\n insert_index = index;\n }\n\n var in_block_comment = false;\n\n for (var j = 0; j < code_lines.length; j++) {\n var words = code_lines[j].split(regex_symbol);\n var in_line_comment = false;\n\n for (var k = 0; k < words.length; k++) {\n var word = words[k];\n\n // Special case for < and >, because they're escaped in\n // innerHTML.\n var to_be_processed_html = element.innerHTML.substr(cursor);\n if (to_be_processed_html.startsWith(\"lt;\") ||\n to_be_processed_html.startsWith(\"gt;\")) {\n cursor += 3;\n }\n\n if (in_block_comment) {\n if (word == \"*/\") {\n in_block_comment = false;\n insert_at(cursor + word.length, \"</span>\"); // close comment block\n }\n } else {\n if (!in_line_comment) {\n if (word == \"//\") {\n in_line_comment = true;\n insert_at(cursor, \"<span class='syntax-comment'>\"); // open comment line\n }\n if (word == \"/*\") {\n in_block_comment = true;\n insert_at(cursor, \"<span class='syntax-comment'>\"); // open comment block\n }\n }\n\n if (!in_line_comment && !in_block_comment) {\n if (keywords.indexOf(word) != -1) {\n insert_at(cursor, \"<span class='syntax-keyword'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_string.test(word)) {\n insert_at(cursor, \"<span class='syntax-string'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_var.test(word) && element.innerHTML.substr(cursor + word.length, 1) == \"(\") {\n insert_at(cursor, \"<span class='syntax-call'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_var.test(word)) {\n insert_at(cursor, \"<span class='syntax-variable'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_number.test(word)) {\n insert_at(cursor, \"<span class='syntax-number'>\");\n insert_at(cursor + word.length, \"</span>\");\n }\n }\n }\n\n cursor += word.length + 1;\n }\n\n if (in_line_comment) {\n insert_at(cursor, \"</span>\"); // close comment line\n }\n }\n\n parts.push(element.innerHTML.substr(insert_index));\n element.innerHTML = parts.join('');\n\n // When processing, using &lt; and &gt; is forced upon us. Now we\n // can fix that to allow for good copypasting.\n element.innerHTML.replace(/&lt;/g, \"<\");\n element.innerHTML.replace(/&gt;/g, \">\");\n }\n}", "function fixMarkup(value, tabReplace, useBR) {\n if (tabReplace) {\n value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1, offset, s) {\n return p1.replace(/\\t/g, tabReplace);\n });\n }\n if (useBR) {\n value = value.replace(/\\n/g, '<br>');\n }\n return value;\n }", "function addNewLinesBeforeBrInPre() {\n\t\t\t// IE8+ rendering mode does the right thing with BR in PRE\n\t\t\tif (getDocumentMode() > 7) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Enable display: none in area and add a specific class that hides all BR elements in PRE to\n\t\t\t// avoid the caret from getting stuck at the BR elements while pressing the right arrow key\n\t\t\tsetEditorCommandState('RespectVisibilityInDesign', true);\n\t\t\teditor.contentStyles.push('.mceHideBrInPre pre br {display: none}');\n\t\t\tdom.addClass(editor.getBody(), 'mceHideBrInPre');\n\n\t\t\t// Adds a \\n before all BR elements in PRE to get them visual\n\t\t\tparser.addNodeFilter('pre', function(nodes) {\n\t\t\t\tvar i = nodes.length, brNodes, j, brElm, sibling;\n\n\t\t\t\twhile (i--) {\n\t\t\t\t\tbrNodes = nodes[i].getAll('br');\n\t\t\t\t\tj = brNodes.length;\n\t\t\t\t\twhile (j--) {\n\t\t\t\t\t\tbrElm = brNodes[j];\n\n\t\t\t\t\t\t// Add \\n before BR in PRE elements on older IE:s so the new lines get rendered\n\t\t\t\t\t\tsibling = brElm.prev;\n\t\t\t\t\t\tif (sibling && sibling.type === 3 && sibling.value.charAt(sibling.value - 1) != '\\n') {\n\t\t\t\t\t\t\tsibling.value += '\\n';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbrElm.parent.insert(new Node('#text', 3), brElm, true).value = '\\n';\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// Removes any \\n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible\n\t\t\tserializer.addNodeFilter('pre', function(nodes) {\n\t\t\t\tvar i = nodes.length, brNodes, j, brElm, sibling;\n\n\t\t\t\twhile (i--) {\n\t\t\t\t\tbrNodes = nodes[i].getAll('br');\n\t\t\t\t\tj = brNodes.length;\n\t\t\t\t\twhile (j--) {\n\t\t\t\t\t\tbrElm = brNodes[j];\n\t\t\t\t\t\tsibling = brElm.prev;\n\t\t\t\t\t\tif (sibling && sibling.type == 3) {\n\t\t\t\t\t\t\tsibling.value = sibling.value.replace(/\\r?\\n$/, '');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function addNewLinesBeforeBrInPre() {\n\t\t\t// IE8+ rendering mode does the right thing with BR in PRE\n\t\t\tif (getDocumentMode() > 7) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Enable display: none in area and add a specific class that hides all BR elements in PRE to\n\t\t\t// avoid the caret from getting stuck at the BR elements while pressing the right arrow key\n\t\t\tsetEditorCommandState('RespectVisibilityInDesign', true);\n\t\t\teditor.contentStyles.push('.mceHideBrInPre pre br {display: none}');\n\t\t\tdom.addClass(editor.getBody(), 'mceHideBrInPre');\n\n\t\t\t// Adds a \\n before all BR elements in PRE to get them visual\n\t\t\tparser.addNodeFilter('pre', function(nodes) {\n\t\t\t\tvar i = nodes.length, brNodes, j, brElm, sibling;\n\n\t\t\t\twhile (i--) {\n\t\t\t\t\tbrNodes = nodes[i].getAll('br');\n\t\t\t\t\tj = brNodes.length;\n\t\t\t\t\twhile (j--) {\n\t\t\t\t\t\tbrElm = brNodes[j];\n\n\t\t\t\t\t\t// Add \\n before BR in PRE elements on older IE:s so the new lines get rendered\n\t\t\t\t\t\tsibling = brElm.prev;\n\t\t\t\t\t\tif (sibling && sibling.type === 3 && sibling.value.charAt(sibling.value - 1) != '\\n') {\n\t\t\t\t\t\t\tsibling.value += '\\n';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbrElm.parent.insert(new Node('#text', 3), brElm, true).value = '\\n';\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// Removes any \\n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible\n\t\t\tserializer.addNodeFilter('pre', function(nodes) {\n\t\t\t\tvar i = nodes.length, brNodes, j, brElm, sibling;\n\n\t\t\t\twhile (i--) {\n\t\t\t\t\tbrNodes = nodes[i].getAll('br');\n\t\t\t\t\tj = brNodes.length;\n\t\t\t\t\twhile (j--) {\n\t\t\t\t\t\tbrElm = brNodes[j];\n\t\t\t\t\t\tsibling = brElm.prev;\n\t\t\t\t\t\tif (sibling && sibling.type == 3) {\n\t\t\t\t\t\t\tsibling.value = sibling.value.replace(/\\r?\\n$/, '');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function addNewLinesBeforeBrInPre() {\n\t\t\t// IE8+ rendering mode does the right thing with BR in PRE\n\t\t\tif (getDocumentMode() > 7) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Enable display: none in area and add a specific class that hides all BR elements in PRE to\n\t\t\t// avoid the caret from getting stuck at the BR elements while pressing the right arrow key\n\t\t\tsetEditorCommandState('RespectVisibilityInDesign', true);\n\t\t\teditor.contentStyles.push('.mceHideBrInPre pre br {display: none}');\n\t\t\tdom.addClass(editor.getBody(), 'mceHideBrInPre');\n\n\t\t\t// Adds a \\n before all BR elements in PRE to get them visual\n\t\t\tparser.addNodeFilter('pre', function(nodes) {\n\t\t\t\tvar i = nodes.length, brNodes, j, brElm, sibling;\n\n\t\t\t\twhile (i--) {\n\t\t\t\t\tbrNodes = nodes[i].getAll('br');\n\t\t\t\t\tj = brNodes.length;\n\t\t\t\t\twhile (j--) {\n\t\t\t\t\t\tbrElm = brNodes[j];\n\n\t\t\t\t\t\t// Add \\n before BR in PRE elements on older IE:s so the new lines get rendered\n\t\t\t\t\t\tsibling = brElm.prev;\n\t\t\t\t\t\tif (sibling && sibling.type === 3 && sibling.value.charAt(sibling.value - 1) != '\\n') {\n\t\t\t\t\t\t\tsibling.value += '\\n';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbrElm.parent.insert(new Node('#text', 3), brElm, true).value = '\\n';\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// Removes any \\n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible\n\t\t\tserializer.addNodeFilter('pre', function(nodes) {\n\t\t\t\tvar i = nodes.length, brNodes, j, brElm, sibling;\n\n\t\t\t\twhile (i--) {\n\t\t\t\t\tbrNodes = nodes[i].getAll('br');\n\t\t\t\t\tj = brNodes.length;\n\t\t\t\t\twhile (j--) {\n\t\t\t\t\t\tbrElm = brNodes[j];\n\t\t\t\t\t\tsibling = brElm.prev;\n\t\t\t\t\t\tif (sibling && sibling.type == 3) {\n\t\t\t\t\t\t\tsibling.value = sibling.value.replace(/\\r?\\n$/, '');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function markup(e){var t,n,i,r;if(hash=clicked=e,get(),$.extend(hash,{line:\"\",root:options.root,textarea:textarea,selection:selection||\"\",caretPosition:caretPosition,ctrlKey:ctrlKey,shiftKey:shiftKey,altKey:altKey}),\n// callbacks before insertion\nprepare(options.beforeInsert),prepare(clicked.beforeInsert),(!0===ctrlKey&&!0===shiftKey||!0===e.multiline)&&prepare(clicked.beforeMultiInsert),$.extend(hash,{line:1}),!0===ctrlKey&&!0===shiftKey){for(lines=selection.split(/\\r?\\n/),n=0,i=lines.length,r=0;r<i;r++)\"\"!==$.trim(lines[r])?($.extend(hash,{line:++n,selection:lines[r]}),lines[r]=build(lines[r]).block):lines[r]=\"\";string={block:lines.join(\"\\n\")},start=caretPosition,t=string.block.length+(browser.opera?i-1:0)}else!0===ctrlKey?(string=build(selection),start=caretPosition+string.openWith.length,t=string.block.length-string.openWith.length-string.closeWith.length,t-=string.block.match(/ $/)?1:0,t-=fixIeBug(string.block)):!0===shiftKey?(string=build(selection),start=caretPosition,t=string.block.length,t-=fixIeBug(string.block)):(string=build(selection),start=caretPosition+string.block.length,t=0,start-=fixIeBug(string.block));\"\"===selection&&\"\"===string.replaceWith&&(caretOffset+=fixOperaBug(string.block),start=caretPosition+string.openBlockWith.length+string.openWith.length,t=string.block.length-string.openBlockWith.length-string.openWith.length-string.closeWith.length-string.closeBlockWith.length,caretOffset=$$.val().substring(caretPosition,$$.val().length).length,caretOffset-=fixOperaBug($$.val().substring(0,caretPosition))),$.extend(hash,{caretPosition:caretPosition,scrollPosition:scrollPosition}),string.block!==selection&&!1===abort?(insert(string.block),set(start,t)):caretOffset=-1,get(),$.extend(hash,{line:\"\",selection:selection}),\n// callbacks after insertion\n(!0===ctrlKey&&!0===shiftKey||!0===e.multiline)&&prepare(clicked.afterMultiInsert),prepare(clicked.afterInsert),prepare(options.afterInsert),\n// refresh preview if opened\npreviewWindow&&options.previewAutoRefresh&&refreshPreview(),\n// reinit keyevent\nshiftKey=altKey=ctrlKey=abort=!1}", "function caretPlacement(charCount,pre,sbwin1){\n\t//debug(\"do replace; \"+charCount);\n\tvar nodes=pre.childNodes;\n\tvar sel=sbwin1.getSelectedBuffer().api.selection;\n\tif(charCount==0){\n\t\tsel.collapse(pre,0);\n\t}\n\tvar count=charCount;\n\tvar currNodeNum=0;\n\tvar len=pre.childNodes.length;\n\twhile(currNodeNum<len){\n\t\tif(charCountLength(nodes[currNodeNum])<count){\n\t\t\tcount=count-charCountLength(nodes[currNodeNum]);\n\t\t\tcurrNodeNum++;\t\n\t\t}\n\t\tif(charCountLength(nodes[currNodeNum])==count){\n\t\t\t//debug(\"== case\");\n\t\t\t//debug(nodes[currNodeNum].nodeName);\n\t\t\tif(nodes[currNodeNum].nodeName==\"SPAN\"){\n\t\t\t\t//debug(\"span node add \"+nodes[currNodeNum].firstChild.nodeValue.length);\n\t\t\t\t//count=count+nodes[currNodeNum].firstChild.nodeValue.length;\n\t\t\t\tvar withinSpanCount=count;\n\t\t\t\tvar spanKids=nodes[currNodeNum].childNodes;\n\t\t\t\tfor(i=0;i<spanKids.length;i++){\t\n\t\t\t\t\t//debug(spanKids[i]);\n\t\t\t\t\tif(spanKids[i].nodeName==\"#text\"){\n\t\t\t\t\t\tif(spanKids[i].nodeValue.length>=withinSpanCount){\n\t\t\t\t\t\t\t//debug(spanKids[i]);\n\t\t\t\t\t\t\tsel.collapse(spanKids[i],withinSpanCount);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\twithinSpanCount=withinSpanCount-spanKids[i].nodeValue.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(spanKids[i].nodeName==\"BR\"){\n\t\t\t\t\t\tif(1>withinSpanCount){\n\t\t\t\t\t\t\tsel.collapse(nodes[currNodeNum],i);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//debug(\"amother br mode\");\n\t\t\t\t\t\t\t//debug(withinSpanCount-1);\n\t\t\t\t\t\t\twithinSpanCount=withinSpanCount-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\tif(nodes[currNodeNum].nodeName==\"#text\"){\n\t\t\t\t//debug(\"text node add \"+nodes[currNodeNum].nodeValue.length);\n\t\t\t\tsel.collapse(nodes[currNodeNum],nodes[currNodeNum].nodeValue.length);\n\t\t\t}\n\t\t\tif(nodes[currNodeNum].nodeName==\"BR\"){\n\t\t\t\t//debug(\"br node \");\n\t\t\t\tif(currNodeNum<len){\n\t\t\t\t\tsel.collapse(pre,currNodeNum+1);\n\t\t\t\t}else{\n\t\t\t\t\tsel.collapse(pre,currNodeNum);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif(charCountLength(nodes[currNodeNum])>count){\n\t\t\t//debug(\"> case\");\n\t\t\t//debug(nodes[currNodeNum].nodeName);\n\t\t\t\n\t\t\tif(nodes[currNodeNum].nodeName==\"SPAN\"){\n\t\t\t\t//debug(\"span node add \"+nodes[currNodeNum].firstChild.nodeValue.length);\n\t\t\t\t//count=count+nodes[currNodeNum].firstChild.nodeValue.length;\n\t\t\t\tvar withinSpanCount=count;\n\t\t\t\tvar spanKids=nodes[currNodeNum].childNodes;\n\t\t\t\tfor(i=0;i<spanKids.length;i++){\n\t\t\t\t\t//debug(spanKids[i]);\n\t\t\t\t\tif(spanKids[i].nodeName==\"#text\"){\n\t\t\t\t\t\n\t\t\t\t\t\t//debug(\"#text\");\n\t\t\t\t\t\t//debug(spanKids[i].nodeValue);\n\t\t\t\t\t\t//debug(withinSpanCount);\n\t\t\t\t\t\tif(spanKids[i].nodeValue.length>=withinSpanCount){\n\t\t\t\t\t\t\t//debug(\"this text mode\");\n\t\t\t\t\t\t\t//debug(spanKids[i]);\n\t\t\t\t\t\t\t//debug(withinSpanCount);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tsel.collapse(spanKids[i],withinSpanCount);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//debug(\"amother text mode\");\n\t\t\t\t\t\t\t//debug(withinSpanCount-spanKids[i].nodeValue.length);\n\t\t\t\t\t\t\twithinSpanCount=withinSpanCount-spanKids[i].nodeValue.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(spanKids[i].nodeName==\"BR\"){\n\t\t\t\t\t\tif(1>withinSpanCount){\n\t\t\t\t\t\t\tsel.collapse(nodes[currNodeNum],i);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//debug(\"amother br mode\");\n\t\t\t\t\t\t\t//debug(withinSpanCount-1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twithinSpanCount=withinSpanCount-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\t}\n\t\t\tif(nodes[currNodeNum].nodeName==\"#text\"){\n\t\t\t\t//debug(\"text node \");\n\t\t\t\t//count=count+nodes[currNodeNum].nodeValue.length;\n\t\t\t\tsel.collapse(nodes[currNodeNum],count);\n\t\t\t}\n\t\t\tif(nodes[currNodeNum].nodeName==\"BR\"){\n\t\t\t\t//debug(\"text node add \"+nodes[currNodeNum].nodeValue.length);\n\t\t\t\t//count=count+1;\n\t\t\t\tsel.collapse(pre,currNodeNum);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n var pres = document.getElementsByTagName('pre');\n for (var i = 0; i < pres.length; i++) {\n var code = findCode(pres[i]);\n if (code)\n highlightBlock(code, hljs.tabReplace);\n }\n }", "function formatCode(code)\r\n{\r\n\tmetaTag = /((<br\\/?>)?\\s?&lt;(meta))/gi;\r\n\thtmlTag = /(&lt;(html)[^(&gt;)]*?&gt;\\s?(<br\\/?>)?)/gi;\r\n\thtml2Tag = /((<br\\/?>)?\\s?&lt;(\\/html)([\\s\\S]*?)&gt;)/gi;\r\n\ttitleTag = /(&lt;(\\/title)&gt;\\s?(<br\\/?>)?)/gi;\r\n\ttitle2Tag = /((<br\\/?>)?\\s?&lt;(title)&gt;)/gi;\r\n\ttableTag = /(&lt;(tbody|th|tr|td|\\/tbody|\\/th|\\/tr|\\/td)([\\s\\S]*?)&gt;\\s?(<br\\/?>)?)/gi;\r\n\ttableBeginTag = /((<br\\/?>)?\\s?&lt;(table)([\\s\\S]*?)&gt;)/gi;\r\n\ttableEndTag = /(&lt;(\\/table)&gt;\\s?(<br\\/?>)?)/gi;\r\n\theadTag = /(&lt;(head)&gt;\\s?(<br\\/?>)?)/gi;\r\n\thead2Tag = /(&lt;(\\/head)[^(&gt;)]*?&gt;\\s?(<br\\/?>)?)/gi;\r\n\tbodyTag = /(&lt;(body)([\\s\\S]*?)&gt;\\s?(<br\\/?>)?)/gi;\r\n\tbody2Tag = /((<br\\/?>)?\\s?&lt;(\\/body)([\\s\\S]*?)&gt;)/gi;\r\n\tscriptTag = /(&lt;(script|\\/script)([\\s\\S]*?)&gt;\\s?(<br\\/?>)?)/gi;\r\n\r\n\tcode = code.replace(metaTag,function(s1,s2){return \"<br/>\"+s2.replace(/(<br\\/?>)/gi,\"\");});\r\n\tcode = code.replace(tableEndTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(tableBeginTag,function(s1,s2){return \"<br/>\"+s2.replace(/(<br\\/?>)/gi,\"\");});\r\n\tcode = code.replace(htmlTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(html2Tag,function(s1,s2){return \"<br/>\"+s2.replace(/(<br\\/?>)/gi,\"\");});\r\n\tcode = code.replace(title2Tag,function(s1,s2){return \"<br/>\"+s2.replace(/<br\\/?>/gi,\"\");});\r\n\tcode = code.replace(titleTag,function(s1,s2){return s2.replace(/<br\\/?>/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(tableTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(headTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(head2Tag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(bodyTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\tcode = code.replace(body2Tag,function(s1,s2){return \"<br/>\"+s2.replace(/(<br\\/?>)/gi,\"\");});\r\n\tcode = code.replace(scriptTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\r\n\treturn code;\r\n}", "function normaliseContentEditableHTML(html, trim) {\n html = html.replace(initialBreaks, '$1\\n\\n')\n .replace(initialBreak, '$1\\n')\n .replace(wrappedBreaks, '\\n')\n .replace(openBreaks, '')\n .replace(breaks, '\\n')\n .replace(allTags, '')\n .replace(newlines, '<br>')\n\n if (trim) {\n html = html.replace(trimWhitespace, '')\n }\n\n return html\n}", "function formatCode(c)\n{\n\tmetaTag = /((<br\\/?>)?\\s?&lt;(meta))/gi;\n\thtmlTag = /(&lt;(html)[^(&gt;)]*?&gt;\\s?(<br\\/?>)?)/gi;\n\thtml2Tag = /((<br\\/?>)?\\s?&lt;(\\/html)([\\s\\S]*?)&gt;)/gi;\n\ttitleTag = /(&lt;(\\/title)&gt;\\s?(<br\\/?>)?)/gi;\n\ttitle2Tag = /((<br\\/?>)?\\s?&lt;(title)&gt;)/gi;\n\ttableTag = /(&lt;(tbody|th|tr|td|\\/tbody|\\/th|\\/tr|\\/td)([\\s\\S]*?)&gt;\\s?(<br\\/?>)?)/gi;\n\ttableBeginTag = /((<br\\/?>)?\\s?&lt;(table)([\\s\\S]*?)&gt;)/gi;\n\ttableEndTag = /(&lt;(\\/table)&gt;\\s?(<br\\/?>)?)/gi;\n\theadTag = /(&lt;(head)&gt;\\s?(<br\\/?>)?)/gi;\n\thead2Tag = /(&lt;(\\/head)[^(&gt;)]*?&gt;\\s?(<br\\/?>)?)/gi;\n\tbodyTag = /(&lt;(body)([\\s\\S]*?)&gt;\\s?(<br\\/?>)?)/gi;\n\tbody2Tag = /((<br\\/?>)?\\s?&lt;(\\/body)([\\s\\S]*?)&gt;)/gi;\n\tscriptTag = /(&lt;(script|\\/script)([\\s\\S]*?)&gt;\\s?(<br\\/?>)?)/gi;\n\n\tc = c.replace(metaTag,function(s1,s2){return \"<br/>\"+s2.replace(/(<br\\/?>)/gi,\"\");});\n\tc = c.replace(tableEndTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\n\tc = c.replace(tableBeginTag,function(s1,s2){return \"<br/>\"+s2.replace(/(<br\\/?>)/gi,\"\");});\n\tc = c.replace(htmlTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\n\tc = c.replace(html2Tag,function(s1,s2){return \"<br/>\"+s2.replace(/(<br\\/?>)/gi,\"\");});\n\tc = c.replace(title2Tag,function(s1,s2){return \"<br/>\"+s2.replace(/<br\\/?>/gi,\"\");});\n\tc = c.replace(titleTag,function(s1,s2){return s2.replace(/<br\\/?>/gi,\"\")+\"<br/>\";});\n\tc = c.replace(tableTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\n\tc = c.replace(headTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\n\tc = c.replace(head2Tag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\n\tc = c.replace(bodyTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\n\tc = c.replace(body2Tag,function(s1,s2){return \"<br/>\"+s2.replace(/(<br\\/?>)/gi,\"\");});\n\tc = c.replace(scriptTag,function(s1,s2){return s2.replace(/(<br\\/?>)/gi,\"\")+\"<br/>\";});\n\treturn c;\n}", "revert() {\n // If it's not parsed, then do nothing\n if (!this.isParsed) {\n return\n }\n\n for (let i = 0; i < this.preEls.length; i++) {\n this.preEls[i].removeAttribute('data-highlight')\n // Check content type\n if (typeof this.preElsCache[i] === 'string') {\n this.preEls[i].innerText = this.preElsCache[i]\n }\n else {\n this.preEls[i].innerHTML = ''\n this.preEls[i].appendChild(this.preElsCache[i].cloneNode(true))\n }\n }\n\n this.removeLinkEl()\n this.isParsed = false\n }", "function codestyling() {\n\t\t$('pre code').each(function(i, e) {\n\t\t\thljs.highlightBlock(e);\n\n\t\t\tif(!$(this).hasClass('language-text')) {\n\t\t\t\tvar code = $(this);\n\t\t\t\tvar lines = code.html().split(/\\n/).length;\n\t\t\t\tvar numbers = [];\n\t\t\t\tfor (i = 1; i < lines; i++) {\n\t\t\t\t\tnumbers += '<span class=\"line\">' + i + '</span>';\n\t\t\t\t}\n\t\t\t\tcode.parent().append('<div class=\"lines\">' + numbers + '</div>');\n\t\t\t}\n\t\t});\n\t}", "function substitutePreCodeTags (doc) {\n\n\t var pres = doc.querySelectorAll('pre'),\n\t presPH = [];\n\n\t for (var i = 0; i < pres.length; ++i) {\n\n\t if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') {\n\t var content = pres[i].firstChild.innerHTML.trim(),\n\t language = pres[i].firstChild.getAttribute('data-language') || '';\n\n\t // if data-language attribute is not defined, then we look for class language-*\n\t if (language === '') {\n\t var classes = pres[i].firstChild.className.split(' ');\n\t for (var c = 0; c < classes.length; ++c) {\n\t var matches = classes[c].match(/^language-(.+)$/);\n\t if (matches !== null) {\n\t language = matches[1];\n\t break;\n\t }\n\t }\n\t }\n\n\t // unescape html entities in content\n\t content = showdown.helper.unescapeHTMLEntities(content);\n\n\t presPH.push(content);\n\t pres[i].outerHTML = '<precode language=\"' + language + '\" precodenum=\"' + i.toString() + '\"></precode>';\n\t } else {\n\t presPH.push(pres[i].innerHTML);\n\t pres[i].innerHTML = '';\n\t pres[i].setAttribute('prenum', i.toString());\n\t }\n\t }\n\t return presPH;\n\t }", "_highlightCode() {\n let code = this.$('pre code');\n\n code.each((i, block) => {\n Highlight.highlightBlock(block);\n });\n }", "function wrapCodePre() {\n var wrap = document.getElementsByTagName('code');\n for (var i = 0; i < wrap.length; i++) {\n if (wrap[i].outerHTML) {\n wrap[i].outerHTML = '<pre>' + wrap[i].outerHTML + '</pre>';\n } else {\n var tmp = document.createElement('pre');\n tmp.appendChild(wrap.cloneNode(true));\n wrap.parentNode.replaceChild(tmp, wrap);\n }\n }\n}", "function format_html_output() {\r\n var text = String(this);\r\n text = text.tidy_xhtml();\r\n\r\n if (Prototype.Browser.WebKit) {\r\n text = text.replace(/(<div>)+/g, \"\\n\");\r\n text = text.replace(/(<\\/div>)+/g, \"\");\r\n\r\n text = text.replace(/<p>\\s*<\\/p>/g, \"\");\r\n\r\n text = text.replace(/<br \\/>(\\n)*/g, \"\\n\");\r\n } else if (Prototype.Browser.Gecko) {\r\n text = text.replace(/<p>/g, \"\");\r\n text = text.replace(/<\\/p>(\\n)?/g, \"\\n\");\r\n\r\n text = text.replace(/<br \\/>(\\n)*/g, \"\\n\");\r\n } else if (Prototype.Browser.IE || Prototype.Browser.Opera) {\r\n text = text.replace(/<p>(&nbsp;|&#160;|\\s)<\\/p>/g, \"<p></p>\");\r\n\r\n text = text.replace(/<br \\/>/g, \"\");\r\n\r\n text = text.replace(/<p>/g, '');\r\n\r\n text = text.replace(/&nbsp;/g, '');\r\n\r\n text = text.replace(/<\\/p>(\\n)?/g, \"\\n\");\r\n\r\n text = text.gsub(/^<p>/, '');\r\n text = text.gsub(/<\\/p>$/, '');\r\n }\r\n\r\n text = text.gsub(/<b>/, \"<strong>\");\r\n text = text.gsub(/<\\/b>/, \"</strong>\");\r\n\r\n text = text.gsub(/<i>/, \"<em>\");\r\n text = text.gsub(/<\\/i>/, \"</em>\");\r\n\r\n text = text.replace(/\\n\\n+/g, \"</p>\\n\\n<p>\");\r\n\r\n text = text.gsub(/(([^\\n])(\\n))(?=([^\\n]))/, \"#{2}<br />\\n\");\r\n\r\n text = '<p>' + text + '</p>';\r\n\r\n text = text.replace(/<p>\\s*/g, \"<p>\");\r\n text = text.replace(/\\s*<\\/p>/g, \"</p>\");\r\n\r\n var element = Element(\"body\");\r\n element.innerHTML = text;\r\n\r\n if (Prototype.Browser.WebKit || Prototype.Browser.Gecko) {\r\n var replaced;\r\n do {\r\n replaced = false;\r\n element.select('span').each(function(span) {\r\n if (span.hasClassName('Apple-style-span')) {\r\n span.removeClassName('Apple-style-span');\r\n if (span.className == '')\r\n span.removeAttribute('class');\r\n replaced = true;\r\n } else if (span.getStyle('fontWeight') == 'bold') {\r\n span.setStyle({fontWeight: ''});\r\n if (span.style.length == 0)\r\n span.removeAttribute('style');\r\n span.update('<strong>' + span.innerHTML + '</strong>');\r\n replaced = true;\r\n } else if (span.getStyle('fontStyle') == 'italic') {\r\n span.setStyle({fontStyle: ''});\r\n if (span.style.length == 0)\r\n span.removeAttribute('style');\r\n span.update('<em>' + span.innerHTML + '</em>');\r\n replaced = true;\r\n } else if (span.getStyle('textDecoration') == 'underline') {\r\n span.setStyle({textDecoration: ''});\r\n if (span.style.length == 0)\r\n span.removeAttribute('style');\r\n span.update('<u>' + span.innerHTML + '</u>');\r\n replaced = true;\r\n } else if (span.attributes.length == 0) {\r\n span.replace(span.innerHTML);\r\n replaced = true;\r\n }\r\n });\r\n } while (replaced);\r\n\r\n }\r\n\r\n for (var i = 0; i < element.descendants().length; i++) {\r\n var node = element.descendants()[i];\r\n if (node.innerHTML.blank() && node.nodeName != 'BR' && node.id != 'bookmark')\r\n node.remove();\r\n }\r\n\r\n text = element.innerHTML;\r\n text = text.tidy_xhtml();\r\n\r\n text = text.replace(/<br \\/>(\\n)*/g, \"<br />\\n\");\r\n text = text.replace(/<\\/p>\\n<p>/g, \"</p>\\n\\n<p>\");\r\n\r\n text = text.replace(/<p>\\s*<\\/p>/g, \"\");\r\n\r\n text = text.replace(/\\s*$/g, \"\");\r\n\r\n return text;\r\n }", "function hightlightCodeBlock(codeElement, preElement) {\n \n // ignore elements that have already been printed\n if (preElement != null && preElement.classList.contains(\"hljs\")) {\n return;\n }\n \n // ignore elements that have already been printed\n if (codeElement != null && codeElement.classList.contains(\"hljs\")) {\n return;\n }\n \n fixMsdnMagazine(codeElement, preElement);\n \n var hasOnlyBRs = true;\n\n for (var i = 0; i < codeElement.children.length; i++) {\n var child = codeElement.children[i];\n if (child.tagName != \"BR\") {\n hasOnlyBRs = false;\n break;\n }\n }\n\n // somebody put <br/>s in our code block, so remove them\n if (hasOnlyBRs) {\n console.log(\"removing BRs\");\n while (codeElement.lastElementChild != null) {\n codeElement.removeChild(codeElement.lastElementChild);\n }\n }\n\n hljs.highlightBlock(codeElement);\n}", "function parse(){\n let lines = editor.innerText.split(\"\\n\");\n let newText = \"\";\n\n lines.forEach(line => {\n let sub;\n let lineContent = line.split(\" \");\n let markdownTag = lineContent[0];\n \n if (markdownTags.includes(markdownTag)) {\n lineContent.shift();\n sub = lineContent.join(\" \");\n\n switch (markdownTag) {\n case \"#\":\n newText += \"<h1>\" + sub + \"</h2>\";\n break;\n \n case \"##\":\n newText += \"<h2>\" + sub + \"</h2>\";\n break;\n\n case \"###\":\n newText += \"<h3>\" + sub + \"</h3>\";\n break;\n\n case \"####\":\n newText += \"<h4>\" + sub + \"</h5>\";\n break;\n }\n }\n else{\n newText += line + \"<br>\";\n }\n //newText += \"<br>\";\n });\n\n copyAsPlainText(newText);\n}", "function addLineBreaks(text) {\n\t// test to see if it was created in the new editor\n\tif (allParams.editorVersion && parseInt(\"0\" + allParams.editorVersion, 10) >= 3)\n\t{\n\t\treturn text; // Return text unchanged\n\t}\n\t// Now try to identify v3beta created LOs\n\tvar trimmedText = $.trim(text);\n\tif ((trimmedText.indexOf(\"<p\") == 0 || trimmedText.indexOf(\"<h\") == 0) && (trimmedText.lastIndexOf(\"</p\") == trimmedText.length-4 || trimmedText.lastIndexOf(\"</h\") == trimmedText.length-5))\n\t{\n\t\treturn text; // Return text unchanged\n\t}\n\t\n // Now assume it's v2.1 or before\n if (text.indexOf(\"<math\") == -1 && text.indexOf(\"<table\") == -1) {\n return text.replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n\t\t\n } else { // ignore any line breaks inside these tags as they don't work correctly with <br>\n var newText = text;\n if (newText.indexOf(\"<math\") != -1) { // math tag found\n var tempText = \"\",\n mathNum = 0;\n\n while (newText.indexOf(\"<math\", mathNum) != -1) {\n var text1 = newText.substring(mathNum, newText.indexOf(\"<math\", mathNum)),\n tableNum = 0;\n while (text1.indexOf(\"<table\", tableNum) != -1) { // check for table tags before/between math tags\n tempText += text1.substring(tableNum, text1.indexOf(\"<table\", tableNum)).replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n tempText += text1.substring(text1.indexOf(\"<table\", tableNum), text1.indexOf(\"</table>\", tableNum) + 8);\n tableNum = text1.indexOf(\"</table>\", tableNum) + 8;\n }\n tempText += text1.substring(tableNum).replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n tempText += newText.substring(newText.indexOf(\"<math\", mathNum), newText.indexOf(\"</math>\", mathNum) + 7);\n mathNum = newText.indexOf(\"</math>\", mathNum) + 7;\n }\n\n var text2 = newText.substring(mathNum),\n tableNum = 0;\n while (text2.indexOf(\"<table\", tableNum) != -1) { // check for table tags after math tags\n tempText += text2.substring(tableNum, text2.indexOf(\"<table\", tableNum)).replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n tempText += text2.substring(text2.indexOf(\"<table\", tableNum), text2.indexOf(\"</table>\", tableNum) + 8);\n tableNum = text2.indexOf(\"</table>\", tableNum) + 8;\n }\n tempText += text2.substring(tableNum).replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n newText = tempText;\n\n } else if (newText.indexOf(\"<table\") != -1) { // no math tags - so just check table tags\n var tempText = \"\",\n tableNum = 0;\n while (newText.indexOf(\"<table\", tableNum) != -1) {\n tempText += newText.substring(tableNum, newText.indexOf(\"<table\", tableNum)).replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n tempText += newText.substring(newText.indexOf(\"<table\", tableNum), newText.indexOf(\"</table>\", tableNum) + 8);\n tableNum = newText.indexOf(\"</table>\", tableNum) + 8;\n }\n tempText += newText.substring(tableNum).replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n newText = tempText;\n }\n\n return newText;\n }\n}", "function r(e,t){e.selection.isCollapsed()&&e.selection.selectLine();for(var n=e.selection.surround(t),o=0,s=n.length;o<s;o++)b.dom.lineBreaks(n[o]).remove(),u(n[o]);// rethink restoring selection\n// composer.selection.selectNode(element, wysihtml5.browser.displaysCaretInEmptyContentEditableCorrectly());\n}", "function highlight(text) {\n var src_str = $(\"#demo\").html();\n var term = text;\n term = term.replace(/(\\s+)/, \"(<[^>]+>)*$1(<[^>]+>)*\");\n var pattern = new RegExp(\"(\" + term + \")\", \"gi\");\n\n src_str = src_str.replace(pattern, \"<mark>$1</mark>\");\n src_str = src_str.replace(/(<mark>[^<>]*)((<[^>]+>)+)([^<>]*<\\/mark>)/, \"$1</mark>$2<mark>$4\");\n\n $(\"#demo\").html(src_str);\n}", "function substitutePreCodeTags (doc) {\n\n var pres = doc.querySelectorAll('pre'),\n presPH = [];\n\n for (var i = 0; i < pres.length; ++i) {\n\n if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') {\n var content = pres[i].firstChild.innerHTML.trim(),\n language = pres[i].firstChild.getAttribute('data-language') || '';\n\n // if data-language attribute is not defined, then we look for class language-*\n if (language === '') {\n var classes = pres[i].firstChild.className.split(' ');\n for (var c = 0; c < classes.length; ++c) {\n var matches = classes[c].match(/^language-(.+)$/);\n if (matches !== null) {\n language = matches[1];\n break;\n }\n }\n }\n\n // unescape html entities in content\n content = showdown.helper.unescapeHTMLEntities(content);\n\n presPH.push(content);\n pres[i].outerHTML = '<precode language=\"' + language + '\" precodenum=\"' + i.toString() + '\"></precode>';\n } else {\n presPH.push(pres[i].innerHTML);\n pres[i].innerHTML = '';\n pres[i].setAttribute('prenum', i.toString());\n }\n }\n return presPH;\n }", "function Calendar_fixupTags( wtext )\n{\norig = new String( wtext )\norig = this.replaceStr( orig, \"<br>\", \"*br*\" )\norig = this.replaceStr( orig, \" \", \"&nbsp\" )\norig = this.replaceStr( orig, \"<\", \"<\" )\norig = this.replaceStr( orig, \">\", \">\" )\norig = this.replaceStr( orig, \"*br*\", \"<br>\" )\nreturn orig\n}", "function lt(e,t,a,r,f,o,i){if(t){var s,c=e.splitSpaces?dt(t,e.trailingSpace):t,u=e.cm.state.specialChars,l=!1;if(u.test(t)){s=document.createDocumentFragment();for(var d=0;;){u.lastIndex=d;var _=u.exec(t),p=_?_.index-d:t.length-d;if(p){var g=document.createTextNode(c.slice(d,d+p));vo&&wo<9?s.appendChild(n(\"span\",[g])):s.appendChild(g),e.map.push(e.pos,e.pos+p,g),e.col+=p,e.pos+=p}if(!_)break;d+=p+1;var h=void 0;if(\"\\t\"==_[0]){var b=e.cm.options.tabSize,y=b-e.col%b;h=s.appendChild(n(\"span\",m(y),\"cm-tab\")),h.setAttribute(\"role\",\"presentation\"),h.setAttribute(\"cm-text\",\"\\t\"),e.col+=y}else\"\\r\"==_[0]||\"\\n\"==_[0]?(h=s.appendChild(n(\"span\",\"\\r\"==_[0]?\"鈵�\":\"鈵�\",\"cm-invalidchar\")),h.setAttribute(\"cm-text\",_[0]),e.col+=1):(h=e.cm.options.specialCharPlaceholder(_[0]),h.setAttribute(\"cm-text\",_[0]),vo&&wo<9?s.appendChild(n(\"span\",[h])):s.appendChild(h),e.col+=1);e.map.push(e.pos,e.pos+1,h),e.pos++}}else e.col+=t.length,s=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,s),vo&&wo<9&&(l=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),a||r||f||l||i){var v=a||\"\";r&&(v+=r),f&&(v+=f);var w=n(\"span\",[s],v,i);return o&&(w.title=o),e.content.appendChild(w)}e.content.appendChild(s)}}", "function fromPres(preHtmls, newBlock) {\n var docFrag = newBlock[0].ownerDocument.createDocumentFragment();\n for (var i = 0; i < preHtmls.length; i++) {\n var blockHtml = preHtmls[ i ];\n\n // 1. Trim the first and last line-breaks immediately after and before <pre>,\n // they're not visible.\n blockHtml = blockHtml.replace(/(\\r\\n|\\r)/g, '\\n');\n blockHtml = replace(blockHtml, /^[ \\t]*\\n/, '');\n blockHtml = replace(blockHtml, /\\n$/, '');\n // 2. Convert spaces or tabs at the beginning or at the end to &nbsp;\n blockHtml = replace(blockHtml, /^[ \\t]+|[ \\t]+$/g, function (match, offset) {\n if (match.length == 1) // one space, preserve it\n return '&nbsp;';\n else if (!offset) // beginning of block\n return new Array(match.length).join('&nbsp;') + ' ';\n else // end of block\n return ' ' + new Array(match.length).join('&nbsp;');\n });\n\n // 3. Convert \\n to <BR>.\n // 4. Convert contiguous (i.e. non-singular) spaces or tabs to &nbsp;\n blockHtml = blockHtml.replace(/\\n/g, '<br>');\n blockHtml = blockHtml.replace(/[ \\t]{2,}/g,\n function (match) {\n return new Array(match.length).join('&nbsp;') + ' ';\n });\n\n var newBlockClone = newBlock._4e_clone();\n newBlockClone.html(blockHtml);\n docFrag.appendChild(newBlockClone[0]);\n }\n return docFrag;\n }", "clean(html) {\n\t\treturn html\n\t\t\t.replace(/(&#xA0;)+/g, ' ')\n\t\t\t.replace(' ', ' ')\n\t\t\t.replace(/\\s*([<>])\\s*/g, '$1');\n\t}", "function getOffsetsAfterAccountingForSomeSpecialSelectionCases(allText, offsets) {\n var newOffs = oldOffs = offsets;\n \n // strip leading and trailing white space\n newOffs = getOffsetsAfterStrippingWhiteSpace(allText,newOffs[0],newOffs[1]);\n \n //remove trailing &nbsp; tag if there\n // this can happen if a user shift down-clicks and the following line\n // is empty; dw expands the selection to include the \"<p>nbsp;\"\n // on the next line\n var selStr = allText.substring(newOffs[0],newOffs[1]);\n var chunk = \"&nbsp;\";\n var chunkPos = selStr.lastIndexOf(chunk);\n if (chunkPos!=-1 && chunkPos == (selStr.length - chunk.length)) \n newOffs[1] -= chunk.length;\n\n // remove last tag if it is an opening block tag\n // this can happen if a user shift down-clicks; dw selects the\n // opening block tag on the next paragraph, resulting in a selection like:\n // <p>|some text</p>\n // <p>|more text</p>\n selStr = allText.substring(newOffs[0], newOffs[1]);\n var pattern = /<([^>]*)>$/;\n var result = selStr.match(pattern);\n if (result != null){\n if ( isAContainerTag(result[1]) ){\n newOffs[1] -= result[0].length;\n }\n }\n\n // if selection starts with a closing block tag, remove it\n // this can happen if a user puts the mouse at the end of a line and\n // presses shift-up-arrow to select it\n selStr = allText.substring(newOffs[0],newOffs[1]);\n pattern = /^<\\/([^>]*)>/;\n result = selStr.match(pattern);\n if (result != null){\n if ( isAContainerTag(result[1]) ){\n newOffs[0] += result[0].length;\n }\n }\n\n // strip leading and trailing white space if offsets have changed\n if (newOffs != oldOffs){\n newOffs = getOffsetsAfterStrippingWhiteSpace(allText,newOffs[0],newOffs[1]);\n oldOffs = newOffs;\n }\n\n // account for special list case: selecting the first item in a list\n // can select the opening <ol> or <ul> as well. Strip it.\n newOffs = getOffsetsAfterListCheck(allText,newOffs[0],newOffs[1]);\n\n // strip leading and trailing white space if offsets have changed\n if (newOffs != oldOffs){\n newOffs = getOffsetsAfterStrippingWhiteSpace(allText,newOffs[0],newOffs[1]);\n }\n \n return newOffs;\n\n}", "function markdownEscapeTableCell(text) {\n return text.replace(/\\n/g, \"<br />\").replace(/\\|/g, \"\\\\|\");\n } // Filter away the rows that have no content", "fixBlankLines(){\n\t\tconst settingName = \"language-roff.blankLineReplacement\";\n\t\tconst replacement = atom.config.get(settingName) || \".\";\n\t\t\n\t\tthis.replace(/^[ \\t]*$/gm, match => {\n\t\t\tconst {range, replace} = match;\n\t\t\tconst {scopes} = ed.scopeDescriptorForBufferPosition(range.start);\n\t\t\tif(-1 === scopes.indexOf(\"comment.block.ignored-input.roff\")\n\t\t\t&& -1 === scopes.indexOf(\"meta.function.definition.request.de.roff\")\n\t\t\t&& -1 === scopes.indexOf(\"meta.function.definition.request.am.roff\")\n\t\t\t&& -1 === scopes.indexOf(\"string.unquoted.roff\"))\n\t\t\t\treplace(replacement);\n\t\t});\n\t}", "function textTransformToHtml(text)\n{\n var html = text;\n //html = html.replace(/&/gi, \"&amp;\");\n //html = html.replace(/</gi, \"&lt;\").replace(/>/gi, \"&gt;\");\n html = html.replace(/\\r\\n/gi, \"<br/>\").replace(/\\n/gi, \"<br/>\");\n html = html.replace(/\\[h(\\d)\\](.+?)\\[\\/h\\d\\]/gi, \"<h$1>$2</h$1>\");\n\n html = html.replace(/\\[q\\](.+?)\\[q\\]/g, '<i class=\"ttQuoted\">$1</i>');\n html = html.replace(/\\[f\\](.+?)\\[f\\]/g, '<b class=\"ttFilename\">$1</b>');\n html = html.replace(/\\[space=(.+?)\\]/g, '<span style=\"margin-right: $1\">&nbsp;</span>');\n html = html.replace(/\\[mdash\\]/g, '&mdash;');\n\n html = html.replace(/\\[img(.*?)\\](.+?)\\[\\/img\\]/g, '<img $1 src=\"$2\" />');\n html = html.replace(/\\[a(.*?)\\](.+?)\\[\\/a\\]/g, '<a $1 target=\"_blank\">$2</a>');\n\n html = html.replace(/<br\\/>(\\d)\\. /g, '<br/><b class=\"numlist\">$1.</b> ');\n\n // word-highliter\n var words = new Array();\n var rx = /\\[wh=([abcdefABCDEF0-9]+?)\\](.+?)\\[wh\\]/g;\n var match;\n while (match = rx.exec(html))\n {\n var color = match[1];\n var word = match[2];\n words[word] = color;\n }\n html = html.replace(/\\[wh=[abcdefABCDEF0-9]+?\\].+?\\[wh\\]/gi, \"\");\n for (word in words)\n {\n color = words[word];\n html = replaceTextNotBetween(html, \"[code\", \"[/code]\", word, '<span style=\"color: #' + color + '\">' + word + '</span>');\n }\n\n\n // prepare code for syntax highlighting\n html = html.replace(/\\[code (class=\"brush\\: .+?\")\\](.+?)\\[\\/code\\]/gi, \"<pre $1>$2</pre>\");\n html = replaceTextBetween(html, '<pre class=\"brush', \"</pre>\", \"<br/>\", \"\\n\");\n\n return html;\n}", "function Tt(e,t){var a=t.text.className,n=kt(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Nt(e,t)):a&&(t.text.className=a)}", "function parseWithRegex(post) {\n\t\tvar html = post.innerHTML;\n\n\t\t// Replace all titles (h1/h2/etc), regex explanation:\n\t\t// ^[\\s]* - Line can start with spaces, we ignore those\n\t\t// ([#]+) - Match a sequence of #\n\t\t// (?:\\s)* - After the hash we can have many spaces, we ignore those\n\t\t// (.*?)(?:<br>)?$ - Then match everything in non-greedy mode (as little as possible) until the end, line can end\n\t\t// with <br> so we ignore it\n\t\thtml = html.replace(/^[\\s]*([#]+)(?:\\s)*(.*?)(?:<br>)?$/gm, function(match, hashes, title) {\n\t\t\tvar headerLevel = hashes.length;\n\t\t\treturn '<h' + headerLevel + '>' + title + '</h' + headerLevel + '>'\n\t\t});\n\n\t\t// Replace all code blocks, regex explanation:\n\t\t// ^``` - line should start with ```\n\t\t// ([a-zA-Z]+)? - Then optionally we could have a language (characters only)\n\t\t// ((?:.|\\n)*?)``` - Then we match anything until ```, since '.' doesn't match \\n we need (.|\\n),\n\t\t// and we don't want that brackets in the match so adding ?:\n\t\t// and we want to match until first occurrence of ``` (non-greedy) so adding *?\n\t\t// (?:\\<br>)?$ - Then we expect br tag or end-of-line\n\t\thtml = html.replace(/^```([a-zA-Z]+)?((?:.|\\n)*?)```(?:<br>)?$/gm, '<pre><code class=\"$1\">$2</code></pre>');\n\n\t\t// Next replace code quotes, regex explanation:\n\t\t// Match anything between backticks, the character before the closing backtick should not be \"\\\" (escaped backtick)\n\t\thtml = html.replace(/`(.*?[^\\\\])`/g, '<code>$1</code>');\n\n\t\t// Next replace all escaped backticks (\\`) with backticks\n\t\thtml = html.replace(/\\\\`/g, '`');\n\n\t\tpost.innerHTML = html;\n\n\t\t// Loop thru all the created code blocks and remove all <br>, also remove the first \"\\n\"\n\t\tvar codes = post.querySelectorAll('pre > code');\n\t\tfor (var i = 0; i < codes.length; ++i) {\n\t\t\tvar code = codes[i].innerHTML;\n\t\t\tcode = code.replace(/<br>/g, '').replace(/^\\n/, '');\n\t\t\tcodes[i].innerHTML = code;\n\t\t}\n\t}", "function autoEdTablestoWikitext(str) { //MAIN FUNCTION describes list of fixes\n \n // Remove newlines from inside table specific tags\n var loopcount = 0;\n while( str.search(/(?:<\\/?table|<\\/?tr|<\\/?td|<\\/?th)[^<>]*[\\r\\n]/gi) >= 0 && loopcount <= 10 ) {\n str.replace(/((?:<\\/?table|<\\/?tr|<\\/?td|<\\/?th)[^<>]*)[\\r\\n]/gi, '$1 ')\n loopcount++;\n }\n // Remove extra whitespace from inside table specific tags\n str=str.replace(/(<table|<tr|<td|<th)([^<>]*?)[\\s]+(>)/gim, '$1$2$3');\n str=str.replace(/(<table|<tr|<td|<th)([^<>]*?)[\\s][\\s]+/gim, '$1$2 ');\n // Remove any extra junk </tr>, </td>, </th>, </table>\n str=str.replace(/(<\\/table|<\\/tr|<\\/td|<\\/th)[^<>]+(>)/gim, '$1$2');\n // Remove space whitespace after </tr>, </td>, </th>, <table>\n str=str.replace(/(<\\/tr>|<\\/td>|<\\/th>|<table[^<>]*>)[\\s]+/gim, '$1');\n // Remove space before <tr>, <td>, <th>, </table>\n str=str.replace(/[\\s]+(<\\/table>|<tr[^<>]*>|<td[^<>]*>|<th[^<>]*>)/gim, '$1');\n // Replace '<table stuff>' with '{| stuff'\n str=str.replace(/<table( [^<>]*|)>[\\s]*/gim, '{|$1\\n');\n // Replace '</table>' with '|}'\n str=str.replace(/[\\s]*<\\/table>/gi, '\\n|}');\n // Replace '</td><td>' with '||'\n str=str.replace(/<\\/td[\\s]*>[\\s]*<td[\\s]*>/gim, '||');\n str=str.replace(/<\\/td[\\s]*>[\\s]*<td ([^<>]+)>/gim, '|| $1 |');\n // Replace '</th><th>' with '!!'\n str=str.replace(/<\\/th[\\s]*>[\\s]*<th[\\s]*>/gim, '!!');\n str=str.replace(/<\\/th[\\s]*>[\\s]*<th ([^<>]+)>/gim, '!! $1 |');\n // Replace '</td></tr>' and '</th></tr>' with EOL\n str=str.replace(/<\\/(?:td|th)>[\\s]*<\\/tr>[\\s]/gim, '\\n');\n // Replace '</td>', '</th>', '</tr>' with EOL\n str=str.replace(/<\\/(?:td|th|tr)>[\\s]*/gim, '\\n');\n // Replace '<tr>' with '|-'\n str=str.replace(/[\\s]*<tr>[\\s]*/gim, '\\n|-\\n');\n str=str.replace(/[\\s]*<tr ([^<>]*)>[\\s]*/gim, '\\n|- $1\\n');\n // Replace '<td>' with '|'\n str=str.replace(/[\\s]*<td>([^\\s])/gim, '\\n| $1');\n str=str.replace(/[\\s]*<td>([\\s])/gim, '\\n|$1');\n str=str.replace(/[\\s]*<td[\\s]*([^<>]*?)[\\s]*>([^\\s])/gim, '\\n| $1 | $2');\n str=str.replace(/[\\s]*<td[\\s]*([^<>]*?)[\\s]*>([\\s])/gim, '\\n| $1 |$2');\n // Replace '<th>' with '!'\n str=str.replace(/[\\s]*<th>([^\\s])/gim, '\\n! $1');\n str=str.replace(/[\\s]*<th>([\\s])/gim, '\\n!$1');\n str=str.replace(/[\\s]*<th[\\s]*([^<>]*?)[\\s]*>([^\\s])/gim, '\\n! $1 | $2');\n str=str.replace(/[\\s]*<th[\\s]*([^<>]*?)[\\s]*>([^\\s])/gim, '\\n! $1 |$2');\n \n return str;\n}", "function formatText(text){\n text = text.replace(/\\r/g, \" \").replace(/\\n/g, \" \");\n text = text.replaceAll(/#w(.*?)#w;/g, \"<span class='text-important'>$1</span>\");\n text = text.replaceAll(/##(.*?)##;/g, \"<span class='text-title'>$1</span>\");\n text = text.replaceAll(/#d(.*?)#d;/g, \"<span class='text-discrete'>$1</span>\");\n text = text.replaceAll(/\\*\\*(.*?)\\*\\*/g, \"<b>$1</b>\");\n text = text.replaceAll(/\\*(.*?)\\*/g, \"<i>$1</i>\");\n text = text.replaceAll(\"#\\\\n\", \"<br/><br/>\");\n text = text.replaceAll(/#u(.*?)#u;/g, \"<ul>$1</ul>\");\n text = text.replaceAll(/#i(.*?)#i;/gim, \"<li>$1</li>\");\n text = text.replaceAll(/#ic(.*?)#ic;/gim, \"<span class='text-inlinecode'>$1</span>\");\n return text;\n}", "function preprocessData(data) {\n\n function addSpans(body) {\n var code = body.children(\"pre\");\n if (code.length > 0) {\n code.each(function() {\n $(this).html(function(_, text) {\n return text.replace(/^<code>/, \"<span>\")\n .replace(/(\\r\\n|\\n|\\r)/gm, \"</span>\\r\\n<span>\")\n .replace(/<\\/code>$/, \"</span>\");\n });\n });\n }\n var par = body.children(\"p\");\n if (par.length > 0) {\n par.each(function() {\n $(this).html(function(_, text) {\n return \"<span>\" + text.replace(/\\.\\s/gm, \"</span>\\r\\n<span>\") + \"</span>\";\n });\n });\n }\n return body;\n }\n\n function highlightCode(body) {\n body.find(\"pre\").each(function(_, block) {\n hljs.highlightBlock(block);\n });\n }\n\n /* Add spans for each line of each answer body so we can look move the\n * preview window to focus precisely at that line. */\n for (var i = 0; i < data.length; i++) {\n data[i].body = addSpans($(\"<div>\" + data[i].body + \"</div>\"));\n highlightCode(data[i].body);\n }\n }", "function hp(){\nvar a = $(\"#html\").val();\nconsole.log('Moving whitespace.....')\na = rms(a)\nconsole.log(a)\n var b=''\n var tp=0;\n var is_new_line = true; // if No next Line is true will doesnt cretat a new line..\n var is_inside_start_tag = 0// Indise_StartTag=1; inside_end_tag =3 ; Inside test: 2\n\n for(i=0;i<a.length;i++) {\n if(a[i] != '>' && a[i] != '<'){ \n //Do Nothing...\n }\n else if(a[i] == '<' && a[i+1]!='/'){ //start tag: It will always in new tab and next line.. \n { b += '\\n '+ gettab(tp); tp++;}\n is_inside_start_tag = 1;\n } \n // End tag Start. Shoud i do it same line or a new line with -- tab ?\n else if(a[i] == '<'&& a[i+1]=='/'){ //endtag: Always tab - and <nocol>\n is_inside_start_tag = 3;\n tp--;\n if(is_new_line){ b += '\\n '+ gettab(tp)}\n else{\n is_new_line = true\n }\n }\n // No New line if Start-tag End\n // 1. <div></div>\n // 2. <div>hello</div>\n else if((is_inside_start_tag == 1)&&\n ( (a[i] == '>' && a[i+1] == '<' && a[i+2] == '/')||\n (a[i] == '>' && a[i+1] != '<'))){ // tag doesnt contains tag but something else..\n is_new_line = false\n }\n else if(1){\n \n }\n b += a[i] \n }\n $(\"#html\").val(b)\n}", "function highlight() {\n\t\t$('pre code').each(function(i, e) {\n\t\t hljs.highlightBlock(e)\n\t\t});\n\t}", "function Da(e,t,a){function r(e,t,a,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),s.appendChild(n(\"div\",null,\"CodeMirror-selected\",\"position: absolute; left: \"+e+\"px;\\n top: \"+t+\"px; width: \"+(null==a?l-e:a)+\"px;\\n height: \"+(r-t)+\"px\"))}function f(t,a,n){function f(a,n){return sa(e,R(t,a),\"div\",_,n)}function o(t,a,n){var r=ma(e,_,null,t),o=\"ltr\"==a==(\"after\"==n)?\"left\":\"right\";return f(\"after\"==n?r.begin:r.end-(/\\s/.test(_.text.charAt(r.end-1))?2:1),o)[o]}var s,c,_=T(i,t),m=_.text.length,p=Se(_,i.direction);return xe(p,a||0,null==n?m:n,function(e,t,i,_){var g=\"ltr\"==i,h=f(e,g?\"left\":\"right\"),b=f(t-1,g?\"right\":\"left\"),y=null==a&&0==e,v=null==n&&t==m,w=0==_,x=!p||_==p.length-1;if(b.top-h.top<=3){// Single line\n var E=(d?y:v)&&w,S=(d?v:y)&&x,C=E?u:(g?h:b).left,k=S?l:(g?b:h).right;r(C,h.top,k-C,h.bottom)}else{// Multiple lines\n var T,N,M,O;g?(T=d&&y&&w?u:h.left,N=d?l:o(e,i,\"before\"),M=d?u:o(t,i,\"after\"),O=d&&v&&x?l:b.right):(T=d?o(e,i,\"before\"):u,N=!d&&y&&w?l:h.right,M=!d&&v&&x?u:b.left,O=d?o(t,i,\"after\"):l),r(T,h.top,N-T,h.bottom),h.bottom<b.top&&r(u,h.bottom,null,b.top),r(M,b.top,O-M,b.bottom)}(!s||Oa(h,s)<0)&&(s=h),Oa(b,s)<0&&(s=b),(!c||Oa(h,c)<0)&&(c=h),Oa(b,c)<0&&(c=b)}),{start:s,end:c}}var o=e.display,i=e.doc,s=document.createDocumentFragment(),c=Ut(e.display),u=c.left,l=Math.max(o.sizerWidth,zt(e)-o.sizer.offsetLeft)-c.right,d=\"ltr\"==i.direction,_=t.from(),m=t.to();if(_.line==m.line)f(_.line,_.ch,m.ch);else{var p=T(i,_.line),g=T(i,m.line),h=de(p)==de(g),b=f(_.line,_.ch,h?p.text.length+1:null).end,y=f(m.line,h?0:null,m.ch).start;h&&(b.top<y.top-2?(r(b.right,b.top,null,b.bottom),r(u,y.top,y.left,y.bottom)):r(b.right,b.top,y.left-b.right,b.bottom)),b.bottom<y.top&&r(u,b.bottom,null,y.top)}a.appendChild(s)}", "function wrapOrReplaceSelectionInDocRemoveNBSP(codeBeforeSel, codeAfterSel, defaultCodeForEmptySel, codeToReplaceSel)\n{\n var dom = dw.getDocumentDOM();\n\tif( dom )\n\t{\n\t\tvar sel = dwscripts.getBalancedSelection(dom);\n\t\tvar docHTML = dom.documentElement.outerHTML;\n\t\tvar preCode = docHTML.substring(0,sel[0]);\n\t\tvar nbspStr = dom.getNBSPChar();\n\t\tif (preCode.length > nbspStr.length)\n\t\t{\n\t\t\tvar nbspIndex = preCode.lastIndexOf(nbspStr); \n\t\t\tif (nbspIndex != -1)\n\t\t\t{\n\t\t\t\tif (nbspIndex == preCode.length-nbspStr.length)\n\t\t\t\t{\n\t\t\t\t\t//we have a &nbsp; preceeding us we can remove\n\t\t\t\t\tpreCode = preCode.substring(0,preCode.length - nbspStr.length);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvar postCode = docHTML.substring(sel[sel.length-1]);\n\t\tif (postCode.length > nbspStr.length)\n\t\t{\n\t\t //we have a &nbsp; following us we can remove\n\t\t\tvar nbspIndex = postCode.indexOf(nbspStr); \n\t\t\tif (nbspIndex != -1)\n\t\t\t{\n\t\t\t\tif (nbspIndex == 0)\n\t\t\t\t{\n\t\t\t\t\t//we have a &nbsp; preceeding us\n\t\t\t\t\tpostCode = postCode.substring(nbspStr.length,postCode.length);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tvar selectedCode;\n\t\tif( codeToReplaceSel )\n\t\t{\n\t\t\tselectedCode = codeToReplaceSel;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tselectedCode = docHTML.substring(sel[0], sel[sel.length-1]);\n\t\t\tif (!selectedCode || selectedCode.length == 0 || selectedCode == nbspStr)\n\t\t\t\tselectedCode = defaultCodeForEmptySel;\n\t\t}\n\t\t\n\t\tif( !codeBeforeSel )\n\t\t\tcodeBeforeSel = \"\";\n\t\tif( !codeAfterSel )\n\t\t\tcodeAfterSel = \"\";\n\t\t\t\t\n\t\tvar newDocHTML = preCode + codeBeforeSel + selectedCode + codeAfterSel + postCode;\n\t\tdom.documentElement.outerHTML = newDocHTML;\n\t}\n}", "valueReformattedForMultilines(value) {\n if (typeof(value)==\"string\") return(value.replace(/\\n/ig,\"<br/>\"));\n else return(value);\n }", "get whitespace() {\n return this.spec.whitespace || (this.spec.code ? \"pre\" : \"normal\");\n }", "function nt(e,t,a,n,r,f,o){var i=a.flattenSpans;null==i&&(i=e.options.flattenSpans);var s,c=0,u=null,l=new di(t,e.options.tabSize,n),d=e.options.addModeClass&&[null];for(\"\"==t&&at(Je(a,n.state),f);!l.eol();){if(l.pos>e.options.maxHighlightLength?(i=!1,o&&Ye(e,t,n,l.pos),l.pos=t.length,s=null):s=at(et(a,l,n.state,d),f),d){var _=d[0].name;_&&(s=\"m-\"+(s?_+\" \"+s:_))}if(!i||u!=s){for(;c<l.start;)c=Math.min(l.start,c+5e3),r(c,u);u=s}l.start=l.pos}for(;c<l.pos;){\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var m=Math.min(l.pos,c+5e3);r(m,u),c=m}}", "function improve_formatting($obj) {\n\tif (typeof($obj) === 'undefined') $obj = $('body');\n\t$obj.find('p img').unwrap();\n\t$obj.find('div[contenteditable] > p > div').unwrap();\n\tvar list = $obj.find('ol,ul');\n\tif (list.parent().is('p')) list.unwrap();\n\t\t\n\tvar div_contenteditable = $obj.find('div[contenteditable]');\n\tvar plainText = div_contenteditable.contents().filter(function() { return this.nodeType === 3; });\n\tplainText.wrap('<p />');\n\t\n\t// Plain-text cuts inline elements out of paragraphs. Fixing with this.\n\t$obj.find('div[contenteditable]').children('a,b,i,u,sub,sup,strong,em').each(function() { \n\t\tvar $this = $(this);\n\t\tvar prev_p = $this.prev('p');\n\t\tif (prev_p.html()) $this.prev('p').append($this);\n\t\telse $this.wrap('<p>');\n\t\tvar new_parent = $this.parent('p');\n\t\tnew_parent.append(new_parent.next('p').detach().html());\n\t});\n\t\n\tdiv_contenteditable.children('br').remove();\n\tdiv_contenteditable.children('p').filter(function() { var html = $(this).html(); return (html == '\\n' || html == '\\n\\t'); }).remove()\n\t\n\tdiv_contenteditable.children('div').each(function() { \n\t\tvar string = '';\n\t\tif ($(this).html() != '<br>') string = '<p>' + $(this).html() + '</p>';\n\t\t$(this).replaceWith(string); \n\t});\n}", "indentLines (start, end, backwards = false) {\n for (var i = start; i > 0 && this.text[i - 1] !== '\\n'; i--);\n\n let replace = this.text.slice(i, end);\n let insert, offset;\n\n if (backwards) {\n insert = (replace[0] === \"\\t\" ? replace.slice(1) : replace).replace(allNewLineTabs, \"\\n\");\n offset = (i < start && replace[0] === \"\\t\") ? -1 : 0;\n } else {\n insert = \"\\t\" + replace.replace(allNewLines, \"\\n\\t\");\n offset = 1;\n }\n\n let postStart = start + offset;\n let postEnd = i + insert.length;\n let edit = {\n start: i,\n end,\n insert,\n replace,\n preSelection: this.selection,\n postSelection: {start: postStart, end: postEnd, isCollapsed: postStart === postEnd, backwards: this.selection.backwards}\n };\n this.edit(edit);\n this.editHistory.push(edit);\n this.redoStack = [];\n }", "function highlightBlock(block, tabReplace, useBR) {\n var text = blockText(block, useBR);\n var language = blockLanguage(block);\n var result, pre;\n if (language == 'no-highlight')\n return;\n if (language) {\n result = highlight(language, text);\n } else {\n result = highlightAuto(text);\n language = result.language;\n }\n var original = nodeStream(block);\n if (original.length) {\n pre = document.createElement('pre');\n pre.innerHTML = result.value;\n result.value = mergeStreams(original, nodeStream(pre), text);\n }\n result.value = fixMarkup(result.value, tabReplace, useBR);\n\n var class_name = block.className;\n if (!class_name.match('(\\\\s|^)(language-)?' + language + '(\\\\s|$)')) {\n class_name = class_name ? (class_name + ' ' + language) : language;\n }\n if (is_old_IE && block.tagName == 'CODE' && block.parentNode.tagName == 'PRE') {\n // This is for backwards compatibility only. IE needs this strange\n // hack becasue it cannot just cleanly replace <code> block contents.\n pre = block.parentNode;\n var container = document.createElement('div');\n container.innerHTML = '<pre><code>' + result.value + '</code></pre>';\n block = container.firstChild.firstChild;\n container.firstChild.className = pre.className;\n pre.parentNode.replaceChild(container.firstChild, pre);\n } else {\n block.innerHTML = result.value;\n }\n block.className = class_name;\n block.result = {\n language: language,\n kw: result.keyword_count,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n kw: result.second_best.keyword_count,\n re: result.second_best.relevance\n };\n }\n }", "function removeWrap(code)\r\n{\r\n\tif (code){\r\n\r\n\t\tvar b = false;\r\n\t\tif (window.activeEditor.mode==\"edit\") {\r\n\t\t\tb = code.match(BodyContents);\r\n\t\t\tif (b) {\r\n\t\t\t\tcode = b[2];\r\n\t\t\t}\r\n\t\t}\r\n\t\tc1 = wrap_tag_expr;\r\n\t\tc2 = wrap_end_tag_expr;\r\n\t\tvar count=0;var count2=0;\r\n\r\n\t\tedit_begin_tags\t= code.match(begin_edit_expr);\r\n\t\tedit_end_tags\t= code.match(end_edit_expr);\r\n\r\n\t\t//if (c1.test(code)){\r\n\t\t\tcode = code.replace(c1,function(s1,s2){count++;return edit_begin_tags[count-1];});\r\n\t\t\tcode = code.replace(c2,function(s1,s2){count2++;return edit_end_tags[count2-1];});\r\n\t\t//}\r\n\t\tif (b) {\r\n\t\t\treturn b[1] + code + b[3];\r\n\t\t} else {\r\n\t\t\treturn code;\r\n\t\t}\r\n\r\n\t} else {\r\n\t\treturn \"\";\r\n\t}\r\n}", "function format_html_input() {\r\n var text = String(this);\r\n\r\n var element = Element(\"body\");\r\n element.innerHTML = text;\r\n\r\n if (Prototype.Browser.Gecko || Prototype.Browser.WebKit) {\r\n element.select('strong').each(function(element) {\r\n element.replace('<span style=\"font-weight: bold;\">' + element.innerHTML + '</span>');\r\n });\r\n element.select('em').each(function(element) {\r\n element.replace('<span style=\"font-style: italic;\">' + element.innerHTML + '</span>');\r\n });\r\n element.select('u').each(function(element) {\r\n element.replace('<span style=\"text-decoration: underline;\">' + element.innerHTML + '</span>');\r\n });\r\n }\r\n\r\n if (Prototype.Browser.WebKit)\r\n element.select('span').each(function(span) {\r\n if (span.getStyle('fontWeight') == 'bold')\r\n span.addClassName('Apple-style-span');\r\n\r\n if (span.getStyle('fontStyle') == 'italic')\r\n span.addClassName('Apple-style-span');\r\n\r\n if (span.getStyle('textDecoration') == 'underline')\r\n span.addClassName('Apple-style-span');\r\n });\r\n\r\n text = element.innerHTML;\r\n text = text.tidy_xhtml();\r\n\r\n text = text.replace(/<\\/p>(\\n)*<p>/g, \"\\n\\n\");\r\n\r\n text = text.replace(/(\\n)?<br( \\/)?>(\\n)?/g, \"\\n\");\r\n\r\n text = text.replace(/^<p>/g, '');\r\n text = text.replace(/<\\/p>$/g, '');\r\n\r\n if (Prototype.Browser.Gecko) {\r\n text = text.replace(/\\n/g, \"<br>\");\r\n text = text + '<br>';\r\n } else if (Prototype.Browser.WebKit) {\r\n text = text.replace(/\\n/g, \"</div><div>\");\r\n text = '<div>' + text + '</div>';\r\n text = text.replace(/<div><\\/div>/g, \"<div><br></div>\");\r\n } else if (Prototype.Browser.IE || Prototype.Browser.Opera) {\r\n text = text.replace(/\\n/g, \"</p>\\n<p>\");\r\n text = '<p>' + text + '</p>';\r\n text = text.replace(/<p><\\/p>/g, \"<p>&nbsp;</p>\");\r\n text = text.replace(/(<p>&nbsp;<\\/p>)+$/g, \"\");\r\n }\r\n\r\n return text;\r\n }", "function clearBlockFormat(editor, tagsToUnwrap, tagsToStopUnwrap, attributesToPreserve) {\n if (tagsToUnwrap === void 0) { tagsToUnwrap = exports.TAGS_TO_UNWRAP; }\n if (tagsToStopUnwrap === void 0) { tagsToStopUnwrap = exports.TAGS_TO_STOP_UNWRAP; }\n if (attributesToPreserve === void 0) { attributesToPreserve = exports.ATTRIBUTES_TO_PRESERVE; }\n editor.focus();\n editor.addUndoSnapshot(function (start, end) {\n var groups = [{}];\n var stopUnwrapSelector = tagsToStopUnwrap.join(',');\n // 1. Collapse the selected blocks and get first and last element\n collapseSelectedBlocks_1.default(editor, function (element) {\n var group = groups[groups.length - 1];\n var td = editor.getElementAtCursor(stopUnwrapSelector, element);\n if (td != group.td && group.first) {\n groups.push((group = {}));\n }\n group.td = td;\n group.first = group.first || element;\n group.last = element;\n });\n groups\n .filter(function (group) { return group.first; })\n .forEach(function (group) {\n // 2. Collapse with first and last element to make them under same parent\n var nodes = editor.collapseNodes(group.first, group.last, true /*canSplitParent*/);\n // 3. Continue collapse until we can't collapse any more (hit root node, or a table)\n if (canCollapse(tagsToStopUnwrap, nodes[0])) {\n while (editor.contains(nodes[0].parentNode) &&\n canCollapse(tagsToStopUnwrap, nodes[0].parentNode)) {\n nodes = [roosterjs_editor_dom_1.splitBalancedNodeRange(nodes)];\n }\n }\n // 4. Clear formats of the nodes\n nodes.forEach(function (node) {\n return clearNodeFormat(node, tagsToUnwrap, tagsToStopUnwrap, attributesToPreserve);\n });\n // 5. Clear CSS of container TD if exist\n if (group.td) {\n var styles = group.td.getAttribute('style') || '';\n var styleArray = styles.split(';');\n styleArray = styleArray.filter(function (style) {\n return style\n .trim()\n .toLowerCase()\n .indexOf('border') == 0;\n });\n styles = styleArray.join(';');\n if (styles) {\n group.td.setAttribute('style', styles);\n }\n else {\n group.td.removeAttribute('style');\n }\n }\n });\n editor.select(start, end);\n }, \"Format\" /* Format */);\n}", "function apply_indents() {\n // TODO:SOMEONE MAKE GLOBAL OPTION THAT THESE AREN'T THERE first, make sure indents are _never_ applied to the first paragraph of a section\n $source.find('.hz_column_break_after').each(function() {\n $(this).find('p:first').addClass('hz_no_indent');\n });\n \n // apply indents everywhere they're expected\n $source.find('p').not('.hz_no_indent, .opening').each(function() {\n $(this).html(\"\" + $(this).html());\n });\n }", "function undoHighlightCurrentCode() {\n // Change the css property by applying no highlighted background color\n $(\"#code_\" + registers[\"rip\"]).css(\"background-color\", \"\");\n}", "function processItems(items) {\n var content = '\\t\\t<ul>\\n' ;\n var codeMode = false;\n var tabsCounted = 0;\n for(var item of items) {\n if(item=='') continue;\n // first replace some special characters\n // check if code mode is activated\n if(item[0]=='{') {\n codeMode=true;\n content += '</ul>\\n<pre>';//'<li>\\n' + '<pre>\\n';\n continue;\n } else if (item[0]=='}' && codeMode) {\n codeMode=false;\n content += '</pre>\\n<ul>';\n //content += '</pre>\\n';\n //content += '</li>\\n';\n continue;\n }\n if(codeMode) {\n content += item+'\\n';//escapeHtml(item)+'\\n' ;\n continue;\n }\n //\n //nested lists denoted with tab\n if(numberOfTabs(item) != tabsCounted) {\n var difference = numberOfTabs(item) - tabsCounted;\n var i=0;\n for(i=0; i<Math.abs(difference); i++) {\n if(difference>0) content += '\\t\\t<ul>\\n';\n else content += '\\t\\t</ul>\\n';\n }\n tabsCounted = numberOfTabs(item) ;\n }\n //\n // then expand html tags\n // and replace tabs\n //content += item.replace('&','&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('\\n','').replace('\\r','');\n item = escapeHtml(item)\n content += '<li>'+ replaceTags(item) +'</li>\\n'\n }\n //\n // polish it off\n content += '\\t\\t</ul>\\n';\n return content ;\n }", "function indent2(code) { return code.replace(/^(.+)$/gm, ' $1'); }", "function indent2(code) { return code.replace(/^(.+)$/gm, ' $1'); }", "function injectPreInHTML(text, borderColor, destinationTab) {\n if (window) {\n // insert PRE element\n let pre = document.createElement(\"PRE\")\n pre.classList.add('orasyo-content-report')\n pre.innerText = text\n // pre.style.margin = '1.1rem';\n pre.style.padding = '1.1rem';\n pre.style.paddingTop = '3.1rem';\n pre.style.paddingLeft = '3.1rem';\n pre.style.paddingBottom = '3.1rem';\n pre.style.backgroundColor = 'black';\n pre.style.color = 'lightGray';\n pre.style.borderLeftWidth = '13px';\n pre.style.borderLeftStyle = 'solid';\n pre.style.borderLeftColor = borderColor;\n pre.style.fontFamily = '\"Lucida Console\", \"Courier New\", monospace';\n pre.style.zIndex = '99999';\n document.getElementById(destinationTab).appendChild(pre)\n }\n}", "function unHighlight() {\r\n var sel = window.getSelection && window.getSelection();\r\n if (sel && sel.rangeCount == 0 && savedRange != null) {\r\n sel.addRange(savedRange);\r\n }\r\n if (sel && sel.rangeCount > 0) {\r\n // Get location and text info\r\n let range = sel.getRangeAt(0);\r\n console.log(range)\r\n let node = document.createElement('p')\r\n node.setAttribute('class', 'unhighlight')\r\n let selText = range.cloneContents();\r\n node.appendChild(selText);\r\n let markedList = node.getElementsByTagName('mark');\r\n for (let i = 0; i < markedList.length; i++) {\r\n markedList[i].outerHTML = markedList[i].innerHTML;\r\n }\r\n\r\n range.deleteContents();\r\n range.insertNode(node);\r\n // Remove the tags from inserted node\r\n var unHiteLiteList = document.getElementsByClassName('unhighlight');\r\n\r\n for (let i = 0 ; i < unHiteLiteList.length; i ++) {\r\n var parent = unHiteLiteList[i].parentNode;\r\n while (unHiteLiteList[i].firstChild) {\r\n parent.insertBefore(unHiteLiteList[i].firstChild, unHiteLiteList[i]);\r\n }\r\n parent.removeChild(unHiteLiteList[i]);\r\n }\r\n // range.selectNodeContents(selText); \r\n saveCurrentState();\r\n }\r\n }", "function colorize (text) {\n var segment = {text: '', idx: 0};\n var segments = [segment];\n var classes = [];\n var obj = {segments, classes};\n var unmatchedTick;\n var unmatchedTickIdx;\n\n var cur = {initial: true};\n colorcode_to_json(text).lines.forEach(l => {\n l.forEach(c => {\n if (cur.newline) {\n // starting a non-first line, let's reset and write a newline\n segment = {text: '\\n', idx: segments.length};\n segments.push(segment);\n }\n\n if (cur.b != c.b || cur.i != c.i || cur.u != c.u || cur.fg != c.fg) {\n if (cur.initial) {\n if (c.value === 62 && l.length > 3) { // >\n classes.push('quote');\n return; // don't include the >\n }\n if (c.value === 32 || c.value === 9) { // space, tab\n classes.push('monospace');\n }\n } else {\n segment = {text: '', idx: segments.length};\n segments.push(segment);\n }\n css = ''\n if (c.b) css += 'font-weight:bold;';\n if (c.i) css += 'font-style:italic;';\n if (c.u) css += 'text-decoration:underline;';\n if (c.fg != 1) css += 'color:'+palette[c.fg]+';';\n if (c.bg != 1) css += 'background-color:'+palette[c.bg]+';';\n segment.css = css;\n cur = c;\n }\n\n var recordText = true;\n\n if (c.value === 96) { // `\n if (unmatchedTick) {\n var segIdx = segments.indexOf(unmatchedTick);\n var tickIdx = unmatchedTickIdx; // unmatchedTick.text.indexOf('`');\n const isCurrent = unmatchedTick === segment;\n\n // split out any prefix\n if (tickIdx > 0) {\n var newSeg = JSON.parse(JSON.stringify(unmatchedTick));\n newSeg.text = newSeg.text.slice(0, tickIdx);\n segments.splice(segIdx, 0, newSeg);\n\n unmatchedTick.text = unmatchedTick.text.slice(tickIdx);\n segIdx++;\n tickIdx = 0;\n }\n\n // adopt the contents\n if (unmatchedTick.text.length > 1) {\n unmatchedTick.text = unmatchedTick.text.slice(1);\n recordText = false;\n\n // mark all segments between there and here\n while (segIdx < segments.length) {\n segments[segIdx].type = 'code';\n segIdx++;\n }\n\n // make a new non-code segment\n segment = {text: '', idx: segments.length};\n segments.push(segment);\n\n unmatchedTick = null;\n unmatchedTickIdx = null;\n } else {\n unmatchedTick = segment;\n unmatchedTickIdx = segment.text.length;\n }\n\n } else {\n unmatchedTick = segment;\n unmatchedTickIdx = segment.text.length;\n }\n }\n\n if (recordText) {\n segment.text += String.fromCharCode(c.value);\n }\n });\n\n // wipe state in case there's more lines\n cur = {initial: true, newline: true};\n });\n\n // Check for URLs, break into link segments\n var segCount = segments.length;\n for (var i = 0; i < segCount; i++) {\n var match;\n const seg = segments[i];\n if (match = seg.text.match(/^(.*?)\\b([a-z+]+):\\/\\/([^ ]+)\\b(.*)$/)) {\n if ((match[1].length + match[2].length) === 0) {\n continue;\n }\n if (match[1].length) {\n const preSeg = JSON.parse(JSON.stringify(segments[i]));\n preSeg.text = match[1];\n segments.splice(i, 0, preSeg);\n i++;\n segCount++;\n }\n if (match[4].length) {\n const postSeg = JSON.parse(JSON.stringify(segments[i]));\n postSeg.text = match[4];\n segments.splice(i+1, 0, postSeg);\n segCount++;\n }\n // this is pretty bad\n if (match[1].length) {\n i-=2;\n }\n seg.text = match[2] + '://' + match[3];\n\n const slices = seg.text.split('/');\n seg.scheme = match[2];\n seg.domain = slices[2];\n seg.origin = slices.slice(0,3).join('/');\n seg.path = '/'+slices.slice(3).join('/');\n seg.type = 'link';\n }\n }\n\n // Number the segments for vue\n segments.forEach((seg, idx) => seg.idx = idx);\n\n // If there's only one segment, make sure it's not empty\n if (segments.length == 1 && !segments[0].text) {\n segments[0].text = ' ';\n }\n\n return obj;\n}", "function format_tags(targets_parent){\r\n\tfunction get_case(elem){\r\n\t //var text=$(elem).text().replace(/^\\s+|\\s+$/g,'');\r\n\t var text=$(elem).text().trim();\r\n\t var max_case=$(elem).attr(\"data-max-case\");\r\n\t var com=0;\r\n\t var type_case=\"input_char_barre\";\r\n\t if($(elem).attr(\"data-type-case\")==\"slash\"){\r\n\t\t type_case=\"input_char_slash\";\r\n\t }\r\n\t var show_text=\"<table class='tableau0 \"+type_case+\"' cellspacing='0'><tr>\";\r\n\t if(type_case==\"input_char_slash\"){\r\n\t\t show_text+=\"<td></td>\";\r\n\t } \r\n\t for(i=0;i<max_case;i++){\r\n\t\t show_text+=\"<td>\";\r\n\t\t if(i<text.length){\r\n\t\t if(text[i]==\"?\"){\r\n\t\t\tshow_text+=\" \";\r\n\t\t }else{\r\n\t\t\tshow_text+=text[i];\r\n\t\t }\r\n\t\t }\r\n\t\t \r\n\t\t show_text+=\"</td>\";\r\n\t }\r\n\t show_text+=\"</tr></table>\";\r\n\t \r\n\t $(elem).html(show_text);\r\n\t \r\n\t $(elem).find(\"td\").css('font-size',$(elem).attr(\"data-size\")+'px');\r\n\t \r\n\t if(type_case==\"input_char_barre\"){\r\n\t\t var w=$(elem).attr(\"data-width\");\r\n\t\t var h=$(elem).attr(\"data-height\");\r\n\t\t $(elem).find(\".input_char_barre td\").css({'width':w+'px','height':h+'px'});\r\n\t\t \r\n\t }\r\n\t\t\r\n\t if(type_case==\"input_char_slash\"){\r\n\t\t \r\n\t\t var w=$(elem).attr(\"data-width\");\r\n\t\t \r\n\t\t var h=$(elem).attr(\"data-height\");\r\n\t\t \r\n\t\t var back_w=parseInt(w)+8;\r\n\t\t var back_h=parseInt(h)+3;\r\n\t\t var f_back_w=w/4;\r\n\t\t var f_back_h=parseInt(h)+7;\r\n\t\t $(elem).find(\".input_char_slash td\").css({'width':w+'px','height':h+'px','background-size':back_w+'px '+back_h+'px'});\r\n\t\t $(elem).find(\".input_char_slash td:first-child\").css({'background-size':f_back_w+'px '+f_back_h+'px'});\r\n\t }\r\n\t }\r\n\t $(\".zone_case\").each(function( index ) {\r\n\t var text=$(this).text().replace(/^\\s+|\\s+$/g,''); \r\n\t var nbr_chars=text.length;\r\n\t var max_case=parseInt($(this).attr(\"data-max-case\"));\r\n\t var data_align=\"LTR\";\r\n\t \r\n\t if($(this).attr(\"data-align\")!=undefined){\r\n\t\t data_align=$(this).attr(\"data-align\");\r\n\t }\r\n\r\n\t var com=0;\r\n\t var type_case=\"input_char_barre\";\r\n\t if($(this).attr(\"data-type-case\")==\"slash\"){\r\n\t\t type_case=\"input_char_slash\";\r\n\t }\r\n\t var show_text=\"<table class='tableau0 \"+type_case+\"' cellspacing='0'><tr>\";\r\n\t if(type_case==\"input_char_slash\"){\r\n\t\t show_text+=\"<td></td>\";\r\n\t } \r\n\t for(i=0;i<max_case;i++){\r\n\t\t show_text+=\"<td>\";\r\n\t\t if(data_align==\"RTL\"){\r\n\t\t\t\r\n\t\t\tif(i>=max_case-nbr_chars){\r\n\t\t\t\tshow_text+=text[i-(max_case-nbr_chars)];\r\n\t\t\t}\r\n\t\t }else{\r\n\t\t\tif(i<nbr_chars){\r\n\t\t\t\tshow_text+=text[i];\r\n\t\t\t}\r\n\t\t }\r\n\t\t \r\n\t\t show_text+=\"</td>\";\r\n\t }\r\n\t show_text+=\"</tr></table>\";\r\n\t \r\n\t $(this).html(show_text);\r\n\t \r\n\t $(this).find(\"td\").css('font-size',$(this).attr(\"data-size\")+'px');\r\n\t \r\n\t if(type_case==\"input_char_barre\"){\r\n\t\t var w=$(this).attr(\"data-width\");\r\n\t\t var h=$(this).attr(\"data-height\");\r\n\t\t $(\".zone_case .input_char_barre td\").css({'width':w+'px','height':h+'px'});\r\n\t\t \r\n\t }\r\n\t\t\r\n\t if(type_case==\"input_char_slash\"){\r\n\t\t \r\n\t\t var w=$(this).attr(\"data-width\");\r\n\t\t \r\n\t\t var h=$(this).attr(\"data-height\");\r\n\t\t \r\n\t\t var back_w=parseInt(w)+8;\r\n\t\t var back_h=parseInt(h)+3;\r\n\t\t var f_back_w=w/4;\r\n\t\t var f_back_h=parseInt(h)+7;\r\n\t\t \r\n\t\t $(this).find(\".input_char_slash td\").css({'width':w+'px','height':h+'px','background-size':back_w+'px '+back_h+'px'});\r\n\t\t \r\n\t\t $(this).find(\".input_char_slash td:eq(0)\").css({'background-size':f_back_w+'px '+f_back_h+'px','width':'5px'});\r\n\t }\r\n\t });\r\n\t \r\n\t $(\".zone_date\").each(function( index ) {\r\n\t var date_val=$(this).text().trim();\r\n\t console.log(\"text1:::\"+date_val);\r\n\t var separ_case=$(this).attr(\"data-separator-case\");\r\n\t var date_sep=\"\";\r\n\t \r\n\t if(date_val.indexOf(\"/\")!=\"-1\"){\r\n\t date_sep=\"/\";\r\n\t }\r\n\t if(date_val.indexOf(\"-\")!=\"-1\"){\r\n\t date_sep=\"-\";\r\n\t }\r\n\t \r\n\t var split_date=date_val.split(date_sep);\r\n\t $(this).empty();\r\n\t var case_value=\"\";\r\n\t var width_dots=\"20\";\r\n\t for(var i=0;i<split_date.length;i++){\r\n\t if($(this).attr(\"data-type-case\")==\"dots\"){\r\n\t\tif(split_date[i]==\"??\" || split_date[i]==\"????\" ){\r\n\t\t\tcase_value+=\"&nbsp;\";\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tcase_value=split_date[i];\r\n\t\t}\r\n\t\tif(split_date[i].length==4){\r\n\t\t\twidth_dots=parseInt($(this).attr(\"data-width\"))*2;\r\n\t\t}else{\r\n\t\t\twidth_dots=$(this).attr(\"data-width\");\r\n\t\t}\r\n\t\t$(this).html($(this).html()+\"<div class='zone_point1' style='width:\"+width_dots+\"px;font-size:\"+$(this).attr(\"data-size\")+\"' >\"+case_value+\"</div>\");\r\n\t\tif(i<split_date.length-1){\r\n\t\t\t$(this).html($(this).html()+\"<strong>/</strong>\");\r\n\t\t}\r\n\t }else{\r\n\t\t$(this).html($(this).html()+\"<div class='zone_case' data-max-case='\"+split_date[i].length+\"' data-type-case='\"+$(this).attr(\"data-type-case\")+\"' data-size='\"+$(this).attr(\"data-size\")+\"' data-width='\"+$(this).attr(\"data-width\")+\"' data-height='\"+$(this).attr(\"data-height\")+\"'>\"+split_date[i]+\"</div>\");\r\n\t\tif(i<split_date.length-1){\r\n\t\t $(this).html($(this).html()+\"&nbsp;<b style='font-size:\"+(parseInt($(this).attr(\"data-size\"))*2)+\"px;'>\"+separ_case+\"</b>&nbsp;\");\r\n\t\t}\r\n\t\t\r\n\t\tget_case($(this).find(\".zone_case:eq(\"+i+\")\"));\r\n\t\tif($(this).attr(\"data-type-case\")==\"slash\"){\r\n\t\t $(this).find(\".zone_case table td:first-child\").css('width','2px');\r\n\t\t}\r\n\t }\r\n\t }\r\n\t \r\n\t \r\n\t \r\n\t });\r\n\t \r\n\t $(\".nombre\").each(function( index ) {\r\n\t\tvar val_text=$(this).text().replace(/^\\s*|\\s*$/,'');\r\n\t\tvar split_value=val_text.split(\".\");\r\n\t\tvar part_int;\r\n\t\tvar part_decimal;\r\n\t\tif(split_value.length==2){\r\n\t\t\tpart_int=split_value[0];\r\n\t\t\tpart_decimal=split_value[1];\r\n\t\t}else{\r\n\t\t\tpart_int=\" \";\r\n\t\t\tpart_decimal=\" \";\r\n\t\t}\r\n\t\t$(this).empty();\r\n\t\t\r\n\t\tvar int_part_html=\"<table class='chiffre' cellspacing='0'><tr>\";\r\n\t\t//int part\r\n\t\tfor( var i=0;i<$(this).attr(\"data-int-max\")-part_int.length;i++){\r\n\t\t\tint_part_html+=\"<td style='width:20px;'>&nbsp;</td>\";\r\n\t\t}\r\n\t\tfor(var i=0;i<part_int.length;i++){\r\n\t\t\tint_part_html+=\"<td style='width:20px;'>\"+part_int[i]+\"</td>\";\r\n\t\t}\r\n\t\tint_part_html+=\"</tr></table><table class='comma' cellspacing='0'><tr><td style='font-size:12px'>.</td></tr></table>\";\r\n\t\t\r\n\t\t//decimal part\r\n\t\tvar decimal_part_html=\"<table class='chiffre' cellspacing='0'><tr>\";\r\n\t\tfor(var i=0;i<part_decimal.length;i++){\r\n\t\t\t\r\n\t\t\tdecimal_part_html+=\"<td style='width:20px'>\"+part_decimal[i]+\"</td>\";\r\n\t\t}\r\n\t\tdecimal_part_html+=\"</tr></table>\";\r\n\t\t$(this).html($(this).html()+int_part_html+decimal_part_html);\r\n\t });\r\n\r\n\t $(\".zone_check\").each(function( index ) {\r\n\t var check_val=$(this).text().replace(/^\\s*|\\s*$/,'');\r\n\t var check_type=\"2d\";\r\n\t if($(this).attr(\"data-type\")){\r\n\t check_type=$(this).attr(\"data-type\");\r\n\t }\r\n\t \r\n\t if(check_type==\"3d\"){\r\n\t $(this).addClass(\"zone_check_3d\");\r\n\t }\r\n\t if(check_val==\"True\" || check_val==\"true\" || check_val==\"1\" || check_val==\"yes\" || check_val==\"x\" || check_val==\"X\"){\r\n\t $(this).text(\"x\");\r\n\t }else{\r\n\t $(this).empty();\r\n\t }\r\n\t });\r\n}", "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}" ]
[ "0.64509696", "0.64509696", "0.64509696", "0.64509696", "0.6434141", "0.63663816", "0.63663816", "0.63663816", "0.63601816", "0.6344901", "0.633459", "0.633459", "0.633459", "0.633459", "0.633459", "0.63028455", "0.6280744", "0.62220705", "0.62121034", "0.62121034", "0.62121034", "0.61884594", "0.6167299", "0.61563414", "0.60874057", "0.60378075", "0.60360605", "0.60320276", "0.60141045", "0.5902411", "0.5886403", "0.587584", "0.58596313", "0.58596313", "0.58596313", "0.5842319", "0.58392346", "0.5786203", "0.5757244", "0.57516015", "0.5713627", "0.5713577", "0.5693273", "0.56720483", "0.56714815", "0.5621404", "0.5590756", "0.55818576", "0.5581312", "0.5580616", "0.55669636", "0.55627376", "0.5536726", "0.5524887", "0.55169284", "0.55144715", "0.5507267", "0.5493104", "0.5468301", "0.54597193", "0.54537594", "0.5450659", "0.54399943", "0.5435548", "0.5428437", "0.5419031", "0.5418316", "0.5417674", "0.5401096", "0.5394708", "0.53938943", "0.53797984", "0.53676385", "0.5366859", "0.5360368", "0.53599674", "0.53560793", "0.53558", "0.53502333", "0.5349142", "0.5342705", "0.5340335", "0.5339701", "0.5339701", "0.53385526", "0.5324739", "0.53202707", "0.5316482", "0.53092796", "0.53092796", "0.53092796" ]
0.6209475
30
Applies highlighting to a DOM node containing code. Accepts a DOM node and two optional parameters for fixMarkup.
function highlightBlock(block) { var node, originalStream, result, resultNode, text; var language = blockLanguage(block); if (isNotHighlighted(language)) return; if (options.useBR) { node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div'); node.innerHTML = block.innerHTML.replace(/\n/g, '').replace(/<br[ \/]*>/g, '\n'); } else { node = block; } text = node.textContent; result = language ? highlight(language, text, true) : highlightAuto(text); originalStream = nodeStream(node); if (originalStream.length) { resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div'); resultNode.innerHTML = result.value; result.value = mergeStreams(originalStream, nodeStream(resultNode), text); } result.value = fixMarkup(result.value); block.innerHTML = result.value; block.className = buildClassName(block.className, language, result.language); block.result = { language: result.language, re: result.relevance }; if (result.second_best) { block.second_best = { language: result.second_best.language, re: result.second_best.relevance }; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highlightNode(node, highlightCallback, excludePredicate) {\n\t// if ('TR' === node.parentNode.nodeName.toUpperCase()) return;\n\tif (excludePredicate(node)) return;\n\n\t// Create a highlight\n\tvar highlight = highlightCallback(node);\n\t// Wrap it around the text node\n\tnode.parentNode.replaceChild(highlight, node);\n\thighlight.appendChild(node);\n\n\treturn highlight;\n}", "function highlight(node, ok) {\n if (!node) return;\n if (self.options.markParen) {\n self.options.markParen(node, ok);\n }\n else {\n node.style.fontWeight = \"bold\";\n node.style.color = ok ? \"#8F8\" : \"#F88\";\n }\n }", "highlightCode() {\n hljs.highlightElement(this.el);\n }", "function cmtxHighlightCode() {\n if (typeof(hljs) != 'undefined' && typeof(hljs.highlightElement) != 'undefined') {\n jQuery('.cmtx_code_box, .cmtx_php_box').each(function(i, el) {\n hljs.highlightElement(el);\n });\n }\n}", "function highlight2(code) {\n return code.replace(/(F+)/g,'<span style=\"color: pink\">$1</span>').\n replace(/(L+)/g,'<span style=\"color: red\">$1</span>').\n replace(/(R+)/g,'<span style=\"color: green\">$1</span>').\n replace(/(\\d+)/g,'<span style=\"color: orange\">$1</span>');\n}", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called) return;\n initHighlighting.called = true;\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t ArrayProto.forEach.call(blocks, highlightBlock);\n\t }", "_highlightCode() {\n let code = this.$('pre code');\n\n code.each((i, block) => {\n Highlight.highlightBlock(block);\n });\n }", "highlight(on) { }", "function highlight() {\n if (window.getSelection) {\n var selection = window.getSelection();\n if (selection.rangeCount) {\n var range = selection.getRangeAt(0).cloneRange();\n var highlightNode = document.createElement(\"span\");\n highlightNode.setAttribute(\"id\", \"highlighted\");\n highlightNode.setAttribute(\"style\", \"background-color:#FFFF00\");\n range.surroundContents(highlightNode);\n selection.removeAllRanges();\n }\n }\n}", "function highlight() {\n\t\t$('pre code').each(function(i, e) {\n\t\t hljs.highlightBlock(e)\n\t\t});\n\t}", "function highlightTree(tree, highlighter, \n/**\nAssign styling to a region of the text. Will be called, in order\nof position, for any ranges where more than zero classes apply.\n`classes` is a space separated string of CSS classes.\n*/\nputStyle, \n/**\nThe start of the range to highlight.\n*/\nfrom = 0, \n/**\nThe end of the range.\n*/\nto = tree.length) {\n let builder = new HighlightBuilder(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);\n builder.highlightRange(tree.cursor(), from, to, \"\", builder.highlighters);\n builder.flush(to);\n}", "colorNode(codeElement) {\n let lang = this.identifyLanguage(codeElement);\n codeElement.classList && codeElement.classList.add('panda-code', 'panda-' + lang);\n\n //optional 'ignore' language for ignoring code blocks.\n if(lang !== 'ignore') {\n //send to parser.\n codeElement.innerHTML = this.parse(lang, codeElement.textContent);\n }\n }", "function highlight(text) {\n var src_str = $(\"#demo\").html();\n var term = text;\n term = term.replace(/(\\s+)/, \"(<[^>]+>)*$1(<[^>]+>)*\");\n var pattern = new RegExp(\"(\" + term + \")\", \"gi\");\n\n src_str = src_str.replace(pattern, \"<mark>$1</mark>\");\n src_str = src_str.replace(/(<mark>[^<>]*)((<[^>]+>)+)([^<>]*<\\/mark>)/, \"$1</mark>$2<mark>$4\");\n\n $(\"#demo\").html(src_str);\n}", "function highlightSyntax(targetDocument, syntaxHighlighter, codeText, codeLanguage) {\n var codeElem, preElem, textNode;\n\n // highlight.js requires a `<code>` element to be passed in that has a\n // `<pre>` parent element.\n\n preElem = targetDocument.createElement('pre');\n codeElem = targetDocument.createElement('code');\n textNode = targetDocument.createTextNode(codeText);\n codeElem.appendChild(textNode);\n preElem.appendChild(codeElem);\n\n // If we're told the language, set it as a class so that the highlighter\n // doesn't have to guess it. This is part of the HTML5 standard. See:\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-code-element\n if (codeLanguage && codeLanguage.length > 0) {\n codeElem.setAttribute('class', 'language-'+codeLanguage);\n }\n else {\n codeElem.setAttribute('class', 'no-highlight');\n }\n\n syntaxHighlighter.highlightBlock(codeElem);\n\n return codeElem.innerHTML;\n }", "function highlightTag(tag) {\n var pTag = _ById('htmlContent');\n var tokens = xmlText.split(tag);\n var node;\n var len = tokens.length - 1;\n pTag.innerHTML = '';\n\n for (var i = 0; i < len; i++) {\n node = document.createTextNode(tokens[i])\n pTag.appendChild(node);\n node = document.createElement('mark');\n node.appendChild(document.createTextNode(tag))\n pTag.appendChild(node);\n }\n node = document.createTextNode(tokens[i])\n pTag.appendChild(node);\n}", "function highlightRewritten(selection, container, anchorNode, focusNode, anchorOffset, focusOffset, highlightColor, uniqueId){\n // NOTE: Look at highlightTry6 for the current highlight function\n}", "function markIt(node) {\n node.addClass(\"marked\");\n jsav.umsg(\"Mark node \" + node.value());\n node.highlight();\n jsav.step();\n}", "function highlightCurrentCode() {\n // Change the css property by applying a highlighted background color of orange\n $(\"#code_\" + registers[\"rip\"]).css('background-color', '#df9857');\n}", "function highlightInCodeBlocks() {\n\n var codes = document.querySelectorAll('pre code');\n \n for (var i = 0; i < codes.length; ++i) {\n var code = codes[i];\n var pre = code.parentElement;\n\n hightlightCodeBlock(code, pre);\n }\n}", "function highlight(text, style) {\n var page_html = document.getElementById('page').innerHTML;\n var page = document.getElementById('page');\n var draft_html = document.getElementById('draft').innerHTML;\n var draft = document.getElementById('draft');\n text = text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); //https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex\n\n var re = new RegExp(text, 'g');\n var m;\n\n if (text.length > 0) {\n page.innerHTML = page_html.replace(re, `<span style='background-color:${style};'>$&</span>`);\n draft.innerHTML = draft_html.replace(re, `<span style='background-color:${style};'>$&</span>`);\n\n } else {\n page.innerHTML = page_html;\n draft.innerHTML = draft_html;\n }\n }", "function highlightText(text, $node){ \n var searchText = $.trim(text).toLowerCase(), currentNode = $node.get(0).firstChild, matchIndex, newTextNode, newSpanNode;\n while ((matchIndex = currentNode.data.toLowerCase().indexOf(searchText)) >= 0) {\n newTextNode = currentNode.splitText(matchIndex);\n currentNode = newTextNode.splitText(searchText.length);\n newSpanNode = document.createElement(\"span\");\n newSpanNode.className = \"highlight\";\n currentNode.parentNode.insertBefore(newSpanNode, currentNode);\n newSpanNode.appendChild(newTextNode);\n }\n }", "function highlightCode() {\n\n \tvar htmlcode_div = document.getElementById(\"htmlcode_div\");\n\n \tvar html_content = htmlcode_div.innerHTML;\n \tvar open_highlight = \"<pre class='language-xml wrs_inline' style='word-wrap:break-word;background-color:white'><code>\";\n \tvar close_highlight = \"</code></pre>\";\n\n \tif (_wrs_conf_saveMode == \"xml\") {\n\n \t\t/* Format the MATH tags */\n\n \t\tvar indexs_end = html_content.getMatchIndices(\"&lt;/math&gt;\");\n\n \t\tfor (var i = indexs_end.length - 1; i >= 0; i--) {\n \t\t\tvar actual_index_end = indexs_end[i] + 13;\n \t\t\thtml_content = html_content.splice(actual_index_end, 0, close_highlight);\n \t\t}\n\n \t\tvar indexs_start = html_content.getMatchIndices(\"&lt;math\");\n\n \t\tfor (var i = indexs_start.length - 1; i >= 0; i--) {\n \t\t\tvar actual_index_start = indexs_start[i];\n \t\t\thtml_content = html_content.splice(actual_index_start, 0, open_highlight);\n \t\t}\n\n\n \t}\n \telse if (_wrs_conf_saveMode == \"image\" || _wrs_conf_saveMode == \"base64\") {\n\n \t\t/* Format the IMG and BASE64 */\n \t\tconsole.log(\"IMAGE MODE\");\n\n \t\tvar indexs_start = html_content.getMatchIndices(\"&lt;img\");\n \t\tif (indexs_start == 0){\n \t\t\tindexs_start = html_content.getMatchIndices(\"&lt;IMG\");\n \t\t}\n \t\tvar indexs_end = [];\n\n \t\tfor (var i = indexs_start.length - 1; i >= 0; i--) {\n \t\t\tvar actual_index_start = indexs_start[i];\n\n \t\t\tfor (var j = actual_index_start; j < html_content.length - 4; j++) {\n \t\t\t\tif (html_content[j] == \"&\" && html_content[j+1] == \"g\" && html_content[j+2] == \"t\" && html_content[j+3] == \";\"){\n \t\t\t\t\thtml_content = html_content.splice(j+4, 0, close_highlight);\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n\n \t\t\thtml_content = html_content.splice(actual_index_start, 0, open_highlight);\n \t\t}\n\n \t}\n\n \thtmlcode_div.innerHTML = html_content;\n\n\t// Prism library. For demo purposes.\n\tPrism.highlightAll();\n}", "function doHighlighting(className, highlight) {\n for (x of className.split(' ')) {\n if (x.includes('ast')) {\n className = x;\n }\n }\n if (highlight) {\n d3.select('#svgCenter').selectAll('circle.' + className)\n .style('fill', 'cyan');\n\n d3.select('#svgScatter').selectAll('circle.' + className)\n .style('fill', 'cyan');\n\n d3.select(\"#svgBar\").selectAll('rect.' + className)\n .style('fill', 'cyan');\n } else {\n d3.select('#svgCenter').selectAll('circle.' + className)\n .style('fill', 'gray');\n\n d3.select('#svgScatter').selectAll('circle.' + className)\n .style('fill', 'black');\n\n d3.select('#svgBar').selectAll('rect.' + className)\n .style('fill', 'pink');\n }\n}", "function highlight(code) {\n return new Promise((resolve, reject) => {\n pygmentize({ lang: 'html', format: 'html' }, code, function (err, result) {\n if (err) {\n console.log(err);\n reject(err);\n } else {\n resolve(result.toString());\n }\n });\n });\n}", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n var pres = document.getElementsByTagName('pre');\n for (var i = 0; i < pres.length; i++) {\n var code = findCode(pres[i]);\n if (code)\n highlightBlock(code, hljs.tabReplace);\n }\n }", "function setHightlightTag(data) {\n\n var addHighlighterDirective = function () {\n var element = $(this);\n // Trim & remove double-spaces.\n // Note: \\s cannot be used because newlines must be preserved.\n element.text(element.text().trim().replace(/ {2}/g, ' '));\n return element.attr('sit-code-highlight', true);\n };\n for (var i = 0; i < data.length; i++) {\n var strHtml = \"\";\n if (data[i].Contents) {\n strHtml = data[i].Contents;\n var selectors = '.codeSnippetContainerCode > pre, code';\n var objHtml = $('<div>' + strHtml + '</div>');\n objHtml.find(selectors).replaceWith(addHighlighterDirective);\n strHtml = objHtml.html();\n }\n\n //Re-assign to data\n if (strHtml || strHtml !== '') {\n data[i].Contents = strHtml;\n }\n\n }\n }", "function code(h, node) {\n var value = node.value ? node.value + \"\\n\" : \"\";\n const lang = node.lang;\n const meta = (node.meta || \"\").split(\" \");\n const props = {};\n\n if (lang) {\n props.className = [\"brush:\", lang.toLowerCase(), ...meta];\n } else if (node.meta) {\n props.className = meta;\n }\n\n /*\n * Prism will inject a <code> element so we don't.\n * If we wanna change this uncomment the following code:\n */\n // const code = h(node, \"code\", props, [u(\"text\", value)]);\n // if (node.meta) {\n // code.data = { meta: node.meta };\n // }\n // return h(node.position, \"pre\", props, [code]);\n\n return h(node.position, \"pre\", props, [u(\"text\", value)]);\n}", "function regularSyntaxColoringAndAutoIndent(event){\n\n \t\tvar sbwin = Chickenfoot.getSidebarWindow(chromeWindow);\n \tvar ed = sbwin.getSelectedBuffer().editor;\n \tvar doc = ed.contentDocument;\n \tvar pre = doc.getElementById(\"pre\"); \n \tvar anchorNodeCaret = sbwin.getSelectedBuffer().api.selection.anchorNode;\n \tvar anchorOffsetCaret = sbwin.getSelectedBuffer().api.selection.anchorOffset;\n \t\n \t//count characters\n \tvar chars=0;\n \t/*\n \tif (event.keyCode ==13 & anchorNodeCaret.nodeName==\"SPAN\") {\n \t\tdebug(\"charCount SPAN BR\");\n \t\tchars=charCountSpanBr(anchorNodeCaret,pre.childNodes);\n \t}else{\n \t\tchars=charCount(anchorNodeCaret,anchorOffsetCaret,pre.childNodes);\n \t}*/\n \tchars=charCount(anchorNodeCaret,anchorOffsetCaret,pre.childNodes);\n \t\n \t//eliminate spans, specifically:\n \t//<span style=\"color: blue;\">\n \t//<span style=\"color: purple;\">\n\t\t//<span style=\"color: green;\">\n\t\t//</span>\n\t\t\n\t\tvar spanRegEx = /(<span style=\"color: purple;\">|<span style=\"color: blue;\">|<span style=\"color: green;\">|<\\/span>)/gm;\n \t\n \tpre.innerHTML=pre.innerHTML.replace(spanRegEx,\"\");\n \t//recolor\n \tsyntaxColor(pre, CF_JAVASCRIPT_RULES); \n \t\n\t\t//replace caret\n\t\tcaretPlacement(chars,pre,sbwin);\n\t\t\n\t\t//autoIndent : only on return, } , and ctrl+tab\n \tvar pre2 = doc.getElementById(\"pre\"); \n \t//debug('event.keyCode');\n \t//debug(event.keyCode);\n \t//if(false){\n \tif(event.keyCode==13||event.keyCode==221||(event.ctrlKey && event.keyCode==9)){\n \t\tvar lines = makeLines(pre2);\n \t\t//debug('lines');\n \t\t//debug(lines);\n \t\tfor (i in lines){\n \t\t//debug(lines[i]);\n \t\t}\n \t\tvar anchorNodeCaret2 = sbwin.getSelectedBuffer().api.selection.focusNode;\n \t\tvar anchorOffsetCaret2 = sbwin.getSelectedBuffer().api.selection.focusOffset;\n \t\t\tvar lineNum=findNodeInLines(lines,anchorNodeCaret2,anchorOffsetCaret2);\n \t\t\t//debug('lineNum= '+lineNum);\n\t\t\t//this is how many spaces we need to indent our line by\n\t\t\t\n\t\t\tif (lines[lineNum][0].parentNode.nodeName==\"SPAN\"){\n\t\t\t\t//do nothing\n\t\t\t\t//debug('inside a span node, dont change indent');\n\t\t\t}else{\n\t\t\t\tvar indents=calculateIndents(lines,lineNum);\n\t\t\t\t\n\t\t\t\t//debug('INDENTS: '+indents)\n\t\t\t\t/*\n\t\t\t\tdebug(\"event.keycode\");\n\t\t\t\tdebug(lines[lineNum]);\n\t\t\t\tdebug(doc);\n\t\t\t\tdebug(pre);\n\t\t\t\tdebug(sbwin);\n\t\t\t\tdebug(anchorNodeCaret2);\n\t\t\t\tdebug(anchorOffsetCaret2);\n\t\t\t\tdebug(\"event.keycode\");\n\t\t\t\t*/\n\t\t\t\t//debug(\"changeIndent\");\n\t\t\t\tchangeIndent(lines[lineNum],indents,doc,pre,sbwin,anchorNodeCaret2,anchorOffsetCaret2);\n\t\t\t}\n\t\t}\n\t\t/*\n\t\tvar pre2 = doc.getElementById(\"pre\"); \n \tvar anchorNodeCaret2 = sbwin.getSelectedBuffer().api.selection.focusNode;\n \tvar anchorOffsetCaret2 = sbwin.getSelectedBuffer().api.selection.focusOffset;\n\t\t\n\t\tdebug('pre');\n \tdebug(pre.childNodes);\n \tdebug(anchorNodeCaret2.data+\"+end\");\n \tdebug(anchorNodeCaret2);\n \tdebug(anchorOffsetCaret2);\n \t//debug(pre.innerHTML)\n \t*/\n \t//debug(\"FINISHED\");\n \t\n \t\n}", "function highlight() {\n var code_blocks = document.body.getElementsByClassName(\"language-c\");\n var keywords = [\n \"auto\", \"break\", \"case\", \"char\", \"const\", \"continue\", \"default\",\n \"do\", \"double\", \"else\", \"enum\", \"extern\", \"float\", \"for\", \"goto\",\n \"if\", \"inline\", \"int\", \"long\", \"register\", \"restrict\", \"return\",\n \"short\", \"signed\", \"sizeof\", \"static\", \"struct\", \"switch\",\n \"typedef\", \"union\", \"unsigned\", \"void\", \"volatile\", \"while\",\n ];\n var regex_var = /\\b[A-z][A-z0-9]*/;\n var regex_number = /\\b0[xX][0-9a-fA-F]+\\b|\\b[0-9]*\\.[0-9]+\\b|\\b[0-9]*\\b/;\n var regex_string = /\"[^\"]*\"/;\n var regex_symbol = /&gt;|&lt;|\\ |\\(|\\)|;|-/;\n for (var i = 0; i < code_blocks.length; i++) {\n var element = code_blocks.item(i);\n var code_lines = element.innerHTML.split('\\n');\n var cursor = 0;\n\n var parts = [];\n var insert_index = 0;\n function insert_at(index, insertable) {\n if (index < insert_index) console.error(\"inserting before last insert!!\");\n parts.push(element.innerHTML.substr(insert_index, index - insert_index));\n parts.push(insertable);\n insert_index = index;\n }\n\n var in_block_comment = false;\n\n for (var j = 0; j < code_lines.length; j++) {\n var words = code_lines[j].split(regex_symbol);\n var in_line_comment = false;\n\n for (var k = 0; k < words.length; k++) {\n var word = words[k];\n\n // Special case for < and >, because they're escaped in\n // innerHTML.\n var to_be_processed_html = element.innerHTML.substr(cursor);\n if (to_be_processed_html.startsWith(\"lt;\") ||\n to_be_processed_html.startsWith(\"gt;\")) {\n cursor += 3;\n }\n\n if (in_block_comment) {\n if (word == \"*/\") {\n in_block_comment = false;\n insert_at(cursor + word.length, \"</span>\"); // close comment block\n }\n } else {\n if (!in_line_comment) {\n if (word == \"//\") {\n in_line_comment = true;\n insert_at(cursor, \"<span class='syntax-comment'>\"); // open comment line\n }\n if (word == \"/*\") {\n in_block_comment = true;\n insert_at(cursor, \"<span class='syntax-comment'>\"); // open comment block\n }\n }\n\n if (!in_line_comment && !in_block_comment) {\n if (keywords.indexOf(word) != -1) {\n insert_at(cursor, \"<span class='syntax-keyword'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_string.test(word)) {\n insert_at(cursor, \"<span class='syntax-string'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_var.test(word) && element.innerHTML.substr(cursor + word.length, 1) == \"(\") {\n insert_at(cursor, \"<span class='syntax-call'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_var.test(word)) {\n insert_at(cursor, \"<span class='syntax-variable'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_number.test(word)) {\n insert_at(cursor, \"<span class='syntax-number'>\");\n insert_at(cursor + word.length, \"</span>\");\n }\n }\n }\n\n cursor += word.length + 1;\n }\n\n if (in_line_comment) {\n insert_at(cursor, \"</span>\"); // close comment line\n }\n }\n\n parts.push(element.innerHTML.substr(insert_index));\n element.innerHTML = parts.join('');\n\n // When processing, using &lt; and &gt; is forced upon us. Now we\n // can fix that to allow for good copypasting.\n element.innerHTML.replace(/&lt;/g, \"<\");\n element.innerHTML.replace(/&gt;/g, \">\");\n }\n}", "function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) \r\n{\r\n // the highlightStartTag and highlightEndTag parameters are optional\r\n if ((!highlightStartTag) || (!highlightEndTag)) {\r\n highlightStartTag = \"<font style='color:blue; background-color:#00B2EE;'>\";\r\n highlightEndTag = \"</font>\";\r\n }\r\n \r\n // find all occurences of the search term in the given text,\r\n // and add some \"highlight\" tags to them (we're not using a\r\n // regular expression search, because we want to filter out\r\n // matches that occur within HTML tags and script blocks, so\r\n // we have to do a little extra validation)\r\n var newText = \"\";\r\n var i = -1;\r\n var lcSearchTerm = searchTerm.toLowerCase();\r\n var lcBodyText = bodyText.toLowerCase();\r\n \r\n while (bodyText.length > 0) {\r\n i = lcBodyText.indexOf(lcSearchTerm, i+1);\r\n if (i < 0) {\r\n newText += bodyText;\r\n bodyText = \"\";\r\n } else {\r\n // skip anything inside an HTML tag\r\n if (bodyText.lastIndexOf(\">\", i) >= bodyText.lastIndexOf(\"<\", i)) {\r\n // skip anything inside a <script> block\r\n if (lcBodyText.lastIndexOf(\"/script>\", i) >= lcBodyText.lastIndexOf(\"<script\", i)) {\r\n newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;\r\n bodyText = bodyText.substr(i + searchTerm.length);\r\n lcBodyText = bodyText.toLowerCase();\r\n i = -1;\r\n }\r\n }\r\n }\r\n }\r\n \r\n return newText;\r\n}", "highlight(code, lang) {\n if (code.match(/^graph/) || code.match(/^sequenceDiagram/) || code.match(/^gantt/)) {\n return `<div class=\"mermaid\">${code}</div>`\n }\n\n if (lang && hljs.getLanguage(lang)) {\n try {\n return `<pre class=\"hljs\"><code>${hljs.highlight(lang, code, true).value}</code></pre>`\n } catch (err) {\n // Ignore error\n }\n }\n\n return `<pre class=\"hljs\"><code>${md.utils.escapeHtml(code)}</code></pre>`\n }", "function highlightWord(node, word, doc){\n if (word.length < 3) \n return;\n //word = urldecode(word);\n \n doc = typeof(doc) != 'undefined' ? doc : document;\n // Iterate into this nodes childNodes\n \n /* tp integration */\n if (node.className == 'tp-info-box')\n return;\n /* tp integration */\n\n if (node.hasChildNodes) {\n var hi_cn;\n for (hi_cn = 0; hi_cn < node.childNodes.length; hi_cn++) {\n highlightWord(node.childNodes[hi_cn], word, doc);\n }\n }\n \n // And do this node itself\n if (node.nodeType == 3) { // text node\n tempNodeVal = stripVowelAccent(node.nodeValue.toLowerCase());\n tempWordVal = stripVowelAccent(word.toLowerCase());\n if (tempNodeVal.indexOf(tempWordVal) != -1) {\n \n pn = node.parentNode;\n if (pn.className != \"searchword\") {\n // word has not already been highlighted!\n nv = node.nodeValue;\n ni = tempNodeVal.indexOf(tempWordVal);\n // Create a load of replacement nodes\n before = doc.createTextNode(nv.substr(0, ni));\n docWordVal = nv.substr(ni, word.length);\n after = doc.createTextNode(nv.substr(ni + word.length));\n hiwordtext = doc.createTextNode(docWordVal);\n hiword = doc.createElement(\"span\");\t\t\t\n hiword.className = \"searchword\";\n hiword.appendChild(hiwordtext);\n pn.insertBefore(before, node);\n pn.insertBefore(hiword, node);\n pn.insertBefore(after, node);\n pn.removeChild(node);\n\t\t\t\ttry {\n\t\t\t\t\tif ((\"\"+hiword.parentNode.href) == 'undefined' &&\n\t\t\t\t\t\t(\"\"+hiword.parentNode.parentNode.href) == 'undefined' && \n\t\t\t\t\t\t(\"\"+hiword.parentNode.parentNode.parentNode.href) == 'undefined') {\n\t\t\t\t\t\thiword.onclick = reportClick;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} catch(e) {};\n }\n }\n }\n}", "render(createElement) {\n return createElement(\"pre\", {}, [\n createElement(\"code\", {\n class: this.className,\n domProps: { innerHTML: this.highlighted }})\n ]);\n }", "function toggleNodeHighlight(node) {\n\n if (node.css(node_highlight_property) === node_highlight_default) {\n node.css(node_highlight_add);\n } else {\n node.css(node_highlight_remove);\n }\n }", "function js_highlight() \n{\n for (var i=0; i<bold_Tags.length; i++)\n { \n bold_Tags[i].style.color = \"green\";\n }\n}", "decorateText(id) {\n const code = document.querySelectorAll(`${id} .html-content pre code`)\n if (!code.length) return\n\n // Preprocess the code blocks: if they don't have a language set,\n // don't try to guess the language inside. Just don't highlight it.\n code.forEach(cb => {\n if (!cb.classList.length) cb.classList.add('empty')\n })\n // Add syntax highlighting.\n highlightSyntax(code)\n }", "function highlightBlock(block) {\n var text = options.useBR ? block.innerHTML\n .replace(/\\n/g,'').replace(/<br>|<br [^>]*>/g, '\\n').replace(/<[^>]*>/g,'')\n : block.textContent;\n var language = blockLanguage(block);\n if (language == 'no-highlight')\n return;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n var original = nodeStream(block);\n if (original.length) {\n var pre = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre');\n pre.innerHTML = result.value;\n result.value = mergeStreams(original, nodeStream(pre), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className += ' hljs ' + (!language && result.language || '');\n block.result = {\n language: result.language,\n re: result.r\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.r\n };\n }\n }", "function highlightBlock(block, tabReplace, useBR) {\n var text = blockText(block, useBR);\n var language = blockLanguage(block);\n var result, pre;\n if (language == 'no-highlight')\n return;\n if (language) {\n result = highlight(language, text);\n } else {\n result = highlightAuto(text);\n language = result.language;\n }\n var original = nodeStream(block);\n if (original.length) {\n pre = document.createElement('pre');\n pre.innerHTML = result.value;\n result.value = mergeStreams(original, nodeStream(pre), text);\n }\n result.value = fixMarkup(result.value, tabReplace, useBR);\n\n var class_name = block.className;\n if (!class_name.match('(\\\\s|^)(language-)?' + language + '(\\\\s|$)')) {\n class_name = class_name ? (class_name + ' ' + language) : language;\n }\n if (is_old_IE && block.tagName == 'CODE' && block.parentNode.tagName == 'PRE') {\n // This is for backwards compatibility only. IE needs this strange\n // hack becasue it cannot just cleanly replace <code> block contents.\n pre = block.parentNode;\n var container = document.createElement('div');\n container.innerHTML = '<pre><code>' + result.value + '</code></pre>';\n block = container.firstChild.firstChild;\n container.firstChild.className = pre.className;\n pre.parentNode.replaceChild(container.firstChild, pre);\n } else {\n block.innerHTML = result.value;\n }\n block.className = class_name;\n block.result = {\n language: language,\n kw: result.keyword_count,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n kw: result.second_best.keyword_count,\n re: result.second_best.relevance\n };\n }\n }", "function highlight(text, selection, tagType) {\n const color = tagType === 'origin' ? '#af3011' : '#37a425';\n let re = new RegExp(`<span data-id=\"${tagType}\"[^>]*>(.*?)</span>`);\n return text\n .replace(re, '$1')\n .replace(\n selection.toString(),\n x =>\n `<span data-id=\"${tagType}\" style=\"padding: 2px 5px; background-color: ${color}; border-radius: 2px; color: white;\">${x}</span>`\n );\n}", "function highlight(id) {\n\tvar note = document.getElementById(id);\n\tnote.className += ' highlight';\n}", "function syntaxHighlight(json) {\n if (json === undefined) return \"\";\n json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); // basic html escaping\n return json\n .replace(/(\"(\\\\u[a-zA-Z0-9]{4}|\\\\[^u]|[^\\\\\"])*\"(\\s*:)?|\\b(true|false|null)\\b|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)/g, function (match) {\n var cls = 'red';\n if (/^\"/.test(match)) {\n if (/:$/.test(match)) {\n cls = 'blue';\n } else {\n cls = 'green';\n }\n } else if (/true|false/.test(match)) {\n cls = 'Sienna';\n } else if (/null/.test(match)) {\n cls = 'gray';\n }\n return '<span style=\"color:' + cls + ';\">' + match + '</span>';\n })\n .replace(/\\t/g,\"&nbsp;&nbsp;\") // to keep indentation in html\n .replace(/\\n/g,\"<br/>\"); // to keep line break in html\n }", "function syntaxColorMouseEvent(event) {\n \n \tif (event) {//event.keyCode ==32\n \t\tvar sbwin = Chickenfoot.getSidebarWindow(chromeWindow);\n \tvar ed = sbwin.getSelectedBuffer().editor;\n \tvar doc = ed.contentDocument;\n \tvar pre = doc.getElementById(\"pre\");\n \t//var preElement=false; \n \tvar anchorNodeCaret = sbwin.getSelectedBuffer().api.selection.focusNode;\n \tvar anchorOffsetCaret = sbwin.getSelectedBuffer().api.selection.focusOffset;\n \t//debug('offset: '+anchorOffsetCaret);\n \t\n \t//pre.innerHTML=\"<span style=\\\"color: blue;\\\">/*j<br>*/</span><br>\";\n /*\n \tdebug('pre');\n \tdebug(pre.childNodes);\n \tdebug(\"anchorNodeCaret\");\n \tdebug(anchorNodeCaret);\n \t//debug(\"anchorNodeCaret.parentNode\");\n \t//debug(anchorNodeCaret.parentNode);\n \t//debug(\"anchorNodeCaret.parentNode.parentNode\");\n \t//debug(anchorNodeCaret.parentNode.parentNode);\n \tdebug(anchorNodeCaret.data+\"+end\");\n \t//debug(anchorNodeCaret.innerHTML);\n \tdebug(anchorOffsetCaret);\n \t*/\n \t\n }\n}", "render(createElement) {\n return createElement(\"pre\", {}, [\n createElement(\"code\", {\n class: this.className,\n domProps: { innerHTML: this.highlighted }})\n ]);\n }", "render(createElement) {\n return createElement(\"pre\", {}, [\n createElement(\"code\", {\n class: this.className,\n domProps: { innerHTML: this.highlighted }})\n ]);\n }", "function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) \r\n{\r\n // the highlightStartTag and highlightEndTag parameters are optional\r\n if ((!highlightStartTag) || (!highlightEndTag)) {\r\n highlightStartTag = \"<font style='color:blue; background-color:yellow;'>\";\r\n highlightEndTag = \"</font>\";\r\n }\r\n \r\n // find all occurences of the search term in the given text,\r\n // and add some \"highlight\" tags to them (we're not using a\r\n // regular expression search, because we want to filter out\r\n // matches that occur within HTML tags and script blocks, so\r\n // we have to do a little extra validation)\r\n var newText = \"\";\r\n var i = -1;\r\n var lcSearchTerm = searchTerm.toLowerCase();\r\n var lcBodyText = bodyText.toLowerCase();\r\n \r\n while (bodyText.length > 0) {\r\n i = lcBodyText.indexOf(lcSearchTerm, i+1);\r\n if (i < 0) {\r\n newText += bodyText;\r\n bodyText = \"\";\r\n } else {\r\n // skip anything inside an HTML tag\r\n if (bodyText.lastIndexOf(\">\", i) >= bodyText.lastIndexOf(\"<\", i)) {\r\n // skip anything inside a <script> block\r\n if (lcBodyText.lastIndexOf(\"/script>\", i) >= lcBodyText.lastIndexOf(\"<script\", i)) {\r\n subName= returnSubName(searchTerm);\r\n \r\n newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + subName + highlightEndTag;\r\n bodyText = bodyText.substr(i + searchTerm.length);\r\n lcBodyText = bodyText.toLowerCase();\r\n i = -1;\r\n }\r\n }\r\n }\r\n }\r\n \r\n return newText;\r\n}", "function _highlightSource() {\n const srcLanguage = (selected.id === 'css') ? 'css' :\n (selected.id === 'smil') ? 'markup' : 'javascript';\n srcCodeEl.className = '';\n srcCodeEl.classList.add('language-' + srcLanguage);\n\n Prism.highlightAll();\n}", "function highlighter() {\n\n\tvar areas = $(\".highlight_area\");\n\n\t// in case of ajax reloading and other dynamics\n\t// remove the old mouseover/mouseout events and attach them new\n\tareas.off(\"mouseover\");\n\tareas.off(\"mouseout\");\n\tareas.mouseover(function() {\n\t\tvar itemId = parseId(jQuery(this).attr('class'));\n\t\tvar prntId = parseId(jQuery(this).attr('class'), 'parent_');\n\t\thighlight(itemId); // highlight the current element\n\t\tcheckForChilds(itemId);// highlight the child elements - recursive\n\t\t// - of the current item, if it's given\n\t\tif (prntId) { // check if the current item is a child of another\n\t\t\thighlight(prntId, 'id_'); // hightlight the next parent item,\n\t\t\t// if the current item is a child\n\t\t}\n\t}).mouseout(function() {\n\t\treset_highlight();\n\t});\n\n}", "function highlightBlock(block) {\n var text = options.useBR ? block.innerHTML\n .replace(/\\n/g,'').replace(/<br>|<br [^>]*>/g, '\\n').replace(/<[^>]*>/g,'')\n : block.textContent;\n var language = blockLanguage(block);\n if (language == 'no-highlight')\n return;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n var original = nodeStream(block);\n if (original.length) {\n var pre = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre');\n pre.innerHTML = result.value;\n result.value = mergeStreams(original, nodeStream(pre), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className += ' hljs ' + (!language && result.language || '');\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var text = options.useBR ? block.innerHTML\n .replace(/\\n/g,'').replace(/<br>|<br [^>]*>/g, '\\n').replace(/<[^>]*>/g,'')\n : block.textContent;\n var language = blockLanguage(block);\n if (language == 'no-highlight')\n return;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n var original = nodeStream(block);\n if (original.length) {\n var pre = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre');\n pre.innerHTML = result.value;\n result.value = mergeStreams(original, nodeStream(pre), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className += ' hljs ' + (!language && result.language || '');\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function applyFormatting(name){\n // console.log(name);\n \n // process the text\n // (click event returns text node)\n \n selection = window.getSelection()\n // console.log(selection);\n \n // for now, can't deal with selections that cross boundaries of different tags (like from h2 into p)\n \n var startNode = getCurrentBlock(selection.anchorNode);\n var endNode = getCurrentBlock(selection.focusNode);\n \n if(startNode == endNode){\n let block = startNode;\n \n // https://stackoverflow.com/questions/6328718/how-to-wrap-surround-highlighted-text-with-an-element\n \n \n // add formmating\n for(let i=0; i<selection.rangeCount; i++){\n let range = selection.getRangeAt(i);\n \n if(range.startContainer == range.endContainer){\n // selection is completely contained with some existing element\n let container = range.startContainer;\n let parent = container.parentNode;\n \n if(nodeType(container) == \"#Text\"){\n if(nodeType(parent) == \"SPAN\"){\n // there's already a styled span - need to split this\n split = splitNode(parent, range);\n \n // add formatting class to p2\n split.p2.classList.add(name);\n }else{\n // you're in completely unformatted territory\n let doc_fragment = range.extractContents();\n \n // console.log(doc_fragment);\n \n let child = doc_fragment.childNodes[0];\n \n // wrap text in <span>\n let span = document.createElement(\"span\");\n span.classList.add(name)\n span.textContent = child.textContent;\n \n doc_fragment.replaceChild(span, child);\n \n range.insertNode(doc_fragment);\n \n // TODO: ^ is there a simpler way to do this without using a document fragment? I just used that technique because it's what I already had in the section below, but there may be cleaner way to implement this\n }\n }\n \n }else{\n // boundary between multiple elements\n \n let doc_fragment = range.extractContents();\n \n // console.log(doc_fragment);\n \n for(child of doc_fragment.childNodes){\n let type = nodeType(child);\n \n if(type == '#Text'){\n // this is raw text\n \n // wrap text in <span>\n let span = document.createElement(\"span\");\n span.classList.add(name)\n span.textContent = child.textContent;\n \n doc_fragment.replaceChild(span, child);\n \n }else if(type == 'SPAN'){\n // if <span> exists, just add a new formatting class\n let span = child;\n span.classList.add(name);\n }else if(type == 'A'){\n // if it's an anchor, just leave it be\n let anchor = child;\n \n }\n }\n \n range.insertNode(doc_fragment);\n }\n \n }\n \n \n // clean up - merge tag fragments\n mergeTagFragments(block);\n \n \n \n \n // selection.anchorOffset\n }\n \n // clearSelection();\n}", "function highlight(id) {\n\n // Find and remove all higlighted chars\n var elems = el.getElementsByTagName('span');\n removeClasses(elems, 'highlight');\n\n // Mark the matching chars as highlited\n var a = annotationById(id);\n if (a) addClasses(elements(a.pos), 'highlight');\n }", "function wordHighlighter(node, word, options, onVisitHighlightedWord) {\n if (!word || !Array.isArray(word)) return;\n const {wordNumbers = [], wordCounter} = options;\n const textContent = toString(node);\n\n word.forEach((word, index) => {\n if (word && textContent?.includes(word)) {\n options.wordCounter = wordCounter + 1;\n if (\n wordNumbers.length === 0 ||\n wordNumbers[index]?.includes(options.wordCounter) ||\n wordNumbers[index]?.length === 0\n ) {\n let textContent = toString(node);\n let startIndex = 0;\n\n while (textContent.includes(word)) {\n const nodesToWrap = getNodesToHighlight(node, word, startIndex);\n\n // maybe throw / notify due to failure here\n if (nodesToWrap.length === 0) break;\n\n wrapHighlightedWords(node, nodesToWrap, onVisitHighlightedWord);\n // re-start from the 'last' node (the word or part of it may exist multiple times in the same node)\n // account for possible extra nodes added from split with - 2\n startIndex = Math.max(\n nodesToWrap[nodesToWrap.length - 1].index - 2,\n 0\n );\n textContent = node.children\n ?.map((childNode) => {\n if (\n !childNode.properties.hasOwnProperty(\n 'rehype-pretty-code-visited'\n ) &&\n !childNode.properties.hasOwnProperty(\n 'data-rehype-pretty-code-wrapper'\n )\n ) {\n return toString(childNode);\n }\n })\n .join('');\n }\n\n node.children?.forEach((childNode) => {\n if (\n childNode.properties.hasOwnProperty('rehype-pretty-code-visited')\n ) {\n delete childNode.properties['rehype-pretty-code-visited'];\n }\n });\n }\n }\n });\n}", "highlightElement(code, languages) {\n // Set code text before highlighting\n this.setTextContent(code);\n this._hljs.highlightAuto(code, languages).subscribe((res) => {\n // Set highlighted code\n this.setInnerHTML(res.value);\n // Check if user want to show line numbers\n if (this.lineNumbers && this._options && this._options.lineNumbersLoader) {\n this.addLineNumbers();\n }\n // Forward highlight response to the highlighted output\n this.highlighted.emit(res);\n });\n }", "function highlight(userId ) { \n \n var result = getTextNodeFromSelection();\n var textNode = result[1];\n var error = result[0]\n error = error || checkAnnoationExisted(textNode);\n \n if (!error && textNode.toString().length > 1) \n { \n //Generate an unique ID for the annotation \n var annotationPanelID = generateId(); \n var sNode = document.createElement(\"span\");\n sNode.id = annotationPanelID;\n sNode.className = \"annotate-highlight\"; \n try\n {\n textNode.surroundContents(sNode); \n }\n catch(err)\n {\n console.log(err);\n return -1\n } \n \n var parent = getParentElem(textNode);\n var pidx = 0;\n var widx = 0;\n if (parent != null) {\n pidx = getParagraphIndex(parent);\n console.log(pidx);\n widx = getWordIndex(parent, textNode);\n sNode.setAttribute('value', pidx + ',' + widx);\n }\n \n var panel = appendPanel(annotationPanelID, textNode.toString(), userId, pidx, widx, annotationState.NEW, 0);\n \n return annotationPanelID;\n }\n else if (textNode.toString().length != 0 ) {\n //TODO: Show a proper UI such as notification for error \n return -1;\n } \n}", "function highlightTranslatedCode( title, code, gray ) {\n\t\treturn \"<MM:DECORATION\"\n\t\t+ ' outline=\"' + title + '\"'\n\t\t+ ' outlineId=\"unique\"'\n\t\t+ (!gray ? ' outlineForSelection=\"outlineForSelection\"' : '')\n\t\t+ (!gray ? ' hiliteChildrenOnSelect=\"true\"' : '') + '>'\n\t\t+ code\n\t \t+ \"</MM:DECORATION>\";\n}", "function onclick_highlight() {\n\tif (document.getElementsByTagName) {\n\t\tvar alinks = document.getElementById('rules').getElementsByTagName('a');\n\t\tfor (var i = 0; i < alinks.length; i++) {\n\t\t\tif (alinks[i].getAttribute('href') !== null && alinks[i].getAttribute('href').indexOf('#') >= 0) {\n\t\t\t\tvar fragment = alinks[i].getAttribute('href').substring(alinks[i].getAttribute('href').indexOf('#') + 1);\n\t\t\t\tvar e_onclick_function = \"frag_highlight('\" + fragment + \"')\";\n\t\t\t\tvar new_function = new Function('e', e_onclick_function);\n\t\t\t\talinks[i].onclick = new_function;\n\t\t\t}\n\t\t}\n\t}\n}", "function flashNode(node, match) {\n if (!node.__gcliHighlighting) {\n node.__gcliHighlighting = true;\n var original = node.style.background;\n node.style.background = match ? 'green' : 'red';\n setTimeout(function() {\n node.style.background = original;\n delete node.__gcliHighlighting;\n }, 500);\n }\n}", "function highlightify(source,output,highlightRegExp)\n{\n\tif(source && source != \"\")\n\t\t{\n\t\tvar wikifier = new Wikifier(source,formatter,highlightRegExp,null);\n\t\twikifier.outputText(output,0,source.length);\n\t\t}\n}", "function _CodeBlock(txt, syntax){\n if(typeof syntax != \"object\") {return \"\";}\n txt = _clearHtml(txt);\n for(var i = 0; i < syntax.codeBase.length; i++){ \n let tag = \"\";\n let className = syntax.name + '-'+syntax.codeBase[i].color.substring(1);\n switch(syntax.codeBase[i].type) {\n case \"word\":\n tag = \"\\\\b(\" + syntax.codeBase[i].tag + \")\\\\b\";\n break;\n case \"regexp\":\n txt = _RegExpColor(txt, syntax.codeBase[i].tag, className);\n break;\n case \"str\":\n txt = _StrColor(txt, syntax.codeBase[i].tag, className);\n break;\n }\n if(tag!=\"\"){\n \n let regexp = new RegExp(tag, \"gim\");\n \n var pretxt = \"\";\n if (isUpperCase) { \n txt = txt.replace(regexp,'<span class='+syntax.name + '-'+syntax.codeBase[i].color.substring(1)+'>'+syntax.codeBase[i].tag.toUpperCase()+'</span>');\n }else{\n txt = txt.replace(regexp,'<span class='+syntax.name + '-'+syntax.codeBase[i].color.substring(1)+'>$1</span>'); \n }\n }\n }\n return txt;\n }", "function highlight(colour) {\n var range,\n sel;\n if (window.getSelection) {\n // IE9 and non-IE\n try {\n if (!document.execCommand(\"BackColor\", false, colour)) {\n makeEditableAndHighlight(colour);\n }\n } catch (ex) {\n makeEditableAndHighlight(colour)\n }\n } else if (document.selection && document.selection.createRange) {\n // IE <= 8 case\n range = document.selection.createRange();\n range.execCommand(\"BackColor\", false, colour);\n }\n}", "function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) {\n // the highlightStartTag and highlightEndTag parameters are optional\n if ((!highlightStartTag) || (!highlightEndTag)) {\n highlightStartTag = \"<font style='color:blue; background-color:yellow;'>\";\n highlightEndTag = \"</font>\";\n }\n \n // find all occurences of the search term in the given text,\n // and add some \"highlight\" tags to them (we're not using a\n // regular expression search, because we want to filter out\n // matches that occur within HTML tags and script blocks, so\n // we have to do a little extra validation)\n var newText = \"\";\n var i = -1;\n var lcSearchTerm = searchTerm.toLowerCase();\n var lcBodyText = bodyText.toLowerCase();\n \n while (bodyText.length > 0) {\n i = lcBodyText.indexOf(lcSearchTerm, i+1);\n if (i < 0) {\n newText += bodyText;\n bodyText = \"\";\n } else {\n // skip anything inside an HTML tag\n if (bodyText.lastIndexOf(\">\", i) >= bodyText.lastIndexOf(\"<\", i)) {\n // skip anything inside a <script> block\n if (lcBodyText.lastIndexOf(\"/script>\", i) >= lcBodyText.lastIndexOf(\"<script\", i)) {\n newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;\n bodyText = bodyText.substr(i + searchTerm.length);\n lcBodyText = bodyText.toLowerCase();\n i = -1;\n }\n }\n }\n }\n \n return newText;\n}", "function undoHighlightCurrentCode() {\n // Change the css property by applying no highlighted background color\n $(\"#code_\" + registers[\"rip\"]).css(\"background-color\", \"\");\n}", "function highlightWord(node,word,doc) {\n doc = typeof(doc) != 'undefined' ? doc : document;\n\t// Iterate into this nodes childNodes\n\tif (node.hasChildNodes) {\n\t\tvar hi_cn;\n\t\tfor (hi_cn=0;hi_cn<node.childNodes.length;hi_cn++) {\n\t\t\thighlightWord(node.childNodes[hi_cn],word,doc);\n\t\t}\n\t}\n\n\t// And do this node itself\n\tif (node.nodeType == 3) { // text node\n\t\ttempNodeVal = stripVowelAccent(node.nodeValue.toLowerCase());\n\t\ttempWordVal = stripVowelAccent(word.toLowerCase());\n\t\tif (tempNodeVal.indexOf(tempWordVal) != -1) {\n\t\t\tpn = node.parentNode;\n\t\t\tif (pn.className != \"searchword\") {\n\t\t\t\t// word has not already been highlighted!\n\t\t\t\tnv = node.nodeValue;\n\t\t\t\tni = tempNodeVal.indexOf(tempWordVal);\n\t\t\t\t// Create a load of replacement nodes\n\t\t\t\tbefore = doc.createTextNode(nv.substr(0,ni));\n\t\t\t\tdocWordVal = nv.substr(ni,word.length);\n\t\t\t\tafter = doc.createTextNode(nv.substr(ni+word.length));\n\t\t\t\thiwordtext = doc.createTextNode(docWordVal);\n\t\t\t\thiword = doc.createElement(\"span\");\n\t\t\t\thiword.className = \"searchword\";\n\t\t\t\thiword.appendChild(hiwordtext);\n\t\t\t\tpn.insertBefore(before,node);\n\t\t\t\tpn.insertBefore(hiword,node);\n\t\t\t\tpn.insertBefore(after,node);\n\t\t\t\tpn.removeChild(node);\n\t\t\t}\n\t\t}\n\t}\n}", "function beginHover(e) {\n e.target.classList.add('editor-highlight');\n}", "function Highlight(){\n if (!(this instanceof Highlight)) return new Highlight();\n this.languages = {};\n this.prefix('Highlight-');\n}", "highlightRange(range) {\n let span = document.createElement('span');\n span.classList.add(SELECTED_CLS);\n let spans = [span];\n\n // If the selection starts and ends in different containers\n if (range.startContainer !== range.endContainer) {\n let startRange = new Range();\n let startSpan = span.cloneNode();\n startRange.setStart(range.startContainer, range.startOffset);\n startRange.setEnd(range.startContainer, range.startContainer.length);\n startRange.surroundContents(startSpan);\n spans.push(startSpan);\n\n let endRange = new Range();\n let endSpan = span.cloneNode();\n endRange.setStart(range.endContainer, 0);\n endRange.setEnd(range.endContainer, range.endOffset);\n endRange.surroundContents(endSpan);\n spans.push(endSpan);\n\n // Get nodes between the start and end containers\n let betweenNodes = getBetweenNodes(startSpan, endSpan, range.commonAncestorContainer);\n betweenNodes.forEach((n) => {\n let range = new Range();\n if (n instanceof Text) {\n let s = span.cloneNode();\n range.setStart(n, 0);\n range.setEnd(n, n.length);\n range.surroundContents(s);\n spans.push(s);\n } else {\n // Just re-use existing span\n n.classList.add(SELECTED_CLS);\n [...n.querySelectorAll('span')].forEach((s) => {\n s.classList.add(SELECTED_CLS);\n });\n }\n });\n } else {\n range.surroundContents(span);\n }\n return spans;\n }", "render(createElement) {\n return createElement(\"pre\", {}, [createElement(\"code\", {\n class: this.className,\n domProps: {\n innerHTML: this.highlighted\n }\n })]);\n }", "function bindRehighlightHandler() {\n const menuDiff = document.getElementById('pr-menu-diff');\n if (!menuDiff) {\n return;\n }\n\n menuDiff.addEventListener('click', () => {\n waitForRender('.diff-container').then(() => {\n highlightCode();\n });\n });\n }", "function highlightTarget(target) {\n $(target).addClass(\"highlight\");\n}", "function hightlightCodeBlock(codeElement, preElement) {\n \n // ignore elements that have already been printed\n if (preElement != null && preElement.classList.contains(\"hljs\")) {\n return;\n }\n \n // ignore elements that have already been printed\n if (codeElement != null && codeElement.classList.contains(\"hljs\")) {\n return;\n }\n \n fixMsdnMagazine(codeElement, preElement);\n \n var hasOnlyBRs = true;\n\n for (var i = 0; i < codeElement.children.length; i++) {\n var child = codeElement.children[i];\n if (child.tagName != \"BR\") {\n hasOnlyBRs = false;\n break;\n }\n }\n\n // somebody put <br/>s in our code block, so remove them\n if (hasOnlyBRs) {\n console.log(\"removing BRs\");\n while (codeElement.lastElementChild != null) {\n codeElement.removeChild(codeElement.lastElementChild);\n }\n }\n\n hljs.highlightBlock(codeElement);\n}", "render (createElement) {\n return createElement(\"pre\", {}, [\n createElement(\"code\", {\n class: this.className,\n domProps: {\n innerHTML: this.highlighted\n }\n })\n ]);\n }", "function createHighlight() {\n\n let highlightElement = document.createElement(\"div\");\n highlightElement.style.zIndex = 0;\n\n let boundingClientRect = window.getSelection().getRangeAt(0).getBoundingClientRect();\n\n highlightElement.style.position = \"absolute\";\n highlightElement.style.left = `${boundingClientRect.left}px`;\n highlightElement.style.top = `${boundingClientRect.top}px`;\n highlightElement.style.width = `${boundingClientRect.width}px`;\n highlightElement.style.height = `${boundingClientRect.height}px`;\n\n highlightElement.style.backgroundColor = 'yellow';\n highlightElement.style.opacity=\"0.3\";\n\n // FIXME: insert this into the page element.. to the parent div... there is a\n // get common parent method that I should probably use.\n\n document.body.appendChild(highlightElement);\n\n // FIXME: now clear the selection once this is done.\n\n // FIXME: the highlight should/could be BELOW the text and probably should\n // be until it's deleted I think.\n\n}" ]
[ "0.64693505", "0.6364802", "0.62301296", "0.5959391", "0.58455855", "0.5758425", "0.5758425", "0.5758425", "0.5758425", "0.5758425", "0.5758425", "0.5758425", "0.5758425", "0.5758425", "0.5758425", "0.5758425", "0.5758425", "0.5758425", "0.5758425", "0.5751009", "0.5751009", "0.5751009", "0.5751009", "0.5751009", "0.5751009", "0.5751009", "0.5751009", "0.5739931", "0.57016534", "0.57016534", "0.57016534", "0.57016534", "0.5698913", "0.56956035", "0.5685644", "0.5668141", "0.56530446", "0.5639929", "0.5612712", "0.5583279", "0.55701685", "0.5537024", "0.552086", "0.5489456", "0.54811496", "0.54679555", "0.54337233", "0.54097545", "0.53896344", "0.53683764", "0.5347676", "0.52631146", "0.52604806", "0.5242691", "0.52296084", "0.52236414", "0.52233726", "0.5207167", "0.51689935", "0.5167286", "0.5166479", "0.5125545", "0.51212174", "0.51122093", "0.510264", "0.5085486", "0.5076261", "0.5075129", "0.5070957", "0.50610715", "0.5054487", "0.50415623", "0.50415623", "0.50410026", "0.5040259", "0.50309795", "0.50208807", "0.50208807", "0.50180763", "0.5007506", "0.5003024", "0.49969184", "0.4996785", "0.4987946", "0.4982335", "0.49815857", "0.4975183", "0.4968067", "0.49658507", "0.49533138", "0.49511907", "0.4950172", "0.4928142", "0.49278027", "0.49243054", "0.49153623", "0.48953864", "0.48947856", "0.4890945", "0.4889126", "0.48804858" ]
0.0
-1
Updates highlight.js global options with values passed in the form of an object.
function configure(user_options) { options = inherit(options, user_options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UpdateConfiguration() {\n var config = vscode.workspace.getConfiguration('hl7tools');\n highlightFieldBackgroundColor = config['highlightBackgroundColor'];\n}", "static define(specs, options) {\n return new HighlightStyle(specs, options || {});\n }", "function populate_highlights() {\n $scope.colorOptions = getOriginalColorOptions();\n for (var type in SWG.node_types) {\n var count = SWG.node_types[type]['count'];\n var newColorOption = {\n text: type + \" (\" + count + \")\",\n value: type\n }\n $scope.colorOptions.push(newColorOption)\n }\n $scope.$apply()\n }", "_processInitialHighlighting() {\n var highlightedCategories = this.getOptions()['highlightedCategories'];\n if (highlightedCategories && highlightedCategories.length > 0)\n this.highlight(highlightedCategories);\n }", "highlight(on) { }", "_updateAutoHighlight(info) {\n const pickingModuleParameters = {\n pickingSelectedColor: info.picked ? info.color : null\n };\n const {highlightColor} = this.props;\n if (info.picked && typeof highlightColor === 'function') {\n pickingModuleParameters.pickingHighlightColor = highlightColor(info);\n }\n this.setModuleParameters(pickingModuleParameters);\n // setModuleParameters does not trigger redraw\n this.setNeedsRedraw();\n }", "function $380d7edc2604b455$var$highlight(name, value, options) {\n var before = $03b62e45aee69014$exports.configure({});\n var settings = options || {};\n var prefix = settings.prefix;\n var result;\n if (typeof name !== \"string\") throw $4aa8a9bf31969fd6$exports(\"Expected `string` for name, got `%s`\", name);\n if (!$03b62e45aee69014$exports.getLanguage(name)) throw $4aa8a9bf31969fd6$exports(\"Unknown language: `%s` is not registered\", name);\n if (typeof value !== \"string\") throw $4aa8a9bf31969fd6$exports(\"Expected `string` for value, got `%s`\", value);\n if (prefix === null || prefix === undefined) prefix = $380d7edc2604b455$var$defaultPrefix;\n $03b62e45aee69014$exports.configure({\n __emitter: $380d7edc2604b455$var$Emitter,\n classPrefix: prefix\n });\n result = $03b62e45aee69014$exports.highlight(name, value, true);\n $03b62e45aee69014$exports.configure(before || {});\n /* istanbul ignore if - Highlight.js seems to use this (currently) for broken\n * grammars, so let’s keep it in there just to be sure. */ if (result.errorRaised) throw result.errorRaised;\n return {\n relevance: result.relevance,\n language: result.language,\n value: result.emitter.rootNode.children\n };\n}", "function updateOptions(options)\n\t{\n\t\t_options = jQuery.extend(true, {}, _options, options);\n\t}", "_initOptions(o) {\n // set the defaults\n this.o = {\n numSliders: 10,\n minVal: 0,\n maxVal: 127,\n sliderColors: [\"#f40\", \"#f50\"],\n backgroundColor: \"#fff\",\n mouseSensitivity: 1.2\n };\n\n // override defaults with provided options\n super._initOptions(o);\n }", "function updateOptions() {\n\tpush();\n\t\tfill([255,255,255]);\n\t\ttextSize(cellwidth/2);\n\t\ttextAlign(CENTER,CENTER);\n\t\ttranslate(screen.w/2,screen.h/2);\n\t\ttext(\"What options do you need?\",0,0);\n\tpop();\n}", "function highlight(language, value, options) {\n var settings = options || {}\n var prefix = settings.prefix\n\n if (prefix === null || prefix === undefined) {\n prefix = defaultPrefix\n }\n\n return normalize(coreHighlight(language, value, true, prefix))\n}", "optionsUpdateHook() { }", "sync_options_and_states(update_states) {\n var that = this;\n var current = that.current;\n var options = that.options;\n \n if (update_states) {\n current.pos = options.pos || current.pos;\n current.data_set = options.data_set || current.data_set;\n current.selection.low_pass_threshold = +options.low_pass || current.selection.low_pass_threshold;\n current.selection.threshold = +options.threshold || current.selection.threshold;\n current.source = options.source || current.source;\n\n var brush_string = options.brush;\n if (brush_string && brush_string.length > 0) {\n current.brush_extent = brush_string.split(',').map(d => +d);\n }\n\n var zero_padding = options.padding;\n if (zero_padding && zero_padding.length > 0) {\n var tmp = zero_padding.split(',').map(d => +d);\n current.zero_left = tmp[0];\n current.zero_right = tmp[1];\n }\n\n\n var cell_string = options.cells;\n if (cell_string && cell_string.length > 0) {\n current.selection.cells = cell_string.split(',').map(d => +d);\n\n }\n\n var ex_cell_string = options.ex_cell;\n if (ex_cell_string && ex_cell_string.length > 0) {\n that.current.selection.excluded_cells = ex_cell_string.split(',').map(d => +d)\n }\n\n\n } else {\n // TODO: maybe\n }\n\n }", "function setOptions(new_options) {\n options = jQuery.extend({}, defaults, options, new_options);\n }", "function setOptions(new_options) {\n options = jQuery.extend({}, defaults, options, new_options);\n }", "_initOptions(o) {\n // set the defaults\n this.o = {\n minVal: 0,\n maxVal: 127,\n step: 1,\n needleColor: \"#414141\",\n activeColor: \"#f40\",\n arcThicknessAspect: 0.2,\n mouseSensitivity: 1.2\n };\n\n // override defaults with provided options\n super._initOptions(o);\n\n // set the precision based on the step interval\n this.o.stepPrecision = MathUtil.getPrecision(this.o.step);\n }", "function _Markdown_formatOptions(options)\n{\n\tfunction toHighlight(code, lang)\n\t{\n\t\tif (!lang && $elm$core$Maybe$isJust(options.defaultHighlighting))\n\t\t{\n\t\t\tlang = options.defaultHighlighting.a;\n\t\t}\n\n\t\tif (typeof hljs !== 'undefined' && lang && hljs.listLanguages().indexOf(lang) >= 0)\n\t\t{\n\t\t\treturn hljs.highlight(lang, code, true).value;\n\t\t}\n\n\t\treturn code;\n\t}\n\n\tvar gfm = options.githubFlavored.a;\n\n\treturn {\n\t\thighlight: toHighlight,\n\t\tgfm: gfm,\n\t\ttables: gfm && gfm.tables,\n\t\tbreaks: gfm && gfm.breaks,\n\t\tsanitize: options.sanitize,\n\t\tsmartypants: options.smartypants\n\t};\n}", "function _Markdown_formatOptions(options)\n{\n\tfunction toHighlight(code, lang)\n\t{\n\t\tif (!lang && $elm$core$Maybe$isJust(options.defaultHighlighting))\n\t\t{\n\t\t\tlang = options.defaultHighlighting.a;\n\t\t}\n\n\t\tif (typeof hljs !== 'undefined' && lang && hljs.listLanguages().indexOf(lang) >= 0)\n\t\t{\n\t\t\treturn hljs.highlight(lang, code, true).value;\n\t\t}\n\n\t\treturn code;\n\t}\n\n\tvar gfm = options.githubFlavored.a;\n\n\treturn {\n\t\thighlight: toHighlight,\n\t\tgfm: gfm,\n\t\ttables: gfm && gfm.tables,\n\t\tbreaks: gfm && gfm.breaks,\n\t\tsanitize: options.sanitize,\n\t\tsmartypants: options.smartypants\n\t};\n}", "function HighlighterSystem() {\n\n var system=this; // kludge to sort out 'this' references in methods\n\n // Set up buttons, hotkeys and menus for the five system commands:\n var { Hotkey } = require(\"sdk/hotkeys\");\n // Add-on SDK API's required by add-on:\n this.api = {\n data: require(\"sdk/self\").data,\n tabs: require(\"sdk/tabs\"),\n contextMenu: require(\"sdk/context-menu\"),\n hotkey: Hotkey,\n widget: widget\n };\n try {\n var { ActionButton } = require(\"sdk/ui/button/action\");\n this.api.actionButton = ActionButton;\n }\n catch (e) {\n var widget = require(\"sdk/widget\");\n this.api.widget = widget.Widget;\n }\n\n this.setupDB();\n\n // panel to present color picker for background and text colors\n this.colorPanel = require(\"sdk/panel\").Panel({\n height: 768,\n width: 456,\n contentURL: this.api.data.url(\"picker.html\"),\n contentScriptFile: this.api.data.url(\"colorpicker.js\")\n });\n\n // Make note of newly selected highlighter colors\n this.colorPanel.port.on(\"newStyle\", function (dataJSON) {\n // console.log(\"dataJSON: \"+dataJSON);\n system.colorPanel.hide();\n var data = JSON.parse(dataJSON);\n var style = system.storage.style = data.style;\n system.storage.styleStacks = data.styleStacks;\n // console.log(\"new value of styleStacks: \"+JSON.stringify(system.storage.styleStacks));\n system.highlight.menuItem.data = system.storage;\n try {\n system.highlight.button.click(); // Hilight selection (if any) in new style\n }\n catch (e) {\n var worker = system.api.tabs.activeTab.attach({\n contentScriptFile: system.api.data.url(\"hilite.js\")\n });\n worker.port.emit(\"hilite\", JSON.stringify(system.storage));\n worker.destroy();\n }\n // Change icon for hilite command in ActionButton and menu item\n system.svgWorker.port.emit(\"updateIcon\", style);\n });\n\n // simple storage stores color selections,\n // and most recently generated hiliteSpanID\n this.storage = require(\"sdk/simple-storage\").storage;\n if (!this.storage.style) this.storage.style = \"color:black;background-color:yellow;\"\n // serialStack no longer used, clean up after older versions:\n this.storage.serialStack = undefined;\n this.storage.hiliteSpanID = this.nextHiliteSpanID();\n if (typeof this.storage.styleStacks == \"undefined\" || this.storage.styleStacks.length < 10) this.storage.styleStacks = \n // this.storage.styleStacks =\n {\n \"preset0\": [{\n \"color\": \"black\",\n \"backgroundColor\": \"hsl(0,100%,80%)\"\n }],\n \"preset1\": [{\n \"color\": \"black\",\n \"backgroundColor\": \"hsl(36,100%,80%)\"\n }],\n \"preset2\": [{\n \"color\": \"black\",\n \"backgroundColor\": \"hsl(72,100%,80%)\"\n }],\n \"preset3\": [{\n \"color\": \"black\",\n \"backgroundColor\": \"hsl(108,100%,80%)\"\n }],\n \"preset4\": [{\n \"color\": \"black\",\n \"backgroundColor\": \"hsl(144,100%,80%)\"\n }],\n \"preset5\": [{\n \"color\": \"black\",\n \"backgroundColor\": \"hsl(180,100%,80%)\"\n }],\n \"preset6\": [{\n \"color\": \"black\",\n \"backgroundColor\": \"hsl(216,100%,80%)\"\n }],\n \"preset7\": [{\n \"color\": \"black\",\n \"backgroundColor\": \"hsl(252,100%,80%)\"\n }],\n \"preset8\": [{\n \"color\": \"black\",\n \"backgroundColor\": \"hsl(288,100%,80%)\"\n }],\n \"preset9\": [{\n \"color\": \"black\",\n \"backgroundColor\": \"hsl(324,100%,80%)\"\n }]\n };\n\n // create interfaces for color selection\n this.color = new Command(this.api, {\n image: this.api.data.url(\"palette.svg\"),\n desc: \"Select highlighter color (Ctrl-Alt-A)\",\n contentScriptFile: this.api.data.url(\"color.js\"),\n event: \"color\",\n payload: undefined,\n callback: function () {\n if (system.colorPanel.isShowing) {\n system.colorPanel.hide();\n }\n else {\n system.colorPanel.show();\n system.colorPanel.port.emit(\"logStyle\", JSON.stringify({\n style: system.storage.style,\n styleStacks: system.storage.styleStacks\n }));\n }\n }\n });\n // create interfaces for highlight command\n this.highlight = new Command(this.api, {\n image:\n this.storage.highlightIcon ? this.storage.highlightIcon : this.api.data.url(\"hilite.svg\"),\n desc: \"Highlight current selection (Ctrl-Alt-H)\",\n contentScriptFile: this.api.data.url(\"hilite.js\"),\n contentStyleFile: this.api.data.url(\"prostetnic.css\"),\n event: \"hilite\",\n payload: this.storage,\n callback: function (hiliteJSON) {\n var hilite = JSON.parse(hiliteJSON);\n var hiliteID = system.postHighlight(hilite);\n for each (var hiliteSpan in hilite.hiliteSpans) {\n system.postHighlightSpan(hiliteID, hiliteSpan);\n }\n system.storage.hiliteSpanID = system.nextHiliteSpanID();\n system.highlight.menuItem.data = JSON.stringify(system.storage);\n }\n });\n // page-worker for content script to alter SVG code representing highlight\n // button icon\n this.svgWorker = require(\"sdk/page-worker\").Page({\n contentURL: this.highlight.button.icon || this.highlight.widget.contentURL,\n contentScriptFile: this.api.data.url(\"change.js\")\n });\n // store base64 of new SVG file in the appropriate places\n this.svgWorker.port.on(\"newIcon\", function (b64code) {\n system.storage.highlightIcon =\n system.highlight.button.icon = \n system.highlight.widget.contentURL =\n system.highlight.menuItem.image = \"data:image/svg+xml;base64,\"+b64code;\n });\n // create interfaces for undo command\n this.undo = new Command(this.api, {\n image: this.api.data.url(\"undo.svg\"),\n desc: \"Undo most recent highlight on this page (Ctrl-Alt-Z)\",\n contentScriptFile: this.api.data.url(\"undo-or-erase.js\"),\n event: \"undo\",\n payload: null,\n callback: function () {\n system.api.tabs.activeTab.attach({\n contentScriptFile: system.api.data.url(\"undo-or-erase.js\")\n }).port.emit(\"removeSpans\", JSON.stringify(system.spansToUndo()));\n }\n });\n // create interfaces for \"erase all this page\"\n this.erase = new Command(this.api, {\n image: this.api.data.url(\"erase.svg\"),\n desc: \"Erase all highlights on this page (Ctrl-Alt-N)\",\n contentScriptFile: this.api.data.url(\"undo-or-erase.js\"),\n event: \"erase\",\n payload: null,\n callback: function () {\n system.api.tabs.activeTab.attach({\n contentScriptFile: system.api.data.url(\"undo-or-erase.js\")\n }).port.emit(\"removeSpans\", JSON.stringify(system.spansToErase()));\n }\n });\n // create interfaces for text search feature:\n this.find = new Command(this.api, {\n image: this.api.data.url(\"search.svg\"),\n desc: \"Search for words in previously highlighted pages (Ctrl-Alt-F)\",\n contentScriptFile: this.api.data.url(\"find.js\"),\n event: \"find\",\n payload: null,\n callback: function () {\n system.api.tabs.open({\n url: system.api.data.url(\"search.html\"),\n onReady: function (tab) {\n var worker = tab.attach({\n contentScriptFile: system.api.data.url(\"find.js\")\n });\n var pageSearcher;\n worker.port.on(\"searchTextChange\", function (wordsJSON) {\n pageSearcher =\n new PageSearcher(system.dbConn, worker, JSON.parse(wordsJSON));\n pageSearcher.getRow();\n });\n worker.port.on(\"nextRow\", function () {\n pageSearcher.getRow();\n });\n }\n });\n }\n });\n\n var tabs = require(\"sdk/tabs\");\n\n var updateURL = function (tab) {\n var oldURL = system.url;\n system.url = tab.url.split(\"#\")[0]; // kludge?\n \n };\n\n tabs.on(\"activate\", updateURL);\n tabs.on(\"pageshow\", updateURL);\n\n updateURL(tabs.activeTab);\n\n // Whenever any new page visited,\n // check to see if it's been highlighted before\n require(\"sdk/page-mod\").PageMod({\n include: \"*\",\n contentScriptFile: this.api.data.url(\"hilite.js\"),\n contentStyleFile: this.api.data.url(\"prostetnic.css\"),\n onAttach: function (worker) {\n var url = tabs.activeTab.url;\n // console.log(\"about to call previousHighlights, url=\"+url);\n var hilites = system.previousHighlights(url);\n if (hilites.length) {\n worker.port.emit(\"reHilite\", JSON.stringify(hilites));\n }\n }\n });\n\n }", "function refreshHighlight()\n\t{\n\t\tvar script = generateHighlightScript(_highlighted);\n\n\t\t// convert array to a single string\n\t\tscript = script.join(\" \");\n\n\t\t// send script string to the app\n\t\t_3dApp.script(script);\n\t}", "function setControlValues() {\n document.getElementById('highlight1').value = Common.Settings.Highlight1;\n document.getElementById('highlight2').value = Common.Settings.Highlight2;\n document.getElementById('highlight3').value = Common.Settings.Highlight3;\n setOption(document.getElementById('menuState'), Common.Settings.Menu);\n setOption(document.getElementById('zoom'), Common.Settings.Zoom);\n setOption(document.getElementById('theme'), Common.Settings.Theme);\n}", "function SetHighlight ()\n\t{\n\t\tif( showHighlight == true )\n\t\t{\n\t\t\t// Enable images if they are off\n\t\t\tif( highlightBase != null && highlightBase.gameObject.activeInHierarchy == false )\n\t\t\t\thighlightBase.gameObject.SetActive( true );\n\t\t\tif( highlightJoystick != null && highlightJoystick.gameObject.activeInHierarchy == false )\n\t\t\t\thighlightJoystick.gameObject.SetActive( true );\n\n\t\t\t// Here we need to check if each variable is assigned so we don't get a null reference log error when applying color\n\t\t\tif( highlightBase != null )\n\t\t\t\thighlightBase.color = highlightColor;\n\t\t\tif( highlightJoystick != null )\n\t\t\t\thighlightJoystick.color = highlightColor;\n\n\t\t\t// If we are using fade, then we want to modify our highlight's color\n\t\t\tif( useFade == true )\n\t\t\t\tHandleFade( \"Untouched\" );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Here we want to check if we have any highlights, and if so, SetActive( false )\n\t\t\tif( highlightBase != null && highlightBase.gameObject.activeInHierarchy == true )\n\t\t\t\thighlightBase.gameObject.SetActive( false );\n\t\t\tif( highlightJoystick != null && highlightJoystick.gameObject.activeInHierarchy == true )\n\t\t\t\thighlightJoystick.gameObject.SetActive( false );\n\t\t}\n\t}", "function updateColor() {\n bOpts['color'] = ('rgba(' + parseInt(r) + ', ' + parseInt(g) + ', '\n + parseInt(b) + ', ' + bOpts['opacity'] + ')');\n }", "function highlightSelectionMatches(options) {\n let ext = [defaultTheme, matchHighlighter];\n if (options)\n ext.push(highlightConfig.of(options));\n return ext;\n}", "function setGlobalOptions(options) {\n if (typeof options !== 'object') {\n throw new TypeError('\"options\" argument needs to be an object!');\n }\n logSettings_1.logger.info('\"setGlobalOptions\" got called with', options);\n for (const key of Object.keys(options)) {\n data_1.globalOptions[key] = Object.assign({}, data_1.globalOptions[key], options[key]);\n }\n}", "set highlightMatches(v) {\n this._highlights = v;\n }", "function setOptions() {\n // set text output to match slider\n $(options.selectors.isochroneOutput).text($(options.selectors.isochroneSlider).val());\n if (exploreLatLng) {\n clickedExplore();\n }\n }", "function Highlight(){\n if (!(this instanceof Highlight)) return new Highlight();\n this.languages = {};\n this.prefix('Highlight-');\n}", "function LK_applySelectedStyle(elem, value) {\n elem.style.fontWeight = 'bold';\n elem.style.backgroundColor = LK_MAPPINGS[value].color;\n}", "function _setOptions(obj, options) {\n options = options || {};\n obj.separator = (typeof options.separator !== 'undefined') ? options.separator : ',';\n obj.quotechar = (typeof options.quote !== 'undefined') ? options.quote : '\"';\n obj.escapechar = (typeof options.escape !== 'undefined') ? options.escape : '\"';\n obj.commentchar = (typeof options.comment !== 'undefined') ? options.comment : '';\n obj.columnNames = (typeof options.columnNames !== 'undefined') ? options.columnNames : [];\n obj.columnsFromHeader = (typeof options.columnsFromHeader !== 'undefined') ? options.columnsFromHeader : false;\n obj.nestedQuotes = (typeof options.nestedQuotes !== 'undefined') ? options.nestedQuotes : false;\n obj.escapeFormulas = (typeof options.escapeFormulas !== 'undefined') ? options.escapeFormulas : false;\n}", "function setHighlighter(object){\n\n\ttry{\n\n\t // set transparency and opacity to highlight object\n\t\tobject.material.transparent = false;\n\t\tobject.material.opacity = 1.0;\n\t\trender();\n\t}catch(error){\n\t\t//update display\n status = 'Fehler bei Markierung';\n\n\t}\n}", "function updateDocumentStyling(selectedOptions){\n var fontColor;\n var backgroundColor;\n DocumentApp.getActiveDocument().getHeader().editAsText().setFontFamily(selectedOptions[0]);\n DocumentApp.getActiveDocument().getHeader().editAsText().setFontSize(parseInt(selectedOptions[1], 10));\n \n switch (selectedOptions[2]) {\n case 'Aggie (Maroon)':\n fontColor = '#800000';\n break;\n case 'Red':\n fontColor = '#FF0000';\n break;\n case 'Orange':\n fontColor = '#FFA500';\n break;\n case 'Yellow':\n fontColor = '#FFFF00';\n break;\n case 'Green':\n fontColor = '#008000';\n break; \n case 'Blue':\n fontColor = '#0000FF';\n break;\n case 'Purple':\n fontColor = '#400080';\n break;\n case 'Pink':\n fontColor = '#FFC0CB';\n break;\n case 'Black':\n fontColor = '#000000';\n break;\n case 'Gray':\n fontColor = '#808080';\n break;\n case 'White':\n fontColor = '#FFFFFF';\n break;\n }\n DocumentApp.getActiveDocument().getHeader().editAsText().setForegroundColor(fontColor);\n \n DocumentApp.getActiveDocument().getBody().editAsText().setFontFamily(selectedOptions[3]);\n DocumentApp.getActiveDocument().getBody().editAsText().setFontSize(parseInt(selectedOptions[4], 10));\n switch (selectedOptions[5]) {\n case 'Aggie (Maroon)':\n fontColor = '#800000';\n break;\n case 'Red':\n fontColor = '#FF0000';\n break;\n case 'Orange':\n fontColor = '#FFA500';\n break;\n case 'Yellow':\n fontColor = '#FFFF00';\n break;\n case 'Green':\n fontColor = '#008000';\n break; \n case 'Blue':\n fontColor = '#0000FF';\n break;\n case 'Purple':\n fontColor = '#400080';\n break;\n case 'Pink':\n fontColor = '#FFC0CB';\n break;\n case 'Black':\n fontColor = '#000000';\n break;\n case 'Gray':\n fontColor = '#808080';\n break;\n case 'White':\n fontColor = '#FFFFFF';\n break;\n }\n DocumentApp.getActiveDocument().getBody().editAsText().setForegroundColor(fontColor);\n \n /*\n switch (selectedOptions[6]) {\n case 'Table':\n \n break;\n case 'Numbered List':\n var bodyText = DocumentApp.getActiveDocument().getBody().getText();\n var regex = /^[^-]+.+/gm;\n var matches = bodyText.match(regex);\n DocumentApp.getActiveDocument().getBody().clear();\n for(var i = 0; i < matches.length; i++){\n DocumentApp.getActiveDocument().getBody().appendListItem(matches[i] + \"\\n\");\n }\n break;\n case 'Bullet Points':\n \n break;\n }\n */\n \n switch (selectedOptions[7]) {\n case 'Aggie (Maroon)':\n backgroundColor = '#800000';\n break;\n case 'Red':\n backgroundColor = '#FF0000';\n break;\n case 'Orange':\n backgroundColor = '#FFA500';\n break;\n case 'Yellow':\n backgroundColor = '#FFFF00';\n break;\n case 'Green':\n backgroundColor = '#008000';\n break; \n case 'Blue':\n backgroundColor = '#0000FF';\n break;\n case 'Purple':\n backgroundColor = '#400080';\n break;\n case 'Pink':\n backgroundColor = '#FFC0CB';\n break;\n case 'Black':\n backgroundColor = '#000000';\n break;\n case 'Gray':\n backgroundColor = '#808080';\n break;\n case 'White':\n backgroundColor = '#FFFFFF';\n break;\n }\n DocumentApp.getActiveDocument().getHeader().editAsText().setBackgroundColor(backgroundColor);\n DocumentApp.getActiveDocument().getBody().editAsText().setBackgroundColor(backgroundColor);\n}", "function resetHighlight(e) {\n geojson.resetStyle(e.target);\n //Custom info:\n info.update();\n}", "function Beautifier() {\n var globalOptions, lang, options, _ref;\n this.setupLogger();\n if (this.options._ != null) {\n globalOptions = this.options._;\n delete this.options._;\n if (typeof globalOptions === \"object\") {\n _ref = this.options;\n for (lang in _ref) {\n options = _ref[lang];\n if (typeof options === \"boolean\") {\n if (options === true) {\n this.options[lang] = globalOptions;\n }\n } else if (typeof options === \"object\") {\n this.options[lang] = _.merge(globalOptions, options);\n } else {\n this.warn((\"Unsupported options type \" + (typeof options) + \" for language \" + lang + \": \") + options);\n }\n }\n }\n }\n this.verbose(\"Options for \" + this.name + \":\", this.options);\n this.languages = _.keys(this.options);\n }", "function _Markdown_formatOptions(options)\n{\n\tfunction toHighlight(code, lang)\n\t{\n\t\tif (!lang && elm$core$Maybe$isJust(options.a$))\n\t\t{\n\t\t\tlang = options.a$.a;\n\t\t}\n\n\t\tif (typeof hljs !== 'undefined' && lang && hljs.listLanguages().indexOf(lang) >= 0)\n\t\t{\n\t\t\treturn hljs.highlight(lang, code, true).value;\n\t\t}\n\n\t\treturn code;\n\t}\n\n\tvar gfm = options.a3.a;\n\n\treturn {\n\t\thighlight: toHighlight,\n\t\tgfm: gfm,\n\t\ttables: gfm && gfm.dh,\n\t\tbreaks: gfm && gfm.bI,\n\t\tsanitize: options.c0,\n\t\tsmartypants: options.bq\n\t};\n}", "function defaultOptions() {\n const options = Object.create(null);\n const yellow = '#FFFF00';\n const black = '#000000';\n const red = '#FF0000';\n options['highlight_color'] = yellow;\n options['text_color'] = black;\n options['link_color'] = red;\n options['tinted_highlights'] = false;\n options['autonomous_highlights'] = false;\n options['autonomous_delay'] = 0;\n options['autonomous_state'] = Math.min(2, NUM_HIGHLIGHT_STATES - 1);\n // Enable the blocklist by default, so that it's ready in case\n // autonomous_highlights is enabled (which is disabled by default).\n options['autonomous_blocklist'] = true;\n options['autonomous_blocklist_items'] = [];\n options['autonomous_blocklist_exceptions'] = [];\n return options;\n}", "function resetHighlight(e) {\n geojson.resetStyle(e.target);\n //FIXME: Info hasn't been defined\n \t//info.update();\n }", "updateHighlight() {\n var on = this.hover || this.selected;\n this.highlighted = on;\n if (on) {\n this.material.emissive = this.defaultEmissiveness;\n } else {\n this.material.emissive = this.defaultEmissiveness\n .clone()\n .multiplyScalar(this.brightness);\n this.material.needsUpdate = true;\n }\n }", "addHighlightListeners () {\n }", "highlight() {\n if (arguments.length === 2) {\n this._highlightedPositionsToBe.push({ line: arguments[1], col: arguments[0], type: '.' });\n } else if (arguments.length === 1) {\n let { line, col } = linearPosToLineCol(this._lines.join('\\n'), arguments[0]);\n this._highlightedPositionsToBe.push({ line, col, type: '.' });\n } else throw new Error(`highlight: invalid arguments`);\n }", "function resetHighlight(e) {\n geojson.resetStyle(e.target);\n info.update();\n }", "function updateAdditionalHighlight() {\n let entsAdd = []; // list of entities units to be highlighted\n let entsRemove = [];\n let highlighted = g_Selection.toList();\n for (let ent in g_Selection.highlighted)\n highlighted.push(g_Selection.highlighted[ent]);\n\n if (g_ShowGuarding)\n // flag the guarding entities to add in this additional highlight\n for (let sel in g_Selection.selected) {\n let state = GetEntityState(g_Selection.selected[sel]);\n if (!state.guard || !state.guard.entities.length) continue;\n\n for (let ent of state.guard.entities)\n if (highlighted.indexOf(ent) == -1 && entsAdd.indexOf(ent) == -1)\n entsAdd.push(ent);\n }\n\n if (g_ShowGuarded)\n // flag the guarded entities to add in this additional highlight\n for (let sel in g_Selection.selected) {\n let state = GetEntityState(g_Selection.selected[sel]);\n if (!state.unitAI || !state.unitAI.isGuarding) continue;\n let ent = state.unitAI.isGuarding;\n if (highlighted.indexOf(ent) == -1 && entsAdd.indexOf(ent) == -1)\n entsAdd.push(ent);\n }\n\n // flag the entities to remove (from the previously added) from this additional highlight\n for (let ent of g_AdditionalHighlight)\n if (\n highlighted.indexOf(ent) == -1 &&\n entsAdd.indexOf(ent) == -1 &&\n entsRemove.indexOf(ent) == -1\n )\n entsRemove.push(ent);\n\n _setHighlight(entsAdd, g_HighlightedAlpha, true);\n _setHighlight(entsRemove, 0, false);\n g_AdditionalHighlight = entsAdd;\n}", "function resetHighlight(e) {\n geojson.resetStyle(e.target);\n info.update();\n }", "set options(value) {}", "function resetHighlight(e) {\n geojson.resetStyle(e.target);\n info.update();\n}", "setGlobalOptions(opts) {\n this.particlesPerFrame = opts.particlesPerFrame || 2;\n this.windSpeedMax = opts.windSpeedMax || 1;\n }", "_updateTrackedSelection(buildHighlight) {\n var trackedSelection = this._computeTrackedSelection(buildHighlight);\n\n this.setState({\n trackedSelection\n });\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "async function onOptionsUpdated() {\n globalOptions = await getNewOptions(null);\n}", "function updateContextHighlights(focusspeciesdata) {\n\t//UPDATE \n\tcontexthighlightcircles = svg.selectAll(\".highlightedcontextspecies\")\n\t.data(focusspeciesdata, getBindingField)\n\t\t.attr(\"cx\", function(d, i) {return getContextXFromGenus(d[\"genus-order\"]);});\n\t\t//.attr(\"fill\", \"blue\");\n\t// EXIT\n\tcontexthighlightcircles.exit().remove();\n\n\t// ENTER\n\tcontexthighlightcircles.enter().append(\"svg:circle\")\n \t\t.attr(\"class\", \"highlightedcontextspecies\")\n\t\t.attr(\"cx\", function(d, i) {\n \t\t\treturn getContextXFromGenus(d[\"genus-order\"]);\n \t\t\t})\n \t\t.attr(\"cy\", function(d, i) {\n \t\t\treturn y0-(parseFloat(d[\"species-order\"])*contextyspace)\n \t\t\t})\n \t\t.attr(\"r\", radius)\n \t\t.classed(\"highlightedcontextthreatenedspecies\", function(d) {return isThreatened(d);})\n \t\t//.attr(\"fill\", \"yellow\");\n \t\t\n \tsvg.selectAll(\".highlightedcontextthreatenedspecies\").moveToFront();\t\t\n}", "function getHighlightConfiguration(query) {\n return {\n pre_tags: ['<mark>'],\n post_tags: ['</mark>'],\n fields: {\n title: {\n fragment_size: 200,\n number_of_fragments: 1,\n },\n headings: { fragment_size: 150, number_of_fragments: 2 },\n // The 'no_match_size' is so we can display *something* for the\n // preview if there was no highlight match at all within the content.\n content: {\n fragment_size: 150,\n number_of_fragments: 3,\n no_match_size: 150,\n\n highlight_query: {\n match_phrase_prefix: {\n content: {\n query,\n },\n },\n },\n },\n },\n }\n}", "function resetHighlight_GCQ(e) {\nAreas_ECQ_GCQ.resetStyle(e.target);\ninfo.update();\n}", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called) return;\n initHighlighting.called = true;\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "setTheme(theme = {}) {\n this.colors.foreground = this._parseColor(theme.foreground, DEFAULT_FOREGROUND);\n this.colors.background = this._parseColor(theme.background, DEFAULT_BACKGROUND);\n this.colors.cursor = this._parseColor(theme.cursor, DEFAULT_CURSOR, true);\n this.colors.cursorAccent = this._parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT, true);\n this.colors.selectionTransparent = this._parseColor(theme.selection, DEFAULT_SELECTION, true);\n this.colors.selectionOpaque = color.blend(this.colors.background, this.colors.selectionTransparent);\n /**\n * If selection color is opaque, blend it with background with 0.3 opacity\n * Issue #2737\n */\n if (color.isOpaque(this.colors.selectionTransparent)) {\n const opacity = 0.3;\n this.colors.selectionTransparent = color.opacity(this.colors.selectionTransparent, opacity);\n }\n this.colors.ansi[0] = this._parseColor(theme.black, DEFAULT_ANSI_COLORS[0]);\n this.colors.ansi[1] = this._parseColor(theme.red, DEFAULT_ANSI_COLORS[1]);\n this.colors.ansi[2] = this._parseColor(theme.green, DEFAULT_ANSI_COLORS[2]);\n this.colors.ansi[3] = this._parseColor(theme.yellow, DEFAULT_ANSI_COLORS[3]);\n this.colors.ansi[4] = this._parseColor(theme.blue, DEFAULT_ANSI_COLORS[4]);\n this.colors.ansi[5] = this._parseColor(theme.magenta, DEFAULT_ANSI_COLORS[5]);\n this.colors.ansi[6] = this._parseColor(theme.cyan, DEFAULT_ANSI_COLORS[6]);\n this.colors.ansi[7] = this._parseColor(theme.white, DEFAULT_ANSI_COLORS[7]);\n this.colors.ansi[8] = this._parseColor(theme.brightBlack, DEFAULT_ANSI_COLORS[8]);\n this.colors.ansi[9] = this._parseColor(theme.brightRed, DEFAULT_ANSI_COLORS[9]);\n this.colors.ansi[10] = this._parseColor(theme.brightGreen, DEFAULT_ANSI_COLORS[10]);\n this.colors.ansi[11] = this._parseColor(theme.brightYellow, DEFAULT_ANSI_COLORS[11]);\n this.colors.ansi[12] = this._parseColor(theme.brightBlue, DEFAULT_ANSI_COLORS[12]);\n this.colors.ansi[13] = this._parseColor(theme.brightMagenta, DEFAULT_ANSI_COLORS[13]);\n this.colors.ansi[14] = this._parseColor(theme.brightCyan, DEFAULT_ANSI_COLORS[14]);\n this.colors.ansi[15] = this._parseColor(theme.brightWhite, DEFAULT_ANSI_COLORS[15]);\n // Clear our the cache\n this._contrastCache.clear();\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t ArrayProto.forEach.call(blocks, highlightBlock);\n\t }", "function format4highlight(inputArray){\n let changes = {}; \n\n //for each row select which columns will be highlight and what style \n //CSS file controls actual color output\n inputArray.forEach(function(d){\n changes[d]={\n user_name: \"current-user\",\n user_location: \"current-user\",\n post_date: \"current-user\",\n user_bio: \"current-user\",\n believes_legitimate: \"current-user\",\n tweet_text_body: \"current-user\"\n };\n })\n\n return changes;\n}", "function format4highlight(inputArray){\n let changes = {}; \n\n //for each row select which columns will be highlight and what style \n //CSS file controls actual color output\n inputArray.forEach(function(d){\n changes[d]={\n user_name: \"current-user\",\n user_location: \"current-user\",\n post_date: \"current-user\",\n user_bio: \"current-user\",\n believes_legitimate: \"current-user\",\n tweet_text_body: \"current-user\"\n };\n })\n\n return changes;\n}", "set highlightColor(value) {\n if (value === this.highlightColorIn) {\n return;\n }\n this.highlightColorIn = value;\n this.notifyPropertyChanged('highlightColor');\n }", "function setOptions(o){\n\t\t\t\n\t\t\toptions = merge(o, {\n\t\t\t\tcolors: ['#00A8F0', '#C0D800', '#cb4b4b', '#4da74d', '#9440ed'], //=> The default colorscheme. When there are > 5 series, additional colors are generated.\n\t\t\t\tlegend: {\n\t\t\t\t\tshow: true,\t\t\t\t// => setting to true will show the legend, hide otherwise\n\t\t\t\t\tnoColumns: 1,\t\t\t// => number of colums in legend table\n\t\t\t\t\tlabelFormatter: null,\t// => fn: string -> string\n\t\t\t\t\tlabelBoxBorderColor: '#ccc', // => border color for the little label boxes\n\t\t\t\t\tcontainer: null,\t\t\t// => container (as jQuery object) to put legend in, null means default on top of graph\n\t\t\t\t\tposition: 'ne',\t\t\t// => position of default legend container within plot\n\t\t\t\t\tmargin: 5,\t\t\t\t// => distance from grid edge to default legend container within plot\n\t\t\t\t\tbackgroundColor: null,\t// => null means auto-detect\n\t\t\t\t\tbackgroundOpacity: 0.85\t// => set to 0 to avoid background, set to 1 for a solid background\n\t\t\t\t},\n\t\t\t\txaxis: {\n\t\t\t\t\tticks: null,\t\t\t// => format: either [1, 3] or [[1, 'a'], 3]\n\t\t\t\t\tnoTicks: 5,\t\t\t\t// => number of ticks for automagically generated ticks\n\t\t\t\t\ttickFormatter: defaultTickFormatter, // => fn: number -> string\n\t\t\t\t\ttickDecimals: null,\t\t// => no. of decimals, null means auto\n\t\t\t\t\tmin: null,\t\t\t\t// => min. value to show, null means set automatically\n\t\t\t\t\tmax: null,\t\t\t\t// => max. value to show, null means set automatically\n\t\t\t\t\tautoscaleMargin: 0\t\t// => margin in % to add if auto-setting min/max\n\t\t\t\t},\n\t\t\t\tyaxis: {\n\t\t\t\t\tticks: null,\t\t\t// => format: either [1, 3] or [[1, 'a'], 3]\n\t\t\t\t\tnoTicks: 5,\t\t\t\t// => number of ticks for automagically generated ticks\n\t\t\t\t\ttickFormatter: defaultTickFormatter, // => fn: number -> string\n\t\t\t\t\ttickDecimals: null,\t\t// => no. of decimals, null means auto\n\t\t\t\t\tmin: null,\t\t\t\t// => min. value to show, null means set automatically\n\t\t\t\t\tmax: null,\t\t\t\t// => max. value to show, null means set automatically\n\t\t\t\t\tautoscaleMargin: 0\t\t// => margin in % to add if auto-setting min/max\n\t\t\t\t},\n\t\t\t\tpoints: {\n\t\t\t\t\tshow: false,\t\t\t// => setting to true will show points, false will hide\n\t\t\t\t\tradius: 3,\t\t\t\t// => point radius (pixels)\n\t\t\t\t\tlineWidth: 2,\t\t\t// => line width in pixels\n\t\t\t\t\tfill: true,\t\t\t\t// => true to fill the points with a color, false for (transparent) no fill\n\t\t\t\t\tfillColor: '#ffffff'\t// => fill color\n\t\t\t\t},\n\t\t\t\tlines: {\n\t\t\t\t\tshow: false,\t\t\t// => setting to true will show lines, false will hide\n\t\t\t\t\tlineWidth: 2, \t\t\t// => line width in pixels\n\t\t\t\t\tfill: false,\t\t\t// => true to fill the area from the line to the x axis, false for (transparent) no fill\n\t\t\t\t\tfillColor: null\t\t\t// => fill color\n\t\t\t\t},\n\t\t\t\tbars: {\n\t\t\t\t\tshow: false,\t\t\t// => setting to true will show bars, false will hide\n\t\t\t\t\tlineWidth: 2,\t\t\t// => in pixels\n\t\t\t\t\tbarWidth: 1,\t\t\t// => in units of the x axis\n\t\t\t\t\tfill: true,\t\t\t\t// => true to fill the area from the line to the x axis, false for (transparent) no fill\n\t\t\t\t\tfillColor: null\t\t\t// => fill color\n\t\t\t\t},\n\t\t\t\tgrid: {\n\t\t\t\t\tcolor: '#545454',\t\t// => primary color used for outline and labels\n\t\t\t\t\tbackgroundColor: null,\t// => null for transparent, else color\n\t\t\t\t\ttickColor: '#dddddd',\t// => color used for the ticks\n\t\t\t\t\tlabelMargin: 3\t\t\t// => margin in pixels\n\t\t\t\t},\n\t\t\t\tselection: {\n\t\t\t\t\tmode: null,\t\t\t\t// => one of null, 'x', 'y' or 'xy'\n\t\t\t\t\tcolor: '#B6D9FF',\t\t// => selection box color\n\t\t\t\t\tfps: 10\t\t\t\t\t// => frames-per-second\n\t\t\t\t},\n\t\t\t\tmouse: {\n\t\t\t\t\ttrack: null,\t\t\t// => true to track the mouse, no tracking otherwise\n\t\t\t\t\tposition: 'se',\t\t\t// => position of the value box (default south-east)\n\t\t\t\t\ttrackFormatter: defaultTrackFormatter, // => formats the values in the value box\n\t\t\t\t\tmargin: 3,\t\t\t\t// => margin in pixels of the valuebox\n\t\t\t\t\tcolor: '#ff3f19',\t\t// => line color of points that are drawn when mouse comes near a value of a series\n\t\t\t\t\ttrackDecimals: 1,\t\t// => decimals for the track values\n\t\t\t\t\tsensibility: 2,\t\t\t// => the lower this number, the more precise you have to aim to show a value\n\t\t\t\t\tradius: 3\t\t\t\t// => radius of the tracck point\n\t\t\t\t},\n\t\t\t\tshadowSize: 4\t\t\t\t// => size of the 'fake' shadow\n\t\t\t});\n\t\t\t\n\t\t\t/**\n\t\t\t * Collect colors assigned by the user to a serie.\n\t\t\t */\n\t\t\tvar neededColors = series.length;\n\t\t\tvar usedColors = [];\n\t\t\tvar assignedColors = [];\n\t\t\tfor(var i = 0; i < series.length; ++i){\n\t\t\t\tvar sc = series[i].color;\n\t\t\t\tif(sc != null){\n\t\t\t\t\t--neededColors;\n\t\t\t\t\tif(Object.isNumber(sc)) assignedColors.push(sc);\n\t\t\t\t\telse usedColors.push(parseColor(series[i].color));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/**\n\t\t\t * Calculate the number of colors that need to be generated.\n\t\t\t */\n\t\t\tfor(var j = 0; j < assignedColors.length; ++j){\n\t\t\t\tneededColors = Math.max(neededColors, assignedColors[j] + 1);\n\t\t\t}\n\t\n\t\t\t/**\n\t\t\t * Generate colors.\n\t\t\t */\n\t\t\tvar colors = [];\n\t\t\tvar variation = 0;\n\t\t\tvar k = 0;\n\t\t\twhile(colors.length < neededColors){\n\t\t\t\tvar c = (options.colors.length == k) ? new Color(100, 100, 100) : parseColor(options.colors[k]);\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Make sure each serie gets a different color.\n\t\t\t\t */\n\t\t\t\tvar sign = variation % 2 == 1 ? -1 : 1;\n\t\t\t\tvar factor = 1 + sign * Math.ceil(variation / 2) * 0.2;\n\t\t\t\tc.scale(factor, factor, factor);\n\t\n\t\t\t\t/**\n\t\t\t\t * @todo if we're getting to close to something else, we should probably skip this one\n\t\t\t\t */\n\t\t\t\tcolors.push(c);\n\t\t\t\t\n\t\t\t\tif(++k >= options.colors.length){\n\t\t\t\t\tk = 0;\n\t\t\t\t\t++variation;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t/**\n\t\t\t * Fill the options with the generated colors.\n\t\t\t */\n\t\t\tvar colori = 0;\n\t\t\tfor(var m = 0, s; m < series.length; ++m){\n\t\t\t\ts = series[m];\n\t\n\t\t\t\t/**\n\t\t\t\t * Assign the color.\n\t\t\t\t */\n\t\t\t\tif(s.color == null){\n\t\t\t\t\ts.color = colors[colori].toString();\n\t\t\t\t\t++colori;\n\t\t\t\t}else if(Object.isNumber(s.color)){\n\t\t\t\t\ts.color = colors[s.color].toString();\n\t\t\t\t}\n\t\n\t\t\t\ts.lines = Object.extend(Object.clone(options.lines), s.lines);\n\t\t\t\ts.points = Object.extend(Object.clone(options.points), s.points);\n\t\t\t\ts.bars = Object.extend(Object.clone(options.bars), s.bars);\n\t\t\t\ts.mouse = Object.extend(Object.clone(options.mouse), s.mouse);\n\t\t\t\t\n\t\t\t\tif(s.shadowSize == null) s.shadowSize = options.shadowSize;\n\t\t\t}\n\t\t}", "function initHighlightJs() {\n\tapexJsSelectors.forEach((selector) => {\n\t\tdocument.querySelectorAll(selector).forEach(block => {\n\t\t\tblock.classList.add(\"language-apex\");\n\t\t});\n\t});\n\t// Alow language auto-detection in \"pre code\" blocks\n\tapexJsSelectors.push(\"pre code\");\n\t// initialize highlighting for code examples and\n\t// signatures for methods, classes, props and enums\n\t// Highlight.js now contains multiple languages to aid in\n\t// code highlighting for the HTML pages in documentation\n\t// Bash, CSS, JSON, YAML, Markdown, HTML/Visualforce, JavaScript, Plain Text)\n\thljs.configure({\n\t\tcssSelector: apexJsSelectors\n\t});\n\thljs.highlightAll();\n}", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function set(obj) {\r\n settings = $.extend(true, settings, obj);\r\n }", "function updateHighlightingStateUI(state) {\n document.getElementById(\"highlightstate\").value = parseInt(state);\n switch (state) {\n case 0:\n $('#highlightstatetext').text('Quote highlighting disabled for all domains.');\n disableDomainControls();\n break;\n case 1:\n $('#highlightstatetext').text('Quote highlighting enabled for domains:');\n document.getElementById(\"domains\").disabled = false;\n document.getElementById(\"togglecurrentdomain\").disabled = false;\n document.getElementById(\"domains\").style.opacity = 1;\n document.getElementById(\"removedomains\").style.opacity = 1;\n document.getElementById(\"togglecurrentdomain\").style.opacity = 1;\n \n enableRemoveButtonsIfNecessary();\n break;\n case 2:\n $('#highlightstatetext').text('Quote highlighting enabled for all domains.');\n disableDomainControls();\n break;\n }\n}", "function resetHighlight(e) {\n style_override = {};\n var layer = e.target;\n geojson.resetStyle(layer);\n}", "function resetHighlight(e) {\n geojson.resetStyle(e.target);\n }", "function objUpdate() \n {\n\n column.innerHTML = window.getSelection().anchorOffset;\n try{\n errorBox.innerText = \"\";\n var result = highlightSyntax(input.innerText);\n input.innerHTML = result[0];\n \n }catch(err){\n //console.log(err);\n errorBox.innerText = JSON.stringify(err);\n }\n\n }", "clearHighlight() {\n\n //TODO - your code goes here -\n }", "function _setupHighlightButton() {\n // TODO: this should be moved into index.html like the Go Live button once it's re-enabled\n _$btnHighlight = $(\"<a href=\\\"#\\\">Highlight </a>\");\n $(\".nav\").append($(\"<li>\").append(_$btnHighlight));\n _$btnHighlight.click(function onClick() {\n config.highlight = !config.highlight;\n if (config.highlight) {\n _setLabel(_$btnHighlight, _checkMark, \"success\");\n } else {\n _setLabel(_$btnHighlight);\n LiveDevelopment.hideHighlight();\n }\n });\n if (config.highlight) {\n _setLabel(_$btnHighlight, _checkMark, \"success\");\n }\n }", "function postParseOptions(options) {\n\t\t for (var i=0; i<this.series.length; i++) {\n\t\t this.series[i].seriesColors = this.seriesColors;\n\t\t this.series[i].colorGenerator = this.colorGenerator;\n\t\t }\n\t\t }", "setOptions(options) {\n this.options = deepExtend({}, this.defaultOptions, options);\n }", "function updateTips(o, t) {\n o.addClass('ui-state-highlight');\n o.text(t).effect(\"highlight\", {}, 1500);\n }", "function resetHighlight(e) {\n\te.target.setStyle({\n\t\tweight: 1.5,\n\t\tcolor: '#fff'\n\t});\n\tinfo.update();\n}", "highlightLine(line_num)\n{\n this.highlightSet = line_num;\n}", "function highlight(language_name, value) {\n\n function subMode(lexem, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n var match = mode.contains[i].beginRe.exec(lexem);\n if (match && match.index == 0) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode_index, lexem) {\n if (modes[mode_index].end && modes[mode_index].endRe.test(lexem))\n return 1;\n if (modes[mode_index].endsWithParent) {\n var level = endOfMode(mode_index - 1, lexem);\n return level ? level + 1 : 0;\n }\n return 0;\n }\n\n function isIllegal(lexem, mode) {\n return mode.illegal && mode.illegalRe.test(lexem);\n }\n\n function eatModeChunk(value, index) {\n var mode = modes[modes.length - 1];\n if (mode.terminators) {\n mode.terminators.lastIndex = index;\n return mode.terminators.exec(value);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n var value = mode.keywords[match_str];\n if (value && value instanceof Array)\n return value;\n return false;\n }\n\n function processKeywords(buffer, mode) {\n buffer = escape(buffer);\n if (!mode.keywords)\n return buffer;\n var result = '';\n var last_index = 0;\n mode.lexemsRe.lastIndex = 0;\n var match = mode.lexemsRe.exec(buffer);\n while (match) {\n result += buffer.substr(last_index, match.index - last_index);\n var keyword_match = keywordMatch(mode, match);\n if (keyword_match) {\n keyword_count += keyword_match[1];\n result += '<span class=\"'+ keyword_match[0] +'\">' + match[0] + '</span>';\n } else {\n result += match[0];\n }\n last_index = mode.lexemsRe.lastIndex;\n match = mode.lexemsRe.exec(buffer);\n }\n return result + buffer.substr(last_index);\n }\n\n function processSubLanguage(buffer, mode) {\n var result;\n if (mode.subLanguage == '') {\n result = highlightAuto(buffer);\n } else {\n result = highlight(mode.subLanguage, buffer);\n }\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (mode.relevance > 0) {\n keyword_count += result.keyword_count;\n relevance += result.relevance;\n }\n return '<span class=\"' + result.language + '\">' + result.value + '</span>';\n }\n\n function processBuffer(buffer, mode) {\n if (mode.subLanguage && languages[mode.subLanguage] || mode.subLanguage == '') {\n return processSubLanguage(buffer, mode);\n } else {\n return processKeywords(buffer, mode);\n }\n }\n\n function startNewMode(mode, lexem) {\n var markup = mode.className? '<span class=\"' + mode.className + '\">': '';\n if (mode.returnBegin) {\n result += markup;\n mode.buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexem) + markup;\n mode.buffer = '';\n } else {\n result += markup;\n mode.buffer = lexem;\n }\n modes.push(mode);\n relevance += mode.relevance;\n }\n\n function processModeInfo(buffer, lexem) {\n var current_mode = modes[modes.length - 1];\n if (lexem === undefined) {\n result += processBuffer(current_mode.buffer + buffer, current_mode);\n return;\n }\n\n var new_mode = subMode(lexem, current_mode);\n if (new_mode) {\n result += processBuffer(current_mode.buffer + buffer, current_mode);\n startNewMode(new_mode, lexem);\n return new_mode.returnBegin;\n }\n\n var end_level = endOfMode(modes.length - 1, lexem);\n if (end_level) {\n var markup = current_mode.className?'</span>':'';\n if (current_mode.returnEnd) {\n result += processBuffer(current_mode.buffer + buffer, current_mode) + markup;\n } else if (current_mode.excludeEnd) {\n result += processBuffer(current_mode.buffer + buffer, current_mode) + markup + escape(lexem);\n } else {\n result += processBuffer(current_mode.buffer + buffer + lexem, current_mode) + markup;\n }\n while (end_level > 1) {\n markup = modes[modes.length - 2].className?'</span>':'';\n result += markup;\n end_level--;\n modes.length--;\n }\n var last_ended_mode = modes[modes.length - 1];\n modes.length--;\n modes[modes.length - 1].buffer = '';\n if (last_ended_mode.starts) {\n startNewMode(last_ended_mode.starts, '');\n }\n return current_mode.returnEnd;\n }\n\n if (isIllegal(lexem, current_mode))\n throw 'Illegal';\n }\n\n var language = languages[language_name];\n compileLanguage(language);\n var modes = [language];\n language.buffer = '';\n var relevance = 0;\n var keyword_count = 0;\n var result = '';\n try {\n var match, index = 0;\n while (true) {\n match = eatModeChunk(value, index);\n if (!match)\n break;\n var return_lexem = processModeInfo(value.substr(index, match.index - index), match[0]);\n index = match.index + (return_lexem ? 0 : match[0].length);\n }\n processModeInfo(value.substr(index), undefined);\n return {\n relevance: relevance,\n keyword_count: keyword_count,\n value: result,\n language: language_name\n };\n } catch (e) {\n if (e == 'Illegal') {\n return {\n relevance: 0,\n keyword_count: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "updateSelectionHash() {\n if (!this.trackedSelections) {\n return;\n }\n const ranges = this.trackedSelections.productSelections();\n const value = ranges.map((r) => r.toString()).join(';');\n AppContext.getInstance().hash.setProp(AppConstants.HASH_PROPS.SELECTION, value);\n }" ]
[ "0.60890985", "0.5841288", "0.57530504", "0.54813933", "0.5392691", "0.5234868", "0.5229774", "0.5227607", "0.5198296", "0.51958704", "0.5170306", "0.5168324", "0.5164002", "0.51420987", "0.51420987", "0.5135855", "0.5134353", "0.5134353", "0.5116286", "0.51022196", "0.5097605", "0.5085643", "0.50853", "0.5079218", "0.50588286", "0.504712", "0.49988106", "0.49972522", "0.4972531", "0.496549", "0.49637258", "0.49586552", "0.49490857", "0.49476132", "0.49433604", "0.4910044", "0.48974904", "0.48897007", "0.48761672", "0.48554543", "0.48319942", "0.48303166", "0.48283303", "0.48234352", "0.48018277", "0.47884613", "0.4784211", "0.4783484", "0.47815916", "0.47732544", "0.4772471", "0.4770068", "0.47693554", "0.47693554", "0.47693554", "0.47693554", "0.47693554", "0.47693554", "0.47693554", "0.47693554", "0.47693554", "0.47693554", "0.47693554", "0.47693554", "0.47693554", "0.47693554", "0.47670254", "0.47568288", "0.473553", "0.47333214", "0.47333214", "0.47333214", "0.47333214", "0.47333214", "0.47333214", "0.47333214", "0.47333214", "0.47194692", "0.47146124", "0.47146124", "0.47089416", "0.47012058", "0.47010452", "0.469543", "0.469543", "0.469543", "0.469543", "0.46936876", "0.46867463", "0.46762916", "0.46691188", "0.46628243", "0.46622127", "0.46322253", "0.46321976", "0.46292326", "0.46280468", "0.46202332", "0.46186525", "0.46084034", "0.4608121" ]
0.0
-1
Applies highlighting to all .. blocks on a page.
function initHighlighting() { if (initHighlighting.called) return; initHighlighting.called = true; var blocks = document.querySelectorAll('pre code'); ArrayProto.forEach.call(blocks, highlightBlock); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called) return;\n initHighlighting.called = true;\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function highlight() {\n\t\t$('pre code').each(function(i, e) {\n\t\t hljs.highlightBlock(e)\n\t\t});\n\t}", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t ArrayProto.forEach.call(blocks, highlightBlock);\n\t }", "function highlightInCodeBlocks() {\n\n var codes = document.querySelectorAll('pre code');\n \n for (var i = 0; i < codes.length; ++i) {\n var code = codes[i];\n var pre = code.parentElement;\n\n hightlightCodeBlock(code, pre);\n }\n}", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n var pres = document.getElementsByTagName('pre');\n for (var i = 0; i < pres.length; i++) {\n var code = findCode(pres[i]);\n if (code)\n highlightBlock(code, hljs.tabReplace);\n }\n }", "function highlighter() {\n\n\tvar areas = $(\".highlight_area\");\n\n\t// in case of ajax reloading and other dynamics\n\t// remove the old mouseover/mouseout events and attach them new\n\tareas.off(\"mouseover\");\n\tareas.off(\"mouseout\");\n\tareas.mouseover(function() {\n\t\tvar itemId = parseId(jQuery(this).attr('class'));\n\t\tvar prntId = parseId(jQuery(this).attr('class'), 'parent_');\n\t\thighlight(itemId); // highlight the current element\n\t\tcheckForChilds(itemId);// highlight the child elements - recursive\n\t\t// - of the current item, if it's given\n\t\tif (prntId) { // check if the current item is a child of another\n\t\t\thighlight(prntId, 'id_'); // hightlight the next parent item,\n\t\t\t// if the current item is a child\n\t\t}\n\t}).mouseout(function() {\n\t\treset_highlight();\n\t});\n\n}", "_highlightCode() {\n let code = this.$('pre code');\n\n code.each((i, block) => {\n Highlight.highlightBlock(block);\n });\n }", "function formatPage() {\n $('.marked').each(function () {\n var text = $(this).text();\n text = text.replace(new RegExp('(\\\\\\\\n)', 'g'), \" \");\n text = text.replace(new RegExp('(\\\\\\\\\")', 'g'), \"\");\n $(this).html(marked(text));\n });\n $('.pre code').each(function(i, block) {\n hljs.highlightBlock(block);\n });\n }", "_processInitialHighlighting() {\n var highlightedCategories = this.getOptions()['highlightedCategories'];\n if (highlightedCategories && highlightedCategories.length > 0)\n this.highlight(highlightedCategories);\n }", "highlight(on) { }", "onHighlight() {\n if (this.isHighlightEditRegion) {\n this.highlightEditRegion();\n }\n else {\n this.unHighlightEditRegion();\n }\n this.viewer.renderVisiblePages();\n }", "function highlight() {\n var code_blocks = document.body.getElementsByClassName(\"language-c\");\n var keywords = [\n \"auto\", \"break\", \"case\", \"char\", \"const\", \"continue\", \"default\",\n \"do\", \"double\", \"else\", \"enum\", \"extern\", \"float\", \"for\", \"goto\",\n \"if\", \"inline\", \"int\", \"long\", \"register\", \"restrict\", \"return\",\n \"short\", \"signed\", \"sizeof\", \"static\", \"struct\", \"switch\",\n \"typedef\", \"union\", \"unsigned\", \"void\", \"volatile\", \"while\",\n ];\n var regex_var = /\\b[A-z][A-z0-9]*/;\n var regex_number = /\\b0[xX][0-9a-fA-F]+\\b|\\b[0-9]*\\.[0-9]+\\b|\\b[0-9]*\\b/;\n var regex_string = /\"[^\"]*\"/;\n var regex_symbol = /&gt;|&lt;|\\ |\\(|\\)|;|-/;\n for (var i = 0; i < code_blocks.length; i++) {\n var element = code_blocks.item(i);\n var code_lines = element.innerHTML.split('\\n');\n var cursor = 0;\n\n var parts = [];\n var insert_index = 0;\n function insert_at(index, insertable) {\n if (index < insert_index) console.error(\"inserting before last insert!!\");\n parts.push(element.innerHTML.substr(insert_index, index - insert_index));\n parts.push(insertable);\n insert_index = index;\n }\n\n var in_block_comment = false;\n\n for (var j = 0; j < code_lines.length; j++) {\n var words = code_lines[j].split(regex_symbol);\n var in_line_comment = false;\n\n for (var k = 0; k < words.length; k++) {\n var word = words[k];\n\n // Special case for < and >, because they're escaped in\n // innerHTML.\n var to_be_processed_html = element.innerHTML.substr(cursor);\n if (to_be_processed_html.startsWith(\"lt;\") ||\n to_be_processed_html.startsWith(\"gt;\")) {\n cursor += 3;\n }\n\n if (in_block_comment) {\n if (word == \"*/\") {\n in_block_comment = false;\n insert_at(cursor + word.length, \"</span>\"); // close comment block\n }\n } else {\n if (!in_line_comment) {\n if (word == \"//\") {\n in_line_comment = true;\n insert_at(cursor, \"<span class='syntax-comment'>\"); // open comment line\n }\n if (word == \"/*\") {\n in_block_comment = true;\n insert_at(cursor, \"<span class='syntax-comment'>\"); // open comment block\n }\n }\n\n if (!in_line_comment && !in_block_comment) {\n if (keywords.indexOf(word) != -1) {\n insert_at(cursor, \"<span class='syntax-keyword'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_string.test(word)) {\n insert_at(cursor, \"<span class='syntax-string'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_var.test(word) && element.innerHTML.substr(cursor + word.length, 1) == \"(\") {\n insert_at(cursor, \"<span class='syntax-call'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_var.test(word)) {\n insert_at(cursor, \"<span class='syntax-variable'>\");\n insert_at(cursor + word.length, \"</span>\");\n } else if (regex_number.test(word)) {\n insert_at(cursor, \"<span class='syntax-number'>\");\n insert_at(cursor + word.length, \"</span>\");\n }\n }\n }\n\n cursor += word.length + 1;\n }\n\n if (in_line_comment) {\n insert_at(cursor, \"</span>\"); // close comment line\n }\n }\n\n parts.push(element.innerHTML.substr(insert_index));\n element.innerHTML = parts.join('');\n\n // When processing, using &lt; and &gt; is forced upon us. Now we\n // can fix that to allow for good copypasting.\n element.innerHTML.replace(/&lt;/g, \"<\");\n element.innerHTML.replace(/&gt;/g, \">\");\n }\n}", "function highlight() {\n if (window.getSelection) {\n var selection = window.getSelection();\n if (selection.rangeCount) {\n var range = selection.getRangeAt(0).cloneRange();\n var highlightNode = document.createElement(\"span\");\n highlightNode.setAttribute(\"id\", \"highlighted\");\n highlightNode.setAttribute(\"style\", \"background-color:#FFFF00\");\n range.surroundContents(highlightNode);\n selection.removeAllRanges();\n }\n }\n}", "function MyApp_RemoveAllHighlights() {\nMyApp_RemoveAllHighlightsForElement(document.body);\n}", "highlightCode() {\n hljs.highlightElement(this.el);\n }", "function highlightBlock(block) {\n var language = blockLanguage(block);\n if (/no(-?)highlight|plain|text/.test(language))\n return;\n\n var node;\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n var text = node.textContent;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n var originalStream = nodeStream(node);\n if (originalStream.length) {\n var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var language = blockLanguage(block);\n if (/no(-?)highlight|plain|text/.test(language))\n return;\n\n var node;\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n var text = node.textContent;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n var originalStream = nodeStream(node);\n if (originalStream.length) {\n var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function filehighlight(fileurl, findings){\n \"use strict\";\n var locations = [], classname;\n\n locations = filelocations(fileurl, findings);\n\n $('.classFrame').load(function (){\n //In case the file does not have any problems assossiated with it, don't do anything.\n if (supress_highlighter){\n return; //Hack to prevent multiple executuions.\n }\n if (locations.length === 0) {\n highlight_clear(previous_highlight.loc); //Clear previous highlight even in files without problems\n //Since highlights are cleared, we shouldn't keep a record of highlights\n previous_highlight.loc = [];\n previous_highlight.classname = \"\";\n return;\n }\n\n classname = locations[0].classname; //Hack to get the necessary classname for the functions\n\n highlight_clear(previous_highlight.loc); // Clear previous highlights\n\n //Highlight everything in the new file\n previous_highlight.loc = locations;\n previous_highlight.classname = classname;\n\n highlight_all(locations, classname);\n\n //Do the hovering\n hover_all(locations, classname);\n });\n}", "function highlightTree(tree, highlighter, \n/**\nAssign styling to a region of the text. Will be called, in order\nof position, for any ranges where more than zero classes apply.\n`classes` is a space separated string of CSS classes.\n*/\nputStyle, \n/**\nThe start of the range to highlight.\n*/\nfrom = 0, \n/**\nThe end of the range.\n*/\nto = tree.length) {\n let builder = new HighlightBuilder(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);\n builder.highlightRange(tree.cursor(), from, to, \"\", builder.highlighters);\n builder.flush(to);\n}", "function clearHighlightsOnPage()\n{\n unhighlight(document.getElementsByTagName('body')[0], \"ffff00\");\n highlightedPage = false;\n lastText = \"\";\n}", "function highlighter(){\n \"use strict\";\n\n var url;\n\n if (supress_highlighter || not_ready_highlighter){\n //Do not fire, only change the supressor\n supress_highlighter = false;\n } else {\n url = document.getElementById(\"classFrame\").contentWindow.location.href;\n filehighlight(url,problems);\n }\n}", "function highlightBlock(block) {\n var language = blockLanguage(block);\n if (/no(-?)highlight/.test(language))\n return;\n\n var node;\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n var text = node.textContent;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n var originalStream = nodeStream(node);\n if (originalStream.length) {\n var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var language = blockLanguage(block);\n if (/no(-?)highlight/.test(language))\n return;\n\n var node;\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n var text = node.textContent;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n var originalStream = nodeStream(node);\n if (originalStream.length) {\n var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var text = options.useBR ? block.innerHTML\n .replace(/\\n/g,'').replace(/<br>|<br [^>]*>/g, '\\n').replace(/<[^>]*>/g,'')\n : block.textContent;\n var language = blockLanguage(block);\n if (language == 'no-highlight')\n return;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n var original = nodeStream(block);\n if (original.length) {\n var pre = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre');\n pre.innerHTML = result.value;\n result.value = mergeStreams(original, nodeStream(pre), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className += ' hljs ' + (!language && result.language || '');\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var text = options.useBR ? block.innerHTML\n .replace(/\\n/g,'').replace(/<br>|<br [^>]*>/g, '\\n').replace(/<[^>]*>/g,'')\n : block.textContent;\n var language = blockLanguage(block);\n if (language == 'no-highlight')\n return;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n var original = nodeStream(block);\n if (original.length) {\n var pre = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre');\n pre.innerHTML = result.value;\n result.value = mergeStreams(original, nodeStream(pre), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className += ' hljs ' + (!language && result.language || '');\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function updateTreeHighlights(hlist) { \n \n \t // clearHighlight();\n idx = 0;\n \n var $concepts = null;\n var conceptSelectors = [];\n \n \t // Select all doc elements with the hid attribute\n \t $alltags=$('htag');\n \t\t $allframetags=$(\".docview_iframe_content\").contents().find('htag');\n\t\t $alltags=$alltags.add($allframetags);\n\t\t $alltags.removeClass('docquery-highlight');\n \t $alltags.removeAttr('highlightNum');\n \t $alltags.removeAttr('hChild');\n \t if($('span').attr('data-field')){\n \t\t$(this).removeClass(\"docquery-highlight\");\n \t\t$(\".data-section\").find(\"span\").removeClass(\".docquery-highlight.active\");\n \t\t$(\".data-section\").find(\"span\").removeClass(\"docquery-highlight.active\")\n \t }\n \t \n\t\t for (k in hlist) {\n var cid = hlist[k];\n \t\t if (hlmap[cid]) {\n \t\t\t for (d in hlmap[cid]) {\n\t\t\t\t\t var $selected;\n\t\t\t\t\t\tvar selector='htag[l=\"' + hlmap[cid][d][1] + '\"]'\n\t\t\t\t\t\tif (hlmap[cid][d][0]==0) {\n\t\t\t\t\t\t\t$selected=$(selector)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$selected=$(\".docview_iframe_content\").contents().find(selector)\t\n\t\t\t\t\t\t}\n \t\t\t \t\t\n\t\t\t\t\t\tif (d==0) {\n \t\t\t \t\t\tconceptSelectors.push($selected);\n \t\t\t\t\t$selected.addClass('docquery-highlight');\n \t\t\t\t\t$selected.attr('hNum',cid);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n \t\t\t\t\t$selected.attr('hNum',cid);\n\t\t\t\t\t\t\t$selected.addClass('docquery-highlight2');\n\t\t\t\t\t\t}\n \t\t\t }\n\t\t\t }\n }\n \n\t\t $concepts = $(conceptSelectors);\n\n toggleHlNavLink($concepts);\n\t\t\tscrollTo(idx); \n }", "function highlightBlock(block) {\n var text = options.useBR ? block.innerHTML\n .replace(/\\n/g,'').replace(/<br>|<br [^>]*>/g, '\\n').replace(/<[^>]*>/g,'')\n : block.textContent;\n var language = blockLanguage(block);\n if (language == 'no-highlight')\n return;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n var original = nodeStream(block);\n if (original.length) {\n var pre = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre');\n pre.innerHTML = result.value;\n result.value = mergeStreams(original, nodeStream(pre), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className += ' hljs ' + (!language && result.language || '');\n block.result = {\n language: result.language,\n re: result.r\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.r\n };\n }\n }", "function highlightBlock(block) {\n\t var language = blockLanguage(block);\n\t if (isNotHighlighted(language))\n\t return;\n\n\t var node;\n\t if (options.useBR) {\n\t node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n\t node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n\t } else {\n\t node = block;\n\t }\n\t var text = node.textContent;\n\t var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n\t var originalStream = nodeStream(node);\n\t if (originalStream.length) {\n\t var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n\t resultNode.innerHTML = result.value;\n\t result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n\t }\n\t result.value = fixMarkup(result.value);\n\n\t block.innerHTML = result.value;\n\t block.className = buildClassName(block.className, language, result.language);\n\t block.result = {\n\t language: result.language,\n\t re: result.relevance\n\t };\n\t if (result.second_best) {\n\t block.second_best = {\n\t language: result.second_best.language,\n\t re: result.second_best.relevance\n\t };\n\t }\n\t }", "function highlightBlock(block) {\n\t var language = blockLanguage(block);\n\t if (isNotHighlighted(language))\n\t return;\n\n\t var node;\n\t if (options.useBR) {\n\t node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n\t node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n\t } else {\n\t node = block;\n\t }\n\t var text = node.textContent;\n\t var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n\t var originalStream = nodeStream(node);\n\t if (originalStream.length) {\n\t var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n\t resultNode.innerHTML = result.value;\n\t result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n\t }\n\t result.value = fixMarkup(result.value);\n\n\t block.innerHTML = result.value;\n\t block.className = buildClassName(block.className, language, result.language);\n\t block.result = {\n\t language: result.language,\n\t re: result.relevance\n\t };\n\t if (result.second_best) {\n\t block.second_best = {\n\t language: result.second_best.language,\n\t re: result.second_best.relevance\n\t };\n\t }\n\t }", "function highlightBlock(block) {\n\t var language = blockLanguage(block);\n\t if (isNotHighlighted(language))\n\t return;\n\n\t var node;\n\t if (options.useBR) {\n\t node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n\t node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n\t } else {\n\t node = block;\n\t }\n\t var text = node.textContent;\n\t var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n\t var originalStream = nodeStream(node);\n\t if (originalStream.length) {\n\t var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n\t resultNode.innerHTML = result.value;\n\t result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n\t }\n\t result.value = fixMarkup(result.value);\n\n\t block.innerHTML = result.value;\n\t block.className = buildClassName(block.className, language, result.language);\n\t block.result = {\n\t language: result.language,\n\t re: result.relevance\n\t };\n\t if (result.second_best) {\n\t block.second_best = {\n\t language: result.second_best.language,\n\t re: result.second_best.relevance\n\t };\n\t }\n\t }", "function highlightBlock(block) {\n\t var language = blockLanguage(block);\n\t if (isNotHighlighted(language))\n\t return;\n\n\t var node;\n\t if (options.useBR) {\n\t node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n\t node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n\t } else {\n\t node = block;\n\t }\n\t var text = node.textContent;\n\t var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n\t var originalStream = nodeStream(node);\n\t if (originalStream.length) {\n\t var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n\t resultNode.innerHTML = result.value;\n\t result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n\t }\n\t result.value = fixMarkup(result.value);\n\n\t block.innerHTML = result.value;\n\t block.className = buildClassName(block.className, language, result.language);\n\t block.result = {\n\t language: result.language,\n\t re: result.relevance\n\t };\n\t if (result.second_best) {\n\t block.second_best = {\n\t language: result.second_best.language,\n\t re: result.second_best.relevance\n\t };\n\t }\n\t }", "function js_highlight() \n{\n for (var i=0; i<bold_Tags.length; i++)\n { \n bold_Tags[i].style.color = \"green\";\n }\n}", "function highlight_load() {\n\tvar frag = location.hash.substring(1);\n\n\tfrag_highlight(frag);\n\trules_aliases_highlight(frag);\n}", "function highlightSelection(e) \n{\n selection = window.getSelection();\n \n //Skip this section if mouse event is undefined\n if (e != undefined)\n {\n \n //Ignore right clicks; avoids odd behavior with CTRL key\n if (e.button == 2)\n {\n return;\n }\n\n //Exit if CTRL key is held while auto highlight is checked on\n if(imedBool && e.ctrlKey)\n {\n return;\n }\n \n //Exit if CTRL key not held and auto highlight is checked off\n if(!imedBool && !e.ctrlKey)\n {\n return;\n }\n }\n \n var selectionTagName;\n //Avoid inputs like the plague..\n try {\n selectionTagName = selection.anchorNode.childNodes[0].tagName.toLowerCase();\n } catch (err) {\n //fail silently :-D\n }\n if (selectionTagName == \"input\") {\n return;\n }\n \n // Clear all highlights if requested\n if (clearBetweenSelections && highlightedPage == true)\n {\n clearHighlightsOnPage();\n }\n \n var selectedText = window.getSelection().toString().replace(/^\\s+|\\s+$/g, \"\");\n var testText = selectedText.toLowerCase();\n \n //Exit if selection is whitespace or what was previously selected\n if (selectedText == '' || lastText == testText)\n {\n return;\n }\n \n if (selection.toString() != '') {\n var mySpan = document.createElement(\"span\");\n var prevSpan = document.getElementById(\"mySelectedSpan\");\n if (prevSpan != null) {\n prevSpan.removeAttribute(\"id\");\n }\n mySpan.id = \"mySelectedSpan\";\n var range = selection.getRangeAt(0).cloneRange();\n mySpan.appendChild(range.extractContents());\n range.insertNode(mySpan);\n }\n \n //Perform highlighting\n localSearchHighlight(selectedText, singleSearch);\n highlightedPage = true;\n \n //Store processed selection for next time this method is called\n lastText = testText;\n if (selection.toString() != '') {\n if (!triggeredOnce) {\n triggeredOnce = !triggeredOnce;\n }\n }\n}", "function highlight(text, style) {\n var page_html = document.getElementById('page').innerHTML;\n var page = document.getElementById('page');\n var draft_html = document.getElementById('draft').innerHTML;\n var draft = document.getElementById('draft');\n text = text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); //https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex\n\n var re = new RegExp(text, 'g');\n var m;\n\n if (text.length > 0) {\n page.innerHTML = page_html.replace(re, `<span style='background-color:${style};'>$&</span>`);\n draft.innerHTML = draft_html.replace(re, `<span style='background-color:${style};'>$&</span>`);\n\n } else {\n page.innerHTML = page_html;\n draft.innerHTML = draft_html;\n }\n }", "function cmtxHighlightCode() {\n if (typeof(hljs) != 'undefined' && typeof(hljs.highlightElement) != 'undefined') {\n jQuery('.cmtx_code_box, .cmtx_php_box').each(function(i, el) {\n hljs.highlightElement(el);\n });\n }\n}", "unhighlightAll() {\n if (!this.tf.highlightKeywords) {\n return;\n }\n\n this.unhighlight(null, this.highlightCssClass);\n }", "function highlightBlock(block) {\n\t var node, originalStream, result, resultNode, text;\n\t var language = blockLanguage(block);\n\n\t if (isNotHighlighted(language))\n\t return;\n\n\t if (options.useBR) {\n\t node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n\t node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n\t } else {\n\t node = block;\n\t }\n\t text = node.textContent;\n\t result = language ? highlight(language, text, true) : highlightAuto(text);\n\n\t originalStream = nodeStream(node);\n\t if (originalStream.length) {\n\t resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n\t resultNode.innerHTML = result.value;\n\t result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n\t }\n\t result.value = fixMarkup(result.value);\n\n\t block.innerHTML = result.value;\n\t block.className = buildClassName(block.className, language, result.language);\n\t block.result = {\n\t language: result.language,\n\t re: result.relevance\n\t };\n\t if (result.second_best) {\n\t block.second_best = {\n\t language: result.second_best.language,\n\t re: result.second_best.relevance\n\t };\n\t }\n\t }", "function highlight_all(locations, classname) {\n \"use strict\";\n var i;\n for (i = 0; i < locations.length; i += 1) {\n // Fix undefined classname (Second condition is for compatibility with findbugs xml)\n if (locations[i].tag === 'class' && locations[i].classname === undefined){\n locations[i].classname = locations[i].name_attr;\n }\n /*Ignore locations without a msg:\n if ((locations[i].msg === undefined) && (i !== 9)){\n continue;\n }*/\n if (locations[i].classname.split('$')[0] === classname.split('$')[0]) {\n $('div[class=\"' + locations[i].line + '\"]',\n window.parent.frames[0].document).css('background-color', '#d8ebf4');\n }\n }\n}", "function highlightPage() \n{\n if (!document.getElementsByTagName) return false;\n if (!document.getElementById) return false;\n \n var headers = document.getElementsByTagName(\"header\");\n if (headers.length == 0) return false;\n \n var navs = headers[0].getElementsByTagName(\"nav\");\t\n if (navs.length == 0) return false;\n \n var links = navs[0].getElementsByTagName(\"a\");\n \n \n var linkurl;\n for (var i=0; i<links.length; i++) \n {\n linkurl = links[i].getAttribute(\"href\");\n //var currenturl = window.location.href;\n //if (currenturl.indexOf(linkurl) != -1)\n // window.location object refers to the various pieces of a URL\n // ... and 'href' refers to the value representing the entire URL\n // .. so if link matches current URL add the class attribute on the fly!\n if ( window.location.href.indexOf(linkurl) != -1 )\n {\n links[i].className = \"here\";\n //links[i].setAttribute(\"class\",\"here\");\t// Of course this also works\n\n // give unique id attribute to <body> element so you can add STYLES specific to page\n // e.g. specify a different background image for header (bootom right) of each individual page\n // ... gosh but space in an attribute will it create problems? such as in id=\"contact us\"?\n // ... jQuery allows it though by using escape characters $('#Contact\\\\ us');\n var linktext = links[i].lastChild.nodeValue.toLowerCase();\n document.getElementsByTagName(\"body\")[0].setAttribute(\"id\",linktext);\n //alert(linktext);\n } \n }\n \n}", "function highlightBlock(block) {\n var language = blockLanguage(block);\n if (isNotHighlighted(language))\n return;\n\n var node;\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n var text = node.textContent;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n var originalStream = nodeStream(node);\n if (originalStream.length) {\n var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var language = blockLanguage(block);\n if (isNotHighlighted(language))\n return;\n\n var node;\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n var text = node.textContent;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n var originalStream = nodeStream(node);\n if (originalStream.length) {\n var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlight_words() {\n\n // YOUR CODE GOES HERE\n}", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightSelected()\n\t{\n\t\t// selected pileups (mutations) on the diagram\n\t\tvar selected = getSelectedPileups();\n\n\t\t// highlight residues\n\t\thighlight3dResidues(selected);\n\t}", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (isNotHighlighted(language))\n return;\n\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream(node);\n if (originalStream.length) {\n resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }", "function changeHighlight() {\n // Get the relative URL of the page eg: '/about.html'\n const location = window.location.pathname+window.location.search;\n \n if (/index?(.html)/.test(location)) {\n return;\n } else if (/over_mij(.html)?/.test(location)) {\n document.getElementById('about-header-link').classList.add('current-page');\n } else if (/projecten(.html)?/.test(location)) {\n document.getElementById('coops-header-link').classList.add('current-page');\n } else if (/sales(.html)?/.test(location)) {\n document.getElementById('sales-header-link').classList.add('current-page');\n } else if (/extra(.html)?/.test(location)) {\n document.getElementById('extras-header-link').classList.add('current-page');\n }\n}", "function getHighlights(url) {\n $.get(baseUrl + \"/tags/highlights\", {\n \"url\": url,\n }).done(function(res) {\n if (res.success) {\n for (var h in res.highlights) {\n var hl = decodeURIComponent(h);\n var hl_id = res.highlights[h].id;\n\n var max_tag = res.highlights[h].max_tag;\n var is_owner = res.highlights[h].is_owner;\n var entire_highlight_present = true;\n var html = $.parseHTML(hl);\n\n var all_eligible = $.merge($(\"p\"), $(\"div\"));\n var last = null;\n\n if ($(\"body\").html().indexOf(hl) === -1) {\n all_eligible.filter(function () {\n if (/&nbsp;/gi.test($(this).html())) {\n if ($(this).html().replace(/&nbsp;/gi,'').indexOf(hl) > -1) {\n if (last === null || $(this).children().length < last.children().length) {\n last = $(this);\n }\n }\n }\n });\n last.html(last.html().replace(hl, \"<div class='highlight-annote' highlight='\" + hl_id + \"'>\"+hl+\"</div>\")); \n } else {\n var base = $('p:contains(\"' + html[0].textContent + '\"):last');\n base.html(base.html().replace(hl, \"<div class='highlight-annote' highlight='\" + hl_id + \"'>\"+hl+\"</div>\"));\n }\n\n $(\".highlight-annote[highlight='\"+hl_id+\"']\").css({\n \"background-color\": muteColor(max_tag[1]),\n \"display\": \"inline\",\n });\n $(\".highlight-annote[highlight='\"+hl_id+\"']\").attr(\"color\", muteColor(max_tag[1]));\n\n highlight_colors[hl_id] = muteColor(max_tag[1]);\n\n $(\".highlight-annote\").attr(\"is_owner\", is_owner);\n }\n } \n });\n}", "clearHighlight() {\n\n //TODO - your code goes here -\n }", "function highlightAll(state) {\n chrome.tabs.query({}, function(tabs) {\n for (let i = 0; i < tabs.length; ++i) {\n const tab = tabs[i];\n if (tab.url === undefined || isOptionsPage(tab.url))\n continue;\n highlight(tab.id, false, state, 'document_end');\n }\n });\n}", "function onclick_highlight() {\n\tif (document.getElementsByTagName) {\n\t\tvar alinks = document.getElementById('rules').getElementsByTagName('a');\n\t\tfor (var i = 0; i < alinks.length; i++) {\n\t\t\tif (alinks[i].getAttribute('href') !== null && alinks[i].getAttribute('href').indexOf('#') >= 0) {\n\t\t\t\tvar fragment = alinks[i].getAttribute('href').substring(alinks[i].getAttribute('href').indexOf('#') + 1);\n\t\t\t\tvar e_onclick_function = \"frag_highlight('\" + fragment + \"')\";\n\t\t\t\tvar new_function = new Function('e', e_onclick_function);\n\t\t\t\talinks[i].onclick = new_function;\n\t\t\t}\n\t\t}\n\t}\n}", "function loadPage(page, target){\n $(target).load(page, function(){\n $('pre code').each(function(i, block) { \n hljs.highlightBlock(block);\n });\n });\n}", "function SearchDoc_RemoveAllHighlights() {\n SearchDoc_SearchResultCount = 0;\n SearchDoc_RemoveAllHighlightsForElement(document.body);\n}", "function disable_highlighting() {\n $(\".highlight-annote\").each(function() {\n var old_bg = $(this).css(\"backgroundColor\");\n $(this).attr({\n \"old-background-color\": old_bg,\n }).css({\n \"background-color\": \"#fff\",\n });\n });\n}", "function setHighlight(indices, mode) {\n var testDiv = $('<ol class=\"' + this.element[0].className + \n '\" style=\"position:absolute;left:-10000px\">' + \n '<li class=\"jsavnode jsavindex jsavhighlight\"></li><li class=\"jsavnode jsavindex\" ></li></li></ol>'),\n \t styleDiv = (mode && mode === \"add\" ? testDiv.find(\".jsavnode\").filter(\".jsavhighlight\"):testDiv.find(\".jsavnode\").not(\".jsavhighlight\"));\n \t// TODO: general way to get styles for the whole av system\n \t$(\"body\").append(testDiv);\n this.css(indices, {color: styleDiv.css(\"color\"), \"background-color\": styleDiv.css(\"background-color\")});\n testDiv.remove();\n }", "function highlightBlock(block, tabReplace, useBR) {\n var text = blockText(block, useBR);\n var language = blockLanguage(block);\n var result, pre;\n if (language == 'no-highlight')\n return;\n if (language) {\n result = highlight(language, text);\n } else {\n result = highlightAuto(text);\n language = result.language;\n }\n var original = nodeStream(block);\n if (original.length) {\n pre = document.createElement('pre');\n pre.innerHTML = result.value;\n result.value = mergeStreams(original, nodeStream(pre), text);\n }\n result.value = fixMarkup(result.value, tabReplace, useBR);\n\n var class_name = block.className;\n if (!class_name.match('(\\\\s|^)(language-)?' + language + '(\\\\s|$)')) {\n class_name = class_name ? (class_name + ' ' + language) : language;\n }\n if (is_old_IE && block.tagName == 'CODE' && block.parentNode.tagName == 'PRE') {\n // This is for backwards compatibility only. IE needs this strange\n // hack becasue it cannot just cleanly replace <code> block contents.\n pre = block.parentNode;\n var container = document.createElement('div');\n container.innerHTML = '<pre><code>' + result.value + '</code></pre>';\n block = container.firstChild.firstChild;\n container.firstChild.className = pre.className;\n pre.parentNode.replaceChild(container.firstChild, pre);\n } else {\n block.innerHTML = result.value;\n }\n block.className = class_name;\n block.result = {\n language: language,\n kw: result.keyword_count,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n kw: result.second_best.keyword_count,\n re: result.second_best.relevance\n };\n }\n }", "function localSearchHighlight(searchStr, singleWordSearch, doc) \n{\n var MAX_WORDS = 50; //limit for words to search, if unlimited, browser may crash\n doc = typeof(doc) != 'undefined' ? doc : document;\n \n if (!doc.createElement) \n {\n return;\n }\n \n // Trim leading and trailing spaces after unescaping\n searchstr = unescape(searchStr).replace(/^\\s+|\\s+$/g, \"\");\n \n if( searchStr == '' ) \n {\n return;\n }\n \n //majgis: Single search option\n if(singleWordSearch)\n {\n phrases = searchStr.replace(/\\+/g,' ').split(/\\\"/);\n }\n else\n {\n phrases = [\"\",searchStr];\n }\n \n var hinodes = [];\n colorgen = colorGenerator(singleWordSearch || !clearBetweenSelections);\n \n for(p=0; p < phrases.length; p++) \n {\n phrases[p] = unescape(phrases[p]).replace(/^\\s+|\\s+$/g, \"\");\n \n if( phrases[p] == '' ) \n {\n continue;\n }\n \n if( p % 2 == 0 ) \n {\n words = phrases[p].replace(/([+,()]|%(29|28)|\\W+(AND|OR)\\W+)/g,' ').split(/\\s+/);\n }\n else \n { \n words=Array(1); \n words[0] = phrases[p]; \n }\n \n //limit length to prevent crashing browser\n if (words.length > MAX_WORDS)\n {\n words.splice(MAX_WORDS - 1, phrases.length - MAX_WORDS);\n }\n \n for (w=0; w < words.length; w++) \n {\n if( words[w] == '' ) \n {\n continue;\n }\n \n hinodes = highlightWord(doc.getElementsByTagName(\"body\")[0], words[w], doc);\n }\n }\n \n selection.removeAllRanges();\n var oldSelection = document.getElementById(\"mySelectedSpan\");\n var reselectRange = document.createRange();\n reselectRange.selectNode(oldSelection);\n selection.addRange(reselectRange);\n}", "addHighlightListeners () {\n }", "clearHighlights() {\n\t\tvar t = this;\n\t\tvar len = t.getLength();\n\t\tfor (var x = 0; x < len; x++) {\n\t\t\tt.getRow(x).classList.remove(\"highlight\");\n\t\t}\n\t}", "highlightFirst_() {\n this.highlightHelper_(-1, 1);\n }", "function highlightBlock(block) {\n var node, originalStream, result, resultNode, text;\n var language = blockLanguage(block);\n\n if (shouldNotHighlight(language))\n return;\n\n fire(\"before:highlightBlock\",\n { block: block, language: language});\n\n if (options.useBR) {\n node = document.createElement('div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(/<br[ \\/]*>/g, '\\n');\n } else {\n node = block;\n }\n text = node.textContent;\n result = language ? highlight(language, text, true) : highlightAuto(text);\n\n originalStream = nodeStream$1(node);\n if (originalStream.length) {\n resultNode = document.createElement('div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams$1(originalStream, nodeStream$1(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n fire(\"after:highlightBlock\", { block: block, result: result});\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }" ]
[ "0.6965865", "0.6965865", "0.6965865", "0.6965865", "0.6965865", "0.6965865", "0.6965865", "0.6965865", "0.6949577", "0.69325364", "0.69270915", "0.69270915", "0.69270915", "0.69270915", "0.68909764", "0.6874987", "0.68587834", "0.66729665", "0.66303533", "0.6340288", "0.61775655", "0.6084966", "0.60738605", "0.60574085", "0.5998788", "0.5885266", "0.58554506", "0.58276206", "0.5825991", "0.5785472", "0.57737243", "0.57705706", "0.5767553", "0.57649815", "0.57480687", "0.5736287", "0.5736287", "0.57194227", "0.57194227", "0.56628436", "0.5656563", "0.56316423", "0.56316423", "0.56316423", "0.56316423", "0.5628761", "0.5619849", "0.5597099", "0.55869657", "0.5580557", "0.5578906", "0.55786973", "0.55649805", "0.5556575", "0.55518734", "0.55518734", "0.55457145", "0.5522469", "0.5511926", "0.54987955", "0.54987955", "0.54987955", "0.54987955", "0.54987955", "0.54987955", "0.54987955", "0.54987955", "0.54987955", "0.54987955", "0.54987955", "0.54987955", "0.54987955", "0.5496623", "0.5493877", "0.54787713", "0.54786956", "0.5478523", "0.5474845", "0.54732424", "0.54676235", "0.5429724", "0.5422623", "0.5419005", "0.5416304", "0.53981906", "0.5396287", "0.5378298" ]
0.69217765
24
Attaches highlighting to the page load event.
function initHighlightingOnLoad() { addEventListener('DOMContentLoaded', initHighlighting, false); addEventListener('load', initHighlighting, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initHighlightingOnLoad() {\n window.addEventListener('DOMContentLoaded', initHighlighting, false);\n window.addEventListener('load', initHighlighting, false);\n }", "function initHighlightingOnLoad() {\n addEventListener('DOMContentLoaded', initHighlighting, false);\n addEventListener('load', initHighlighting, false);\n }", "function initHighlightingOnLoad() {\n addEventListener('DOMContentLoaded', initHighlighting, false);\n addEventListener('load', initHighlighting, false);\n }", "function initHighlightingOnLoad() {\n\t addEventListener('DOMContentLoaded', initHighlighting, false);\n\t addEventListener('load', initHighlighting, false);\n\t }", "function initHighlightingOnLoad() {\n\t addEventListener('DOMContentLoaded', initHighlighting, false);\n\t addEventListener('load', initHighlighting, false);\n\t }", "function initHighlightingOnLoad() {\n\t addEventListener('DOMContentLoaded', initHighlighting, false);\n\t addEventListener('load', initHighlighting, false);\n\t }", "function initHighlightingOnLoad() {\n\t addEventListener('DOMContentLoaded', initHighlighting, false);\n\t addEventListener('load', initHighlighting, false);\n\t }", "function initHighlightingOnLoad() {\n\t addEventListener('DOMContentLoaded', initHighlighting, false);\n\t addEventListener('load', initHighlighting, false);\n\t }", "function initHighlightingOnLoad() {\n window.addEventListener('DOMContentLoaded', initHighlighting, false);\n }", "function initHighlightingOnLoad() {\n if (window.addEventListener) {\n window.addEventListener('DOMContentLoaded', initHighlighting, false);\n window.addEventListener('load', initHighlighting, false);\n } else if (window.attachEvent)\n window.attachEvent('onload', initHighlighting);\n else\n window.onload = initHighlighting;\n }", "function initHighlightingOnLoad() {\n // @ts-ignore\n window.addEventListener(\"DOMContentLoaded\", initHighlighting, false);\n }", "function initHighlightingOnLoad() {\n // @ts-ignore\n window.addEventListener('DOMContentLoaded', initHighlighting, false);\n }", "function initHighlightingOnLoad() {\n // @ts-ignore\n window.addEventListener('DOMContentLoaded', initHighlighting, false);\n }", "function initHighlightingOnLoad() {\n // @ts-ignore\n window.addEventListener('DOMContentLoaded', initHighlighting, false);\n }", "function initHighlightingOnLoad() {\n // @ts-ignore\n window.addEventListener('DOMContentLoaded', initHighlighting, false);\n }", "function highlight_load() {\n\tvar frag = location.hash.substring(1);\n\n\tfrag_highlight(frag);\n\trules_aliases_highlight(frag);\n}", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t ArrayProto.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "function initHighlighting() {\n if (initHighlighting.called) return;\n initHighlighting.called = true;\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "function initMouseHighlighter() {\n bodyEl.addEventListener(\"mousemove\", mouseHighlighter);\n }", "_processInitialHighlighting() {\n var highlightedCategories = this.getOptions()['highlightedCategories'];\n if (highlightedCategories && highlightedCategories.length > 0)\n this.highlight(highlightedCategories);\n }", "function _setupHighlightButton() {\n // TODO: this should be moved into index.html like the Go Live button once it's re-enabled\n _$btnHighlight = $(\"<a href=\\\"#\\\">Highlight </a>\");\n $(\".nav\").append($(\"<li>\").append(_$btnHighlight));\n _$btnHighlight.click(function onClick() {\n config.highlight = !config.highlight;\n if (config.highlight) {\n _setLabel(_$btnHighlight, _checkMark, \"success\");\n } else {\n _setLabel(_$btnHighlight);\n LiveDevelopment.hideHighlight();\n }\n });\n if (config.highlight) {\n _setLabel(_$btnHighlight, _checkMark, \"success\");\n }\n }", "function onPageLoad() {\r\n\t// although jQuery already has an on page load, \r\n\t// this function was added for sake of organization.\r\n\tvar trigger = \"load\";\r\n}", "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n var pres = document.getElementsByTagName('pre');\n for (var i = 0; i < pres.length; i++) {\n var code = findCode(pres[i]);\n if (code)\n highlightBlock(code, hljs.tabReplace);\n }\n }", "function pageLoadHook() {\n $('body').removeClass('stranger');\n bindTouchFeedback('main a');\n loadHook();\n}", "function page_loaded() {\n post_load_setup();\n}", "function SetHighlight ()\n\t{\n\t\tif( showHighlight == true )\n\t\t{\n\t\t\t// Enable images if they are off\n\t\t\tif( highlightBase != null && highlightBase.gameObject.activeInHierarchy == false )\n\t\t\t\thighlightBase.gameObject.SetActive( true );\n\t\t\tif( highlightJoystick != null && highlightJoystick.gameObject.activeInHierarchy == false )\n\t\t\t\thighlightJoystick.gameObject.SetActive( true );\n\n\t\t\t// Here we need to check if each variable is assigned so we don't get a null reference log error when applying color\n\t\t\tif( highlightBase != null )\n\t\t\t\thighlightBase.color = highlightColor;\n\t\t\tif( highlightJoystick != null )\n\t\t\t\thighlightJoystick.color = highlightColor;\n\n\t\t\t// If we are using fade, then we want to modify our highlight's color\n\t\t\tif( useFade == true )\n\t\t\t\tHandleFade( \"Untouched\" );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Here we want to check if we have any highlights, and if so, SetActive( false )\n\t\t\tif( highlightBase != null && highlightBase.gameObject.activeInHierarchy == true )\n\t\t\t\thighlightBase.gameObject.SetActive( false );\n\t\t\tif( highlightJoystick != null && highlightJoystick.gameObject.activeInHierarchy == true )\n\t\t\t\thighlightJoystick.gameObject.SetActive( false );\n\t\t}\n\t}", "onIndicateLoadStart () {\n document.documentElement.style.transition = 'opacity linear 0.05s'\n document.documentElement.style.opacity = '0.8'\n }", "addHighlightListeners () {\n }", "function initOnLoadCompleted(e) {\n //add handler to event that receive message from popup page.\n browser.runtime.onMessage.addListener((message) => {\n switch (message.command) {\n case 'search'://'search' button clicked.\n Highlight(message.target);\n IsHighlight = true;\n break;\n case 'clear'://'clear' button clicked.\n Highlight(\"\");\n IsHighlight = false;\n break;\n case 'toggle'://'Ctrl+Alt+L'Shortcut\n if (IsHighlight) {\n Highlight(\"\");\n IsHighlight = false;\n }\n else {\n Highlight(message.target);\n IsHighlight = true;\n }\n break;\n }\n });\n}", "function initializePage() {\r\n colorList();\r\n }", "function pageReady() {\n legacySupport();\n initSliders();\n }", "onHighlight() {\n if (this.isHighlightEditRegion) {\n this.highlightEditRegion();\n }\n else {\n this.unHighlightEditRegion();\n }\n this.viewer.renderVisiblePages();\n }", "function pageReady() {\n legacySupport();\n\n updateHeaderActiveClass();\n initHeaderScroll();\n\n setLogDefaultState();\n setStepsClasses();\n _window.on('resize', debounce(setStepsClasses, 200))\n\n initMasks();\n initValidations();\n initSelectric();\n initDatepicker();\n\n _window.on('resize', debounce(setBreakpoint, 200))\n }", "function addOnloadHook(f) {\n addLoadEvent(f);\n}", "function addOnloadHook(f) {\n addLoadEvent(f);\n}", "onPageLoaded() {\n window.clearTimeout(this.animationTimeout_);\n window.clearTimeout(this.loadingTimeout_);\n this.setUIStep(AssistantLoadingUIState.LOADED);\n }", "function __INITIALIZE(self){\n self._view.css({\n backgroundColor: '#EEE'\n });\n }", "function init() {\n\t\t$(document).on('pageBeforeInit', function (e) {\n\t\t\tvar page = e.detail.page;\n\t\t\tload(page.name, page.query);\n\t\t});\n }", "highlight(on) { }", "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "function handleBodyLoad() {\n document.body.classList.add('loaded');\n}", "function onPageLoad() { \n drawRegions();\n}", "function initHighlightJs() {\n\tapexJsSelectors.forEach((selector) => {\n\t\tdocument.querySelectorAll(selector).forEach(block => {\n\t\t\tblock.classList.add(\"language-apex\");\n\t\t});\n\t});\n\t// Alow language auto-detection in \"pre code\" blocks\n\tapexJsSelectors.push(\"pre code\");\n\t// initialize highlighting for code examples and\n\t// signatures for methods, classes, props and enums\n\t// Highlight.js now contains multiple languages to aid in\n\t// code highlighting for the HTML pages in documentation\n\t// Bash, CSS, JSON, YAML, Markdown, HTML/Visualforce, JavaScript, Plain Text)\n\thljs.configure({\n\t\tcssSelector: apexJsSelectors\n\t});\n\thljs.highlightAll();\n}", "function onloadHandler(){\n console.info(\"Nick Cage is ready!\");\n // where the magic happens\n replaceAllElements();\n }", "function handlePageLoad() {\n // Add a listener to be triggered when we scroll through the pages\n window.addEventListener('hashchange', function() {\n debug('Hash change detected: ' + location.hash + ' State: ' + document.readyState);\n processUserList();\n }, false);\n\n queryUserId();\n queryReviveSkill();\n }", "function init() {\n\t\tlet selector = $('#theme-selector');\n\t\tselector.on(\"change\", selectionChangeHandler);\n\t}", "function initLineReference()\r\n{\r\n\tif ($('section#show').length != 0)\r\n\t{\r\n\t\tvar line = 1;\r\n\r\n\t\t// First, we allocate unique IDs to all lines\r\n\t\t$('.pre li').each(function()\r\n\t\t{\r\n\t\t\t$(this).attr('id', 'line-' + line++);\r\n\t\t});\r\n\r\n\t\t// Next, navigate to an ID if the user requested it\r\n\t\tvar anchor = window.location.hash;\r\n\r\n\t\tif (anchor.length > 0)\r\n\t\t{\r\n\t\t\tvar top = $(anchor).offset().top;\r\n\r\n\t\t\t// Scroll to the anchor\r\n\t\t\t$.scrollTo(top, 200);\r\n\r\n\t\t\t// Highlight the anchor\r\n\t\t\t$(anchor).addClass('highlight');\r\n\t\t}\r\n\r\n\t\t// Click to change anchor\r\n\t\t$('.pre li').off('mouseup').on('mouseup', function()\r\n\t\t{\r\n\t\t\tif (window.getSelection() == '')\r\n\t\t\t{\r\n\t\t\t\tvar id = $(this).attr('id');\r\n\t\t\t\tvar top = $(this).offset().top;\r\n\r\n\t\t\t\t// Scroll to the anchor\r\n\t\t\t\t$.scrollTo(top, 200, function() {\r\n\t\t\t\t\twindow.location.hash = '#' + id;\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// Highlight the anchor\r\n\t\t\t\t$('.pre li').removeClass('highlight');\r\n\t\t\t\t$(this).addClass('highlight');\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "function pageLoad() {\n setControlValues();\n processHashInstruction();\n\n if (Common.isIE) Common.fixToMaxItemWidth('settings-header', 16, false);\n\n document.getElementById('theme').addEventListener('change', themeSelectChange);\n document.getElementById('defaults').addEventListener('click', defaultsClick);\n document.getElementById('save').addEventListener('click', saveClick);\n document.getElementById('cancel').addEventListener('click', cancelClick);\n\n document.getElementById('offline').style\n .display = (navigator.onLine ? 'none' : 'block');\n window.addEventListener('offline', appOffline);\n window.addEventListener('online', appOnline);\n}", "windowOnLoadOverride() {\n window.onload = function () {\n document.getElementById(\"home-icon\").style.color = \"coral\";\n }\n }", "function init()\n {\n $(document).on(\"loaded:everything\", runAll);\n }", "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headAssemblyLi\").addClass(\"active\");\r\n\t\t$(\"#leftCarQueryLi\").addClass(\"active\");\r\n\t\tgetSeries();\r\n\t\tfillLineSelect();\r\n\t\t$(\"#carTag\").hide();\r\n\t\t$(\"#resultTable\").hide();\r\n\t\t$(\"#tabTestLine\").hide();\r\n\t}", "function loaded() {\n\taddElements();\n\tosScroll();\n\t// initiate tabs\n\t$('#tabs').tab();\n\t// set event listeners\n\tsetOneTimeEventListeners();\n\t//updateChecked();\n}" ]
[ "0.80268514", "0.7993287", "0.7993287", "0.7922299", "0.7922299", "0.7922299", "0.7922299", "0.7922299", "0.778201", "0.7738398", "0.74058837", "0.73645383", "0.73645383", "0.73645383", "0.73645383", "0.70029616", "0.6562669", "0.65551406", "0.65435123", "0.65405047", "0.65405047", "0.65405047", "0.65405047", "0.653188", "0.653188", "0.653188", "0.653188", "0.653188", "0.653188", "0.653188", "0.653188", "0.653188", "0.653188", "0.653188", "0.653188", "0.653188", "0.653188", "0.65058994", "0.65058994", "0.65058994", "0.65058994", "0.65058994", "0.65058994", "0.65058994", "0.65058994", "0.6467893", "0.6457235", "0.6335193", "0.60653096", "0.6025946", "0.60232097", "0.60209006", "0.5945857", "0.59141576", "0.58335805", "0.581108", "0.5776776", "0.57262653", "0.57015103", "0.5669561", "0.56502104", "0.56118554", "0.56118554", "0.5602546", "0.55665445", "0.55529", "0.5534843", "0.55234945", "0.5500885", "0.5485483", "0.54771173", "0.5459018", "0.5455193", "0.54291713", "0.5418179", "0.5412492", "0.54050964", "0.53888965", "0.5382832", "0.5381757" ]
0.7933503
23
Initialize the UI components.
function initUI() { showDataIsLoaded(); showExplorePage(); bindSearchHandler(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init(){\n buildComponent();\n attachHandlers();\n addComponents();\n }", "function init() {\n // courses\n lastCheckedCourse = -1;\n isActive = false;\n\n // connect ui elements with event handlers\n bindUIActions();\n }", "function init() {\n\n initFloorsMapping(Config.BUILDINGS);\n createElevators(Config.BUILDINGS);\n\n AppUI.init();\n attachEvents(Config.BUILDINGS);\n }", "initialize() {\n this._initializeButtons();\n this._initializeLock();\n this._initializeWindowsTransparency();\n this.settings.initialize();\n\n this.updateWindowHeight();\n }", "function init() {\n\tformReset();\n\tsetupFloatLabels();\n\tsetupClickHandlers();\n}", "init() {\n // call the base component's init function\n UIComponent.prototype.init.apply(this, arguments)\n }", "function init() {\n cashElements();\n attachEvents();\n render();\n }", "function uiInit() {\r\n\tuiRegisterSetting('settings.style.hide_author');\r\n\tuiRegisterSetting('settings.style.hide_desc');\r\n\tuiRegisterSetting('settings.style.hide_time_created');\r\n\tuiRegisterSetting('settings.style.hide_views');\r\n\tuiRegisterSetting('settings.style.hide_flags');\r\n\tuiRegisterSetting('settings.style.disable_motw');\r\n\tuiRegisterSetting('settings.style.skin');\r\n\t\r\n\tuiPopulateDropdown(settingsElements['settings.style.skin'], ENUM_SKINS, settings.style.skin);\r\n\t\r\n\tuiRegisterCodeboxes();\r\n\tuiRegisterCheckboxes();\r\n}", "function initControls() {\n // set up textarea autosize\n $('textarea').autosize();\n // set up tooltips\n $('[data-toggle=\"tooltip\"]').tooltip();\n // set up checkbox/radiobox styles\n $(\"input:checkbox, input:radio\").uniform();\n $('.datatable').dataTable({});\n\n // set up select2\n $('.select2').select2();\n\n // Pie charts\n if ($('.pie-chart').length){\n $('.pie-chart').easyPieChart({\n barColor: \"#428bca\",\n lineWidth: 4,\n animate: 1000,\n onStart: function () {\n if (this.options.isInit) {\n return;\n }\n this.options.isInit = true;\n var color = $(this.el).data('barColor');\n if (color) {\n this.options.barColor = color;\n }\n },\n onStep: function (oldVal, newVal, crtVal) {\n $(this.el).find('span').text(Math.floor(crtVal) + '%');\n }\n });\n }\n }", "setupComponents() {\n\t\tthis.contactBar = new ContactBar();\n\t\tthis.contactBar.setup();\n\n\t\tthis.modal = new Modal();\n\t\tthis.modal.setup();\n\n\t\tthis.accordion = new Accordion();\n\t\tthis.accordion.setup();\n\n\t\tthis.mediaGallery = new MediaGallery();\n\t\tthis.mediaGallery.setup();\n\t}", "function init () {\n Accordion.initAll()\n Alert.initAll()\n Disclosure.initAll()\n Dropdown.initAll()\n FileInput.initAll()\n Dialog.initAll()\n Sidenav.initAll()\n Switch.initAll()\n Tabs.initAll()\n}", "function init() {\n\t\tbuildBar();\n\t\tbuildBubble();\n\t\tbuildGauge();\n\t\t//buildMeta();\n\t}", "init() {\n // call the base component's init function\n UIComponent.prototype.init.apply(this, arguments)\n\n // set the device model\n this.setModel(models.createDeviceModel(), 'device')\n\n // set the todo model\n this.setModel(models.createTodoModel(), 'todo')\n\n // create the views based on the url/hash\n this.getRouter().initialize()\n }", "function setupUI() {\n //Form controls\n createElement(\"frm\", \"US Census layer controls:\");\n createP(); // spacer\n uiBoss.radio = createRadio();\n\n uiBoss.radio.option(\"sex\", \"Sex\");\n uiBoss.radio.option(\"race\", \"Race / Ethnicity\");\n uiBoss.radio.option(\"incRace\", \"Median Income by Race\");\n\n uiBoss.radio.changed(updateViz);\n\n createP(); // spacer\n uiBoss.checkbox1 = createCheckbox(\"Show state name\");\n uiBoss.checkbox1.changed(updateViz);\n\n createP(); // spacer\n uiBoss.checkbox2 = createCheckbox(\"Show median housing value\");\n uiBoss.checkbox2.changed(updateViz);\n}", "function init() {\r\n initBars();\r\n bindResizeEvents();\r\n bindMouseMove();\r\n }", "function init(){\n buildComponent();\n attachHandlers();\n addComponents();\n doSomethingAfterRendering(); // 렌더 이후 처리함수 (예 - 서버접속)\n }", "function initComponents() {\n\n //calls the drop down menu option\n dropDownComponents();\n\n // builds the initial table.\n getThatTable(ufoData);\n}", "function initUi() {\n // Set player values\n timeInp.value = millisecondsToIso(0);\n timeLeftInp.value = millisecondsToIso(duration);\n progressInp.max = duration;\n urlbar.value = site.url;\n\n updateOptions(false);\n addProgressBackground();\n}", "function init() {\n\n\t\t// Bind the editor elements to variables\n\t\tbindElements();\n\n\t\t// Create event listeners for keyup, mouseup, etc.\n\t\tcreateEventBindings();\n\t}", "function initializeUI()\r\n{\r\n var elts;\r\n\r\n _RecordsetName.initializeUI();\r\n _MasterPageFields.initializeUI();\r\n _LinkField.initializeUI();\r\n _UniqueKeyField.initializeUI();\r\n _NumRecs.initializeUI();\r\n _DetailPageName.initializeUI();\r\n _DetailPageFields.initializeUI();\r\n _Numeric.initializeUI();\r\n\r\n elts = document.forms[0].elements;\r\n if (elts && elts.length)\r\n elts[0].focus();\r\n}", "function initialize(){\n\n\t\t//sets all needed components, listeners, etc\n\t\tformatBodyPages();\n\t\tsetBodyTransitions();\n\n\t}", "initialize() {\n this.display = 0;\n this.initButtons();\n this.initClipBoard();\n this.pasteFromClipBoard();\n this.initDblClick();\n }", "function init() {\n\t// Constants\n\tslotCount = 6\n\tcodeComplexity = 6\n\tcodeLength = 4\n\taugmentedContrast = false\n\n\tCONTROLS.init()\n}", "function init() {\r\n // Set up the items that are needed for the controller to run\r\n }", "init() {\n if (this.initialised) {\n return;\n }\n\n // Set initialise flag\n this.initialised = true;\n // Create required elements\n this._createTemplates();\n // Generate input markup\n this._createInput();\n // Subscribe store to render method\n this.store.subscribe(this.render);\n // Render any items\n this.render();\n // Trigger event listeners\n this._addEventListeners();\n\n const callback = this.config.callbackOnInit;\n // Run callback if it is a function\n if (callback && isType('Function', callback)) {\n callback.call(this);\n }\n }", "init()\n {\n //Logic that will detemrine which ui to initialize\n if(this.mainUIBodyID!=null)\n {\n this.mainUInit();\n } \n else if(this.secondUIBodyID!=null)\n {\n this.secondUIInt();\n }\n \n }", "init() {\n // call the base component's init function\n UIComponent.prototype.init.apply(this, arguments)\n\n // set the device model\n this.setModel(models.createDeviceModel(), 'device')\n\n\n this.attachProgress();\n\n let currentUserModel = new JSONModel();\n this.setModel(currentUserModel, \"currentUser\");\n\n\n // create the views based on the url/hash\n this.getRouter().initialize()\n }", "function init() {\n\t\tinitEvents();\n\t}", "function jUIInit() {\r\n if (!Lazy.load(_fdk.load.ui, jUIInit)) return;\r\n datePickerInit();\r\n ckedInit();\r\n fajaxInit();\r\n fconfirmInit();\r\n gooMapiInit();\r\n fuupInit();\r\n slimboxInit();\r\n GaleryEdit.init();\r\n $(\".expand\").autogrow();\r\n}", "function init() {\n autoScroll();\n countDown();\n fetchWeather();\n fetchDestinations();\n formValidation();\n }", "function init() {\n\t\n initMap();\n initUI();\n}", "async init() {\n // setup the csvLoader button\n this.csvLoader()\n this.mkradio(\"axial\")\n this.mkradio(\"sagittal\")\n this.mkradio(\"coronal\")\n // setup the radio buttons\n // selected is the radio button we have selected\n /** The view that has been selected to view the slices of the brain from. Stored on pane for export and import of sessions.\n * @alias brainView\n * @memberof Pane\n * @instance\n */\n this.paneOb.brainView = \"sagittal\" // default\n this.paneOb.paneDiv.querySelector(\"#radiosagittal\").checked = true\n\n // create the brain slice slider\n this.createSlider()\n\n // set defaults\n // ensure that the slider only permits sagittal slice count\n this.paneOb.paneDiv.querySelector(\"#radiosagittal\").click()\n\n }", "init() {\n this.render();\n }", "init() {\n this.render();\n }", "function init() {\n setupBasicUi();\n setupBasicEventHandling();\n quiz = new Quiz();\n }", "_initWidget() {\n for (const id of this.compareList.keys()) {\n this._checkCheckbox(id);\n\n this._populateWidget(id);\n\n this._updateWidgetState();\n }\n }", "initialize() {\n this.render();\n }", "function init(e) {\r\n\r\n\tbackgroundPane = dojo.widget.byId(\"backgroundPane\");\r\n\tfontPane = dojo.widget.byId(\"fontPane\");\r\n\tcolorPane = dojo.widget.byId(\"colorPane\");\r\n\timagePane = dojo.widget.byId(\"imagePane\");\r\n\tuploadPane = dojo.widget.byId(\"uploadPane\");\r\n\tdeletePane = dojo.widget.byId(\"deletePane\");\r\n\tyahooLinksPane = dojo.widget.byId(\"yahooLinksPane\");\r\n\ttabContainerSearchUi = dojo.widget.byId(\"tabContainerSearchUi\");\r\n\tssbcpPane = dojo.widget.byId(\"ssbcpPane\");\r\n\t\r\n\tdojo.event.kwConnect({srcObj:colorPicker, srcFunc:\"onColorSelect\", targetObj:this, \r\n\t\t\ttargetFunc:\"updateColorAndClose\", once:true});\r\n\t\r\n\t// Sidebar needs to be drawn after the rest of the Graphics are initiated to\r\n\t// prevent Firefox from drawing it incorrectly...\r\n\tdocument.getElementById(\"side-bar\").style.display = \"block\";\r\n\t\r\n\tverifyCheckboxes();\r\n}", "init() {\n\n this.assignPlayer();\n gameView.init(this);\n gameView.hide();\n scoreBoardView.init(this);\n registerView.init(this);\n this.registerSW();\n }", "function init() {\n\t\t\tif (!container) return;\n\t\t\trequestImages();\n\t\t\tbuildLayout();\n\t\t}", "function init() {\n setDomEvents();\n }", "function init() {\n setMortalitySlider()\n setIncidentsSlider()\n setDeathPercentageSlider()\n setYearSlider()\n}", "function init() {\n initVariable();\n initDatePicker();\n }", "function init() {\n\n updateDisplay(locations_0);\n\n healthBox();\n\n mapVisibility();\n\n disableButton();\n\n }", "function init () {\n ctrl.selectedIndex = ctrl.selectedIndex || 0;\n compileTemplate();\n configureWatchers();\n bindEvents();\n $mdTheming($element);\n $mdUtil.nextTick(function () {\n // Note that the element references need to be updated, because certain \"browsers\"\n // (IE/Edge) lose them and start throwing \"Invalid calling object\" errors, when we\n // compile the element contents down in `compileElement`.\n elements = getElements();\n updateHeightFromContent();\n adjustOffset();\n updateInkBarStyles();\n ctrl.tabs[ ctrl.selectedIndex ] && ctrl.tabs[ ctrl.selectedIndex ].scope.select();\n loaded = true;\n updatePagination();\n });\n }", "function initializeUI() {\n\n LOCOBJ\t= findObject(\"location\");\n URIOBJ\t= findObject(\"uri\");\n PREFIXOBJ = findObject(\"prefix\");\n\n LOCOBJ.focus();\n LOCOBJ.select();\n}", "function init() {\n initializeVariables();\n initializeHtmlElements();\n}", "Init()\n {\n this.my_state_machine = new StateMachine();\n this.overlay_manager_inst = new OverlayManager();\n this.level_viewer = null;\n this.information_log = document.getElementById(\"informationLog\");\n this.level_object_manager = new LevelObjectManager();\n this.level_complete = document.getElementById(\"complete\");\n this.stats_manager = new StatManager();\n this.AI_bridge = new AIBridge();\n this.memento = new Memento();\n this.toolbar_manager = new ToolbarManager();\n }", "function init() {\n initGalleryToolbar();\n initGalleryList();\n initGalleryListEvents();\n }", "function init() {\n 'use strict';\n isActive = false;\n\n // no classes loaded or selected\n classes = null;\n classesSelectedIndex = -1;\n\n lastCheckedStudent = -1;\n\n bindUIActions();\n }", "function init () {\n // Here below all inits you need\n }", "function init () {\n ctrl.selectedIndex = ctrl.selectedIndex || 0;\n compileTemplate();\n configureWatchers();\n bindEvents();\n $mdTheming($element);\n $mdUtil.nextTick(function () {\n updateHeightFromContent();\n adjustOffset();\n updateInkBarStyles();\n ctrl.tabs[ ctrl.selectedIndex ] && ctrl.tabs[ ctrl.selectedIndex ].scope.select();\n loaded = true;\n updatePagination();\n });\n }", "function init () {\n ctrl.selectedIndex = ctrl.selectedIndex || 0;\n compileTemplate();\n configureWatchers();\n bindEvents();\n $mdTheming($element);\n $mdUtil.nextTick(function () {\n updateHeightFromContent();\n adjustOffset();\n updateInkBarStyles();\n ctrl.tabs[ ctrl.selectedIndex ] && ctrl.tabs[ ctrl.selectedIndex ].scope.select();\n loaded = true;\n updatePagination();\n });\n }", "function initializeUI(){\n\n GselJumpMenus = findObject(\"JumpMenuList\");\n \n //populate the GarrJumpMenus global array\n GarrJumpMenus = getAllJumpMenus();\n \n //check validity of using behavior and give user \n //informative message if not valid\n if ( !checkValidity() ){\n GbValidContext = false;\n return;\n }\n \n //make main layer visible, previously hidden to prevent flashing\n //if dialog text changes because document is invalid\n findObject(\"mainLayer\").visibility = \"visible\";\n \n //populate list and select a likely candidate\n populateJumpMenuOptions(); \n selectJumpMenuOption();\n}", "constructor() {\n super();\n this.renderCoreStyles();\n this.render();\n }", "function init() {\n // Activate Widget / Cards\n weatherWidget(true);\n holidayWidget(true);\n restaurantWidget(true);\n timezoneWidget(true);\n\n // Activate the page content\n renderHeader();\n renderMainContent();\n renderFooter();\n $('.sidenav').sidenav();\n $('.fixed-action-btn').floatingActionButton();\n $('.modal').modal();\n searchInputAutoComplete();\n renderSearchLocations();\n\n // LAST: Activate Widget Filter\n renderFilterWidgets();\n}", "init() {\n // display month\n UICtrl.displayMonth();\n loadEventListeners();\n }", "async _init() {\n // load the container from DOM, and check it\n const loaded = this._loadContainer(this._options.container);\n\n if (!loaded) return;\n\n // init html templates\n this._initContainer();\n this._initControls();\n this._renderControls();\n\n // init listeners\n this._initListeners();\n\n // first data load\n await this._fetchCards(this._maxDisplayedCards);\n this._loadCurrentPage();\n }", "function init(){\n $('.page-content').append(window.ST.pooToolSpinner.el);\n changeDesign();\n initializeCheckOrientation();\n initializeListingDateLocationService();\n initializeGantt();\n initializeDatepickers();\n initialize_poolTool_createTransaction_form(gon.locale, gon.choose_employee_or_renter_msg);\n initialize_device_picker();\n initialize_poolTool_options();\n initialize_poolTool_search();\n\n // devices the current logged in user has in his hands\n if (gon.user_active_bookings !== null){\n show_my_borrowed_devices();\n }\n\n $(\".inline\").colorbox({inline:true, width:\"90%\", height:\"95%\", maxWidth:\"500px\", maxHeight:\"270px\"});\n }", "build() {\r\n this.defineComponents();\r\n this.render();\r\n this.initEventHandlers();\r\n }", "init () {\n // register default plugins\n this.apply(BasicForm.UiLibPlugin, new SchemaPlugin(), new RenderPlugin())\n\n // user defined plugins\n const plugins = this.options.plugins\n if (plugins && plugins.length > 0) {\n this.apply.apply(this, plugins)\n }\n\n /** create and render form view - without data bind */\n this.create()\n }", "function init(){\n initBackground();\n initNavBar();\n initLatestProjects();\n initCarrouselProjects();\n initDetailsProject();\n initGalleries();\n initContactForm();\n }", "function initialization() {\n $log.info('default component initialized');\n }", "function initUI() {\n\tconst pauseButton = document.getElementById(\"pause-button\");\n\tconst restartButton = document.getElementById(\"restart-button\");\n\tconst memorySlotSizeSelect = document.getElementById(\"memory-slot-size-select\");\n\tconst accessPatternFileInput = document.getElementById(\"access-patterns-file\");\n\tcycleCounterSpan = document.getElementById(\"cycle-counter\");\n\tnumberOfSMs = document.getElementById(\"num-SMs\");\n\tpauseButton.addEventListener(\"click\", _ => {\n\t\tpause();\n\t\tpauseButton.value = drawing ? \"Pause\" : \"Continue\";\n\t});\n\trestartButton.addEventListener(\"click\", _ => {\n\t\tpauseButton.value = \"Pause\";\n\t\trestart();\n\t});\n\tmemorySlotSizeSelect.addEventListener(\"change\", event => {\n\t\tdrawing = false;\n\t\tmemorySlotSize = parseInt(event.target.value);\n\t\tpauseButton.value = \"Pause\";\n\t\trestart();\n\t});\n\taccessPatternFileInput.addEventListener(\"change\", event => {\n\t\tconst file = event.target.files[0];\n\t\tconsole.log(\"Parsing\", file.name, \"of size\", file.size);\n\t\tconst reader = new FileReader();\n\t\treader.onload = JSONFileHandler;\n\t\treader.readAsText(file);\n\t});\n}", "init() {\n //initialise colour inputs\n this.div.classList.add(\"coloursFilter\"); //add class coloursFilter to div\n this.makeInputs_Labels(); //method call\n }", "_init() {\n this.$inputs = this.$element.find('input, textarea, select');\n\n this._events();\n }", "init() {\n this.previousSlide();\n this.createControls();\n this.initGestures();\n }", "function init() {\n setUpModeButtons();\n setUpSquares();\n reset();\n}", "initialize() {\n this.listenTo(this.owner, {\n [events_1.RendererEvent.BEGIN]: this.onRenderBegin,\n [events_1.PageEvent.BEGIN]: this.onRendererBeginPage,\n });\n }", "function initializeComponent() {\n\n lblName.text(VIS.Msg.translate(VIS.Env.getCtx(), \"Name\"));\n lblDepartment.text(VIS.Msg.translate(VIS.Env.getCtx(), \"Department\"));\n lblEmployeeGrade.text(VIS.Msg.translate(VIS.Env.getCtx(), \"EmployeeGrade\"));\n lblDateOfBirth.text(VIS.Msg.translate(VIS.Env.getCtx(), \"DateOfBirth\"));\n lblBottomMsg.text(VIS.Msg.translate(VIS.Env.getCtx(), \"Bottom Message\"));\n\n $root = $(\"<div style='width: 100%; height: 100%; background-color: white;'>\");\n\n $btnPartial = $(\"<input class='VIS_Pref_btn-2' style='float: left;height: 38px;' type='button' value='SampleDialoge1'>\");\n $btnSample = $(\"<input class='VIS_Pref_btn-2' style='float: left;height: 38px;' type='button' value='SampleDialoge2'>\");\n $okBtn = $(\"<input class='VIS_Pref_btn-2' style=' margin-right: 3px;height: 38px;' type='button' value='Save'>\");\n $cancelBtn = $(\"<input class='VIS_Pref_btn-2' style=' margin-right: 15px ;width: 70px;height: 38px;' type='button' value='Clear'>\");\n\n //left side div\n leftSideDiv = $(\"<div style='float: left; margin-left: 0px;height: 95%;width:20%;margin-top: 1px;position: relative; background-color: #F1F1F1;'>\");\n leftSideBottomDiv = $(\"<div style='float: left; position: absolute; bottom: 0;height: 60px;width:100%; background-color: #F1F1F1'>\");\n \n bottumDiv = $(\"<div style='width: 100%; height: 60px; float: left; margin-bottom: 0px;'>\");\n\n var tble = $(\"<table style='width: 100%;'>\");\n //add table into div\n leftSideDiv.append(tble);\n\n var tr = $(\"<tr>\");\n var td = $(\"<td style='padding: 4px 15px 2px;'>\");\n\n tble.append(tr);\n tr.append(td);\n td.append(lblName.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(txtName.css(\"display\", \"inline-block\").css(\"width\", \"236px\").css(\"height\", \"30px\"));\n\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 4px 15px 2px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(lblDepartment.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(cmbDepartment.css(\"display\", \"inline-block\").css(\"width\", \"236px\").css(\"height\", \"30px\"));\n\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 4px 15px 2px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(lblEmployeeGrade.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(cmbEmployeeGrade.css(\"display\", \"inline-block\").css(\"width\", \"236px\").css(\"height\", \"30px\"));\n\n \n\n \n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 4px 15px 2px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(lblDateOfBirth.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n\n\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(vdate.css(\"display\", \"inline-block\").css(\"width\", \"236px\").css(\"height\", \"30px\"));\n\n //add button to left bottom div\n leftSideBottomDiv.append($cancelBtn).append($okBtn);\n //then to left div\n leftSideDiv.append(leftSideBottomDiv);\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append($btnPartial);\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append($btnSample);\n\n\n //Right Side Div Declaration\n rightSideDiv = $(\"<div style='float: right;width: 78%; height: 95%; margin-right: 15px;margin-top: 1px; border: 1px solid darkgray;'>\");\n //Bottom div\n bottumDiv.append(lblBottomMsg.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n\n //add value to root\n $root.append(leftSideDiv).append(rightSideDiv).append(bottumDiv);\n\n //Event\n $okBtn.on(VIS.Events.onTouchStartOrClick, function () {\n saveEmployee();\n });\n\n $cancelBtn.on(VIS.Events.onTouchStartOrClick, function () {\n //if (confirm(\"wanna close this form?\")) {\n // $self.dispose();\n //}\n\n txtName.val(\"\");\n cmbEmployeeGrade.prop('selectedIndex', -1);\n cmbDepartment.prop('selectedIndex', -1);\n vdate.val(\"\");\n lblBottomMsg.text(\"Please Fill value to insert record.\");\n });\n\n $btnPartial.on(VIS.Events.onTouchStartOrClick, function () {\n \n\n });\n\n $btnSample.on(VIS.Events.onTouchStartOrClick, function () {\n var obj = new VAT.EmployeeFormByDialog($self.windowNo);\n obj.showDialoge();\n });\n\n\n // getDepartmentData();\n // getEmployeeGradeData();\n }", "function init() {\n initVisualization();\n \n addSimulationControls(play, pause, step, stop_movement);\n \n addParamControls(\"#sliders\", params, update_params); \n}", "function init() {\n\t\t//console.log(\"app.init()\");\n\t\tif(initDone) {\n\t\t\t//console.log(\"init already done.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tinitDone = true;\n\t\t}\n\n\t\t// Init HTML layout and from there the GUI/UI with interaction.\n\t\tlayout.init();\n\t\tscene.init();\n\t\t//ui.init();\n\t\t// Proceed directly to startup of the loop.\n\t\t//start();\n\t}", "init() {\n this.loadModules();\n this.cacheDOM();\n this.attachEvents();\n this.stickFooterToBottom();\n }", "function initialization(){\n try{\n statusBar('Inicializando...');\n \n setContextMenu();\n ChangedItens = new Hash();\n startChangedMonitor();\n\n }catch(E){\n raiseException(E);\n }finally{\n statusBar('');\n }\n\n}", "function init() {\n emptyAbilities();\n renderHeroButtons();\n handleClick();\n }", "function initWidgetUI() {\n $(\".widget-wrapper\").each(function () {\n var widgetId = extractObjectIdFromElementId($(this).attr(\"id\"));\n styleWidgetButtons(widgetId);\n });\n }", "function init() {\n populateDOMElementVariables();\n setUpInputBindings();\n return;\n}", "Initialize()\n {\n this.UpdateValues();\n }", "function Init() {\r\n\tSetupCanvas();\r\n\tSetupButtons();\r\n}", "function init() {\n // Creating views\n trackBank = host.createMainTrackBank (1, 0, 0), host.createCursorTrack (\"AIIOM_CTRL\", \"Cursor Track\", 0, 0, true);\n cursorTrack = host.createArrangerCursorTrack(1, 1); // Track cursor\n trackBank.followCursorTrack(cursorTrack); // Sync cursor track of view and script\n\n host.getMidiInPort(0).setMidiCallback(onMidi); // Configuring MIDI device\n\n // Initializing controller sections\n midiListeners = [\n initTransport(),\n initTrack(),\n initDevice(),\n initNote(),\n initNavigation(),\n initLoopback()\n ];\n}", "function init(e)\n {\n component = $(e);\n component.addClass('mt-container');\n addTextarea();\n addInput();\n addList();\n component.append('<div style=\"clear:both;\"></div>');\n }", "function init() {\n if (!buttons || !graph || !container || !infoQuantity || !infoDuration) {\n console.error('could not find all necessary elements');\n return;\n }\n\n buttons.forEach((button) => {\n button.addEventListener('click', _handleButtonClick);\n });\n\n CHART_CONTEXT = graph.getContext('2d');\n}", "function init() {\n\n // setup canvas\n canvas = document.getElementById(canvas_id);\n context = canvas.getContext('2d');\n\n // render user controls\n if (controlsRendered === false) {\n self.renderControls();\n controlsRendered = true;\n }\n\n // add page controls\n window.addEventListener('keydown', self.navigation, false);\n window.addEventListener('hashchange', checkHash, false);\n }", "onInit() {\n this.__initEvents();\n }", "function _init() {\n\t\t\t// Trigger a few events so the bar looks good on startup.\n\t\t\t_timeHandler({\n\t\t\t\tid: api.id,\n\t\t\t\tduration: api.jwGetDuration(),\n\t\t\t\tposition: 0\n\t\t\t});\n\t\t\t_bufferHandler({\n\t\t\t\tid: api.id,\n\t\t\t\tbufferProgress: 0\n\t\t\t});\n\t\t\t_muteHandler({\n\t\t\t\tid: api.id,\n\t\t\t\tmute: api.jwGetMute()\n\t\t\t});\n\t\t\t_stateHandler({\n\t\t\t\tid: api.id,\n\t\t\t\tnewstate: jwplayer.api.events.state.IDLE\n\t\t\t});\n\t\t\t_volumeHandler({\n\t\t\t\tid: api.id,\n\t\t\t\tvolume: api.jwGetVolume()\n\t\t\t});\n\t\t}", "function initializeUI() \n{\n MENU_DN1 = new ListControl('DNComparison');\n MENU_DN2 = new ListControl('DNComparison2');\n\tMENU_DN3 = new ListControl('DNComparison3');\n\tMENU_DN1.setAll(selectListArray,selectValueArray);\n\tMENU_DN2.setAll(selectListArray,selectValueArray);\n\tMENU_DN3.setAll(selectListArray,selectValueArray);\n\t\n\tPREF_OBJ.initialize(\n { // In line declaration of objects associative array.\n\t\t DNName1 : new PrefField(findObject('DNName')),\n DNComparison1 : new PrefSelectClass(MENU_DN1),\n DNValue1: new PrefField(findObject('DNValue')),\n\t\t\tDNName2 : new PrefField(findObject('DNName2')),\n DNComparison2 : new PrefSelectClass(MENU_DN2),\n DNValue2 : new PrefField(findObject('DNValue2')),\n\t\t\tDNName3 : new PrefField(findObject('DNName3')),\n DNComparison3 : new PrefSelectClass(MENU_DN3),\n DNValue3 : new PrefField(findObject('DNValue3')) \n }\n )\n}", "setup() {\n this.setupLayout();\n this.setupNotifications();\n }", "function _constructComponents() {\r\n\t//having a set root element allows us to make queries\r\n\t//and resultant styling safe and much faster.\r\n\t//var elOuterParent = _rootDiv;\r\n\t//document.getElementById(_rootID);\r\n\tvar builder = new WidgetBuilder();\r\n\t_debugger.log(\"building html scaffolding.\"); //#\r\n\t_el = builder.construct(CSS_PREFIX, _manips);\r\n\t\r\n\t//todo: do we need to \"wait\" for these? Is there any initialization problem\r\n\t//that prevents them from being constructed to no effect?\r\n\t\r\n\t_debugger.log(\"building slideMotion.\"); //#\r\n\t_slideMotion = new SlideMotion();\r\n\tthis.slideMotion = _slideMotion; //# debugging only\r\n\t\r\n\t_debugger.log(\"building slideLogic.\"); //#\r\n\t_slideLogic = new SlideLogic(_slideMotion);\r\n\t_animator = _slideLogic;\r\n\t\r\n\t_debugger.log(\"building Event Manager.\"); //#\r\n\t_evtMgr = new EvtMgr(_behavior, _animator);\r\n\t_debugger.log(\"building Scaler.\"); //#\r\n\t_deviceWrangler = new DeviceWrangler();\r\n\t_scaler = new Scaler(_outerParent, _evtMgr, _animator);\r\n}", "function init() {\n \n \n mostrarForm(false);\n listar();\n }", "function main() {\n MenuItem.init();\n sizeUI();\n }", "setupUI () {\n this.html.canvas.width = this.canvasWidth\n this.html.canvas.height = this.canvasHeight\n \n // Prevent \"touch and hold to open context menu\" menu on touchscreens.\n this.html.canvas.addEventListener('touchstart', stopEvent)\n this.html.canvas.addEventListener('touchmove', stopEvent)\n this.html.canvas.addEventListener('touchend', stopEvent)\n this.html.canvas.addEventListener('touchcancel', stopEvent)\n \n this.html.buttonHome.addEventListener('click', this.buttonHome_onClick.bind(this))\n this.html.buttonReload.addEventListener('click', this.buttonReload_onClick.bind(this))\n this.html.buttonLeft.addEventListener('click', this.buttonLeft_onClick.bind(this))\n this.html.buttonRight.addEventListener('click', this.buttonRight_onClick.bind(this))\n \n this.html.main.addEventListener('keydown', this.onKeyDown.bind(this))\n \n window.addEventListener('resize', this.updateUI.bind(this))\n this.updateUI()\n this.hideUI() // Hide until all assets are loaded\n \n this.html.main.focus()\n }", "function init(){\r\n\r\n\t\t//Adding listeners \r\n\t\tbtnSubmit.addEventListener('click' , handleSubmitClick);\r\n\t\tgroceryList.addEventListener('click' , handleListClick);\r\n\t\t//call to setup the page\r\n\t\tsetUp();\r\n\t}", "init () {\n this.renderProfiles()\n this.profileClickEvent()\n this.modalCloseEvent()\n }", "function init() {\n\tinitCamera();\n\tinitRenderer();\n\tinitControls();\n\trender();\n}", "function initialize() {\n\t\talertBinding();\n\t\tsetGalleryId();\n\t\tfileUploadInit();\n\t\tfileUploadBinding();\n\t\tloadGallery();\n\t}", "function initialize() {\n\tinitialColorScale(imageData);\n\tloadIconImages(imageData);\n\tdrawBarChart(imageData);\n\tdrawSliderBar(imageData);\n\tdrawTreemap(imageData);\n}", "setupUI () {\n\t\t// Score Keeper\n\t\tthis.score = this.add.text(1150, 10, 'Score: 0', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFFFFF'\n\t\t});\n\n\t\tthis.score.alpha = 0;\n\n\t\t// Castle Health\n\t\tthis.hpBarTxt = this.add.text(395, 50, 'Health: 100', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFF'\n\t\t});\n\t\tthis.hpBarTxt.alpha = 0;\n\n\t\t// Health bar\n\t\tthis.healthBar = this.add.graphics();\n\t\tthis.healthBar.fillStyle(0xFF0000, 0.8);\n\t\tthis.healthBar.fillRect(395, 10, 490, 20);\n\t\tthis.healthBar.alpha = 0;\n\n\t\t// Health bar indicator\n\t\tthis.healthBarPercText = this.add.text(620, 12, '100%', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFF'\n\t\t});\n\t\tthis.healthBarPercText.alpha = 0;\n\n\t\t// Gold indicator\n\t\tthis.goldAmount = this.add.text(395, 80, 'Gold: 8', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFF'\n\t\t});\n\t\tthis.goldAmount.alpha = 0;\n\n\t\t// Wave Msg text\n\t\tthis.waveText = this.add.text(195, 160, 'Wave: 0 ', {\n\t\t\tfontSize: '48px',\n\t\t\tfill: '#fff'\n\t\t});\n\t\tthis.waveText.alpha = 0;\n\n\t\t// Wave indicator\n\t\tthis.waveIndicator = this.add.text(755, 80, 'Wave: 0 ', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#fff'\n\t\t});\n\t\tthis.waveIndicator.alpha = 0;\n\n\t\t// Wave status\n\t\tthis.waveStatus1 = this.add.text(840, 50, 'OFF', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FF0000'\n\t\t});\n\t\tthis.waveStatus1.alpha = 0;\n\n\t\tthis.waveStatus2 = this.add.text(755, 50, 'Status: ', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#FFF'\n\t\t});\n\t\tthis.waveStatus2.alpha = 0;\n\n\t\tthis.waveStatus3 = this.add.text(840, 50, 'ON', {\n\t\t\tfontSize: '18px',\n\t\t\tfill: '#66ff00'\n\t\t});\n\t\tthis.waveStatus3.alpha = 0;\n\n\t\t// Boss health bar\n\t\tthis.bossHealthBar = this.add.graphics();\n\t\tthis.bossHealthBar.fillStyle(0xFF0000, 0.8);\n\t\tthis.bossHealthBar.fillRect(0, 0, 115, 5);\n\t\tthis.bossHealthBar.alpha = 0;\n\t}", "function objectInit() {\n wallCloseSpan = select('#wall-close');\n wallCloseSpan.mousePressed(wallClosePressed);\n pointCloseSpan = select('#point-close');\n pointCloseSpan.mousePressed(pointClosePressed);\n\n if (isSmartPhone) {\n for (let modal of selectAll('.modal-content')) {\n modal.removeClass('modal-content');\n modal.class('modal-content-smapho');\n }\n }\n\n startButton = createButton('Start');\n startButton.mousePressed(startAlgo);\n startButton.class('button');\n startButton.parent('#navbar')\n\n resetButton = createButton('Reset');\n resetButton.mousePressed(reset);\n resetButton.class('button');\n resetButton.parent('#navbar');\n\n resetAllButton = createButton('Remove Walls');\n resetAllButton.mousePressed(resetAll);\n resetAllButton.class('button');\n resetAllButton.parent('#navbar');\n}", "function init() {\n\n // Set up hamburger/menu toggle\n initHamburger();\n }", "_init() {\n \t\n \tthis.events = new Siteapp.sys.EventManager(this);\n\t this._events();\n \t\n \tthis._initPanelAdapter();\n\n\t\t// usually: earthTheme.Ui.initialize(this) ,but in this case lets call the alias\n \t// because, we are 'connecting' a '(screen)layer' to a '(UI)manager'\n var layerName = Siteapp.sys.functionName(this);\n this.manager.connectLayer(this, layerName);\n\t \n }" ]
[ "0.7526719", "0.72185904", "0.7114103", "0.7096513", "0.70570654", "0.6973309", "0.690981", "0.68565226", "0.68510777", "0.68357563", "0.68226945", "0.67514586", "0.67251706", "0.6712862", "0.6698622", "0.6689241", "0.66522837", "0.6633256", "0.66311234", "0.6627765", "0.6617184", "0.6607106", "0.6604348", "0.6593482", "0.6585922", "0.6585203", "0.65632707", "0.6563083", "0.65418375", "0.6526193", "0.65108156", "0.6508482", "0.65036595", "0.65036595", "0.6498688", "0.6487369", "0.64548916", "0.64447224", "0.6444586", "0.6444144", "0.64375025", "0.6436412", "0.64247495", "0.6414945", "0.64135486", "0.64126533", "0.6408516", "0.6407664", "0.64071923", "0.6402583", "0.6383787", "0.6379526", "0.6379526", "0.6378421", "0.637341", "0.63599515", "0.6356943", "0.6348691", "0.6348243", "0.6336066", "0.63284636", "0.6326964", "0.63230664", "0.63214487", "0.6306379", "0.6297323", "0.6293075", "0.6283886", "0.6283384", "0.62791723", "0.6278722", "0.6274936", "0.6273211", "0.62583846", "0.62527406", "0.62513417", "0.62460077", "0.62451375", "0.62416524", "0.6240938", "0.62404245", "0.6226067", "0.62249607", "0.621565", "0.62153316", "0.6211238", "0.62002736", "0.6198643", "0.61935085", "0.61895853", "0.6189544", "0.6184271", "0.6178527", "0.61781144", "0.61720127", "0.61682063", "0.6163688", "0.6159398", "0.6158885", "0.6146374" ]
0.686599
7
Group salary years of the same people together.
function processSalaryData() { for (let [year, yearlyData] of Object.entries(salaryData)) { for (let entry of yearlyData) { // get the person's first and last name let name = getNormalizedName(entry[FIRST_NAME], entry[MIDDLE_INITIAL], entry[LAST_NAME]); // if the name has not been seen yet in other years if (!(name in people)) { people[name] = {}; } // save the person's yearly salary data people[name][year] = entry; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function employee_grouping_by_age() {\n var emp=\n [\n {\n name:\"Amarjeet malik\",\n age:22,\n salary:8000,\n DOB:\"04/08/1996\"\n },\n {\n name:\"Dolly\",\n age:21,\n salary:10000,\n DOB:\"14/11/1997\"\n },\n {\n name:\"Surya\",\n age:19,\n salary:4000,\n DOB:\"03/07/1999\"\n },\n {\n name:\"Sampriti\",\n age:19,\n salary:900,\n DOB:\"12/08/1999\"\n }\n ];\n var group={};\n console.log(\"Grouping employees by age\");\n for (var i=0;i< emp.length;i++)\n {\n if(!group[emp[i].age])\n group[emp[i].age]=[emp[i]];\n else\n group[emp[i].age].push(emp[i]);\n }\n console.log(group);\n}", "function groupBy(arr){\n const groupByYear = arr.reduce(function (acc, item) {\n acc[item.year] = acc[item.year] || []\n acc[item.year].push(item)\n\n return acc;\n }, Object.create(null));\n return groupByYear\n}", "function years(yrs) {\n let growth = (basis * 0.05) * yrs;\n return growth;\n }", "function groupBy(accum, person) {\n var century = Math.ceil(person.died / 100);\n if (!(century in accum)) {\n accum[century] = [];\n }\n accum[century].push(person.died - person.born);\n return accum;\n}", "function groupPeopleByCentury(century, person) {\n includeCenturyValues(centuries, century, person);\n}", "function annSalCal(salary) {\n\tconsole.log('In annSalCal function!');\n\t// monthlySal is each annual salary devided my total months in year\n\tlet monthlySal = Number(salary) / 12;\n\t// return the monthly salary\n\treturn monthlySal;\n}", "function getYears() {\n\tconst retirementAge = 65;\n\tconst currentYear = new Date().getFullYear();\n\tconst baseYear = currentYear - retirementAge + 1;\n\treturn [...Array(65).keys()].map((index) => index + baseYear);\n}", "function getYears(getFinals) {\n return getFinals(fifaData).map((x) => {\n return x.Year;\n });\n}", "function calculateAnnualPerf(years) {\n years.map(function (item, index) {\n const previousYear = years.find((q) => q.year == item.year - 1);\n // check if previous year available. present year and previous have 4 qtrs.\n if (\n isDefined(previousYear) &&\n item.qtrs4Year == 4 &&\n previousYear.qtrs4Year == 4\n ) {\n item.epsPerf = calculatePercentChange(item.eps, previousYear.eps);\n item.revPerf = calculatePercentChange(item.rev, previousYear.rev);\n }\n });\n}", "function asRoughYears(dur) {\n return asRoughDays(dur) / 365;\n }", "listYears () {\n const dates = []\n let currentDate = Moment(this.minMoment)\n while (currentDate <= this.maxMoment) {\n dates.push({\n text: currentDate.year(),\n value: currentDate.year()\n })\n currentDate = Moment(currentDate).add(1, 'year')\n }\n return dates\n }", "function groupByYear(collection) {\n return new Map(\n fp.flow(\n fp.orderBy([\"date\"], [\"desc\"]),\n fp.groupBy((x) => new Date(x.date).getFullYear()),\n fp.toPairs,\n fp.orderBy(fp.first, [\"desc\"])\n )(collection)\n );\n}", "function asRoughYears(dur) {\n return asRoughDays(dur) / 365;\n }", "function asRoughYears(dur) {\n return asRoughDays(dur) / 365;\n }", "function asRoughYears(dur) {\n return asRoughDays(dur) / 365;\n }", "function asRoughYears(dur) {\n return asRoughDays(dur) / 365;\n }", "function asRoughYears(dur) {\n return asRoughDays(dur) / 365;\n }", "function centuryWrapper() {\n ancestry.forEach(function(person) {\n var century = Math.ceil(person.died/100);\n\n groupPeopleByCentury(century, person);\n });\n}", "function getMembersPerYear() {\n membersPerYear = d3.nest()\n .key(d => d.year).sortKeys(d3.ascending)\n .rollup(leaves => leaves.length)\n .entries(memberData);\n}", "function averageAgeByCentury() {\n let data = {};\n for (let name in byName) {\n let person = byName[name];\n let century = (parseInt(person.died.toString().substr(0, 2)) + 1).toString();\n data[century] = data[century] || [];\n data[century].push(person.died - person.born);\n }\n Object.keys(data).forEach( x => data[x] = average(data[x]));\n return data;\n}", "function getYearRange() {\n for (var i = self.startOn; i <= self.endOn; i++) {\n self.years.push(i);\n }\n }", "function asRoughYears$1(dur) {\n return asRoughDays$1(dur) / 365;\n }", "function asRoughYears(dur) {\n return asRoughDays(dur) / 365;\n}", "function getYearsRange(startYear) {\n var currentYear = new Date().getFullYear(), years = [];\n startYear = startYear || 1980;\n while ( startYear <= currentYear ) {\n var nextYear = startYear++;\n var yearObj = {name: nextYear , value : nextYear};\n years.push(yearObj);\n } \n return years;\n }", "function getData() {\n\n // Create new object for each year 2013-2019 \n for (let i = 2013; i <= latestYear; i++) {\n yearTotals[i] = { 'total': 0, 'total_new': 0, 'total_existing': 0, 'total_floyd': 0, 'total_clark': 0, 'total_harrison': 0, 'new_floyd': 0, 'new_clark': 0, 'new_harrison': 0, 'existing_floyd': 0, 'existing_clark': 0, 'existing_harrison': 0 };\n }\n\n for (const year in yearTotals) {\n dataList.forEach(person => {\n if (person[year] > 0) {\n if (person.first_added === parseInt(year)) {\n switch(person.primary_county) {\n case 'Floyd':\n yearTotals[year].new_floyd++;\n yearTotals[year].total++;\n yearTotals[year].total_new++;\n countyTotals.Floyd++;\n countyTotals.Total++;\n break;\n case 'Clark':\n yearTotals[year].new_clark++;\n yearTotals[year].total++;\n yearTotals[year].total_new++;\n countyTotals.Clark++;\n countyTotals.Total++;\n break;\n case 'Harrison':\n yearTotals[year].new_harrison++;\n yearTotals[year].total++;\n yearTotals[year].total_new++;\n countyTotals.Harrison++;\n countyTotals.Total++;\n break;\n default:\n break;\n }\n } else {\n switch(person.primary_county) {\n case 'Floyd':\n yearTotals[year].existing_floyd++;\n yearTotals[year].total++;\n yearTotals[year].total_existing++;\n break;\n case 'Clark':\n yearTotals[year].existing_clark++;\n yearTotals[year].total++;\n yearTotals[year].total_existing++;\n break;\n case 'Harrison':\n yearTotals[year].existing_harrison++;\n yearTotals[year].total++;\n yearTotals[year].total_existing++;\n break;\n default:\n break;\n }\n }\n }\n });\n }\n}", "function Years(startDate, endDate) {\n this.startDate = startDate;\n this.endDate = endDate;\n}", "function populationStepYears(years, add, avgLos, start) {\n\t\tvar pop = start;\n\t\tfor (var i = 0; i < years; i++) {\n\t\t\t\tpop = populationStep(pop, add, avgLos);\n\t\t}\n\t\treturn pop;\n}", "function getNumberOfYears() {\n let repaymentTerm = Number(document.querySelector('input[name=\"number-of-years\"]:checked').value);\n return isNaN(repaymentTerm) ? 0 : (repaymentTerm / 12);\n }", "function calcRetirement(year) {\n const age = new Date().getFullYear() - year;\n return [age, year];\n}", "function getStudentYears(studentName) {\n /*\n * Filter the transcriptList for the specfied student\n */\n let transcriptList = database_data.getTranscripts();\n let findStudentTrans = transcriptList.filter(function (obj) {\n return (obj.studentName===studentName);\n });\n\n /*\n * Using the records in findStudentTrans, get distinct\n * semester, year values.\n */\n let years = findStudentTrans.reduce((acc, x) =>\n acc.concat(acc.find(y => y.year === x.year) ? [] : [x]), []);\n return years;\n}", "function getYears (seconds) {\nreturn (seconds/31536000).toFixed(5) + \" number of years\";\n}", "yearlySalary(seekingYear){\n let newSalary = this._startingSalary;\n //console.log(`Initial newSalary is ${newSalary}`);\n //y is the current year that function is being called in (2020)\n const y = new Date().getFullYear();\n //First check if seeking year is before the current year, which wouldn't make much sense. Return starting salary, which is always discounted by pre tax contribution rate (which could be 0 and therefore have no impact)\n if(seekingYear<y){\n //console.log(`Seeking year before current year code is being executed`);\n return newSalary*(1-this.preTaxContribution);\n //if seeking year is after retirement, salary is 0\n }else if(seekingYear>=this._retirementYear){\n newSalary=0;\n //console.log(`Seeking year after retirement year code is being executed`);\n return newSalary;\n //Check if there are salary bumps defined, and seeking year is after at least one of the bumps. Or if plateau is defined, and seeking year is after plateau\n }else if ((this._salaryBumps.length>0 && seekingYear>=this._salaryBumps[0][0]) || (this._salaryPlateau.length>0 && seekingYear>=this._salaryPlateau[0])){\n //console.log(this._salaryBumps.length);\n //console.log(this._salaryPlateau.length);\n //Then check if seeking year is before plateau year (or there is no plateau)-therefore can only focus on salary bumps\n if(this._salaryPlateau.length===0 || seekingYear<this._salaryPlateau[0]){\n //first grow salary using growth rate and number of years between seeking year and current year (standard)\n newSalary = growAgainstInflation(newSalary, seekingYear-y, this._salaryGrowth);\n //console.log(`Second newSalary is ${newSalary}`);\n //relevant salary bumps are determined as the bumps which occur before the seeking year\n const relevantSalaryBumps = this._salaryBumps.filter(bump => {\n return bump[0] < seekingYear; \n })\n //Then use relevant salary bumps to increase salary accoringly. Important to note that percentage increases commute so order of operation doesn't matter \n for(i=0; i<relevantSalaryBumps.length; i++){\n newSalary = growAgainstInflation(newSalary, 1, relevantSalaryBumps[i][1]); \n //console.log(`For loop with i = ${i}, newSalary is ${newSalary}`);\n }\n //console.log(`Salary bump return statement code is being executed`);\n return newSalary*(1-this.preTaxContribution);\n //Now we are in the section where seeking year is after the salary plateau year\n }else{\n //If there are nonzero number of salary bumps, first repeat above section to calculate the salary at the end of the pre-plateau period. No need to use relevant bumps since all bumps will be relevant\n if(this._salaryBumps.length>0){\n newSalary = growAgainstInflation(newSalary, this._salaryPlateau[0]-y-1, this._salaryGrowth);\n //console.log(`Plateau before For loop, newSalary is ${newSalary}`);\n for(i=0; i<this._salaryBumps.length; i++){\n newSalary = growAgainstInflation(newSalary, 1, this._salaryBumps[i][1]); \n //console.log(`Plateau For loop with i = ${i}, newSalary is ${newSalary}`);\n }\n //then calculate salary growth in plateau period, using the relevant years and new salary growth value\n newSalary = growAgainstInflation(newSalary, seekingYear+1-this._salaryPlateau[0], this._salaryPlateau[1]);\n //console.log(`Plateau after For loop, newSalary is ${newSalary}`);\n return newSalary*(1-this.preTaxContribution);\n //If there were no salary bumps to begin with, calculate salary at beginning of plateau period, then salary within plateau period\n }else{\n newSalary = growAgainstInflation(newSalary, this._salaryPlateau[0]-y-1, this._salaryGrowth);\n newSalary = growAgainstInflation(newSalary, seekingYear+1-this._salaryPlateau[0], this._salaryPlateau[1]);\n //console.log(`Post plateau, no salary bumps code is being executed`);\n return newSalary*(1-this.preTaxContribution); \n }\n }\n //if not, salary is calculated based on basic growth rate and number of years between first year and seeking year\n }else{\n newSalary = growAgainstInflation(this._startingSalary, seekingYear-y, this._salaryGrowth);\n //console.log(`no salary bumps code is being executed`);\n return newSalary*(1-this.preTaxContribution);\n }\n }", "function years() {\n let currentYear = new Date().getFullYear();\n //Loop and add the Year values to DropDownList.\n for (var i = 1950; i <= currentYear; i++) {\n releaseYears.push(i);\n }\n }", "function groupYearMonth(list) {\n\tvar result = {};\n\tvar years = groupBy(list, function(item) {\n\t\treturn item.date.substr(0, 4);\n\t});\n\tfor (var key in years) {\n\t\tresult[key] = {\n\t\t\tvisible: years[key].visible,\n\t\t\tdata: groupBy(years[key].data, function(item) {\n\t\t\t\treturn item.date.substr(5, 2);\n\t\t\t}),\n\t\t\tamount: years[key].amount,\n\t\t};\n\t}\n\treturn result;\n}", "function totalYearsLong(inventors) {\n var totalYears = 0;\n for (var i = 0; i < inventors.length; i++) {\n totalYears += inventors[i].year;\n }\n return totalYears;\n}", "function getDogYears(humanYears) {\n //FILL IN!\n}", "function list_pairwize_year(){\n pairwize_year=[];\n if(i_word>-1){\n\tfor(var i=0;i<pairwize[i_word];i++){\n\t if(data_json_w['links'][i]['y']===year){\n\t\tsource=data_json_w['links'][i]['s'];\n\t\ttarget=data_json_w['links'][i]['t'];\n\t\tsource=data_json['LL'][source]['continent'];\n\t\ttarget=data_json['LL'][target]['continent'];\n\t\tif((source===continent_1 && target===continent_2) || (source===continent_2 && target===continent_1) || continent_1==='all' || continent_2==='all'){\n\t\t pairwize_year.push(i);\n\t\t}\n\t }\n\t}\n }\n n_pairwize_year=pairwize_year.length;\n}", "function averageAgeByCentury() {\n //assign each person to a century\n var avgAgeExpectancy = {};\n var century;\n\n ancestry.forEach(function(person) {\n century = Math.ceil(person.died / 100).toString();\n if(!avgAgeExpectancy.hasOwnProperty(century)) { avgAgeExpectancy[century] = []; }\n avgAgeExpectancy[century].push(person.died - person.born);\n });\n\n for (var cent in avgAgeExpectancy) {\n avgAgeExpectancy[cent] = average(avgAgeExpectancy[cent]);\n }\n\n return avgAgeExpectancy;\n}", "function getYears(dataArray) {\n\n return dataArray.map(function(item){\n return item.Year;\n })\n}", "function averageAgeByCentury() {\n var centuries = {};\n var century;\n ancestry.forEach(function(person){\n century = Math.ceil(person.died/100);\n if(!(century in centuries)){\n centuries[century] = [];\n }\n centuries[century].push(person.died - person.born);\n });\n\n for(var key in centuries){\n centuries[key] = average(centuries[key]);\n }\n \n return centuries;\t\n}", "function calculateYears(principal, interest, tax, desired) {\n let p = principal\n let int = interest\n let t = tax\n let d = desired\n if(d <= p){\n return 0\n }\n \n let years = 0\n \n for( let i = 0; i < desired; i++) {\n let bonus = p * int \n bonus -= (bonus * t)\n \n p += bonus\n years ++\n if(p >= d) {\n return years\n }\n }\n }", "function getYearsSE(earnings) {\n var substantialEarnings = getWepTables.substantialEarningsMarks()\n\n // NOTE: Assumption - years of substantial earnings includes years where the earnings amount is equal to the substantial earnings value?\n let years = 0;\n let substantialEarningsMap = {};\n if (Array.isArray(substantialEarnings)) {\n substantialEarnings.forEach((earning) => {\n substantialEarningsMap[earning.year]= earning.SubstantialEarnings;\n });\n }\n\n let earningsYears = Object.keys(earnings);\n if (Array.isArray(earningsYears)) {\n earningsYears.forEach((earningsYear) => {\n if (earnings[earningsYear] >= substantialEarningsMap[earningsYear]) {\n years++;\n }\n });\n }\n\n if (years === 0) {\n //MAYBE: default to 20 if no data\n console.warn(\"getYearsSE has returned the default value of 20, correct years could not be calculated\");\n return 20\n }\n\n return years;\n}", "function leapYears() {\r\n var yearsPrinted = 0;\r\n var currentYear = 2021;\r\n while (yearsPrinted < 20) { \r\n if ((currentYear % 4 === 0) && (!((currentYear % 100===0) && (currentYear % 400 !== 0)))) {\r\n document.write(currentYear+\"<br>\")\r\n yearsPrinted++;\r\n currentYear++;\r\n } else {\r\n currentYear++;\r\n }\r\n } \r\n}", "function buildYearly() {\n yearlyData = [];\n originalData.forEach(buildYearlyForEach);\n}", "function setYears(data, i) {\n return data.toString();\n}", "function salCalc() {\n //loop through employees \n for (var i = 0; i < empArray.length; i++) {\n totalSal += Number(empArray[i].annualSalary);\n } //END for loop\n var monthlySal = totalSal / 12;\n // append monthly salary to DOM\n $('#cost').replaceWith('<p id=\"cost\"> Cost: $' + monthlySal + '</p>');\n} //END salCalc function", "function setYears() {\n if (self.budgetMonths[0].month === 'January') {\n for (i = 0; i < self.budgetMonths.length; i++) {\n self.budgetMonths[i].year = self.startingYear;\n }\n } else {\n var newYear = false;\n for (i = 0; i < self.budgetMonths.length; i++) {\n if (newYear === false && self.budgetMonths[i].month != 'January') {\n newYear = false;\n self.budgetMonths[i].year = self.startingYear;\n } else if (newYear === false && self.budgetMonths[i].month === 'January') {\n newYear = true;\n self.budgetMonths[i].year = self.startingYear + 1;\n } else {\n self.budgetMonths[i].year = self.startingYear + 1;\n }\n }\n }\n } // end setYears", "function ageOneYear (obj) {\n obj.age += 1\n return obj\n}", "yearToAcademicYear () {\n return this + \"-\" + (Number(this) + 1).toString().slice(-2);\n }", "function sumYear(data) {\r\n var total = 0;\r\n\r\n // loop through passed data and sum it ...\r\n data.forEach(function (d, i) {\r\n var count = d.value.d;\r\n total = total + count;\r\n });\r\n\r\n return total;\r\n\r\n return;\r\n}", "function dogToHumanYears(years)\n{\n let humanYears = 0;\n\n //ages 1-3 - 10 human years to dog years\n if (years <= 3)\n {\n humanYears = years * 10;\n }\n //other ages - 7 human years to dog years\n else\n {\n humanYears = 30; //first three dog years\n years -= 3;\n humanYears += (years * 7);\n }\n return humanYears;\n}", "function wrapDates(startJulian,endJulian){\r\n //Set up date wrapping\r\n var wrapOffset = 0;\r\n var yearWithMajority = 0;\r\n if (startJulian > endJulian) {\r\n wrapOffset = 365;\r\n var y1NDays = 365-startJulian;\r\n var y2NDays = endJulian;\r\n if(y2NDays > y1NDays){yearWithMajority = 1;}\r\n }\r\n return [wrapOffset,yearWithMajority];\r\n}", "function calculateAge(birthYear){\n return 2019 - birthYear;\n}", "function getYears(cb) {\n const finalsYears = cb.map((final) => {\n return final.Year;\n });\n // console.log(\"TASK #3\", finalsYears);\n return finalsYears\n}", "function totalSalary() {\n return people.reduce((total, p) => total + p.salary, 0);\n}", "function yearsUntilRetirement(year, firstName) {\n var age = calculateAge(year);\n var retirement = 65 - age;\n console.log(firstName + ' retires in ' + retirement + ' years.');\n}", "function yearSum (dataArray) {\n\tvar yTotal = [];\n\n\tdataArray.forEach(function(d, i) {\n\t\tyTotal.push(d.total);\n\t});\n\n\tvar sumYear = d3.sum(yTotal);\n\treturn sumYear;\n}", "function totalDaysInYear(fullYear){\r\n return isLeapYear(fullYear)? 366 : 365;\r\n }", "function lgDogMultiplier(years) {\n\treturn lgDogEq(years + 1) - lgDogEq(years);\n}", "function bornBeforeYear(dataArr, year) {\n const result = [];\n dataArr.forEach(person => {\n const birthYear = new Date(person.birthday).getFullYear();\n (birthYear < year) && result.push(person);\n \n });\n return result; \n}", "function xAmounts(d) {\n return d.year;\n }", "function getYears(age) {\n var currentTime = new Date();\n var currentYear = currentTime.getFullYear();\n return currentYear - age;\n}", "static years(years = 1, around = Day.today(), focus = 0.4999, input) {\n return this.forType(Units.YEAR, years, around, focus, input);\n }", "function totalyearsExperience( employeesArray ){\n console.log( 'in totalyearsExperience:', employeesArray );\n // create a new cariable to hold sum of all experience\n let yearsToReturn = 0;\n // loop through array\n for( let i=0; i < employeesArray.length; i++ ){\n // total all yearsOfExperience\n yearsToReturn += employeesArray[ i ].yearsOfExperience;\n } //end for\n // return totalyearsExperience\n return yearsToReturn;\n} // end func", "function filterYear(d) {\r\n return (d.year === yearcompare)\r\n }", "function createSalaryTable(sals, headers) {\n\tvar tab = document.createElement(\"table\");\n\n\t$(tab).addClass('table').addClass('table-striped').addClass('table-bordered');\n\n\tvar heads = document.createElement(\"tr\");\n\n\t// iterate and create the headers\n\tfor(var i =0; i < headers.length; i++) {\n\t\tvar th = document.createElement(\"th\");\n\t\t$(th).text(headers[i]);\n\t\t$(heads).append(th)\n\t}\n\n\t$(tab).append(heads);\n\n\t// for each salary data set for a date range\n\tfor(var i = 0 ; i < sals.length; i++) {\n\n\t\tvar dRow = document.createElement(\"tr\");\n\n\t\t// for each value in the current salary data set\n\t\tfor(var j = 1; j < sals[i].length; j++) {\n\t\t\tvar td = document.createElement(\"td\");\n\t\t\t$(td).text(sals[i][j]);\n\t\t\t$(dRow).append(td);\n\t\t}\n\n\t\t$(tab).append(dRow);\n\t}\n\n\treturn tab;\n}", "function organizeByGroup() {\n const groupedEmployees = {};\n employees.forEach(employee => {\n const name = {\n name:\n employee.nameOrder === 'reverse'\n ? `${employee.last} ${employee.first}`\n : `${employee.first} ${employee.last}`,\n };\n if (groupedEmployees[employee.group]) {\n groupedEmployees[employee.group].push(name);\n } else {\n groupedEmployees[employee.group] = [name];\n }\n });\n\n return groupedEmployees;\n}", "function dogToHumanYears(dogAge) {\n return (dogAge - 2) * 4 + 21;\n}", "function calcYear(y){\n\tyear = 12;\n\thrYear = y * year;\n\treturn hrYear;\n}", "function yearsUntilRetirement2(year, firstName) {\n var age = calculateAge(year);\n var retirement = 65 - age;\n if (retirement > 1) {\n console.log(firstName + ' retires in ' + retirement + ' years.');\n } else if (retirement === 1) {\n console.log(firstName + ' retires this year!');\n } else {\n console.log(firstName + ' has retired!');\n }\n}", "function numberOfAccidentsPerYear(accidents) {\n\n // map accidents by year\n var mapOfAccidentsPerYear = _.groupBy(accidents, 'dateYear');\n\n var numberOfAccidentsPerYear = {};\n\n _.each(mapOfAccidentsPerYear, function(accidentsPerYearArray, year) {\n\n numberOfAccidentsPerYear[year] = accidentsPerYearArray.length;\n\n });\n\n console.log(numberOfAccidentsPerYear);\n\n}", "function groupByDate2(arr) {\n let grouped = {}; let yearMonth;\n for (let element of arr) {\n yearMonth = Object.keys(element)[0];\n if (!(yearMonth in grouped)) {\n grouped[yearMonth] = {\n [element[yearMonth].Category.category.toUpperCase().replace('.PNG', '')]: parseInt(element[yearMonth].sum),\n }\n } else {\n grouped[yearMonth] = {\n ...grouped[yearMonth],\n [element[yearMonth].Category.category.toUpperCase().replace('.PNG', '')]: parseInt(element[yearMonth].sum),\n }\n }\n }\n return grouped;\n}", "_renderYearItems() {\n\t\tlet years = [];\n\t\t// add an empty option for user to clear out\n\t\tyears.push(<option key=\"empty\" value=\"\"></option>);\n\n\t\tfor (let i = 1942; i < 2013; i++) {\n\t\t\tif (i === 1975) {\n\t\t\t\t// there were two years in 1975\n\t\t\t\tyears.push(<option key={i + 'n'} value={i + 'n'}>{i + 'n'}</option>);\n\t\t\t\tyears.push(<option key={i + 'o'} value={i + 'o'}>{i + 'o'}</option>);\n\t\t\t} else {\n\t\t\t\tyears.push(<option key={i} value={i}>{i}</option>);\n\t\t\t}\n\t\t}\n\n\t\treturn years; \n\t}", "updateYears() {\n let years = years_for_decade(this.decade);\n let yearsel = this.year_picker.selectAll('.year-selector').data(years)\n\n yearsel.exit().remove()\n\n let newyears = yearsel.enter()\n .append('a')\n .classed('year-selector', true)\n\n yearsel.merge(newyears)\n .text(year=>year)\n .on('click', year=>this.setYear(year))\n .classed('active', year=>year==this.year)\n }", "function setYears (setSelectedYears, rangeOfYears){\n let years = []\n for (var i = rangeOfYears[0]; i <= rangeOfYears[1]; i++) {\n years.push(i);\n }\n setSelectedYears(years)\n}", "function groupBy(arr, group) {\n var groups = {};\n //forEach element in the array\n //var elementGroup = get the group by calling century function on the person\n //see if that group is already in groups object, if not, add it to groups object\n arr.forEach(function(element){\n var elementGroup = group(element);\n //console.log(elementGroup);\n if (elementGroup in groups) {\n groups[elementGroup].push(element);\n }else {\n groups[elementGroup] = [element]; \n }\n });\n\n return groups;\n}", "function add_years(dt,n)\n {\n return new Date(dt.setFullYear(dt.getFullYear() + n));\n }", "function addAdditionalFields(emp) {\n for (i = 0; i < Object.keys(emp).length; i++) {\n addYearSalary(emp[i]);\n addNextSalary(emp[i]);\n }\n}", "function calculateAge(year) {\n console.log(2019 - year);\n}", "function DataKeeper(CurrentYear, JudgementDay){\r\n\r\n\tvar Allleaps = 0;\r\n\tvar AllNonLeaps = -1; // intitatilized to - 1 to compensate for the extra year in Non leap years\r\n\tvar TrackYears = {Leaps : Allleaps, Nonleap : AllNonLeaps};\r\n\r\n\tfor(var i = CurrentYear; i <= JudgementDay; i++){\r\n\r\n\t\tif (i%4 === 0){\r\n\t\t\r\n\t\t\tAllleaps = Allleaps + 1;\r\n\t\t\tTrackYears.Leaps = Allleaps\r\n\t\t}\r\n\t\telse{\r\n\r\n\t\t\tAllNonLeaps = AllNonLeaps + 1;\r\n\t\t\tTrackYears.Nonleap = AllNonLeaps;\r\n\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\t\treturn TrackYears;\r\n}", "function getGrossIncome(annualSalary)\n{\n\treturn Math.round(annualSalary / 12);\n}", "function nbYear(p0, percent, aug, p) {\n let years = 0;\n let population = p0;\n const growthRate = percent / 100;\n while (population < p) {\n population += population*growthRate + aug;\n years++;\n }\n return years\n}", "function getYears(id) {\n for (var i = 0; i < peopleArray.length; i++) {\n if (peopleArray[i].id == id) {\n var today = new Date();\n var yearStarted = new Date(peopleArray[i].startDate);\n var years = today.getFullYear() - yearStarted.getFullYear();\n var m = today.getMonth() - yearStarted.getMonth();\n\n if (m < 0 || (m === 0 && today.getDate() < yearStarted.getDate())) {\n years--;\n }\n return years;\n }\n }\n return '404';\n}", "function avgAge(...parks) {\n let totalAge = 0;\n parks.forEach(park => totalAge += new Date().getFullYear() - park.builtYear);\n console.log(`Our ${parks.length} parks have an average age of ${(totalAge / parks.length).toFixed(2)} years.`)\n}", "function averageAgeByCentury() \n{\n\tlet cent = []\n\tlet avg = []\n\tlet c = 0\n\n\tfor (let i in ancestry)\n\t{\n\t\tc = Math.ceil(ancestry[i].died / 100)\n\t\tif(cent.hasOwnProperty(c) == false) \n\t\t{\n\t\t\tcent[c] = []\n\t\t}\n\t\tcent[c].push(ancestry[i].died - ancestry[i].born)\n }\n\n for(let i in cent)\n {\n \t\tavg[i] = average(cent[i])\n }\n\n return avg\n}", "function getYears () {\n var seconds = prompt(\"how many second?\");\n return((seconds/31536000).toFixed(5) + \" number of years\");\n }", "function leapYears(thisYear, counter) {\n while (counter >= 0) {\n if ((thisYear % 4 === 0) && (thisYear % 100 !== 0) || (thisYear % 400 === 0)) {\n console.log(thisYear);\n thisYear++;\n counter--;\n }\n else {\n thisYear++;\n }\n }\n}", "function calcAge1(birthYear) {\r\n // const age = 2021 - birthYear\r\n // return age\r\n return 2021 - birthYear;\r\n}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function bestYearAvg() {}", "function resetYears() {\n curYearRange = [1950, 2020];\n}", "function calcAge(year){\n console.log(2019 - year);\n}", "function groupByGrade(arr){\n arr.sort((x, y) => (x.grade > y.grade) ? 1 : -1)\n students = arr, \n keys = ['grade', 'name'], \n studentGrade = students.map(a => Object.assign(...keys.map(b=>({[b]: a[b]}))))\n return studentGrade\n}", "function averageAge(arr) {\n\n const currentAge = arr.map(cur => new Date().getFullYear() - cur.buildYear);\n\n function add(a, b) {\n return a + b;\n }\n\n const totalAge = currentAge.reduce(add, 0);\n const average = totalAge / arr.length;\n\n console.log(`Our ${arr.length} parks have an average age of ${average} years.`);\n}", "function CalculateYearToDays (year1, year2){\n var localOutput = 0;\n \n for (i = year1; i < year2; i++){\n if (IsItLeapYear(i)){\n localOutput += 366;\n }else if (inputYear = checkLeap){\n localOutput += 365;\n }\n else{\n localOutput += 365;\n }\n }\n \n return localOutput;\n}" ]
[ "0.61218965", "0.6102793", "0.6092263", "0.603932", "0.57204527", "0.5619973", "0.56011134", "0.559948", "0.5540842", "0.5533275", "0.5529206", "0.5501415", "0.55013776", "0.54887897", "0.54887897", "0.54887897", "0.54887897", "0.5476106", "0.54710215", "0.5446877", "0.5380455", "0.5371697", "0.5368984", "0.53624916", "0.5333782", "0.53306913", "0.5318721", "0.5315114", "0.53089005", "0.52796537", "0.52762854", "0.52640724", "0.5262756", "0.52464056", "0.5244339", "0.5239689", "0.52376187", "0.5229806", "0.5166313", "0.5160951", "0.5152031", "0.5145344", "0.5140466", "0.51385236", "0.51155704", "0.5114024", "0.508005", "0.50772625", "0.5068003", "0.50558317", "0.504701", "0.5045119", "0.50404054", "0.50298613", "0.5028448", "0.50218064", "0.5014477", "0.5010211", "0.50039595", "0.500135", "0.49978748", "0.49916938", "0.49877292", "0.4972759", "0.4969085", "0.4964817", "0.49603406", "0.49439344", "0.49428824", "0.49419904", "0.49382055", "0.49348074", "0.4929031", "0.4925946", "0.49155617", "0.49143854", "0.49103117", "0.48764697", "0.48703814", "0.48628104", "0.48607078", "0.485531", "0.4850111", "0.484077", "0.48344058", "0.48212987", "0.48202825", "0.48187664", "0.48070723", "0.48070723", "0.48070723", "0.48070723", "0.48070723", "0.48070723", "0.48070723", "0.48065507", "0.4803267", "0.480173", "0.4800246", "0.47973168" ]
0.6252792
0
Show the Salary Explore page.
function showExplorePage() { // show the pagination document.getElementById("page").style.display = ""; // show "Explore Salary Data" text let resultsDisplay = document.getElementById("results"); resultsDisplay.innerHTML = "<h4 class='mt-3'>Explore Salary Data (From High to Low)</h4>"; // sort salary data of people const data = Object.values(people).sort((a, b) => { let aLatest = Object.keys(a).reduce((a, b) => Math.max(a, b)); let bLatest = Object.keys(b).reduce((a, b) => Math.max(a, b)); return b[bLatest][YTD_GROSS_EARNINGS] - a[aLatest][YTD_GROSS_EARNINGS]; }); // show first page of results showResults(data.slice(0, PAGE_SIZE)); // setup pagination $("#page").pagination({ items: data.length, prevText: '<span aria-hidden="true">&laquo;</span>', nextText: '<span aria-hidden="true">&raquo;</span>', itemsOnPage: 10, onPageClick: function(page, event) { event.preventDefault(); clearResults(); showResults(data.slice((page - 1) * PAGE_SIZE, page * PAGE_SIZE)); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSalary() {\n hourlyEntry.style.display = \"none\";\n salaryEntry.style.display = \"grid\";\n commissionEntry.style.display = \"none\";\n }", "function viewEmployees() {\n connection.query(\"SELECT * FROM employee\", function(error, results) {\n if (error) throw error;\n\n // This shows the results in a nice table in the CLI\n console.table(results);\n\n // Goes back to the main menu.\n start();\n })\n}", "function employeeView() {\n let query = \"SELECT * FROM employee\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.table(res);\n // result is then shown in the console.table\n runMenu();\n });\n}", "viewSalary(results) {\n return connection.query(`SELECT ed.dept_name, sum(er.salary) as total_salary\n FROM employees_db.employee as ee\n LEFT JOIN employees_db.role as er\n ON ee.role_id = er.id\n LEFT JOIN employees_db.department as ed\n ON er.department_id = ed.id\n LEFT JOIN employees_db.employee as em\n on ee.manager_id = em.id\n WHERE ed.id = ?`,\n [results.deptId]\n )\n }", "viewInvidualSalarytable(adr) {\n\t\tconst query = `\n\t\tSELECT \t\n\t\t(CONCAT(s2.first_name, ' ', s2.last_name)) AS staff_name,\n\t\tstaffrole.title,staffrole.salary\n\t\tFROM employee As S1\n\t\tRight JOIN employee as S2 on (S1.id = S2.manager_id)\n\t\tLEFT JOIN staffrole on (S2.role_id = staffrole.id)\n\t\tLEFT JOIN department on (staffrole.department_id = department.id)\n\t\tWHERE department.id = ?\n\t\t`;\n\t\treturn this.connection.query(query, [adr]);\n\t}", "function viewSupervisor() {\n console.log('\\nWelcome to Bamazon Supervisor View\\n');\n inquirer.prompt([\n {\n type: 'list',\n name: 'menuSuper',\n message: 'Menu of Options',\n choices: ['View Product Sales by Department', 'Create New Department']\n }\n ])\n .then(answer => {\n // If menu option then display\n switch (answer.menuSuper) {\n case 'View Product Sales by Department':\n return displayProductsByDept();\n case 'Create New Department':\n return createNewDept();\n }\n });\n}", "function viewEmployees() {\n db.query('SELECT * FROM employee', function (err, results) {\n console.table(results);\n goPrompt();\n });\n}", "viewDepartmentSalary() {\n // collect department info\n inquirer.prompt([\n questions.functions.deptId\n ])\n // send results to view salary function\n .then((results) => {\n dbFunctions.viewSalary(results)\n .then((results) => {\n console.table(results)\n startManagement()\n })\n\n })\n }", "function viewEmployee() {\n console.log(\"Viewing all employees\\n\");\n\n var results=connection.query\n (\"SELECT employee.id, employee.first_name, employee.last_name, role.title, department_id AS department, role.salary, employee.manager_id FROM employee, role where employee.role_id = role.id ;\",\n function(error,results)\n {\n\n if(error) throw error;\n\n \n console.table(results)\n console.log(\" All Employees \\n\");\n mainMenu();\n \n })\n\n }", "function viewEmployees() {\n connection.query(\"SELECT * FROM employee\", function(err, results) {\n if (err) throw err;\n // show results in table format\n console.table(results);\n // console.log(results);\n // re-prompt the user for further actions by calling \"start\" function\n start();\n });\n}", "function viewEmp() {\n db.displayEmployeeData()\n .then(([data]) => {\n console.log(`${separator}${separator}\\n EMPLOYEES\\n${separator}${separator}`);\n console.table(data);\n console.log(`${separator}\\n`);\n })\n .then(() => {\n promptAction();\n })\n}", "function viewDeptSales() {\n salesByDept();\n}", "function viewEmployees() {\n connection.query(\n \"SELECT employee.id, first_name, last_name, roles.title, department.name AS department, roles.salary FROM employee INNER JOIN roles ON employee.role_id = roles.role_id INNER JOIN department ON roles.department_id = department.department_id\",\n (err, results) => {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(results);\n console.log(\"===============================\");\n console.log(\"\\n \\n \\n \\n \\n \\n \\n\");\n }\n );\n // RETURN TO MAIN LIST\n runTracker();\n}", "function showAllExercisesPage(){\n showExercisesPage(exercises, '/exercises');\n}", "viewJobSalarytable(adr) {\n\t\tconst query = `\n\t\tSELECT \t\n\t\tstaffrole.title,sum(staffrole.salary)\n\t\tFROM employee As S1\n\t\tRight JOIN employee as S2 on (S1.id = S2.manager_id)\n\t\tLEFT JOIN staffrole on (S2.role_id = staffrole.id)\n\t\tLEFT JOIN department on (staffrole.department_id = department.id)\n\t\tWHERE department.id = ?\n group by staffrole.title\n\t\t`;\n\t\treturn this.connection.query(query, [adr]);\n\t}", "function viewEmployees() {\n \n const query = `SELECT first_name, last_name, title FROM employee LEFT JOIN role ON role.id = employee.role_id`;\n\n\tconnection.query(query, function(err, res) {\n\t\tif (err) throw err;\n \n console.table(res);\n\n\t\tstart();\n\t});\n}", "function viewEmployees() {\n connection.query(\"SELECT first_name, last_name, title, salary, manager_id FROM employee JOIN role ON employee.role_id = role.id\", (err, result) => {\n if (err) {\n throw err;\n } else {\n console.table(result);\n beginApp();\n }\n });\n}", "function seeEmployees(){\n \n db.viewAllEmployees().then( ([res]) => {\n console.table(res)\n loadMainPrompt();\n }) \n}", "function salaryModal(name, sals) {\n\t$('#currEmployee').text(\" \" + name);\n\n\t$('#salModal .modal-body').append(createSalaryTable(sals, [\"Salary ($)\", \"Pay Period Start\", \"Pay Period End\"]));\n\n\t$('#salModal').show().modal('show')\n}", "function viewEmpls() {\n connection.query(\"SELECT * FROM employee\", (err, results) => {\n if (err) throw err\n console.table(results)\n action()\n })\n}", "function viewFullProfile() {\n history.push('/supported-employees/'+employee.id)\n }", "function viewSales() {\n\tvar joinQuery = \"SELECT department_id, departments.department_name, over_head_costs,\"\n\t\t+ \" SUM(product_sales) AS product_sales,\" \n\t\t+ \" SUM(product_sales) - over_head_costs AS total_profit \";\n\tjoinQuery += \"FROM departments INNER JOIN products \";\n\tjoinQuery += \"ON departments.department_name = products.department_name \";\n\tjoinQuery += \"GROUP BY department_id \";\n\n\tconnection.query(joinQuery, function(error, results) {\n\t\tif (error) throw error;\n\t\tconsoleTableProfit(\"\\nDepartmental Profit\", results);\n\t\twelcome();\n\t});\n}", "function viewEmps() {\n let query = `SELECT e.id AS \"ID\", e.first_name AS \"FIRST NAME\", e.last_name AS \"LAST NAME\", \nr.title AS \"ROLE\", d.name AS \"DEPARTMENT\", r.salary AS \"SALARY\", \n(select concat(emp.first_name,' ',emp.last_name) from employee as emp where e.manager_id = emp.id) AS \"MANAGER\"\nFROM employee e \nLEFT JOIN role r ON e.role_id=r.id\nLEFT JOIN department d ON r.department_id = d.id;`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n printTable(res);\n CMS();\n });\n}", "function viewEmp() {\n connection.query(\n \"SELECT employee.id,first_name,last_name,manager,title,salary,department FROM employee JOIN role ON employee.role_id = role.id JOIN department ON role.department_id = department.id\",\n function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n }\n );\n}", "function viewEmployee() {\n\n var query =\n `SELECT e.id, e.first_name, e.last_name, r.title, d.name AS department, r.salary, CONCAT(m.first_name, ' ', m.last_name) AS manager\n FROM employee e\n LEFT JOIN roles r\n ON e.roles_id = r.id\n LEFT JOIN department d\n ON d.id = r.department_id\n LEFT JOIN employee m\n ON m.id = e.manager_id`\n \n connection.query(query, function (err, res) {\n if (err) throw err;\n \n console.table(res); \n init(); \n \n });\n }", "function viewEmployees() {\n // select from the db\n let query = \"SELECT * FROM employee\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.table(res);\n startPrompt();\n });\n \n}", "viewAllSalarySum(adr) {\n\t\tconst query = `\n\t\tselect sum(staffrole.salary) as salary_total\n\t\tfrom employee\n\t\tLEFT JOIN staffrole on (employee.role_id = staffrole.id)\n\t\tLEFT JOIN department on (staffrole.department_id = department.id)\n\t\t`;\n\t\treturn this.connection.query(query, [adr]);\n\t}", "function showEarnings(){\n\t$(\"#earnings_credentials\").hide();\n\t$(\"#earnings_container\").show();\n\tgetEarnings();\n\t\n}", "function show() {\n\tapp.getView().render('content/folder/customerserviceaboutus');\n}", "function directUserFromViewInfo() {\n if (nextStep == \"Departments\") {\n viewDepartments();\n }\n if (nextStep == \"Roles\") {\n viewRoles();\n }\n if (nextStep == \"Employees\") {\n viewEmployees();\n }\n if (nextStep == \"All Information\") {\n viewAll();\n } \n }", "function viewDepartmentExpenses() {\n const departments = [];\n connection.query(\n \"SELECT department.name as department FROM department\",\n (err, res) => {\n if (err) throw err;\n res.forEach((department) => {\n departments.push(department.department);\n });\n inquirer\n .prompt({\n type: \"list\",\n message: \"What Departments Budget would you like to view?\",\n name: \"name\",\n choices: departments,\n })\n .then((res) => {\n let department = res.name;\n connection.query(\n \"SELECT SUM(role.salary) as Total FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department ON role.department_id = department.id WHERE department.name = ?\",\n res.name,\n (err, res) => {\n if (err) throw err;\n console.log(\n `The Total Expenses of The ${department} is $${res[0].Total}`\n );\n baseQuestions();\n }\n );\n });\n }\n );\n}", "async function viewEmployees() {\n clear();\n const employees = await connection.query(employeesSQL + \";\");\n\n log(\"\\n\");\n log(inverse(\"Viewing All Employees\"));\n console.table(employees);\n mainMenu();\n}", "async function viewEmployees() {\n const employeeList = await db.obtainAllEmployees();\n\n console.log(`\\nTASK: VIEW ALL EMPLOYEES\\n`);\n console.table(employeeList);\n\n displayMenus();\n}", "async function viewByRole() {\n clear();\n log(\"Viewing Employees By Role\");\n\n const roles = await connection.query(\"SELECT * FROM role\");\n const roleOptions = roles.map(({ id, title }) => ({\n name: title,\n value: id,\n }));\n\n const { userRoleId } = await inquirer.prompt([\n {\n type: \"list\",\n message: \"Which role would you like to view?\",\n name: \"userRoleId\",\n choices: roleOptions,\n },\n ]);\n\n const employees = await connection.query(\n employeesSQL + \" WHERE role.id = ?;\", userRoleId\n );\n\n log(\"\\n\");\n console.table(employees);\n mainMenu();\n}", "function viewAllEmployees() {\n db.query(employeeQuery, function (err, res) {\n if (err) throw err;\n console.log(\n \"---------------------------------------------------------------------------------------------------------------------------------------\"\n );\n console.table(res);\n console.log(\n \"---------------------------------------------------------------------------------------------------------------------------------------\"\n );\n start();\n });\n}", "function viewDepartmentBudget() {\n console.log(\"Selecting all departments...\\n\");\n connection.query(\"SELECT SUM(salary),department.name FROM role JOIN department ON role.department_id = department.id GROUP BY role.department_id;\", function (err, resDep) {\n if (err) throw err;\n console.table(resDep);\n mainPrompt()\n });\n}", "function viewSaleProduct() {\n connection.query(\"SELECT * FROM store\", function (err, results) {\n if (err) throw err;\n console.table(results);\n })\n}", "function departmentView() {\n let query = \"SELECT * FROM department\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.table(res);\n // result is then shown in the console.table\n runMenu();\n });\n}", "function viewEmployees() {\n var query = \"SELECT CONCAT(employees.first_name, ' ', employees.last_name) as employee_name, roles.title, departments.name, employees.id FROM employees LEFT JOIN roles on employees.role_id = roles.id LEFT JOIN departments ON departments.id = roles.department_id \";\n con.query(query, function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\" + \"|| Employee: \" + res[i].employee_name + \"|| Title: \" + res[i].title + \"|| Department: \" + res[i].name + \"|| ID: \" + res[i].id);\n }\n runManager();\n });\n }", "function View() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"view\",\n message: \"what would you like to view?\",\n choices: [\"Department\", \"Role\", \"Employee\", \"Back\"],\n },\n ])\n .then((res) => {\n switch (res.view) {\n case \"Department\":\n console.log(\"VIEW department function goes here\");\n viewDept();\n break;\n case \"Role\":\n console.log(\"View role function goes here\");\n viewRole();\n break;\n case \"Employee\":\n viewEmployee();\n break;\n case \"Back\":\n initPrompt();\n break;\n }\n });\n}", "function viewEmpByMngr() {\n const query = `\n SELECT\n employee.id AS EmployeeID,\n CONCAT(employee.first_name, \" \", employee.last_name) AS EmployeeName,\n role.title AS Role,\n department.name AS Department,\n CONCAT(manager.first_name, \" \", manager.last_name) AS Manager \n FROM employee\n LEFT JOIN employee manager \n ON manager.id = employee.manager_id\n INNER JOIN role \n ON (role.id = employee.role_id && employee.manager_id != 'NULL')\n INNER JOIN department \n ON (department.id = role.department_id)\n ORDER BY manager;`\n db.query(query, (err, response) => {\n if (err) { \n throw(err);\n return;\n }\n console.log(``);\n console.log(chalk.white.bold(`============================================================================================================`));\n console.log(` ` +chalk.white.bold(` Employee by Manager `));\n console.log(chalk.white.bold(`============================================================================================================`));\n console.table(response);\n console.log(chalk.white.bold(`============================================================================================================`));\n });\n init();\n}", "viewEmployees() {\n console.log(`\n\n * Viewing All Employees *\n `)\n connection.query(`SELECT employees.id, employees.first_name, employees.last_name, roles.title AS role, roles.salary AS salary, departments.name AS department, CONCAT(m.first_name, ' ', m.last_name) AS manager FROM employees LEFT JOIN roles ON employees.role_id = roles.id LEFT JOIN departments ON roles.department_id = departments.id LEFT JOIN employees m ON employees.manager_id = m.id;`, function(err, res) {\n if (err) throw err;\n console.table(res);\n beginAgain();\n })\n }", "function viewEmployees() {\n connection.query(\"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS department, role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS Manager FROM employee LEFT JOIN employee manager on manager.id = employee.manager_id INNER JOIN role ON (role.id = employee.role_id) INNER JOIN department ON (department.id = role.department_id)\", function(err, res) {\n if(err) throw err;\n console.log(\"Employees:\")\n console.table(res)\n start();\n });\n}", "viewDeptSalarySum(adr) {\n\t\tconst query = `\n\t\tselect department.name,sum(staffrole.salary) as salary_total\n\t\tfrom employee\n\t\tLEFT JOIN staffrole on (employee.role_id = staffrole.id)\n\t\tLEFT JOIN department on (staffrole.department_id = department.id)\n\t\twhere department.id = ?\n\t\t`;\n\t\treturn this.connection.query(query, [adr]);\n\t}", "function loadEmployeeView() {\n\tlet xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function(){ \n \tif((xhr.readyState == 4) && (xhr.status == 200)) {\n \t\t$('#view').html(xhr.responseText);\n \t\trefreshCount();\n \t\tloadReimbursementList();\n \t\tpopulateTypeDropDown('type-dropdown');\n \t\tpopulateRequestOff();\n \t}\n }\n \n xhr.open(\"GET\", 'employee.view', true);\n xhr.send();\n}", "function displayExpensesOverview(e) {\n\n var expansesTable = \"\";\n\n db.transaction([\"Expenses\"], \"readonly\").objectStore(\"Expenses\").openCursor().onsuccess = function(e) {\n var cursor = e.target.result;\n if(cursor) {\n expansesTable += \"<tr>\";\n expansesTable += \"<td>\"+cursor.key+\"</td>\";\n for(var key in cursor.value) {\n expansesTable += \"<td>\" + cursor.value[key] + \"</td>\";\n }\n expansesTable += \"</tr>\";\n cursor.continue();\n }\n document.querySelector(\"tbody\").innerHTML = expansesTable;\n }\n}", "async function viewEmployees() {\n return inquirer\n .prompt([\n {\n type: 'list',\n message: 'What would you like to do?',\n name: 'userChoice',\n choices: [\n 'View all Employees',\n 'View Employee by Manager',\n 'View Employee by Department',\n 'Go back'\n ]\n }\n ])\n .then(choice => {\n switch (choice.userChoice) {\n case 'View all Employees':\n console.log('Viewing all Employees');\n viewAllEmployees();\n break;\n case 'View Employee by Manager':\n console.log('Viewing Employees by Manager');\n viewEmployeesByManager();\n break;\n case 'View Employee by Department':\n console.log('Viewing Employees by Department');\n viewEmployeesByDepartment();\n break;\n case 'Go back':\n startingPrompt();\n break;\n }\n });\n}", "function viewEmployees() {\n console.log('~~~~~~~~~~ All Employees ~~~~~~~~~~')\n const query = `SELECT employees.id, employees.first_name as 'first name', employees.last_name as 'last name', \n roles.title, departments.name as department, roles.salary, \n concat(m.first_name, ' ', m.last_name) as manager \n FROM employees \n INNER JOIN roles ON employees.role_id = roles.id\n INNER JOIN departments ON roles.department_id = departments.id \n LEFT JOIN employees m ON m.id = employees.manager_id`;\n\n db.promise().query(query)\n .then((results) => {\n console.table(results[0])\n })\n .catch('error getting the rows')\n .then(() => {\n menu();\n })\n}", "function showEmployees() {\n console.log(employees)\n}", "viewAllEmployees() {\n\t\treturn this.connection.query(\n\t\t\t`\n SELECT\n e1.id AS ID,\n e1.first_name AS First_Name,\n e1.last_name AS Last_Name,\n role.title AS Role,\n department.name AS Department,\n CONCAT(e2.first_name, ' ', e2.last_name) AS Manager,\n role.salary AS Salary\n FROM\n employee e1\n LEFT JOIN\n role ON e1.role_id = role.id\n LEFT JOIN\n employee e2 ON e1.manager_id = e2.id\n\t\t LEFT JOIN department ON role.department_id = department.id\n\t\t ORDER BY\n e1.id;\n `\n\t\t);\n }", "function showHseSkill(branch, generation) {\n var hseStudents = document.querySelector('.skill-students');\n hseStudents.textContent = hseSkills(branch, generation);\n var percentageHseStudents = document.querySelector('.percentage-skill-students');\n percentageHseStudents.textContent = percentageHseSkills(branch, generation);\n }", "viewAllDeptSalarySum(adr) {\n\t\tconst query = `\n\t\tselect department.name,sum(staffrole.salary) as total_salary\n\t\tfrom employee\n\t\tLEFT JOIN staffrole on (employee.role_id = staffrole.id)\n\t\tLEFT JOIN department on (staffrole.department_id = department.id)\n\t\tgroup by department.name\n\t\t`;\n\t\treturn this.connection.query(query, [adr]);\n\t}", "function view () {\n $('div.employeeList').removeClass('hidden');\n // $('form.addForm').addClass('hidden');\n var forms = document.querySelectorAll('form');\n if (forms[0] != undefined) {\n document.body.removeChild(forms[0]);\n }\n toggleActive('View');\n}", "function displayAllEmployees() {\n return connection.query(viewCommand);\n}", "function Inventory () {\n \n return (\n <div>\n <h2> This is the Inventory page</h2>\n </div>\n )\n}", "async function viewEmployees() {\n const employees = await db.findAllEmployees();\n\n console.log(\"\\n\");\n console.table(employees);\n startPrompt();\n}", "function openTermsOfUse() {\n\t\t\t$window.open('/CustPortal/terms_of_service.html', 'Terms Of Service', 'scrollbars=yes,width=1000,height=700');\n\t\t}", "function openSesame(){\r\n window.open(\"add-employee.html\", \"_blank\");\r\n }", "function salesman(name1, age2){\n\tthis.name = name1;\n\tthis.age = age2;\n\tthis.showDetails=function(){\n\t\treturn this.name + \":\" + this.age;\n\t};\n}", "function viewEmployees(){\n // Select all data from the departmenets table\n connection.query(`SELECT * FROM employee_table`, (err, res) => {\n // If error log error\n if (err) throw err;\n // Display the data in a table format...\n console.table(res);\n // Run the task completed function\n taskComplete();\n })\n }", "function viewInfoPrompt () {\n return inquirer.prompt ([\n {\n type: \"list\",\n name: \"itemToView\",\n message: \"What would you like to view?\",\n choices: [\n \"Departments\", \n \"Roles\",\n \"Employees\",\n \"All Information\"\n ]\n }\n ])\n\n }", "function viewAllEmployees() {\n connection.query(\n 'SELECT e.id, e.first_name AS First_Name, e.last_name AS Last_Name, title AS Title, salary AS Salary, name AS Department, CONCAT(m.first_name, \" \", m.last_name) AS Manager FROM employee e LEFT JOIN employee m ON e.manager_id = m.id INNER JOIN role r ON e.role_id = r.id INNER JOIN department d ON r.department_id = d.id',\n function (err, res) {\n if (err) throw err;\n console.table(\"All Employees:\", res);\n init();\n }\n );\n}", "function showUsagePage(data) {\n /*Store usage data in session storage, so it can be retrieved by the usage page, then navigate there. */\n sessionStorage.setItem(\"simyoUsageData\", JSON.stringify(data));\n document.location = \"usage.html\";\n}", "function viewEmployee() {\n connection.query(\"SELECT * FROM employee_db.employee\", function (error, data) {\n console.table(data)\n init()\n })\n}", "function SalesUpGratis(){\n tb_show('SalesUp! Gratis', 'salesupgratis.dbsp?keepThis=false&TB_iframe=true&height=280&width=750', '');\n }", "async function viewEmployeesByDepartment() {\n const\n departmentNames = await departments.getNamesAll(),\n {departmentName} = await inquirer.prompt([\n {\n type: \"list\",\n message: \"Which department's employees would you like to view?\",\n choices: departmentNames,\n name: \"departmentName\"\n }\n ])\n \n const departmentTable = await employees.getTableByDepartment(departmentName)\n\n if (departmentTable.length) {\n showTable(departmentTable)\n } else {\n showMessage(`No employees in ${departmentName} department.`)\n promptMainMenu()\n }\n}", "function showTrade() {\n clearErrorMsg();\n showLinks(['logoutLink', 'transferLink', 'portfolioLink']);\n showView('tradeForm');\n}", "function viewEmpByRole() {\n const sql = `\n SELECT \n employee.id AS EmployeeID, \n CONCAT(employee.first_name, \" \", employee.last_name) AS EmployeeName, \n role.title AS Role\n FROM employee\n LEFT JOIN role \n ON employee.role_id = role.id\n ORDER BY role.id;`\n db.query(sql, (err, response) => {\n if (err) {\n throw(err);\n return;\n }\n console.log(``);\n console.log(chalk.white.bold(`============================================================================================================`));\n console.log(` ` +chalk.white.bold(` Employee by Role `));\n console.log(chalk.white.bold(`============================================================================================================`));\n console.table(response);\n console.log(chalk.white.bold(`============================================================================================================`));\n });\n init();\n}", "function showDalcAndWalc() {\n\n\t// calculate the average workday and weekend alcohol \n\t// consumption arrays for each age\n\tvar avgDalcConsumption = calculateAvgOf(\"Dalc\"),\n\t\tavgWalcConsumption = calculateAvgOf(\"Walc\");\n\n\t// we give \"dalcWalcLabel\" to both lines so that we can remove them together\n\tshowLine(avgDalcConsumption, \"avgDalcLine\");\n \taddPointsToLine(avgDalcConsumption, \"dalcWalc\");\t\t\t\n \taddLabelToLine(avgDalcConsumption, \"Workday Average\", \"dalcWalcLabel\");\n\n \tshowLine(avgWalcConsumption, \"avgWalcLine\");\n \taddPointsToLine(avgWalcConsumption, \"dalcWalc\");\t\t\t\n \taddLabelToLine(avgWalcConsumption, \"Weekend Average\", \"dalcWalcLabel\");\n}", "get salary(){return this._salary}", "function showHourly() {\n hourlyEntry.style.display = \"grid\";\n salaryEntry.style.display = \"none\";\n commissionEntry.style.display = \"none\";\n }", "function showMainPage(){\n\t\t\t$(\"#loginDiv\").addClass(\"analyst-login-div-hide\");\n\t\t\t$(\"#analystMainPage\").removeClass(\"analys-main-page-hide\");\n\t\t\tpopulateAllDocs();\n\t\t}", "function viewRoles(index) {\n \n console.log('Displaying employee roles:');\n db.query(`SELECT roles.id, title, salary, dept_name FROM roles\n LEFT JOIN departments ON dept_id = departments.id`,\n function (err, res) {\n if (err) {\n console.log('error: ', err);\n }\n console.table(res)\n index();\n });\n}", "function viewAllEmployees() {\n const sql = `\n SELECT \n employee.id AS ID,\n employee.first_name AS FirstName, \n employee.last_name AS LastName, \n role.title AS Title, \n role.salary AS Salary, \n department.name AS Department, \n CONCAT(manager.first_name, \" \", manager.last_name) AS Manager\n FROM employee\n LEFT JOIN role \n ON employee.role_id = role.id\n LEFT JOIN department \n ON role.department_id = department.id\n LEFT JOIN employee AS manager\n ON employee.manager_id = manager.id\n ORDER BY employee.id;`\n db.query(sql, (err, response) => {\n if (err) {\n throw(err);\n return;\n }\n console.log(``);\n console.log(chalk.white.bold(`============================================================================================================`));\n console.log(` ` +chalk.white.bold(` Employees `));\n console.log(chalk.white.bold(`============================================================================================================`));\n console.table(response);\n console.log(chalk.white.bold(`============================================================================================================`));\n });\n init();\n}", "function showPurchases() {\n app.getView().render('account/giftregistry/purchases');\n}", "function showSLASummary() {\n\tvar grid = View.panels.get('slaList');\n\tView.controllers.get(0).trigger('app:operation:express:sla:showSLASummaryPopUp',\n\t\t\tgrid.rows[grid.selectedRowIndex].row);\n}", "function viewEmp(){\n connection.query(`\n SELECT e.first_name FirstName, e.last_name LastName, d.name Department, r.title JobTitle, r.salary Salary, e.id EmpID, e.manager_id Manager\n FROM employee e\n LEFT JOIN role r on (e.role_id = r.id)\n LEFT JOIN department d on (r.department_id = d.id)\n LEFT JOIN employee m on (e.manager_id = m.id)\n ORDER BY e.first_name,e.last_name,d.name,r.title;`,(err, results)=>{\n if(err)throw err;\n console.table(results);\n renderAction()\n })\n}", "function schoolListSalaryCallBack(res){\n let pageContent = `\n <h3 class='pb-3 text-center'>SCHOOL PAYROLL LIST</h3>\n ${page.schoolsSalaryTable(res)}\n `;\n document.querySelector('main').innerHTML = pageContent;\n schoolPayrollBtnInit();\n monthSelectFxn();\n schoolReportBtnInit();\n return pageContent;\n}", "function goToEmployeeDetail(event)\n{\n\twindow.location.assign(\"/employeeDetail/\");\n}", "function viewAllRole() {\n connection.query(`SELECT title, salary FROM employee_tracker_db.role;`,\n function(err, res) {\n if (err) throw err;\n console.log(\"\\n\");\n // Log all results of the SELECT statement\n console.table(res);\n //go back to inital\n initialQuestion();\n });\n}", "function open_OxOst_site()\n{\n location.href = \"../../Oxfords/OxfordOst/Overview.html\";\n}", "async function viewEmployeesByManager() {\n const\n managerList = await employees.getListManagers(),\n {managerId} = await inquirer.prompt([\n {\n type: \"list\",\n message: \"Which manager's employees would you like to view?\",\n choices: managerList,\n name: \"managerId\"\n }\n ])\n\n showTable(await employees.getTableByManager(managerId))\n}", "onlyTheSalary() {\r\n return `${this.dayRate * this.workingDays * this.#showExp}`\r\n }", "function viewSales() {\n var URL=\"select d.department_id,d.department_name,d.over_head_costs,sum(p.product_sales)as product_sales,d.over_head_costs-p.product_sales as total_profit \";\n URL+=\"from departments d ,products p \";\n URL+=\"where d.department_name=p.department_name Group by p.department_name;\";\n connection.query(URL, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n start();\n });\n}", "function viewInformation() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n Message: \"WHAT INFORMATION WOULD YOU LIKE TO DISPLAY?\",\n choices: [\"VIEW department\", \"VIEW role\", \"VIEW employee\"],\n })\n //==================IF YOU WANT TO VIEW THE DEPARTMENT===========\n .then(function (answer) {\n switch (answer.action) {\n case \"VIEW department\":\n viewDepartment();\n break;\n //========IF YOU WANT TO VIEW THE ROLE=============\n case \"VIEW role\":\n viewRole();\n break;\n //========IF YOU WANT TO VIEW THE EMPLOYEE===========\n case \"VIEW employee\":\n viewEmployee();\n break;\n }\n });\n}", "editWorkAndEducation(){\n\t\tresources.workAndEducationTab().click();\n\t}", "function viewBudget() {\n connection.query(\n \"SELECT name as DeptName, SUM(salary) as DeptBudget FROM roles INNER JOIN department ON roles.department_id = department.deptid GROUP BY name\",\n function (err, res) {\n if (err) throw err;\n console.table(res)\n reroute();\n })\n}", "async function viewEmployeesByManager() {\n const managers = await db.findAllEmployees();\n const managerChoices = managers.map(function ({\n id,\n first_name,\n last_name\n }) {\n return ({\n name: `${first_name} ${last_name}`,\n value: id\n });\n });\n const {\n managerId\n } = await prompt([{\n type: \"list\",\n name: \"managerId\",\n message: \"Which employee do you want to see direct reports for?\",\n choices: managerChoices\n }]);\n const employees = await db.findAllEmployeesByManager(managerId);\n console.log(\"\\n\");\n if (employees.length === 0) {\n console.log(\"The selected employee has no direct reports\");\n } else {\n console.table(employees);\n }\n startPrompt();\n}", "function viewTransactionSummary(transaction_id, transaction_type) {\n\tif (null != transaction_id && \"\" != transaction_id && \"-- Select a transaction --\" != transaction_id) {\n\t\twindow.location = \"view-entries?id=\" + transaction_id + \"&transaction_type=\" + transaction_type;\n\t} else {\n\t\talert('Please select a transaction.');\n\t}\n}", "function Salad() {\n this.size = 0;\n this.additions = 0;\n this.deliveryfee = 0;\n this.totalcost = 0;\n this.type = \"Salad\";\n}", "function Ranking_pageshow() {\n\ttry {\n\t\t// Grab some users and display them.\n\t\tdrupalgap.views_datasource.call({\n\t\t\t'path': 'drupalgap/views_datasource/padel_ranking',\n\t\t\t'success': function(data) {\n\t\t\t\t// Extract the users into items, then drop them in the list.\n\t\t\t\tvar rows = [];\n\t\t\t\tvar rank = 0;\n\t\t\t\t$.each(data.ranking, function(index, object) {\n\t\t\t\t\trank = rank + 1;\n\t\t\t\t\tvar pos = object.position;\n\t\t\t\t\trows.push([rank, \n\t\t\t\t\t l(pos.team,\"leage/matches/?team=\" + pos.team), \n\t\t\t\t\t pos.Jugados, pos.Ganados, pos.Perdidos, pos.SetsFavor, pos.SetsContra]);\n\n\t\t\t\t});\n\t\t\t\tdrupalgap_table_populate('#Ranking_list', rows);\n\t\t\t}\n\t\t});\n\t\tconsole.log( $('#Ranking_list').html());\n\t}\n\tcatch (error) { console.log('Ranking_pageshow - ' + error); }\n}", "getSalary() {\n return this.salary;\n }", "function viewDepartmnt() {\n \n connection.query(\" SELECT * FROM department \", function (error, result) \n {\n if (error) throw error;\n console.table(result);\n mainMenu()\n\n });\n\n }", "function showEmployees() {\n //query consult select\n connection.query(`SELECT employee.id, employee.first_name,employee.last_name,role.title AS job_title,role.salary,\n CONCAT(manager.first_name ,\" \", manager.last_name) AS Manager FROM employee LEFT JOIN role ON employee.role_id=role.id LEFT JOIN employee manager ON manager.id = employee.manager_id`, (err, res) => {\n \n \n if (err) throw err;\n \n if (res.length > 0) {\n console.log('\\n')\n console.log('** Employees **')\n console.log('\\n')\n console.table(res);\n }\n //calls the menu to display the question again\n menu();\n });\n \n }", "async function loadMealPlanPage() {\n cleanUp();\n // show($mealPlan);\n drawMealPlanTable();\n setColorBgForMealPlanTable();\n await fillMealPlanTable();\n\n }", "function viewEmp() {\n connection.query(\n `\n SELECT\n employee.id AS 'Employee ID', \n employee.first_name AS 'First Name', \n employee.last_name AS 'Last Name', \n role.title AS 'Position', \n role.salary AS 'Salary', \n department.name AS 'Department'\n FROM employee\n LEFT JOIN role\n ON employee.role_id = role.id\n LEFT JOIN department\n ON role.department_id = department.id;\n `\n , function (error, res) {\n console.table(res);\n mainMenu();\n }\n );\n}", "function learn() {\n\twindow.open(\"http://nationalsocialanxietycenter.com/resources/\", \"_blank\");\n}", "function viewAllRoles(conn, start) {\n conn.query(`SELECT\tr.id ID, r.title Title, d.name Department, \n LPAD(CONCAT('$ ', FORMAT(r.salary, 0)), 12, ' ') Salary\n FROM\trole r\n LEFT JOIN department d on d.id = r.department_id\n ORDER BY r.title;`, function(err, results) {\n if (err) throw err;\n console.table(results);\n start();\n });\n }", "function viewAllEmployees() {\n const query = \"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.department_name AS department, role.salary FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department on role.department_id = department.id\";\n db.query(query, function (err, res) {\n console.table(res);\n startTracker();\n });\n}", "function viewAllEmployees() {\n connection.query(\"SELECT * FROM employee\", function (err, results) {\n if (err) throw err;\n console.log(\"----------------------------------------------------------------------\")\n console.table(results)\n userInput()\n });\n}" ]
[ "0.6180199", "0.58031374", "0.5794141", "0.5714532", "0.56359076", "0.56145453", "0.55778146", "0.55285794", "0.5525259", "0.5517379", "0.54681194", "0.54566485", "0.5444847", "0.5389511", "0.5360305", "0.53571486", "0.53136885", "0.5298541", "0.5282933", "0.52591884", "0.5245534", "0.5240427", "0.52323383", "0.52285075", "0.5223068", "0.52034044", "0.51951796", "0.51931936", "0.5169662", "0.51310337", "0.5126905", "0.5119007", "0.5101942", "0.5097853", "0.5083668", "0.5083546", "0.50616676", "0.50591636", "0.503436", "0.5022057", "0.5019393", "0.50072724", "0.50013196", "0.49896646", "0.49862143", "0.4986078", "0.4975936", "0.49683926", "0.4963846", "0.4955044", "0.4949526", "0.49475682", "0.49412316", "0.49403596", "0.4934532", "0.49340925", "0.4931054", "0.4929218", "0.49287784", "0.49283698", "0.4919811", "0.49187535", "0.49168047", "0.49134287", "0.4904011", "0.48989788", "0.4882777", "0.48826867", "0.48776177", "0.48751438", "0.4867072", "0.48662055", "0.48622933", "0.48560014", "0.48500973", "0.48487037", "0.48450807", "0.484338", "0.48377612", "0.48343247", "0.48337337", "0.48336136", "0.48317426", "0.48316756", "0.48260102", "0.48215732", "0.48168635", "0.48164466", "0.48022956", "0.4797475", "0.47947294", "0.47928244", "0.47927925", "0.47889426", "0.47861865", "0.47821298", "0.47778112", "0.47774023", "0.47769275", "0.47697788" ]
0.58868617
1
Clear the results view.
function clearResults() { document.getElementById("results").innerHTML = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearResults() {\n\t\t// Re-display loading icons\n\t\tdocument.getElementById(\"loadingmeaning\").style.display = \"inline\";\n\t\tdocument.getElementById(\"loadinggraph\").style.display = \"inline\";\n\t\tdocument.getElementById(\"loadingcelebs\").style.display = \"inline\";\n\t\t\n\t\t// Clear old results\n\t\tdocument.getElementById(\"meaning\").innerHTML = \"\";\n\t\tdocument.getElementById(\"graph\").innerHTML = \"\";\n\t\tdocument.getElementById(\"celebs\").innerHTML = \"\";\n\t\t\n\t\t// Hide \"no results\" error message\n\t\tdocument.getElementById(\"norankdata\").style.display = \"none\";\n\t}", "function clearResults()\r\n{\r\n\t// Stop any existing search.\r\n\tsearchControl.cancelSearch();\r\n\t\r\n\t// Clear the results.\r\n\tresults = new Array();\r\n\tresultProgress = new Array();\r\n\tresultCounter = 0;\r\n\twriteDiv('results', null, \"\");\r\n\tshowProgress(0);\r\n\t\r\n\t// Clear the input box.\r\n\tsetControlValue(\"searchInput\", \"\");\r\n}", "clear() {\n this.searchModule.textSearchResults.clearResults();\n this.searchModule.clearSearchHighlight();\n this.searchModule.viewer.renderVisiblePages();\n }", "function clearResults() {\n\t$('.results').text('');\n}", "reset() {\n this._results = [];\n this._resultsCache = {};\n this._isSearching = false;\n this.updateQuery(\"\");\n }", "function clearOutResults(){\n\t\t$(\"#resultsTable\").find(\"td\").each(function() { \n\t\t\t$(this).html(\"\");\n\t\t});\n\t}", "function clearResults(){\n searchResults.innerHTML = '';\n}", "function clearSearchResults() {\n $(\"#results\").html(\"\");\n}", "reset () {\n this.displayPlot(null)\n this.displayStatistics(null, null)\n this.displayLog(null)\n this.displayError(null)\n this.results = new Map()\n }", "function clearResult() {\n $(\"#resultEl\").html(\"\");\n }", "function clearResults() {\n selectedPoints = [];\n Map.layers().remove(Map.layers().get(2));\n var instructionsLabel = ui.Label('Select regions to compare population.');\n resultsPanel.widgets().reset([instructionsLabel]);\n}", "function clearResults() {\r\n\t$('.card-query-result').each(function() {\r\n\t\tthis.remove();\r\n\t});\r\n}", "function clearSearchResults() {\n $(\"#output\").text(\"\");\n }", "function clearPreviousResults() {\n setMapOnAllMarkers(null);\n markersOnMap = [];\n arrayOfLocations = [];\n}", "function resetResults() {\n $(\"#search-results-heading\").text(\"\");\n $(\"#results\").text(\"\");\n}", "function clear() {\t\t\n\t\t\tresetData();\n refreshTotalCount();\n\t\t\tsetFocus();\n\t\t}", "clear() {\n super.clear();\n\n if (this.getInitialSearch()) {\n this.clearInitialSearch();\n } else {\n m.redraw();\n }\n }", "function resetDisplay() {\n\n $(\"#display-results\").empty();\n\n}", "function clearOutPutDataToHTML() {\n STATE.searchResult = [];\n render();\n}", "function clearResults() {\n const previousItems = document.querySelectorAll(\".search__result\");\n previousItems.forEach(node => {\n node.parentNode.removeChild(node);\n })\n}", "function clearResults() {\n clearTimeout(timerId);\n $(\".choice-reveal\").text('').hide();\n $(\"#results\").empty();\n $(\"#results\").removeClass(\"alert alert-danger\");\n\n playerObj.choice = \"\";\n database.ref(\"/players/\" + playerNumber).set(playerObj);\n}", "function clearSearch () {\n try {\n $rootScope.search_result = [];\n }\n catch (err) {\n console.error (`Clear search results problem: ${err}`);\n }\n }", "function resetData() {\n\t\t\tconsole.log(\"resetData()\");\n\n\t\t\tvm.results = [];\n\t\t\tvm.selectedIndex = -1;\n vm.selectedAccIndex = 0;\n\t\t\tvm.total_count = 0;\n loadEmptyObject();\n\t\t\tresetBoolean();\n\t\t}", "function clearTable() {\n if (searchResultsList.children().length > 0) {\n searchResultsList.empty();\n }\n }", "function clearSearchResults() {\n document.getElementById('clear_search_results').style.display = 'none';\n document.getElementById('tags_nav').style.display = 'initial';\n document.getElementById('categories_nav').style.display = 'initial';\n document.getElementById('search').value = '';\n popParamFromURL('searchTerm');\n savedNavURL = false;\n displayTen();\n}", "function clear () {\n self.searchTerm = '';\n search();\n }", "clear() {\n this.queries.length = 0;\n }", "clearUserSearch() {\n this.get('searchResults').length = 0;\n this.set('totalSearchResults', 0);\n }", "function clearSearchResults() {\n if (g_searchResults) {\n $('#list-view').html('');\n $('#list-view-status').text('Enter a search location to ' +\n 'search for nearby public schools.');\n for (var i = 0; i < g_searchResults.length; i++) {\n map.removeOverlay(g_searchResults[i].marker);\n }\n }\n \n g_searchResults = [];\n}", "function clearsearch() {\n searchResultArray.clear();\n searchTrailArray.clear();\n}", "function reset(){\n $(\".relevance-feedback-search-results\").hide();\n relevant = [];\n irrelevant = [];\n sentence_relevance = {};\n updateVectorQuery(undefined, getCurrentVectorQuery());\n $(\".relevant-table\").html(\"\");\n $(\".irrelevant-table\").html(\"\");\n displayResults(\"\");\n $(\"div.task\"+currentTask).find(\".refine-results\").hide();\n $(\"div.feedback\").hide();\n}", "reset() {\n this.cache = null\n this.counter = 0\n this.results = []\n }", "function clearAll() {\n\n\t\t\t// Clear the sorts and filters, defer the query\n \tclearAllSorts();\n \tclearAllFilters();\n\n }", "function clearPreviousResults() {\n searchResults.innerHTML = '';\n}", "function resetSearchResults () {\n [].slice.call(\n _results.getElementsByTagName('a')\n ).forEach(function (result) {\n result.parentNode.removeChild(result);\n });\n _results.setAttribute('aria-hidden', 'true');\n _results.setAttribute('hidden', '');\n _root.removeAttribute('data-displayresults');\n }", "function clearResults() {\n var mapResults = document.getElementById('mapResultsFull');\n var navResults = document.getElementById('navResults');\n while (mapResults.childNodes[0]) {\n mapResults.removeChild(mapResults.childNodes[0]);\n }\n while (navResults.childNodes[0]) {\n navResults.remove(navResults.childNodes[0]);\n }\n}", "function clearResults(){\n $(\"#current-conditions\").empty();\n $(\".forecast-card\").empty();\n}", "function clearQueryData() {\n\t\t\tlastLogStamp = 0;\n\t\t\t$timeout.cancel(queryLogsTimeout);\n\t\t\t$timeout.cancel(displayLogsTimeout);\n\t\t\tcurQueryId = \"\";\n\t\t\t$scope.resultsAvailable = false;\n\t\t\t$scope.queryLogsBusy = false;\n\t\t\t$scope.resultsBusy = false;\n\t\t\t$scope.data.logs = [];\n\t\t\tupdateLogsText();\n\t\t\t$scope.data.queryResponse.schema = [];\n\t\t\t$scope.data.queryResponse.results = [];\n\t\t}", "function clearData(){\n emptyBoxes()\n loadView(\"none\")\n $(\".code-box:eq(0)\").focus()\n lastSearch=\"\"\n }", "function clearList(){\n $('#results-list').empty();\n}", "function clearResultSec() {\n resultSec.html(\"\");\n searchMsg.html(\"\");\n }", "clearPrevResults(){\n const resultsDiv = document.querySelector('#results');\n resultsDiv.innerHTML = '';\n }", "function clearInput() {\n\tresults.value = \"\";\n}", "function clearResults() {\n $('div.cards-container').html('');\n}", "function clearResultsDiv() {\n \"use strict\";\n document.getElementById('results').style.display = 'none';\n}", "function SearchResultsReset(){\n\t_TTSearchResults = new Array();\n}", "function clearAll () {\n lastNum = \"\";\n theNum = \"\";\n result = \"\";\n viewer.innerHTML = \"\";\n }", "function clear() {\n vm.searchText = null;\n }", "function deleteResults() {\n $(\".resultsBox\").removeClass('resultsBox-active');\n $(\".resultsBox\").empty();\n }", "function clearResults() {\n \"use strict\";\n document.getElementById(\"resultNumberCount\").value = \"\";\n document.getElementById(\"resultNumberTotal\").value = \"\";\n document.getElementById(\"resultWordCount\").value = \"\";\n}", "function clearResults() {\r\n const clearResults = document.getElementsByClassName(\"show\");\r\n for (let i = clearResults.length - 1; i >= 0; i--) {\r\n clearResults[i].remove();\r\n }\r\n}", "function clearResult(){\n const searchResults = document.getElementById('companies');\n searchResults.innerHTML = '';\n \n}", "function clear(){\n var node = document.getElementById(\"results\");\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n}", "function clear() {\n\t\t\tconsole.log(\"clear()\");\t\t\n\t\t\tresetData();\n refreshTotalCount();\n\t\t\tsetFocus();\n\t\t\taddAdbRow();\n\t\t\tconsole.log(\"done clear()\");\n\t\t}", "function clearSearchResults() {\n\t $(\"#carousel\").html(\"\");\n\t}", "function clearResults() {\n if (savedQueries.count > 0){\n savedQueries.count = 0;\n savedQueries.items = [];\n $(\"#downloadSavedQueries\").text('Download (0)').removeClass(\"buttonIcons\").addClass(\"uploadShapeButton-disabled\");\n $(\"#clearResults\").removeClass(\"buttonIcons\").addClass(\"uploadShapeButton-disabled\");\n }\n }", "function clearSearchResults() {\n $(\".search-results\").remove();\n $(\"#search-input\").val(\"\");\n $(\"#clear-search\").css(\"visibility\", \"hidden\")\n}", "function clearViewContainer() {\n $('.content_container').empty();\n $('.next_btn_container').empty();\n $('.results_container').empty();\n $('.summary_container').empty();\n}", "function clearResults() {\r\n\r\n\tlet parent = document.querySelector(\"#parentBody\");\r\n\twhile(parent.hasChildNodes()) {\r\n\t\tparent.removeChild( parent.lastChild )\r\n\t}\r\n}", "function clearValues(){\n let resultsBox = document.querySelector(\".results\");\n resultsBox.value = \"\";\n}", "function clearImageResults() {\r\n $(\"#image_search_result\")\r\n .empty()\r\n .html(\"<p class=\\\"images_empty_res\\\">Нет элементов для отображения</p>\");\r\n }", "function clearResults(markers) {\r\n\t\tfor(var i = 0; i < markers.length; i++) {\r\n\t\t\tmarkers[i].setMap(null);\r\n\t\t}\r\n\t\tmarkers = [];\r\n\t}", "function clearSearchesVisualization(){\n g.selectAll('*').remove();\n }", "function deleteResults() {\n document.getElementById(\"results\").innerHTML = \"\";\n}", "function resetSearchResult() {\r\n $('.show-results p.risultati').addClass('hidden');\r\n\r\n $('.movies .results-number').text('');\r\n $('.show-results .container.movies-results').html('');\r\n\r\n $('.tv-series .results-number').text('');\r\n $('.show-results .container.tv-series-results').html('');\r\n\r\n}", "function clear() {\t\t\n\t\t\tresetData();\n refreshTotalCount();\n for(var i=0;i<5; i++) { addMutationInvolvesRow(); }\n for(var i=0;i<5; i++) { addExpressesComponentsRow(); }\n for(var i=0;i<5; i++) { addDriverComponentsRow(); }\n\t\t\tsetFocus();\n\t\t}", "function clearSearch(){\n for(var i=0;i<reporter_path.length;i++){\n reporter_path[i].setMap(null);\n }\n for(var i=0;i<reporter_record.length;i++){\n reporter_record[i].setMap(null);\n }\n reporter_path=[];\n reporter_record=[];\n}", "function reset() {\n quizMetrics.changeState(\"results\", false);\n quizMetrics.numCorrect = 0;\n \n for(var i = 0; i < dataSvc.quizQuestions.length; i++) {\n var data = dataSvc.quizQuestions[i];\n \n data.selected = null;\n data.correct = null;\n }\n }", "function clear() {\n contentVeil.reset();\n contentVeil.hide();\n removePreviewLegend();\n unwrapInterestingRange();\n }", "clear() {\n this.autocompleteCache = [];\n this.internalQuery = null;\n this.autocompleteSelectedQuery = null;\n this.autocomplete.perform();\n }", "clearAll()\r\n { \r\n this.selectedItems=[];\r\n this.display = null;\r\n this.value = null;\r\n this.results = null;\r\n this.error = null;\r\n this.icon = false;\r\n this.Focusinputbox = false;\r\n this.source.forEach(function (item) {\r\n item.invisible = false;\r\n });\r\n\r\n this.$emit(\"clear\");\r\n \r\n }", "function clear() {\n data = [];\n $grid.find('.row').remove();\n }", "resetView() {\n let result = document.querySelector(\".result\");\n result.classList.remove(\"result-active\");\n let cells = document.querySelectorAll(\".cross-circle\");\n for (let i = 0; i < cells.length; i++) {\n cells[i].remove();\n }\n }", "function resetData() {\n\t\t\tconsole.log(\"resetData()\");\n\n\t\t\tvm.results = [];\n\t\t\tvm.selectedIndex = -1;\n\t\t\tvm.total_count = 0;\n\n\t\t\t// rebuild empty apiDomain submission object, else bindings fail\n\t\t\tvm.apiDomain = {};\n\t\t\tvm.apiDomain.logicalDBKey = \"\";\t\n\t\t}", "function reset() {\n oConfig = {};\n oConfig = jQuery.extend({}, {}, oConfigDefaults);\n aLastResults = [];\n }", "function clearResults(markers) {\n for (var m in markers) {\n markers[m].setMap(null)\n }\n markers = []\n}", "function resetResult() {\n $('#results').empty();\n $('#result').replaceWith('<div id=\"result\">Result = Well you have to calculate something dummy ;P</div>')\n}", "clear() {\n this.operation = [];\n this.updateDisplay();\n }", "clear() {\n this.processRecords();\n this.queue.length = 0;\n this.selectionChanged = false;\n }", "clear() {\r\n this._clear();\r\n }", "clear() {\n this.index.clear();\n }", "function clearit() { \n jun.map.setFilter(\"points\", null)\n $('#region_select').multipleSelect(\"checkAll\");\n $('#Version_select').multipleSelect(\"checkAll\"); \n jun.map.flyTo({center : [jun.default_center_first, jun.default_center_second], zoom:1.1})\n \n $('.typeahead').typeahead('val', '')\n unfiltered_list_creator()\n\n document.getElementById(\"results_num\").innerText = Site_search.length\n document.getElementById('third_bar').click();\n}", "function clear() {\n $('#result-add').text(\"\");\n $('#result-mult').text(\"\");\n }", "function clearAll() {\n shouldAutoClear = false;\n expressionElm.empty();\n tokensElm.empty();\n treeElm.empty();\n resultElm.empty();\n }", "function clearMap() {\n\t\n\t// Junk data \n\tdata = google.visualization.arrayToDataTable([\n\t\t['Place', 'Searches'],\n\t\t['', 0]\n\t]);\n\t\n\t// Remove the selected topic on the right sidebar\n\t$(\".topItem\").removeClass('active');\n\t\n\t// Remove the current query\n\tcurrentQ = '';\n\t\n\t// Redraw the now empty chart\n\tchart.draw(data, defaultOptions);\n}", "function reset_data(){\n\t updateData(current_search);\n }", "function clearAll() {\n clearEntry();\n previousValue = 0;\n currentValue = 0;\n operatorPressed = \"\";\n result = 0;\n hasDoneMath = false;\n hasPrevValue = false;\n hasTooManyDigits = false;\n showBreadcrumbs(\"\");\n showNumberInDisplay(currentValue);\n}", "function reset() {\n $button.on(\"click\", function(event) {\n // Prevents dupicate click assignments\n event.preventDefault();\n $button.off(\"click\");\n\n // Resets result divs and removes them from page, reloads search div, re-runs input function\n $search.val(\"\");\n $search.css(\"border-bottom\", \"2px solid rgb(255, 255, 255)\");\n $search.off(\"focus\");\n $(\"p\").html(\"\");\n $(\"ul\").html(\"\");\n $inputCard\n .hide()\n .delay(500)\n .fadeIn(1000);\n $alertCard.hide();\n $mapCard.hide();\n $newsCard.hide();\n $button.hide();\n $weatherCard.hide();\n $(\"select\").material_select();\n $(\"#alertDiv\").empty();\n $(\".imgBox\").remove();\n $(\"#tableHead\").empty();\n $(\"#tableRow\").empty();\n $(\"#dropdown1\").empty();\n $(\"#safetyDisplay\").empty();\n input();\n });\n }", "function resetList()\n{\n\tvar element = document.getElementById('resultslist');\n\telement.innerHTML = \"\";\n}", "function clearLoaderShowResults() {\n loader.style.display = \"none\";\n results.style.display = \"block\";\n}", "clear() {\n this._clear();\n }", "function resetResultContent(){\r\n document.getElementById(\"result\").innerHTML = \"\";\r\n}", "function clearAllFilm() {\n\t$(\"#all-film-result\").empty();\n}", "function clearOutput () {\n mainView.send('output-clear');\n}", "clear() { \n this.state.page=0;\n this.state.filters='';\n this.state.search='';\n document.getElementById('searchInput').value = '';\n for (var key in this.state.listFilters){\n document.getElementById(key).value='';\n this.state.listFilters[key]='';\n this.state.filters='';\n } \n this.loadData(''); \n }", "function clear_page(){\n jQuery('#current').empty();\n jQuery(\"#results\").empty();\n jQuery(\"#results\").slideUp();\n jQuery('#current').slideUp();\n}", "resetAllFilterViews(){\n this.setProperties({'viewFilterbySearch': false, 'viewFilterbyGrade': false, 'viewFilterbyClassification': false });\n }", "function clearResults(markers) {\n for (let m in markers) {\n markers[m].setMap(null)\n }\n markers = []\n}", "function clearOldResults() {\n const res = document.getElementById('res');\n const child = res.firstElementChild;\n if (child !== null) {\n res.removeChild(child); \n }\n}", "clear() {\n\t\tthis.model.clear();\n\t}" ]
[ "0.7894176", "0.7826185", "0.78203005", "0.76986355", "0.75015706", "0.741445", "0.7378017", "0.736055", "0.7340736", "0.7305873", "0.7304077", "0.72747767", "0.7239815", "0.72241765", "0.71921504", "0.71819866", "0.7153377", "0.71248156", "0.711531", "0.70830256", "0.7065517", "0.70234203", "0.70168245", "0.70084727", "0.69837755", "0.6961039", "0.69473505", "0.69233775", "0.6900554", "0.68764055", "0.68748426", "0.6871516", "0.6855544", "0.68524", "0.684313", "0.6820916", "0.6817581", "0.6774735", "0.67667013", "0.6766524", "0.6749627", "0.6744519", "0.6739997", "0.6735332", "0.6716102", "0.6701042", "0.6679677", "0.6666528", "0.66642934", "0.66600597", "0.66342145", "0.66217405", "0.6621124", "0.6609827", "0.66092825", "0.6586815", "0.65833694", "0.65720135", "0.6537122", "0.6516843", "0.6516576", "0.65091306", "0.64894134", "0.64791965", "0.64738476", "0.6468487", "0.6466114", "0.64570874", "0.6446501", "0.643717", "0.64335907", "0.64321494", "0.6401672", "0.63961935", "0.63917905", "0.6391344", "0.6389388", "0.63813734", "0.6372523", "0.63413775", "0.63281924", "0.63247633", "0.63176125", "0.63118213", "0.63081884", "0.6302662", "0.63018376", "0.6294383", "0.6283511", "0.6283343", "0.628276", "0.62818044", "0.62692326", "0.6260151", "0.62600386", "0.6252209", "0.62424797", "0.624135", "0.6236417", "0.6235968" ]
0.73955107
6
Bind the search handler function to the search element.
function bindSearchHandler() { document.getElementById("search").addEventListener("input", searchHander); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchBinding(){\n var selector = thisInstance.constants.selector,\n $searchForm = $(selector.searchForm);\n $searchForm.on('submit', function(event){\n event.preventDefault();\n fetchAndLoadUserList({searchKey: $.trim($(selector.searchBox).val())});\n });\n }", "function searchCall() {\n $('#searchButton').click(function () {\n var qString = $('#searchInput').val();\n bindSearchUrl(qString);\n });\n\n $('#searchInput').keypress(keypressHandler);\n }", "function bindSearchHandler() {\n $(\"#search-form\").submit(function() {\n var q = $(\"#q\").val();\n if (q !== \"\") {\n $.ajax({\n dataType: 'html',\n url: '/search?q=' + encodeURIComponent(q),\n \n // Show the user his search results.\n success: function(response) {\n $(\"#search-results\").html(response); \n bindSearchResultHandlers();\n }\n });\n }\n \n return false;\n });\n }", "searchChangeHandler(event) {\n console.log(event.target.value);\n const boundObject = this\n const searchTerm = event.target.value\n boundObject.performSearch(searchTerm);\n }", "addHandlerSearch(handler) {\n this._parentElement.addEventListener('submit', function (e) {\n e.preventDefault();\n handler();\n });\n }", "function handleSearch() {\n triggerSearch({}); // need empty braces here\n }", "function applySearchInventoryHandler() {\n debug && console.log( \"VanInventory.applySearchInventoryHandler: Binding the custom inventory search bar handlers\" );\n\n // Bind the search handler\n $(\"#inventorySearch\").bind( \"change\", searchInventoryHandler );\n }", "search() {\n this.trigger('search', {\n element: this.searchBar,\n query: this.searchBar.value\n });\n }", "function configureSearchInput()\n{\n document.getElementById('search-query').\n addEventListener('keypress', onkeyForSearchInput, false);\n}", "addHandlerSearch(handler) {\n // Add event listener to form\n this.#parent.addEventListener('submit', function (e) {\n e.preventDefault();\n // call handler when triggered\n handler();\n });\n }", "function SearchWrapper () {}", "function searchHandler(e) {\n \"use strict\";\n // Prevent default form action\n e.preventDefault();\n showFilteredBreeds();\n}", "function addSearchListener() {\n var target = $(\"#searchbar\");\n target.keyup(sendKeyup)\n}", "function bindSearchBoxEvents() {\n var trigger, searchType, searchBoxValueFromSuggestions;\n bindSearchWidgetEvents();\n\n $('.search-close').click(function() {\n\n resetSearchBox();\n });\n\n $('.search-options a').click(function() {\n\n var type = (type = $(this).attr('href')) ? type.trim().toLowerCase() : '',\n input = searchBox.val();\n input = input ? input.trim() : '';\n $('.search-results ul').html('');\n if (input !== '') {\n bindSearchSuggestions(type);\n } else {\n $('.search-results ul').html('');\n }\n });\n bindSearchBoxKeyupEvents();\n bindSearchSuggestionEvents();\n $(function() {\n $(\"form\").submit(function() {\n return false;\n });\n });\n }", "function initSearch(event) {\n var searchPageDoc = event.target;\n var searchField = searchPageDoc.getElementByTagName(\"searchField\");\n if (!searchField) { return; }\n \n var keyboard = searchField.getFeature(\"Keyboard\");\n keyboard.onTextChange = function () {\n doSearch(keyboard.text, searchPageDoc);\n }\n}", "function _triggerSearch() {\n Mediator.pub(\n CFG.CNL.DICTIONARY_SEARCH,\n (_searchIsActive ? _$search.val() : \"\")\n );\n }", "function bindSearchResultHandlers() {\n bindAddHandlers();\n enableSorting();\n }", "handleSearchClick(){\n\n this.doSearch();\n\n }", "function search( event, searchTerms ){\n //console.debug( this, 'searching', searchTerms );\n $( this ).trigger( 'search:searchInput', searchTerms );\n if( typeof options.onfirstsearch === 'function' && firstSearch ){\n firstSearch = false;\n options.onfirstsearch( searchTerms );\n } else {\n options.onsearch( searchTerms );\n }\n }", "function search( event, searchTerms ){\n //console.debug( this, 'searching', searchTerms );\n $( this ).trigger( 'search:searchInput', searchTerms );\n if( typeof options.onfirstsearch === 'function' && firstSearch ){\n firstSearch = false;\n options.onfirstsearch( searchTerms );\n } else {\n options.onsearch( searchTerms );\n }\n }", "function searchEventListener() {\n\t$(\"#searchbtn\").click(function() {\n\t\tif ($(\"#searchbox\").val() != '') {\n\t\t\tsearchNewspapers($(\"#searchbox\").val());\n\t\t}\n\t});\n}", "_handleChange(e){let root=this;root._getSearchText(root.$.input.value);root.resultCount=0;root.resultPointer=0;root.dispatchEvent(new CustomEvent(\"simple-search\",{detail:{search:root,content:e}}))}", "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "function emitSearch(event){ if (event.which == 13) {addSearch();}}", "function searchChanged(event) {\n let text = event.target;\n\n let request = new XMLHttpRequest();\n request.addEventListener(\"load\", searchReceived);\n request.open(\"get\", \"getsearch.php?name=\" + text.value, true);\n request.send();\n}", "function SearchPanel() {\n Component.call(this, 'form');\n\n var $element = $(this.element);\n var $input = $('<input type=\"search\" placeholder=\"Input a text...\">');\n var $button = $('<button type=\"submit\">Search</button>');\n\n $element.submit(function(event){\n event.preventDefault();\n var query = $input.val();\n if (query && _callback) _callback(query);\n }.bind(this));\n \n $element.append([$input, $button]);\n \n var _callback;\n this.onSearch = function (callback) {\n _callback = callback;\n };\n}", "function search() {\n\t\n}", "onSearch() {\n try {\n const searchText = this.getSearchHash();\n if (searchText === this.priorSearchText)\n return;\n this.engine.search(searchText);\n this.priorSearchText = searchText;\n }\n catch (ex) {\n this.publish(\"error\", ex.message);\n }\n }", "function bindSearchSuggestionEvents() {\n var highlightedLink, trigger, searchType, parentUL;\n $('.search-results').on('mouseenter', 'li', function() {\n $('.search-results span').removeClass('highlight');\n $(this).find('span').addClass('highlight');\n });\n\n $('.search-results').on('mouseleave', 'li', function() {\n $(this).find('span').removeClass('highlight');\n });\n $(\".search-results\").on('click', '.is-opened li a', function(event) {\n trigger = SN.Constant.GTM_SEARCH_EVENT_SUGGESTIONS;\n searchType = getSearchType();\n highlightedLink = $('.search-results .is-opened li span.highlight');\n parentUL = $('.search-results .is-opened li span.highlight').closest('ul').attr('id');\n\n if (highlightedLink.length === 1) {\n searchBox.val(highlightedLink.text());\n $(\".search-wrapper\").hide();\n $(\".searchfn\").show();\n search(searchBox.val(), trigger, searchType, parentUL);\n\n }\n });\n }", "function handleSearch() {\n\n\tvar value = $(\"#searchBox\").val();\n\t\n\tif(value != null && value != \"\") {\n\t\tsearchStationForName(value);\n\t}\n\n}", "function handleSearchClick(){\r\n var temp = document.getElementById('searchText').value;\r\n fetchRecipesBySearch(temp);\r\n }", "function search(_event) {\r\n let inputName = document.getElementById(\"searchname\");\r\n let inputMatrikel = document.getElementById(\"searchmatrikel\");\r\n let query = \"command=search\";\r\n query += \"&nameSearch=\" + inputName.value;\r\n query += \"&matrikelSearch=\" + inputMatrikel.value;\r\n console.log(query);\r\n sendRequest(query, handleSearchResponse);\r\n }", "function searchThis(e) {\n $('#searchbox').val($(e).text());\n FJS.filter();\n}", "function bindSearchIconEvent(searchElements) {\n\n WM.forEach(searchElements, function (ele) {\n var searchEle = WM.element('<a class=\"app-header-action wi wi-search\"></a>');\n WM.element(ele).before(searchEle);\n //Tap icon to show/hide search box\n bindTapEvtHandler(searchEle, function () {\n toggleSearchContainer(ele);\n });\n });\n\n }", "function handleSearch(e) {\n e.preventDefault();\n let input = document.getElementById('networkSearch');\n\t\tlet search = input.value;\n\t\tprops.handleSearch(search);\n\t\tinput.value = '';\n }", "searchinputClickCallback(event) {\n event.target.select();\n this.searchinputCallback(event);\n }", "AddSearchProvider() {}", "function bindHeaderSearch() {\r\n var $searchForm = $(\"#searchForm\");\r\n var $searchIcon = $searchForm.find('.header-search-icon');\r\n var $searchInput = $searchForm.find(\"#header-search-input\");\r\n var $closeSearchIcon = $searchForm.find(\"#header-search-close\");\r\n\r\n $searchInput.off(\".search\").on(\"focus.search\", function() {\r\n $searchInput.addClass(\"is-extended\");\r\n $closeSearchIcon.removeClass(\"is-hidden\");\r\n });\r\n\r\n $closeSearchIcon.off(\".search\").on(\"click.search\", function (e) {\r\n e.preventDefault();\r\n $searchInput.removeClass(\"is-extended\").val(\"\");\r\n $closeSearchIcon.addClass(\"is-hidden\");\r\n });\r\n\r\n $searchForm.on('click', '.header-search-icon', function(e) {\r\n var $elem = $(e.target);\r\n if (!$elem.hasClass('header-search-icon-wellcome')) {\r\n e.preventDefault();// stop click on search icon opening out input field\r\n }\r\n if (blankQuery($searchInput.val())) {\r\n $searchForm.submit();\r\n } \r\n });\r\n}", "function search(event, searchTerms) {\n if (!searchTerms) {\n return clearSearchInput();\n }\n $(this).trigger(\"search.search\", searchTerms);\n if (typeof options.onfirstsearch === \"function\" && firstSearch) {\n firstSearch = false;\n options.onfirstsearch(searchTerms);\n } else {\n options.onsearch(searchTerms);\n }\n }", "function addeventListener() {\n var button = document.getElementById('search-button');\n button.addEventListener('click', linearSearch);\n }", "function setSearch() {\r\n\tconst btn=document.querySelector('#searchbtn');\r\n\tbtn.addEventListener('click', searchCraft);\r\n\tconst bar = document.querySelector('#searchbar');\r\n\tbar.addEventListener(\"keyup\", function(event) {\r\n if (event.key === \"Enter\"|event.keyCode === 13) {\r\n searchCraft(event);\r\n\t }\r\n\t});\r\n}", "search() {\n\t\tthis.props.onSearch(this.state.term);\n\t}", "onSearch(value) {\n this.model.query = value;\n }", "onSearch(value) {\n this.model.query = value;\n }", "search() {\n this.send('searchWithParams', this.buildSearchQuery());\n }", "handleSearch() {\n if (this.state.searchTerm) {\n this.props.onSearch(this.state.searchTerm);\n }\n else {\n return;\n }\n }", "function Search(parent) {\n this.parent = parent;\n this.addEventListener();\n }", "function searchHelper() {\r\n let searchValue = searchField.value;\r\n if (searchValue.length) search(searchValue);\r\n else getAll();\r\n }", "function initSearch() {\n var searchInput=$(\"#search-input\");\n var magnifier=$(\"#magnifier\");\n var filmWrapper=$(\".film-wrapper\");\n var seriesWrapper=$(\".series-wrapper\");\n var myQuery;\n\n searchInput.on('keydown',function(e) {\n if (e.which == 13) {\n myQuery=searchInput.val();\n searchApi(myQuery);\n searchInput.val(\"\");\n }\n });\n\n magnifier.click(function() {\n myQuery=searchInput.val();\n searchApi(myQuery);\n searchInput.val(\"\");\n });\n}", "function handleSearch(e) {\n const { value } = e.target;\n setSearch(value);\n if (!value) dispatch(searchContent({ val: null, type: \"all\" }));\n if (value.length < 3) return \"\";\n return debouncedSearch({ ...sorter, type: \"search\", search: value });\n }", "handleSearchClick(event) {\n\t\tthis.props.onSearchClick(event, this.state);\n\t}", "function search_keypress(evt) {\n}", "function onSearchTerm(evt) {\n var text = evt.target.value;\n doSearch(text, $('#types .btn-primary').text());\n }", "onSearch(e) {\n let term = e.target.value;\n // Clear the current projects/samples selection\n this.props.resetSelection();\n this.props.search(term);\n }", "function run_search() {\n var q = $(elem).val();\n if (!/\\S/.test(q)) {\n // Empty / all whitespace.\n show_results({ result_groups: [] });\n } else {\n // Run AJAX query.\n closure[\"working\"] = true;\n $.ajax({\n url: \"/search/_autocomplete\",\n data: {\n q: q\n },\n success: function(res) {\n closure[\"working\"] = false;\n show_results(res);\n }, error: function() {\n closure[\"working\"] = false;\n }\n })\n }\n }", "search() {\n this.props.onSearch(this.state.searchValue);\n }", "search(){\n // Condition checks if nothing has been input when first entering website and clicking the button or when something is typed and then deleted\n // returns out of method if this is the case as there will be no results\n if(this.state === null || this.state.term === ''){\n return;\n }\n\n // Calls the passed down event handler search function from App.js\n this.props.onSearch(this.state.term);\n }", "function searchInventoryHandler() {\n debug && console.log( \"VanInventory.applySearchInventoryHandler: Searching for listview results\" );\n var searchVal = $(\"#inventorySearch\" ).val();\n var inventoryToSearch = null;\n if ( guidedSearchFilteredInventoryArray ) {\n inventoryToSearch = guidedSearchFilteredInventoryArray;\n } else {\n inventoryToSearch = inventoryArray;\n }\n var inventoryResults = _.filter( inventoryToSearch, function( currentItem ) {\n var currentItemStringToSearch = currentItem.productCode + \" \" + currentItem.description +\n \" \" + currentItem.manufacturer + \" \" + currentItem.binName;\n return ( currentItemStringToSearch ).toLowerCase().indexOf( searchVal.toLowerCase() ) != -1;\n });\n currentPage = 0;\n populateListViews( inventoryResults, true );\n initializePaging();\n\n // Adjust the list view borders after the guided search is applied\n UIFrame.adjustListViewBorders();\n }", "function makeSearch(event) {\n event.preventDefault();\n\n toggleError();\n\n searchRepos(\n searchInput.value,\n searchStartCB,\n searchSuccessErrorCB,\n searchFinalCB\n );\n}", "function createSearchTypingListener() {\n var searchInputDOM = document.getElementById(\"evo_c-divtable-search_input\");\n if (searchInputDOM != null) {\n searchInputDOM.addEventListener(\"keyup\", function () {\n searchUserArray(mockUsers);\n }, false);\n }\n }", "function handleSearch(event) {\n event.preventDefault();\n if (formSearch) {\n searchGoogleBooksAPI(formSearch.search);\n }\n\n }", "handleSearchKeyChange(searchKey) { \n this.searchKey = searchKey;\n }", "doSearch(){\n\n monit.monitOut(\"SEARCH\",\"onSearch\",2);\n //calling parent scope callback\n this.onSearch(this.search);\n\n\n }", "clickSearchBox(event) {\n if (!this.isSearching()) {\n this.startSearching();\n }\n }", "function startUp() {\n let search = document.getElementById(\"search\");\n search.onclick = searchAll;\n }", "HandleSearch(e) {\n this.props.searchname(this.state.search);\n this.setState({ clicked: true, search: '' });\n this.props.handleClickParent(e);\n }", "bindSearch() {\n // Get the input box\n var textInput = document.getElementById('search');\n\n // Init a timeout variable to be used below\n var timeout = null;\n\n // Listen for keystroke events\n textInput.onkeyup = (e) => {\n\n // Clear the timeout if it has already been set.\n // This will prevent the previous task from executing\n // if it has been less than <MILLISECONDS>\n clearTimeout(timeout);\n\n // Make a new timeout set to go off in 800ms\n timeout = setTimeout(() => {\n this.photoMap.search(textInput.value)\n }, 500);\n };\n }", "handleKeyPressed(event) {\n if (event.keyCode)\n this.search()\n}", "search() {\n let self = this;\n let inputField = self.getEl('search_field');\n window.location = window.location.origin + `/search/${inputField.value}`;\n }", "attachedCallback() { /**/\n this.element = this.sr.querySelector('.search-widget');\n this.searchQuery = this.sr.querySelector('.search_query');\n this.resultsList = this.sr.querySelector('.autocomplete-results');\n this.itemDetails = this.sr.querySelector('.item-details');\n // much like react we have to manually bind our scope in as needed\n this.searchQuery.oninput = this.updateOnKeypres.bind(this);\n this.searchQuery.onfocus = this.onFocus.bind(this);\n // bind over functions that need scope\n this.createResultList = this.createResultList.bind(this);\n this.setIsLoading = this.setIsLoading.bind(this);\n this.setIsOpen = this.setIsOpen.bind(this);\n this.setIsEmpty = this.setIsEmpty.bind(this);\n this.fetchData = this.fetchData.bind(this);\n this.canShowItemDetails = this.canShowItemDetails.bind(this);\n }", "function ssearch_do_search() {\n\tvar search_string = d$(\"string_to_search\").value;\n\tif ( !search_string.length )\n\t\treturn;\n\twoas.do_search(search_string);\n}", "function start() {\r\n document.getElementById(\"search\").addEventListener(\"keypress\", searchvalue);\r\n retreive();\r\n}", "handleSearchChange(event){\n let val = event.target.value; \n this.searching = val;\n }", "handleEvent(event) {\n switch (event.type) {\n case 'input':\n this.onSearch(this.inputNode.value);\n break;\n case 'focus':\n case 'blur':\n this._toggleFocused();\n break;\n default:\n break;\n }\n }", "handleEvent(event) {\n switch (event.type) {\n case 'input':\n this.onSearch(this.inputNode.value);\n break;\n case 'focus':\n case 'blur':\n this._toggleFocused();\n break;\n default:\n break;\n }\n }", "function searchMainWindow() {\n\tvar query = document.getElementById(\"searchinput\").value;\n\tsearch(query, 0);\n}", "function bindKeydownSearches() {\n\n var $search,\n searchTerm,\n searchLength,\n predictiveSearchTerms,\n predictiveSearchLinks,\n appendedTerms,\n appendedLinks,\n searchType,\n predictiveListCount = 0,\n prevSearchHadResults,\n currentIndex = -1,\n touch = $('html').hasClass('touch');\n\n //Do not allow the cursor to move to the front of the search on\n //up arrow key\n $('.search').on('keydown', function(e) {\n if (e.keyCode === 38) {\n return false;\n }\n });\n\n $('.search').on('keyup', function(e) {\n\n e.preventDefault();\n\n $search = $(this);\n searchTerm = $search.val().toLowerCase();\n searchLength = searchTerm.length;\n\n /**\n * Type of search situations\n * Large\n * Small\n * Large but on touch device (force mobile)\n * Search page (mobile)\n */\n searchType = $search.attr(\"id\") === \"search-page-search\" ? \"search\" :\n touch ? 'small' : window.innerWidth >= 960 ? \"large\" : \"small\";\n\n if (searchLength < 2) {\n predictiveContainer[searchType].hide();\n return true;\n }\n\n if (searchLength === 2 && Search.models.indexOf(searchTerm) === -1) {\n predictiveContainer[searchType].hide();\n return true;\n }\n\n //If last search yielded results AND up/down key pressed:\n if (/(large|search)/.test(searchType) && prevSearchHadResults && (e.keyCode === 38 || e.keyCode === 40)) {\n\n //We made it into the scrolling of predictive terms, is this our first time?\n predictiveListCount = predictiveListCount === 0 ? document.querySelectorAll(\"#predictive-terms-\" + searchType + \" li\").length : predictiveListCount;\n\n //We know our index and how many items we have now, let's move\n switch (e.keyCode) {\n case 38:\n currentIndex = arrowKeyPressed(currentIndex, predictiveListCount, -1, searchType);\n break;\n case 40:\n currentIndex = arrowKeyPressed(currentIndex, predictiveListCount, 1, searchType);\n break;\n default:\n console.log(\"Funky-ness.\");\n }\n\n return true;\n }\n\n //If we get to this point we can make an ajax call, because of scope i should have\n //variables available\n hydrateObjectFromJSON('terms', '/rest/suggest?q=' + searchTerm, function() {\n\n hydrateObjectFromJSON('links', '/rest/shortcuts?q=' + searchTerm, function() {\n currentIndex = -1;\n predictiveListCount = 0;\n\n html = '';\n\n predictiveSearchTerms = getPredictiveSearchTerms();\n predictiveSearchLinks = Search.links[0] || null;\n\n appendedTerms = appendTermsToList(predictiveSearchTerms, searchTerm, searchType);\n appendedLinks = appendDestinationToList(predictiveSearchLinks, searchType);\n\n if (appendedTerms || appendedLinks) {\n //Show the dropdown\n prevSearchHadResults = true; //This lets us know if we need to listen to up and down arrows in the future\n predictiveTermsContainer[searchType].html(html); //The html variable is a high level variable that is injected once instead of being passed around\n predictiveContainer[searchType].show();\n } else {\n //Hide the dropdown\n prevSearchHadResults = false;\n predictiveContainer[searchType].hide();\n }\n });\n });\n });\n }", "handleSearchChange(event){\n let val = event.target.value;\n this.searching = val;\n }", "onSearch(event) {\n //using this.setState to manipulate the internal component state\n this.setState({ query: event.target.value}); \n }", "handleSearchClick(e){\n this.toggleSearch();\n \n e.stopPropagation(); //parents not told of the click\n }", "search() {\n let location = ReactDOM.findDOMNode(this.refs.Search).value;\n if (location !== '') {\n let path = `/search?location=${location}`;\n makeHTTPRequest(this.props.updateSearchResults, path);\n }\n }", "function start(){\n document.getElementById(\"search\").addEventListener('keypress',searchvalue);\n retreive();\n}", "searchHandler(e){\n this.setState({\n term : e.target.value \n });\n}", "function handler() {\r\n var searchfor = document.getElementById(\"searchterm\").value;\r\n alert('Searching for: ' + searchfor);\r\n /* ... */\r\n}", "function clicked() {\n search()\n; }", "function manualSearch(e) {\n let term = document.querySelector(\"#searchTerm\").value;\n term = term.trim();\n if (term.length < 1) return;\n manualSearchData(term.toLowerCase());\n}", "function userNormalSearch(e){\n\te.preventDefault();\n\tsearchTerm = $('#search').val().trim(); \n\tuserSearch();\n}", "function build_search() {\n\t\t\tvar search_box = element.find(settings.search_box);\n\t\t\tif (!search_box.length) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsearch_box.css({color: settings.css_off}).val('search');\n\t\t\tsearch_box.click(function () {\n\t\t\t\t$(this).css({color: settings.css_on}).val('');\n\t\t\t});\n\t\t\tsearch_box.blur(function () {\n\t\t\t\tif ($(this).val() === '') {\n\t\t\t\t\t$(this).css({color: settings.css_off}).val('search');\n\t\t\t\t}\n\t\t\t});\n\t\t\tsearch_box.on('keyup', function (e) {\n\t\t\t\t//don't count the SHIFT key as a key press\n\t\t\t\tif (e.which == 16) return;\n\t\t\t\tsearch($(this).val());\n\t\t\t});\n\t\t}", "function handleSearchEvent() {\n const newData = filterStudents(searchValue);\n showPage(newData, 1);\n addPagination(newData);\n}", "function searchthis(e){\n $.search.value = \"keyword to search\";\n $.search.blur();\n focused = false;\n needclear = true;\n}", "function onSearch() {\n var wasActive = !!activeSearch\n activeSearch = searchBox.value\n if (!wasActive) {\n viewer.addFilter(searchFilter)\n }\n clearOption.style.visibility = \"visible\"\n onSearchBlur()\n viewer.filter()\n refreshFilterPane()\n }", "function keypressHandler(event) {\n\n if ((event.keyCode == '13') || (event.keyCode == '10')) {\n var qString = $('#searchInput').val();\n bindSearchUrl(qString)\n }\n }", "function addSearchListeners() {\n searchInput.addEventListener(\"keyup\", function(event) {\n const k = event.keyCode; // ignore arrow keys\n if (k > 36 && k < 41) return;\n suggestionModule.displayMatches();\n });\n\n searchInput.addEventListener(\"focus\", suggestionModule.displayMatches);\n\n document.addEventListener(\n \"click\",\n function() {\n if (\n !(event.target === searchInput || suggestions.contains(event.target))\n )\n removeChildren(suggestions);\n },\n true\n );\n }", "triggersearch(){\r\n\t\t\tlet query='';\r\n\t\t\tif(this.props.keyword){\r\n\t\t\t\tquery=this.props.keyword\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tquery=this.props.query\r\n\t\t\t}\r\n\t\t\tthis.props.fetchSearchResults(query);\r\n\t}", "function enterSearch(event) {\n if (event.keyCode == 13) {\n Search();\n }\n}", "function search() {\n\tvar query = $(\".searchfield\").val();\n\tif (query == \"\") {\n\t\tdisplaySearchResults(\"\", data, data);\n\t}\n\telse {\n\t\tvar results = idx.search(query);\n\t\tdisplaySearchResults(query, results, data);\n\t\tga('send', 'event', 'Search', 'submit', query);\n\t}\n}", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }", "handleSearch(e) {\n var text = e.target.value;\n this.props.onSearch(text);\n this.setState({\n queryText: text\n });\n }", "bindings() {\n let that = this\n $(`${this.selectors.overlay} .close-icon`).on('click', function () {\n $(that.selectors.overlay).toggleClass(\"minimised\")\n $(`.close-icon > svg`).toggleClass(\"fa-rotate-180\")\n })\n\n this.bindSearch()\n }" ]
[ "0.75486916", "0.7392349", "0.73411644", "0.7178711", "0.7177348", "0.71594834", "0.70945114", "0.7060106", "0.7003046", "0.6943377", "0.6926139", "0.6902265", "0.68957525", "0.6797893", "0.6794089", "0.6768801", "0.67645663", "0.6691853", "0.6634165", "0.6634165", "0.66263837", "0.6588615", "0.6555676", "0.6544096", "0.65325457", "0.6514487", "0.64738375", "0.64689606", "0.6461303", "0.6438481", "0.64184076", "0.6381082", "0.63670564", "0.63649845", "0.63642126", "0.63234067", "0.63218576", "0.6310273", "0.6305544", "0.6279232", "0.627257", "0.6266906", "0.626375", "0.626375", "0.6257654", "0.6250921", "0.6244403", "0.6236186", "0.62306905", "0.6218627", "0.6209562", "0.6206861", "0.6199758", "0.6197681", "0.6194381", "0.6172835", "0.61697185", "0.61638033", "0.6161349", "0.6161295", "0.6155866", "0.6149931", "0.61425817", "0.61421835", "0.6137304", "0.6105722", "0.610257", "0.60975194", "0.60923153", "0.6087127", "0.60859174", "0.6083524", "0.60797226", "0.60786384", "0.60786384", "0.6073608", "0.6071558", "0.60688645", "0.6058418", "0.604506", "0.6043348", "0.6037286", "0.6031425", "0.6028985", "0.60216", "0.601426", "0.6006544", "0.5977822", "0.5977225", "0.59759223", "0.5975352", "0.5968121", "0.59605426", "0.595623", "0.59553516", "0.59543395", "0.5950239", "0.5950239", "0.59486634", "0.59419715" ]
0.8257948
0
Show data loaded text then hide it after one second.
function showDataIsLoaded() { let loadingIndicator = document.getElementById("loadingIndicator"); loadingIndicator.innerHTML = "Data loaded!"; setTimeout(() => loadingIndicator.style.display = "none", 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadAndDisplay() {\n $(\"#hideBox\").delay(800).fadeOut('fast', function() {\n $(\"#resultsByTime\").show();\n });\n }", "function showLoading() {\n loading.classList.add(\"show\");\n setTimeout(callData, 2000);\n }", "function infoFunc(txt) {\r\n info.style.display = \"block\";\r\n info.textContent = txt;\r\n setTimeout(() => { info.style.display = \"none\" }, (1000 * 9))\r\n}", "function showText () {\n window.setTimeout(function () {\n document.getElementById('titleRightPic').style.visibility = 'hidden';\n document.getElementById('titleRightText').style.display = 'block';\n document.getElementById('titleLeftPic').style.visibility = 'hidden'; \n document.getElementById('titleLeftText').style.display = 'block'; \n }, 3500);\n }", "function showComparisonDataBrief() {\n \n // Show the comparison data\n showComparisonData();\n\n // Show the comparison data for a period of time, then hide it\n setTimeout(hideComparisonData, 1000);\n\n}", "function displayLoader() {\n $(\"#loader\").show();\n setTimeout(() => {\n $(\"#loader\").hide();\n }, 5000);\n}", "function loading() {\n loader.hidden = false;\n quoteContainer.hidden = true;\n}", "function loading() {\n loader.hidden = false;\n quoteContainer.hidden = true;\n}", "function waitFunction() {\n setTimeout(showDescription, 700);\n }", "function showLoading(show) {\r\n if (show) {\r\n Ext.getBody().mask(loadHtml);\r\n } else {\r\n Ext.getBody().unmask();\r\n }\r\n}", "function showLoading(show) {\r\n if (show) {\r\n Ext.getBody().mask(loadHtml);\r\n } else {\r\n Ext.getBody().unmask();\r\n }\r\n}", "function redraw () {\n $(\"#url-form\").hide();\n $(\"#loading\").show();\n $(\"button[name=redraw]\").hide();\n // Hack to stop the UI from blocking before \"loading\" text shows up.\n window.setTimeout(() => {\n displayContent(currentText);\n }, 100);\n}", "function showloader(){\n $(\".cart-addon-gif\").show();\n $('.pricetitle').hide();\n setTimeout(function(){\n $('.pricetitle').show();\n $(\".cart-addon-gif\").hide();\n }, 200);\n}", "function hideLoadingScreen(){\n $( \".loader\" ).hide();\n $(\".loader-text\").html(\"Cleaning sequences!\");\n}", "function showText() {\n // TODO\n document.getElementById(\"text\").style.display = \"block\";\n document.getElementById(\"more\").innerHTML = \"\";\n }", "function displayResult(id) {\r\n $('.feedback').hide();\r\n $(id).show()\r\n .delay(2000)\r\n .fadeOut('fast');\r\n}", "function waitAndShowTime() {\n\t\taudio.addEventListener('loadeddata', function() {\n\t\t\tshowDuration();\n\t\t\tshowTimeLeft();\n\t\t});\n\t}", "function displayHtml($html, time) {\n time = time || 2000; // default time is two seconds\n $html.show();\n setTimeout(function () {\n $html.hide();\n }, time);\n}", "function showNoDataLoggedText() {\r\n\tdocument.getElementById(\"NoDataLoggedText\").style.display = \"block\";\r\n}", "function contentLoading() {\n hide(topSearch);\n hide(clearSearchIcon);\n //show(loadingContentElement);\n show(\".es-progress-indicator\");\n hide(resultsElement);\n hide(articleDisplay);\n }", "function showLoading() {\n $('#MCLoading')[0].innerHTML = 'Loading ...';\n}", "function displayResult(message) {\n resultDisplay.textContent = message;\n resultDisplay.classList.remove(\"hidden\");\n\n setTimeout(function () {\n resultDisplay.textContent = \"\";\n resultDisplay.classList.add(\"hidden\");\n }, 500);\n\n}", "function delayDisplay() {\n\n\t// Clear dynamic HTML elements\n\tclearElements();\n\n\t// Pick NEXT trivia question with answers\n\tpickQuestion();\n\n\t// Adjust game timer after delaying game for 10 seconds\n\tgameTime += 10;\n\n\t// Reset time for answering trivia question back to 30 seconds\n\tquestionTime = 30;\n\n\t// Render NEXT trivia question and answers (buttons)\n\trenderQuestionAnswers();\n}", "function showLoading() {\n\twindow.status = \"Obtendo informações\";\n\n\tmainContent.style.display = \"none\";\n\tloading.style.display = \"block\";\n}", "function delayShow() {\n if (isManual.value || props.disabled)\n return;\n // renders out the teleport element root.\n showTeleport();\n registerTimeout(show, props.showAfter);\n }", "function showSuccess(html) {\n $('#successbox').html(html);\n $('#successbox').show('slow', function hideLater() {\n setTimeout(function() {\n $('#successbox').hide('slow');\n }, 5000);\n });\n}", "function showData(data) {\n\n _waiting = true;\n\n _currentData = data;\n _shownData = new Array(data.length);\n\n body_container[0].scrollTop = 0;\n\n body[0].innerHTML = '';\n\n self.resize();\n\n resetViewPorts();\n newViewPort();\n\n //setTimeout(function() {\n _showData();\n _waiting = false;\n //}, 1000);\n }", "function loadAPText(obj)\n {\n // load text\n ap.addClass(fadeIn)\n .text(obj);\n // reset AP classes after animation runs\n setTimeout(function()\n {\n ap.removeClass(fadeIn);\n }, fadeTime);\n }", "function loadAndDisplayPatients() {\n $(\"#hideBoxPatients\").delay(1000).fadeOut('fast', function() {\n var oTable = $('#patientTable').dataTable({\n // Options for proper display, sorting with datatables\n \"aoColumnDefs\": [\n { \"aTargets\": [0], \"sType\": \"html\" },\n { \"aTargets\": [4], \"sType\": \"date-uk\" }\n ],\n // FIXME - \"Tous\" not localized\n \"aLengthMenu\": [[10, 100 , -1], [10, 100, \"Tous\"]],\n // Empty sorting means we let sql output handle the sorting\n aaSorting: []\n });\n $(\"#patientOutput\").removeClass('invisible');\n });\n }", "function displayRandomMessage() {\n showHide(loader, logo);\n hide(chosenMessage);\n // hide(favoriteButton);\n var timer;\n timer = setTimeout(showMessage, 1500);\n}", "function show_number_after(delay) {\n jQuery(\"#number\").css(\"visibility\",\"hidden\");\n jQuery(\"#number\").html(outcomes[count]);\n setTimeout(function() {\n jQuery(\"#number\").css(\"visibility\",\"visible\");\n },\n delay);\n }", "function showMessageContent(type, content, time) {\r\n $(\"#SuccessMessageComponent\").hide();\r\n $(\"#WarningMessageComponent\").hide();\r\n $(\"#ErrorMessageComponent\").hide();\r\n var message = '<i class=\"uiIcon' + type + '\"></i> ' + content;\r\n var id = '#' + type + 'MessageComponent';\r\n var timeDisplay = 3000;\r\n $(id).html(message);\r\n $(id).show();\r\n window.scrollTo(0,0);\r\n if(time)\r\n timeDisplay = time;\r\n setTimeout(function(){\r\n $(id).hide();\r\n }, timeDisplay);\r\n}", "function showLoader(showLoader) {\n loader.hidden = !showLoader;\n quoteContainer.hidden = showLoader;\n}", "function showWhenReady() {\n var seconds = self.video.time();\n if (parseFloat(seconds) > startPoint) {\n $loading.remove();\n self.show(callback);\n self.video.removeEvent(\"playback\", showWhenReady);\n }\n }", "function hideLoading() {\n\n\t$('.chat-form').css('visibility', 'visible');\n\t$(\"#loadingGif\").hide();\n\n\t// Clear the text area of text\n\t$(\".input\").val(\"\");\n\n\t// reset the size of the text area\n\t$(\".input\").attr(\"rows\", \"1\");\n}", "function hideLoading()\n{\n\t$('.chat-form').css('visibility', 'visible');\n\t$(\"#loadingGif\").hide();\n\n\t// Clear the text area of text\n\t$(\".input\").val(\"\");\n\n\t// reset the size of the text area\n\t$(\".input\").attr(\"rows\", \"1\");\n\t\n}", "function showInfo(txt, hide) {\n\t$('#info').html('<div class=\"right small\">[<a href=\"#\" onclick=\"hideInfo(); return false;\">close</a>]</div>' + txt);\n\t$('#info').centerInClient();\n\t$('#info').css('display', 'block');\n\tif(hide) {\n\t\ttimerInf = setTimeout(\"hideInfo()\", 3000);\n\t}\n}", "function newsTimeAppear(){\n if (newsHidden){\n setTimeout(newsDisplayTrue, 5000);\n newsHidden = false;\n } \n}", "function loading() {\n\tloader.hidden = false;\n\tmain.hidden = true;\n}", "function showLoader() {\n\tloader.className = 'show';\n\tsetTimeout(() => {\n\t\tloader.className = loader.className.replace('show', '');\n\t}, 90000);\n}", "function delay(objt,visible,time) {\n\tsetTimeout(function(){\n\t\tdocument.getElementById(objt).style.visibility = visible;\n\t},time);\n}", "showContent() {\n if(this.contentShown) return;\n if(articlesBigContainer.selectedArticle !== undefined)\n articlesBigContainer.selectedArticle.hideContent(); // Hides currently selected article\n this.loadText(); // Downloads text from db\n }", "function dataloadingend() {\nvar loader = document.getElementById(\"loader\");\nvar info = document.getElementById(\"info\");\nvar progress = document.getElementById(\"progress\");\nvar count = document.getElementById(\"count\");\nvar time = document.getElementById(\"time\");\nloader.innerHTML = \"\";\ninfo.innerHTML = \"\";\nprogress.innerHTML = \"\";\ncount.innerHTML = \"\";\ntime.innerHTML = \"\";\n}", "function showLoadingSpinner(){\n loader.hidden = false;\n quoteContainer.hidden = true;\n}", "function update_status(text){\n\n setTimeout(function(){\n $('#status').css(\"opacity\",0);\n $('#status').html(text);\n $('#status').css(\"opacity\",1);\n }, 2000);\n \n \n}", "function showCCLoader(type) \n{\n\tif(type=='show')\n\t{\n\t\t$('#ccResultsLoaderTop').show();\n\t}\n\telse\n\t{\n\t\t$('#ccResultsLoaderTop').hide();\n\t\tsetTimeout(function(){hidePersonalisedMessage();},100);\n\t}\n}", "function showText() {\n\tfiglet('Twitch', function(err, data) {\n\t if (err) {\n\t console.log('Something went wrong...');\n\t console.dir(err);\n\t return;\n\t }\n\t console.log(data);\n\t console.log(' Twitch streamers status '.inverse + '\\r\\n');\n\t //console.log('loading...');\n\t});\n}", "function timeSelecionado () {\n\t\t// body...\n\t\tonLoad = true;\n\t\t$(\"#byjson\").remove();\n\t\t// $(\"#introductionTop\").append(\"<b>Appended text</b>\");\n\t\t\tinit();\n\t\t\tanimate();\n\t}", "function callLoad() {\n\t$('#confirmModal').hide();\n\t$('.modal1').show();\n\t$('#loader').show();\n\tmyVar = setTimeout(showFinal, 3000);\n\n}", "function showLoadingView() {\n $loadScreen.show();\n $startGameButton.text(\"Loading...\");\n $gameCategoryRow.empty();\n $gameQuestionsBody.empty();\n $gameBoard.hide();\n\n\n}", "function showToast(text) {\n\tTOAST.textContent = text;\n\tTOAST.classList.toggle('toast__is-hidden');\n\n\tsetTimeout(() => {\n\t\tTOAST.classList.toggle('toast__is-hidden');\n\t}, 4000);\n}", "loadContent(title, text)\n {\n $(\".infoCardContentTitle\").html(title);\n $(\".infoCardContentText\").html(text);\n $(\"#infoCard\").show(500);\n }", "function showMessage () {\n vmSelected.copyTextLen = vmSelected.selectedArrayUpdated.length\n $('#alertMessage').hide()\n $('#alertMessage').css('display', 'inline')\n setTimeout(function () {\n $('#alertMessage').css('display', 'none')\n }, 3000)\n}", "function showLoading() {\n $B.removeClass(\"js-loaded loaded-reveal\").addClass(\"show-loading\");\n $(\".sl-progress span\").css(\"width\", \"0%\");\n }", "function loadshow(){\n $(\"#contentviewadmin\").hide();\n $(\"#loadingview\").fadeIn();\n}", "function action_after_delay_timer2() {\n IDx('response_iframe_id').style.display = 'none';\n IDx('response_img_id').style.display = 'inline';\n }", "function hide_update_text() {\n $('.update_text').hide();\n $('.success_img').hide();\n $('.error_text').hide();\n }", "function display_data(data) {\n\n\tif (data && (data != prev_data)) {\n\t\tsetTimeout(function() {$('div#polling_message').html(data.payload);\t},500);\n\t\tprev_data = data;\n\t}\n}", "function di_loading(val) {\n\tif(val=='show') {\n\t\tdi_jq('#block_div').show();\n\t\tdi_jq('#block_div_loading').show();\n\t}\n\telse{\n\t\tdi_jq('#block_div_loading').hide();\n\t\tdi_jq('#block_div').hide();\n\t}\n}", "function showLoadingAjax () {\n\treplaceHTMLOfElement(contentDiv, '');\n\tshowProgressBar();\n}", "function ProcessingFinished (StatusText) {\r\n\tSetStatus(StatusText);\r\n\tvar objDynaMsg=document.getElementById('dynamsgtext');\r\n\tif (objDynaMsg!=null){\r\n\t\tdocument.getElementById('dynamsg').style.display='none';\r\n\t}\r\n}", "function updateText() {\r\n\r\n timeoutContainer.innerHTML = \"Text updated after waiting 2 seconds\";\r\n }", "function showQuiosqueLoad(){\n $(\"#myloadingDiv\" ).show();\n }", "function show()\n{\n // Restart any timers that were stopped on hide\n\tbgn();\n}", "function displayAnswer(){\n setTimeout(nextQuestion, 7000);\n $(\".game-container\").hide();\n $(\".timer\").hide();\n $(\".correct-answer\").text(currentQuestionData.answer);\n $(\".image\").show().html(\"<img src=\" + currentQuestionData.answerImage + \">\");\n $(\".answer-container\").show();\n }", "function showLoadingView() {\n $loader.css(\"display\", \"block\");\n }", "function showVisualLoading(show) {\n\t\t\tvar toAppend$,\n\t\t\t\tshowMoreBtn$ = jContainer.find('.ASWidget-Stream-ShowMoreBtn');\n\t\t\tgetLoading$().remove();\n\t\t\tif (show) {\n\t\t\t\tif (showMoreBtn$.length) {\n\t\t\t\t\tshowMoreBtn$.parents('.ASWidget-Stream-Showmore').after(getLoading$());\n\t\t\t\t} else {\n\t\t\t\t\tjContainer.parents(\".wbody\").append(getLoading$());\n\t\t\t\t}\n\t\t\t\ttoAppend$ = $('<li/>').addClass('ASWidgetLoadingLi')\n\t\t\t\t\t.append($('<div/>')\n\t\t\t\t\t\t.addClass('activityStreamLoadingContainer ActivityStreamWidgetPost ASWidgetLoadingPost')\n\t\t\t\t\t\t.append(getLoading$()));\n\t\t\t\tjContainer.find(\".streamItems\").prepend(toAppend$);\n\t\t\t}\n\t\t}", "function loading(show=false){\n loadingElement = d3.select(\"#loading\");\n if (show){\n loadingElement.style('display', 'block');\n } else{\n loadingElement.style('display', 'none');\n }\n }", "function displayWaiting() {\n var waiting = graph.selectAll(\".waiting\");\n if (data.length < 3 && waiting[0].length == 0) {\n graph.append(\"text\")\n .attr(\"class\", \"waiting\")\n .attr(\"x\", width/2 - 50)\n .attr(\"y\", height/2)\n .text(\"Waiting for more data...\");\n }\n\n if (data.length >= 3 && waiting[0].length > 0) {\n graph.selectAll(\".waiting\")\n .remove();\n }\n }", "function showLoader() {\n loader.style.display = 'block';\n }", "function showOutput(data) {\n $(\"#title\").text(data.title);\n $(\"#poster\").attr(\"src\", data.poster);\n $(\"#story\").text(data.plot);\n $(\"#released\").text(data.released);\n $(\"#rated\").text(data.rated);\n $(\"#genre\").text(data.genre);\n $(\"#runtime\").text(data.runtime);\n $(\"#director\").text(data.director);\n $(\"#writer\").text(data.writer);\n $(\"#actors\").text(data.actor);\n $(\"#lang\").text(data.language);\n $(\"#country\").text(data.country);\n $(\"#awards\").text(data.awards);\n $(\"#metascore\").text(data.metascore);\n $(\"#imdbrating\").text(data.imdbRating);\n $(\"#imdbvotes\").text(data.imdbVotes);\n $(\"#type\").text(data.type);\n $(\"#year\").text(data.year);\n if (data.type != \"movie\") {\n $(\"#tSeasons\").attr(\"style\", \"visibility: visible\");\n $(\"#totalseason\").attr(\"style\", \"visibility: visible\");\n $(\"#tSeasons\").text(data.tSeason);\n }\n else {\n $(\"#totalseason\").attr(\"style\", \"visibility: hidden\");\n $(\"#tSeasons\").attr(\"style\", \"visibility: hidden\");\n }\n}", "function LoadData() {\n setTimeout(function () {\n fetchingData();\n document.querySelector(\"#LoadData\").disabled = \"true\";\n }, 800);\n}", "function show_lil_msg(content) {\n var lil_msg = $(\"div#lil_msg\");\n $(lil_msg).html(content);\n var ms_to_show = 2600;\n $(lil_msg)\n .fadeIn()\n .delay(ms_to_show)\n .fadeOut();\n}", "function Completo() {\n\n $(\"#divLoading\").hide();\n\n }", "function displayResults() {\n loader.style.display = \"none\";\n resultsDiv.style.display = \"block\";\n}", "function ShowHideLoadingMsg(bShow){\n var oLoadingDiv = document.getElementById('divLoadingMessage');\n oLoadingDiv.style.display= bShow ? \"block\" : \"none\"; \n}", "function delayedHide(messageToShow)\n{\n\tif ( timer )\n\t{\n\t\t// cancel older timeout that would \n\t\t// otherwise hide the hover text.\n\t\tclearTimeout(timer);\n\t}\n\tshowHoverText(messageToShow);\n\ttimer = setTimeout(function() {\n\t\ttimer = setTimeout(hideHoverText, time_limit * 1000);\n\t}, 1300);\n}", "function fecharCarregandoVeiculo() {\n setTimeout(function(){\n $('#carregandoVeiculo').hide();\n \n \n}, 3000);\n}", "function hideLoaderShowContent() {\n const loader = document.getElementById('loader');\n ensureNonNull(loader);\n loader.classList.add('fade-out');\n setTimeout(() => {\n loader.style.display = Display.HIDE;\n const contentElements = document.getElementsByTagName('section');\n const footer = document.getElementsByTagName('footer');\n ensureNonNull(contentElements, loader);\n for (let i = 0; i < contentElements.length; i++) {\n contentElements[i].style.display = Display.SHOW;\n }\n const homeSection = document.getElementById('home');\n ensureNonNull(homeSection);\n homeSection.style.display = Display.SHOW;\n for (let i = 0; i < footer.length; i++) {\n footer[i].style.display = Display.SHOW;\n }\n }, 2000); // duration should be synchronised with fade-out's \n}", "function loading(){\n $('#load').css('display','none');\n}", "function showText(text) {\n playerState = \"locked\";\n $(\"#text\").text(text);\n $(\"#text-box\").show();\n}", "function showHideText_Strat() {\n if(text_Strat.hidden){\n btn_strat.hidden= true;\n intro.hidden = false;\n formEl.hidden = true;\n text_Strat.hidden = false;\n text_Paul.hidden= true;\n btn_paul.hidden=true;\n div_stuff.hidden=true;\n\n body.style.background = \"url('./imgs/homepic.jpg')\";\n body.style.backgroundPosition = \"center\";\n// Making alert to test out setTimeout function\n function tryAlert() {\n alert(\"GO TRY THE LES PAUL!\");\n }\n\n setTimeout( tryAlert, 10000 );\n\n} else {\n btn_strat.hidden =false\n intro.hidden = false;\n formEl.hidden = false;\n text_Strat.hidden = true;\n text_Paul.hidden= true;\n btn_paul.hidden=false;\n div_stuff.hidden=false;\n }\n}", "'mouseenter #csv-helper'(){\n // document.getElementById('csv-helper-text').style.display = 'block';\n $(\"#csv-helper-text\").fadeIn(1000);\n }", "hideLoadingScreen() {\n if (this.minTime > 0) {\n // if a min time was provided, wait for the time period to add 'loaded' class,\n // which starts fade out animation\n setTimeout(() => this.dom.el.classList.add('loaded'), this.minTime);\n \n // calculate fade out animation duration\n const { transitionDuration, transitionDelay } = window.getComputedStyle(this.dom.el);\n let duration = parseInt(transitionDuration.split(',')[0]);\n duration += parseInt(transitionDelay.split(',')[0]);\n\n // when both animation and min time are over, apply 'display: none' to loading screen\n setTimeout(() => this.dom.el.style.display = 'none', (duration * 1000) + this.minTime + 100);\n return;\n }\n \n // start fade out animation\n this.dom.el.classList.add('loaded');\n\n // calculate animation duration\n const { transitionDuration, transitionDelay } = window.getComputedStyle(this.dom.el);\n const duration = parseInt(transitionDuration.split(',')[0]) + parseInt(transitionDelay.split(',')[0]) + 0.1;\n\n // when animation is over, apply 'display: none' to loading screen\n setTimeout(() => this.dom.el.style.display = 'none', duration * 1000);\n }", "function showCargaAcademicainfoAcademicaDefectoAno(id){ \n alerta_principal=$(\"#alerta_principal\");\n alerta_principal.html(\"Cargando Detalles de Carga Academica...........\");\n alerta_principal.show();\n $.get(entorno+\"cargaAcademica/\"+id+\"/show\",function(data){\n $(\"#tab5-0\").html(data); \n alerta_principal.html(\"Listo\");alerta_principal.hide(5000);\n \n }); \n}", "function displayFire() {\n fireElem.style.visibility = 'visible';\n setTimeout(hideFire, 200);\n}", "function showLoader() {\n\n loader.style.display = \"block\";\n\n }", "function info(id, message, seconds){\n clearTimeout(window[\"timeout_\"+id]);\n $(id).update(message);\n if (message)\n $(id).show();\n else\n $(id).hide();\n if (seconds) {\n window[\"timeout_\"+id] = setTimeout(function(){\n info(id); // hide message after sencods\n }, seconds*1000);\n }\n}", "function hideInfo() {\n\t$('#info').html('<!-- i -->');\n\t$('#info').css('display', 'none');\n\ttimerInf = \"\";\n}", "function showAndFadeErrorText(idElement, message) {\n\t\t$(idElement).removeClass('hidden').text(message);\n\t\tsetTimeout(function(){\n\t\t\t$(idElement).text('').addClass('hidden')\n\t\t}, 3000);\n\t}", "function showLoadingView() {\n $('#gameboard').html('');\n $('#new-game-btn').text('Loading...');\n $('#loading-gif').removeClass('hidden');\n}", "function messageDisplay() {\n\n message.style.display = 'block';\n setTimeout( function() {\n message.style.display = 'none';\n }, 1000);\n\n}", "function NODATA(){\n $(\"#groupinfo\").hide();\n $(\"#nodata\").show();\n $(\"#loadicon\").hide().data('spinner').stop();\n}", "function showMessage(messageText) {\n\t\t$(\"#form-mensagem\").html(messageText);\n\t\t$(\"#form-mensagem\").fadeIn(tempo);\n\n\t\tsetTimeout(function() {\n\t\t\t$(\"#form-mensagem\").fadeOut(tempo);\n\t\t}, 3000);\n\t}", "function showAnimation() {\n // $(\"#info\").html(words[index][1]);\n $(\"info\").show();\n document.getElementById(\"info\").innerHTML = \"Correct! \" + words[index][0] + \" belongs in the \" + words[index][1] + \" bin\";\n $(\"info\").fadeOut();\n }", "function showNoResponseText() {\n setTimeout(function(){\n $('.review-no-response').show();\n\n setTimeout(function(){\n $('body').addClass('rattle');\n }, 200);\n\n }, fadeInDelay);\n setTimeout(function(){\n loadNewReview();\n }, fadeInDelay * 3);\n\n}", "function showAlertDiv(name, price) {\n $(\".alertingdivbg\").show();\n $(\".alertingdiv\")[0].innerHTML = \"<span>Se a&ntildeadió: <br><b> \" +name + \"</b> por <b>$\" + price + \" </b><br> al carrito</span>\"\n setTimeout(function () {\n $(\".alertingdivbg\").hide();\n },1000)\n}", "function rate_loading_text() {\n\tdocument.getElementById('post-ratings-' + post_id + '-loading').style.display = 'block';\n}", "function showDebrief() {\n hideElements(); \n $('#instructions').show();\n $('#instructions').load('html/debrief.html', function () {\n $('#subid').text(subjectID);\n });\n}", "function show_tid() {\n tid_cache_.style.display = 'block';\n tid_hidden_ = false;\n }" ]
[ "0.73404324", "0.69087374", "0.6868067", "0.67688966", "0.6656473", "0.6454247", "0.6433648", "0.6433648", "0.6414432", "0.64014715", "0.64014715", "0.6391693", "0.638427", "0.6366506", "0.6333692", "0.63213426", "0.63101715", "0.62784857", "0.62565607", "0.6250191", "0.624738", "0.62454545", "0.62229115", "0.62215084", "0.6190354", "0.6183657", "0.6181479", "0.6172077", "0.6171532", "0.61593205", "0.6150608", "0.6145531", "0.61424375", "0.6117396", "0.6107106", "0.60957026", "0.6095481", "0.60853314", "0.6081142", "0.608039", "0.6071179", "0.6058627", "0.6049762", "0.60492676", "0.60426813", "0.60206246", "0.60185516", "0.60111064", "0.6009716", "0.60084593", "0.6005741", "0.6005102", "0.6001479", "0.6001084", "0.600022", "0.5993645", "0.5990234", "0.59895706", "0.59820044", "0.5977283", "0.5974798", "0.59729916", "0.59589344", "0.5947665", "0.59353864", "0.59321547", "0.5931326", "0.59299594", "0.59294283", "0.5921831", "0.59167975", "0.59028494", "0.59013456", "0.5899962", "0.5899194", "0.5899094", "0.58864236", "0.58804375", "0.58790797", "0.58648133", "0.58610183", "0.5860451", "0.5857634", "0.58551574", "0.58498394", "0.58481324", "0.5836", "0.583039", "0.58282536", "0.582775", "0.58248067", "0.5824215", "0.5821468", "0.5820701", "0.5818093", "0.5815772", "0.5815059", "0.5814896", "0.5814614", "0.581269" ]
0.7029414
1
Bouton pour continuer de jouer.
function continu() { let button = document.createElement("button"); button.addEventListener("click", function (){ playComputer(); }) button.innerHTML = "Continuer"; container.appendChild(button); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onFinish() {\n\t\tclbk();\n\t}", "function boucleJeu() {\n\n var nouvelInterval = Date.now();\n\n\n\n //SI au premier instant du jeu on initialise le debut de l'interval a quelque chose\n if (!debutInterval) {\n debutInterval = Date.now();\n }\n\n gestionnaireObjets.repositionnerObjets(Bouteille, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Obstacle, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Voiture, nouvelInterval);\n\n\n //Si le nouveau temps est plus grand que l'accelaration souhaiter par rapport au début de l'interval\n if (nouvelInterval - debutInterval >= 20) {\n vitesseRoute += 0.005;\n\n debutInterval = nouvelInterval;\n }\n\n //Appliquer les déplacements\n gestionnaireObjets.deplacerLesObjets(vitesseRoute);\n }", "function handleContinuation(kont)\n{\n kont.continuation(kont);\n}", "function jouer(){\n\t\tafficheScoreCook();\n\t\tstart('180');\t\n}", "function Continuation() {}", "function parar(){\r\n clearInterval(inicioC)\r\n botaoContinuar.addEventListener('click', continuar)\r\n}", "_onEnd() {}", "function continuar(){\r\n\r\n clearInterval(inicioC)\r\n iniciar()\r\n botaoContinuar.removeEventListener('click', continuar)\r\n\r\n}", "onFinish() {}", "begin () {\n this.container.classList.remove('visible')\n this.callback(this.cargo)\n }", "end() {\n this.status = 'finished';\n }", "function bridjeActionExecutionComplete()\n{\n initBridjeActionElements();\n window.bootstrapActionExecutionComplete && bootstrapActionExecutionComplete();\n}", "avancer() {\n\t\tlet fermee = this.cellule.ouverture(this.direction);\n\t\tif (fermee) { //il y a un mur\n\t\t\treturn this.finMouvement();\n\t\t} else if (this.verifierBlocage()===true) { //la porte est bloquee\n return this.finMouvement();\n }\n\t\tthis.visuel.style.transitionDuration = (this.animMouvement) + \"ms\";\n\t\tthis.cellule = this.cellule.voisine(this.direction);\n\n console.log(\"Déplacement: \"+[\"↑\",\"→\",\"↓\",\"←\"][this.direction]+\" / \"+this.cellule.infoDebogage());\n\n\t\tthis.visuel.addEventListener('transitionend', this.evt.visuel.transitionend);\n\t}", "function continuar() {\n emp2=new Date(); //fecha actual\n emp2=emp2.getTime(); //pasar a tiempo Unix\n emp3=emp2-cro; //restar tiempo anterior\n emp=new Date(); //nueva fecha inicial para pasar al temporizador \n emp.setTime(emp3); //datos para nueva fecha inicial.\n elcrono=setInterval(tiempo,10); //activar temporizador\n marcha=1; //indicar que esta en marcha\n document.cron.boton2.value=\"parar\"; //Cambiar estado del botón\n document.cron.boton1.disabled=false; //activar boton 1 si estuviera desactivado\n }", "function acertou() {\n alert(\"Acertei de Novo!\");\n start(false);\n}", "function startCallback() {\n currentlyCompiling += 1;\n }", "function breakFinished(){\n\n //Update\n MODE = 'session'\n $('#pomodoro').animateCss('flip');\n $(\"#mode\").html(\"Session\");\n\n //Reset Break Timer\n BREAKTIME = ONEMINUTE * BREAKCOUNTER;\n REFERENCE = BASICTIMER;\n $(\"#pomodoro #progress\").css('background', '#C66C34').css('width', '100%');\n\n\n //Start interval for normal\n pomodoroClick();\n\n}", "function onEnd() {\n\t\t\tif ( ++counter === total ) {\n\t\t\t\tif ( clbk ) {\n\t\t\t\t\tclbk();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "complete() {}", "function recorrerBajada() {\n nuevaPosicion();\n $('.bajada').animate({'left': '150%'}, tempo, function() {\n actualizarBajada();\n });\n\n // Iniciar BANDAA\n animarBandaA();\n // Iniciar BANDAB\n animarBandaB();\n // Iniciar BANDAC\n animarBandaC();\n }", "async 'after sunbath' () {\n console.log( 'see? I appear here because of the first custom above' )\n }", "changerJoueur() {\n this.indexJoueurActuel = !this.indexJoueurActuel;\n }", "function principal() {\n choquecuerpo();\n choquepared();\n dibujar();\n movimiento();\n \n if(cabeza.choque (comida)){\n comida.colocar();\n cabeza.meter();\n } \n}", "canceled() {}", "startJourney() {\n this.running = true;\n this.previousTime = false;\n this.ui.notify('The journey through the wasteland begins', 'positive');\n this.step();\n }", "finish() {}", "start() {// [3]\n }", "function cone() {\n\n}", "function finished(err){\n }", "bark() {\n console.log('gau gau...');\n }", "end(){\n this.request({\"component\":this.component,\"method\":\"end\",\"args\":[\"\"]})\n this.running = false\n }", "onEnd() {\n\t\tthis.debug('onEnd');\n\t}", "function play()\n{\n // Ajoute un son aleatoire a la sequence (lettre)\n sequence = \"BVRJB\"\n\n // Joue la sequence\n i = 0;\n const metronome = setInterval( function () {\n joueSon(sequence[i++]);\n if (i >= sequence.length) clearInterval(metronome);\n }, 1000);\n\n // Attend que le joueur la sequence \n\n // Si le joueur se trompe, fin du jeu\n\n // sinon on recommence\n}", "function startRitual() {\n\tconsole.log(\"** glitter **\");\n\tflash(pump);\n}", "function onloevha() {\n}", "function confirmarLiz () {\n\tliz.lizOK = true;\n\tdibujar();\n}", "function bouger() {\n console.log(\"Animation logo activée\");\n $('.image')\n .transition({\n debug: true,\n animation: 'jiggle',\n duration: 500,\n interval: 200\n })\n ;\n}", "startBraking () {\n this._parent._send('motorBrake', {motorIndex: this._index});\n this._isOn = false;\n this._setNewTimeout(this.setMotorOff, WeDo2Motor.BRAKE_TIME_MS);\n }", "onComplete() {// Do nothing, this is defined for flow if extended classes implement this function\n }", "function blanco(elemento){\n if (tiempoJuego > 0) \n {\n $(elemento).animate(\n {\n 'color': \"white\"\n }, 500, function()\n {\n amarillo(elemento);\n }\n );\n }\n}", "function finish() {\n// if (--finished == 0) {\n if (!isFinished) {\n isFinished = true;\n Physics.there.style(self.from.getContainerBodyId(), {\n opacity: 0\n });\n\n self.dfd.resolve();\n }\n }", "function basculeJoueur() {\r\n //Verifie si il reste des tours\r\n endgame();\r\n //Change la valeur du joueur actif\r\n if (playerActive === 2) {\r\n playerActive = 1;\r\n } else if (playerActive === 1) {\r\n playerActive = 2;\r\n }\r\n //Reinitialise le compteur de tours du place jeton\r\n i = 0;\r\n //Rappel le tour joueur\r\n tourJoueur();\r\n}", "function onFinish() {\n console.log('finished!');\n}", "function taoTroChoi() {\n clearInterval(interval);\n KhoiTao();\n TaoHinhMoi();\n Thua = false;\n interval = setInterval( vongLap, Tocdo)\n}", "function ActionMoi(valeur)\r\n{\r\n\tclearInterval(chrono);\r\n\ttemps = 100;\r\n\tSetActionMoi(valeur);\r\n\tTourSuivantVerification();\r\n}", "finish() {\n this.done = true;\n }", "async onFinished() {}", "static bienvenida(){\n\t \treturn `Bienvenido al cajero`;\n\t }", "function ObserverButton() {\n\tclearTimeout(nextRound);\n\tclearTimeout(roundProgress);\n\tRoundTimer();\n}", "function amarillo(elemento){\n if (tiempoJuego > 0) \n {\n $(elemento).animate(\n {\n 'color': \"yellow\"\n }, 500, function()\n {\n blanco(elemento);\n }\n );\n }\n}", "function letra(key){\n\tif(letra_buscar == key.text()){\n\n\t\tkey.css(\"background-color\", \"green\");\n\n\t\tcontP++;\n\n\t\tif(contB == contP){\n\n\t\t\tmostrarMensaje(\"../../imagen/icon/exito.png\",\"lenguaje/felicitaciones.webm\",\"../../audio/efecto_sonido/felicitaciones.ogg\");\n\n\t\t\tfin = getActual();\t\n\n\t\t\tanotarDesempeno();\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tcargarActividad();\n\t\t\t}, 3000);\n\n\t\t\t$(\"#intentoCont\").val(0);\n\t\t\tcontP = 0;\n\t\t}\n\t}\n\telse{\n\t\tkey.css(\"background-color\", \"red\");\n\n\t\tsetTimeout(function(){\n\t\t\tkey.css(\"background-color\", \"#81c8ce\");\n\t\t}, 3000);\n\n\t\t$(\"#intentoCont\").val( parseInt($(\"#intentoCont\").val()) + 1 );\n\t}\n}", "function complete() {\n Y.log('complete');\n }", "function gereTourCombat() {\r\n // SI tourJoueur1 = 0 au départ TOUR JOUEUR 1\r\n if(tourJoueur1 < 1) { // tourJoueur1 vaut 0 au début\r\n joueur2.passeSonTourAu(joueur1); // Change le texte de MON TOUR dans l'ATH des joueurs en OUI ou NON\r\n AttaqueOuDefense(); // Demande au joueur 2 de choisir si il attaque ou se défend\r\n tourJoueur1++; // mais il vaudra 1 pour la fonction et pour passer de tour\r\n } else {\r\n joueur1.passeSonTourAu(joueur2);\r\n AttaqueOuDefense();\r\n tourJoueur1--;\r\n }\r\n}", "onCommitted() {\n this.committed.raise();\n }", "function FimJogo(){\n\t\tswitch(_vitoria){\n\t\t\tcase 1:AnunciarVitoria(1);p1.Vencer();break;\n\t\t\tcase 2:AnunciarVitoria(2);p2.Vencer();break;\n\t\t\tcase 4:AnunciarVitoria(3);p3.Vencer();break;\n\t\t\tcase 8:AnunciarVitoria(4);p4.Vencer();break;\n\t\t\tcase 0:AnunciarVitoria(0);AnimacaoEmpate();break;\n\t\t\tdefault:if(_minutos==0 && _segundos==0){AnunciarVitoria(0);AnimacaoEmpate();}break;\n\t\t}\n\t}", "function mensajeBienvenida() {\n console.log(\"Bienvenido a Fabrega!\")\n console.log(\"Ingrese código de artículo a comprar: \")\n console.log(\"0001-Televisor\\n0002-Computadora\\n0003-Heladera\")\n}", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function exitoCallback(resultado) {\n console.log(\"Tuvo éxito con \" + resultado);\n }", "crier() {\n this.cri.visible = true;\n this.cri.gotoAndPlay(0);\n }", "onMessageEnd() { }", "function jogar(){\r\n //o jogo continuará até que alguém destrua completamente os navios do adversário\r\n //testa após cada jogada se o número de pontos foi atingido\r\n while (true){\r\n jogadorJoga();\r\n console.log(\"O computador tem \"+naviosComputador);\r\n if (pontosJogador == naviosComputador){\r\n console.log(nome+\" ganhou! Parabéns!\");\r\n break;\r\n }\r\n else {\r\n computadorJoga();\r\n if (pontosComputador == naviosJogador){\r\n console.log(\"Computador ganhou! Tente novamente, \"+nome);\r\n break;\r\n }\r\n };\r\n }\r\n}", "function fin() {\n //ponemos el contados y el tiempo final a 0\n contador = 0;\n tiempoFinal = 0;\n console.log('fin');\n\n //desbloqueamos el boton de finalizar para que puedan guardar el movimiento\n document.getElementById('siguiente').innerHTML = '<b>FINALIZAR</b>';\n document.getElementById('siguiente').disabled = false;\n document.getElementById('siguiente').style.backgroundColor = 'rgb(3, 119, 25)';\n}", "onprogress() {}", "function Usagi() {\n\tplayer.GetComponent(PlayerMovement).BecomeBunny(this.bunnyTime);\n}", "jump() {\n\t\t// \n\t}", "finish() {\n\t\tthis.IS_STARTED = false;\n\t}", "function atirar(){\n\tif(jogoEmAndamento==true){\n\t\tif(jogador.getMunicao()>0){\n\t\t\tvar audio = new Audio('tiro.wav');\n\t\t\taudio.play();\n\t\t\tjogador.setMunicao(jogador.getMunicao()-1);\n\t\t\tbalas.push(new bala);\n\t\t}\n\t}\n}", "function startWait(){\n let loader = document.getElementsByClassName(\"loader\")[0];\n loader.style.display = 'block';\n document.getElementsByTagName(\"BODY\")[0].style.cursor = \"wait !important\"; \n nanobar.go( 30 );\n}", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "function animacaoJogo(){\n __life.step();\n __life.desenhaGrid(window.ctx);\n window.idTimeoutJogo = setTimeout(animacaoJogo, 10);\n }", "function Waiter() {}", "function executarLooping() {\n moverFundo()\n moverHelicopteroInimigo()\n moverCaminhao()\n moverJogador()\n moverAliado()\n detectarColisoes()\n mostrarPlacar()\n atualizarEnergia()\n}", "function primerBoton(){\r\n alert(\"Hiciste click en el primer boton\");\r\n}", "function onFinish() {\n console.log('finished playing');\n window.location = 'http://www.theplanaproj.com/';\n }", "function miFuncionCallback(){\n console.log(\"Saludo asíncrono despues de 3 segundos...\");\n}", "finishProcessing() {\n this.busy = false;\n this.successful = true;\n }", "wait() {\r\n this._wait = true;\r\n }", "function Bouncer(thismarker, l) {\n thismarker.setAnimation(google.maps.Animation.BOUNCE);\n var thatmarker = thismarker;\n setTimeout(function() {\n thatmarker.setAnimation(null);\n }, 2800);\n populateInfoWindow(thismarker, largeInfoWindow, l);\n }", "function activar1(quien, objeto) {\r\n if (objeto === void 0) { objeto = 'batisenal'; }\r\n var mensaje = quien + \" activo la \" + objeto;\r\n console.log('El mensaje es: ', mensaje);\r\n}", "function chortle() {\n\n writeToConsoleBool = true;\n writeConsoleText(`chortle!!!`);\n\n if (chortleImgsIndex < chortleImgs.length - 1) {\n chortleImgsIndex++;\n } else {\n\n chortleImgsIndex = 0;\n }\n\n actionAnimating = true;\n executeAction = 'chortle';\n}", "function simple(){\n aff('Exercice n°01 : Bienvenue');\n var name = 'loic';\n aff(`Bienvenue à vous -> ${name} !`);\n jump();\n}", "function btnClick() {\n\t//On écoute l'évènement du clic sur le bouton d'ajout au panier\n\tbouton.addEventListener(\"click\", () => {\n\t if (quantiteProduit.value >= 1 && quantiteProduit.value <= 20) { //On borne la quantité entre 1 et 20 articles\n\t\t //Si la quantité est correcte, on lance la fonction pour ajouter notre produit\n\t\t ajouterProduit();\n\t\t // Puis on réinitialise l'input de quantité à 1\n\t\t quantiteProduit.value = 1;\n\t\t} else { //Si une mauvaise quantité de produits a été entrée, on affiche un message d'erreur\n\t\terreurQte.style.color = \"#ba7894\";\n\t\terreurQte.style.fontWeight = \"bold\";\n\t\terreurQte.innerHTML = \"La quantité doit être d'au moins 1 article et ne doit pas excéder 20 articles.\";\n\t\tsetTimeout(function() {\n\t\t\terreurQte.innerHTML = \"\";\n\t\t},5000);\n\t}\n});\n}", "function reactionButton1 () {\n t0 = new Date(); // Anfangszeitpunkt (s) \n on = true; // Animation einschalten\n order(); // Falls nötig, Nummerierung der Einzelkräfte ändern\n }", "function manualBreak() {\n stopTimer();\n Vars.TimerRunnig = false;\n Vars.onBreak = true;\n Vars.Timer = Consts.POMODORO_DONE_TEXT;\n}", "end(event) {\n\n }", "function END() {}", "function performer(cb) {\n cb();\n }", "function primero(segundo) {\r\n //Arrow function se puede expresar de esta forma: function(){sentencia a ejecutar}\r\n //()=>{sentencia a ejecutar}\r\n\r\n\r\n setTimeout(() => {\r\n console.log('1.Soy el primer mensaje')\r\n segundo(tercero)\r\n }, 2000)\r\n}", "function activar2(quien, objeto, momento) {\r\n if (objeto === void 0) { objeto = 'batisenal '; }\r\n if (momento) {\r\n var mensaje = quien + \" activo la \" + objeto + \" en la \" + momento;\r\n }\r\n else {\r\n var mensaje = quien + \" activo la \" + objeto + \" \";\r\n }\r\n console.log('El mensaje es: ', mensaje);\r\n}", "function wobbleTheBrain(input){\n\n\t\t\tif(input === 'start'){\n\t\t\t\tjQuery('.Head')\n\t\t\t\t\t.find('#Colors')\n\t\t\t\t\t.css({\n\t\t\t\t\t\t'-webkit-animation-name': 'BRAINITCH',\n\t\t\t\t\t '-webkit-animation-duration': '0.5s',\n\t\t\t\t\t '-webkit-transform-origin': '50% 50%',\n\t\t\t\t\t '-webkit-animation-iteration-count': 'infinite',\n\t\t\t\t\t '-webkit-animation-timing-function': 'linear'\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tjQuery('.Head')\n\t\t\t\t\t.find('#Colors')\n\t\t\t\t\t.css({\n\t\t\t\t\t\t'-webkit-animation-name': '',\n\t\t\t\t\t\t'-webkit-transform': 'translate(0px, 0px) rotate(0deg)'\n\t\t\t\t\t});\n\t\t\t}\n\t\t}", "finishAddingBottle()\n {\n if( this.state.vintage < 1900 || this.state.vintage > 2050 ) {\n alert(\"Le milésime doit être entre 1900 et 2050\");\n }\n else {\n $.ajax({\n url: '/Vinux/addBottle/',\n data: {'denomination_id':this.state.denomination.id, 'producer_id':this.state.producer.id, 'price':this.state.price, 'vintage':this.state.vintage, 'name':this.state.name},\n type:'POST',\n dataType: 'json',\n success: function(data) {\n // this is the output of the request being redirected to getCellar\n this.setState({cellarData: data});\n this.closeModal();\n }.bind(this),\n error:function (xhr, ajaxOptions, thrownError) {\n alert(\"finishAddingBottle; - \" + xhr.status + \" - \" + thrownError );\n }\n });\n this.closeModal();\n }\n }", "terminating() {}", "bell() {\n if (this._soundBell()) {\n this._soundService.playBellSound();\n }\n // if (this._visualBell()) {\n // this.element.classList.add('visual-bell-active');\n // clearTimeout(this._visualBellTimer);\n // this._visualBellTimer = window.setTimeout(() => {\n // this.element.classList.remove('visual-bell-active');\n // }, 200);\n // }\n }", "function sequencing() {\n if (started) {\n $('.simonButton').removeClass('clicks');\n cpuTurn(0);\n playerTurn(0);\n }\n}", "function iniciarJuego() {\n\n\n //se determina el tiempo en milisegundos para ir cambiando\n setInterval(function() {\n segTranscurridos += 1;\n document.getElementById('cronometro').innerHTML = \"Tiempo: \" + segTranscurridos;\n }, 1000);\n\n\n\n //mando llamar la funcion para dibujar solo las minas\n dibujarMinas(ancho, alto, 'bombas');\n campoJuego = crearCampoJuego(ancho, alto, numMinas);\n\n var botonsitos = document.getElementsByName('botonsitos');\n\n for (var i = 0; i < botonsitos.length; i++) {\n document.getElementById(botonsitos[i].id).onclick = posicionactual;\n }\n segTranscurridos = 0;\n}" ]
[ "0.6195545", "0.61410254", "0.60387194", "0.5949616", "0.59375685", "0.5786673", "0.5750555", "0.5680152", "0.5677919", "0.5675547", "0.5653098", "0.5584378", "0.55716354", "0.5549071", "0.5522714", "0.55151117", "0.55028224", "0.54751045", "0.54701453", "0.5444646", "0.5441877", "0.5437855", "0.54181564", "0.5415578", "0.540989", "0.5405693", "0.5398517", "0.53984296", "0.5353733", "0.53365016", "0.5335592", "0.53222436", "0.5308255", "0.53054684", "0.52949977", "0.52780885", "0.52772087", "0.52721846", "0.5270306", "0.5269324", "0.52687275", "0.5267295", "0.5262883", "0.525622", "0.52460283", "0.5242542", "0.52408415", "0.52342236", "0.52087396", "0.52068233", "0.5193443", "0.51898855", "0.5188915", "0.5186188", "0.5185609", "0.51827025", "0.51816875", "0.51816875", "0.51816875", "0.51816875", "0.5173349", "0.5172825", "0.5169985", "0.51692325", "0.5165861", "0.5165628", "0.51504993", "0.5146076", "0.5145215", "0.5136597", "0.5130863", "0.5128946", "0.5128946", "0.5128946", "0.5113003", "0.5110244", "0.510523", "0.51050097", "0.5104441", "0.5104178", "0.5101273", "0.5100965", "0.5091632", "0.50893235", "0.50892895", "0.50880533", "0.5087436", "0.5084429", "0.508212", "0.5075861", "0.50754076", "0.5068103", "0.5064622", "0.5064405", "0.50504136", "0.5044256", "0.50419277", "0.50396425", "0.5038513", "0.5035988" ]
0.5089386
83
Build a destructive iterator for the value list
function iteratorFor(items) { var iterator = { next: function() { var value = items.shift(); return {done: value === undefined, value: value} } }; if (support.iterable) { iterator[Symbol.iterator] = function() { return iterator }; } return iterator }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createIteratorFromValue(value){\n return (function(){\n let used = false;\n\n return {\n next: function(){\n try {\n return used ? {done: true} : {value: value, done: false};\n }\n finally{\n used = !used;\n }\n }\n };\n })();\n }", "*[Symbol.iterator]() {\n for (let current = this.#head.next;\n current != this.#tail;\n current = current.next) {\n yield current.value;\n }\n }", "*values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i];\n if (v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i];\n }\n }\n }", "*[Symbol.iterator]() {\n let values = this.values;\n for (let i = 0; i < values.length; i++)\n yield values[i];\n }", "[Symbol.iterator]() {\n return {\n next: () => {\n let done = !this.hasNext();\n let val = this.next();\n return {\n done: done,\n value: val\n };\n }\n };\n }", "[Symbol.iterator]() {\n return {\n next: () => {\n let done = !this.hasNext();\n let val = this.next();\n return {\n done: done,\n value: val\n };\n }\n };\n }", "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "[Symbol.iterator]() {\n let size = this.size();\n return {\n next: () => {\n size -= 1;\n return {\n value: this.pop(),\n done: size === -1\n };\n }\n };\n }", "*values() {\n\n let current = this[head];\n\n while (current !== null) {\n yield current.data;\n current = current.next;\n }\n }", "[Symbol.iterator]()\n {\n return this._iterate({ wrapPoint:false, includeEmpty:false });\n }", "*[Symbol.iterator]() {\n let i = 0\n while (i < this.size()) {\n yield this.get(i)\n i++\n }\n }", "function iterContinue(value) {\n return { value, done: false };\n}", "function make_list (value, next) {\n\treturn {\n\t\tvalue: value,\n\t\tnext: next\n\t};\n}", "*entries() {\n for (const i of this.#indexes()) {\n if (this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield [this.#keyList[i], this.#valList[i]];\n }\n }\n }", "*[Symbol.iterator]() {\n for (let node = this.first, position = 0; node; position++, node = node.next) {\n yield node.value;\n }\n }", "[Symbol.iterator]() {\n this._update();\n return this._list[Symbol.iterator]();\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n return iterator\n}", "function iterator(next) {\n return { next };\n}", "[Symbol.iterator]() {\n return this.values[Symbol.iterator]();\n }", "[Symbol.iterator]() {\n return this.values[Symbol.iterator]();\n }", "[Symbol.iterator]() {\n return this.items.values();\n }", "*[Symbol.iterator]() {\n let pointer = this.head\n while (pointer) {\n yield pointer\n pointer = pointer.next\n }\n }", "function ListIteratorBackwards__(List__instance) {\n this.List__instance_ = List__instance;\n this.reset()\n }", "function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m)\r\n return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length)\r\n o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n }", "[Symbol.iterator]() {\n let index = -1;\n let keys = Object.keys(this.forecasts);\n return {\n next: () => ({\n value: this.forecasts[keys[++index]], done: !(index in keys)\n })\n };\n }", "[Symbol.iterator]() {\n //we need to set the starting values we'll use in the return val\n let iteratorVariable = 0;\n let lengthOfSet = this.group.length;\n let setArray = this.group;\n //We return the next() function which will then return the appropriate\n //object (including one with done:true when we're out of elements)\n return {\n next() {\n if (iteratorVariable == lengthOfSet) return {\n done: true\n }\n let value = setArray[iteratorVariable];\n iteratorVariable++\n return {\n value: value,\n done: false\n }\n }\n }\n }", "function ListIterator__(List__instance) {\n this.List__instance_ = List__instance;\n this.predicate_ = null;\n this.reset();\n }", "function reject(iterator, context) {\n var results = [];\n this.each(function(value, index) {\n if (!iterator.call(context, value, index))\n results.push(value);\n });\n return results;\n }", "function __values(o) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\n if (m) return m.call(o);\n return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n }", "static from(iter) {\n let outputGroup = new Group();\n let thisIter = iter[Symbol.iterator]();\n let currentVal = thisIter.next();\n\n //loops over the iterable until done is true\n while(!currentVal.done) {\n if(!outputGroup.has(currentVal.value)) {\n outputGroup.add(currentVal.value);\n }\n currentVal = thisIter.next();\n }\n\n //returns the new Group with the iterable's values, non-repeating!\n return outputGroup;\n }", "function __values(o) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\n if (m)\n return m.call(o);\n return {\n next: function () {\n if (o && i >= o.length)\n o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n }", "function backwardsIterator() {\n var array = this;\n var i = array.length;\n return {\n next() {\n var value = array[--i];\n return i < 0 ? { done: true } : { value };\n }\n };\n}", "[Symbol.iterator]() {\n return this.data.values();\n }", "[Symbol.iterator]() {\n return this.data.values();\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n \n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n \n return iterator\n }", "* values() {\n\t\tfor (const [, value] of this) {\n\t\t\tyield value;\n\t\t}\n\t}", "[Symbol.iterator]() {\n return this.storage.values[Symbol.iterator]();\n }", "[Symbol.iterator]() {\n return this.storage.values[Symbol.iterator]();\n }", "function iteratorFor(items) {\n\t\t var iterator = {\n\t\t next: function() {\n\t\t var value = items.shift()\n\t\t return {done: value === undefined, value: value}\n\t\t }\n\t\t }\n\t\t\n\t\t if (support.iterable) {\n\t\t iterator[Symbol.iterator] = function() {\n\t\t return iterator\n\t\t }\n\t\t }\n\t\t\n\t\t return iterator\n\t\t }", "[Symbol.iterator]() {\n let pre = 0, cur = 1;\n // The resulting iterator object has to have a next method:\n return {\n next() {\n // The result of next has to be an object with the property `done` that states whether or not the iterator is done.\n [pre, cur] = [cur, pre + cur];\n if (pre < 1000) return { done: false, value: pre };\n return { done: true };\n }\n }\n }", "function __values(o) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\n if (m) return m.call(o);\n return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n}", "function SetIterator() {}", "*[Symbol.iterator]() {\n const length = this.length;\n for (let i = 0 ; i < length ; i++) {\n yield this.get(i);\n }\n }", "dropWhile(predicate) {\n const self = this;\n return new Seq(function* () {\n const iter = self[Symbol.iterator]();\n while (true) {\n const { value, done } = iter.next();\n if (done)\n break;\n if (!predicate(value)) {\n yield value;\n yield* iterableOfIterator(iter);\n }\n }\n });\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "[Symbol.iterator]() {}", "function keyValueIterable(target) {\n target[Symbol.iterator] = function () {\n const keys = Object.keys(target);\n return {\n next() {\n const done = keys.length === 0;\n const key = keys.shift();\n return {\n done,\n value: [key, target[key]]\n };\n }\n };\n };\n return target;\n}", "*[Symbol.iterator]() {\n let node = this.head;\n\n while(node) {\n yield node;\n node = node.next;\n }\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }" ]
[ "0.6567051", "0.61971587", "0.6129268", "0.60959846", "0.6081213", "0.6081213", "0.60518825", "0.60518825", "0.60518825", "0.60518825", "0.60518825", "0.60395825", "0.6019784", "0.6000144", "0.593555", "0.59003186", "0.5864537", "0.58550805", "0.57782644", "0.57182074", "0.5696546", "0.5678825", "0.5650001", "0.5650001", "0.5626858", "0.5598189", "0.5578078", "0.5562323", "0.5553551", "0.5545673", "0.5522022", "0.5507745", "0.5497337", "0.54833496", "0.54804116", "0.5457861", "0.54544246", "0.54544246", "0.5451051", "0.54476434", "0.54418916", "0.54418916", "0.5426908", "0.542111", "0.5417031", "0.5406467", "0.5405448", "0.5399026", "0.5391502", "0.53890103", "0.53890103", "0.53890103", "0.5386343", "0.53807116", "0.5372553", "0.5366664", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894", "0.5363894" ]
0.0
-1
global document, window, fetch / eslintdisable nonew
function getTotalDistance (result) { var total = 0; var myroute = result.routes[0]; for (var i = 0; i < myroute.legs.length; i++) { total += myroute.legs[i].distance.value; } total /= 1000; return total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function windowFetch() {\n window.fetch = whatwg_fetch__WEBPACK_IMPORTED_MODULE_0__[\"fetch\"];\n }", "function Co() {\n // `document` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof document ? document : null;\n}", "function WKD() {\n this._fetch = typeof window !== 'undefined' ? window.fetch : require('node-fetch');\n}", "function So() {\n // `document` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof document ? document : null;\n}", "function So() {\n // `window` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof window ? window : null;\n}", "function initDocument (document, window) {\n const html = document.childNodes.find(el => el.tagName === 'HTML');\n const documentElement = html || (document.childNodes.length > 0 ? document.childNodes[0] : null);\n const head = html ? html.childNodes.find(el => el.tagName === 'HEAD') : new window.HTMLHeadElement();\n const body = html ? html.childNodes.find(el => el.tagName === 'BODY') : new window.HTMLBodyElement();\n\n document.documentElement = documentElement;\n document.readyState = 'loading';\n document.head = head;\n document.body = body;\n document.location = window.location;\n document.URL = window.location.href;\n document.cookie = '';\n document.referrer = '';\n document.createElement = (tagName, options = {}) => {\n tagName = tagName.toUpperCase();\n const HTMLElementTemplate = window[symbols.htmlTagsSymbol][tagName];\n const element = HTMLElementTemplate ? new HTMLElementTemplate() : new window.HTMLElement(tagName);\n options.is && element.setAttribute('is', options.is);\n return element;\n };\n document.createElementNS = (namespace, tagName, options) => document.createElement(tagName, options);\n document.createDocumentFragment = () => new window.DocumentFragment();\n document.createTextNode = text => new window.Text(text);\n document.createComment = comment => new window.Comment(comment);\n document.createEvent = type => {\n switch (type) {\n case 'KeyboardEvent':\n case 'KeyboardEvents':\n return new KeyboardEvent();\n case 'MouseEvent':\n case 'MouseEvents':\n return new MouseEvent();\n case 'Event':\n case 'Events':\n case 'HTMLEvents':\n return new Event();\n default:\n throw new Error('invalid createEvent type: ' + type);\n }\n };\n document.createRange = () => new Range(window);\n document.importNode = (el, deep) => el.cloneNode(deep);\n document.scripts = utils._makeHtmlCollectionProxy(document.documentElement, 'script');\n document.styleSheets = [];\n document.implementation = new DOMImplementation(window);\n document.resources = new GlobalContext.Resources(); // non-standard\n document.activeElement = body;\n document.open = () => {\n document.innerHTML = '';\n };\n document.close = () => {};\n document.write = htmlString => {\n const childNodes = parse5.parseFragment(htmlString, {\n locationInfo: true,\n }).childNodes.map(childNode => _fromAST(childNode, window, document.body, document, true));\n for (let i = 0; i < childNodes.length; i++) {\n document.body.appendChild(childNodes[i]);\n }\n };\n document.execCommand = command => {\n if (command === 'copy') {\n // nothing\n } else if (command === 'paste') {\n document.dispatchEvent(new Event('paste'));\n }\n };\n document.queryCommandSupported = s => ['copy', 'paste'].includes(s);\n document[symbols.pointerLockElementSymbol] = null;\n document[symbols.fullscreenElementSymbol] = null;\n\n const runElQueue = [];\n const _addRun = fn => {\n (async () => {\n if (!document[symbols.runningSymbol]) {\n document[symbols.runningSymbol] = true;\n\n try {\n await fn();\n } catch(err) {\n console.warn(err.stack);\n }\n\n document[symbols.runningSymbol] = false;\n if (runElQueue.length > 0) {\n _addRun(runElQueue.shift());\n } else {\n document.emit('flush');\n }\n } else {\n runElQueue.push(fn);\n }\n })();\n };\n document[symbols.runningSymbol] = false;\n document[symbols.addRunSymbol] = _addRun;\n\n if (window.top === window) {\n document.addEventListener('pointerlockchange', () => {\n const pointerLockElement = document[symbols.pointerLockElementSymbol];\n \n for (let i = 0; i < GlobalContext.contexts.length; i++) {\n const context = GlobalContext.contexts[i];\n nativeBindings.nativeWindow.setCursorMode(context.getWindowHandle(), !pointerLockElement);\n }\n\n /* const iframes = document.getElementsByTagName('iframe');\n for (let i = 0; i < iframes.length; i++) {\n const iframe = iframes[i];\n if (iframe.contentDocument) {\n // iframe.contentDocument._emit('pointerlockchange'); // XXX send this down\n }\n } */\n });\n document.addEventListener('fullscreenchange', () => {\n const fullscreenElement = document[symbols.fullscreenElementSymbol];\n \n for (let i = 0; i < GlobalContext.contexts.length; i++) {\n const context = GlobalContext.contexts[i];\n nativeBindings.nativeWindow.setFullscreen(context.getWindowHandle(), !!fullscreenElement);\n }\n \n /* const iframes = document.getElementsByTagName('iframe');\n for (let i = 0; i < iframes.length; i++) {\n const iframe = iframes[i];\n if (iframe.contentDocument) {\n // iframe.contentDocument._emit('pointerlockchange'); // XXX send this down\n iframe.contentDocument._emit('fullscreenchange');\n }\n } */\n });\n }\n\n process.nextTick(async () => {\n if (body) {\n const bodyChildNodes = body.childNodes;\n body.childNodes = new window.NodeList();\n\n try {\n await GlobalContext._runHtml(document.head, window);\n } catch(err) {\n console.warn(err);\n }\n\n body.childNodes = bodyChildNodes;\n body._emit('children', Array.from(bodyChildNodes), [], null, null);\n\n try {\n await GlobalContext._runHtml(document.body, window);\n } catch(err) {\n console.warn(err);\n }\n\n document.readyState = 'interactive';\n document.dispatchEvent(new Event('readystatechange', {target: document}));\n\n document.dispatchEvent(new Event('DOMContentLoaded', {\n target: document,\n bubbles: true,\n }));\n } else {\n try {\n await GlobalContext._runHtml(document, window);\n } catch(err) {\n console.warn(err);\n }\n\n document.readyState = 'interactive';\n document.dispatchEvent(new Event('readystatechange', {target: document}));\n\n document.dispatchEvent(new Event('DOMContentLoaded', {\n target: document,\n bubbles: true,\n }));\n }\n\n document.readyState = 'complete';\n document.dispatchEvent(new Event('readystatechange', {target: document}));\n\n document.dispatchEvent(new Event('load', {target: document}));\n window.dispatchEvent(new Event('load', {target: window}));\n });\n\n return document;\n}", "function No() {\n // `document` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof document ? document : null;\n}", "function setGlobals() {\n const env = (global || window);\n if (!env.hasOwnProperty(\"FormData\")) {\n env.FormData = require(\"form-data\");\n }\n if (!env.hasOwnProperty(\"fetch\")) {\n env.fetch = require(\"node-fetch\");\n }\n}", "function f5() {\n var globalOrLocal = this.document;\n}", "function setUpDomEnvironment() {\n const { JSDOM } = jsdom;\n const dom = new JSDOM('<!doctype html><html lang=\"en\"><body> </body></html>', { url: 'http://localhost/' });\n const { window } = dom;\n\n global.shallow = shallow;\n global.render = render;\n global.mount = mount;\n global.window = window;\n global.document = window.document;\n global.navigator = {\n userAgent: 'node.js',\n };\n copyProps(window, global);\n}", "function initJsdom() {\n var jsdom = require('jsdom').jsdom;\n\n global.document = jsdom('');\n global.window = document.defaultView;\n global['XMLHttpRequest'] = document.defaultView['XMLHttpRequest'];\n}", "static isBrowser() {\n return typeof window !== 'undefined';\n }", "function Sr() {\n // `document` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof document ? document : null;\n}", "function Go() {\n // `document` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof document ? document : null;\n}", "function zo() {\n // `window` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof window ? window : null;\n}", "function isStandardBrowserEnv(){if(typeof navigator!=='undefined'&&(navigator.product==='ReactNative'||navigator.product==='NativeScript'||navigator.product==='NS')){return false;}return typeof window!=='undefined'&&typeof document!=='undefined';}", "function isStandardBrowserEnv(){if(typeof navigator!=='undefined'&&(navigator.product==='ReactNative'||navigator.product==='NativeScript'||navigator.product==='NS')){return false;}return typeof window!=='undefined'&&typeof document!=='undefined';}", "function applyGlobal(plan) {\n handleNormalAttr(plan, 'document');\n}", "function _initJSDom() {\n const jsdom = new JSDOM(\n `<!doctype html><html id=\"main-html\"><body><div id=\"${config.masterElementId}\"></div></body></html>`\n );\n const { window } = jsdom;\n\n global.window = window;\n global.document = window.document;\n global.navigator = {\n userAgent: 'node.js'\n };\n global.jsdom = jsdom;\n global.$IMA = global.$IMA || {};\n global.window.$IMA = global.$IMA;\n global.window.$Debug = global.$Debug;\n global.window.scrollTo = () => {};\n global.window.fetch = require('node-fetch');\n global.sessionStorage = {\n setItem: () => {},\n removeItem: () => {}\n };\n\n // To skip protocol/host not same as server's error (ima/main.js)\n jsdom.reconfigure({\n url: `${config.protocol}//${config.host}/`\n });\n\n global.$IMA.$Protocol = config.protocol;\n global.$IMA.$Host = config.host;\n global.$IMA.$Env = config.environment;\n global.$IMA.$App = {};\n\n // To skip Image is not defined error\n global.Image = global.window.Image;\n // To skip CustomEvent is not defined error\n global.CustomEvent = global.window.CustomEvent;\n }", "function isStandardBrowserEnv(){if(typeof navigator!=='undefined'&&navigator.product==='ReactNative'){return false;}return typeof window!=='undefined'&&typeof document!=='undefined';}", "function isStandardBrowserEnv(){if(typeof navigator!=='undefined'&&navigator.product==='ReactNative'){return false;}return typeof window!=='undefined'&&typeof document!=='undefined';}", "function isStandardBrowserEnv(){if(typeof navigator!=='undefined'&&navigator.product==='ReactNative'){return false;}return typeof window!=='undefined'&&typeof document!=='undefined';}", "function isStandardBrowserEnv(){if(typeof navigator!=='undefined'&&navigator.product==='ReactNative'){return false;}return typeof window!=='undefined'&&typeof document!=='undefined';}", "function browserContext() {\n if (typeof window === 'undefined') return false;\n return true;\n}", "function supportsReferrerPolicy(){if(!supportsFetch())return false;try{// eslint-disable-next-line no-new\nnew Request('pickleRick',{referrerPolicy:'origin'});return true;}catch(e){return false;}}", "function f1() {\n var global1 = this.document;\n var global2 = window.document;\n var global3 = document;\n}", "function or() {\n // `document` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof document ? document : null;\n}", "function hasDocument() {\n return typeof document !== \"undefined\";\n}", "function hasDocument() {\n return typeof document !== \"undefined\";\n}", "function f2() {\n var window = {document: {}};\n var document = {};\n var global1 = this.document;\n var local1 = window.document;\n var local2 = document;\n}", "async function _initJSDom() {\n const content = await _getIMAResponseContent();\n\n // SPA jsdom interpreter\n const jsdom = new JSDOM(content, {\n pretendToBeVisual: true,\n url: `${config.protocol}//${config.host}/`,\n });\n\n // Setup node environment to work with jsdom window\n const { window } = jsdom;\n\n global.window = window;\n global.jsdom = jsdom;\n global.document = window.document;\n\n // Extend node global with created window vars\n Object.defineProperties(global, {\n ...Object.getOwnPropertyDescriptors(window),\n ...Object.getOwnPropertyDescriptors(global),\n });\n\n // set debug before IMA env debug\n global.$Debug = true;\n\n // Mock dictionary\n global.$IMA.i18n = generateDictionary(imaConfig.languages, config.locale);\n\n // Mock scroll for ClientWindow.scrollTo for ima/core page routing scroll\n global.window.scrollTo = () => {};\n\n // Replace window fetch by node fetch\n global.window.fetch = global.fetch;\n\n // Required for JSDOM XPath selectors\n global.console.assert = assert; // eslint-disable-line no-console\n\n // Call all page scripts (jsdom build-in runScript creates new V8 context, unable to mix with node context)\n const pageScripts = jsdom.window.document.getElementsByTagName('script');\n if (typeof config.pageScriptEvalFn === 'function') {\n for (const script of pageScripts) {\n config.pageScriptEvalFn(script);\n }\n }\n }", "fetch(options) {\n if (typeof options.url !== \"string\") {\n throw new TypeError(\"DocumentLoader.fetch: url option must be a string.\");\n }\n // Cancel the previous request if it is still in-flight.\n if (options.concurrent !== true) {\n this.cancelFetch();\n }\n // Parse the request URL\n const docURL = this.prepareURL(options.url);\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", docURL);\n xhr.responseType = \"document\";\n xhr.setRequestHeader(\"cache-control\", \"no-cache\");\n xhr.onload = () => {\n const responseDoc = xhr.response;\n this.prepareDocument(responseDoc);\n if (typeof options.success === \"function\") {\n options.success(responseDoc);\n } else {\n navigationDocument.pushDocument(responseDoc);\n }\n };\n xhr.onerror = () => {\n if (typeof options.error === \"function\") {\n options.error(xhr);\n } else {\n const alertDocument = createLoadErrorAlertDocument(docURL, xhr, true);\n navigationDocument.presentModal(alertDocument);\n }\n };\n xhr.send();\n // Preserve the request so it can be cancelled by the next fetch\n if (options.concurrent !== true) {\n this._fetchXHR = xhr;\n }\n }", "get UseGlobal() {}", "function isStandardBrowserEnv() {\n return typeof window !== 'undefined' && typeof document !== 'undefined' && typeof document.createElement === 'function';\n}", "function isStandardBrowserEnv() {\n return typeof window !== 'undefined' && typeof document !== 'undefined' && typeof document.createElement === 'function';\n}", "function isStandardBrowserEnv() {\n return typeof window !== 'undefined' && typeof document !== 'undefined' && typeof document.createElement === 'function';\n}", "function isStandardBrowserEnv() {\n return typeof window !== 'undefined' && typeof document !== 'undefined' && typeof document.createElement === 'function';\n}", "onDOMReady() {\n return new Promise(resolve => {\n if (document.readyState !== 'loading') {\n resolve()\n } else {\n document.addEventListener('DOMContentLoaded', resolve)\n }\n })\n }", "function initialize(window){\r\n\t\t$document = window.document;\r\n\t\t$location = window.location;\r\n\t\t$cancelAnimationFrame = window.cancelAnimationFrame || window.clearTimeout;\r\n\t\t$requestAnimationFrame = window.requestAnimationFrame || window.setTimeout;\r\n\t}", "function initialize(window){\r\n\t\t$document = window.document;\r\n\t\t$location = window.location;\r\n\t\t$cancelAnimationFrame = window.cancelAnimationFrame || window.clearTimeout;\r\n\t\t$requestAnimationFrame = window.requestAnimationFrame || window.setTimeout;\r\n\t}", "function initialize(window){\r\n\t\t$document = window.document;\r\n\t\t$location = window.location;\r\n\t\t$cancelAnimationFrame = window.cancelAnimationFrame || window.clearTimeout;\r\n\t\t$requestAnimationFrame = window.requestAnimationFrame || window.setTimeout;\r\n\t}", "function initialize(window){\r\n\t\t$document = window.document;\r\n\t\t$location = window.location;\r\n\t\t$cancelAnimationFrame = window.cancelAnimationFrame || window.clearTimeout;\r\n\t\t$requestAnimationFrame = window.requestAnimationFrame || window.setTimeout;\r\n\t}", "fetch(options) {\n if (typeof options.url !== \"string\") {\n throw new TypeError(\"DocumentLoader.fetch: url option must be a string.\");\n }\n // Cancel the previous request if it is still in-flight.\n if (options.concurrent !== true) {\n this.cancelFetch();\n }\n // Parse the request URL\n const docURL = this.prepareURL(options.url);\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", docURL);\n xhr.responseType = \"document\";\n xhr.onload = () => {\n const responseDoc = xhr.response;\n this.prepareDocument(responseDoc);\n if (typeof options.success === \"function\") {\n options.success(responseDoc);\n } else {\n navigationDocument.pushDocument(responseDoc);\n }\n };\n xhr.onerror = () => {\n if (typeof options.error === \"function\") {\n options.error(xhr);\n } else {\n const alertDocument = createLoadErrorAlertDocument(docURL, xhr, true);\n navigationDocument.presentModal(alertDocument);\n }\n };\n xhr.send();\n // Preserve the request so it can be cancelled by the next fetch\n if (options.concurrent !== true) {\n this._fetchXHR = xhr;\n }\n }", "onBeforeLoad (win) {\n // Just to make sure it's really evident this isn't getting called... call alert()!\n alert('This alert does not happen - it should, though')\n\n // Since onBeforeLoad isn't getting called, we can't erase win.fetch to trigger the actual\n // app code to use XMLHttpRequest (which Cypress knows how to mock).\n win.fetch = null\n }", "function run() {\n 'use strict';\n}", "function getGlobalObject() {\n return (Object(_node__WEBPACK_IMPORTED_MODULE_0__[/* isNodeEnv */ \"b\"])()\n ? global\n : typeof window !== 'undefined'\n ? window\n : typeof self !== 'undefined'\n ? self\n : fallbackGlobalObject);\n}", "function main() {\n window.addEventListener('load', onBodyLoad)\n\n NodeList.prototype.forEach = HTMLCollection.prototype.forEach = Array.prototype.forEach\n\n useCompanion = (location.href.indexOf('?companion') != -1) ||\n (location.href.indexOf('&companion') != -1)\n useLocalServer = (location.href.indexOf('?local') != -1) ||\n (location.href.indexOf('&local') != -1)\n\n slideEls = document.querySelectorAll('.presentation > div')\n}", "function f3() {\n var local1 = this.document;\n}", "function To() {\n // `window` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof window ? window : null;\n}", "static globalize() {\n if (!isBrowser) {\n throw \"Console globalization is not available.\";\n }\n window._console = console;\n window.console = Logger.logger;\n }", "function inBrowser() {\n return typeof window !== 'undefined';\n}", "function mockRequestScope() {\n Object.assign(global, makeServiceWorkerEnv());\n Object.assign(global, { __STATIC_CONTENT_MANIFEST: (0, exports.mockManifest)() });\n Object.assign(global, { __STATIC_CONTENT: (0, exports.mockKV)(store) });\n Object.assign(global, { caches: (0, exports.mockCaches)() });\n}", "function specialRequest(arr){\r\n arr=arr.concat([ //values that I NEED\r\n \"Object.getOwnPropertyDescriptor\",\r\n \"Object.defineProperty\",\r\n \"Document.prototype.createElement\",\r\n \"Document.prototype.removeChild\",\r\n \"Document.prototype.appendChild\",\r\n \"XMLHttpRequest\",\r\n \"XMLHttpRequest.prototype.setRequestHeader\",\r\n \"XMLHttpRequest.prototype.send\"\r\n ])\r\n let arr1=`[${arr.map(a=>\"win.w1.\"+a).join(\",\")}]` //array of required modules in window\r\n let arr2=`[${arr.map(a=>\"win.w2.\"+a).join(\",\")}]` //array of required modules in iframe\r\n \r\n //array of contexts(like for XMLHttpRequest.prototype.send, the context is XMLHttpRequest.prototype)\r\n let context=`[${arr.map(a=>{let x=a.split(\".\");x.splice(x.length-1,1);return \"win.w1.\"+(x.join(\".\")||\"window\")}).join(\",\")}]`\r\n \r\n //array of modules(like for XMLHttpRequest.prototype.send, the module is \"send\")\r\n let _module=JSON.stringify(arr.map(a=>{let x=a.split(\".\");return x[x.length-1]}))\r\n \r\n let toReturn=(`\r\n try{\r\n const win={}; win.toRun=true //object because I wanna delete vars after I'm finished with them >:D\r\n win.iframe=document.createElement('iframe')\r\n win.iframe.src=location.href\r\n document.head.appendChild(win.iframe)\r\n win.fnCheck=function(fn1,fn2){return fn1.name==fn2.name&&''+fn1==''+fn2}\r\n win.w1=window; win.w2=win.iframe.contentWindow\r\n win.arr1=${arr1}\r\n win.arr2=${arr2}\r\n win.context=${context}\r\n win.module=${_module}\r\n win.fullCheck=function(){\r\n let tr=true\r\n for(let i=0;i<win.arr1.length;i++){\r\n let a=win.arr1[i]; let b=win.arr2[i]\r\n if(!win.fnCheck(a,b)){tr=false}\r\n }\r\n return tr\r\n }\r\n if(win.fullCheck()){\r\n for(let i=0;i<win.arr1.length;i++){try{\r\n let o1=Object.getOwnPropertyDescriptor(win.context[i],win.module[i])\r\n o1.configurable=false; o1.writable=false\r\n Object.defineProperty(win.context[i],win.module[i],o1)\r\n }catch(er){/*This would only happen if a module's properties already has configurable:false*/}}\r\n win.xhd=new XMLHttpRequest()\r\n win.xhd.open('POST',location.href,true)\r\n win.xhd.setRequestHeader(\"i\",\"pw\")\r\n win.xhd.setRequestHeader(\"pw\",_pw)\r\n win.xhd.send(); delete(win.toRun)\r\n win.xhd.onload=function(){\r\n delete(win.w1); delete(win.w2); delete(win.context)\r\n delete(win.arr1); delete(win.arr2); delete(win.module)\r\n delete(win.fnCheck); delete(win.fullCheck)\r\n document.head.removeChild(win.iframe); delete(window._pw)\r\n var y=document.createElement('script');y.innerHTML=win.xhd.response\r\n document.body.appendChild(y);document.body.removeChild(y)\r\n delete(win.pw); delete(win.xhd); delete(win.iframe)\r\n }\r\n }\r\n else{toRun=false;while(true){let i=\"Required modules that MUST be in their DEFAULT form are compromised\";try{alert(i);window.close()}catch(err){}}}\r\n }//basically, the window would close or at the very least halt all further processes(through infinite loop) if required modules were tampered\r\n catch(err){toRun=false;while(true){let i=\"Required modules that MUST be in their DEFAULT form are compromised\";try{alert(i);window.close()}catch(err){}}}\r\n `)\r\n return toReturn\r\n}", "function getGlobalObject() {\r\n return isNodeEnv() ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : fallbackGlobalObject;\r\n}", "function getGlobalObject() {\n return (node_1.isNodeEnv()\n ? global\n : typeof window !== 'undefined' // eslint-disable-line no-restricted-globals\n ? window // eslint-disable-line no-restricted-globals\n : typeof self !== 'undefined'\n ? self\n : fallbackGlobalObject);\n}", "function getWindow() {\n return window;\n}", "async function fetchMyDocument(){\r\n const options = {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Access-Control-Allow-Origin' : '*'\r\n },\r\n body: JSON.stringify( {} ) \r\n }\r\n try{\r\n const response = await fetch(url_link)\r\n const resp = await response.json();\r\n document.getElementById(\"json\").innerHTML = resp;\r\n }catch(error){\r\n document.getElementById(\"json\").innerHTML = error;\r\n }\r\n}", "function withSetStateAllowed(fn) {\n // NOTE(lmr):\n // this is currently here to circumvent a React bug where `setState()` is\n // not allowed without global being defined.\n var cleanup = false;\n if (typeof global.document === 'undefined') {\n cleanup = true;\n global.document = {};\n }\n fn();\n if (cleanup) {\n // This works around a bug in node/jest in that developers aren't able to\n // delete things from global when running in a node vm.\n global.document = undefined;\n delete global.document;\n }\n}", "function withSetStateAllowed(fn) {\n // NOTE(lmr):\n // this is currently here to circumvent a React bug where `setState()` is\n // not allowed without global being defined.\n var cleanup = false;\n if (typeof global.document === 'undefined') {\n cleanup = true;\n global.document = {};\n }\n fn();\n if (cleanup) {\n // This works around a bug in node/jest in that developers aren't able to\n // delete things from global when running in a node vm.\n global.document = undefined;\n delete global.document;\n }\n}", "function hooks() {\n \"use strict\";\n}", "async function init() {\n const html = await fetchHtml();\n const tempElm = document.createElement('html');\n tempElm.innerHTML= html.replace(/href=\"./g, `href=\"${packageUrl}/build`).replace(/src=\"./g, `src=\"${packageUrl}/build`);\n \n const scripts = tempElm.querySelectorAll('script');\n const styles = tempElm.querySelectorAll('link[rel=stylesheet]');\n\n // Create root element if not exists\n createRootElm();\n\n // Load RESTool (most recent) styles\n loadStyles(styles);\n\n // Load RESTool (most recent) scripts\n loadScriptsRecursively(Array.apply(null, scripts));\n }", "function getGlobalObject() {\n return isNodeEnv() ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {};\n}", "function isStandardBrowserEnv() {\n\t return typeof window !== 'undefined' && typeof document !== 'undefined' && typeof document.createElement === 'function';\n\t}", "function isStandardBrowserEnv() {\n\t return typeof window !== 'undefined' && typeof document !== 'undefined' && typeof document.createElement === 'function';\n\t}", "function _global$() {\n var _a;\n let _global$ = ('undefined' != typeof globalThis && globalThis.window) ? globalThis.window :\n ('undefined' != typeof window) ? window :\n ('undefined' != typeof globalThis) ? globalThis :\n ('undefined' != typeof __webpack_require__.g && (__webpack_require__.g === null || __webpack_require__.g === void 0 ? void 0 : __webpack_require__.g.window)) ? __webpack_require__.g.window :\n ('undefined' != typeof __webpack_require__.g) ? __webpack_require__.g : null;\n //under test systems we often have a lazy init of the window object under global.window, but we\n //want the window object\n return (_a = _global$ === null || _global$ === void 0 ? void 0 : _global$.window) !== null && _a !== void 0 ? _a : _global$;\n}", "onBeforeLoad(win) { win.fetch = null; }", "function Window() {}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "function isStandardBrowserEnv() {\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof document.createElement === 'function'\n );\n}", "get window() {\n return {\n crypto,\n };\n }", "function isStandardBrowserEnv(){\nif(typeof navigator!=='undefined'&&navigator.product==='ReactNative'){\nreturn false;\n}\nreturn(\ntypeof window!=='undefined'&&\ntypeof document!=='undefined');\n\n}", "static init() {\n if ($('body').hasClass('papi-iframe-mode')) {\n return;\n }\n\n $(document).on('click', 'a.papi-iframe-link-open', function(e) {\n e.preventDefault();\n\n if (typeof window.papi.iframe !== 'undefined') {\n window.papi.iframe.close();\n window.papi.iframe = undefined;\n }\n\n const $this = $(this);\n\n window.papi.iframe = new Iframe({\n selector: $this.data('selector'),\n title: $this.data('title'),\n url: $this.data('url')\n });\n window.papi.iframe.open();\n });\n }", "function mockGlobalScope() {\n Object.assign(global, { __STATIC_CONTENT_MANIFEST: (0, exports.mockManifest)() });\n Object.assign(global, { __STATIC_CONTENT: (0, exports.mockKV)(store) });\n}", "function isBrowser() {\n return typeof window !== 'undefined';\n}", "function isBrowser() {\n return typeof window !== 'undefined';\n}", "function globalizeReact() {\n var global = (function () {\n return this;\n })();\n global.React = global.React || react;\n }", "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}", "function isStandardBrowserEnv() {\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined' &&\n\t typeof document.createElement === 'function'\n\t );\n\t}" ]
[ "0.70870996", "0.6996015", "0.6759757", "0.66159815", "0.645969", "0.6440826", "0.63982975", "0.62370384", "0.61967504", "0.61747456", "0.6103623", "0.59823287", "0.5959121", "0.5910301", "0.58842325", "0.58611834", "0.58611834", "0.5794507", "0.5778042", "0.5766924", "0.5766924", "0.5766924", "0.5766924", "0.5733818", "0.57211024", "0.5714161", "0.5669874", "0.56252736", "0.56252736", "0.56022155", "0.5551805", "0.5525902", "0.54774433", "0.5473475", "0.5473475", "0.5473475", "0.5473475", "0.5461413", "0.5454912", "0.5454912", "0.5454912", "0.5454912", "0.5454305", "0.5454086", "0.5452887", "0.5451193", "0.5448913", "0.54451656", "0.5443626", "0.5441706", "0.54369617", "0.54317826", "0.5428283", "0.5406102", "0.539768", "0.5390483", "0.5388344", "0.5388209", "0.5388209", "0.53792465", "0.5373955", "0.536955", "0.5363603", "0.5363603", "0.5360992", "0.53522366", "0.5350322", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.5333679", "0.53195477", "0.52986103", "0.5283881", "0.5273938", "0.527034", "0.527034", "0.5236767", "0.52296627", "0.52296627", "0.52296627", "0.52296627", "0.52296627", "0.52296627" ]
0.0
-1
Method to handle click events on the criteria buttons Should take users to the tab of the targeted criteriaz
handleClick(key, category, e) { e.preventDefault(); e.stopPropagation(); const interpretation = this.props.interpretation; const selectedTab = this.state.selectedTab; const selectedSubtab = queryKeyValue('subtab', window.location.href); const selectedCriteria = queryKeyValue('criteria', window.location.href); if (interpretation) { if (selectedTab) { window.history.replaceState(window.state, '', editQueryValue(window.location.href, 'tab', mappingTab[category])); } else { window.history.replaceState(window.state, '', addQueryKey(window.location.href, 'tab', mappingTab[category])); } if (selectedSubtab) { if (mappingSubtab[key]) { window.history.replaceState(window.state, '', editQueryValue(window.location.href, 'subtab', mappingSubtab[key])); } else { window.history.replaceState(window.state, '', editQueryValue(window.location.href, 'subtab', '')); } } else { if (mappingSubtab[key]) { window.history.replaceState(window.state, '', addQueryKey(window.location.href, 'subtab', mappingSubtab[key])); } } if (selectedCriteria) { window.history.replaceState(window.state, '', editQueryValue(window.location.href, 'criteria', key)); } else { window.history.replaceState(window.state, '', addQueryKey(window.location.href, 'criteria', key)); } } this.props.updateSelectedCriteria(mappingTab[category], mappingSubtab[key], key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onClick( event ) {\n for( var i = 0; i < _buttons.length; i++ ) {\n var button = _buttons[i];\n \n if( button.contains( event.layerX, event.layerY ) ) {\n actionPerformed( button.getActionCommand() );\n return;\n }\n }\n \n if( event.which == 1 ) {\n location.href = linkHref;\n }\n }", "function chosenClick() {\n if (core || all || career) { // If any other tab is currently open, set them to false and show user's chosen courses\n setAll(false);\n setCore(false);\n setCareer(false);\n setChosen(true);\n }\n }", "function onClickHandler(info, tab) {\n var selectedText = info.selectionText.trim();\n if(selectedText.length == 15) {\n var url = \"https://servicedesk.microsoft.com/#/customer/cases?caseNumber=\" + encodeURIComponent(selectedText);\n window.open(url, '_blank');\n }\n else if(selectedText.length == 9) {\n var url = \"https://portal.microsofticm.com/imp/v3/incidents/details/\" + encodeURIComponent(selectedText);\n window.open(url, '_blank');\n }\n else if(selectedText.length == 7) {\n var url = \"https://dynamicscrm.visualstudio.com/OneCRM/_workitems/edit/\" + encodeURIComponent(selectedText);\n window.open(url, '_blank');\n }\n else {\n var url = \"https://unify.services.dynamics.com/CRM/Collaborations/GlobalSearch?#search=\" + encodeURIComponent(selectedText);\n window.open(url, '_blank');\n }\n }", "function onClickHandler(info, tab) {\r\n var sText = info.selectionText;\r\n\r\n //if raw selectionText search\r\n if (info.menuItemId == \"raw\") {\r\n var url = 'http://jira.motionsoft.com:8080/issues/?jql=text%20~%20\"' + encodeURIComponent(sText) + '\"';\r\n window.open(url, '_blank');\r\n }\r\n //if custom selctionText search **chris' parameters\r\n else if (info.menuItemId == \"custom\") {\r\n var url = 'http://jira.motionsoft.com:8080/issues/?jql=text%20~%20\"' + encodeURIComponent(sText) + '\"%20ORDER%20BY%20created%20DESC';\r\n window.open(url, '_blank');\r\n }\r\n //if jumping directly to selected JIRA ticket number\r\n else if (info.menuItemId == \"direct\") {\r\n //if only the JIRA case number is highligted\r\n if (!isNaN(sText)) {\r\n var url = 'http://jira.motionsoft.com:8080/browse/MOSO-' + sText\r\n window.open(url, '_blank');\r\n }\r\n else {\r\n //if the MOSO-n is also selected, take just the numeric portion\r\n var url = 'http://jira.motionsoft.com:8080/browse/' + sText\r\n window.open(url, '_blank');\r\n }\r\n }\r\n}", "onClickCity(e){\n\n const TABS = document.getElementsByName(\"tabs\")[0];\n\n let target = e.target;\n\n // USE EVENT DELEGATION SO WE ONLY LISTEN TO CLICKS ON THE PARENT ELEMENT INSTEAD OF EVERY CHILD\n if (target.classList.contains(\"block\")){\n\n let tabIndex = target.dataset.index;\n\n // trigger the click on the tab element\n document.querySelectorAll(\".tabs-header--tab\")[tabIndex].click();\n\n // scroll the page to the tabs section\n window.scroll({\n left: 0,\n top: TABS.offsetTop - 60,\n behavior: \"smooth\"\n });\n\n }\n\n\n\n }", "function inviteOthers() {\n //specify inviteContacts as tab so it will customize button\n showTab(\"inviteContacts\");\n}", "function clickParams()\n{\n\tvar model_id = getModelId();\n //changeStartTime();\n\n\tif ((model_id == null) || (model_id < 0))\n\t\treturn;\n\tif ((tab1.modelId == null) || (tab1.modelId != model_id)) {\n\t tab1.modelId = model_id;\n\t tab1.enabled = false;\n\t tab2.enabled = false;\n\t\t tab3.enabled = true;\n\t tab4.enabled = false;\n\t tab5.enabled = false;\n\t tab6.enabled = false;\n tab7.enabled = false;\n tab8.enabled = false;\n\t\t\n\t\tonTabClick(\"btn3\");\n\n\t\tshowModelName();\n\t\tclearModelParams();\n\t\tloadModelParams('false');\n\t} else {\n\t\ttab2.enabled = false;\n\t\ttab3.enabled = true;\n\t\tonTabClick(\"btn3\");\n\t}\n}", "function listenForClick() {\n loopThroughGrid();\n clickTurnBtn();\n }", "function ChartClick(chartReportId, row, col){\n \n var oParams = GetReportParameters();\n\n var sUrl = _reports_CaseListUrl + \"?analysis=1\"\n + \"&Row=\" + row + \"&Col=\" + col + \"&ReportId=\" + chartReportId\n + \"&WorkflowId=\" + oParams.workflowId \n + \"&idWfClass=\" + oParams.wfclassId\n + \"&ReportSetId=\" + oParams.reportSetId\n + \"&StopwatchId=\" + oParams.stopwatchId\n + \"&CounterId=\" + oParams.counterId\n + \"&userFilters=\" + oParams.userFiltersString\n + \"&date=\" + new Date(); \n if(oParams.dateFrom != \"\"){\n sUrl += \"&dtFrom=\" + oParams.dateFrom\n + \"&dtTo=\" + oParams.dateTo\n + \"&history=1\";\n }\n\n var currentUserId = -1;\n if (chartReportId == 33 && _resultTemporal != null) {\n var oResultTable = _resultTemporal.Results[0].resultTable;\n var columnUserId = GetTableColumnIndex(oResultTable, \"iduser\", false);\n currentUserId = oResultTable.rows[row][columnUserId].value;\n }\n \n if(currentUserId >-1) {\n sUrl += \"&currentUserId=\" + currentUserId\n + \"&taskId=\" + _curSelectedTask ;\n \n }\n \n\n\n var arrButtons = [];\n arrButtons[0] = getModalWindowButton(jQuery(\"#hidMsgClose\").val(), \"closeCurrentModalWindow(null);\", false);\n\n\topenModalWindow(sUrl, 1000, 450, arrButtons, true);\n\n}", "function careerClick() {\n if (core || all || chosen) { // If any other tab is currently open, set them to false and show career specific courses\n setAll(false);\n setCore(false);\n setCareer(true);\n setChosen(false);\n }\n }", "function clickAssess() {\n\t$.trigger(\"clickAssess\");\n}", "function onBusinessUnitClick(){\n var curTreeNode = View.panels.get(\"abScDefStdZhicBzTree\").lastNodeClicked;\n var zhic_bz_id = curTreeNode.data['sc_zhic_bz.zhic_bz_id'];\n View.controllers.get('abScDefStdZhic').curTreeNode = curTreeNode;\n if (!zhic_bz_id) {\n View.panels.get(\"abScDefStdZhicBz\").show(false);\n View.panels.get(\"abScDefStdZhic\").show(false);\n }\n else {\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"sc_zhic_bz.zhic_bz_id\", zhic_bz_id, '=');\n View.panels.get('zhicDetailTabs').selectTab(\"biaoZhunZhiChengTab\", restriction, false, false, false);\n }\n}", "clickOverviewTab(){\n this.overviewTab.waitForExist();\n this.overviewTab.click();\n }", "function viewThisClickFunct() {\n\t// if overview is clicked from an info step (where it can be a last step) then remove any later history\n\tif (currentStepInfo.type == \"info\" && currentStep < decisionHistory[currentDecision].length - 1) {\n\t\tdecisionHistory[currentDecision] = decisionHistory[currentDecision].splice(0,currentStep + 1);\n\t\tstoredResultTxt[currentDecision] = storedResultTxt[currentDecision].splice(0,currentStep + 1);\n\t\t$fwdBtn.attr(\"disabled\", \"disabled\");\n\t}\n\t\n\t$overviewHolder.find(\".decisionInfo\").parent().remove();\n\t$(\"#viewAllBtn\").remove();\n\tshowHideHolders($overviewHolder);\n\t\n\tshowDecision(currentDecision);\n\t\n\tif (decisionHistory.length > 1) {\n\t\t$overviewHolder.append('<a id=\"viewAllBtn\" href=\"#\">' + allParams.viewAllString + '</a>');\n\t}\n\t\n\t$dialog.dialog(\"close\");\n\tdocument.getElementById(\"mainHolder\").scrollIntoView();\n\t\n\t// _____ VIEW ALL DECISIONS BTN _____\n\t$(\"#viewAllBtn\")\n\t\t.click(function() {\n\t\t\t$overviewHolder.find(\".decisionInfo\").parent().remove();\n\t\t\t$(\"#viewAllBtn\").remove();\n\t\t\tshowHideHolders($overviewHolder);\n\t\t\t\n\t\t\tfor (var i=0; i<decisionHistory.length; i++) {\n\t\t\t\tshowDecision(i);\n\t\t\t}\n\t\t\t\n\t\t\tdocument.getElementById(\"mainHolder\").scrollIntoView();\n\t\t});\n}", "function registerClicks() {\n\t \t//To handle click on cluster to redirect to respective GPCC\n\t\t$('.cluster').click(function(e){\n\t\t loadClusterDashboard(this.id);\n\t\t});\n\t\n\t\t// To handle tab clicks to navigate to different cluster groups.\n\t\t$(\".tabs\").click(function(e) {\n\t\t\tvar tabHolder = $(\".tabHolder\");\n\t\t\tvar tabToActivate = tabHolder.find(\"#\"+e.target.id);\n\t\t\tfor (var i = 0; i < tabHolder[0].children.length; i++) {\n\t\t\t var node = tabHolder[0].children[i];\n\t\t\t if (node.nodeType == 1) { \n\t\t\t\t if(node == tabToActivate[0]) {\n\t\t\t\t tabToActivate.addClass(\"active\")\n\t\t\t\t } else{\n\t\t\t\t $(node).removeClass(\"active\");\n\t\t\t\t }\n\t\t\t }\n\t\t\t}\n\t\t\tvar tabCtrl = $(\".pageHolder\");\n\t\t\tvar pageToActivate = tabCtrl.find(\"#\"+e.target.id);\n\t\t\t for (var i = 0; i < tabCtrl[0].children.length; i++) {\n\t\t\t\t var node = tabCtrl[0].children[i];\n\t\t\t\t if (node.nodeType == 1) {\n\t\t\t\t\t node.style.display = (node == pageToActivate[0]) ? 'block' : 'none';\n\t\t\t\t }\n\t\t\t }\n\t\t});\n\t}", "clickRaceListTab(){\n this.raceListTab.waitForExist();\n this.raceListTab.click();\n }", "function onChartClick(obj){\n\t\tView.controllers.get('blcostByAreaController').blId = obj.selectedChartData['wr.bl_id'];\n View.openDialog('ab-bldgops-report-bl-cost-by-area-occ-details.axvw', null, false, {width:800, height:800});\n }", "_clickHandler(event) {\n const that = this,\n target = that.shadowRoot || that.isInShadowDOM ? event.composedPath()[0] : event.target;\n\n if (that.disabled || !target || !target.closest || (!that._isMobile && event.button !== 0)) {\n return;\n }\n\n if (that._scrollBarDown) {\n delete that._scrollBarDown;\n return;\n }\n\n const isTargetADropDown = target.closest('.jqx-drop-down'),\n targetIsEditor = (that._editor && that._editor.contains(target) || (isTargetADropDown && (that._editor.contains(isTargetADropDown.ownerElement) ||\n that._editor === isTargetADropDown.ownerElement))) || target.closest('.jqx-custom-editor');\n\n if (that._editor && that._editorIsOpen && !targetIsEditor) {\n that._closeEditor();\n }\n\n const filterItem = target.closest('.jqx-filter-group-condition') || target.closest('.jqx-filter-nested-operator') || target.closest('.jqx-filter-group');\n\n if (!filterItem) {\n return;\n }\n\n const item = that._getItemById(filterItem.getAttribute('node-id'));\n\n if (!item) {\n return;\n }\n\n that.$.fireEvent('itemClick', {\n id: item.nodeId,\n type: item.type,\n data: item.data\n });\n\n if (target.closest('.jqx-filter-delete-btn')) {\n that._clickHandlerDeleteButton(item.htmlNode);\n return;\n }\n\n const isAddButton = target.closest('.jqx-filter-add-btn') || target.closest('.jqx-filter-add-condition-btn');\n\n //Add group\n if (isAddButton) {\n const selectedFilterGroupId = isAddButton.closest('.jqx-filter-group').getAttribute('node-id');\n\n if (isAddButton.classList.contains('jqx-filter-add-condition-btn') && ((that.maxConditions && (that._getTotalConditions() < that.maxConditions)) || !that.maxConditions)) {\n that._addElement('condition', selectedFilterGroupId, []);\n //that._totalConditions++;\n }\n else {\n that._clickHandlerFilterButton(isAddButton.classList, item.nodeId, target);\n }\n\n return;\n }\n\n const isFilterButton = target.closest('.filter-builder-item') || target.closest('.jqx-filter-group-operator') || target.closest('.jqx-filter-nested-operator');\n\n if (isFilterButton) {\n const elementClassList = isFilterButton.classList;\n\n that._clickHandlerFilterButton(elementClassList, item.nodeId, target);\n }\n }", "clickOnButton() {\n if (!this._disabled) {\n this.cancelBlur();\n this.focusOnButton();\n\n if (this._triggers === 'click') {\n this.toggleMenuVisibility();\n }\n }\n }", "function addListenerToButtons(){\n if(document.querySelector('button')){\n document.querySelectorAll('.viewBtn').forEach(function(event){\n event.addEventListener('click', function(e){\n // get jobid from th field which is two level up for button.\n let jobId = e.target.parentNode.parentNode.querySelector('th').innerText;\n localStorage.setItem(\"JOB_VIEW_ID\", jobId);\n window.location.href = \"ViewJobDetails.html\";\n });\n });\n }\n}", "creanOnClick() {\n\n var currentAssignmentType = AssignmentReactiveVars.CurrentAssignmentType.get();\n\n switch (currentAssignmentType) {\n case AssignmentType.USERTOTASK:\n console.error(\"Template.assignmentCalendar.events.click .creneau\", \"User can't normally click on this kind of element when in userToTask\");\n return;\n break;\n case AssignmentType.TASKTOUSER: //only display users that have at least one availability matching the selected time slot\n break;\n }\n }", "function external_tab_on_click(scale_title, resource_type){\n var click_tab = document.getElementsByClassName(scale_title + '_' + resource_type)[0];\n click_tab.onclick = function(){\n deactivate_previous_tab(scale_title);\n click_tab.parentElement.className = 'tabberactive';\n $(resource_type).show();\n };\n}", "clickExpertTipsTab(){\n this.expertTipsTab.waitForExist();\n this.expertTipsTab.click();\n }", "function listenForClicks() {\n document.addEventListener(\"click\", (e) => {\n /**\n * Fills the form using the values from the storage\n */\n function fillForm(tabs) {\n const gettingItem = browser.storage.local.get(BOOKING_MODEL_KEYS);\n gettingItem.then((res) => {\n browser.tabs.sendMessage(tabs[0].id, {\n command: \"fillForm\",\n bookingDetails: res\n }).catch(err => reportError(err));\n });\n }\n\n /**\n * Open the options page for this add-on to configure the form values\n */\n function openOptionsPage() {\n browser.runtime.openOptionsPage().catch(err => reportError(err))\n }\n\n /**\n * Just log the error to the console.\n */\n function reportError(error) {\n console.error(error);\n }\n\n /**\n * Get the active tab,\n * then call \"fillForm()\" or \"openOptionsPage()\" as appropriate.\n */\n if (e.target[\"id\"] === \"fill-form-button\") {\n browser.tabs.query({active: true, currentWindow: true})\n .then(fillForm)\n .catch(reportError);\n } else if (e.target[\"id\"] === \"options-link\") {\n openOptionsPage();\n }\n });\n}", "function handleViewResultsButtonClicked() {\n $('.page').on('click', '.view-results', function (event) {\n event.preventDefault();\n STORE.view = 'results';\n STORE.button = { class: 'start-over', label: 'Start Over' };\n STORE.currentQuestion = null;\n STORE.userChoice = null;\n renderPage();\n });\n}", "clickRunnerTab(){\n this.runnerTab.waitForExist();\n this.runnerTab.click();\n }", "clickEventListener (event) {\n var tab = event.target;\n this.activateTab(tab, false);\n }", "function activateValidationCaseSetControllerButtonsEvent(){\r\n $(\"#rdr-ka-validate-case-list-controller-button-except\").click(function(){\r\n //go to tab 4\r\n changeTab(\"rdr-tab-3\");\r\n });\r\n \r\n $(\"#rdr-ka-validate-case-list-controller-button-accept\").click(function(){\r\n //remove selected case\r\n var newArray = new Array();\r\n for(var i=0; i<validationCaseSet.length; i++){\r\n if(i !== validatingCaseIndex){\r\n newArray.push(validationCaseSet[i]);\r\n }\r\n }\r\n \r\n if(newArray.length === 0){\r\n var r = confirm(\"모든 사례들을 수락하셨습니다. 새로운 지식을 생성하시겠습니까? \");\r\n if (r == true) {\r\n //add rule\r\n addRuleAjax();\r\n } else {\r\n\r\n }\r\n } else {\r\n validationCaseSet = newArray;\r\n\r\n var attributeText = $(\"#rdr-ka-validate-case-list-search-input\").val();\r\n drawValidationCaseSetTable(validationCaseSet, attributeText);\r\n\r\n //select the case on top of the list\r\n $(\"#rdr-ka-validate-case-list-table\").find(\"tr:first\").next().addClass(\"tr-selected\");\r\n var cornerstoneCaseId =$(\"#rdr-ka-validate-case-list-table\").find(\"tr:first\").next().find(\"td\").first().text();\r\n \r\n getOtherConclusionsAjax(cornerstoneCaseId);\r\n validatingCaseIndex = 0;\r\n }\r\n });\r\n \r\n $(\"#rdr-ka-validate-case-list-controller-button-accept-all\").click(function(){\r\n var r = confirm(\"모든 사례들을 수락하시고 새로운 지식을 생성하시겠습니까? \");\r\n if (r == true) {\r\n //add rule\r\n addRuleAjax();\r\n } else {\r\n \r\n }\r\n });\r\n}", "function onClickBuDvDpEvent(obj){\n var groupGrid = View.panels.get('gpGrid');\n\n if (obj.restriction.clauses.length > 0) {\n groupGrid.addParameter('BuDvDp', \"='\" + obj.restriction.clauses[0].value + \"'\");\n }\n else {\n groupGrid.addParameter('BuDvDp', \"is not null\");\n }\n\n\t// Get the restriction that applies to the view.\n\tvar restArray = allocDpDvController.getConsoleRestriction();\n \n\tgroupGrid.refresh(restArray[\"restriction\"]);\n\n groupGrid.show(true);\n\n groupGrid.showInWindow({\n width: 600,\n height: 400\n });\n}", "click(){\r\n if ( !this.isDisabled && !this.readnly ){\r\n this.getRef('input').focus();\r\n if ( this.filteredData.length ){\r\n this.isOpened = !this.isOpened;\r\n }\r\n }\r\n }", "function handleOnButtonClick(asBtn) {\r\n switch (asBtn) {\r\n case 'ADD_RECIPIENT':\r\n commonAddRow(\"mailingRecipientListGrid\");\r\n break;\r\n case 'DELETE_RECIPIENT':\r\n commonDeleteRow(\"mailingRecipientListGrid\");\r\n break;\r\n case 'FIND_RECIPIENT':\r\n policyNo = getObjectValue(\"policyNoCriteria\");\r\n name = getObjectValue(\"nameCriteria\");\r\n window.frameElement.document.parentWindow.loadMailingRecipient(policyNo,name);\r\n }\r\n\r\n}", "function handleOnButtonClick(btn) {\r\n switch (btn) {\r\n case 'FILTER':\r\n var dividendEventId = dividendReportListGrid1.recordset(\"ID\").value;\r\n var policyNo = getObjectValue(\"policyNoCriteria\");\r\n var filterStr;\r\n if (dti.oasis.page.useJqxGrid()) {\r\n filterStr = \"CDIVIDENDEVENTID='\" + dividendEventId + \"' and \" +\r\n \" contains(CPOLICYNO,'\" + policyNo +\"')\";\r\n } else {\r\n filterStr = \"CDIVIDENDEVENTID='\" + dividendEventId + \"' and \" +\r\n \"CPOLICYNO[contains(.,'\" + policyNo + \"')]\";\r\n }\r\n\r\n dividendReportDetailListGrid_filter(filterStr);\r\n if (isEmptyRecordset(dividendReportDetailListGrid1.recordset)) {\r\n hideEmptyTable(getTableForXMLData(dividendReportDetailListGrid1));\r\n } else {\r\n showNonEmptyTable(getTableForXMLData(dividendReportDetailListGrid1));\r\n }\r\n break;\r\n case 'SEARCH':\r\n document.forms[0].process.value = \"loadAllDividendReport\";\r\n submitFirstForm();\r\n break;\r\n default:break;\r\n }\r\n}", "clickHandler(evt) {\n if (evt.target.classList.contains('fa-check')) {\n gameApp.eventHandler(evt);\n }\n\n if (evt.target.classList.contains('assignment') || evt.target.parentElement.classList.contains('assignment')) {\n gameApp.activateContract(evt);\n }\n\n if (evt.target.classList.contains('loc')) {\n gameApp.addLoc();\n }\n\n if (evt.target.classList.contains('nav-button')) {\n let elem = evt.target;\n gameApp.gameView.changeMenue(elem);\n }\n }", "function custOrderHistory() {\nlet place = window.location.href;\nif (place.includes('#order-history-body')) {\n document.getElementById('order-history').click();\n}\n}", "click(){\r\n if (!this.isDisabled) {\r\n this.getRef('input').focus();\r\n if (this.filteredData.length) {\r\n this.isOpened = !this.isOpened;\r\n }\r\n }\r\n }", "function addLeaderboardEventListeners() {\n canvas.addEventListener('click', function (event) {\n var x = event.offsetX;\n var y = event.offsetY;\n button.forEach(function (question) {\n if (y > question.top && y < question.top + question.height && x > question.left && x < question.left + question.width) {\n //window.location.replace('http://www.softwarehut.party/');//Needs to be changed\n location.reload();\n }\n });\n });\n}", "function quickSearchButton_click() {\n //Begin Search Animation\n var $quickSearchResultsListWrapper = $(\"#QuickSearchResultsListWrapper_helm\");\n var $quickSearchProgressLoaderWrapper = $(\"#QuickSearchProgressLoaderWrapper_helm\");\n quickSearchResults_show(true);\n showProgressSpinner(true, \"#QuickSearchResultsContentTab_helm\");\n var quickSearch = quickSearchOptions_GetUserDefinedValues(); //Gather the search options specified by user and package them in QuickSearchOptions_helm javascript object\n quickSearch.recentSearches.save.call(quickSearch); //save the quick search in recent quick searches\n //\n helm.xhr.getQuickSearchResults(quickSearch.toJSON()).promise().done(function() {\n showProgressSpinner(false,\"#QuickSearchResultsContentTab_helm\");\n });\n if (Compass.Global.isLoanSelected && helm.DisplayMode !== \"QuickSearchRecentlyViewedOnly\") { //a setting/check for is in iquote mode would be better here.\n helm.showBasicLoanDetailsInPageHeader(true);\n }\n }", "onContainerClick() {\n this.focus();\n this.open();\n }", "function resultsAuxHandler (e) {\n let target = e.target; // Type depends ..\n let className = target.className;\n//console.log(\"Result aux event: \"+e.type+\" button: \"+e.button+\" shift: \"+e.shiftKey+\" phase: \"+e.eventPhase+\" target: \"+target+\" class: \"+className);\n // Be careful, button 2 (contextmenu) also ends up here :-(\n if ((e.button == 1)\n\t && (className != undefined)\n\t && (className.length > 0)) {\n\t// The click target is one of .brow cell,\n\t// .rbkmkitem_x div or anchor, .favicon img or .favttext span\n\t// Handle click, and go to the parent row\n\tlet row;\n\tif (className.includes(\"fav\") || className.startsWith(\"rtwistie\")) {\n\t row = (target = target.parentElement).parentElement.parentElement;\n\t className = target.className;\n\t}\n\telse if (className.startsWith(\"rbkmkitem_\")) {\n\t row = target.parentElement.parentElement;\n\t}\n\telse { // .brow\n\t row = target.parentElement;\n\t if (row.dataset.type == \"bookmark\") {\n\t\ttarget = target.firstElementChild;\n\t\tclassName = target.className;\n\t }\n\t}\n\tif (className == \"rbkmkitem_b\") { // An HTMLAnchorElement\n\t e.preventDefault(); // We prevent default behavior and handle ourselves ..\n\t let href = target.href;\n\t if ((href != undefined) && (href.length > 0)) {\n\t\t// Get current active tab as opener id to come back to it when closing the new tab\n\t\tbrowser.tabs.query({windowId: myWindowId, active: true})\n\t\t.then (\n\t\t function (a_tabs) {\n\t\t\tif (beforeFF57)\n\t\t\t browser.tabs.create({url: href});\n\t\t\telse\n\t\t\t browser.tabs.create({url: href, openerTabId: a_tabs[0].id});\n\t\t }\n\t\t);\n\t }\n\t}\n }\n e.stopPropagation(); // Prevent handlers up the DOM chain on same event\n}", "editWorkAndEducation(){\n\t\tresources.workAndEducationTab().click();\n\t}", "function clickBtnPager() {\n // remet à jour les données de state en demandant la page\n // identifiée dans l'attribut data-page\n // noter ici le 'this' QUI FAIT AUTOMATIQUEMENT REFERENCE\n // A L'ELEMENT AUQUEL ON ATTACHE CE HANDLER\n getQuizzes(this.dataset.page);\n }", "function register_event_handlers()\n {\n \n \n /* listitem Pancakes */\n $(document).on(\"click\", \".uib_w_4\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#uib_page_pancakes\"); \n return false;\n });\n \n /* button #backBtnPancakes */\n $(document).on(\"click\", \"#backBtnPancakes\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n \n \n \n var iabRef = null;\n\n function iabClose(event) {\n iabRef.removeEventListener('exit', iabClose);\n }\n \n \n \n \n /* button #takeAwayBtn */\n $(document).on(\"click\", \"#takeAwayBtn\", function(evt)\n {\n iabRef = window.open('http://www.shawacademy.com', '_blank', 'location=yes');\n iabRef.addEventListener('exit', iabClose);\n return false;\n });\n \n }", "function clickNewModel()\n{\n//\ttab1.isNew = true;\n\ttab1.modelId = null;\n\ttab2.enabled = true;\n\ttab3.enabled = false;\n\ttab4.enabled = false;\n\ttab5.enabled = false;\n\ttab6.enabled = false;\n tab7.enabled = false;\n tab8.enabled = false;\n changeStartTime();\n\tresetCheckedId();\n\tonTabClick(\"btn2\");\n}", "function listenToButtons() {\n\t\tconst currentlyDisplayed = employeesData.find(isDisplayed);\n\t\tif (hasPrevious(currentlyDisplayed.id)) {\n\t\t\tpreviousButton.addEventListener('click', () => {\n\t\t\t\tupdateContactDetails(getAdjacentContactId('previous'));\n\t\t\t});\n\t\t}\n\t\tif (hasNext(currentlyDisplayed.id)) {\n\t\t\tnextButton.addEventListener('click', () => {\n\t\t\t\tupdateContactDetails(getAdjacentContactId('next'));\n\t\t\t});\n\t\t}\n\t}", "function resultsMouseHandler (e) {\n let target = e.target; // Type depends ..\n let className = target.className;\n//console.log(\"Result click event: \"+e.type+\" button: \"+e.button+\" shift: \"+e.shiftKey+\" target: \"+target+\" class: \"+className);\n if ((className != undefined) && (className.length > 0)) {\n\t// The click target is one of .brow cell,\n\t// .rbkmkitem_x div, .twistieac div, favicon img or .favttext span\n\t// Handle click, and go to the parent row\n\tlet row;\n\tif (className.includes(\"fav\") || className.startsWith(\"rtwistie\")) {\n // Go to .bkmkitem_x when advanced or Alt key, else go to .brow\n\t if (options.advancedClick || e.altKey) {\n\t\trow = (target = target.parentElement).parentElement.parentElement;\n\t }\n\t else { // Go to .brow\n\t\trow = (target = target.parentElement.parentElement).parentElement;\n\t }\n\t className = target.className;\n\t}\n\telse if (className.startsWith(\"rbkmkitem_\")) {\n\t let cell;\n\t row = (cell = target.parentElement).parentElement;\n\t // If Alt key or advanced, open in current tab (remain on current target), else show => go to .brow\n\t if (!options.advancedClick && !e.altKey) {\n\t\ttarget = cell;\n\t\tclassName = target.className;\n\t }\n\t}\n\telse { // .brow, cannot be scrollbars when left mouse click\n\t row = target.parentElement;\n\t if (e.altKey) { // .brow, if Alt key, force open in current tab if bookmark\n\t\tif (target.parentElement.dataset.type == \"bookmark\") {\n\t\t target = target.firstElementChild;\n\t\t className = target.className;\n\t\t}\n\t }\n\t}\n\n\tlet showSrcRow = true;\n\tlet is_ctrlKey = (isMacOS ? e.metaKey : e.ctrlKey);\n\tif (className == \"rbkmkitem_b\") { // An HTMLDivElement\n\t e.preventDefault(); // We do not want the left click to open in a new tab ..\n\t \t\t\t\t\t // but in the active tab\n\t let href = target.href;\n\t if ((href != undefined) && (href.length > 0)) {\n\t\t// Respect the about:config browser.search.openintab setting setting\n\t\tif (openSearchResultsInNewTabs_option) { // If option set, open in new tab at end\n\t\t browser.tabs.create({url: href});\n\t\t}\n\t\telse if (is_ctrlKey) { // Open in new tab, referred by this tab to come back to it when closing\n\t\t // Get current active tab as opener id to come back to it when closing the new tab\n\t\t if (beforeFF57)\n\t\t\tbrowser.tabs.create({url: href});\n\t\t else {\n\t\t\tbrowser.tabs.query({windowId: myWindowId, active: true})\n\t\t\t.then (\n\t\t\t function (a_tabs) {\n\t\t\t\tbrowser.tabs.create({url: href, openerTabId: a_tabs[0].id});\n\t\t\t }\n\t\t\t);\n\t\t }\n\t\t}\n\t\telse if (e.shiftKey) { // Open in new window\n\t\t browser.windows.create({url: href});\n\t\t}\n\t\telse { // Open in current tab, except if we are running BSP2 inside a tab and Alt is not pressed\n\t\t if (isInSidebar || e.altKey) {\n\t\t\tbrowser.tabs.update({url: href});\n\t\t }\n\t\t showSrcRow = false; // Do not show row, we already got an action\n\t\t}\n\t }\n\t}\n\n\t// Make the source object visible .. and scroll to it, except when Shift, Ctrl or Alt are pressed,\n\t// and when not on favtext / favicon in advanced mode\n\tlet resultBN_id = row.dataset.id;\n\tif (showSrcRow && !e.shiftKey && !is_ctrlKey && !e.altKey) {\n\t // Retrieve bookmark information in the result row (BN.id)\n\t // Then show it\n\t handleResultClick(resultBN_id);\n\n\t // If close search option is set, close search pane now\n\t if (options.closeSearch) {\n\t\tclearSearchTextHandler();\n\t }\n\t}\n }\n e.stopPropagation(); // Prevent handlers up the DOM chain on same event\n}", "clickOnCreateAccountLink(){\n let createAccountLink = utils.byLocator(jobsPageLocator.jobsPage.CreateAccountLink);\n utils.clickOn(createAccountLink);\n }", "openOnwerFilter(){\n\n var selected = this.template.querySelector(\".selected-owner\");\n var optionsContainer = this.template.querySelector(\".options-container-owner\");\n var optionsList =this.template.querySelectorAll(\".option-owner\");\n selected.addEventListener(\"click\", () => {\n optionsContainer.classList.toggle(\"active\");\n }); \n //selected.addEventListener(\"click\", () => {\n //});\n\n /* optionsList.forEach(o => {\n o.addEventListener(\"click\", () => {\n selected.innerHTML = o.querySelector(\"label\").innerHTML;\n optionsContainer.classList.remove(\"active\");\n });\n });\n */\n }", "function clickEventListener (event) {\n var tab = this;\n activateTab(tab, false);\n}", "function menuControlsClick(event) {\n // console.log('menuControlsClick');\n\n event.preventDefault();\n\n PageData.ControlsOpen = !PageData.ControlsOpen;\n setControlsPosition();\n}", "clickOnClaim(){\n // wait for page load is before click ?? Failing at this step- disabled it - Monica\n //browser.waitForPageToLoadAndCheckPartialHeaderText(eval(ticketDetailPageObject.ticketSubmissionHeader),ticketsJson.ticketSubmissionHeader);\n console.log(\" **** Claiming Ticket ****\");\n browser.click(eval(ticketDetailPageObject.topNav.btn_claimTicket));\n //console.log(\" **** Assert button mark as complete is visible after claiming ticket ****\");\n //assert.assertElementIsVisible(eval(ticketDetailPageObject.topNav.btn_markAsComplete))\n\n}", "function inputClick () {\n clickSection('#tarjetaTab', 'desgloseTarjeta', 'show', null)\n clickSection('#sucursalTab', 'desgloseSucursal', 'show', null)\n clickSection('#paypalTab', 'desglosePaypal', 'hide', null)\n clickSection('#visaTab', 'desgloseVisa', 'hide', null)\n clickSection('#masterpassTab', 'desgloseMasterpass', 'hide', null)\n clickSection('#intervaleTab', 'desgloseIntervale', 'show', null)\n clickSection('#paybackTab', 'desglosePayback', 'disable', null)\n clickSection('#ClubTab', 'desgloseClubInterjet', 'disable', null)\n\n modalAlerts('.link-interest' , '#modalBankCards')\n modalAlerts('#mapShuttle', '#modalInterjetTierra')\n modalAlerts('#link-terms-ref', '#modalPaymentRef')\n modalAlerts('.link-prices', '.modalPrices')\n modalAlerts('.links-rules', '#ReglasOptima')\n $('.has-tooltip').tooltip('disable')\n\n $('.input-material').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n\n $(this).find('input')[0].focus()\n })\n\n $('input[type=text], input[type=number]').on('click focus', function (e) {\n e.stopPropagation()\n e.preventDefault()\n\n deselectInputs()\n\n $(this).closest('.input-material').addClass('active')\n })\n // green buttons functionality\n $('.btn-primary').on('click', function (e) {\n // $('.btn-secondary').click()\n })\n\n $('.btn-confirm').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n // class incorrect adds red outline and X mark\n // class correct adds green outline and check mark\n $('#nu-tarjeta').addClass('incorrect')\n $('#nu-payback').addClass('correct')\n })\n\n $('.detail-purchase').on('click', function (e) {\n if ($('#purchaseDetails').hasClass('open')) {\n $('#purchaseDetails').removeClass('open')\n $('#purchaseDetails').slideUp('slow')\n $('.detail-purchase').removeClass('show')\n }else {\n $('#purchaseDetails').addClass('open')\n $('#purchaseDetails').slideDown('slow')\n $('.detail-purchase').addClass('show')\n }\n })\n\n $('.navbar-brand').on('click', function (e) {\n window.location.href = 'home.aspx'\n })\n\n /*$('.btn-validate').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n\n $('#nu-intervale').addClass('incorrect')\n $('#nu-tarjeta-int').addClass('correct')\n $('#titularTarjeta').addClass('incorrect')\n $(IntervaleSection1).hide()\n $('#intervaleValidado').show()\n $('#intervale-wrp').slideDown('slow')\n })\n\n $('#valid-paybck').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n $('#paybackValidate').hide()\n $('#paybackAvailableAmount').slideDown('slow')\n }) */\n\n $('.btn-delete').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n $('#nu-intervale').removeClass('correct')\n $('#intervaleValidado').hide()\n $(IntervaleSection1).show()\n })\n\n $('.btn-check').on('click', function (e) {\n $('#nu-payback').addClass('correct')\n })\n\n // calendar click\n $('.option-active').on('focus', function (e) {\n deselectInputs()\n\n $(this).parent().addClass('open')\n if ($(this).parent().hasClass('select-date')) {\n $(this).find('.datepicker').click()\n }\n })\n // dropdown click\n $('.select-generic').on('click', function (e) {\n $(this).find('.select-options').slideDown('down')\n\n e.stopPropagation()\n e.preventDefault()\n // if dropdown is already opened this closes it\n if ($($(this).find('.btn-select')[0]).hasClass('open')) {\n $('.input-material').removeClass('active')\n $('.btn-select').removeClass('open')\n for (var i = 0; i < $('.select-options').length; i++) {\n $($('.select-options')[i]).slideUp('slow')\n }\n }else {\n $('.input-material').removeClass('active')\n $('.btn-select').removeClass('open')\n\n $($(this).find('.btn-select')[0]).addClass('open')\n $('.detail-purchase').removeClass('open')\n // console.log($($(this).find('.btn-select')[0]).hasClass('open'))\n for (var i = 0; i < $('.select-options').length; i++) {\n // closes all dropdowns but the one clicked\n if ($('.select-options')[i] != $(this).find('.select-options')[0]) {\n $($('.select-options')[i]).slideUp('slow')\n }\n }\n\n $(this).find('.option-active').focus()\n $(this).find('.option-active').addClass('open')\n }\n })\n\n // dropdown option selected\n $('.option-item').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n var newOption = $(this).text()\n $(this).closest('.select-generic').find('.option-active').html(newOption)\n\n $($(this).closest('.select-generic').find('.btn-select')[0]).removeClass('open')\n $(this).closest('.select-options').slideUp('slow')\n })\n\n // Meses sin Interes *********************\n $('.select-MSI').on('click', function (e) {\n $(this).find('.select-options').slideDown('down')\n e.stopPropagation()\n e.preventDefault()\n // if dropdown is already opened this closes it\n if ($($(this).find('.btn-select')[0]).hasClass('open')) {\n $('.btn-select').removeClass('open')\n for (var i = 0; i < $('.select-options').length; i++) {\n $($('.select-options')[i]).slideUp('slow')\n }\n }else {\n $('.btn-select').removeClass('open')\n\n $($(this).find('.btn-select')[0]).addClass('open')\n\n for (var i = 0; i < $('.select-options').length; i++) {\n // closes all dropdowns but the one clicked\n if ($('.select-options')[i] != $(this).find('.select-options')[0]) {\n $($('.select-options')[i]).slideUp('slow')\n }\n }\n\n $(this).find('.option-active').focus()\n $(this).find('.option-active').addClass('open')\n }\n })\n\n $('.option-item-MSI').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n var newOption = $(this).text()\n $(this).closest('.select-MSI').find('.option-active').html(newOption)\n\n if ($(\"select[id$='INSTALLMENTS']\")) {\n $(\"select[id$='INSTALLMENTS']\").val($(this).attr('value'))\n }\n\n\n $($(this).closest('.select-MSI').find('.btn-select')[0]).removeClass('open')\n $(this).closest('.select-options').slideUp('slow')\n })\n // Meses sin Interes *********************\n\n $('.checkbox-wrp').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n checkboxClick('#checkpayback', $(this))\n })\n\n $('#paybackCheck').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n checkboxClick('#checkpayback', $(this).find('.checkbox-label')[0])\n })\n\n // when clicking outside of inputs this makes them all inactive\n $('body').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n deselectInputs()\n })\n\n /*$( '.link-delete-payback' ).bind( 'click', function(e){\n e.preventDefault()\n $('#modalDeletePayback').modal(\"show\")\n } )*/\n\n //clickSecondCard()\n }", "function myAgendaClickHandler(eventObj) {\n // Get ID of the agenda item from the event object\n var agendaId = eventObj.data.agendaId;\n // pull agenda item from calendar\n var agendaItem = jfcalplugin.getAgendaItemById(\"#mycal\", agendaId);\n clickAgendaItem = agendaItem;\n $(\"#display-event-form\").dialog('open');\n }", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function C101_KinbakuClub_RopeGroup_Click() {\t\n\n\t// Regular and inventory interactions\n\tClickInteraction(C101_KinbakuClub_RopeGroup_CurrentStage);\n\tvar ClickInv = GetClickedInventory();\n\t\n\tC101_KinbakuClub_RopeGroup_CalcParams();\n\n}", "onClickEstimate() {\r\n \r\n }", "clicked(panel) {\n\t}", "function onclickForTab_Search()\n{\n //console.log('click on search tab');\n \n if(!global_pagesLoaded.search)\n {\n firstLoadForTab_Search();\n }\n \n //alert('Search');\n}", "cuttingClicked (){\n this.cutting.addEventListener('click',()=>{\n window.open(\"././links/cutting/cutting.htm\");\n },false);\n }", "on_desklet_clicked(event) {\n this.retrieveEvents();\n }", "renderCriteriaBar(key, evidence, interpretation) {\n let status = 'not-evaluated';\n // Flag 'met' criteria via [data-status]\n let evalArray = interpretation.evaluations;\n if (evalArray) {\n if (evalArray.length) {\n evalArray.forEach(entry => {\n if (typeof entry.criteria !== 'undefined' && entry.criteria === key) {\n status = entry.criteriaStatus;\n }\n });\n }\n }\n return (\n <button className={'btn btn-default ' + evidence[key].class + ' ' + evidence[key].category + this.getCurrentTab(evidence[key].category)}\n type=\"button\" key={key} data-status={status}\n data-toggle=\"tooltip\" data-placement=\"top\"\n data-tooltip={evidence[key].definition}\n onClick={this.handleClick.bind(this, key, evidence[key].category)}>\n <span>{key}</span>\n </button>\n );\n }", "function navButtonListener() {\n $('#calendarTest').click(function() {\n addScheduleToGoogleCal(courseList);\n });\n}", "handleJDotterClick() {}", "function onClickMarker(title, attributes) {\n\t\n\tvar restriction = ' regviolation.location_id IS NOT NULL ';\n var attributes = eval(\"(\" + attributes + \")\");\n\t\n\tvar location = attributes.values['regviolation.groupField'];\n\tvar locationOption = mapController.getOptionValue('location');\n\t\n\t//get restriction from click object\n\tif(location){\n\t\trestriction += ' AND ' + mapController.optionFieldMap[locationOption]+ \"='\"+location+\"' \"\n\t}else{\n\t\trestriction += ' AND ' + mapController.optionFieldMap[locationOption]+ \" IS NULL \"\n\t}\n\t\n\tvar tabs = View.panels.get('tabsBldgManagement');\n\ttabs.markerRestriction = restriction;\n //KB3035975 - change the location tab to pop up to avoid issue in Firefox\n\tvar restriction = tabs.treeRestriction \n\t+ \" and \" + tabs.regulationRes\n\t+ \" and \" + tabs.regprogramRes\n\t+ \" and \" + tabs.regcomplianceRes\n\t+ \" and \" + tabs.regviolationRes\n + \" and \" + tabs.markerRestriction;\n\tView.getOpenerView().mode = 'report';\n\tView.getOpenerView().openDialog(\"ab-comp-violation-grid-rpt.axvw\", restriction);\n}", "function mouseClicked() {\n //i cant figure out how to do mouse controls\n //player.mouseControls *= -1\n\n for (b = 0; b < buttons.length; b++){\n switch (buttons[b].shape) {\n case \"rect\":\n if (mouseX >= (buttons[b].x + camOffsetX) * canvasScale &&\n mouseX <= (buttons[b].x + camOffsetX + buttons[b].w) * canvasScale &&\n mouseY >= (buttons[b].y + camOffsetY) * canvasScale &&\n mouseY <= (buttons[b].y + camOffsetY + buttons[b].h) * canvasScale){\n if (options.optionsMenuHidden === -1 && buttons[b].tab === options.optionsMenuTab){\n buttons[b].testClick();\n return;\n }\n }\n break;\n case \"circle\":\n if (Math.sqrt(Math.pow(mouseX - ((buttons[b].x + camOffsetX) * canvasScale), 2)+Math.pow(mouseY - ((buttons[b].y + camOffsetY) * canvasScale),2) < buttons[b].w)){\n if (options.optionsMenuHidden === -1 && buttons[b].tab === options.optionsMenuTab){\n buttons[b].testClick();\n return;\n }\n }\n default:\n break;\n }\n \n }\n}", "function scrollToSeeSides() {\n jQuery(document).on(\"click\", \"#linkSides\", function(e) {\n e.preventDefault();\n const sides = document.querySelector(\"#sides\");\n sides.querySelector(\".tab-title\").click();\n });\n}", "function iteration_button_onclick(clicked_id) {\n location.href = \"/view/iteration\";\n}", "function displayTabOnClick() {\n const tabs = document.querySelectorAll(\"#resources-nav .nav-item\");\n tabs.forEach(function (tabButton) {\n tabButton.addEventListener(\"click\", function (e) {\n e.preventDefault();\n let tabContentId = tabButton.id.split(/tab\\-(.+)/)[1];\n openCategory(e, tabContentId);\n });\n });\n}", "function stock_reports() {\n //\n reset_meat_page();\n //\n document.getElementById('tab-clicked').value = 'stock-reports';\n //\n remove_class('hidden-elm','inventory-report');\n remove_class('hidden-elm','stock-change-report');\n}", "function onClick(event) {\n\t\t//console.log(event);\t\t\n\t\tvar target = event.target;\n\t\tif (target.classList.contains(\"ui-selector-indicator\")) {\n\t\t\t//console.log(\"Indicator clicked\");\n\t\t\tvar ItemClicked = event.srcElement.textContent;\n\t\t\tconsole.log(\"Item Clicked on home page was: \" + ItemClicked);\n\n\t\t\t//Handel home page click events\n\t\t\tif(ItemClicked == \"Switches\"){\n\t\t\t\ttau.changePage(\"switchesPage\");\n\t\t\t}else if(ItemClicked == \"Clear Database\"){\n\t\t\t\t//------------------------------------------Clear Database\n\t\t\t\t//This should be moved to it's own function.\n\t\t\t\tconsole.log(\"Clearing Database\");\n\t\t\t\tlocalStorage.clear();\n\t\t\t\tAccess_Token = null;\n\t\t\t\tAccess_Url = null;\n\t\t\t\tswitches_DB = null;\n\t\t\t\talert(\"Database Cleared\");\n\t\t\t\t//Maybe we should exit here?\n\t\t\t\t//------------------------------------------Clear Database\n\t\t\t}else if(ItemClicked == \"Routines\"){\n\t\t\t\ttau.changePage(\"routinesPage\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}", "function clickOn1(){if(goodAnswer == 1){ correctAnswerClick(1); }else{ badAnswerClick(1); }}", "click(){\n createAddItemWindow();\n }", "function operandClicked(key) {\r\n operatorButtons.forEach(operator => {\r\n if(operator.innerText === key) {\r\n operator.click();\r\n }\r\n })\r\n}", "function initCriteriaList() {\n jQuery(\"#progContainer\").hide();\n var critListElement = jQuery(\"#sideBarCriterias\");\n onEventMap = (mapTitle.indexOf(\"Veranstaltungen Ehrenamt\") != -1) ? true : false;\n onProjectMap = (mapTitle.indexOf(\"Ehrenamt Berlin\") != -1) ? true : false;\n var tabsHtml = \"\";\n if (onBerlinDe && onEventMap) {\n tabsHtml = '<div id=\"navigation-helper\" '\n + 'style=\"border-bottom: 1px dashed #e8e8e8; padding-left: 7px; padding-bottom: 8px; padding-top:3px; padding-right: 4px;\">'\n + '<a href=\"'+ baseUrl +'ehrenamt\" title=\"Zum Einsatzstadtplan wechseln\">Einsatzorte</a>&nbsp;|&nbsp;'\n + 'Veranstaltungen Heute</div>';\n } else if (onBerlinDe && onProjectMap) {\n tabsHtml = '<div id=\"navigation-helper\" '\n + 'style=\"border-bottom: 1px dashed #e8e8e8; padding-left: 7px; padding-bottom: 8px; padding-top:3px; padding-right: 4px;\">'\n + 'Einsatzorte&nbsp;|&nbsp;'\n + '<a href=\"'+ baseUrl +'veranstaltungen-ehrenamt\" title=\"Zum Veranstaltungsstadtplan wechseln\">Veranstaltungen Heute</a></div>';\n }\n var critLinkList = '';\n if (onBerlinDe && (onEventMap || onProjectMap)) {\n critLinkList += tabsHtml; // render special tab selection for inner ehrenamtsnetz navigation\n }\n critLinkList += '<table width=\"95%\" cellpadding=\"0\" border=\"0\"><tbody>';\n critLinkList += '<tr valign=\"top\">'; // TODO: onclick\n critLinkList += '<td rowspan=\"'+workspaceCriterias.result.length+1+'\" align=\"left\">';\n // rebuild upper part of the sideBar stub\n critLinkList += '<a id=\"sideBarLogoLink\" href=\"http://www.kiezatlas.de\">'\n + ' <img id=\"sideBarLogo\" src=\"'+IMAGES_URL +'kiezatlas-logo.png\" alt=\"Das Kiezatlas Logo\" '\n + ' border=\"0\" text=\"Das Kiezatlas Logo\"/></a></td>';\n critLinkList += '<td></td><td></td>';\n critLinkList += '</tr>';\n for (var i = 0; i < workspaceCriterias.result.length; i++) {\n var critName = [workspaceCriterias.result[i].critName];\n if ( i == 0 && workspaceCriterias.result.length == 2) {\n critLinkList += '<tr valign=\"center\">';\n } else {\n critLinkList += '<tr valign=\"top\">';\n }\n if (onBerlinDe && crtCritIndex == i) {\n critLinkList += '<td onclick=\"javascript:updateCategoryList(' + i + ');\" class=\"critLinkNormal selectedCriteria\">'\n + '<img src=\"http://www.berlin.de/_bde/css/list_bullet.png\"/>&nbsp;' + critName + '</td>';\n } else {\n critLinkList += '<td onclick=\"javascript:updateCategoryList(' + i + ');\" class=\"critLinkNormal\">'\n + critName + '</td>';\n }\n if (!onBerlinDe && crtCritIndex == i) {\n critLinkList += '<td align=\"left\">&#8226;</td></tr>';\n } else {\n critLinkList += '<td></td></tr>';\n }\n }\n critLinkList += '</tbody>';\n critLinkList += '</table>';\n // do append the concatenated html\n critListElement.html(critLinkList);\n if (!onBerlinDe) {\n var breadCrumpHtml = '<div id=\"navigation-helper\">'\n + '<a href=\"http://www.kiezatlas.de/tipps_und_tricks.pdf\" style=\"float: left;\" title=\"Tipps und Tricks zur Nutzung vom KiezAtlas (PDF)\">Tipps & Tricks</a>&nbsp;&nbsp;&nbsp;'\n + '&nbsp;&nbsp;&nbsp;<a href=\"http://www.kiezatlas.de/browse/'+mapAlias+'\" title=\"Zur klassichen Stadtplanoberfl&auml;che wechseln\">Zur klassischen Ansicht</a></div>';\n critListElement.append(breadCrumpHtml);\n }\n // set the correct images\n // if (workspaceInfos != null) setCustomWorkspaceInfos(); else setDefaultWorkspaceInfos();\n setWorkspaceInfos(workspaceHomepage, workspaceLogo, workspaceImprint, mapTitle);\n if (onEventMap) {\n // ### FIXME: make use of kiezatlas.mapTopics and thereofre initalize them earlier...\n var countHtml = '&nbsp;&nbsp;&nbsp;Insgesamt <b>' + mapTopics.result.topics.length + '</b> Veranstaltungen Heute<p></p>';\n jQuery(\"#sideBarCriterias\").append(countHtml);\n }\n }", "function hold_btn_Click(eventObject) {\r\n var userRole = cordys.getNodeText(GetPoUserMasterCompleteObjectModel.getData(), \".//*[local-name()='USER_ROLE']\", \"\", \"\");\r\n var callID = \"\";\r\n var currentRow = caseTbl.getCheckedRows();\r\n callID = callId[currentRow[0].index].getValue();\r\n if (userRole == \"StakeHolderMaker\") {\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='callId']\", callID);\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='action']\", 'HOLD');\r\n HoldReleaseDecisionOnCaseModel.reset();\r\n if (!HoldReleaseDecisionOnCaseModel.soapFaultOccurred) {\r\n if (callID != \"\") {\r\n xo__xElementbarButton__1_Click();\r\n application.notify(\"The case is held successfully\");\r\n hold_btn.hide();\r\n } else\r\n application.notify(\"Please select the case\");\r\n } else {\r\n application.notify(\"Holding failed. Please Contact the admin\");\r\n }\r\n } else if (userRole == \"ADMIN\" || userRole == \"VendorManager\") {\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='callId']\", callID);\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='action']\", 'HOLD');\r\n HoldReleaseDecisionOnCaseModel.reset();\r\n if (!HoldReleaseDecisionOnCaseModel.soapFaultOccurred) {\r\n if (callID != \"\") {\r\n xo__xElementbarButton__1_Click();\r\n application.notify(\"The case is held successfully\");\r\n hold_btn.hide();\r\n } else\r\n application.notify(\"Please select the case\");\r\n } else {\r\n application.notify(\"Holding failed. Please Contact the admin\");\r\n }\r\n }\r\n}", "function user_form_afterSelect(){\n\n\tvar pattern = tabsFrame.patternRestriction;\t\n var tgrpPanel = 'tgrp' + tgrp_position + 'Panel'; // determine panel name based on the tab name\n var grid = Ab.view.View.getControl('', tgrpPanel);\n var view = tabsFrame.newView; // get the view object\n var numOfTgrps = view.tableGroups.length; // get the number of tablegroups in the view object\n var table_name = \"\"; // variable to store the current table name\n var parentTable = \"\"; // variable to store the parent/owner table name (relevant to the curent table)\n var restriction = \"\"; // variable to store restriction for the next tab\n var numberOfTblgrps = Number(tabsFrame.tablegroupsRestriction); // number of tablegroups based on the selected pattern\n\t \n\t// if the number of tablegroup in the pattern matches the number of tablegroups in the view obj, enable corresponding tabs\n if (numOfTgrps == numberOfTblgrps) {\n for (j = 1; j < 4; j++) {\n dataTabsFrame.setTabEnabled(\"page3-\" + j, true);\n }\n }\n \n \tvar action = grid.actions.get('goNext' + tgrp_position);\n\taction.enable(false);\n\t\t\t\n // for \"data\" tablegroup\n if (tgrp_position == 1) {\n table_name = tabsFrame.datagrpRestriction;\n parentTable = tabsFrame.ownergrpRestriction;\n if ((numberOfTblgrps > 1) && !(pattern.match(/highlight/gi))) {\n $('goBack1').style.display = \"\";\n }\n else {\n $('goBack1').style.display = \"none\";\n }\n }\n \n // for \"owner\" tablegroup\n if (tgrp_position == 2) {\n table_name = tabsFrame.ownergrpRestriction;\n parentTable = tabsFrame.owner2grpRestriction;\n if (numberOfTblgrps > 2) {\n $('goBack2').style.display = \"\";\n }\n else {\n $('goBack2').style.display = \"none\";\n }\n }\n \n // for \"owner2\" tablegroup\n if (tgrp_position == 3) {\n table_name = tabsFrame.owner2grpRestriction;\n }\n \n // if a table was previously selected, restrict the grid show only that table record and hide the \"Select\" button\n if ((table_name != \"\") && (table_name != undefined)) {\n\t\taction.enable(true); \n\t\t \n // apply restriction to grid\n restriction = \"afm_tbls.table_name = '\" + table_name + \"'\";\n grid.refresh(restriction);\n \n\t\thideButtons(grid);\n\t\t\t\n } else if (parentTable != \"\") {\n\t\t\taction.enable(false); \n\t\t\t \n // otherwise, if a parent table exists, restrict grid to show all possible tables that can have the parent table as an owner table\n restriction = \"afm_tbls.table_name = '\" + parentTable + \"' OR EXISTS (SELECT 1 FROM afm_flds WHERE afm_tbls.table_name = afm_flds.table_name AND afm_flds.ref_table='\" + parentTable + \"'\";\n var listOfRestrictedTables = tabsFrame.listOfRestrictionTables;\n restriction += (valueExistsNotEmpty(listOfRestrictedTables) && listOfRestrictedTables != ';') ? \" AND table_name IN (\" + addStringSeparators(listOfRestrictedTables) + \")\" : \"\";\n restriction += \")\";\n grid.refresh(restriction);\n }\n \n // show the miniconsole filter uncollapsed\n if (grid) {\n\t\tgrid.indexLevel = 0;\n grid.isCollapsed = false;\n grid.showIndexAndFilter();\n }\n \n}", "function processClick(e){\n\t var object = e.target;\n\t if (e.target.classList.contains(\"panel-list-item\")) {\n\t\t object = e.target;\n\t } else if (e.target.parentNode.classList.contains(\"panel-list-item\")){\n\t\t object = e.target.parentNode;\n\t } else if (e.target.classList.contains(\"panel-section-tabs-button\")){\n\t\t object = e.target; \n\t }\n\t console.log(\"Checking for\"+object);\n\t var typ = object.getAttribute(\"type\");\n\t var val = object.getAttribute(\"value\");\n\t if (typ === \"script\"){ //If the typ is \"script\", then it will inject the script instead.\n\t\t browser.tabs.executeScript({\n\t\t\t file: \"/contentScripts/newScript.js\"\n\t\t });\n\t } else if (typ === \"url\"){ //Otherwise it opens a new tab with the URL contained in the \"value\" attribute.\n\t\t\tbrowser.tabs.create({\n\t\t\t\turl: val\n\t\t\t});\n\t } else if (typ === \"urlscript\"){ //if typ is \"urlscript\" then we make a new tab, and then inject the newScript.js (which is the tweak controls)\n\t\t\tvar creating = browser.tabs.create({\n\t\t\t\turl: val\n\t\t\t});\n\t\t\tcreating.then(() => browser.tabs.executeScript({\n\t\t\t file: \"/contentScripts/newScript.js\"\n\t\t\t\t})\n\t\t\t);\n\t } else if (typ === \"tab\"){ //If we clicked on a panel tab, then we switch over to that tab.\n\t\t console.log(\"It's a tab!\");\n\t\t switchToTab(val);\n\t } else if (typ===\"errorReport\"){\n\t\t/*TODO: We still need to figure out how to put the HTML into the email. This would have worked. But it glitched up and the mailto link is too long.*/\n\n\t\t//This theoretically should ask the page for the HTML. But this should only do this on facebook.com or messenger.com. If you try to run it on another, the content script fails to get injected properly, due to permissions.\n\t\t//findTab().then(requestTabForHTML).then(parsePacketForHTML).then(generateEncodedErrorMessageTemplate).then(generateFullErrorEmailURL).then(makeTabWithURL).catch(onError);\n\t \tgenerateEncodedErrorMessageTemplate().then(generateFullErrorEmailURL).then(makeTabWithURL).catch(onError);\n\t } else if (typ===\"submit\"){\n\t\t return;\n\t }\n}", "function clickHandler(event) {\n \tconsole.log('event');\n \ttau.openPopup(popup);\n }", "function handleClick() {\n $('button').click(function(event){\n emptyAbilities();\n renderAbilities(event.currentTarget.innerHTML);\n showAbilities();\n });\n }", "function onBrowserActionClick() {\n info(\"event: browser action icon was clicked\");\n click($(_ID_STATUS));\n}", "function onClickFloor(){\n var flGrid = View.panels.get(\"abEqStatusUpdate_gr_fl\");\n var selectedRow = flGrid.rows[flGrid.selectedRowIndex];\n\t\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"eq.bl_id\", selectedRow[\"fl.bl_id\"], \"=\");\n\trestriction.addClause(\"eq.fl_id\", selectedRow[\"fl.fl_id\"], \"=\");\n\t\n\tvar eqGrid = View.panels.get(\"abEqStatusUpdate_gr_eq\");\n eqGrid.refresh(restriction);\n\tvar eqForm = View.panels.get(\"updateEqStatusForm\");\n eqForm.refresh(restriction);\n}", "function handleOnButtonClick(asBtn) {\r\n switch (asBtn) {\r\n case 'FILTER':\r\n setObjectValue(\"process\", \"loadEntityVehicleList\");\r\n submitFirstForm();\r\n break;\r\n case 'CLEAR':\r\n clearFormFields(document.forms[0], false, true);\r\n setObjectValue(\"process\", \"loadEntityVehicleList\");\r\n submitFirstForm();\r\n break;\r\n case 'SEL':\r\n if (isDefined(getObject(\"vehicleListGrid1\"))) {\r\n if (getParentWindow()) {\r\n //Set selected vehicle information\r\n getParentWindow().SELECTED_VEHICLE_INFO.vehicleId = vehicleListGrid1.recordset(\"ID\").value;\r\n getParentWindow().SELECTED_VEHICLE_INFO.entityId = vehicleListGrid1.recordset(GRID_CENTITYID).value;\r\n getParentWindow().SELECTED_VEHICLE_INFO.vehicleDescription = vehicleListGrid1.recordset(GRID_CVEHICLEDESCRIPTION).value;\r\n getParentWindow().SELECTED_VEHICLE_INFO.vehicleNo = vehicleListGrid1.recordset(GRID_CVEHICLENO).value;\r\n getParentWindow().SELECTED_VEHICLE_INFO.serialNo = vehicleListGrid1.recordset(GRID_CSERIALNO).value;\r\n getParentWindow().SELECTED_VEHICLE_INFO.tagNo = vehicleListGrid1.recordset(GRID_CTAGNO).value;\r\n getParentWindow().SELECTED_VEHICLE_INFO.vin = vehicleListGrid1.recordset(GRID_CVIN).value;\r\n getParentWindow().SELECTED_VEHICLE_INFO.vehicleType = vehicleListGrid1.recordset(GRID_CVEHICLETYPE).value;\r\n getParentWindow().SELECTED_VEHICLE_INFO.make = vehicleListGrid1.recordset(GRID_CMAKE).value;\r\n getParentWindow().SELECTED_VEHICLE_INFO.YEAR = vehicleListGrid1.recordset(GRID_CYEAR).value;\r\n getParentWindow().SELECTED_VEHICLE_INFO.licenseState = vehicleListGrid1.recordset(GRID_CLICENSESTATE).value;\r\n getParentWindow().SELECTED_VEHICLE_INFO.garageState = vehicleListGrid1.recordset(GRID_CGARAGESTATE).value;\r\n closeWindow(getParentWindow().OPEN_SELECT_VEHICLE_PARAMETERS.callbackEvent);\r\n }\r\n } else {\r\n alert(getMessage(\"ci.vehicle.searchSelect.msg.warning.vehicleNotFound\", new Array(getObjectValue(vehiclefields.ENTITY_DESCRIPTION))));\r\n }\r\n break;\r\n case 'CANCEL':\r\n closeWindow();\r\n break;\r\n default: break;\r\n }\r\n}", "addClickHandler() {\n this.$el.find(this.settings.menuGroupTitleSelector).on('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n window.open(this.menu.find(this.settings.firstItemSelector).first().attr('href'), e.metaKey ? '_blank' : '_self');\n });\n this.toggler.on('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n this.menu.toggleClass(this.settings.visibleCssClass);\n this.setTogglerIcon(this.settings.icon.selector);\n });\n }", "click(id, event) {\n let tab = this.get(id)\n if (tab == null || tab.disabled || this.last.reordering) return false\n // event before\n let edata = this.trigger('click', { target: id, tab: tab, object: tab, originalEvent: event })\n if (edata.isCancelled === true) return\n // default action\n query(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.active)).removeClass('active')\n query(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.active)).removeClass('active')\n this.active = tab.id\n // route processing\n if (typeof tab.route == 'string') {\n let route = tab.route !== '' ? String('/'+ tab.route).replace(/\\/{2,}/g, '/') : ''\n let info = w2utils.parseRoute(route)\n if (info.keys.length > 0) {\n for (let k = 0; k < info.keys.length; k++) {\n if (this.routeData[info.keys[k].name] == null) continue\n route = route.replace((new RegExp(':'+ info.keys[k].name, 'g')), this.routeData[info.keys[k].name])\n }\n }\n setTimeout(() => { window.location.hash = route }, 1)\n }\n // event after\n edata.finish()\n this.refresh(id)\n }", "function createAccountLinkClicked() {\n createAccountEl.addEventListener(\"click\", function () {\n createAccountModalTrigger();\n });\n }", "function executeSearch(){\n\t/*Save the form data to a JSON file, so that it can be autopopulated the next time the form page is opened.*/\n\tsaveJsonToBrowserStorage(convertCriteriaToJSON());\n\t/*Redirect to the search page*/\n\tcreateNewTabWithURL(generateSearchURL());\n\t/*Close the Current Tab, as it has no need to be open, and avoid Tab Spam.*/\n\tcloseCurrentTab();\n}", "function OnClickObjectiveOk() {\n SetActive('#LO', false);\n OnClickLevel1();\n}", "function clickOptiontoSelect(){\n\n}", "handleSlotClick() {\n if (this.triggers === 'focus') {\n this.focusOnButton();\n }\n if (this.triggers === 'click') {\n this.popoverVisible = true;\n }\n }", "function legendClick(candidate, button) {\n\n\tif(mode === 'move') {\n\n\t} else if(mode === 'paint' || mode === 'paintmove') {\n\t\tpaintIndex = candidate;\n\t\tLegendManager.selectCandidateDisplay(button);\n\t} else if(mode === 'candidate' && candidate !== 'Tossup') {\n\t\tvar candidateedit = document.getElementById('candidateedit');\n\t\tcandidateedit.style.display = 'inline';\n\t\tvar nameinput = document.getElementById('candidate-name');\n\t\tnameinput.value = candidate;\n\t\tvar solidinput = document.getElementById('candidate-solid');\n\t\tsolidinput.value = CandidateManager.candidates[candidate].colors[0];\n\t\tvar likelyinput = document.getElementById('candidate-likely');\n\t\tlikelyinput.value = CandidateManager.candidates[candidate].colors[1];\n\t\tvar leaninput = document.getElementById('candidate-lean');\n\t\tleaninput.value = CandidateManager.candidates[candidate].colors[2];\n\t\tvar tiltinput = document.getElementById('candidate-tilt');\n\t\ttiltinput.value = CandidateManager.candidates[candidate].colors[3];\n\t\tvar hiddeninput = document.getElementById('candidate-originalName');\n\t\tvar message = document.getElementById('candidateedit-message');\n\t\tmessage.innerHTML = 'Edit ' + candidate;\n\t\thiddeninput.value = candidate;\n\t} else if(mode === 'deletecandidate' && candidate !== 'Tossup') {\n\t\tCandidateManager.deleteCandidateByName(candidate);\t\t\n\t}\n}", "function selectButtonOnClick(ev)\n{\n\t//console.log(\"selectButtonOnClick(\", ev, \")\");\n\tstopPointTable.toggleCheckBoxVisibility();\n}", "function setEventHandlers() {\n $('#edit-category-button').click(function(){\n window.location.href = '/book_shop/admin/editCategory';\n return false;\n });\n\n $('#edit-book-button').click(function(){\n window.location.href = '/book_shop/admin/editBook';\n return false;\n });\n\n $('#edit-customer-button').click(function(){\n window.location.href = '/book_shop/admin/editCustomer';\n return false;\n });\n\n $('#edit-customer-order-button').click(function(){\n window.location.href = '/book_shop/admin/editCustomerOrder';\n return false;\n });\n }", "function clickedExplore() {\n if (!tabControl.isTabShowing(tabControl.TABS.EXPLORE)) {\n return;\n }\n showSpinner();\n clearIsochrone();\n\n if (exploreLatLng) {\n fetchIsochrone();\n } else {\n getNearbyPlaces();\n }\n }", "function allClick() {\n if (core || career || chosen) { // If any other tab is currently open, set them to false and show all courses\n setAll(true);\n setCore(false);\n setCareer(false);\n setChosen(false);\n }\n }", "function button_click(e) {\n e.preventDefault();\n var $this = e.target,\n name = $this.ancestor('.plugin.well').getAttribute('data-key'), // Get addon name.\n action = $this.getAttribute('data-action');\n if ($this.hasClass('disabled')) {\n return;\n }\n Y.log($this);\n // Get the addon object key to add to action list.\n\n Y.log('Button '+action+' started for '+name);\n // Add addon to actions array.\n if (action in M.local_rlsiteadmin.data_actions) {\n M.local_rlsiteadmin.data_actions[action][name] = name;\n Y.log(M.local_rlsiteadmin.data_actions);\n } else {\n Y.log('Unknown action requested: '+action);\n }\n\n // Disable button for this plugin.\n $this.addClass('disabled');\n M.local_rlsiteadmin.action_dropdown_update();\n }", "function metric_clicks()\n\t\t\t{\n\n\t\t\t\t// var rec_apn = dojo.connect(dojo.byId('apnButton'), 'onclick', null, function() {\n\n\t\t\t\t// \tvar apn = apn_search.value;\n\n\t\t\t\t// \tpostMetric(productCode,sessionNumber + ':FindView APN Search - (Click) ~ ' + apn);\n\n\t\t\t\t// });\n\n\t\t\t\t// var rec_address = dojo.connect(dojo.byId('addressButton'), 'onclick', null, function() {\n\n\t\t\t\t// \tvar address = address_search.value;\n\n\t\t\t\t// \tpostMetric(productCode,sessionNumber + ':FindView Address Search - (Click) ~ ' + address);\n\n\t\t\t\t// });\n\n\n\t\t\t\t// var rec_streets = dojo.connect(dojo.byId('streetsButton'), 'onclick', null, function() {\n\n\t\t\t\t// \tvar streets = crossStreet_search.value;\n\n\t\t\t\t// \tpostMetric(productCode,sessionNumber + ':FindView Streets Search - (Click) ~ ' + streets);\n\n\t\t\t\t// });\n\n\n\t\t\t\t// var rec_owner = dojo.connect(dojo.byId('ownerButton'), 'onclick', null, function() {\n\n\t\t\t\t// \tvar owner = owner_search.value;\n\n\t\t\t\t// \tpostMetric(productCode,sessionNumber + ':FindView Owner Search - (Click) ~ ' + owner);\n\n\t\t\t\t// });\n\n\n\n\t\t\t\t// var rec_poi = dojo.connect(dojo.byId('poiButton'), 'onclick', null, function() {\n\n\t\t\t\t// \tvar POI = poi_search.value;\n\n\t\t\t\t// \tpostMetric(productCode,sessionNumber + ':FindView POI Search - (Click) ~ ' + POI);\n\n\t\t\t\t// });\n\n\t\t\t}", "function doClick(e) {\n options.onClick(e);\n }", "function onFleetButton( event ) {\r\n\topenWindowMenu(3);\r\n}", "function clickHandler(event) {\n\tindexChangeSections(event);\n\ttabChangeSections(event);\n}", "wallEditorTabClick() {\n this.projectEditorTab.className = \"HVACApplication_ProjectEditorTab\";\n this.wallEditorTab.className = \"HVACApplication_WallEditorTab selected\";\n this.roomEditorTab.className = \"HVACApplication_RoomEditorTab\";\n this.viewEditorTab.className = \"HVACApplication_ViewEditorTab\";\n this.simulatorTab.className = \"HVACApplication_SimulatorTab\";\n\n if (this.currentEditor != null) {\n this.currentEditor.hide();\n this.currentEditor.getDiv().remove();\n }\n this.currentEditor = this.wallEditor;\n this.mainContentDiv.appendChild(this.currentEditor.getDiv());\n this.currentEditor.show();\n this.showFloorPicker();\n }" ]
[ "0.6142148", "0.60345095", "0.59485", "0.594289", "0.59227425", "0.58963495", "0.5866551", "0.5862355", "0.58620954", "0.58570975", "0.58541536", "0.5790099", "0.57886904", "0.5778321", "0.57543445", "0.575279", "0.5742212", "0.5741319", "0.5739748", "0.57186145", "0.5716675", "0.5714494", "0.5711426", "0.5702334", "0.5692796", "0.56809264", "0.5676466", "0.566637", "0.5662622", "0.5647409", "0.5629177", "0.56153595", "0.5606588", "0.56047446", "0.5601928", "0.5593831", "0.5574136", "0.5571207", "0.55583394", "0.5552507", "0.55323565", "0.5532268", "0.55210483", "0.55193806", "0.5512413", "0.5509072", "0.5504005", "0.5503036", "0.55017495", "0.5497859", "0.5487637", "0.5478064", "0.5474588", "0.5474588", "0.54724747", "0.5466685", "0.5465682", "0.5462209", "0.5431857", "0.54300797", "0.54287654", "0.54281133", "0.5422869", "0.5417077", "0.54168695", "0.54167986", "0.54155904", "0.5415247", "0.5410548", "0.5409119", "0.5407956", "0.5405946", "0.53992516", "0.5393332", "0.5393146", "0.53926027", "0.53915286", "0.5389977", "0.53875995", "0.5385997", "0.5384032", "0.5383994", "0.53822166", "0.53788424", "0.5376968", "0.537633", "0.53734666", "0.5369336", "0.53670955", "0.53666586", "0.53594315", "0.53586435", "0.5357545", "0.53517747", "0.5350739", "0.5345446", "0.53376997", "0.5337326", "0.53373206", "0.53365374" ]
0.5765704
14
Method to render individual criteria codes and their respective tooltip 'datastatus' attribute flags whether a criterion is met
renderCriteriaBar(key, evidence, interpretation) { let status = 'not-evaluated'; // Flag 'met' criteria via [data-status] let evalArray = interpretation.evaluations; if (evalArray) { if (evalArray.length) { evalArray.forEach(entry => { if (typeof entry.criteria !== 'undefined' && entry.criteria === key) { status = entry.criteriaStatus; } }); } } return ( <button className={'btn btn-default ' + evidence[key].class + ' ' + evidence[key].category + this.getCurrentTab(evidence[key].category)} type="button" key={key} data-status={status} data-toggle="tooltip" data-placement="top" data-tooltip={evidence[key].definition} onClick={this.handleClick.bind(this, key, evidence[key].category)}> <span>{key}</span> </button> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTestResults() {\n\n var trLength = testResults.length;\n if (trLength > 0 ) {\n\n // Get the labels for each of the system statuses\n var passed_label = getStatusLabel(\"passed\");\n var blocked_label = getStatusLabel(\"blocked\");\n var untested_label = getStatusLabel(\"untested\");\n var retest_label = getStatusLabel(\"retest\");\n var failed_label = getStatusLabel(\"failed\");\n\n var data = new google.visualization.arrayToDataTable([\n [{label: 'Test Plan', id: 'TestPlan'},\n {label: passed_label, id: 'Passed', type: 'number'},\n {label: blocked_label, id: 'Blocked', type: 'number'},\n {label: untested_label, id: 'Untested', type: 'number'},\n {label: retest_label, id: 'Retest', type: 'number'},\n {label: failed_label, id: 'Failed', type: 'number'}]\n ]);\n\n // Add the label information for any custom statuses\n for (var i = 1; i <= customStatusCount; i++) {\n data.addColumn({label: getStatusLabel(\"custom_status\" + String(i)), id: 'CustomStatus'+String(i), type: 'number'});\n }\n\n // Add a row for each set of test results\n for (var i = 0; i < trLength; i++) {\n var rowArray = [testResults[i][0] + \" (\" + testResults[i][3] + \")\", testResults[i][4], testResults[i][5], testResults[i][6], testResults[i][7], testResults[i][8]];\n\n // Push any custom statuses onto the row\n for (var j = 1; j <= customStatusCount; j++) {\n rowArray.push(testResults[i][j+8]);\n }\n data.addRow(rowArray);\n }\n\n var chartAreaHeight = data.getNumberOfRows() * 30;\n var chartHeight = chartAreaHeight + 80;\n var chartWidth = gadgets.window.getViewportDimensions().width - 50;\n\n // Get the display color for each of the system statuses\n var passed_color = getStatusColor(\"passed\");\n var blocked_color = getStatusColor(\"blocked\");\n var untested_color = getStatusColor(\"untested\");\n var retest_color = getStatusColor(\"retest\");\n var failed_color = getStatusColor(\"failed\");\n\n var colorArray = [passed_color, blocked_color, untested_color, retest_color, failed_color];\n\n // Add the display color information for any custom statuses\n for (var i = 1; i <= customStatusCount; i++) {\n colorArray.push(getStatusColor(\"custom_status\" + String(i)));\n }\n\n var options = {\n allowHtml: true,\n sliceVisibilityThreshold: 0,\n height: chartHeight,\n width: chartWidth,\n colors: colorArray,\n isStacked: 'percent',\n legend: { position: 'top', maxLines: 3 },\n bar: { groupWidth: 20 },\n chartArea: {\n left: '18%',\n height: chartAreaHeight,\n width: '75%'\n },\n vAxis: {\n textStyle: { fontSize: 11 }\n },\n hAxis: {\n minValue: 0,\n ticks: [0, .25, .5, .75, 1]\n }\n };\n\n // Instantiate and draw our chart, passing in the options.\n var myProjectChart = new google.visualization.BarChart(document.getElementById('projectsAllChart'));\n myProjectChart.draw(data, options);\n document.getElementById('projectsAllCaption').innerHTML = \"All active <a href='\" + testRailURL + \"' target='_blank'>TestRail</a> test results\";\n document.getElementById('disclaimer').innerHTML = \"For any of the above links a TestRail login is required.\";\n } else {\n document.getElementById('projectsAllCaption').innerHTML = \"No active test plans or test runs found\";\n }\n gadgets.window.adjustHeight();\n}", "function renderTestResults() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Status');\n data.addColumn('number', 'Number');\n\n // Get the labels for each of the system statuses\n var passed_label = getStatusLabel(\"passed\");\n var blocked_label = getStatusLabel(\"blocked\");\n var untested_label = getStatusLabel(\"untested\");\n var retest_label = getStatusLabel(\"retest\");\n var failed_label = getStatusLabel(\"failed\");\n\n data.addRows([\n [passed_label, testResults[0]],\n [blocked_label, testResults[1]],\n [untested_label, testResults[2]],\n [retest_label, testResults[3]],\n [failed_label, testResults[4]]\n ]);\n\n // Add the rows for any custom statuses\n for (var i = 1; i <= customStatusCount; i++) {\n data.addRow([getStatusLabel(\"custom_status\" + String(i)),testResults[4+i]]);\n }\n\n var chartWidth = gadgets.window.getViewportDimensions().width;\n var chartHeight = chartWidth - 200;\n\n // Get the display color for each of the system statuses\n var passed_color = getStatusColor(\"passed\");\n var blocked_color = getStatusColor(\"blocked\");\n var untested_color = getStatusColor(\"untested\");\n var retest_color = getStatusColor(\"retest\");\n var failed_color = getStatusColor(\"failed\");\n\n var colorArray = [passed_color, blocked_color, untested_color, retest_color, failed_color];\n\n // Add the display color information for any custom statuses\n for (var i = 1; i <= customStatusCount; i++) {\n colorArray.push(getStatusColor(\"custom_status\" + String(i)));\n }\n\n // Set chart options\n var options = {\n allowHtml: true,\n sliceVisibilityThreshold: 0,\n colors: colorArray,\n legend: {\n alignment: 'center',\n position: 'top'\n },\n chartArea: {\n left: '5%',\n top: '10%',\n width: \"90%\",\n height: \"80%\"\n },\n width: chartWidth,\n height: chartHeight\n };\n\n // Instantiate and draw our chart, passing in the options.\n var myMilestoneChart = new google.visualization.PieChart(document.getElementById('milestoneChart'));\n myMilestoneChart.draw(data, options);\n document.getElementById('milestoneCaption').innerHTML = \"Testing results for the \" + projectName + \" <a href=\\\"\" + milestoneURL + \"\\\" target=\\\"_blank\\\">\" + milestoneName + \"</a> milestone\";\n document.getElementById('disclaimer').innerHTML = \"For any of the above links a TestRail login is required.\";\n gadgets.window.adjustHeight();\n}", "function getStatusHtml() { \n return `<div class='status_bar'>\n <span>Question ${getCurrentNum() + 1} / ${DATA_SOURCE.length}</span>\n <span>Score ${getRightCnt()}</span>\n </div>`;\n}", "tooltip_render (tooltip_data) {\n\t let text = \"<ul>\";\n\t tooltip_data.result.forEach((row)=>{\n if(row.votecount != \"\") {\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\" (\"+row.percentage+\")\" + \"</li>\"\n }\n\t });\n\t return text;\n\t}", "renderCompStatus() {\r\n const { Cell } = Table;\r\n const { companies } = this.props;\r\n if (companies.status === \"2\" || companies.status === 2) {\r\n return (\r\n <Cell textAlign=\"center\" singleLine style={{ color: 'red' }}>In Active</Cell>\r\n );\r\n } else if (companies.status === \"1\" || companies.status === 1) {\r\n return (\r\n <Cell textAlign=\"center\" singleLine style={{ color: 'green' }}>Active</Cell>\r\n );\r\n } else {\r\n return (\r\n <Cell textAlign=\"center\" singleLine >-</Cell>\r\n );\r\n }\r\n }", "tooltip_render (tooltip_data) {\n\t let text = \"<ul>\";\n\t tooltip_data.result.forEach((row)=>{\n\t\tif (row.votecount.length != 0){\n\t \n\t\t\ttext += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n\t\t}\n\t });\n\n\t return text;\n\t}", "function status_to_html(actual) {\n html_start = '<span data-toggle=\"tooltip\" data-placement=\"top\" title=\"' + actual.time + '\">'\n html_end = '</span>'\n if (actual.status == \"on time\") {\n var on_time = ' <span class=\"on-time\">' + actual.status + '</span>';\n return html_start + on_time + html_end\n } else if (actual.status == \"no time clocked\") {\n return '<span>' + actual.status + html_end;\n } else {\n time_diff = ' <span class=\"not-on-time\">' + actual.diff + '</span>';\n return html_start + actual.status + time_diff + html_end;\n }\n}", "getAreaHTML(props) {\n //set the font color to red if the area protected is less than the target area\n let color =\n this.props.feature.protected_area < this.props.feature.target_area &&\n props.row.key === \"Area protected\"\n ? \"red\"\n : \"rgba(0, 0, 0, 0.6)\";\n //rounded to 6 sf in the hint\n let html = (\n <div\n title={getArea(props.row.value, this.props.reportUnits, false, 6)}\n style={{ color: color }}\n >\n {getArea(props.row.value, this.props.reportUnits, true)}\n </div>\n );\n return html;\n }", "tooltip_render (tooltip_data) {\n let text = \"<ul>\";\n tooltip_data.result.forEach((row)=>{\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n });\n\n return text;\n }", "function showInclusionCriteriaByMethod(mp_method, incCritQL) {\r\n if (mp_method == \"Case Report\"){\r\n $(\"#cr-ic-questions-div\").css(\"display\",\"block\");\r\n }\r\n else if (mp_method == \"Clinical study\") || (mp_method == \"Metabolic Experiment\") {\r\n\tvar icdiv = null; \r\n\tvar newHtml = \"\";\r\n\tif (mp_method == \"Clinical study\") {\r\n $(\"#ct-ic-questions-div\").css(\"display\",\"block\");\r\n\t icdiv = document.getElementById(\"ct_ic_table_div\");\r\n\t newHtml = '<input id=\"confirmedEvType-value\" value=\"Clinical study\" type=\"hidden\" name=\"confirmedEvType\" />';\r\n\t}\r\n\telse if (mp_method == \"Metabolic Experiment\") {\r\n\t $(\"#ex-mt-ic-questions-div\").css(\"display\",\"block\");\r\n\t $(\"#ex_mt_ic_table_div\").css(\"display\",\"block\");\r\n\t icdiv = document.getElementById(\"ex_mt_ic_table_div\");\r\n\t newHtml = '<input id=\"confirmedEvType-value\" value=\"Metabolic Experiment\" type=\"hidden\" name=\"confirmedEvType\" />';\r\n\t}\r\n\tnewHtml += '<table style=\"width:100%\">'\r\n\tvar n = i;\r\n\tvar curGroup = \"\";\r\n\tfor (var i = 0; i < incCritQL.length; i++) {\r\n\t n = i + 1;\r\n\t if (curGroup !== incCritQL[i][\"icGroup\"]){\r\n\t\tcurGroup = incCritQL[i][\"icGroup\"]\r\n\t\tnewHtml += '<tr><td style=\"width:50%\"><h3>'+ incCritQL[i][\"icGroup\"] + '</h3></td><td/><td/><td/></tr>';\r\n\t }\r\n\r\n\t if (i % 2 == 0){\r\n \t\tnewHtml += '<tr style=\"background-color:#def2ef\">';\r\n\t } else {\r\n\t\tnewHtml += '<tr>';\r\n\t }\r\n\t newHtml += '<td style=\"width:50%\"><label data-toggle=\"tooltip\" data-placement=\"right\" title=\"Tooltip on right\">' + n + '. ' + incCritQL[i][\"icText\"] + '&nbsp;<a target=\"new\" href=\"../static/pdf/FDA-2017-guidance-on-clinical-DDI-evalutations-UCM292362.pdf#nameddest=' + incCritQL[i][\"icSourceRef\"].replace(/ /g,\"\") + '\">' + incCritQL[i][\"icSourceRef\"] + '</a></label></td>';\r\n\t newHtml += '<td style=\"width:20%\"><label class=\"radio-inline\"><input type=\"radio\" name=\"' + incCritQL[i][\"icID\"] + '\" ng-model=\"myVar\" value=\"yes\">Yes</label></td>';\r\n\t newHtml += '<td style=\"width:20%\"><label class=\"radio-inline\"><input type=\"radio\" name=\"' + incCritQL[i][\"icID\"] + '\" ng-model=\"myVar\" value=\"no\">No</label></td>';\r\n\t newHtml += '<td style=\"width:20%\"><label class=\"radio-inline\"><input type=\"radio\" name=\"' + incCritQL[i][\"icID\"] + '\" ng-model=\"myVar\" value=\"unsure\">Unsure/NA</label></td>';\r\n\t newHtml += '</tr>';\r\n\t}\r\n\tnewHtml += '</table>';\r\n\ticdiv.innerHTML = newHtml;\r\n }\r\n\r\n else if (mp_method == \"Transport Experiment\"){\r\n $(\"#ex-tp-ic-questions-div\").css(\"display\",\"block\");\r\n }\r\n else {\r\n\tconsole.log(\"[ERROR] evidence type undefined: \" + mp_method);\r\n }\r\n}", "function statusRender(value,parent,record) {\r\n if(value == IM_PRESENCE_IN_CALL) return '<img id=\"' + record.data['name'] + '_presence\" src=\"' + incallImgSrc + '\" alt=\"' + getLocalizationValue('application.javascript.contactList.image.tooltip.incall') + '\" onmouseover=\"setInCallTime(\\'' + record.data['name'] + '\\')\"/>';\r\n if(value == IM_PRESENCE_ONLINE) return '<img src=\"' + onlineImgSrc + '\" alt=\"' + getLocalizationValue('application.javascript.contactList.image.tooltip.online') + '\"/>';\r\n if(value == IM_PRESENCE_AFTER_CALL_WORK) return '<img id=\"' + record.data['name'] + '_presence\" src=\"' + afterCallImgSrc + '\" alt=\"' + getLocalizationValue('application.javascript.contactList.image.tooltip.aftercall') + '\" onmouseover=\"setACWTime(\\'' + record.data['name'] + '\\')\"/>';\r\n if(value == IM_PRESENCE_IN_IM_CONVERSATION) return '<img src=\"' + inImImgSrc + '\" alt=\"' + getLocalizationValue('application.javascript.contactList.image.tooltip.inim') + '\" />';\r\n if(value == IM_PRESENCE_OFFLINE) return '<img src=\"' + offlineImgSrc + '\" alt=\"' + getLocalizationValue('application.javascript.contactList.image.tooltip.offline') + '\" />';\r\n}", "function status_companyinfo(){\n if(inspectedItem !== \"\"){\n\n var tag = inspectedItem.status;\n let color = \"purple\";\n if (tag.toUpperCase() === 'ACQUIRED') {\n color = 'blue';\n }else if(tag.toUpperCase() === 'CLOSED'){\n color = 'red';\n }else if (tag.toUpperCase() === 'OPERATING'){\n color = 'green'\n }\n\n return (\n <Tag color={color} key={tag}>\n {tag.toUpperCase()}\n </Tag>\n );\n }\n }", "renderStatus(stat){\n const {title, message, status, admin_email, sid} = stat\n const pendingColor = '#ff6b57';\n const resolvedColor = '#2ef15b';\n const unresolvedColor = '#f22e2e';\n const inProgressColor = '#2d3ef0';\n const color = {\n 'PENDING': pendingColor,\n 'RESOLVED': resolvedColor,\n 'UNRESOLVED': unresolvedColor,\n 'IN PROGRESS': inProgressColor\n }\n return (\n <div key={'status-'+sid}>\n <Typography type=\"body2\" gutterBottom>\n {title}\n </Typography>\n <Typography type=\"body1\" gutterBottom>\n {message}\n </Typography>\n <Chip label={status} style={{backgroundColor:color[status], color: '#ffffff'}} />\n <Divider className={this.props.classes.divider}/>\n </div>\n )\n }", "function renderStatus (value, p, r) {\n var statusId = r.get('statusId');\n if(statusId == 1)\n return '<span class=\\'successBox font10\\' >#{msgs.success}</span>';\n else if(statusId == 2)\n return Ext.String.format('<span class=\\'warnBox font10\\' >#{msgs.warning}</span>',value);\n else if(statusId == 0)\n return Ext.String.format('<span class=\\'failBox font10\\' >#{msgs.fail}</span>',value); \n else\n return Ext.String.format('{0}', value === null ? '#{msgs.task_result_pending}' : value);\n}", "function format ( d ) {\n// `d` is the original data object for the row\nr = '<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" style=\"padding-left:50px;\">'+\n '<thead>'+\n '<tr>'+\n '<th>'+\n 'Status'+\n '</th>'+\n '<th>'+\n 'Code'+\n '</th>'+\n '<th>'+\n 'Description'+\n '</th>'+\n '<th>'+\n 'Complete'+\n '</th>'+\n '</tr>'+\n '</thead>'+\n '<tbody>';\n\n d.statuses.forEach(function(value){\n r += '<tr><td>'+ value.name +'</td>'+\n '<td>'+ value.code +'</td>'+\n '<td>'+ value.description +'</td>'\n if(value.complete == 1)\n {\n r += \"<td><span style='color:green;font-size: 2em; margin-top:5px;' class='glyphicon glyphicon-check'></span></td></tr>\"\n }\n else\n {\n r += \"<td><span style='color:red;font-size: 2em; margin-top:5px;' class='glyphicon glyphicon-remove'></span></td></tr>\"\n }\n });\n\n return r + '</tbody>'+'</table>';\n}", "tooltip_render(tooltip_data) {\n let text = \"<h2>\" + tooltip_data.state + \"</h2>\";\n text += \"<div>Deaths: \" + tooltip_data.deaths+\"</div>\";\n text += \"<div>Rate per 100,000: \" + tooltip_data.rate+\"</div>\";\n\n\n return text;\n }", "tooltip_render (tooltip_data) {\n let text = \"<ul>\";\n tooltip_data.forEach((row)=>{\n text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.percentage+\"%)\" + \"</li>\"\n });\n text += \"</ul>\"\n\n return text;\n }", "_showStatus() {\n if (this._titleJqElem) {\n let statusElem = this._titleJqElem.find(\".chart-status:first\");\n statusElem.children(\".chart-status-text:first\").text(this.controlOptions.chartStatus);\n\n if (this.controlOptions.hasError) {\n statusElem.addClass(\"error\");\n } else {\n statusElem.removeClass(\"error\");\n }\n }\n }", "tooltip_render (tooltip_data)\r\n\t{\r\n\t\t//var that=this;\r\n\t let text = \"<ul>\";\r\n\t // console.log(\"----\",tooltip_data);\r\n\t tooltip_data.forEach((row)=>{\r\n\t text += \"<li class = \" + this.chooseClass(row.party)+ \">\" + row.nominee+\":\\t\\t\"+row.votecount+\"(\"+row.value+\"%)\" + \"</li>\"\r\n\t });\r\n\r\n\t return text;\r\n\t}", "function formatCondition() {\n if (id_result.condition == \"new\") {\n return \"Nuevo\";\n } else if (id_result.condition == \"used\") {\n return \"Usado\";\n } else return \"\";\n }", "function getStatus($){\n if ($.status){\n return Label($, { string: $.status, style: smallStyle }),\n } else{\n return Label($, { string: globalStats, style: smallStyle }),\n }\n}", "function showStatus() \n{\n\t/* score */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"score:\"+score, 5, 16);\n\t/* level */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"level:\"+level, 5, 32);\n\t/* bullet left */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"bullet:\"+bnum, 5, 48);\n\t/* blood */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"blood:\"+blood, 5, 64);\n}", "function getTooltip (data) {\n if (data == \"loading\")\n return 'Loading...';\n else\n return data ? 'Remove from collection' : 'Add to collection'\n }", "function RENDEReditstatus_canonical(gridrowitem)\r\n{\r\n var v = (gridrowitem.getMember('c_u_EditStatus').get_value());\r\n // v is now a number, e.g. 32 means \"NEW\"\r\n if ((v & 6) == 6) {\r\n\treturn \"<IMG alt='New entitlement now being undone' src='media/ADDED.gif'/><IMG alt='New entitlement now being undone' src='media/DELETED.gif'/>\";\r\n }\r\n if (v & 2) {\r\n\treturn \"<IMG alt='NEW entitlement' src='media/ADDED.gif'/>\";\r\n }\r\n if (v & 4) {\r\n\treturn \"<IMG alt='DELETED entitlement' src='media/DELETED.gif'/>\";\r\n }\r\n\r\n var retval = \"\";\r\n if (v & 8) {\r\n\tretval += \"<IMG alt='Change occurred in at least one entitlement field' src='media/EDITEDvector.gif'/>\";\r\n }\r\n if (v & 1) {\r\n\tretval += \"<IMG alt='Change occurred in the commentary' src='media/EDITEDcommentary.gif'/>\";\r\n }\r\n return retval;\r\n}", "function status () {\n if ((arguments.length === 1) && (typeof (arguments[0]) === 'object')) {\n let s = toStr(arguments[0]);\n _('#status').innerText = s.slice(1, s.length - 1);\n } else {\n _('#status').innerText = [...Array(arguments.length).keys()].map((j) => toStr(arguments[j])).join(', ');\n }\n}", "render() {\n const { currentStatus, openRuleDialog, dataList, height, filterRuleServiceList, openPolicyDialog, toggleRowIndex } = this.state\n // const contentStatement = \" Are you sure you want to change \" + currentStatus ? \"Disable\" : \"Enable\" + \" this policy ?\"\n const contentStatement = \" Are you sure you want to \".concat(currentStatus ? \"disable\" : \"enable\").concat(\" this policy ?\")\n const ruleContentStatement = \" Are you sure you want to \".concat(currentStatus ? \"disable\" : \"enable\").concat(\" this rule ?\")\n\n return (\n <div className=\"container\">\n <Grid container spacing={24}>\n <Grid item sm={3} className=\"pdT0\">\n <h5 className=\"mrT0\">Filter by Resources</h5>\n </Grid>\n <Grid item sm={9} className=\"pdT0\">\n <Grid container spacing={24} className=\"mr-container\">\n <Grid item sm={6} className=\"pdT0\">\n <h5 className=\"mr0\">Rules Available</h5>\n </Grid>\n <Grid item sm={6} className=\"pdT0 text-right\">\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n <Grid container spacing={24} className=\"container\">\n <Grid item sm={3} className=\"pdT0\">\n <div className=\"filter-search\">\n <ErrorBoundary error=\"error-boundary\">\n <SearchField handleChange={this.handleChange} />\n <div className=\"vrt-scroll\">\n {\n filterRuleServiceList.map((ruleService, index) => {\n return <div key={ruleService.service} className=\"mrT10\">\n <div\n className=\"btn-icon btn-checkbox btn-bg-white\"\n >\n <span className=\"icon-text\">\n <Checkbox\n onChange={this.handleCheckboxChange('checkedA')}\n value={ruleService.service}\n color=\"primary\"\n className=\"checkbox-select\"\n />\n </span>\n <span className=\"bar-icon\">\n <img alt={ruleService.service_name} src={fetchServiceIconPath(ruleService.service)} /> {ruleService.service_name} ({ruleService.count} )\n </span>\n </div>\n </div>\n })\n }\n </div>\n </ErrorBoundary>\n </div>\n </Grid>\n <Grid item sm={9} className=\"pdT0\">\n <Grid container spacing={24} className=\"mr-container grid-container\">\n <Grid item sm={12} className=\"pdT0\">\n <ErrorBoundary error=\"error-boundary\">\n <WithDrawer\n drawerContent={(rowProps) => {\n return (<div className=\"sub-table\">{this.ruleRenderer(rowProps.rowData)}</div>);\n }}\n rowsDimensions={dataList.map((dataItem) => ({ collapsedHeight: 80, expandedHeight: 320 }))}\n >\n {({ rowHeight, rowRenderer, toggleDrawer, toggleDrawerWithAnimation, setTableRef }) => (\n <div style={{ height: \"100%\", maxHeight: \"100%\" }}>\n <AutoSizer>\n {({ height, width }) => (\n <Table\n ref={setTableRef}\n headerHeight={0}\n height={height}\n width={width}\n rowCount={dataList.length}\n rowGetter={this._rowGetter}\n rowHeight={rowHeight}\n rowRenderer={rowRenderer}\n className=\"data-table table-policy table-expand table-rule table-border\"\n noRowsRenderer={this.noRowsRenderer}\n onScroll={this.scrollEvent}\n >\n\n <Column\n className=\"col-td toggle-row\"\n label=\"\"\n dataKey=\"resource\"\n width={40}\n headerRenderer={headerRenderer}\n cellRenderer={\n ({ cellData, rowIndex }) => {\n return (\n <div onClick={() => this.toggleActiveClass(rowIndex)} className={rowIndex === toggleRowIndex ? 'arrow-down' : ''}>\n <a href=\"javascript:void(0)\" onClick={() => toggleDrawerWithAnimation(rowIndex)}>\n <i className=\"fa fa-angle-right\"></i>\n </a>\n </div>\n );\n }\n }\n />\n <Column\n className=\"col-td text-center fnt-15\"\n dataKey=\"rule_id\"\n label=\"Policy Name\"\n headerRenderer={headerRenderer}\n disableSort={!this.isSortEnabled}\n width={250}\n flexGrow={1}\n\n />\n\n <Column\n className=\"col-td fnt-15 font-bold\"\n dataKey=\"name\"\n label=\"Account\"\n currentStatus headerRenderer={headerRenderer}\n cellRenderer={wrapTextCellRenderer}\n disableSort={true}\n width={700}\n flexGrow={2}\n />\n\n <Column\n className=\"col-td\"\n dataKey=\"service\"\n label=\"Service\"\n headerRenderer={headerRenderer}\n disableSort={!this.isSortEnabled}\n cellRenderer={serviceCellRenderer}\n width={300}\n flexGrow={3}\n />\n\n <Column\n className=\"col-td\"\n dataKey=\"active\"\n label=\"Status\"\n headerRenderer={headerRenderer}\n disableSort={true}\n cellRenderer={this.ruleSwitchCellRenderer}\n width={350}\n flexGrow={4}\n className=\"table-td\"\n />\n\n </Table>\n )}\n </AutoSizer>\n </div>\n )}\n </WithDrawer>\n </ErrorBoundary>\n <ConfirmDialogBoxHOC\n isOpen={openPolicyDialog}\n title={'Confirmation'}\n content={contentStatement}\n handleDialogClose={this.handlePolicyDialogClose}\n successDialogEvent={this.policyEnableDisable}\n />\n\n <ConfirmDialogBoxHOC\n isOpen={openRuleDialog}\n title={'Confirmation'}\n content={ruleContentStatement}\n handleDialogClose={this.handleRunDialogClose}\n successDialogEvent={this.ruleEnableDisable}\n />\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n </div>\n )\n }", "function showStatus(status) {\n stat_str.innerHTML = status;\n condition_str.innerHTML = \"\";\n temp_str.innerHTML = \"\";\n}", "function displayPValue() {\n // these are p-values from a bunch of two sample t-tests\n let overallResult = getPValue(stats_data[\"1\"][\"scores\"], stats_data[\"2\"][\"scores\"]);\n let hatchResult = getPValue(stats_data[\"1\"][\"hscores\"], stats_data[\"2\"][\"hscores\"]);\n let cargoResult = getPValue(stats_data[\"1\"][\"cscores\"], stats_data[\"2\"][\"cscores\"]);\n // displays them, and gives the cell a background corresponding to the severity of the p-value\n $(\".stats-overall-result\").text(overallResult).css({ background: color(overallResult) });\n $(\".stats-hatch-result\").text(hatchResult).css({ background: color(hatchResult) });\n $(\".stats-cargo-result\").text(cargoResult).css({ background: color(cargoResult) });\n}", "function getStatus() {\r\n\r\n var success = false;\r\n var newText = document.createElement('span');\r\n \r\n var oDivProps = document.getElementById('props');\r\n var aDivStatus = oDivProps.getElementsByClassName('mystatus');\r\n \r\n if( aDivStatus.length == 0 ) return;\r\n \r\n var oDivStatus = aDivStatus[0];\r\n \r\n var aA = oDivStatus.getElementsByTagName('a');\r\n \r\n if( aA.length > 0 )\r\n {\r\n var href = aA[0].href;\r\n \r\n if( href.match(\"hospital\") )\r\n {\r\n var tempo = aA[0].getElementsByTagName('span')[0].getAttribute('title');\r\n newText.innerHTML = \"No hospital até \" + getDate(tempo);\r\n }\r\n else if( href.match(\"jail\") )\r\n {\r\n var tempo = aA[0].getElementsByTagName('span')[0].getAttribute('title');\r\n newText.innerHTML = \"Na cadeia até \" + getDate(tempo);\r\n }\r\n else if( href.match(\"map\") )\r\n {\r\n var text = aA[0].innerHTML;\r\n newText.innerHTML = \"Status \" + text;\r\n }\r\n \r\n success = ( newText.innerHTML.length > 0 )\r\n }\r\n \r\n if( !success ) newText.innerHTML = \"Status não identificado\";\r\n \r\n return newText;\r\n\r\n}", "function formatterstatus(cellvalue, option, rowObject){\n\t\t\t\t\tif (cellvalue == 'A'){\n\t\t\t\t\t\treturn 'Active';\n\t\t\t\t\t}\n\n\t\t\t\t\tif (cellvalue == 'D'){\n\t\t\t\t\t\treturn 'Deactive';\n\t\t\t\t\t}\n\n\t\t\t\t}", "function generateQuizStatus() {\n //console.log('Generating quiz status bar');\n return `<div class=\"col-12\">\n <div class=\"score\">\n <span><strong>Question</strong>: ${STORE.currentQuestion}/${QUESTIONS.length}</span>\n <span><strong>Score</strong>: ${STORE.userScore}/${QUESTIONS.length}</span>\n </div>\n </div>`\n}", "getTooltipText(){\n\t\t\n\t\tconst isConsumable = this.isConsumable(),\n\t\t\tisBreakable = ~this.slots.indexOf(Asset.Slots.upperBody) || ~this.slots.indexOf(Asset.Slots.lowerBody)\n\t\t;\n\t\tlet html = '';\n\t\t// Usable items shows the action tooltip instead\n\t\tif( isConsumable && !this.iuad )\n\t\t\treturn this.use_action.getTooltipText(true, this.rarity);\n\n\t\tlet apCost = this.equipped ? Game.UNEQUIP_COST : Game.EQUIP_COST;\n\n\n\t\thtml += '<strong class=\"'+(Asset.RarityNames[this.rarity])+'\">'+esc(this.name)+'</strong><br />';\n\t\t// Low level indicator (only affects upper/lowerbody since they're the only ones that give protection\n\t\tif( \n\t\t\tthis.isLowLevel() && \n\t\t\t(this.slots.includes(Asset.Slots.upperBody) || this.slots.includes(Asset.Slots.lowerBody)) \n\t\t){\n\n\t\t\tif( this.durability )\n\t\t\t\thtml += '<em style=\"color:#FAA\">Low level, armor reduced</em><br />';\n\t\t\telse\n\t\t\t\thtml += '<em style=\"color:#FAA\">Broken!</em><br />';\n\n\t\t}\n\t\t\n\t\thtml += '<em class=\"sub\">';\n\t\tif( game.battle_active && this.parent )\n\t\t\thtml += '[<span style=\"color:'+(this.parent.ap >= apCost ? '#DFD' : '#FDD')+'\">'+\n\t\t\t\tapCost+' AP to '+(this.equipped ? 'take off' : 'equip')+\n\t\t\t'</span>]<br />';\n\n\t\tif( this.equippable() ){\n\n\t\t\tlet lv = this.getLevel() || 0;\n\t\t\tif( lv < 0 )\n\t\t\t\tlv = game.getAveragePlayerLevel()+Math.abs(lv)-1;\n\t\t\t\n\t\t\thtml += 'Lv '+lv+' | ';\n\t\t\t\n\t\t\tif( this.isDamageable() )\n\t\t\t\thtml += (+this.durability)+'/'+this.getMaxDurability()+' Durability | ';\n\n\t\t}\n\t\thtml += this.getWeightReadable()+' ';\n\t\tif( this.equippable() ){\n\t\t\thtml += '| ';\n\t\t\tif(this.slots.length && !this.equipped)\n\t\t\t\thtml+= '<strong>'+this.slots.map(el => el.toUpperCase()).join(' + ')+'</strong>';\n\t\t\telse if(this.slots.length)\n\t\t\t\thtml+= 'Equipped <strong>'+this.slots.map(el => el.toUpperCase()).join(' + ')+'</strong>';\n\t\t}\n\t\thtml += '</em><br />';\n\n\t\t\n\t\t// Special tags:\n\t\t/*\n\t\t\t%TOD - Approximate time of day\n\t\t*/\n\t\tlet aDesc = this.description\n\t\t\t.split('%TOD').join(game.getApproxTimeOfDay())\n\t\t;\n\t\t\n\t\thtml += esc(aDesc);\n\n\t\thtml += '<div class=\"assetWrappers\">';\n\t\tfor( let wrapper of this.wrappers ){\n\n\t\t\tif( wrapper.description ){\n\t\t\t\t\n\t\t\t\tlet color = '#FAA';\n\t\t\t\tif( wrapper.rarity > 0 )\n\t\t\t\t\tcolor = Asset.RarityColors[wrapper.rarity];\n\t\t\t\tlet desc = wrapper.description;\n\n\t\t\t\thtml += '<br /><span style=\"color:'+color+'\">'+esc(desc)+'</span>';\n\n\t\t\t}\n\t\t}\n\t\thtml += '</div>';\n\n\t\treturn html;\n\t}", "drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Status');\n data.addColumn('number', 'Estimates');\n data.addRows([\n ['Not contacted', this.props.statuses.notContacted],\n ['Making decision', this.props.statuses.makingDecision],\n ['Customer declined', this.props.statuses.custDeclined],\n ['Deal closed', this.props.statuses.dealsClosed]\n ]);\n\n // Set chart options\n var options = {'title':'Customers by status',\n 'width':400,\n 'height':300};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function writeFilterStatus() {\n\t\tvar num_visible = $('.restaurant').filter(':visible').length;\n\t\tvar num_hidden = $('.restaurant').not(':visible').length;\n\n\t\tvar status_el = $('.filter-status');\n\n\t\tstatus_el.html( 'showing ' + (num_hidden == 0 ? 'all ' : '') + num_visible + ' restaurant' + (num_visible > 1 ? 's' : '') );\n\n\t\tif( num_hidden > 0 ) {\n\t\t\tstatus_el.append( ', hiding ' + num_hidden );\n\t\t}\n\t}", "function displayFilterValues(filters) {\n var filterContainerElement = document.getElementById(\"filterTableBody\");\n var innerHtml = \"\" ;\n filters.forEach(filter => {\n if (filter.$type === \"categorical\") {\n var appliedValues = \"\";\n filter.$appliedValues.forEach(value => {\n appliedValues += `<span class=\"badge badge-primary\"> ${value.formattedValue} </span> \\n`;\n });\n innerHtml += `\n <tr>\n <th> ${filter.$caption} </th>\n <td> ${appliedValues} <td>\n </tr> \\n`; \n }\n });\n filterContainerElement.innerHTML = innerHtml;\n}", "function calculateAreaStatus() {\n polygons = gatherPolygons();\n for (var i = 0; i < titles.length; i++){\n if (statusAreaMapping[titles[i]].includes(\"red\")){\n colorPolygonByTitle(titles[i], RED);\n }\n else if (statusAreaMapping[titles[i]].includes(\"yellow\")){\n colorPolygonByTitle(titles[i], YELLOW);\n }\n else if (statusAreaMapping[titles[i]].includes(\"green\")){\n colorPolygonByTitle(titles[i], GREEN);\n }\n }\n}", "function showFilterSplitTitles() {\n svg.append('text')\n .attr('class', 'coursesoverview_split')\n .attr('x', 60)\n .attr('y', function (d) { return filterSplitTitles[\"filtered\"]; })\n .attr('text-anchor', 'middle')\n .text(\"Filtered\");\n\n svg.append('text')\n .attr('class', 'coursesoverview_split')\n .attr('x', 60)\n .attr('y', function (d) { return filterSplitTitles[\"notFiltered\"]; })\n .attr('text-anchor', 'middle')\n .text(\"Not filtered\");\n }", "parsedStatus(){\n const { context } = this.props;\n if (!context || !context.status) return <div/>;\n\n return (\n <div className=\"indicator-item item-status\" data-status={ context.status.toLowerCase() } data-tip=\"Current Status\">\n { context.status }\n </div>\n );\n }", "function getGameDescription()\n{\n\tlet titles = [];\n\tif (!g_GameAttributes.settings.VictoryConditions.length)\n\t\ttitles.push({\n\t\t\t\"label\": translateWithContext(\"victory condition\", \"Endless Game\"),\n\t\t\t\"value\": translate(\"No winner will be determined, even if everyone is defeated.\")\n\t\t});\n\n\tfor (let victoryCondition of g_VictoryConditions)\n\t{\n\t\tif (g_GameAttributes.settings.VictoryConditions.indexOf(victoryCondition.Name) == -1)\n\t\t\tcontinue;\n\n\t\tlet title = translateVictoryCondition(victoryCondition.Name);\n\t\tif (victoryCondition.Name == \"wonder\")\n\t\t\ttitle = sprintf(\n\t\t\t\ttranslatePluralWithContext(\n\t\t\t\t\t\"victory condition\",\n\t\t\t\t\t\"Wonder (%(min)s minute)\",\n\t\t\t\t\t\"Wonder (%(min)s minutes)\",\n\t\t\t\t\tg_GameAttributes.settings.WonderDuration\n\t\t\t\t),\n\t\t\t\t{ \"min\": g_GameAttributes.settings.WonderDuration }\n\t\t\t);\n\n\t\tlet isCaptureTheRelic = victoryCondition.Name == \"capture_the_relic\";\n\t\tif (isCaptureTheRelic)\n\t\t\ttitle = sprintf(\n\t\t\t\ttranslatePluralWithContext(\n\t\t\t\t\t\"victory condition\",\n\t\t\t\t\t\"Capture the Relic (%(min)s minute)\",\n\t\t\t\t\t\"Capture the Relic (%(min)s minutes)\",\n\t\t\t\t\tg_GameAttributes.settings.RelicDuration\n\t\t\t\t),\n\t\t\t\t{ \"min\": g_GameAttributes.settings.RelicDuration }\n\t\t\t);\n\n\t\ttitles.push({\n\t\t\t\"label\": title,\n\t\t\t\"value\": victoryCondition.Description\n\t\t});\n\n\t\tif (isCaptureTheRelic)\n\t\t\ttitles.push({\n\t\t\t\t\"label\": translate(\"Relic Count\"),\n\t\t\t\t\"value\": g_GameAttributes.settings.RelicCount\n\t\t\t});\n\n\t\tif (victoryCondition.Name == \"regicide\")\n\t\t\tif (g_GameAttributes.settings.RegicideGarrison)\n\t\t\t\ttitles.push({\n\t\t\t\t\t\"label\": translate(\"Hero Garrison\"),\n\t\t\t\t\t\"value\": translate(\"Heroes can be garrisoned.\")\n\t\t\t\t});\n\t\t\telse\n\t\t\t\ttitles.push({\n\t\t\t\t\t\"label\": translate(\"Exposed Heroes\"),\n\t\t\t\t\t\"value\": translate(\"Heroes cannot be garrisoned and they are vulnerable to raids.\")\n\t\t\t\t});\n\t}\n\n\tif (g_GameAttributes.settings.RatingEnabled &&\n\t g_GameAttributes.settings.PlayerData.length == 2)\n\t\ttitles.push({\n\t\t\t\"label\": translate(\"Rated game\"),\n\t\t\t\"value\": translate(\"When the winner of this match is determined, the lobby score will be adapted.\")\n\t\t});\n\n\tif (g_GameAttributes.settings.LockTeams)\n\t\ttitles.push({\n\t\t\t\"label\": translate(\"Locked Teams\"),\n\t\t\t\"value\": translate(\"Players can't change the initial teams.\")\n\t\t});\n\telse\n\t\ttitles.push({\n\t\t\t\"label\": translate(\"Diplomacy\"),\n\t\t\t\"value\": translate(\"Players can make alliances and declare war on allies.\")\n\t\t});\n\n\tif (g_GameAttributes.settings.LastManStanding)\n\t\ttitles.push({\n\t\t\t\"label\": translate(\"Last Man Standing\"),\n\t\t\t\"value\": translate(\"Only one player can win the game. If the remaining players are allies, the game continues until only one remains.\")\n\t\t});\n\telse\n\t\ttitles.push({\n\t\t\t\"label\": translate(\"Allied Victory\"),\n\t\t\t\"value\": translate(\"If one player wins, his or her allies win too. If one group of allies remains, they win.\")\n\t\t});\n\n\ttitles.push({\n\t\t\"label\": translate(\"Ceasefire\"),\n\t\t\"value\":\n\t\t\tg_GameAttributes.settings.Ceasefire == 0 ?\n\t\t\t\ttranslate(\"disabled\") :\n\t\t\t\tsprintf(translatePlural(\n\t\t\t\t\t\"For the first minute, other players will stay neutral.\",\n\t\t\t\t\t\"For the first %(min)s minutes, other players will stay neutral.\",\n\t\t\t\t\tg_GameAttributes.settings.Ceasefire),\n\t\t\t\t{ \"min\": g_GameAttributes.settings.Ceasefire })\n\t});\n\n\tif (g_GameAttributes.map == \"random\")\n\t\ttitles.push({\n\t\t\t\"label\": translateWithContext(\"Map Selection\", \"Random Map\"),\n\t\t\t\"value\": translate(\"Randomly select a map from the list.\")\n\t\t});\n\telse\n\t{\n\t\ttitles.push({\n\t\t\t\"label\": translate(\"Map Name\"),\n\t\t\t\"value\": translate(g_GameAttributes.settings.Name)\n\t\t});\n\t\ttitles.push({\n\t\t\t\"label\": translate(\"Map Description\"),\n\t\t\t\"value\": g_GameAttributes.settings.Description ?\n\t\t\t\t\ttranslate(g_GameAttributes.settings.Description) :\n\t\t\t\t\ttranslate(\"Sorry, no description available.\")\n\t\t});\n\t}\n\n\ttitles.push({\n\t\t\"label\": translate(\"Map Type\"),\n\t\t\"value\": g_MapTypes.Title[g_MapTypes.Name.indexOf(g_GameAttributes.mapType)]\n\t});\n\n\tif (typeof g_MapFilterList !== \"undefined\")\n\t\ttitles.push({\n\t\t\t\"label\": translate(\"Map Filter\"),\n\t\t\t\"value\": g_MapFilterList.name[g_MapFilterList.id.findIndex(id => id == g_GameAttributes.mapFilter)]\n\t\t});\n\n\tif (g_GameAttributes.mapType == \"random\")\n\t{\n\t\tlet mapSize = g_MapSizes.Name[g_MapSizes.Tiles.indexOf(g_GameAttributes.settings.Size)];\n\t\tif (mapSize)\n\t\t\ttitles.push({\n\t\t\t\t\"label\": translate(\"Map Size\"),\n\t\t\t\t\"value\": mapSize\n\t\t\t});\n\t}\n\n\tif (g_GameAttributes.settings.Biome)\n\t{\n\t\tlet biome = g_Settings.Biomes.find(b => b.Id == g_GameAttributes.settings.Biome);\n\t\ttitles.push({\n\t\t\t\"label\": biome ? biome.Title : translateWithContext(\"biome\", \"Random Biome\"),\n\t\t\t\"value\": biome ? biome.Description : translate(\"Randomly select a biome from the list.\")\n\t\t});\n\t}\n\n\tif (g_GameAttributes.settings.TriggerDifficulty !== undefined)\n\t{\n\t\tlet difficulty = g_Settings.TriggerDifficulties.find(difficulty => difficulty.Difficulty == g_GameAttributes.settings.TriggerDifficulty);\n\t\ttitles.push({\n\t\t\t\"label\": difficulty.Title,\n\t\t\t\"value\": difficulty.Tooltip\n\t\t});\n\t}\n\n\ttitles.push({\n\t\t\"label\": g_GameAttributes.settings.Nomad ? translate(\"Nomad Mode\") : translate(\"Civic Centers\"),\n\t\t\"value\":\n\t\t\tg_GameAttributes.settings.Nomad ?\n\t\t\t\ttranslate(\"Players start with only few units and have to find a suitable place to build their city.\") :\n\t\t\t\ttranslate(\"Players start with a Civic Center.\")\n\t});\n\n\ttitles.push({\n\t\t\"label\": translate(\"Starting Resources\"),\n\t\t\"value\": sprintf(translate(\"%(startingResourcesTitle)s (%(amount)s)\"), {\n\t\t\t\"startingResourcesTitle\":\n\t\t\t\tg_StartingResources.Title[\n\t\t\t\t\tg_StartingResources.Resources.indexOf(\n\t\t\t\t\t\tg_GameAttributes.settings.StartingResources)],\n\t\t\t\"amount\": g_GameAttributes.settings.StartingResources\n\t\t})\n\t});\n\n\ttitles.push({\n\t\t\"label\": translate(\"Population Limit\"),\n\t\t\"value\":\n\t\t\tg_PopulationCapacities.Title[\n\t\t\t\tg_PopulationCapacities.Population.indexOf(\n\t\t\t\t\tg_GameAttributes.settings.PopulationCap)]\n\t});\n\n\ttitles.push({\n\t\t\"label\": translate(\"Treasures\"),\n\t\t\"value\": g_GameAttributes.settings.DisableTreasures ?\n\t\t\ttranslateWithContext(\"treasures\", \"Disabled\") :\n\t\t\ttranslateWithContext(\"treasures\", \"As defined by the map.\")\n\t});\n\n\ttitles.push({\n\t\t\"label\": translate(\"Revealed Map\"),\n\t\t\"value\": g_GameAttributes.settings.RevealMap\n\t});\n\n\ttitles.push({\n\t\t\"label\": translate(\"Explored Map\"),\n\t\t\"value\": g_GameAttributes.settings.ExploreMap\n\t});\n\n\ttitles.push({\n\t\t\"label\": translate(\"Cheats\"),\n\t\t\"value\": g_GameAttributes.settings.CheatsEnabled\n\t});\n\n\treturn titles.map(title => sprintf(translate(\"%(label)s %(details)s\"), {\n\t\t\"label\": coloredText(title.label, g_DescriptionHighlight),\n\t\t\"details\":\n\t\t\ttitle.value === true ? translateWithContext(\"gamesetup option\", \"enabled\") :\n\t\t\t\ttitle.value || translateWithContext(\"gamesetup option\", \"disabled\")\n\t})).join(\"\\n\");\n}", "render(){\n try {\n const {dataList, value} = this.props\n //flatten conditions and mechanics arrays into one array\n let conditionsAndMechanics = [dataList[1], dataList[2]].flat(), result = [];\n\n // determine which datalist to use, then filter through that list and find the this.props.value unique identifier for the ability\n if(typeof(value) === 'string'){\n result = conditionsAndMechanics.filter(item =>{\n return item.key === value\n })\n }else if(typeof(value) === 'number'){\n result = dataList[0].filter(item => {\n return item.ability_id === value\n })\n }\n\n //if no unique identifier was found return an empty string \n //if a identifier was found run the hover ability function which will generate the ability\n if(result === undefined || result.length === 0){\n let inCaseFailedToFind = this.props.inCaseFailedToFind[0].split(/<.*?>/)\n return <span className=\"markupAbility\"><b className='name'>{inCaseFailedToFind[1]}</b></span>\n }else if(this.props.isNested){\n return (\n HoverAbility(result[0], dataList, true)\n )\n }\n else{\n return (\n HoverAbility(result[0], dataList, false)\n )\n }\n } catch (error) {\n console.error(error);\n return <div className=\"RunesErrorMessage\"><h3>Ability not Found</h3></div>\n }\n }", "renderEvidenceRow(eco_groups, row, eco_index) {\n let eco = eco_groups[0].evidence_type;\n let eco_id = eco_groups[0].evidence_id;\n let eco_label = eco_groups[0].evidence_label;\n\n if (this.props.filters.get(eco)) {\n return (\n <div className='ontology-ribbon__evidence-row' key={row + '.' + eco_index}>\n <div className='ontology-ribbon__eco'>\n <div>\n <a\n className='link'\n href={`http://www.evidenceontology.org/term/${eco_id}`}\n key={row + '.' + eco_index + '.' + eco_id}\n title={eco_label}\n target='_blank'\n >\n {eco}\n </a>\n </div>\n {\n this.renderQualifiers(eco_groups, row, eco_index)\n }\n </div>\n <div className='ontology-ribbon__eco-group-column' key={row + '.' + eco_index + '.groups'}>{this.renderECOgroups(eco_groups, row, eco_index)}</div>\n </div>\n );\n } else {\n return null;\n }\n }", "statusColor(status) {\n switch(status) {\n case 2:\n return \"titleGreen\";\n case 1:\n return \"titleOrange\"; \n case 3:\n return \"titleRed\";\n default:\n return \"titleOrange\";\n }\n }", "function checkStatus(data, i) {\n\tvar img;\n\tif (data == 0) {\n\t\timg = \"<a href=#><img src=img/0.png id=mydata\" + i\n\t\t\t\t+ \" onclick=updateStatus(\" + i + \",\" + data + \")></a>\";\n\t} else {\n\t\timg = \"<a href=#><img src=img/1.png id=mydata\" + i\n\t\t\t\t+ \" onclick=updateStatus(\" + i + \",\" + data + \")></a>\";\n\t}\n\treturn img;\n}", "function updateStatus() {\nconst defaultStatus = \"Click on Palette to Start\";\n\t//\tse non è attiva nessuna modalità, mostro il testo predefinito\n\tif (mode == \"\")\n\t\td3.select('#statusline').text(defaultStatus);\n\t//\taltrimenti stampo la modalità e il tipo di shape correnti\n\telse if (mode == \"draw\")\n\t\td3.select('#statusline').text(\"draw \" + shapeType);\n\telse\n\t\td3.select('#statusline').text(mode + \" \" + active.shape);\n}", "get availability () {\n let opening = ''\n if (this.openingHours) {\n opening = `${this.prettyCurrentState}<br/><br/>\n <strong>Opening Hours:</strong> ${this.prettyOpeningHours}<br/>`\n }\n opening += this.label('kitchen_hours')\n\n return opening +\n // this.label('Opening Times','opening_hours',(currentStatus)?`<div class=\"pop-caption\">${currentStatus}</div>`:'</br>') +\n this.label('access', '&nbsp;') +\n this.label('centralkey', '&nbsp;') +\n this.label('fee:charge') +\n ((this.tags.amenity !== 'toilets') ? this.label('toilets:wheelchair') : '')\n }", "_tooltip(d, i) {\n // console.log(\"flag\");\n if (d.indexData !== -1) {\n return this.model.data.children.data[this._vOrder[d.indexData]].labels[1] + \"\\n\" + // Full name\n this.model.data.edges.valueTitle[i] + \": \" +\n this.model.data.children.data[this._vOrder[d.indexData]].edge.values[i];\n }\n else\n return \"\"; // Empty Tooltip\n }", "function displayStatus(data)\n{\n if(data.pos)\n document.getElementById(\"commentsBox1\").innerHTML = data.res;\n else\n document.getElementById(\"commentsBox2\").innerHTML = data.res;\n}", "render() {\n var conditionData = this.props.conditions.map(condition => {\n if (condition.resource.patient.reference === `Patient/${this.props.patientId}`) {\n return (\n <Condition\n key={condition.resource.id}\n id={condition.resource.id}\n patientID={condition.resource.patient.reference}\n onset={condition.resource.onsetDateTime}\n conditionName={condition.resource.code.text}\n />\n );\n }\n });\n return (\n <div>\n <h4>Name: {this.props.name}</h4>\n <p>Gender: {this.props.gender}</p>\n <p>DOB: {this.props.birthDate}</p>\n {conditionData}\n </div>\n )\n }", "function initCriteriaList() {\n jQuery(\"#progContainer\").hide();\n var critListElement = jQuery(\"#sideBarCriterias\");\n onEventMap = (mapTitle.indexOf(\"Veranstaltungen Ehrenamt\") != -1) ? true : false;\n onProjectMap = (mapTitle.indexOf(\"Ehrenamt Berlin\") != -1) ? true : false;\n var tabsHtml = \"\";\n if (onBerlinDe && onEventMap) {\n tabsHtml = '<div id=\"navigation-helper\" '\n + 'style=\"border-bottom: 1px dashed #e8e8e8; padding-left: 7px; padding-bottom: 8px; padding-top:3px; padding-right: 4px;\">'\n + '<a href=\"'+ baseUrl +'ehrenamt\" title=\"Zum Einsatzstadtplan wechseln\">Einsatzorte</a>&nbsp;|&nbsp;'\n + 'Veranstaltungen Heute</div>';\n } else if (onBerlinDe && onProjectMap) {\n tabsHtml = '<div id=\"navigation-helper\" '\n + 'style=\"border-bottom: 1px dashed #e8e8e8; padding-left: 7px; padding-bottom: 8px; padding-top:3px; padding-right: 4px;\">'\n + 'Einsatzorte&nbsp;|&nbsp;'\n + '<a href=\"'+ baseUrl +'veranstaltungen-ehrenamt\" title=\"Zum Veranstaltungsstadtplan wechseln\">Veranstaltungen Heute</a></div>';\n }\n var critLinkList = '';\n if (onBerlinDe && (onEventMap || onProjectMap)) {\n critLinkList += tabsHtml; // render special tab selection for inner ehrenamtsnetz navigation\n }\n critLinkList += '<table width=\"95%\" cellpadding=\"0\" border=\"0\"><tbody>';\n critLinkList += '<tr valign=\"top\">'; // TODO: onclick\n critLinkList += '<td rowspan=\"'+workspaceCriterias.result.length+1+'\" align=\"left\">';\n // rebuild upper part of the sideBar stub\n critLinkList += '<a id=\"sideBarLogoLink\" href=\"http://www.kiezatlas.de\">'\n + ' <img id=\"sideBarLogo\" src=\"'+IMAGES_URL +'kiezatlas-logo.png\" alt=\"Das Kiezatlas Logo\" '\n + ' border=\"0\" text=\"Das Kiezatlas Logo\"/></a></td>';\n critLinkList += '<td></td><td></td>';\n critLinkList += '</tr>';\n for (var i = 0; i < workspaceCriterias.result.length; i++) {\n var critName = [workspaceCriterias.result[i].critName];\n if ( i == 0 && workspaceCriterias.result.length == 2) {\n critLinkList += '<tr valign=\"center\">';\n } else {\n critLinkList += '<tr valign=\"top\">';\n }\n if (onBerlinDe && crtCritIndex == i) {\n critLinkList += '<td onclick=\"javascript:updateCategoryList(' + i + ');\" class=\"critLinkNormal selectedCriteria\">'\n + '<img src=\"http://www.berlin.de/_bde/css/list_bullet.png\"/>&nbsp;' + critName + '</td>';\n } else {\n critLinkList += '<td onclick=\"javascript:updateCategoryList(' + i + ');\" class=\"critLinkNormal\">'\n + critName + '</td>';\n }\n if (!onBerlinDe && crtCritIndex == i) {\n critLinkList += '<td align=\"left\">&#8226;</td></tr>';\n } else {\n critLinkList += '<td></td></tr>';\n }\n }\n critLinkList += '</tbody>';\n critLinkList += '</table>';\n // do append the concatenated html\n critListElement.html(critLinkList);\n if (!onBerlinDe) {\n var breadCrumpHtml = '<div id=\"navigation-helper\">'\n + '<a href=\"http://www.kiezatlas.de/tipps_und_tricks.pdf\" style=\"float: left;\" title=\"Tipps und Tricks zur Nutzung vom KiezAtlas (PDF)\">Tipps & Tricks</a>&nbsp;&nbsp;&nbsp;'\n + '&nbsp;&nbsp;&nbsp;<a href=\"http://www.kiezatlas.de/browse/'+mapAlias+'\" title=\"Zur klassichen Stadtplanoberfl&auml;che wechseln\">Zur klassischen Ansicht</a></div>';\n critListElement.append(breadCrumpHtml);\n }\n // set the correct images\n // if (workspaceInfos != null) setCustomWorkspaceInfos(); else setDefaultWorkspaceInfos();\n setWorkspaceInfos(workspaceHomepage, workspaceLogo, workspaceImprint, mapTitle);\n if (onEventMap) {\n // ### FIXME: make use of kiezatlas.mapTopics and thereofre initalize them earlier...\n var countHtml = '&nbsp;&nbsp;&nbsp;Insgesamt <b>' + mapTopics.result.topics.length + '</b> Veranstaltungen Heute<p></p>';\n jQuery(\"#sideBarCriterias\").append(countHtml);\n }\n }", "function toolTipHTML(data) {\r\n\r\n \t\tvar tip = '<h6 class=\"card-title\">'+data.data.prop+'</h6>'\r\n \t\ttip += '<p class=\"card-text\">'+data.data.expression+'</p>';\r\n\r\n return tip;\r\n }", "function ShowToolTip (d) {\n tooltip\n .style(\"opacity\", 1)\n .style(\"left\", d3.event.x -\n (tooltip.node().offsetWidth / 2) - 10 + \"px\")\n .style(\"top\", d3.event.y - (tooltip.node().offsetHeight / 2) - 145 + \"px\")\n .html(function() { \n if (currGlobal === \"Global Areas\"){ \n return `\n <p class=\"text-center\">${getContinentMap(d.areaname)} ${d.areaname}</p>\n <p class=\"text-center\">Immigration: ${d.value.toLocaleString()}</p>\n `;\n } else { \n return ` \n <p class=\"text-center\"><img src=${d.flag} alt=\"flag\"> ${d.country}</p>\n <p class=\"text-center\">Immigration: ${d.value.toLocaleString()}</p>\n `;\n }\n });\n}", "function setPopupColor(condition) {\n\tif (condition == 'No Condition Reported') { return '#41abdd' }\n if (condition == '') { return '#41abdd' }\n\tif (condition == 'Good') { return '#75b230' }\n\tif (condition == 'Advisory') { return '#d54733' }\n\tif (condition == 'Closed') { return '#3a3a3a' }\n}", "render() {\n return (\n <div className=\"status-component\">\n <h3>Status of selected services from Datadoghq:</h3>\n {\n this.props.serviceStatus.components.map(function(item) { return (\n <div className=\"status-panel\" key={item.name} data-status={item.status}>\n <div className=\"status-panel__name\">{item.name}</div>\n <div className=\"status-panel__status\">{'Current status: ' + item.status}</div>\n </div>\n )\n })\n }\n </div>\n );\n }", "function getTooltipText(d) {\r\n var mainText = '<p><strong>Name: </strong>' + d.label + ' (' + d.abbrev\r\n + ')</p><p><strong>Description: </strong>' + d.description + '</p>';\r\n var classification = '<p><strong>Classification: </strong>'\r\n + d.classification + '</p';\r\n return d.type == \"out\" ? mainText : mainText + classification;\r\n }", "getStatusClass(status) {\n const statusMap = {\n \"Not Bidding\": \"danger\",\n \"Complete\": \"success\",\n \"Bidding\": \"warning\",\n };\n\n return `text-${statusMap[status]}`;\n }", "function MyCustomRedFlagsComponent({ value, griddleKey, rowData }) {\n //console.log(rowData.redFlagsDesc)\n var redFlags = rowData.redFlagsDesc.join(', ');\n return (\n <div className=\"MyCustomComponent\">\n <span style={{ color: '#AA0000' }}>{redFlags}</span>\n </div>\n );\n}", "_tooltipComplete(d) {\n if (d.indexData !== -1) {\n let result = this.model.data.children.data[this._vOrder[d.indexData]].labels[1] + \"\\n\";\n let j;\n for (j = 0; j < this._nbOfTypesDoc; j++) {\n result += this.model.data.edges.valueTitle[j] + \": \" +\n this.model.data.children.data[this._vOrder[d.indexData]].edge.values[j] + \"\\n\";\n }\n return result;\n }\n else\n return \"\"; // Empty Tooltip\n }", "function coloredText(status) {\n if(status === \"booked\") {\n return <span className=\"text-primary font-weight-bold\">{status}</span>\n }\n if(status === \"seated\") {\n return <span className=\"text-secondary font-weight-bold\">{status}</span>\n }\n if(status === \"cancelled\") {\n return <span className=\"text-danger font-weight-bold\">{status}</span>\n }\n if(status === \"finished\") {\n return <span className=\"text-success font-weight-bold\">{status}</span>\n }\n }", "function renderBillStatus(billData) {\n // $(\".status-button\").each(function () {\n if (billData.house_passage === null && billData.senate_passage === null) {\n $(\"#introduced\").addClass(\"active-status\");\n $(\"#introduced\").removeClass(\"inactive-status\");\n return;\n }\n if (billData.house_passage !== null && billData.senate_passage === null) {\n $(\"#pass-house\").addClass(\"active-status\");\n $(\"#pass-house\").removeClass(\"inactive-status\");\n return;\n }\n if (billData.senate_passage !== null) {\n $(\"#pass-senate\").addClass(\"active-status\");\n $(\"#pass-senate\").removeClass(\"inactive-status\");\n return;\n }\n if (billData.active !== false) {\n $(\"#became-law\").addClass(\"active-status\");\n $(\"#became-law\").removeClass(\"inactive-status\");\n return;\n }\n}", "getRowOperator() {\n this.position = this.props.visStore.secondaryHeight;\n const _self = this;\n if (this.props.timepoint) {\n return this.props.timepoint.heatmap.map(function (d, i) {\n let lineHeight;\n let fontWeight;\n if (d.variable === _self.props.dataStore.globalPrimary) {\n lineHeight = _self.props.visStore.secondaryHeight;// _self.props.visStore.primaryHeight;\n fontWeight = \"bold\";\n }\n else {\n lineHeight = _self.props.visStore.secondaryHeight;\n fontWeight = \"normal\";\n }\n const transform = \"translate(0,\" + _self.position + \")\";\n const iconScale = (_self.props.visStore.secondaryHeight - _self.props.visStore.gap) / 20;\n let fontSize = 10;\n if (lineHeight < fontSize) {\n fontSize = Math.round(lineHeight);\n }\n return <g key={d.variable} className={\"clickable\"} transform={transform}>\n {_self.getRowLabel(_self.props.timepoint, d.variable, (lineHeight + fontSize / 2) / 2, iconScale, _self.props.width, fontWeight, fontSize)}\n </g>\n\n });\n }\n else return null;\n\n }", "renderRule(){\n if(this.state.showRuleWindow.status===true){\n let currentIfElseBlock = this.getCurrentBLock();\n let current = \"\";\n current = currentIfElseBlock.conditionIf;\n let conditionType = currentIfElseBlock.conditionType;\n console.log(\"CONDITION TYPE ..............\", conditionType);\n if(this.state.conditionType === 'simple')\n {\n return current.map((cond,index) => {\n return(\n <div id = \"ruleSimpleHead\" className={this.state.toggleCondClass}>\n <div className=\"col-xs-12 rule hidden\"></div>\n <div className=\"col-xs-12 rule\">\n\n <span className=\"condDelete\" onClick={(event)=>this.removeCondition(event,index)}>X</span>\n <div className=\"ruleOuter\">\n <div className=\"form-group sel\" data-condition=\"condBool\">\n <label>Function</label>\n <select className=\"form-control select\" id={`fn_sel_${index}`} data-index={index} data-type=\"fun\" name=\"fun\" onChange={(event)=>this.updateCondition(event)}>\n <option disabled=\"\" selected=\"\">Select Function</option>\n {this.renderFun(cond)}\n </select>\n </div>\n <div className=\"form-group sel\" data-condition=\"condColumn1\">\n <label>Parameter 1</label>\n <select className=\"form-control select\" id={`para_sel_${index}`} data-index={index} data-type=\"parameter1\" name=\"parameter1\" onChange={(event)=>this.updateCondition(event)}>\n <option disabled selected>Select Column</option>\n {/* {(() => {})} */}\n {this.renderDataList(cond)}\n </select>\n </div>\n <div className=\"form-group sel\" data-condition=\"condOperand\">\n <label>Operand</label>\n <select className=\"form-control select operator\" id={`operandt_sel_${index}`} data-index={index} data-type=\"operator\" name=\"operator\" onChange={(event)=>this.updateCondition(event)}>\n <option disabled=\"\" selected=\"\">Select Operator</option>\n {this.renderOperator(cond)}\n </select>\n </div>\n <div className=\"form-group sel\" data-condition=\"condColumn2\">\n <label>Parameter 2</label>\n <input type=\"text\" key={`${cond.parameter2}_swel_${index}`} data-index={index} placeholder={cond.parameter2} data-type=\"parameter2\" name=\"parameter2\" defaultValue = {cond.parameter2} onBlur={(event)=>this.updateCondition(event)} />\n {/*\n <input list=\"browsers\" data-index={index} data-value={cond.parameter2} data-type=\"parameter2\" name=\"parameter2\" onBlur={(event)=>this.updateCondition(event)} />\n <datalist className=\"select\" id=\"browsers\">\n {this.renderSuggestions(cond)}\n </datalist>\n */}\n </div>\n <div className=\"form-group sel\" data-condition=\"condBool\">\n <label>Condition</label>\n {(()=>{\n if((cond.parameter1==='')|| (cond.parameter2==='')||(cond.operator==='')){\n return (\n <select disabled className=\"form-control select\" id={`logical_sel_${index}`} data-index={index} data-type=\"cond\" name=\"cond\" onChange={(event)=>this.updateCondition(event)}>\n <option >Select</option>\n {this.renderLogicalOperators(cond)}\n </select>\n )\n }\n else{\n return (\n <select className=\"form-control select\" id={`logical_sel_${index}`} data-index={index} data-type=\"cond\" name=\"cond\" onChange={(event)=>this.updateCondition(event)}>\n <option >Select</option>\n {this.renderLogicalOperators(cond)}\n </select>\n )\n }\n })()\n }\n\n\n </div>\n </div>\n </div>\n {/* rule rendering ends */}\n <div className=\"col-xs-12 block\" id={`input_sel_${index}`} >\n <div className=\"ruleLabel dropdown-toggle hidden\" id=\"addNewCondition\" onClick = {(event)=> this.addNewCondition(event)}>\n <i className=\"fa fa-long-arrow-right\" aria-hidden=\"true\"></i> Add New Condition\n </div>\n <ul className=\"dropdown-menu\">\n <li><a className=\"disabled\">Select Condition Type</a></li>\n {this.renderMathFunctions()}\n </ul>\n </div>\n </div>\n );\n })\n }\n else{\n return(\n <div className=\"col-xs-12 ruleTextArea\" id = \"ruleTextAreaHead\">\n <div className=\"col-xs-12 ruleHeader\">\n <ul className=\"item\">\n <li className=\"list\">\n <div className=\"link dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n Column <span className=\"glyphicon glyphicon-menu-down\" aria-hidden=\"true\"></span>\n </div>\n <ul className=\"dropdown-menu\">\n <li><a className=\"disabled\">Select</a></li>\n {this.renderComplexDataList()}\n </ul>\n </li>\n\n <li className=\"list\">\n <div className=\"link dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n ColumnFunction <span className=\"glyphicon glyphicon-menu-down\" aria-hidden=\"true\"></span>\n </div>\n <ul className=\"dropdown-menu\">\n <li><a className=\"disabled\">Select</a></li>\n {this.renderComplexDataFunctions()}\n </ul>\n </li>\n\n <li className=\"list\">\n <div className=\"link dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n Operand <span className=\"glyphicon glyphicon-menu-down\" aria-hidden=\"true\"></span>\n </div>\n <ul className=\"dropdown-menu\">\n <li><a className=\"disabled\">Select</a></li>\n {this.renderComplexOperator()}\n </ul>\n </li>\n\n <li className=\"list\">\n <div className=\"link dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n Condition <span className=\"glyphicon glyphicon-menu-down\" aria-hidden=\"true\"></span>\n </div>\n <ul className=\"dropdown-menu\">\n <li><a className=\"disabled\">Select</a></li>\n {this.renderComplexLogicalOperators()}\n </ul>\n </li>\n </ul>\n </div>\n <div className=\"form-group\" id=\"complexTextArea\">\n <textarea className=\"form-control rounded-0\" id=\"formControlTextarea\" data-type=\"textArea\" defaultValue={currentIfElseBlock.conditionText } rows=\"10\" onBlur={(event)=>this.updateCondition(event)}></textarea>\n </div>\n <div className=\"col-xs-12 notice\">\n <div>\n <span className=\"glyphicon glyphicon-pushpin icon\" aria-hidden=\"true\"></span>\n <span><i>Be Careful! your are using <span className=\"underLine\">Free-Form Text</span>, make sure your rule is valid.</i></span></div>\n\n </div>\n </div>\n )\n }\n\n }\n }", "function Advise_Person(data){\n sections[\"screenThinking\"].style.visibility = \"collapse\";\n\n //document.getElementById('showFlag').innerText = data.redFlag; //tracking bug section\n\n if(data.redFlag > 1 ){\n sections[\"screenRed\"].style.visibility = \"visible\";\n } else {\n sections[\"screenGreen\"].style.visibility = \"visible\";\n }\n}", "function showResults(evt) {\n\t\t\tmap.graphics.clear();\n\t\t var point = evt.result.feature.geometry;\n\t\t\tvar symbol = new SimpleMarkerSymbol();\n\t\t\tsymbol.setStyle(SimpleMarkerSymbol.STYLE_DIAMOND);\n\t\t\tsymbol.setColor(new Color([0,255,255]));\n\t\t\tvar graphic = new Graphic(point, symbol);\n\t\t\tmap.graphics.add(graphic);\n\t\t\tvar result = \"<p>Click/Zoom anywhere near your search result (<img src='/assets/img/blue_diamond.gif'>) to view solar radiation per square meter.</p><p>Struggling to find what you are looking for? Try using the basemap toggle button at left to bring up satellite imagery for further help finding the spot you wish to analyze.</p>\";\n\n document.getElementById('r').innerHTML = result;\n\t\t}", "function tooltipFlags() {\n\t// ' ' + Highcharts.dateFormat('%m/%d/%y %H:%M:%S', new Date(this.x)) +\n\treturn stationsMeta[sensor]['name']+'<br>'+\n '<b>'+jsMoment(this.x, 'pac', 'normal')+' Pacific Time</b><br>'+\n//ISO '%Y-%m-%dT%H:%M:%SZ'\n Highcharts.dateFormat('%m/%d/%Y %H:%M:%S', new Date(this.x))+' (UTC)'+\n '<br><b>' + this.series.name +': '+this.y+' '+this.unit+//{this.y:,.2f}+': </b>'+\n\t'<br/>primary flag: '+this.flag1+\n\t'<br/>secondary flag: '+this.flag2;\n}", "colorStatusHeader(status) {\n\n if (status === \"ouvert\")\n return <h3 style={{ color: '#00B711' }}>Statut : {this.props.competition.date_end_inscription}</h3>;\n else\n return <h3 style={{ color: 'red' }}>Statut : {this.props.competition.date_end_inscription}</h3>;\n }", "reqPerStatus() {\n let req = new Map()\n for (let d = 0; d < this.state.data.length; d++) {\n if (req.has(this.state.data[d].ds_compl_status_returned)) {\n let valor = req.get(this.state.data[d].ds_compl_status_returned) + 1\n req.set(this.state.data[d].ds_compl_status_returned, valor)\n } else {\n req.set(this.state.data[d].ds_compl_status_returned, 1)\n }\n }\n \n this.setState({\n show_rs: true,\n data_req: {\n labels: Array.from(req.keys()),\n datasets: [\n {\n label: 'Requests per Compliance Status',\n fill: false,\n lineTension: 0.1,\n backgroundColor: 'rgba(75,192,192,0.4)',\n borderColor: 'rgba(75,192,192,1)',\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0.0,\n borderJoinStyle: 'miter',\n pointBorderColor: 'rgba(75,192,192,1)',\n pointBackgroundColor: '#fff',\n pointBorderWidth: 1,\n pointHoverRadius: 5,\n pointHoverBackgroundColor: 'rgba(75,192,192,1)',\n pointHoverBorderColor: 'rgba(220,220,220,1)',\n pointHoverBorderWidth: 2,\n pointRadius: 1,\n pointHitRadius: 10,\n data: [...Array.from(req.values()).slice(0)]\n }\n ]\n }\n })\n\n }", "function UDTDefinitionCellStatus(props) {\n console.log(props, \"<< props\")\n let { cell } = props\n let status_message = (<span className=\"Error\">Not Found</span>)\n if (cell && cell.cell_output) {\n status_message = (<span className=\"Success\">Deployed</span>)\n }\n return (\n <div className=\"nervos-green-border\">\n <p>UDT Code Cell Status: {status_message}</p>\n </div>\n )\n}", "function renderColumnFilter(col, status, colname) {\n str = \"<div>\";\n if (status) {\n str += \"<input id='\" + colname + \"_\" + col + \"' type='checkbox' checked onchange='myTable.toggleColumn(\\\"\" + col + \"\\\")'>\"\n str += \"<label for='\" + colname + \"_\" + col + \"'>\" + colname + \"</label>\";\n } else {\n str += \"<input id='\" + colname + \"_\" + col + \"' type='checkbox' onchange='myTable.toggleColumn(\\\"\" + col + \"\\\")'>\"\n str += \"<label for='\" + colname + \"_\" + col + \"'>\" + colname + \"</label>\";\n }\n str += \"</div>\";\n\n return str;\n}", "function negativeSupportStatus(data) {\n if (data > 0) {\n $('.negativeSupportStatus').append('Ja');\n } else {\n $('.negativeSupportStatus').append('Nei');\n }\n}", "tooltip_render(tooltip_data) {\n let text = \"<h4 class =\" +'tooltip-' + tooltip_data['aff_name'] + \" >\" + tooltip_data['aff_name'] + \"</h4>\";\n text += \"<h5 class =\" +'tooltip-' + tooltip_data['aff_name'] + \" >\" +'Co-publication:' + tooltip_data['copub'] + \"</h5>\";\n return text;\n }", "function getValidationStatus() {\n const selectStatus = document.getElementById('select-status');\n let txtmJiraCommentValidation = \"\";\n\n switch (selectStatus.value) {\n case \"valide\":\n txtmJiraCommentValidation = mJiraCommentValidation + \"{color:green}VALIDÉ\" + jiraColor + \" \" + jiraChecked;\n break;\n case \"refuse\":\n txtmJiraCommentValidation = mJiraCommentValidation + \"{color:red}REFUSÉ\" + jiraColor + \" \" + jiraUnchecked;\n break;\n default:\n break;\n }\n return txtmJiraCommentValidation + \"\\n\";\n}", "function renderStatus() {\n if (Map.collided === true) {\n ctx.font = '25pt Calibri';\n ctx.textAlign = 'center';\n ctx.fillStyle = 'black';\n ctx.fillText(\n 'YOU GOT STINKED!! Score: ' + Map.score,\n parseInt(Map.BLOCKWIDTH * Map.columns / 2),\n parseInt(Map.BLOCKHEIGHT * Map.rows * 2 / 3)\n );\n }\n else {\n ctx.font = '15pt Calibri';\n ctx.textAlign = 'right';\n ctx.fillStyle = 'white';\n ctx.fillText(\n 'Score: ' + Map.score,\n parseInt(Map.BLOCKWIDTH * Map.columns - (Map.BLOCKWIDTH * 1/8)),\n parseInt((Map.BLOCKHEIGHT / 2) + 40)\n );\n }\n }", "renderLogicalOperators(cond){\n let fun = [\n {\"funVal\":\"and\"},\n {\"funVal\":\"or\"},\n {\"funVal\":\"not\"}\n ];\n return fun.map((funVal,index) => {\n if(cond.cond===funVal.funVal) {\n return(\n <option selected key={`${funVal.funVal}_sel_${index}`} value={funVal.funVal}>{funVal.funVal}</option>\n\n );\n }\n\n else {\n return(\n <option key={`${funVal.funVal}_sel_${index}`} value={funVal.funVal}>{funVal.funVal}</option>\n );\n }\n\n });\n }", "function setResultTooltips()\n {\n var textLength = my.current.subunitText.length\n var charNoun = textLength == 1 ? 'character' : 'characters'\n\n // Speed tooltip\n my.html.speed.title =\n 'You have typed ' + textLength + ' ' + charNoun +\n ' in\\n' +\n Util.prettyTime(my.current.timeElapsed) + '.\\n\\n' +\n 'Your typing speed is\\n' +\n my.current.wpm + ' words per minute, or\\n' +\n my.current.cpm + ' characters per minute.'\n\n\n // Error rate tooltip\n var errorRateTooltip\n var accuracyTooltip\n\n // Update error rate\n if (my.current.errorRate == Number.POSITIVE_INFINITY) {\n errorRateTooltip = '\\u221e'\n accuracyTooltip = 0\n } else {\n errorRateTooltip = parseFloat(my.current.errorRate.toFixed(1))\n accuracyTooltip = 100 - errorRateTooltip\n }\n\n var errorNoun = my.current.errors == 1 ? 'error' : 'errors'\n\n var title =\n 'You have typed ' + textLength + ' ' + charNoun +\n '.\\n' +\n 'You have made ' + my.current.errors + ' ' +\n errorNoun + '.\\n' +\n 'Your error rate is ' + errorRateTooltip + '%.\\n' +\n 'Your accuracy is ' + accuracyTooltip + '%.\\n'\n\n my.html.error.title = title\n }", "function stat2label(status) {\n\n var label;\n\n switch (status) {\n case OPEN:\n label = 'label-open';\n break;\n case ASSIGN:\n label = 'label-assign';\n break;\n case ACK:\n label = 'label-ack';\n break;\n case CLOSED:\n label = 'label-closed';\n break;\n case EXPIRED:\n label = 'label-expired';\n break;\n case UNKNOWN:\n label = 'label-unknown';\n break;\n default:\n label = '';\n }\n status = status.charAt(0).toUpperCase() + status.slice(1).toLowerCase();\n\n return('<span class=\"label ' + label + '\">' + status + '</span>');\n}", "function updateLegend(label1, status) {\n document.querySelector(\".legend\").innerHTML = [\n \"<p>\" + label1.replace(/_/g, \" \").toUpperCase() + \"</p>\",\n \"<p class='open-now'>OPEN NOW: \" + status.OPEN_NOW + \"</p>\",\n \"<p class='closed'>CLOSED: \" + status.CLOSED + \"</p>\",\n \"<p class='not-sure'>NOT SURE: \" + status.NOT_SURE + \"</p>\",\n ].join(\"\");\n }", "function showStatus() {\n\n if ((reporteSeleccionado == 13) || (reporteSeleccionado == 14)) {\n\n if (banderas.banderaTodoSeleccionado == 0) {\n if (Calles.length == 0) {\n ngNotify.set('Seleccione al menos una calle', { type: 'error' });\n }\n else {\n modalStatus();\n }\n }\n else if (banderas.banderaTodoSeleccionado == 1) {\n modalStatus();\n }\n }\n }", "mapStatusToColor(status){\n if (status === 'A')\n return \"green\";\n if (status === 'R')\n return \"red\";\n if (status === 'W' || status === 'P')\n return \"blue\";\n if (status === 'N')\n return \"yellow\";\n }", "function renderStatus() {\n foundEle = document.getElementById(\"found\");\n availableEle = document.getElementById(\"available\");\n availableEle.textContent = available;\n foundEle.textContent = foundSets.length;\n}", "renderSuggestions(cond){\n let status = 0;\n return this.props.dataColumns.map((dataCols,index) => {\n\n if(cond.parameter2===dataCols.column) {\n status = 1;\n return(\n\n <option selected key={`${dataCols.column}_sugg_${index}`} value={dataCols.column}>{dataCols.column}</option>\n );\n }\n\n else {\n return(\n <option key={`${dataCols.column}_sugg_${index}`} value={dataCols.column}>{dataCols.column}</option>\n );\n }\n\n\n\n });\n\n }", "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}", "function renderACPopup(json_data, status){\n\n\t// Remove the current popup from the screen.\n\thide_me();\n\n\t// Verify the incoming data. Only go if we got something.\n\tif( core.response.success(json_data) &&\n\t core.response.type(json_data) == 'completion' ){\n\n\t var os = new org.bbop.amigo.opensearch(json_data);\n\n\t ll(\"fixed query: \" + os.fixed_query());\n\t ll(\"raw query: \" + os.raw_query());\n\t ll(\"response got: \" + os.count());\n\n\t var output_stack = new Array;\n\t output_stack.push('<div class=\"');\n\t //output_stack.push(BBOP_AC_UL_CLASS);\n\t output_stack.push('\">');\n\t for( var f = 0; f < os.count(); f++ ){\n\n\t\tvar desc = os.completion(f, 'description');\n\t\tvar comp = os.completion(f, 'completion');\n\t\tvar id = os.completion(f, 'id');\n\n\t\tclosed_response_set[id] =\n\t\t {\n\t\t\tdescription: desc,\n\t\t\tcompletion: comp,\n\t\t\tacc: id\n\t\t };\n\n\t\t// There is a chance that the completion id undefined\n\t\t// (e.g. full name is undef, but found stuff in\n\t\t// synonym, etc.).\n\t\tif( ! comp ||\n\t\t comp == '' ||\n\t\t comp == ' ' ){\n\t\t if( desc ){\n\t\t\tcomp = desc;\n\t\t }else{\n\t\t\tcomp = '???';\n\t\t }\n\t\t}\n\t\t\n\t\tll(f + \": \" + id + ' _ ' + desc + ' _ ' + comp);\n\n\t\tvar cropped_comp = core.util.crop(comp, 40);\n\t\tvar cropped_desc = core.util.crop(desc, 15);\n\n\t\toutput_stack.push('<div id=\"');\n\t\toutput_stack.push(coder.encode(id));\n\t\toutput_stack.push('\" class=\"');\n\t\toutput_stack.push(BBOP_AC_UNIQUE_ROW_CLASS);\n\t\toutput_stack.push(' ');\n\t\toutput_stack.push(BBOP_AC_STANDARD_ROW_CLASS);\n\t\toutput_stack.push(' ');\n\t\tif( f % 2 == 0 ){\n\t\t output_stack.push(BBOP_AC_ROW_EVEN_CLASS);\n\t\t}else{\n\t\t output_stack.push(BBOP_AC_ROW_ODD_CLASS);\n\t\t}\n\t\toutput_stack.push('\">');\n\t\toutput_stack.push('<div style=\"float:left;\" >');\n\t\toutput_stack.push(cropped_comp);\n\t\toutput_stack.push('</div>');\n\t\toutput_stack.push('<div style=\"float:right;\">');\n\t\toutput_stack.push(cropped_desc);\n\t\toutput_stack.push('</div>');\n\t\toutput_stack.push('<br />');\n\t\toutput_stack.push('</div>');\n\t }\n \t output_stack.push('</div>');\n\n\t var outstr = output_stack.join('');\n\t \n\t //\n\t feed_me(outstr);\n\n\t //\n\t if( os.count() > 0 ){\n\t\tshow_me();\n\t }\n\t} \n }", "renderScoreArea(gameStatus, STATUS) {\n if (gameStatus != STATUS.BEGIN) {\n //When game completes\n let scoreLabel = (gameStatus == STATUS.COMPLETE) ? \"Final Score\" : \"Score\"\n let score = <span\n className=\"column column-100\"><h1><u>{scoreLabel}</u></h1><h2>{this.getScore()}</h2></span>;\n return score\n }\n return <span></span>\n }", "resultsRender(country, emissions) {\n return (\n <div className=\"renderResults\">\n {country === undefined || country === null ?\n\n <h1 className=\"searchHeader\">Search for emissions by country</h1>\n \n :\n <div> \n <h1 className=\"searchHeader\">{country.name}</h1>\n {this.props.perCapita ? \n <p className=\"chartTitle\">Emissions in kilotonnes per capita</p>\n :\n <p className=\"chartTitle\">Emissions in kilotonnes</p>\n\n }\n <div className=\"emissionChart\">\n <LineChart dataset={{radius: 1.5}} curve={false} data={emissions} />\n </div>\n\n </div> \n }\n </div>\n )\n }", "function resultsHTML(jobsAndLocData) {\n\n\n const location = jobsAndLocData[1].results[0].formatted_address;\n\n const jobData = jobsAndLocData[0];\n\n const jobCount = jobData.count;\n\n const mean = jobData.mean;\n if (mean === undefined) {\n return `\n <section class=\"result\" role=\"show-result\">\n <label class=\"result\" id=\"noData\" aria-errormessage=\"not enough job data for location\">Not enough Job Data for ${location} because the Aduzna API sucks. No map marker will be shown</label> \n </section>`;\n\n } else {\n mean;\n }\n\n console.log('This is the data being passed before displaying the results in HTML. Should be an Array:', jobsAndLocData);\n\n return `\n <section class=\"result\" role=\"show-result\">\n <label class=\"result label\" aria-label=\"Location\">Location\n <span class=\"displayedData\" aria-label=\"result location\">${location}</span>\n </label>\n <label class=\"result label\" aria-label=\"Job-Count\">Job Count\n <span class=\"displayedData\" aria-label=\"result job count\">${jobCount}</span>\n </label>\n <label class=\"result label\" aria-label=\"Salary-Mean\">Salary Mean\n <span class=\"displayedData\" aria-label=\"result job mean\">${mean}</span>\n </label>\n </section>\n `;\n }", "renderBigPercent() {\n\n let nodata = 'false';\n\n \t\t\n\n\t\tif(!this.props.foodList.foodCounts){ \n\t\t\tnodata = 'true';\n\t\t\t//console.log('foodcounts missing nodata = ', nodata);\n\t\t}\n\n\t\tif(this.props.dataStatus ==\"none\") {\n\t\t\tnodata = 'true';\n\t\t\t//console.log('status none nodata = ', nodata);\n\t\t}\n\n\t\tif(this.props.foodList.foodCounts) {\n\n\t\t\tif(this.props.foodList.foodCounts.length <= 0) {\n\t\t\t\tnodata='true';\n\t\t\t\tconsole.log('foodcounts empty nodata = ', nodata);\n\n\t\t\t}\n\t\t}\n\n \tif(nodata=='false') {\n\n\n \t\treturn (\n \t\t\t\t\t\t<div className=\"dark-box\">\n\t\t\t\t\t\t\t<DataBar dataStatus={this.props.dataStatus} symptom={this.props.symptom} description= {this.props.foodList.foodCounts[0].name } \n\t\t\t\t\t\t\tnumber={`${this.generatePercent(this.props.foodList.foodCounts[0].count, this.props.foodList.daylists.length)}%`} nodata={nodata} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)\n\n \t} else {\n\n \t\treturn(\n\n \t\t<div className=\"dark-box\">\n\t\t\t<DataBar symptom={this.props.symptom} description= ''\n\t\t\tnumber=\"0\" nodata='true' dataStatus={this.props.dataStatus}/>\n\t\t\t</div>\n\n\t\t\t)\n\n\n \t}\n \n\n\n }", "getStatusMarker() {\n // Do not use colored status marker for the moment as the output feels\n // to crowded. TODO(sdefresne): revisit this eventually.\n return '';\n\n if (this.cl_.hasUnresolvedComments())\n return 'tbr';\n if (this.cl_.isSubmittable())\n return 'lgtm';\n return 'pending';\n }", "function drawStatusInModal(data) {\n window.uksm = false ;\n window.ksm = false ;\n window.cpulimit =false ;\n var $statusModalBody = $(\"#statusModal\");\n\n if (!$statusModalBody.length) {\n return void 0;\n }\n\n // Read privileges and set specific actions/elements\n $('#actions-menu', $statusModalBody).empty();\n $('#actions-menu', $statusModalBody).append('<li><a class=\"action-sysstatus\" href=\"javascript:void(0)\"><i class=\"glyphicon glyphicon-refresh\"></i> ' + MESSAGES[40] + '</a></li>');\n $('#actions-menu', $statusModalBody).append('<li><a class=\"action-stopall\" href=\"javascript:void(0)\"><i class=\"glyphicon glyphicon-stop\"></i> ' + MESSAGES[50] + '</a></li>');\n //$('#actions-menu', $statusModalBody).append('<li><a class=\"action-update\" href=\"javascript:void(0)\"><i class=\"glyphicon glyphicon-repeat\"></i> ' + MESSAGES[132] + '</a></li>');\n\n // Adding all stats\n\n // Text\n $('#stats-text ul', $statusModalBody).empty();\n $('#stats-text ul', $statusModalBody).append('<li>' + MESSAGES[39] + ': <code>' + data['version'] + '</code></li>');\n $('#stats-text ul', $statusModalBody).append('<li>' + MESSAGES[49] + ': <code>' + data['qemu_version'] + '</code></li>');\n $('#stats-text ul', $statusModalBody).append('<li class=\"uksm\">' + MESSAGES[165] + ':&nbsp;&nbsp;<input type=\"checkbox\" id=\"ToggleUKSM\"></li>');\n $('#stats-text ul', $statusModalBody).append('<li class=\"ksm\">' + MESSAGES[171] + ':&nbsp;&nbsp;<input type=\"checkbox\" id=\"ToggleKSM\"></li>');\n\n if ( data['uksm'] == \"unsupported\" ) $('.uksm').addClass('hidden')\n if ( data['ksm'] == \"unsupported\" ) $('.ksm').addClass('hidden')\n\n $('#ToggleUKSM').toggleSwitch({width: \"50px\"});\n if ( data['uksm'] == \"enabled\" ) { window.uksm = true ; $('#ToggleUKSM').toggleCheckedState(true) };\n\n $('#ToggleKSM').toggleSwitch({width: \"50px\"});\n if ( data['ksm'] == \"enabled\" ) { window.ksm = true ; $('#ToggleKSM').toggleCheckedState(true) };\n\n $('#stats-text ul', $statusModalBody).append('<li>' + MESSAGES[170] + ':&nbsp;&nbsp;<input type=\"checkbox\" id=\"ToggleCPULIMIT\"></li>');\n $('#ToggleCPULIMIT').toggleSwitch({width: \"50px\"});\n if ( data['cpulimit'] == \"enabled\" ) { window.cpulimit = true ;$('#ToggleCPULIMIT').toggleCheckedState(true) };\n $('#stats-text ul', $statusModalBody).append('<li>' + MESSAGES[29] + ': <code>' + ROLE + '</code></li>');\n $('#stats-text ul', $statusModalBody).append('<li>' + MESSAGES[32] + ': <code>' + ((TENANT == -1) ? 'none' : TENANT) + '</code></li>');\n\n // use graphs\n $('#stats-graph ul', $statusModalBody).empty();\n\n // CPU usage\n $('#stats-graph ul', $statusModalBody).append('<li><div class=\"circle circle-cpu col-md-3 col-lg-3\"><strong></strong><br/><span>' + MESSAGES[36] + '</span></div></li>');\n $('.circle-cpu').circleProgress({\n arcCoef: 0.7,\n value: data['cpu'],\n thickness: 10,\n startAngle: -Math.PI / 2,\n fill: {gradient: ['#2cc085']}\n }).on('circle-animation-progress', function (event, progress) {\n if (progress > data['cpu']) {\n $(this).find('strong').html(parseInt(100 * data['cpu']) + '%');\n } else {\n $(this).find('strong').html(parseInt(100 * progress) + '%');\n }\n });\n\n // Memory usage\n $('#stats-graph ul', $statusModalBody).append('<li><div class=\"circle circle-memory col-md-3 col-lg-3\"><strong></strong><br/><span>' + MESSAGES[37] + '</span></div></li>');\n $('.circle-memory').circleProgress({\n arcCoef: 0.7,\n value: data['mem'],\n thickness: 10,\n startAngle: -Math.PI / 2,\n fill: {gradient: ['#2cc085']}\n }).on('circle-animation-progress', function (event, progress) {\n if (progress > data['mem']) {\n $(this).find('strong').html(parseInt(100 * data['mem']) + '%');\n } else {\n $(this).find('strong').html(parseInt(100 * progress) + '%');\n }\n });\n\n // Swap usage\n $('#stats-graph ul', $statusModalBody).append('<li><div class=\"circle circle-swap col-md-3 col-lg-3\"><strong></strong><br/><span>Swap usage</span></div></li>');\n $('.circle-swap').circleProgress({\n arcCoef: 0.7,\n value: data['swap'],\n thickness: 10,\n startAngle: -Math.PI / 2,\n fill: {gradient: ['#2cc085']}\n }).on('circle-animation-progress', function (event, progress) {\n if (progress > data['swap']) {\n $(this).find('strong').html(parseInt(100 * data['swap']) + '%');\n } else {\n $(this).find('strong').html(parseInt(100 * progress) + '%');\n }\n });\n\n // Disk usage\n $('#stats-graph ul', $statusModalBody).append('<li><div class=\"circle circle-disk col-md-3 col-lg-3\"><strong></strong><br/><span>' + MESSAGES[38] + '</span></div></li>');\n $('.circle-disk').circleProgress({\n arcCoef: 0.7,\n value: data['disk'],\n thickness: 10,\n startAngle: -Math.PI / 2,\n fill: {gradient: ['#2cc085']}\n }).on('circle-animation-progress', function (event, progress) {\n if (progress > data['disk']) {\n $(this).find('strong').html(parseInt(100 * data['disk']) + '%');\n } else {\n $(this).find('strong').html(parseInt(100 * progress) + '%');\n }\n });\n\n // IOL running nodes\n $('#stats-graph ul', $statusModalBody).append('<li><div class=\"count count-iol col-md-4 col-lg-4\"></div>');\n $('.count-iol', $statusModalBody).html('<strong>' + data['iol'] + '</strong><br/><span>' + MESSAGES[41] + '</span></li>');\n\n // Dynamips running nodes\n $('#stats-graph ul', $statusModalBody).append('<li><div class=\"count count-dynamips col-md-4 col-lg-4\"></div></li>');\n $('.count-dynamips', $statusModalBody).html('<strong>' + data['dynamips'] + '</strong><br/><span>' + MESSAGES[42] + '</span>');\n\n // QEMU running nodes\n $('#stats-graph ul', $statusModalBody).append('<li><div class=\"count count-qemu col-md-4 col-lg-4\"></div></li>');\n $('.count-qemu', $statusModalBody).html('<strong>' + data['qemu'] + '</strong><br/><span>' + MESSAGES[43] + '</span>');\n\n // Docker running nodes\n $('#stats-graph ul', $statusModalBody).append('<li><div class=\"count count-docker col-md-4 col-lg-6\"></div></li>');\n $('.count-docker', $statusModalBody).html('<strong>' + data['docker'] + '</strong><br/><span>' + MESSAGES[161] + '</span>');\n\n // VPCS running nodes\n $('#stats-graph ul', $statusModalBody).append('<li><div class=\"count count-vpcs col-md-4 col-lg-6\"></div></li>');\n $('.count-vpcs', $statusModalBody).html('<strong>' + data['vpcs'] + '</strong><br/><span>' + MESSAGES[162] + '</span>');\n}", "function renderPlot$1(_, title, isCollapsed, render, thresholdsAndCriteria) {\n var _this = this;\n\n var lodash = window._;\n var Flow = window.Flow;\n var $ = window.jQuery;\n var rocPanel = void 0;\n var container = Flow.Dataflow.signal(null);\n var linkedFrame = Flow.Dataflow.signal(null);\n\n // TODO HACK\n if (thresholdsAndCriteria) {\n rocPanel = {\n thresholds: Flow.Dataflow.signals(thresholdsAndCriteria.thresholds),\n threshold: Flow.Dataflow.signal(null),\n criteria: Flow.Dataflow.signals(thresholdsAndCriteria.criteria),\n criterion: Flow.Dataflow.signal(null)\n };\n }\n render(function (error, vis) {\n var _autoHighlight = void 0;\n if (error) {\n return console.debug(error);\n }\n $('a', vis.element).on('click', function (e) {\n var $a = $(e.target);\n switch ($a.attr('data-type')) {\n case 'frame':\n return _.insertAndExecuteCell('cs', 'getFrameSummary ' + flowPrelude$42.stringify($a.attr('data-key')));\n case 'model':\n return _.insertAndExecuteCell('cs', 'getModel ' + flowPrelude$42.stringify($a.attr('data-key')));\n default:\n // do nothing\n }\n });\n container(vis.element);\n _autoHighlight = true;\n if (vis.subscribe) {\n vis.subscribe('markselect', function (_arg) {\n var currentCriterion = void 0;\n var selectedIndex = void 0;\n var frame = _arg.frame;\n var indices = _arg.indices;\n var subframe = window.plot.createFrame(frame.label, frame.vectors, indices);\n _.plot(renderTable.bind(_this, indices, subframe))(function (error, table) {\n if (!error) {\n return linkedFrame(table.element);\n }\n });\n\n // TODO HACK\n if (rocPanel) {\n if (indices.length === 1) {\n selectedIndex = lodash.head(indices);\n _autoHighlight = false;\n rocPanel.threshold(lodash.find(rocPanel.thresholds(), function (threshold) {\n return threshold.index === selectedIndex;\n }));\n currentCriterion = rocPanel.criterion();\n\n // More than one criterion can point to the same threshold,\n // so ensure that we're preserving the existing criterion, if any.\n if (!currentCriterion || currentCriterion && currentCriterion.index !== selectedIndex) {\n rocPanel.criterion(lodash.find(rocPanel.criteria(), function (criterion) {\n return criterion.index === selectedIndex;\n }));\n }\n _autoHighlight = true;\n } else {\n rocPanel.criterion(null);\n rocPanel.threshold(null);\n }\n }\n });\n vis.subscribe('markdeselect', function () {\n linkedFrame(null);\n\n // TODO HACK\n if (rocPanel) {\n rocPanel.criterion(null);\n return rocPanel.threshold(null);\n }\n });\n\n // TODO HACK\n if (rocPanel) {\n Flow.Dataflow.react(rocPanel.threshold, function (threshold) {\n if (threshold && _autoHighlight) {\n return vis.highlight([threshold.index]);\n }\n });\n return Flow.Dataflow.react(rocPanel.criterion, function (criterion) {\n if (criterion && _autoHighlight) {\n return vis.highlight([criterion.index]);\n }\n });\n }\n }\n });\n return _.plots.push({\n title: title,\n plot: container,\n frame: linkedFrame,\n controls: Flow.Dataflow.signal(rocPanel),\n isCollapsed: isCollapsed\n });\n }", "static displayColorSwatchs(layer, pcode, value, occurence, tresholds){\n let rate;\n if (analyser.indicator == 3) {\n rate = value\n } else {\n rate = value / occurence\n if (value == 0 && occurence == 0) {\n rate = 0\n }\n }\n if (layer.feature.properties.pcode == pcode) {\n layer.feature.properties.selected = true\n layer.bindPopup(Mapper.setPopUpContent(rate, layer.feature.properties.name));\n layer.on('mouseover', function (e) {\n this.openPopup();\n });\n layer.on('mouseout', function (e) {\n this.closePopup();\n });\n if (value == 0) {\n layer.setStyle({\n \"weight\": 1,\n \"color\": \"#000\",\n \"opacity\": 0.7,\n \"fillColor\": analyser.swatchsFill['0'],\n \"fillOpacity\": 0.9\n });\n }\n if (rate <= tresholds[0] && value != 0) {\n layer.setStyle({\n \"weight\": 1,\n \"color\": \"#000\",\n \"opacity\": 0.7,\n \"fillColor\": analyser.swatchsFill['1'],\n \"fillOpacity\": 0.7\n });\n } else if (rate > tresholds[0] && rate <= tresholds[1]) {\n layer.setStyle({\n \"weight\": 1,\n \"color\": \"#000\",\n \"opacity\": 0.7,\n \"fillColor\": analyser.swatchsFill['2'],\n \"fillOpacity\": 0.7\n });\n } else if (rate > tresholds[1] && rate <= tresholds[2]) {\n layer.setStyle({\n \"weight\": 1,\n \"color\": \"#000\",\n \"opacity\": 0.7,\n \"fillColor\": analyser.swatchsFill['3'],\n \"fillOpacity\": 0.7\n });\n } else if (rate > tresholds[2] && rate <= tresholds[3]) {\n layer.setStyle({\n \"weight\": 1,\n \"color\": \"#000\",\n \"opacity\": 0.7,\n \"fillColor\": analyser.swatchsFill['4'],\n \"fillOpacity\": 0.7\n });\n } else if (rate > tresholds[3] && rate <= tresholds[4]) {\n layer.setStyle({\n \"weight\": 1,\n \"color\": \"#000\",\n \"opacity\": 0.7,\n \"fillColor\": analyser.swatchsFill['5'],\n \"fillOpacity\": 0.7\n });\n } else if (rate > tresholds[4]) {\n layer.setStyle({\n \"weight\": 1,\n \"color\": \"#000\",\n \"opacity\": 0.7,\n \"fillColor\": analyser.swatchsFill['6'],\n \"fillOpacity\": 0.7\n });\n }\n }\n }", "function ListUsersComp(props) {\n const columns = [\n {\n name: 'Name',\n options: {\n filter: true\n }\n },\n {\n name: 'Title',\n options: {\n filter: true,\n }\n },\n {\n name: 'KPI',\n options: {\n filter: false,\n customBodyRender: (value) => (\n <LinearProgress variant=\"determinate\" color=\"secondary\" value={value} />\n )\n }\n },\n {\n name: 'Status',\n options: {\n filter: true,\n customBodyRender: (value) => {\n if (value === 'active') {\n return (<Chip label=\"Active\" color=\"secondary\" />);\n }\n if (value === 'non-active') {\n return (<Chip label=\"Non Active\" color=\"primary\" />);\n }\n return (<Chip label=\"Unknown\" />);\n }\n }\n },\n {\n name: 'Salary',\n options: {\n filter: true,\n customBodyRender: (value) => {\n const nf = new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n minimumFractionDigits: 2,\n maximumFractionDigits: 2\n });\n\n return nf.format(value);\n }\n }\n },\n ];\n\n const data = [\n ['Gabby George', 'Business Analyst', 30, 'active', 100000],\n ['Aiden Lloyd', 'Business Consultant', 55, 'active', 200000],\n ['Jaden Collins', 'Attorney', 27, 'non-active', 500000],\n ['Franky Rees', 'Business Analyst', 90, 'active', 50000],\n ['Aaren Rose', 'Business Consultant', 28, 'unknown', 75000],\n ['Blake Duncan', 'Business Management Analyst', 65, 'active', 94000],\n ['Frankie Parry', 'Agency Legal Counsel', 71, 'non-active', 210000],\n ['Lane Wilson', 'Commercial Specialist', 19, 'active', 65000],\n ['Robin Duncan', 'Business Analyst', 20, 'unknown', 77000],\n ['Mel Brooks', 'Business Consultant', 89, 'active', 135000],\n ['Harper White', 'Attorney', 52, 'non-active', 420000],\n ['Kris Humphrey', 'Agency Legal Counsel', 80, 'active', 150000],\n ['Frankie Long', 'Industrial Analyst', 31, 'active', 170000],\n ['Brynn Robbins', 'Business Analyst', 22, 'active', 90000],\n ['Justice Mann', 'Business Consultant', 76, 'non-active', 33000],\n ['Addison Navarro', 'Business Management Analyst', 50, 'non-active', 295000],\n ['Jesse Welch', 'Agency Legal Counsel', 28, 'active', 100000],\n ['Eli Mejia', 'Commercial Specialist', 65, 'active', 400000],\n ['Gene Leblanc', 'Industrial Analyst', 100, 'active', 110000],\n ['Danny Leon', 'Computer Scientist', 60, 'non-active', 220000],\n ['Lane Lee', 'Corporate Counselor', 52, 'unknown', 180000],\n ['Jesse Hall', 'Business Analyst', 44, 'active', 99000],\n ['Danni Hudson', 'Agency Legal Counsel', 37, 'active', 90000],\n ['Terry Macdonald', 'Commercial Specialist', 39, 'active', 140000],\n ['Justice Mccarthy', 'Attorney', 26, 'active', 330000],\n ['Silver Carey', 'Computer Scientist', 10, 'active', 250000],\n ['Franky Miles', 'Industrial Analyst', 49, 'active', 190000],\n ['Glen Nixon', 'Corporate Counselor', 15, 'non-active', 80000],\n ['Gabby Strickland', 'Business Process Consultant', 26, 'unknown', 45000],\n ['Mason Ray', 'Computer Scientist', 39, 'active', 142000]\n ];\n\n const options = {\n\n textLabels: {\n body: {\n noMatch: 'Sorry!, no matching records found',\n toolTip: 'Sort',\n\n columnHeaderTooltip: column => `Sort for ${column.label}`\n },\n pagination: {\n next: 'Next Page',\n previous: 'Previous Page',\n rowsPerPage: 'Rows per page:',\n displayRows: 'of',\n },\n toolbar: {\n search: 'Search',\n downloadCsv: 'Download CSV',\n print: 'Print',\n viewColumns: 'View Columns',\n filterTable: 'Filter Table',\n },\n filter: {\n all: 'All',\n title: 'FILTERS',\n reset: 'RESET',\n },\n viewColumns: {\n title: 'Show Columns',\n titleAria: 'Show/Hide Table Columns',\n },\n selectedRows: {\n text: 'row(s) selected',\n delete: 'Delete',\n deleteAria: 'Delete Selected Rows',\n },\n }\n\n };\n\n const { classes } = props;\n\n return (\n <div className={classes.table}>\n <MUIDataTable\n title=\"list Users\"\n data={data}\n columns={columns}\n options={options}\n />\n </div>\n );\n}", "function radioEvents(event) {\r\n\r\n\tswitch(event) {\r\n\t\r\n\t\tcase 'steerYes':\r\n\t\tsteerAssistLabel.style.color = 'lightgreen';\r\n\t\tassistsFilter[0] = true;\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'steerNo':\r\n\t\tsteerAssistLabel.style.color = 'pink';\r\n\t\tassistsFilter[0] = false;\r\n\t\tbreak;\t\r\n\t\t\r\n\t\tcase 'steerBoth':\r\n\t\tsteerAssistLabel.style.color = 'lightblue';\r\n\t\tassistsFilter[0] = \"both\";\r\n\t\tbreak;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tcase 'brakeYes':\r\n\t\tbrakeAssistLabel.style.color = 'lightgreen';\r\n\t\tassistsFilter[1] = true;\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'brakeNo':\r\n\t\tbrakeAssistLabel.style.color = 'pink';\r\n\t\tassistsFilter[1] = false;\r\n\t\tbreak;\t\r\n\t\t\r\n\t\tcase 'brakeBoth':\r\n\t\tbrakeAssistLabel.style.color = 'lightblue';\r\n\t\tassistsFilter[1] = \"both\";\r\n\t\tbreak;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tcase 'ABS_Yes':\r\n\t\tABS_label.style.color = 'lightgreen';\r\n\t\tassistsFilter[2] = true;\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'ABS_No':\r\n\t\tABS_label.style.color = 'pink';\r\n\t\tassistsFilter[2] = false;\r\n\t\tbreak;\t\r\n\t\t\r\n\t\tcase 'ABS_Both':\r\n\t\tABS_label.style.color = 'lightblue';\r\n\t\tassistsFilter[2] = \"both\";\r\n\t\tbreak;\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tcase 'TC_Yes':\r\n\t\tTC_label.style.color = 'lightgreen';\r\n\t\tassistsFilter[3] = true;\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'TC_No':\r\n\t\tTC_label.style.color = 'pink';\r\n\t\tassistsFilter[3] = false;\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'TC_Both':\r\n\t\tTC_label.style.color = 'lightblue';\r\n\t\tassistsFilter[3] = \"both\";\r\n\t\tbreak;\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tcase 'SC_Yes':\r\n\t\tSC_label.style.color = 'lightgreen';\r\n\t\tassistsFilter[4] = true;\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'SC_No':\r\n\t\tSC_label.style.color = 'pink';\r\n\t\tassistsFilter[4] = false;\r\n\t\tbreak;\t\r\n\t\t\r\n\t\tcase 'SC_Both':\r\n\t\tSC_label.style.color = 'lightblue';\r\n\t\tassistsFilter[4] = \"both\";\r\n\t\tbreak;\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tcase 'noDamageYes':\r\n\t\tdamageLabel.style.color = 'lightgreen';\r\n\t\tassistsFilter[5] = true;\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'noDamageNo':\r\n\t\tdamageLabel.style.color = 'pink';\r\n\t\tassistsFilter[5] = false;\r\n\t\tbreak;\t\r\n\t\t\r\n\t\tcase 'noDamageBoth':\r\n\t\tdamageLabel.style.color = 'lightblue';\r\n\t\tassistsFilter[5] = \"both\";\r\n\t\tbreak;\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tcase 'gearYes':\r\n\t\tgearLabel.style.color = 'lightgreen';\r\n\t\tassistsFilter[6] = true;\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'gearNo':\r\n\t\tgearLabel.style.color = 'pink';\r\n\t\tassistsFilter[6] = false;\r\n\t\tbreak;\t\r\n\t\t\r\n\t\tcase 'gearBoth':\r\n\t\tgearLabel.style.color = 'lightblue';\r\n\t\tassistsFilter[6] = \"both\";\r\n\t\tbreak;\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tcase 'clutchYes':\r\n\t\tclutchLabel.style.color = 'lightgreen';\r\n\t\tassistsFilter[7] = true;\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'clutchNo':\r\n\t\tclutchLabel.style.color = 'pink';\r\n\t\tassistsFilter[7] = false;\r\n\t\tbreak;\t\r\n\t\t\r\n\t\tcase 'clutchBoth':\r\n\t\tclutchLabel.style.color = 'lightblue';\r\n\t\tassistsFilter[7] = \"both\";\r\n\t\tbreak;\r\n\r\n\t\t\r\n\t\t\r\n\t\tcase 'lineYes':\r\n\t\tlineLabel.style.color = 'lightgreen';\r\n\t\tassistsFilter[8] = true;\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'lineNo':\r\n\t\tlineLabel.style.color = 'pink';\r\n\t\tassistsFilter[8] = false;\r\n\t\tbreak;\t\r\n\t\t\r\n\t\tcase 'lineBoth':\r\n\t\tlineLabel.style.color = 'lightblue';\r\n\t\tassistsFilter[8] = \"both\";\r\n\t\tbreak;\t\r\n\r\n\t\t\r\n\t\t\r\n\t\tdefault:\r\n\t\talert('error in event switch');\r\n\t\tbreak;\r\n\t}\r\n\t\r\n\tcheckIfcurrentFilterMatchSave();\r\n}", "function annotateAndFilterSearchResults(data) {\n console.debug(\"TGWF:search:yahoo:annotateAndFilterSearchResults\")\n\n var list = $(\"#web\").find(\"ol > li\");\n\n list.each(function () {\n var loc = getUrl($(this).find('a').first().attr('href'));\n if (loc && data[loc]) {\n\n\n $(this).find('.TGWF').first()\n .html(getResultNode(data[loc]).append('&nbsp;'))\n .qtip({\n content: {\n text: function (api) {\n return getTitleWithLink(data[loc]);\n }\n },\n show: { delay: 700 },\n hide: { fixed: true, delay: 500 }\n });\n\n\n if (data[loc].green) {\n $(this).find('.TGWF').first().qtip('option', { 'style.classes': 'qtip-green' });\n } else {\n $(this).find('.TGWF').first().qtip('option', { 'style.classes': 'qtip-light' });\n }\n\n\n // remove link if it's not green and we have filtering enabled\n // if (message.filter && data[loc].green === false) {\n // // remove full result from the page\n // $(this).hide();\n // }\n }\n });\n}", "function printData()\n{\n // update labels\n lblScore.innerHTML = score;\n lblRecent.innerHTML = recent;\n lblHScore.innerHTML = hScore;\n \n // show/hide 'PAUSED'\n if (paused)\n {\n lblPaused.innerHTML = 'PAUSED';\n lblPaused.style.color = '#00ffff';\n }\n else\n {\n lblPaused.innerHTML = 'RUNNING';\n lblPaused.style.color = '#2f2f2f';\n }\n \n // show/hide current score\n if (chkScore.checked)\n divScore.style.display = 'block';\n else\n divScore.style.display = 'none';\n \n // show/hide recent score\n if (chkRecent.checked)\n divRecent.style.display = 'block';\n else\n divRecent.style.display = 'none';\n \n // show/hide high score\n if (chkHScore.checked)\n divHScore.style.display = 'block';\n else\n divHScore.style.display = 'none';\n\n // show/hide wrap label\n if (doWrap)\n {\n lblWrap.style.color = '#00ff00';\n lblWrap.innerHTML = 'WRAP ENABLED';\n } \n else\n {\n lblWrap.style.color = '#0f0f0f';\n lblWrap.innerHTML = 'WRAP DISABLED';\n }\n}", "_initDataTypeCriterias() {\n const that = this;\n\n // Left title\n let inputCriteriaLeftTitle = document.createElement('div');\n inputCriteriaLeftTitle.classList.add('left-title');\n\n let inputCriteriaSpanLeftTitle = document.createElement('div');\n inputCriteriaSpanLeftTitle.classList.add('criteria-container');\n inputCriteriaSpanLeftTitle.innerHTML = that.messages[that.locale].criteriaText ? that.messages[that.locale].criteriaText : that.defaultMessages[that.defaultLocale].criteriaText;\n\n inputCriteriaLeftTitle.appendChild(inputCriteriaSpanLeftTitle);\n\n // Right elements\n that.inputCriteriaRightElements = document.createElement('div');\n that.inputCriteriaRightElements.classList.add('right-elements');\n\n // Init criteria\n that.smartInputCriteria = document.createElement('smart-input');\n that.smartInputCriteria.classList.add('smart-input-criteria');\n that.smartInputCriteria.dropDownButtonPosition = 'right';\n that.smartInputCriteria.readonly = true;\n that.smartInputCriterias = [];\n\n // OnChange criteria\n const criteriaClickFunction = () => that._initConditionCriterias();\n that.smartInputCriteria.addEventListener('change', criteriaClickFunction);\n that.smartInputCriteria['criteria-change'] = criteriaClickFunction;\n\n // Init criterias\n for (let i = 0; i < Object.keys(that.criteriaType).length; i++) {\n let criteria = Object.keys(that.criteriaType)[i];\n let criteriaLabel = that.messages[that.locale][criteria + 'DataTypeText'] ? that.messages[that.locale][criteria + 'DataTypeText'] : that.defaultMessages[that.defaultLocale][criteria + 'DataTypeText'];\n that.smartInputCriterias.push({ value: criteria, label: criteriaLabel });\n }\n\n that.smartInputCriteria.dataSource = that.smartInputCriterias;\n that.smartInputCriteria.value = that.smartInputCriterias[0].label;\n that.smartInputCriteria.label = that.smartInputCriterias[0].value;\n\n that.criteriaContainer.appendChild(that.smartInputCriteria);\n\n that.inputCriteriaRightElements.appendChild(that.criteriaContainer);\n that.dataValidationContainer.appendChild(inputCriteriaLeftTitle);\n that.dataValidationContainer.appendChild(that.inputCriteriaRightElements);\n\n that.dataValidationModal.appendChild(that.dataValidationContainer);\n that.dataValidationModal.style.display = 'flex';\n that.dataValidationModal.style.flexDirection = 'column-reverse';\n\n // Init condition criterias\n that._initConditionCriterias();\n\n }", "function buildStatusDataTable(responseData) {\n // create an array of object keys and use the length of the array to determine number of columns in the table\n let totalNumberOfRecords = Object.keys(responseData);\n let statsTableHTML = `<table><tr>`;\n for (let i = 0; i < totalNumberOfRecords.length; i++) {\n // build table header for each status code\n statsTableHTML += `<th>`;\n if (totalNumberOfRecords[i].indexOf('noResponse') != -1) {\n statsTableHTML += `No Response`;\n } else {\n statsTableHTML += `Status Code: ${totalNumberOfRecords[i]}`;\n }\n statsTableHTML += `</th>`;\n }\n statsTableHTML += `</tr><tr>`;\n\n for (let i = 0; i < totalNumberOfRecords.length; i++) {\n // loop through array of object keys again and use the key value in the array to access the key value in the object\n statsTableHTML += `<td>${responseData[totalNumberOfRecords[i]]}</td>`;\n }\n statsTableHTML += `</tr></table>`;\n return statsTableHTML;\n}", "function displayResults (dataset) {\n if (dataset.data.length === 0) {\n window.alert('Can\\'t handle the request, probably you misspelled the name of your city, or if you used the geolocation it took too much time to handle the request. Please try again!')\n document.querySelector('.geo_btn').click()\n return null\n } else {\n const city = document.querySelector('.location')\n city.innerText = dataset.data[0].station.name\n\n const update = document.querySelector('h3.update')\n update.innerText = 'Last update: ' + `${dataset.data[0].time.stime}`\n\n const index = document.querySelector('.index')\n const indexValue = (`${dataset.data[0].aqi}`)\n index.innerText = indexValue\n\n let commentText\n let image\n let warning\n switch (true) {\n case (indexValue < 50):\n commentText = 'Air quality is Good'\n image = 'Good.png'\n warning = 'Air quality is considered satisfactory, and air pollution poses little or no risk'\n // background = ''\n break\n case (indexValue < 100):\n commentText = 'Air quality is Moderate'\n image = 'Moderate.png'\n warning = 'Air quality is acceptable; however, for some pollutants there may be a moderate health concern for a very small number of people who are unusually sensitive to air pollution.'\n // background = ''\n break\n case (indexValue < 150):\n commentText = 'Air quality is Unhealthy for Sensitive Groups'\n image = 'Unhealthy.png'\n warning = 'Members of sensitive groups may experience health effects. The general public is not likely to be affected.'\n // background = ''\n break\n case (indexValue < 200):\n commentText = 'Air quality is Unhealthy'\n image = 'UnhealthyRisk.png'\n warning = 'Everyone may begin to experience health effects; members of sensitive groups may experience more serious health effects'\n // background = ''\n break\n case (indexValue < 300):\n commentText = 'Air quality is Very Unhealthy'\n image = 'VeryUnhealthy'\n warning = 'Health warnings of emergency conditions. The entire population is more likely to be affected.'\n // background = ''\n break\n case (indexValue < 999):\n commentText = 'Air quality is Hazardous'\n image = 'Hazardous.png'\n warning = 'Health alert: everyone may experience more serious health effects'\n // background = ''\n break\n }\n\n const comment = document.querySelector('.comment')\n comment.innerText = commentText\n\n const png = document.querySelector('td.png')\n png.innerHTML = \"<img src='../src/img/\" + image + \"' width='140px' height='auto'>\"\n\n const hint = document.querySelector('td.hint')\n hint.innerText = warning\n }\n}", "function renderStatusLabel(key, codes, options={}) {\n\n let text = null;\n let label = null;\n\n // Find the entry which matches the provided key\n for (var name in codes) {\n let entry = codes[name];\n\n if (entry.key == key) {\n text = entry.value;\n label = entry.label;\n break;\n }\n }\n\n if (!text) {\n console.error(`renderStatusLabel could not find match for code ${key}`);\n }\n\n // Fallback for color\n label = label || 'bg-dark';\n\n if (!text) {\n text = key;\n }\n\n let classes = `badge rounded-pill ${label}`;\n\n if (options.classes) {\n classes += ` ${options.classes}`;\n }\n\n return `<span class='${classes}'>${text}</span>`;\n}", "function doTooltip(d, i) {\n\tvar commonname = toTitleCase(d['Common names (Eng)'].split(',')[0]);\n\tif (commonname=='') {\n\t\tcommonname = toTitleCase(d.Genus)+ \" \" +d.Species;\n\t//ttsciname.text(' ');\n \t//ttspecieslabel.text(toTitleCase(d.Genus)+ \" \" +d.Species);\n \t//ttthreatlabel.text(threatdict[d['Red List status']].toUpperCase())\n\t} \n\t\n\tttspecieslabel.text(commonname);\n \tttthreatlabel.text(threatdict[d['Red List status']].toUpperCase())\n\twordlen=Math.max(commonname.length, threatdict[d['Red List status']].length)\n\t\n\ttooltip\n\t\t.style(\"left\", getFocusXFromGenus(d[\"genus-order\"])-13+\"px\")//+focuswidth+8+\"px\")\n\t\t.style(\"top\", tooltipy0+\"px\")//(getSpeciesFocusY(d)+(classdata[currclassindex].focusheight/2.0))+\"px\")\n\t\t.style(\"display\", \"block\")\n\t\t//.style(\"width\", 10*wordlen+\"px\")\n}", "generateDetailsLabel() {\n var id = generateId();\n var icon = \"<i class='material-icons icon' style='display: none;'>done</i>\";\n var iconS = \"<i class='material-icons icon'>done</i>\";\n var sub = \"<span class='subtitle'>Algorithmus auswählen</span>\";\n var subS = \"<span class='subtitle'>Algorithmus ausgewählt</span>\";\n var html = \"<div id='\" + id + \"'><div class='approaches-overview' style='display: none; width: 100%;'>\";\n if (this.algorithm == \"AllInOneRow\") {\n html += \"<div class='algorithm-overview' data-alg='air'>\" + iconS + \"<span class='headline'>AllInOneRow</span>\" + subS + \"</div>\";\n } else {\n html += \"<div class='algorithm-overview' data-alg='air'>\" + icon + \"<span class='headline'>AllInOneRow</span>\" + sub + \"</div>\";\n }\n if (this.algorithm == \"StartLeftBottom\") {\n html += \"<div class='algorithm-overview' data-alg='slb'>\" + iconS + \"<span class='headline'>StartLeftBottom</span>\" + subS + \"</div>\";\n } else {\n html += \"<div class='algorithm-overview' data-alg='slb'>\" + icon + \"<span class='headline'>StartLeftBottom</span>\" + sub + \"</div>\";\n }\n if (this.algorithm == \"SuperFlo\") {\n html += \"<div class='algorithm-overview' data-alg='suf'>\" + iconS + \"<span class='headline'>SuperFlo</span>\" + subS + \"</div>\";\n } else {\n html += \"<div class='algorithm-overview' data-alg='suf'>\" + icon + \"<span class='headline'>SuperFlo</span>\" + sub + \"</div>\";\n }\n html += \"</div><table class='user-input-tab'><tbody><tr><td>Breite des Containers</td><td class='input'><input class='user-input' type='text' id='cicw' value='\" + this.cW + \"' /></td><td rowspan='2'><div style='width: 300px; height: 130px; overflow-x: scroll; overflow-y: none; display: none;'></div></td></tr><tr><td>Höhe des Containers</td><td class='input'><input class='user-input' type='text' id='cich' value='\" + this.cH + \"' /></td></tr><tr><td colspan='2' class='fill-orders' ></td></tr></tbody></table></div>\";\n return {\n html: html,\n id: id\n };\n }" ]
[ "0.60921293", "0.59985125", "0.5935145", "0.57989573", "0.5769663", "0.5739767", "0.5723356", "0.57116985", "0.5633558", "0.5599243", "0.55275136", "0.55244064", "0.55243766", "0.5476842", "0.5465518", "0.54373485", "0.5413009", "0.5360616", "0.5341046", "0.5307232", "0.53007483", "0.5289395", "0.5248401", "0.5233363", "0.52285475", "0.52190113", "0.52189654", "0.5216961", "0.52160335", "0.5211451", "0.5192646", "0.5174442", "0.5139172", "0.513916", "0.51349944", "0.51160806", "0.5107222", "0.5102997", "0.510111", "0.5099925", "0.5075466", "0.506694", "0.506071", "0.5058615", "0.5040132", "0.5038341", "0.5034549", "0.5014033", "0.50089395", "0.50069654", "0.49965137", "0.4987158", "0.49739748", "0.49730164", "0.49664056", "0.49645823", "0.4962056", "0.4962034", "0.4957684", "0.49564594", "0.49539638", "0.49438375", "0.4927839", "0.4921889", "0.49207118", "0.49194282", "0.49119878", "0.49048555", "0.49036777", "0.48916364", "0.48893797", "0.48892176", "0.48861188", "0.48860848", "0.48815638", "0.48800892", "0.48793185", "0.48780322", "0.48738366", "0.48734275", "0.4869848", "0.48664278", "0.48648563", "0.48644498", "0.48511273", "0.4849216", "0.48476067", "0.48470396", "0.48448378", "0.48323756", "0.48304045", "0.48301038", "0.48196948", "0.48191002", "0.48153913", "0.48136786", "0.4809775", "0.4800501", "0.47982156", "0.4797503" ]
0.6939561
0
Method to return current tab
getCurrentTab(category) { let currentTabName, className = ''; let currentTab = this.state.selectedTab; if (currentTab) { switch (currentTab) { case 'population': currentTabName = 'population'; break; case 'variant-type': currentTabName = 'computational'; break; case 'experimental': currentTabName = 'functional'; break; case 'segregation-case': currentTabName = 'segregation'; break; default: currentTabName = null; } } if (currentTabName && currentTabName === category) { className = ' onCurrentTab'; } return className; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentTab() {\n return currentTab;\n}", "function getCurrentTab() {\n return currentTab;\n}", "function getCurrentTab() {\n return currentTab;\n}", "function getCurrentTab() {\n return $currentTab;\n}", "getCurrentTab() {\n return window.location.pathname.split('/')[2];\n }", "function getCurrentTab() {\r\n try {\r\n var li = jQuery(\".tabOn\");\r\n if (li.length != 1) return -1;\r\n var links = jQuery('a', li);\r\n if (links.length != 1) return -1;\r\n var p = new SimpleParser(links[0].href);\r\n var tab = new Number(p.extract(\"javascript:goToTab(\", \");\"));\r\n if (tab < 1 || tab > 9) return -1;\r\n return tab;\r\n } catch (ex) {\r\n return -1;\r\n }\r\n}", "function getActiveTab() {\n return lt.objs.tabs.active_tab();\n }", "function getCurrentTab() {\r\n\tif (tabArray.length > 0) {\r\n\t\treturn tabArray[tabArray.length - 1];\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n}", "function getCurrentTab(cb) {\n chrome.tabs.query({\n 'active': true,\n 'windowId': chrome.windows.WINDOW_ID_CURRENT\n }, function (tabs) {\n cb(tabs[0]);\n });\n}", "get tab() {\n var index = Application.activeWindow.activeTab.index;\n return new Tab(Application.activeWindow.tabs[index]);\n }", "function CurrentTab(func) {\n chrome.tabs.query({\n 'active': true,\n 'windowId': chrome.windows.WINDOW_ID_CURRENT\n },\n function (tabs) {\n if (tabs[0]) {\n func(tabs[0]);\n }\n });\n}", "function getCurrentTab(callback)\n\t\t{\n\t\t\tif (window.chrome && chrome.tabs)\n\t\t\t{\n\t\t\t\tchrome.tabs.query({ active: true, lastFocusedWindow: true}, function(tabs) { callback(tabs[0]); });\n\t\t\t}\n\t\t}", "function getActiveTab() {\n return $('.nav.nav-tabs .active')\n }", "get _tab( )\n\t{\n\t\tif (!this._valid) return(null);\n\n\t\tif (!(\"tab\" in this._ctx))\n\t\t{\n\t\t\tthis._ctx.tab = null;\n\n\t\t\tfor (var i = 0; i < gBrowser.mTabs.length; ++i)\n\t\t\t{\n\t\t\t\tif (gBrowser.mTabs[i].linkedBrowser == this._ctx.browser)\n\t\t\t\t{\n\t\t\t\t\tthis._ctx.tab = gBrowser.mTabs[i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn(this._ctx.tab);\n\t}", "function getActiveTab() {\n return browser.tabs.query({active: true, currentWindow: true});\n }", "getCurrentTabURL() {\n return this._queryCurrentTab().then(tab => tab.url);\n }", "function getCurrentTab () {\n return new Promise((resolve, reject) => {\n chrome.tabs.query({active: true, currentWindow: true}, tabs => {\n let tab = tabs[0];\n if (!tab || typeof tab.id === 'undefined' || (tab.url || '').startsWith('chrome://')) {\n reject('notAllowed');\n }\n resolve(tab);\n });\n });\n}", "function getCurrentTabUrl() {\n var queryInfo = {\n active: true,\n currentWindow: true\n };\n\n api.tabs.query(queryInfo, (tabs) => {\n if (tabs) {\n var tab = tabs[0];\n if (tab) {\n var url = tab.url;\n if (url) {\n currentTabUrl = url;\n }\n }\n }\n });\n}", "function getSelectedTabIndex()\r\n{\r\n return $('#tabs').tabs('option', 'active');\r\n}", "function getTabSelectedIndex()\n{\n\treturn $(\"#tabs\").tabs('option').active;\n}", "function getActiveTab() {\n return browser.tabs.query({currentWindow: true, active: true});\n}", "_currentTabBar() {\n const current = this._tracker.currentWidget;\n if (!current) {\n return null;\n }\n const title = current.title;\n const bars = this._dockPanel.tabBars();\n return find(bars, bar => bar.titles.indexOf(title) > -1) || null;\n }", "function whatTab() {\n var $this = $(this);\n var $tp = $('.tabbedPanels');\n return $tp.find('.tabs a.active').text(); \n}", "function getCurrentTabButtonId() {\n return $('#navbar .current').attr('id');\n }", "function getActiveTab() {\n return browser.tabs.query({ currentWindow: true, active: true })\n}", "function GetFirstTab() {\n return TabList[0];\n}", "function currentTab(){\r\n\tif (byId(\"tUnassigned\").style.display == \"block\") return 1;\r\n\telse return 2;\r\n}", "async function getCurrentTab() {\n \"use strict\";\n const queryInfo = {\n active: true,\n lastFocusedWindow: true\n };\n // New Syntax\n const tabs = await new Promise(resolve => chrome.tabs.query(queryInfo, tabs => resolve(tabs)))\n var currentTab = tabs[0];\n if (currentTab === undefined) {\n throw \"ERROR: Cannot get the current tab, it is not defined!\";\n } else {\n return currentTab;\n }\n}", "static queryActiveTab() {\r\n return Utils.queryTab({\r\n active: true,\r\n currentWindow: true,\r\n })\r\n }", "function findTab() {\n var tabs = browser.tabs.query({\n currentWindow: true,\n active: true\n })\n return tabs;\n}", "function getTab() {\n return new Promise(function(resolve) {\n chrome.tabs.query({\n active: true,\n currentWindow: true\n },\n function(tabs) {\n resolve(tabs[0])\n })\n })\n }", "get activeTab() {\n var _a;\n return (_a = this.getAttribute('active-tab')) !== null && _a !== void 0 ? _a : '';\n }", "async function getActiveTab() {\n\tlet tabs = await browser.tabs.query({currentWindow: true, active: true});\n\tfor (let tab of tabs) {\n\t\tif (tab.active) {\n\t\t\treturn tab;\n\t\t}\n\t}\n}", "get selectedTab() {\n let children = this.element.querySelectorAll('li.tab a');\n let index = -1;\n let href = null;\n [].forEach.call(children, (a, i) => {\n if (a.classList.contains('active')) {\n index = i;\n href = a.href;\n return;\n }\n });\n return { href, index };\n }", "function getActiveTab() {\n var wrapper = document.body.querySelector(\"fs-person-page\").shadowRoot;\n var tabs = [\"fs-tree-person-details\", \"fs-tree-person-sources\"];\n for (var i in tabs) {\n if (wrapper.querySelector(tabs[i]).classList.contains(\"iron-selected\")) {\n return tabs[i];\n }\n }\n return false;\n}", "function getCurrentTabUrl(callback){\n var queryInfo = {\n active: true,\n currentWindow: true\n };\n\n chrome.tabs.query(queryInfo, function(tabs){\n var tab = tabs[0];\n var url = tab.url;\n callback(url);\n });\n}", "function getCurrentTabUrl(callback) {\n\t// lots of queryInfo options -- this is how we restrict what tabs get returned\n\t// in the query callback. Select only the active tabs that are in the currentWindow.\n\tvar queryInfo = {\n\t\tactive: true,\n\t\tcurrentWindow: true\n\t};\n\tvar tab;\n\tvar url;\n\n\t// to access tab.url, you'll need either 'tab' or 'activeTab' permission set in your manifest file\n\tchrome.tabs.query(queryInfo, function (tabs) {\n\t\ttab = tabs[0];\n\t\turl = tab.url;\n\t\tcallback(url);\n\t});\n}", "function getCurrentTabUrl(callback) {\n var queryInfo = {\n \tactive: true,\n \tcurrentWindow: true\n };\n\n chrome.tabs.query(queryInfo, function(tabs) {\n var tab = tabs[0];\n var url = tab.url;\n callback(url);\n});\n}", "function doInCurrentTab(tabCallback) {\n browser.tabs.query(\n { currentWindow: true, active: true },\n function (tabArray) {tabCallback(tabArray[0]);}\n );\n}", "function getActiveLocation(){\n var tabIndex = $(\"#location_tabs\").tabs('option', 'active');\n switch(tabIndex){\n case 0: return $(\"#tab-one\").val();\n case 1: return $(\"#tab-two\").val();\n case 2: return $(\"#tab-three\").val();\n case 3: return $(\"#tab-four\").val();\n case 4: return $(\"#tab-five\").val();\n default: console.log(\"no active tab found\");\n return;\n }\n}", "_defaultTab() {\n return this.$tabContents.first().attr('id');\n }", "function doInCurrentTab(tabCallback) {\n chrome.tabs.query(\n { currentWindow: true, active: true },\n function (tabArray) { tabCallback(tabArray[0]);}\n );\n}", "function currentTabs(tabs) {\n var loc = tbr.localSession_;\n consoleDebugLog('Latest local tabs:\\n' + tabsToString(tabs));\n // Accept the new set of tabs\n loc.tabs = tabs;\n // Proceed with updated tabs in place.\n contFunc();\n }", "function getCurrentTabUrl(callback) {\n\tvar queryInfo = {\n\t\tactive: true,\n\t\tcurrentWindow: true\n\t};\n\n\tchrome.tabs.query(queryInfo, function(tabs) {\n\t\tvar url = tabs[0].url;\n\t\tconsole.assert(typeof url == 'string', 'tab.url should be a string');\n\t\tcallback(url);\n\t});\n}", "function getSpotifyCurrentTab(successFunction) {\n chrome.tabs.query({url: MAIN_URL}, successFunction);\n}", "function getCurrentTabUrl(callback) {\n var queryInfo = {\n active: true,\n currentWindow: true\n };\n\n // Query chrome's tabs to get the current tab url.\n chrome.tabs.query(queryInfo, function (tabs) {\n if (tabs instanceof Array) {\n if (tabs.length > 0) {\n var tab = tabs[0];\n var url = tab.url;\n\n console.log(\"Current tab URL : \" + url);\n\n callback(url);\n }\n }\n })\n}", "function _sendMsgCurrentTab( successCallback ) {\n chrome.tabs.query( { active: true, currentWindow: true }, function( tabs ) {\n successCallback( tabs[ 0 ].id );\n });\n }", "function onGetWindow(win)\n{\n chrome.tabs.getSelected(win.id, onGetTab); \n}", "function getActiveTab(var nameOfPage){\n\tif(nameOfPage.equals(\"home\")){\n\t\thome.className = home.className + \" active\"\n\t}else if(nameOfPage.equals(\"repo\")){\n\t\trepos.className = repos.className + \" active\"\n\t}\n}", "function getCurrentPage() {\n\n\t// Gets the URL of the current page\n\tvar link_url = document.URL;\n\t// splits on '/'\n\tvar temp = link_url.split('/');\n\n\t// gets the page label || need to check when live\n\tvar currentPage = temp[3];\n\n\treturn currentPage;\n}", "function getActiveTabName() {\n if(document.getElementsByClassName(\"activeTab\").length === 0) {\n return \"\";\n }\n //Returns the second class name\n return document.getElementsByClassName(\"activeTab\")[0].className.split(' ')[1];\n}", "currentPageSelect(activeTab, displayTab) {\r\n if (displayTab === activeTab) {\r\n return \"selected tab-button\";\r\n } else return \"not-selected tab-button\";\r\n }", "function getNextTab() {\n\t\treturn $(\".form-nav a.active\").parent().closest('li').next().children().first().attr('href');\n\t}", "function updateCurrentTab(data) {\n return {\n type: _constants.UPDATE_CURRENT_TAB,\n data: data\n };\n}", "function getActiveTabId(e) {\n\t\tvar query = { active: true, currentWindow: true };\n\t\tfunction callback(tabs) {\n\t\t\tvar tab = tabs[0];\n\t\t\te(tab);\n\t\t\treturn tabs[0];\n\t\t}\n\t\tchrome.tabs.query(query, callback);\n\t}", "function refreshCurrentTab()\n{\n jsobj.swap_tabs(XPCNativeWrapper.unwrap($(\"tabs\")).down(\".tabon\").getAttribute(\"val\"));\n}", "function getSelectedTab(tabs) {\n const childId = window.location.hash.split(\"=\")[1];\n return tabs.find((tab) => tab.actor.includes(childId));\n}", "function getTabs(){\n return tabs;\n }", "getCurrentIndexTabControl(target) {\n let ele;\n let cindex = 0;\n let currentIndex = -1;\n const tabsControl = this.getElementsBySelector(this.selectorTabsControl);\n const tabs = this.getArrayFromNodeList(tabsControl);\n tabs.map(tabControl => {\n ele = tabControl.querySelector(TAB_TITLE_CLASS);\n if (ele.isEqualNode(target)) {\n currentIndex = cindex;\n }\n cindex = cindex + 1;\n });\n return currentIndex;\n }", "function submitCurrentTab() {\n console.log('submitCurrentTab!');\n chrome.windows.getCurrent(function(win){\n chrome.tabs.getSelected(win.id, function(tab){\n var submit_url = \"https://news.ycombinator.com/submitlink?u=\" + encodeURIComponent(tab.url) + \"&t=\" + encodeURIComponent(tab.title);\n openUrl(submit_url, true);\n });\n });\n}", "function GetNextTab() {\n let currentTab = GetCurrentTab();\n return TabList[($.inArray(currentTab, TabList) + 1) % TabList.length];\n}", "get parent() {\n for each (win in Application.windows) {\n for each (tab in win.tabs) {\n if (tab._browser._id == this.id) {\n return win;\n }\n }\n }\n return null;\n }", "_firstAvailable () {\n\t\tfor (var index = 0, l = this._tabs.length; index < l; index++) {\n\t\t\tif (_.isObject(this._tabs[index])) return this._tabs[index];\n\t\t}\n\t\treturn {};\n\t}", "function getTabPane(menuItem){\r\n\treturn $(menuItem).closest(\".tab-pane\");\r\n}", "function refreshCurrentUrl(){\n chrome.tabs.getSelected(null,function(tab) {\n currentUrl = tab.url;\n });\n}", "function findActiveTab() {\n\n //get information about this tab\n chrome.tabs.query({ active: true, status: \"complete\", lastFocusedWindow: true }, function (tabs) {\n\n //we may have more than one result if the tab has dev tools open\n tabs.forEach(function (tab) {\n\n setActiveTabIfValidUrl(tab);\n\n });\n\n });\n\n}", "function GetPreviousTab() {\n let currentTab = GetCurrentTab();\n return TabList[($.inArray(currentTab, TabList) - 1 + TabList.length) % TabList.length];\n}", "function checkCurrentTab(tab, useDefault) {\n\t\t\tconst providerData = getProviderData(icon.provider);\n\t\t\tconst tree = providerData.tree;\n\n\t\t\tif (typeof tab === \"string\") {\n\t\t\t\tfor (let parentIndex = 0; parentIndex < tree.length; parentIndex++) {\n\t\t\t\t\tconst parent = tree[parentIndex];\n\n\t\t\t\t\tif (parent.mode === tab || parent.tab === tab) {\n\t\t\t\t\t\tif (parent.children) {\n\t\t\t\t\t\t\t// Has children: return first child\n\t\t\t\t\t\t\tconst child = parent.children[0];\n\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\ttab: child.mode,\n\t\t\t\t\t\t\t\tparent,\n\t\t\t\t\t\t\t\tparentIndex,\n\t\t\t\t\t\t\t\tchild\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// No children, must have mode\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttab: parent.mode,\n\t\t\t\t\t\t\tparent,\n\t\t\t\t\t\t\tparentIndex,\n\t\t\t\t\t\t\tchild: null\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check children\n\t\t\t\t\tif (parent.children) {\n\t\t\t\t\t\tfor (let j = 0; j < parent.children.length; j++) {\n\t\t\t\t\t\t\tconst child = parent.children[j];\n\n\t\t\t\t\t\t\tif (child.mode === tab) {\n\t\t\t\t\t\t\t\treturn { tab, parent, parentIndex, child };\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\n\t\t\t// No match: use first item\n\t\t\tif (useDefault) {\n\t\t\t\tconst parent = tree[0];\n\n\t\t\t\tif (!parent) {\n\t\t\t\t\t// No modes available\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttab: \"\",\n\t\t\t\t\t\tparent: null,\n\t\t\t\t\t\tparentIndex: 0,\n\t\t\t\t\t\tchild: null\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (parent.children) {\n\t\t\t\t\t// Has child items: use first item\n\t\t\t\t\tconst child = parent.children[0];\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttab: child.mode,\n\t\t\t\t\t\tparent,\n\t\t\t\t\t\tparentIndex: 0,\n\t\t\t\t\t\tchild\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Tab without children\n\t\t\t\treturn {\n\t\t\t\t\ttab: parent.mode,\n\t\t\t\t\tparent,\n\t\t\t\t\tparentIndex: 0,\n\t\t\t\t\tchild: null\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttab: \"\",\n\t\t\t\tparent: null,\n\t\t\t\tparentIndex: 0,\n\t\t\t\tchild: null\n\t\t\t};\n\t\t}", "select(tab) {\n const alreadySelected = this.outlet.getActiveStackId() === tab;\n const tabRootUrl = `${this.outlet.tabsPrefix}/${tab}`;\n if (alreadySelected) {\n const activeStackId = this.outlet.getActiveStackId();\n const activeView = this.outlet.getLastRouteView(activeStackId);\n // If on root tab, do not navigate to root tab again\n if (activeView.url === tabRootUrl) {\n return;\n }\n const rootView = this.outlet.getRootView(tab);\n const navigationExtras = rootView && tabRootUrl === rootView.url && rootView.savedExtras;\n return this.navCtrl.navigateRoot(tabRootUrl, Object.assign({}, (navigationExtras), { animated: true, animationDirection: 'back' }));\n }\n else {\n const lastRoute = this.outlet.getLastRouteView(tab);\n /**\n * If there is a lastRoute, goto that, otherwise goto the fallback url of the\n * selected tab\n */\n const url = lastRoute && lastRoute.url || tabRootUrl;\n const navigationExtras = lastRoute && lastRoute.savedExtras;\n return this.navCtrl.navigateRoot(url, Object.assign({}, (navigationExtras), { animated: true, animationDirection: 'back' }));\n }\n }", "function GetLastTab() {\n return TabList[TabList.length - 1];\n}", "loadOneTab() { }", "function getActiveFile() {\n var active = getActiveTab();\n if(!active) {\n return false;\n }\n return lt.objs.tabs.__GT_path(active);\n }", "function tabs () {\n\treturn 'foo'\n}", "function getPrevTab() {\n\t\treturn\t$(\".form-nav a.active\").parent().closest('li').prev().children().first().attr('href') ? \n\t\t\t\t$(\".form-nav a.active\").parent().closest('li').prev().children().first().attr('href') :\n\t\t\t\t$(\".form-nav a.active\").parent().siblings().last().children().first().attr('href');\n\t}", "function withTab(f) {\n chrome.tabs.query({ active: true, currentWindow: true }, tabs => {\n f(tabs[0]);\n });\n}", "function getTabTitle()/*:String*/ {\n return this.currentTabTitle$hWxS;\n }", "function listingo_appointment_tabs(current) {\n //Tab Items\n jQuery('.tg-navdocappointment li').removeClass('active');\n var _navitems = jQuery(\".tg-navdocappointment li\");\n _navitems.each(function (index, li) {\n if (parseInt(index) < parseInt(current)) {\n jQuery(this).addClass('active');\n }\n });\n\n //Tab Contents\n jQuery('.tg-appointmenttabcontent .tab-pane').hide();\n\n if (current == 1) {\n jQuery('.tg-appointmenttabcontent .step-one-contents').show();\n } else if (current == 2) {\n jQuery('.tg-appointmenttabcontent .step-two-contents').show();\n } else if (current == 3) {\n jQuery('.tg-appointmenttabcontent .step-three-contents').show();\n } else if (current == 4) {\n jQuery('.tg-appointmenttabcontent .step-four-contents').show();\n } else if (current == 5) {\n jQuery('.tg-appointmenttabcontent .step-five-contents').show();\n }\n\n}", "function getSelectedSubtab() {\n\n var selected = false;\n\n subtabs.each(function (subtab) {\n if ($(subtab.linkId).hasClassName(\"selected\")) { selected = subtab.linkName; }\n });\n\n //didn't find a selected subtab, so select by transaction.\n if (!selected) {\n selected = \"learningCurve\"\n selectSubtab(\"learningCurve\");\n }\n\n return selected;\n}", "function chooseTab() {\n // console.debug( \"pfFunctions.js:chooseTab\" );\n // see if the showTab variable points to tab that actually exists in\n // the page\n if( ! ( showTab === undefined ) && $(showTab) ) {\n // console.debug( \"chooseTab: using param setting: \" + showTab );\n\n // yes; show that tab\n show( showTab );\n\n } else {\n // console.debug( \"chooseTab: no param setting; checking cookie\" );\n \n // no; see if there's a cookie to tell us the last tab\n var cookieTab = readCookie( \"lastTab\" );\n // console.debug( \"cookieTab: |\" + cookieTab + \"|\" );\n\n if( cookieTab && $(cookieTab) ) {\n // console.debug( \"chooseTab: found a cookie; switching to |\" + cookieTab + \"|\" );\n \n // yes; show that tab\n show( cookieTab );\n } else {\n // console.debug( \"chooseTab: no cookie switching to default\" );\n\n // no; get the first block in the page and show that instead\n var block = document.getElementsByClassName( \"block\" )[0];\n if( block && block.id ) {\n show( block.id );\n }\n }\n }\n}", "function BackTab(JCurTab, JNewTab, BSObject, parameters) {\n\n\n //if there is no next, then we know we just clicked submit button, otherwise which tab is active\n\n if (JCurTab.classList.contains(\"nav-link\") && JNewTab != null) {\n JCurTab.classList.remove(\"active\");\n JNewTab.className += \" active\";\n\n // now change which tab content is visible\n var JCurTabContent = BSObject.querySelector('.tab-pane.active');\n\n var nextContent = getPreviousSibling(JCurTabContent);\n JCurTabContent.classList.remove(\"active\");\n JCurTabContent.classList.remove(\"show\");\n nextContent.className += \" active\";\n nextContent.className += \" show\";\n\n console.log(\"call anim from back tab\");\n //animate the transition\n JAnimate(JCurTab, JNewTab, BSObject, parameters);\n\n\n // check tab status 1= first, 2 = middle, 3 = end, 13 = first and end\n var isPrev = 0;\n isPrev = CheckTabLocation(JNewTab, BSObject, parameters);\n if (isPrev == 1 || isPrev == 13) {\n //We are on te first tab, if we care to identify it\n //console.log(\"FIRST TAB: \"+isPrev);\n }\n\n } else {\n // console.log(\"CLICKED FIRST\");\n CheckTabLocation(JNewTab, BSObject, parameters);\n }\n\n}", "function updateActiveTab () {\n let gettingActiveTab = browser.tabs.query({active: true, currentWindow: true})\n gettingActiveTab.then(updateTab, onError)\n}", "function getCurrentURL() {\n\treturn window.location;\n\t//return the url of the current page\n}", "function getParentTab(el) {\r\n\t'use strict';\r\n\r\n\twhile (el !== null && !el.className.match(/(?:^|\\s)tab(?!\\S)/)) {\r\n\t\tel = el.parentNode;\r\n\t}\r\n\treturn el;\r\n}", "currentTabData() {\n const {activeTab} = this.state;\n if (activeTab === WEEK) {\n return this.state.weekData;\n } else if (activeTab === MONTH) {\n return this.state.monthData;\n } else if (activeTab === YEAR) {\n return this.state.yearData;\n }\n }", "function currentTabs(tabs) {\n var loc = tbr.localSession_;\n consoleDebugLog('HAD local tabs:\\n' + tabsToString(loc.tabs));\n consoleDebugLog('GOT local tabs:\\n' + tabsToString(tabs));\n // Accept the new set of tabs\n loc.tabs = tabs;\n // if this is local session initialization, make generation = 0\n if (loc.generation < 0) {\n loc.generation = 0;\n }\n // Touch the session to update timestamp and generation.\n loc.touch();\n // For first-time init, we go init remote session now.\n if (!tbr.initialized_) {\n // Continue initialization by fetching remote storage.\n chrome.storage.sync.get(null, tbr.onStorageGet);\n } else { // after normal update go sync\n // Update status and session states. Note that this path can happen during\n // post-init syncing\n tbr.doSync_();\n }\n }", "function onclickForTab(event)\n{\n //to prevent URL from changing and browse history building up\n event.preventDefault();\n \n //-------tab display logic---\n var lastTab = document.querySelector('li.current a');\n \n //NOP if clicking current tab again\n if(lastTab == this)\n {\n return false;\n }\n \n lastTab.parentNode.className = ''; //undisplay\n \n this.parentNode.className = 'current';\n //---------------------------\n \n //-----content div display logic---\n var lastDiv = document.querySelector('div.current');\n lastDiv.className = ''; //undisplay\n \n var matchingDiv = this.getAttribute('data-div-id');\n \n var thisDiv = document.getElementById(matchingDiv);\n \n thisDiv.className = 'current';\n //-----------\n \n //get tab div id from tab link\n var divId = this.getAttribute('data-div-id');\n \n onclickForNamedTab(divId);\n}", "function prevTab(currentTab) {\n \"use strict\";\n //SE ? LA SECONDA TAB NASCONDILA E MOSTRA LA PRIMA\n if (currentTab === 1) {\n document.getElementById(\"tab_1\").className = \"container hidden\";\n document.getElementById(\"tab_0\").className = \"container\";\n }\n //SE E' LA TERZA TAB, NASCONDILA E MOSTRA LA SECONDA\n if (currentTab === 2) {\n document.getElementById(\"tab_2\").className = \"container hidden\";\n document.getElementById(\"tab_1\").className = \"container\";\n }\n //SE E' LA QUARTA TAB, NASCONDILA E MOSTRA LA TERZA\n if (currentTab === 3) {\n document.getElementById(\"tab_3\").className = \"container hidden\";\n document.getElementById(\"tab_2\").className = \"container\";\n }\n}", "function getTab(callback) {\n\tlet tab;\n\tchrome.tabs.getAllInWindow(null, (tabs) => {\n\t\tlet tabsFiltered = tabs.filter(tab => tab.url === 'http://localhost:8080/');\n\t\tif (tabsFiltered.length) {\n\t\t\tcallback(tabsFiltered[0]);\n\t\t\treturn;\n\t\t} else {\n\t\t\ttabsFiltered = tabs.filter(tab => tab.url === 'https://audius.rockdapus.org/');\n\t\t\tif (tabsFiltered.length) {\n\t\t\t\tcallback(tabsFiltered[0]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tcallback();\n\t});\n}", "getCurrent() \r\n\t{\r\n\t\treturn this.current;\r\n\t}", "get isCurrentTabActive() {\n const { mainRouter: { routes: mainRoutes }, tabId, variant } = this.props;\n const { index: mainIndex, routes: tabNavRoutes } = _.find(mainRoutes, { routeName: ROOT_ROUTES.MAIN });\n\n if (variant === OVERALL_SCHEDULES) {\n if (mainIndex !== OVERALL_SCHEDULES_INDEX || tabNavRoutes == null) return false;\n\n const { routes: tabRoutes } = tabNavRoutes[mainIndex];\n const { index } = tabRoutes[0];\n return tabId === index;\n }\n \n if (variant === MY_SESSIONS) {\n if (mainIndex !== MY_SESSIONS_INDEX || tabNavRoutes == null) return false;\n \n const { routes: tabRoutes } = tabNavRoutes[mainIndex];\n const { index } = tabRoutes[0];\n return tabId === [UPCOMING, PAST][index];\n }\n\n if (variant === STUDIO_SCHEDULES) {\n const { index } = _.find(mainRoutes, { routeName: STUDIO_SCHEDULES }) || {};\n return tabId === index;\n }\n\n return false;\n }", "_current() {\n return this._history[this.index];\n }", "function openTab(tabName) {\n //todo\n}", "function checkCurrentTab() {\n\tchrome.tabs.query({\"active\": true, \"currentWindow\": true, \"windowType\": \"normal\"}, tabs => {\n\t\tvar tab = tabs[0];\n\n\t\t// popup/devTools windows ran result in null tab variable\n\t\tif (!tab) { return; }\n\n\t\t// get current URL\n\t\tvar currentURL = tab.url; \n\t\tconsole.log('Updating state from URL: ' + currentURL);\n\t\tchrome.storage.local.set({'url': currentURL});\n\n\t\t// check if URL matches a refugee need\n\t\tvar match = isMatch(currentURL);\n\t\t// update chrome.storage.local.isMatch\n\t\tchrome.storage.local.set({'isMatch': match});\n\t\t// update notification badge\n\t\tchrome.browserAction.setBadgeText({ text: match ? '1' : ''});\n\t});\n}", "getDefaultTabElement() {\n if (!this.defaultTabElement) {\n this.setDefaultTabElement();\n }\n return this.verticalContentPosition !== 'accordion' ? this.defaultTabElement : undefined;\n }", "function prevTab() {\n\tvar query = {\n\t\tcurrentWindow: true,\n\t\thidden: false,\n\t};\n\tif (skiploading) query['status'] = 'complete';\n\tif (skipdiscarded) query['discarded'] = false;\n\tbrowser.tabs.query(query).then(tabs => {\n\t\tlet current = tabs.findIndex(tab => tab.active);\n\t\tlet prev = current - 1;\n\t\twhile (true) {\n\t\t\t// before the first tab?\n\t\t\tif (prev < 0) {\n\t\t\t\tif (!wrap) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tprev = tabs.length - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// lapped all the way around\n\t\t\tif (prev == current) return true;\n\t\t\t// skip urls\n\t\t\tif (skipurls.indexOf(tabs[prev].url) > -1) {\n\t\t\t\tprev--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// if we get here, we have a tab to switch to\n\t\t\tbreak;\n\t\t}\n\t\tbrowser.tabs.sendMessage(tabs[prev].id, {\n\t\t\ttopic: 'scrolledToTab'\n\t\t}).catch (error => {});\n\t\tbrowser.tabs.update(tabs[prev].id, {\n\t\t\tactive: true\n\t\t});\n\t\treturn true;\n\t});\n}", "function lastView(){\n let display = document.getElementsByClassName(\"tab-pane\");\n display[currentTab].style.display = \"none\";\n showTab(lastTab);\n currentTab = lastTab;\n lastTab = lastTab - 1;\n}", "function getCurrentForm()\n {\n if ( current() !== false) {\n return forms[current()];\n } else {\n return false;\n }\n }", "function tab(tab) {\n\tif ($.inArray(tab, availableTabs) == -1) {\n\t\tconsole.log(\"invalid tab. Please update your available tabs\");\n\t} else {\n\t\tvar arrayLength = availableTabs.length;\n\t\tfor (var i = 0; i < arrayLength; i++) {\n\t\t\t//maybe have problems where tab doesn't exist\n\t\t $(\"#\"+availableTabs[i] + 'Content').hide(); \n\t\t $(\"#\"+availableTabs[i] + 'Content').css({'class': ''});\n\t\t $(\"#\"+availableTabs[i]).css({'background': 'rgb(0, 45, 60)'});\n\t\t}\n\t\t$(\"#\" + tab + 'Content').show();\n\t\t$(\"#\" + tab + 'Content').css({'class': 'active'});\n\t\tactiveTab = tab;\n\t\t$(\"#\" + tab).css({'background': 'rgb(67, 153, 152)'});\n\t\tif ($.inArray(tab, loadedTabs) == -1) {\n\t\t\tloadTab(activeTab);\n\t\t}\n\t\tif (window.mobilecheck()) {\n\t\t\tlayoutMobileMasonry(activeTab + 'Grid');\n\t\t} else {\n\t\t\tlayoutMasonry(activeTab + 'Grid');\n\t\t}\n\t}\n}", "function getCurrentTabUrl(callback) {\n\n var queryInfo = {\n active: true,\n currentWindow: true\n };\n\n chrome.tabs.query(queryInfo, (tabs) => {\n\n var tab = tabs[0];\n\n var url = tab.url;\n\n console.assert(typeof url == 'string', 'tab.url should be a string');\n var urls = new URL(tab.url);\n var domain = urls.hostname;\n callback(url,domain);\n });\n}", "get overviewTab() {return browser.element(\"~Overview\");}" ]
[ "0.86921525", "0.86921525", "0.86921525", "0.85274065", "0.8011118", "0.7959443", "0.792258", "0.7772033", "0.77215374", "0.7521333", "0.7488247", "0.74814713", "0.7398076", "0.73719704", "0.736675", "0.7289245", "0.7244673", "0.724271", "0.72346973", "0.72335786", "0.7228042", "0.72138536", "0.71798533", "0.7178084", "0.71281993", "0.7106748", "0.70281476", "0.70143294", "0.7012749", "0.6888811", "0.68609387", "0.6857965", "0.6847523", "0.6829481", "0.6739366", "0.6667926", "0.6658343", "0.6635943", "0.66209507", "0.6610383", "0.65922695", "0.6547839", "0.6538022", "0.65291744", "0.65265465", "0.64829504", "0.6445847", "0.6442554", "0.6405728", "0.6372737", "0.63700235", "0.6327517", "0.6251972", "0.62314755", "0.6207926", "0.62072086", "0.6203208", "0.6184222", "0.616655", "0.6151727", "0.6151149", "0.6148606", "0.6122196", "0.6096005", "0.6090335", "0.60896933", "0.60880125", "0.60769105", "0.6066625", "0.60432917", "0.60335046", "0.6028866", "0.60100585", "0.59765255", "0.5969341", "0.5957509", "0.59513044", "0.5945708", "0.59434944", "0.59089184", "0.5906181", "0.5901711", "0.58651716", "0.585496", "0.5848581", "0.584336", "0.5840019", "0.5827514", "0.5822542", "0.58087", "0.58072513", "0.58040893", "0.57987607", "0.57902414", "0.57878476", "0.5763248", "0.5760553", "0.5755351", "0.5751449", "0.57365024" ]
0.6694273
35
Event listener for key press
function keyPressed() { if (keyCode === 32) { // Space key if (!isFalling) { itsRaining.play() } else {maspeek.play()} isFalling = !isFalling; // Toggle raindrop falling state } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keyPressed() {\n}", "HandleKeyDown(event) {}", "function onKeyDown(event) {\n}", "keyDown(_keycode) {}", "function keyListener(e) {\n // check which element fired the function\n let number = null;\n if($(e.target).is('button')) {\n number = $(e.target).html();\n } else {\n number = e.key;\n }\n\n if ((playing || messing) && visuals[number]) {\n const key = visuals[number];\n const skey = number;\n visualise(key);\n userSequence.push(parseInt(number));\n $numberDisplay.removeClass('hiddener');\n $numberDisplay.html(skey);\n setTimeout(hideKey, 500);\n compareArrays();\n }\n }", "function pressKey(event) {\n currentKey = event.which;\n}", "function handleKeyDown(event) {\n wgl.listOfPressedKeys[event.keyCode] = true;\n // console.log(\"keydown - keyCode=%d, charCode=%d\", event.keyCode, event.charCode);\n }", "function canvasHandleKeyDown(e){\r\n\tvar key = e.keyCode;\r\n\t//println(key);\r\n\tif(useStates){\r\n\t\tStates.current().input.handleKeyDown(e);\r\n\t}\r\n\tgInput.handleKeyDown(e);\r\n}", "function onKeyDown(e) {\n // do not handle key events when not in input mode\n if (!imode) {\n return;\n }\n\n // only handle special keys here\n specialKey(e);\n }", "function keyDown(e) {\n keyPress[e.key] = true;\n}", "function keyPressed() {\n if (handler.active === handler.nameplate) {\n doorbell.keyPressed();\n }\n}", "function keyPressed(event) {\n const digits = \"0123456789\";\n const operators = \"+-x*/\";\n if (digits.indexOf(event.key) !== -1) {\n digitPressed(event.key);\n } else if (operators.indexOf(event.key) !== -1) {\n operatorPressed(event.key);\n } else if (event.key === \"=\" || event.key === \"Enter\") {\n computeResult();\n } else if (event.key === \"c\" || event.key === \"C\") {\n clearDisplay();\n } else if (event.key === \".\") {\n addDecimal();\n } else if (event.key === \"m\" || event.key === \"M\") {\n flipSign();\n } else if (event.key === \"Backspace\") {\n deleteLastDigit();\n }\n}", "function cust_KeyDown(evnt) {\n //f_log(evnt.keyCode)\n}", "function keyReleased() {\n\n}", "handleKeyDown (event) {\n }", "function keypressListener() {\n if (event.key === 's' || event.key === 'S') { \n players[0].rideDown();\n\n } else if (event.key === 'k' || event.key === 'K') {\n players[1].rideDown();\n } else {\n console.log('you pressed the wrong key');\n console.log(event);\n console.log(event.key);\n }\n }", "onElementKeyPress(event) {}", "onElementKeyPress(event) {}", "function onKeyPress(event) {\n\t\n\tswitch (event.key) {\n\t\t\n\t\t// Light Keys\n\t\tcase \"ArrowDown\":\n\t\tcase \"ArrowUp\":\n\t\tcase \"ArrowRight\":\n\t\tcase \"ArrowLeft\":\n\t\tcase \"+\":\n\t\tcase \"-\":\n\t\t\tlightEventHandler(event);\n\t\t\tbreak;\n\n\t\t// Camera keys\n\t\tcase \"w\":\n\t\tcase \"s\":\n\t\tcase \"d\":\n\t\tcase \"a\":\n\t\tcase \"q\":\n\t\tcase \"e\":\n\t\t\tSC.keyPress(event); // pass the listener event to the camera (Required for SphericalCamera Module)\n\t\t\tupdateMVP(); // re-generate the MVP matrix and update it\n\t\t\tbreak;\n\t}\n\n\trender(); // draw with the new view\n}", "function keyPressed(){\n\tgameManager.keyPressed();\n}", "function onKeyPress(e) {\n const pressed = e.keyCode;\n\n switch(pressed) {\n case 82: // R\n handleRestart();\n break;\n case 83: // S\n handleStartMenu();\n break;\n case 27:\n // Esc\n handlePause();\n break;\n }\n}", "handleKeyPress(kEvent) {\n switch (kEvent.keyCode) {\n case Phaser.KeyCode.BACKSPACE:\n this.deleteChar();\n break;\n case Phaser.KeyCode.LEFT:\n case Phaser.KeyCode.RIGHT:\n case Phaser.KeyCode.UP:\n case Phaser.KeyCode.DOWN:\n console.warn('CMD NAV NOT IMPLEMENTED');\n break;\n case Phaser.KeyCode.SPACEBAR:\n this.addTextToCommand(' ');\n break;\n case Phaser.KeyCode.ENTER:\n this.submitCommand();\n break;\n case Phaser.KeyCode.TAB:\n console.warn('CMD AUTOCOMPLETE NOT IMPLEMENTED');\n break;\n default:\n this.addTextToCommand(kEvent);\n break;\n }\n }", "function keyDownHandler(event) {\n keyHandler(true, event);\n}", "function handleKey(event) { //function to create input when key is pressed\n\t\tvar pressedKey = event.key;\n\t\tmakeSound(pressedKey);\n\t\tbuttonAnimation(pressedKey);\n\t\tsetTimeout(buttonAnimation,500);\n\t\t// console.log(pressedKey);\n}", "function keyHandler(e){\n\tvar keyCode = String(e.keyCode);\n\tupdateScore(keyCode);\n\tvar p1 = d.getElementById(\"keypressed\");\n\t//p1.innerHTML = e.keyCode;\n\tvar track = map_key_track[keyCode];\n \tstaticCircles.playedNote(track, new Date().getTime());\n \tplaySound(track);\n\t\n}", "function keyEvent(event) {\n console.log(\"KEY: \" + event.name + \"=\" + event.isPressed);\n if (event.name == 'UP'){\n\t\tactivesensor = 'T';\n\t\tled.sync.showMessage(activesensor);\n\t} else if (event.name == 'LEFT'){\n\t\tactivesensor = 'P';\n\t\tled.sync.showMessage(activesensor);\n\t} else if (event.name == 'RIGHT'){\n\t\tactivesensor = 'H';\n\t\tled.sync.showMessage(activesensor);\n\t}\n}", "function enableKeyPress() {\n // Add event listener for keyboard press events to the canvas\n window.addEventListener(\"keydown\", function (evt) {\n connectedGame.keyPressEvent(evt);\n }, false);\n }", "function onkey(event) {\n\n if (!(event.metaKey || event.altKey || event.ctrlKey)) {\n event.preventDefault();\n }\n\n if (event.charCode == 'z'.charCodeAt(0)) { // z\n controls.zeroSensor();\n } else if (event.charCode == 'f'.charCodeAt(0)) { // f\n effect.setFullScreen( true );\n } else if (event.charCode == 'w'.charCodeAt(0)) { // w - move a row up\n animator.changeRow( -1 );\n currentRow -= 1;\n } else if (event.charCode == 's'.charCodeAt(0)) { // s - move a row down\n animator.changeRow( 1 );\n currentRow += 1;\n } else if (event.charCode == 'a'.charCodeAt(0)) { // a - spin row left\n animator.spinRow( -1 );\n } else if (event.charCode == 'd'.charCodeAt(0)) { // d - spin row right\n animator.spinRow( 1 );\n }\n}", "function keyup_handler(event)\n{\n\tgame.handle_key(event.code, false);\n}", "function handleKeyDown(event) {\r\n // storing the pressed state for individual key\r\n currentlyPressedKeys[event.keyCode] = true;\r\n}", "function keydown(event) {\n keys[event.code] = event;\n }", "keyUp(_keycode) {}", "function keyPressDown(event){\n\n let key = (96 <= event.keyCode && event.keyCode <= 105)? event.keyCode - 48 : event.keyCode;\n if(key >= 16 && key <= 18){\n\n if(pressedModifiers.indexOf(key) === -1){\n\n pressedModifiers.push(key);\n }\n if(event.data && event.data.modifierFunc){\n\n event.data.modifierFunc(event);\n }\n\n } else {\n\n if(event.data && event.data.keyFunc){\n\n event.data.keyFunc(event);\n }\n }\n if(event.data && event.data.func){\n\n event.data.func(event);\n }\n for (var handler in waitingForInput) {\n if (waitingForInput.hasOwnProperty(handler)) {\n waitingForInput[handler](event);\n }\n }\n\n}", "keypressInput(e) {\n // console.log(e);\n let keycode = event.key; // also for cross-browser compatible\n (this.acceptMoves) && this.ea.publish('keyPressed', keycode);\n }", "onKeyPressed(event){\n switch(event.keyCode){\n case 13: /** ENTER */\n this.command.state = this.command.stateFactory.getFinalizeState(this.command);\n this.command.state.onEpsilon();\n break;\n case 27: /** ESCAPE */\n this.command.state = this.command.stateFactory.getIdleState(this.command);\n break;\n }\n }", "function keyPressed() {\n if (gameView == VIEW_GAME) {\n //Ingame\n if (keyCode == UP_ARROW) {\n console.log(\"up\")\n }\n if (keyCode == DOWN_ARROW) {\n console.log(\"down\")\n }\n if (keyCode == LEFT_ARROW) {\n console.log(\"left\")\n }\n if (keyCode == RIGHT_ARROW) {\n console.log(\"right\")\n }\n if (key == ' ') {\n console.log(\"Space\");\n shakeTimer = 0.1;\n }\n\n if (key == 'p') {\n console.log(\"Pressed P key\")\n submitScore();\n }\n\n if (key == 'e') {\n console.log(\"Pressed E key\")\n\n spawnExplosion(camera.mouseX, camera.mouseY, 3);\n }\n }\n\n\n if (keyCode == ESCAPE) {\n gameView = VIEW_MAIN_MENU;\n }\n}", "function keyboardListener() {\n\tdocument.addEventListener('keydown', (ev) => {\n\t\tconst key = parseInt(ev.key);\n\t\tif(!isNaN(key)) {\n\t\t\tsetValue(key);\n\t\t}\n\t})\n}", "function handlerUserInput() {\n\tdocument.addEventListener('keyup', function(event) {\n\t\tconsole.log(event);\n\t\tconsole.log(event.key); //k\n\t});\n}", "function keyIsDown(event) {\n keyPressed[event.keyCode] = true;\n}", "function keyDown(event) {\r\n keyboard[event.keyCode] = true;\r\n}", "function keyPressed() {\n // toggle fullscreen mode\n if( key === 'f') {\n fs = fullscreen();\n fullscreen(!fs);\n return;\n }\n\n // dispatch all keys to adventure manager\n adventureManager.keyPressed(key); \n}", "function keyPressed() {\n // toggle fullscreen mode\n if( key === 'f') {\n fs = fullscreen();\n fullscreen(!fs);\n return;\n }\n\n // dispatch all keys to adventure manager\n adventureManager.keyPressed(key); \n}", "function keydown() {\n switch (d3.event.keyCode) {\n case 8: // backspace\n {\n break;\n }\n case 46: { // delete\n delete_node = true;\n break;\n }\n case 16: { //shift\n should_modify = true;\n break;\n }\n case 17: { //control\n drawing_line = true;\n }\n\n }\n}", "function computeKey(event){\n if(event.code == 'KeyV')\n scene.changeActiveCamera();\n else if(event.code == 'Space' && !scene.endedGame) //barra espaciadora\n scene.pauseGame();\n else if(!scene.pausedGame)\n scene.computeKey(event);\n}", "keyPressed({keyPressed, keyCode}){\n console.log('keypressed, keycode', keyPressed, keyCode);\n if(keyCode === 70){ //f\n requestFullScreen();\n return;\n }\n if(keyCode === 80){ //p\n requestPointerLock();\n return;\n }\n let key = keyCode + '';\n this.keysCurrentlyPressed[key] = {keyPressed, keyCode, clock:new Clock()};\n }", "function canvasHandleKeyPress(e){\r\n\tvar key = e.which;\r\n\tif(useStates){\r\n\t\tStates.current().input.handleKeyPress(e);\r\n\t}\r\n\tgInput.handleKeyPress(e);\r\n}", "function key() { }", "function keyPressed() {\n\t// toggle fullscreen mode\n\tif( key === 'f') {\n\t\tfs = fullscreen();\n\t\tfullscreen(!fs);\n\t\treturn;\n\t}\n\n\t// dispatch key events for adventure manager to move from state to \n\tadventureManager.keyPressed(key); \n}", "function keyDown(event){\n\tkeyboard[event.keyCode] = true;\n}", "onKeyPressed(keyCode, event) {\n switch (keyCode) {\n case cc.KEY.a:\n case cc.KEY.left:\n self.accLeft = true;\n self.accRight = false;\n break;\n case cc.KEY.d:\n case cc.KEY.right:\n self.accLeft = false;\n self.accRight = true;\n break;\n }\n }", "keyDown(event) {\n var keyCode = event.which || event.keyCode;\n this.activeCommands[keyCode] = true;\n }", "keyDown(event) {\n var keyCode = event.which || event.keyCode;\n this.activeCommands[keyCode] = true;\n }", "handleInput(keycode) {\n if (keycode !== undefined && player.moves === true) {\n key = keycode;\n }\n }", "_keydown(event) {\n if (this._originatesFromChip(event)) {\n this._keyManager.onKeydown(event);\n }\n }", "_keydown(event) {\n if (this._originatesFromChip(event)) {\n this._keyManager.onKeydown(event);\n }\n }", "function onkey(event) {\r\n event.preventDefault();\r\n\r\n if (vr) {\r\n if (event.keyCode == 90) // z\r\n controls.resetSensor(); //zero rotation\r\n else if (event.keyCode == 70 ) //f or enter\r\n effect.setFullScreen(true) //fullscreen\r\n else if (event.key == 'Enter') {\r\n\r\n console.log('ugh');\r\n onMouseDown();\r\n }\r\n }\r\n\r\n // some controls\r\n if(event.keyCode == 87) // w\r\n camera.position.z -= 0.8;\r\n else if(event.keyCode == 83) // s\r\n camera.position.z += 0.8;\r\n else if(event.keyCode == 65) // a\r\n camera.position.x -= 0.8;\r\n else if(event.keyCode == 68) // d\r\n camera.position.x += 0.8;\r\n}", "function onKeyDown(event){\n \n //keyboard events\n switch(event.keyCode){\n case 48:\n case 96:\n lookUp = true;\n break;\n case 38: //up\n case 87: //w\n console.log('w');\n moveForward = true;\n break;\n case 37: //left\n case 65: //a\n moveLeft = true;\n break;\n case 40: //down \n case 83: //s\n moveBackward = true;\n break;\n case 39: //right\n case 68: //d\n moveRight = true;\n break;\n }//end switch\n}", "static trackKeypress(_event) {\n _event.preventDefault();\n Setup.keyPressed[_event.keyCode] = (_event.type == \"keydown\");\n }", "function keyDown (event) {\n let key = event.key;\n key = standardizeKey(key);\n if (keyIsValid(key)) {\n addActiveClasses(key);\n }\n}", "keyupHandler(event) {\n window.addEventListener('keydown', this.keydown);\n }", "function onKeyPress(e) {\n\n\t\tvar code;\n\t\tif (!e) var e = window.event;\n\t\tif (e.keyCode) code = e.keyCode;\n\t\telse if (e.which) code = e.which;\n\n\t\tif (code === 37) {\n\t\t\tinputManager.onPress(\"left1\");\n\t\t}\n\t\tif (code === 38) {\n\t\t\tinputManager.onPress(\"up1\");\n\t\t}\n\t\tif (code === 39) {\n\t\t\tinputManager.onPress(\"right1\");\n\t\t}\n\t\tif (code === 40) {\n\t\t\tinputManager.onPress(\"down1\");\n\t\t}\n\t\tif (code === 32) {\n\t\t\tinputManager.onPress(\"confirm1\");\n\t\t}\n\t\tif (code === 27) {\n\t\t\tinputManager.onPress(\"cancel1\");\n\t\t}\n\t\tif (code === 13) {\n\t\t\tinputManager.onPress(\"pause1\");\n\t\t}\n\t\tif (code === 65) {\n\t\t\tinputManager.onPress(\"left2\");\n\t\t}\n\t\tif (code === 87) {\n\t\t\tinputManager.onPress(\"up2\");\n\t\t}\n\t\tif (code === 68) {\n\t\t\tinputManager.onPress(\"right2\");\n\t\t}\n\t\tif (code === 83) {\n\t\t\tinputManager.onPress(\"down2\");\n\t\t}\n\t\tif (code === 16) {\n\t\t\tinputManager.onPress(\"confirm2\");\n\t\t}\n\t\tif (code === 112) {\n\t\t\tinputManager.onPress(\"cancel2\");\n\t\t}\n\t\tif (code === 8) {\n\t\t\tinputManager.onPress(\"pause2\");\n\t\t}\n\n\t}", "function keyTyped() {\n letter = key;\n}", "keyEvent(key, isPressed) {\n // Look up the key info.\n const keyInfo = keyMap.get(key);\n if (keyInfo === undefined) {\n if (key !== \"Meta\" && key !== \"Control\" && key !== \"Alt\") {\n console.log(\"Unknown key \\\"\" + key + \"\\\"\");\n }\n }\n else {\n // Append key to queue.\n this.keyQueue.push(new KeyActivity(keyInfo, isPressed));\n }\n }", "function keyDown(evt) {\n var c = (evt.keyCode) ? evt.keyCode : evt.charCode;\n switch(c) {\n case 37: // left\n case 63234:\n dx = 1; break;\n case 39: // right\n case 63235:\n dx = -1; break;\n case 40: // down\n case 63233:\n dy = -1; break;\n case 38: // up\n case 63232:\n dy = 1; break;\n case 32: // fire\n if (Torpedo.x) {\n playSound('notAvail');\n message('Not loaded new torpedo yet!');\n mainPanel(\"#779\");\n } else Torpedo.fire();\n break;\n case 16: // shift\n withShift = 1; break;\n case 27: // esc\n gameRunning = score = 0;\n IntroOutro.endAnimDest(0 , 1, 1);\n }\n}", "function getKeyRelease(event) {\n\n// window.alert(\"It works....\");\n\n//Firefox based?\n if (event.keyCode !== undefined) {\n// window.alert(event.which);\n if (event.keyCode === 32) {\n shoot = 0;\n } else if (event.keyCode === 37) {\n left = 0;\n } else if (event.keyCode === 39) {\n right = 0;\n } else if (event.keyCode === 38) {\n up = 0;\n } else if (event.keyCode === 40) {\n down = 0;\n } else if (event.keyCode === 80) {\n pause = 0;\n }\n }\n\n}", "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.which;\n\t\tif (charCode == KEYCODE_RETURN)\t// If return, clear and get out\n\t\t{\n\t\t\tclearTypingBuffer();\n\t\t\tclearTypingTimer();\n\t\t\treturn;\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}", "function addKeydownEventListener() {\n document.addEventListener('keydown', function(e) {\n var allowedKeys = {\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down'\n };\n\n player.handleInput(allowedKeys[e.keyCode]);\n });\n\n}", "function getKeyPress(event) {\n//Keyboard press detected!\n keyboard = 1;\n //window.alert(\"It works....\");\n //window.alert(event.keyCode);\n //Key Codes supported?\n if (event.keyCode !== undefined) {\n// window.alert(event.which);\n if (event.keyCode === 32) {\n shoot = 5;\n } else if (event.keyCode === 37) {\n left = 5;\n } else if (event.keyCode === 39) {\n right = 5;\n } else if (event.keyCode === 38) {\n up = 5;\n } else if (event.keyCode === 40) {\n down = 5;\n } else if (event.keyCode === 80) {\n pause = 5;\n }\n }\n}", "function onKeyDown(event){\n var key = (event.keyCode) ? event.keyCode : event.which;\n\n if (currentGameState === GameState.IN_GAME) {\n switch (key) {\n case String('W').charCodeAt():\n case String('A').charCodeAt():\n case String('S').charCodeAt():\n case String('D').charCodeAt():\n case String('Q').charCodeAt():\n case String('E').charCodeAt():\n case String(' ').charCodeAt():\n case 37: // Left arrow\n case 38: // Up arrow\n case 39: // Right arrow\n case 40: // Down arrow\n if(pressedKeysArray.indexOf(key) == -1) {\n pressedKeysArray.push(key);\n }\n }\n }\n}", "function keyPressed() {\n if (keyCode === UP_ARROW) {\n upPressed = true;\n } else if (keyCode === DOWN_ARROW) {\n downPressed = true;\n } else if (keyCode === LEFT_ARROW) {\n leftPressed = true;\n } else if (keyCode === RIGHT_ARROW) {\n rightPressed = true;\n } else if (keyCode === 32){\n spacePressed = true;\n fired = true\n }\n}", "function keystroke(event) \n{\n 'use strict';\n\n // Left arrow?\n if (event.which == 37) {\n pfView.moveLeft();\n }\n\n // Right arrow?\n else if (event.which == 39) {\n pfView.moveRight();\n }\n}", "function handleKeyDown(event) {\n currentlyPressedKeys[event.keyCode] = true;\n }", "onKeyReleased(keyCode, event) {\n switch (keyCode) {\n case cc.KEY.a:\n case cc.KEY.left:\n self.accLeft = false;\n break;\n case cc.KEY.d:\n case cc.KEY.right:\n self.accRight = false;\n break;\n }\n }", "function keyListener() {\r\n window.addEventListener(\"keydown\", function (event) {\r\n if (event.defaultPrevented) {\r\n return; // Do nothing if the event was already processed\r\n }\r\n\r\n switch (event.key) {\r\n // add a ball.\r\n case \"a\":\r\n initBall();\r\n break;\r\n\r\n case \"A\":\r\n initBall();\r\n break;\r\n\r\n // press \"d\" to remove all the spheres.\r\n case \"d\":\r\n resetBalls();\r\n break;\r\n\r\n case \"D\":\r\n resetBalls();\r\n break;\r\n\r\n\r\n default:\r\n return; // Quit when this doesn't handle the key event.\r\n }\r\n\r\n // Cancel the default action to avoid it being handled twice\r\n event.preventDefault();\r\n }, true);\r\n}", "function setKeyEvent(){\n addEvent(document,\"keydown\",keyBoardHandler);\n}", "function keyDown (event) {\r\n // console.log(event.keyCode);\r\n if (event.keyCode == 65) {\r\n rightPressed = true;\r\n } else if (event.keyCode == 68) {\r\n leftPressed = true;\r\n } else if (event.keyCode == 87) {\r\n upPressed = true;\r\n } else if (event.keyCode == 83) {\r\n downPressed = true;\r\n }\r\n}", "function d3_keyup() {\n\n lastKeyDown = -1;\n // ctrl\n if (!d3.event.ctrlKey) {\n rect.on('mousedown.drag', null)\n .on('touchstart.drag', null);\n svg.classed('ctrl', false);\n }\n}", "function KeyDetect(event)\r\n {\r\n var key=event.key; //storing the value in variable.\r\n \r\n Play(key); //Passing the value to Play function();\r\n Ani(key);\r\n }", "function keyEventDown(event){\n justPressedKey=event.keyCode;\n if (currentlyPressedKeys.indexOf(event.keyCode)== -1){\n currentlyPressedKeys.push(event.keyCode);\n }\n documentUpdate();\n event.preventDefault();\n}", "function keyPress(e) {\n var x = e || window.event;\n var key = x.keyCode || x.which;\n if (key == 13 || key == 3) {\n //runs this function when enter is pressed\n newEntry();\n }\n if (key == 38) {\n console.log('hi');\n //document.getElementById(\"chatbox\").value = lastUserMessage;\n }\n }", "function handleKeyPress(event) {\n\n var action = getSwitcherAction(event.keyCode);\n\n switch (action) {\n case Config.GOING_UP:\n case Config.GOING_DOWN:\n moveListFocus(action);\n break;\n case Config.ESCAPING:\n $(Config.LIST_SWITCHER).hide();\n break;\n case Config.SWITCHING:\n switchToSelectedList();\n break;\n }\n }", "function keydownEventListener(event) {\n\tvar elementXPath = getXPath(event.target);\n\tvar keyIdentifier;\n\tif (isCharacterKeyPress(event)) {\n\t\t// For charcter keys return printable character instead of code\n\t\tkeyIdentifier = String.fromCharCode(event.which);\n\t} else {\n\t\tkeyIdentifier = event.which;\n\t};\n\n\tif (isCharacterKeyPress(event) && ((!event.altKey && !event.metaKey && !event.shiftKey && !event.ctrlKey) || (!event.altKey && !event.metaKey && event.shiftKey && !event.ctrlKey))) {\n\t\t// Ignore as it's just normal key press and will be sent via \"keypress event\" or someone did Shift+key to make it capital – again will be sent via keypress event\n\t} else {\n\t\tconsole.log('Pressed down: ' + keyIdentifier + ' on ' + elementXPath + ' alt: ' + event.altKey + ' meta: ' + event.metaKey + ' shift: ' + event.shiftKey + ' ctrl: ' + event.ctrlKey);\n\t\tsendEvent(\"{\\\"path\\\":\\\"\" + elementXPath + \"\\\", \\\"action\\\":\\\"keydown\\\", \\\"keyIdentifier\\\":\\\"\" + keyIdentifier + \"\\\", \\\"metaKey\\\":\\\"\" + event.metaKey + \"\\\", \\\"ctrlKey\\\":\\\"\" + event.ctrlKey + \"\\\", \\\"altKey\\\":\\\"\" + event.altKey + \"\\\", \\\"shiftKey\\\":\\\"\" + event.shiftKey + \"\\\"}\");\n\t};\n}", "function keyPress(e) {\n\t var x = e || window.event;\n\t var key = (x.keyCode || x.which);\n\t if (key == 13 || key == 3) {\n\t\t//runs this function when enter is pressed\n\t\tnewEntry();\n\t }\n\t if (key == 38) {\n\t\tconsole.log('hi')\n\t\t //document.getElementById(\"chatbox\").value = lastUserMessage;\n\t }\n\t}", "function pressedKey(event) {\n let pressed = event.key;\n // Start The Game:\n moveSound.play();\n position = { x: 0, y: 1 };\n switch (pressed) {\n case 'ArrowUp':\n position.x = 0;\n position.y = -1;\n break;\n case 'ArrowDown':\n position.x = 0;\n position.y = 1;\n break;\n case 'ArrowRight':\n position.x = 1;\n position.y = 0;\n break;\n case 'ArrowLeft':\n position.x = -1;\n position.y = 0;\n break;\n case ' ':\n gamePause();\n break;\n default:\n break;\n }\n}", "function keyboardEvent(event){\n var key = event.keyCode;\n \n switch( key ) {\n case 119:\n case 87:\n // w key\n // translate in a positive direction along Y axis of window\n vertical(true);\n break;\n case 115:\n case 83:\n // s key\n // translate in a negative direction along Y axis of window\n vertical(false);\n\n break;\n case 97:\n case 65:\n // a key\n // translate in a negative direction along X axis of window\n horizontal(true);\n\n break;\n case 100:\n case 68:\n // d key\n // translate in a positive direction along X axis of window\n horizontal(false);\n\n break;\n case 113:\n case 81:\n // q key\n // move counter clockwise direction\n\n turn(false);\n\n break;\n case 101:\n case 69:\n // e key\n // move clockwise direction\n\n turn(true);\n\n break;\n case 120:\n case 88:\n // x key\n // translate polygon centre to window [0,0]\n\n home();\n\n break;\n case 27:\n // escape key\n console.log(\"Esc\");\n clearCanvas();\n break;\n };\n}", "function keyUpEvent(e)\n{\n switch(e.keyCode)\n {\n case _keyCodes.esc:\n showStartMenu();\n break;\n \n case _keyCodes.enter:\n initGame();\n break;\n }\n}", "_onKeyDown(event) {\n switch (event.keyCode) {\n case 87: // w\n case 38: // up\n this.keys.forward = true;\n break;\n case 65: // a\n case 37: //left\n this.keys.left = true;\n break;\n case 83: // s\n case 40: //down\n this.keys.backward = true;\n break;\n case 68: // d\n case 39: //right\n this.keys.right = true;\n break;\n case 32: // SPACE\n this.keys.space = true;\n break;\n case 16: // SHIFT\n this.keys.run = true;\n break;\n }\n }", "keyupEventListener(event) {\n var key = event.keyCode;\n\n switch (key) {\n case this.keys.left:\n case this.keys.right:\n this.determineOrientation(event);\n break;\n };\n }", "keyupEventListener(event) {\n var key = event.keyCode;\n\n switch (key) {\n case this.keys.left:\n case this.keys.right:\n this.determineOrientation(event);\n break;\n };\n }", "function keyPress(e) {\n var x = e || window.event;\n var key = x.keyCode || x.which;\n if (key == 13 || key == 3) {\n //runs this function when enter is pressed\n newEntry();\n }\n if (key == 38) {\n console.log(\"hi\");\n //document.getElementById(\"chatbox\").value = lastUserMessage;\n }\n}", "function onKeyPress(event){\n\t\t \n\t\tvar obj = jQuery(event.target);\n\t\tif(obj.is(\"textarea\") || obj.is(\"select\") || obj.is(\"input\"))\n\t\t\treturn(true);\n\t\t\t\n\t\t var keyCode = (event.charCode) ? event.charCode :((event.keyCode) ? event.keyCode :((event.which) ? event.which : 0));\n\t\t \n\t\t switch(keyCode){\n\t\t\t case 39:\t//right key\n\t\t\t\t t.nextItem();\n\t\t\t\t event.preventDefault();\n\t\t\t break;\n\t\t\t case 37:\t//left key\n\t\t\t\t t.prevItem();\n\t\t\t\t event.preventDefault();\n\t\t\t break;\n\t\t }\n\t\t \n\t\tg_objGallery.trigger(t.events.GALLERY_KEYPRESS, keyCode);\n\t}", "keyPressed() {\n if (this.started){\n\n switch (event.key) {\n case \"ArrowDown\":\n this.mainLoop(); //Call mainloop because funtion is the same\n break;\n case \"ArrowUp\":\n this.rotate('rotateright');\n break;\n case \"ArrowLeft\":\n this.arrowKeys(-1);\n break;\n case \"ArrowRight\":\n this.arrowKeys(1);\n break;\n case \" \": //space\n this.hardLock();\n break;\n case \"Escape\":\n // this.pauze();\n break;\n case \"z\":\n this.rotate('rotateleft');\n break;\n case \"c\":\n // this.hold();\n break;\n case \"r\":\n // this.gameover();\n // this.start();\n break;\n default:\n return; // Quit when this doesn't handle the key event.\n }\n\n }\n\n }", "keybord() {\n document.addEventListener(\"keyup\", (e) => {\n if (e.key === \"ArrowLeft\") {\n this.stopTimerSlide();\n this.nextSlide();\n this.timerSlide();\n }\n if (e.key === \"ArrowRight\") {\n this.stopTimerSlide();\n this.previousSlide();\n this.timerSlide();\n }\n })\n }", "function keyPressed() {\n\tswitch (keyCode){\n\t\tcase LEFT_ARROW:\n\t\t\tconsole.log('pressed', keyCode)\n\t\t\t\n\t\t\tsnake.setDir(-1, 0);\n\t\t\tbreak;\n\t\t\t\n\n\t\tcase RIGHT_ARROW:\n\t\t\tconsole.log('pressed', keyCode)\n\t\t\t\n\t\t\tsnake.setDir(1, 0);\n\t\t\tbreak;\n\t\t\t\n\n\t\tcase DOWN_ARROW:\n\t\t\tconsole.log('pressed', keyCode)\n\n\t\t\t\n\t\t\tsnake.setDir(0, 1)\n\t\t\tbreak;\n\t\t\t\n\t\tcase UP_ARROW:\n\t\t\tconsole.log('pressed', keyCode)\n\t\t\t\n\t\t\tsnake.setDir(0, -1)\n\t\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\tconsole.log('pressed', keyCode)\n\t\t\tbreak;\n\t}\n}", "bind() {\n\t\tdocument.addEventListener('keydown', this.handleKeyPress);\n\t}", "function key_pressed(ev){\n\n\te = ev || window.event;\n\t\n\tif (e.keyCode) code = e.keyCode;\n\telse if (e.which) code = e.which;\n\t\n\t/*\n\t* if being dragged, the Escape key (27) drop all the files back to their original location\n\t*/\n\n\tif(drag_manager.drag_flag){\n\n\t\tif(code==27){\n\n\t\t\tscreen_refresh_no_ajax();\n\n\t\t}\n\n\t}\n\n\tdrag_manager.active_key=code;\n\n}", "_handleHeaderKeydown(event) {\n this._keyManager.onKeydown(event);\n }", "function keyPressed() {\n lastKeyPressed = key;\n\n sendChannel2();\n \n }", "function atkGKeyListener()\n{ \n}", "keypress ( target, keyText ) {\n target.dispatchEvent(_keyboardEventFor('keypress', Editor.KeyCode(keyText)));\n }", "function enableKeyRelease() {\n // Add event listener for keyboard release events to the canvas\n window.addEventListener(\"keyup\", function (evt) {\n connectedGame.keyReleaseEvent(evt);\n }, false);\n }" ]
[ "0.7668592", "0.76072514", "0.76043946", "0.75907576", "0.74914855", "0.7488165", "0.7484244", "0.73791456", "0.73749834", "0.736602", "0.7347649", "0.7338612", "0.73363376", "0.73200935", "0.73099583", "0.73098874", "0.7297156", "0.7297156", "0.72847664", "0.7267472", "0.7247477", "0.7233038", "0.7232483", "0.7230625", "0.7209765", "0.720362", "0.7192259", "0.7183879", "0.7183465", "0.71731544", "0.7173018", "0.71707547", "0.71460915", "0.71380836", "0.71374977", "0.71363175", "0.71092117", "0.7109147", "0.71053034", "0.71045697", "0.7103075", "0.7103075", "0.70788115", "0.70743483", "0.7068411", "0.7058972", "0.70579755", "0.70345986", "0.70338494", "0.7028644", "0.702552", "0.702552", "0.701176", "0.7007115", "0.7007115", "0.7006597", "0.70017916", "0.7001108", "0.69970757", "0.69938856", "0.699024", "0.6966982", "0.69636077", "0.6962067", "0.6952961", "0.6951961", "0.6947169", "0.69416195", "0.6939417", "0.6935323", "0.6934103", "0.69329125", "0.691382", "0.6910424", "0.6910024", "0.69072795", "0.6892757", "0.68873024", "0.6887154", "0.6885879", "0.6881786", "0.6878107", "0.6873767", "0.68717366", "0.686689", "0.6863826", "0.6855493", "0.6853058", "0.6853058", "0.6848294", "0.6848264", "0.684753", "0.6845416", "0.6840606", "0.68398684", "0.6836846", "0.6833937", "0.68328696", "0.68312865", "0.6824676", "0.6822515" ]
0.0
-1
========================================================================= sendMail ========================================================================= Main function for recieving and validating the user's inputs. When finished, information will be sent to the email transfer php function to be prepared and sent to our email.
function sendMail(){ error = false; // Reset error to assume there's no errors // Fetch user's information var name = document.getElementById('name').value; var email = document.getElementById('email').value; var subject = document.getElementById('subject').value; var message = document.getElementById('message').value; //-----------------------------// // Validate user's information // //-----------------------------// // Did user input their name? if (name == ''){ validateActions("nameVal", "nameGroup", "Name field is empty", true); } else{ validateActions("nameVal", "nameGroup", "", false); } // Did user input their email? if (email == ''){ validateActions("emailVal", "emailGroup", "Email field is empty", true); } else{ // Email Regex var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; // Is the email invalid? if (!re.test(email)){ validateActions("emailVal", "emailGroup", "Given email is invalid", true); } else{ validateActions("emailVal", "emailGroup", "", false); } } // Did user input an email subject? if (subject == ''){ validateActions("subjectVal", "subjectGroup", "Subject field is empty", true); } else{ // Is the email subject ridiculously long? if (subject.length > 100){ validateActions("subjectVal", "subjectGroup", "We appreciate the long subject title but please shorten it to 100 words or less.", true); } else{ validateActions("subjectVal", "subjectGroup", "", false); } } // Did user input their email message? if (message == ''){ validateActions("messageVal", "messageGroup", "Message field is empty", true); } else{ // Is the email message ridiculously long? if (message.length > 2000){ validateActions("messageVal", "messageGroup", "We appreciate the long message but please shorten it to 2000 words or less.", true); } else{ validateActions("messageVal", "messageGroup", "", false); } } // Did we have an error? if (error){ $("#errormessage").addClass("show"); $("#sendmessage").removeClass("show"); return false; // Prevent form from sending } else{ // Empty each field (to prevent submit button spam) document.getElementById('name').value = ""; document.getElementById('email').value = ""; document.getElementById('subject').value = ""; document.getElementById('message').value = ""; $("#errormessage").removeClass("show"); $("#sendmessage").addClass("show"); } //----------------------------------------// // Send user's information to create mail // //----------------------------------------// // Stores user's information var data = {}; data.name = name; data.email = email; data.subject = subject; data.message = message; //alert(data.name + " || " + data.email + " || " + data.subject + " || " + data.message); //var loc = window.location.pathname; //var dir = loc.substring(0, loc.lastIndexOf('/')); //alert(dir); //$.post(dir + "/contactform/emailtransfer.php", data, mailReturn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendMail(){ \n\tlogincontroller.logincheck(name,password,(err,data)=>{\n \tif(err) throw err;\n \telse{\n \t\tconsole.log(\"\\n------------------------------Compose Mail---------------------------------\\n\\n\")\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n \t\tconsole.log(\"Sender Name=> \"+data[0].name+\" ---------Sender Email ID => \"+data[0].emailid);\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n \t\tvar reciever = readline.question(\"Reciever Email Id => \");\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n \t\tvar subject = readline.question(\"Subject => \");\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n \t\tvar message = readline.question(\"Message = >\")\n \t\tconsole.log(\"------------------------------------------------------------------------------\\n\")\n\t\tmailcontroller.sendmail(data[0].emailid,reciever,subject,message,(err)=>{\n\t\t\tif(err) throw err;\n\t\t\telse{\n\t\t\t\tconsole.log(\"\\n---------Mail Sent Successfully---------\");\n\t\t\t\tconsole.log(\"\\n---------------------------Welcome \"+data[0].name+\"------------------------\");\n\t\t\t\thomeUI();\n\t\t\t}\n\t\t});\t\n\t\n \t}\n\n });\n\n}", "async function main () {\n // send mail with defined transport object\n transporter.sendMail({\n from: email, // sender address\n to: '[email protected]', // list of receivers\n subject: 'Client Enquiry', // Subject line\n html: message\n }, function (err) {\n if (err) {\n console.log(err)\n res.render('error')\n } else {\n console.log('Message sent successfully:')\n res.render('confirmation')\n }\n })\n }", "function sendMail(e){\n\te.preventDefault()\n\tconst receiver = document.querySelector(\"#receiverName\").value\n\tconst content = document.querySelector(\"#inputContent\").value\n\t//const appendMail = new Mail(receiver.value, content)\n\t//auser.send.push(newMail)\n\n const newMail = {\n \"receiver\":receiver,\n \"content\":content\n }\n RequestModule.sendmail(newMail, function(newmail){\n sent.insertBefore(mailHTML(newmail), sent.children[1])\n if(receiver === currentUser){\n inbox.insertBefore(mailHTML(newmail), inbox.children[1])\n }\n })\n\n // Server side funtions will be added below in phase2.\n}", "function sendContactForm() {\n let sCustomerName = contactFormName.value;\n let sCustomerEmail = customerFormEmail.value;\n let sCustomerMessage = customerFormMessage.value;\n\n //check if input fields has been filled out\n if (sCustomerName == \"\" || sCustomerEmail == \"\" || sCustomerMessage == \"\") {\n showMessage(\"Please fill out all the fields\", true);\n } else {\n let sEmailRegEx =\n /^[-!#$%&'*+\\/0-9=?A-Z^_a-z`{|}~](\\.?[-!#$%&'*+\\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\\.?[a-zA-Z0-9])*\\.[a-zA-Z](-?[a-zA-Z0-9])+$/;\n\n //check that the email is a valid email\n if (!sEmailRegEx.test(sCustomerEmail)) {\n customerFormEmail.classList.add(\"invalid\");\n setTimeout(() => {\n customerFormEmail.classList.remove(\"invalid\");\n }, 5000);\n //lets user know their email was invalid\n showMessage(\"Please provide a valid email address\", true);\n } else {\n document.body.style.cursor = \"wait\";\n document.querySelector(\".contact-form__button\").style.backgroundColor =\n \"grey\";\n customerFormEmail.classList.remove(\"invalid\");\n //post the filled out data to the mailing api\n postData(\"MAILER/send-contact-message-email.php\", {\n customerName: sCustomerName,\n customerEmail: sCustomerEmail,\n customerMessage: sCustomerMessage,\n }).then((jResponse) => {\n console.log(jResponse);\n if (!jResponse.mailSent) {\n showMessage(\"An error occurred\", true);\n } else {\n showMessage(\n \"Thank you, Your message has been sent to Mirtual\",\n false\n );\n document.body.style.cursor = \"default\";\n document.querySelector(\".contact-form__button\").style = \"\";\n\n contactFormName.value = \"\";\n customerFormEmail.value = \"\";\n customerFormMessage.value = \"\";\n }\n });\n }\n }\n}", "function attemptContact() {\n \"use strict\";\n var variables = getVariables();\n if (variables) {\n sendEmail(variables);\n }\n}", "sendMail(options) {}", "async function main( \n transType, address1, address2, address3, countryState, email, firstBookDate, lastBookDate, newsletter, postCode, surname, title, town, userID, category \n ) {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n // const testAccount = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n // const transporter = nodemailer.createTransport({\n // host: 'smtp.ethereal.email',\n // port: 587,\n // secure: false, // true for 465, false for other ports\n // auth: {\n // user: testAccount.user, // generated ethereal user\n // pass: testAccount.pass, // generated ethereal password\n // },\n // });\n\n var transporter = nodemailer.createTransport({\n service: 'gmail',\n auth: {\n user: '[email protected]',\n pass: 'F0rumre1'\n }\n });\n\n\n \n // send mail with defined transport object\n const info = await transporter.sendMail({\n from: '\"ParkDIA Server\" <[email protected]>', // sender address\n to: '[email protected]', // list of receivers\n subject: 'M15815', // Subject line\n text: `Transaction Type: ${transType} \\r\\n\\r\\n Address 1: ${address1} \\r\\n\\r\\n Address 2: ${address2} \\r\\n\\r\\n Address 3: ${address3} \\r\\n\\r\\n Country/State: ${countryState} \\r\\n\\r\\n Email: ${email} \\r\\n\\r\\n First Booking Date: ${firstBookDate} \\r\\n\\r\\n Last Booking Date: ${lastBookDate} \\r\\n\\r\\n Newsletter Opt In: ${newsletter} \\r\\n\\r\\n Postcode: ${[postCode]} \\r\\n\\r\\n Surname: ${surname} \\r\\n\\r\\n Title: ${title} \\r\\n\\r\\n Town: ${town} \\r\\n\\r\\n User ID: ${userID} \\r\\n\\r\\n Category: ${category}` , // plain text body\n html: `Transaction Type: ${transType} </br> Address 1: ${address1} </br> Address 2: ${address2} </br> Address 3: ${address3} </br> Country/State: ${countryState} </br> Email: ${email} </br> First Booking Date: ${firstBookDate} </br> Last Booking Date: ${lastBookDate} </br Newsletter Opt In: ${newsletter} </br> Postcode: ${[postCode]} </br> Surname: ${surname} </br> Title: ${title} </br> Town: ${town} </br> User ID: ${userID} </br> Category: ${category}`, // html body\n });\n\n // console.log('Message sent: %s', info.messageId);\n // // Message sent: <[email protected]>\n\n // // Preview only available when sending through an Ethereal account\n // console.log('Preview URL: %s', nodemailer.getTestMessageUrl(info));\n // // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n\n transporter.sendMail(info, function (err, info) {\n if(err)\n console.log(err)\n else\n console.log(info);\n });\n}", "function postStuff (){\n\t//prevent form submission\n\tevent.preventDefault();\n\tlet name = document.contact.name.value;\n\tlet email = document.contact.email.value;\n\tlet phone = document.contact.phone.value;\n\tlet message = document.contact.message.value;\n\tconst regex=/^(?![ .]+$)[a-zA-Z .]*$/;\n\tconst emailRegex =/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n\tconst phRegex = /^[0-9]*$/;\n\t//call functions\n\tvalidName();\n\tvalidEmail();\n\tvalidPhone();\n\tvalidMessage();\n\t//validate name\n\tfunction validName () {\n\t\tif ((name.match(regex))&&(name !== '')) {\n\t\t//clear validation message if the input error fixed\n\t\tdocument.getElementById('name_error').innerHTML = \"\";\n\t\tdocument.getElementById('name').style.borderColor = \"\";\n\t\t}//if name not match regex, Styling errors written to the DOM\n\t\telse{\n\t\t\tdocument.contact.name.select();\n\t\t\tdocument.contact.name.focus();\n\t\t\tdocument.getElementById('name_error').innerHTML = '*Only alpha characters and spaces are allowed (A-Z and a-z)';\n\t\t\tdocument.getElementById('name_error').style.color = \"red\";\n\t\t\tdocument.getElementById('note').innerHTML = '*Check the error';\n\t\t\tdocument.getElementById('name').style.borderColor = \"red\";\n\t\t\t//clear input field when it's error\n\t\t\tdocument.getElementById('name').value = \"\";\n\t\t\treturn false;\n\t\t}\n\t}\n\t//valid email\n\tfunction validEmail () {\n\t\tif ((email.match(emailRegex))&&(email !== '')) {\n\t\t//clear validation message if the input error fixed\n\t\tdocument.getElementById('email_error').innerHTML = \"\";\n\t\tdocument.getElementById('email').style.borderColor = \"\";\n\t\t}//if email not match regex, Styling errors written to the DOM\n\t\telse{\n\t\t\tdocument.contact.email.select();\n\t\t\tdocument.contact.email.focus();\n\t\t\tdocument.getElementById('email_error').innerHTML = '*Only valid email accept';\n\t\t\tdocument.getElementById('email_error').style.color = \"red\";\n\t\t\tdocument.getElementById('note').innerHTML = '*Check the error';\n\t\t\tdocument.getElementById('email').style.borderColor = \"red\";\n\t\t\t//clear input field when it's error\n\t\t\tdocument.getElementById('email').value = \"\";\n\t\t\treturn false;\n\t\t}\n\t}\n\t//valid phone number\n\tfunction validPhone () {\n\t\tif ((phone.match(phRegex))&&(phone !== '')) {\n\t\t//clear validation message if the input error fixed\n\t\tdocument.getElementById('phone_error').innerHTML = \"\";\n\t\tdocument.getElementById('phone').style.borderColor = \"\";\n\t\t}//if phone not match regex, Styling errors written to the DOM\n\t\telse{\n\t\t\tdocument.contact.phone.select();\n\t\t\tdocument.contact.phone.focus();\n\t\t\tdocument.getElementById('phone_error').innerHTML = '*only numbers (0-9) and NO characters';\n\t\t\tdocument.getElementById('phone_error').style.color = \"red\";\n\t\t\tdocument.getElementById('note').innerHTML = '*Check the error';\n\t\t\tdocument.getElementById('phone').style.borderColor = \"red\";\n\t\t\t//clear input field when it's error\n\t\t\tdocument.getElementById('phone').value = \"\";\n\t\t\treturn false;\n\t\t}\n\t}\n\t//message not empty\n\tfunction validMessage () {\n\t\tif (message != '') {\n\t\t//clear validation message if the input error fixed\n\t\tdocument.getElementById('message_error').innerHTML = \"\";\n\t\tdocument.getElementById('message').style.borderColor = \"\";\n\t\t//call function postData if all inputs valid\n\t\tpostData();\n\t\tdocument.getElementById('note').innerHTML = \"\";\n\t\t}//if message empty, Styling errors written to the DOM\n\t\telse{\n\t\t\tdocument.contact.message.select();\n\t\t\tdocument.contact.message.focus();\n\t\t\tdocument.getElementById('message_error').innerHTML = '*Not allowed empty message';\n\t\t\tdocument.getElementById('message_error').style.color = \"red\";\n\t\t\tdocument.getElementById('note').innerHTML = '*Check the error';\n\t\t\tdocument.getElementById('message').style.borderColor = \"red\";\n\t\t\t//clear input field when it's error\n\t\t\tdocument.getElementById('message').value = \"\";\n\t\t\treturn false;\n\t\t}\n\t}\n\t//function call AJAX & post data \n\tfunction postData (){\n\t\t//creates a text string in standard URL-encoded notation\n\t\tvar dataString = $('#myform').serialize();\n\t\t$.ajax({\n\t\t\turl: $('#myform').attr('action'),\n\t\t\ttype: \"post\",\n\t\t\tdata: dataString,\n\t\t\tsuccess: function(data) {\n\t\t\t\tdocument.getElementById('note').innerHTML = 'Thanks for contact!';\n\t\t\t\t//clear form after success submit\n\t\t\t\t$('#myform input[type=\"text\"]').val('');\n\t\t\t\t$('#myform textarea').val('');\n\t\t\t},\n\t\t\terror: function(){\n\t\t\t\tdocument.getElementById('note').innerHTML = 'There is an error please try again later!';\n\t\t}\n\t})\n\t}\n}", "function validateandSendForm() {\n var name = $(\"input#name\").val(),\n email = $(\"input#email\").val(),\n subject = $(\"input#subject\").val(),\n message = $(\"textarea#message\").val();\n\n\n // - Regular expression for the form validation\n\n if(name == null || name.length == 0 || /^\\s+$/.test(name) ) {\n $(\"#nameError\").text(\"Please enter a valid name\").show().fadeOut(3000);\n return false;\n } else if(!(/^(([^<>()[\\]\\\\.,;:\\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,}))$/.test(email))){\n $(\"#emailError\").text(\"Please enter a valid email\").show().fadeOut(3000);\n return false;\n } else if(subject == null || /^\\s+$/.test(subject)) {\n $(\"#subjectError\").text(\"ERROR\").show().fadeOut(3000);\n return false;\n } else if(message == null || message.length == 0 || /^\\s+$/.test(message)){\n $(\"#messageError\").text(\"Please enter a message\").show().fadeOut(3000);\n return false;\n }\n\n // - Submit the form to the PHP endpoint\n\n var request = $.ajax({\n url: \"././php/mail.php\",\n type: \"POST\",\n data: {\n name: name,\n subject: subject,\n email: email,\n message: message\n },\n cache: false\n });\n\n request.done(function() {\n // Success message\n $('#timelineForm').html(\"<p>Thank you! Your message has been sent</p>\");\n })\n .error(function() {\n // Failure message\n $('#timelineForm').html(\"<p>Something was wrong</p>\");\n });\n}", "function sendMail(contactForm) {\n // for testing the contactForm\n // we need to make sure that contactForm has the <form> html element\n console.log(contactForm); // output the entire form element\n\n /*\n Now be advised that contactFrom is a variable that contains the <from> object \n \n we need to access the individual properties (fields) of this form object to get their values:\n we can the values of name attribute\n - name => because we put name=\"name\" in our HTML form element\n - emailaddress => because we put name=\"emailaddress\" in our HTML form element\n - projectsummary => because we put name=\"projectsummary\" in our HTML form element\n\n to summarize, the values of the \"name\" html attribute are the properties of the form object\n */\n var templateParams = {\n // Notice that our template (EmailJS) has the parameter named \"main_subject\"\n // it's good to give a value for this property\n // Remember it is just an optional field!\n main_subject: \"Personal Project Request\",\n // we need to get the value of user name/full name [ name=\"name\" ]:\n from_name: contactForm.name.value,\n // we need to get the value of user's email [ name=\"emailaddress\" ]:\n from_email: contactForm.emailaddress.value,\n // we need to get the value of user's project request message [ name=\"projectsummary\" ]:\n project_request: contactForm.projectsummary.value\n }\n\n // for testing: *************************************************\n console.log(\"templateParams => name property value: \" + templateParams.from_name);\n console.log(\"templateParams => from_email property value: \" + templateParams.from_email);\n console.log(\"templateParams => project_request property value: \" + templateParams.project_request);\n // **************************************************************\n\n // Put the values for YOUR_SERVICE_ID which is \"outlook\" and YOUR_TEMPLATE_ID which is \"cbc_demo2\"\n emailjs.send('outlook', 'cbc_demo3', templateParams)\n /*\n now we can supply the then() method for our promise.\n And we can provide two functions:\n - the first one will run when the promise is done/met (pass => run our first anonymous function)\n - the second on will runt when the promise is not done (fail) => run our second anonymous function)\n */\n .then(function (response) {\n // NOTE#1: this line of code is from EmailJS docs\n console.log('SUCCESS!', response.status, response.text); // has more details\n // output: SUCCESS! 200 OK\n\n // NOTE#2: This line of code is from the Code Institute (LMS Learning):\n console.log(\"SUCCESS\", response); // simpler\n // output: the response object with its two properties: status and text\n // output: SUCCESS r {status: 200, text: \"OK\"}\n\n /* ************************************************************************ */\n /* ********* Below is our own code (NOT Code institute [LMS]) ************* */\n /*\n - alert the user that his email has been sent successfully!\n - clear all the input fields of the form\n */\n alert(`\n Thank you ${templateParams.from_name} for emailing us,\n We will reply to you on this address:\n ${templateParams.from_email}\n `);\n // Now we can clear all the fields input by assigning an empty string to each one:\n contactForm.name.value = \"\";\n contactForm.emailaddress.value = \"\";\n contactForm.projectsummary.value = \"\";\n }, function (error) {\n console.log('FAILED...', error);\n alert(`\n Sorry ${templateParams.from_name}!,\n We were unable to receive your email: ${templateParams.from_email}\n `);\n }); // the end of method then() for emailjs.send()\n\n // Return false is required so \"email.min.js\" file can have the time to read the content of the HTML form before being refreshed\n // email.min.js is the minified version of email.js code file that will be run by EmailJS services\n return false; // to prevent the default behaviour of the browser of reloading or refreshing the pages\n} // end sendMail() function", "async function main(){\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: \"smtp.gmail.com\",\n port: 587,\n secure: false, // true for 465, false for other ports\n auth: {\n user: '[email protected]', // generated ethereal user\n pass: 'VFgg%%$#%&GFR' // generated ethereal password\n },\n tls:{\n rejectUnauthorized:false\n }\n });\n\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: '\"'+req.body.name+'\" <[email protected]>', // sender address\n to: \"[email protected]\",\n replyTo: req.body.email,// list of receivers\n subject: req.body.noOfTravlers+' pax -'+ req.body.city+' - '+fromDate + ' to '+toDate, // Subject line\n // text: \"Hello world?\", // plain text body\n html: userInfo // html body\n });\n\n console.log(\"Message sent: %s\", info.messageId);\n // Message sent: <[email protected]>\n\n // Preview only available when sending through an Ethereal account\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n }", "function validateForm() {\n let check1 = document.getElementById('checkbox-1');\n let check2 = document.getElementById('checkbox-2');\n let name = document.getElementById('mce-NAME');\n let email = document.getElementById('mce-EMAIL');\n\n let checkMessage = document.querySelector('.js-check-message');\n let nameMessage = document.querySelector('.js-name-message');\n let emailMessage = document.querySelector('.js-email-message');\n // The browser validation allows both [email protected] and x@y, because of \n // the second format considered valid, we need our own check \n // that a top level domain is present as MailChimp requires\n let emailRegex = new RegExp (/(.*@.*\\..*)/);\n\n // Reset the error messages\n checkMessage.innerText = \"\";\n nameMessage.innerText = \"\";\n emailMessage.innerText = \"\";\n name.classList.remove('cmp-form-field__input--error');\n email.classList.remove('cmp-form-field__input--error');\n\n // Make sure one of the checkboxes is selected\n if (!check1.checked && !check2.checked) {\n checkMessage.innerText = 'One of the contact options must be selected to send the form.';\n }\n\n // Make sure the name value isn’t blank\n if (name.value === \"\") {\n name.classList.add('cmp-form-field__input--error');\n nameMessage.innerText = 'Your name is required.';\n }\n\n // Make sure the email value isn’t blank\n if (email.value === \"\") {\n email.classList.add('cmp-form-field__input--error');\n emailMessage.innerText = 'Your email is required.';\n }\n\n // Make sure the email address is formatted correctly\n if (!emailRegex.test(email.value)) {\n email.classList.add('cmp-form-field__input--error');\n emailMessage.innerText = 'Your email format is incorrect.';\n }\n\n // Double check everything is right before sending.\n if ((check1.checked || check2.checked) && name.value !== \"\" && email.value !== \"\" && emailRegex.test(email.value)) {\n sendData()\n }\n }", "function processPurchaseForm(){\n\n //Assign variables for each input, as well as corresponding validation formats\n var amountInput = document.getElementById(\"amountInput\");\n var nameInput = document.getElementById(\"nameInput\");\n var emailInput = document.getElementById(\"emailInput\");\n var senderInput = document.getElementById(\"senderInput\");\n var dateInput = document.getElementById(\"deliveryDateInput\");\n var fullDateInput = dateInput.value;\n var timeNow = new Date();\n var dateSelected = new Date(fullDateInput + 'T23:59:59');\n var messageInput = document.getElementById(\"message\");\n \n\n //REGEX formatting\n var stringFormat = /^[A-Za-z]+\\s?[A-Za-z]+$/i;\n var intFormat = /^([1-9][0-9]*)\\.?(\\d{2})?$/;\n var emailFormat = /^([\\w\\.\\-\\_]+)@(\\w+)\\.(\\w{2,3})/;\n \n //Validates form fields\n if(!intFormat.test(amountInput.value)){ \n amountInput.style.background = \"red\";\n amountInput.focus();\n return false;\n }\n else{\n amountInput.style.background = \"white\";\n }\n \n if(!stringFormat.test(nameInput.value)){ \n nameInput.style.background = \"red\";\n nameInput.focus();\n return false;\n }\n else{\n nameInput.style.background = \"white\";\n }\n \n if(!emailFormat.test(emailInput.value)){ \n emailInput.style.background = \"red\";\n emailInput.focus();\n return false;\n }\n else{\n emailInput.style.background = \"white\";\n }\n\n if(!stringFormat.test(senderInput.value)){ \n senderInput.style.background = \"red\";\n senderInput.focus();\n return false;\n }\n else{\n senderInput.style.background = \"white\";\n }\n\n if (dateSelected < timeNow || dateInput.value === \"\"){\n dateInput.style.background = \"red\";\n dateInput.focus();\n return false;\n }\n else{\n dateInput.style.background = \"white\";\n }\n\n //Gets HTML elements for displaying thanks message\n var thanksMsg = document.getElementById(\"thanksMsg\");\n var buyGCForm = document.getElementById(\"buyGCForm\");\n var buyGCTitle = document.getElementById(\"buyGCTitle\")\n\n var buyerName = document.getElementById(\"buyerName\");\n var gcAmount = document.getElementById(\"gcAmount\");\n var gcEmail = document.getElementById(\"gcEmail\");\n var sendDate = document.getElementById(\"sendDate\");\n var customerMsg = document.getElementById(\"customerMsg\");\n\n //Displays thanks message\n buyGCTitle.style.display = \"none\";\n buyGCForm.style.display = \"none\";\n thanksMsg.style.display = \"inherit\";\n\n customerMsg.innerText = messageInput.value;\n buyerName.innerText = nameInput.value;\n gcAmount.innerText = '$' + amountInput.value;\n gcEmail.innerText = emailInput.value;\n sendDate.innerText = fullDateInput;\n\n //Prevents form from fully submitting, for project purposes\n return false;\n }", "function sendEnquirytoAdmin() {\r\n\t\t// User help menu popup window validation start\r\n\t\tvar badColor = \"#ff6666\";\r\n\t\tvar goodColor = \"#66cc66\";\r\n\r\n\t\tvar Error_msg1 = document.getElementById('Error_msg1');\r\n\t\tvar Error_msg2 = document.getElementById('Error_msg2');\r\n\t\tvar Error_msg3 = document.getElementById('Error_msg3');\r\n\r\n\t\tvar Sendername = document.getElementById('Sender_name');\r\n\t\tvar senderemailid = document.getElementById(\"sendermail\");\r\n\t\tvar UserQuery = document.getElementById(\"userquery\");\r\n\t\tvar Email_pattern = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\r\n\t\tif (Sendername.value == \"\") {\r\n\t\t\tsenderemailid.style.borderColor = badColor;\r\n\t\t\tError_msg1.style.color = badColor;\r\n\t\t\tError_msg1.innerHTML = \"please enter your Name\"\r\n\t\t\treturn false;\r\n\r\n\t\t} else {\r\n\t\t\tSendername.style.borderColor = goodColor;\r\n\t\t\tError_msg1.innerHTML = \"\"\r\n\t\t\tError_msg1.style.color = goodColor;\r\n\t\t}\r\n\t\tif (senderemailid.value == \"\") {\r\n\t\t\tsenderemailid.style.borderColor = badColor;\r\n\t\t\tError_msg2.style.color = badColor;\r\n\t\t\tError_msg2.innerHTML = \"please enter your E-mail id\"\r\n\t\t\treturn false;\r\n\r\n\t\t} else if (!senderemailid.value.match(Email_pattern)) {\r\n\t\t\tsenderemailid.style.borderColor = badColor;\r\n\t\t\tError_msg2.style.color = badColor;\r\n\t\t\tError_msg2.innerHTML = \"This is not a valid E-mail id\"\r\n\t\t\treturn false;\r\n\r\n\t\t} else {\r\n\t\t\tsenderemailid.style.borderColor = goodColor;\r\n\t\t\tError_msg2.innerHTML = \"\"\r\n\t\t\tError_msg2.style.color = goodColor;\r\n\t\t}\r\n\t\tif (UserQuery.value == \"\") {\r\n\t\t\tUserQuery.style.borderColor = badColor;\r\n\t\t\tError_msg3.style.color = badColor;\r\n\t\t\tError_msg3.innerHTML = \"please enter your query\"\r\n\t\t\treturn false;\r\n\r\n\t\t} else {\r\n\t\t\tUserQuery.style.borderColor = goodColor;\r\n\t\t\tError_msg3.innerHTML = \"\"\r\n\t\t\tError_msg3.style.color = goodColor;\r\n\r\n\t\t}\r\n\t\talert(\"your query successfully sended to us\");\r\n\t\t$('.modal.in').modal('hide')\r\n\t\t// User help menu popup window validation End\r\n\t\t// code for user enquiry sended to the Admin\r\n\t\tvar senderemailid = $('#sendermail').val();\r\n\t\tvar UserQuery = $('#userquery').val();\r\n\t\tvar user = {\r\n\t\t\t\"senderEmailid\" : senderemailid,\r\n\t\t\t\"userQuery\" : UserQuery\r\n\t\t}\r\n\t\tvar userData = JSON.stringify(user);\r\n\r\n\t\t$.ajax({\r\n\t\t\turl : restAPIUrl + 'registeredUser/sendUserEnquery', //API for User Enquiry\r\n\t\t\theaders : {\r\n\t\t\t\t'Authorization' : 'Bearer' + oauthToken,\r\n\t\t\t\t'Content-Type' : 'application/json',\r\n\t\t\t},\r\n\t\t\ttype : 'POST',\r\n\t\t\tdata : userData,\r\n\t\t\tasync : false,\r\n\t\t\tdataType : 'json',\r\n\t\t\tsuccess : function(data) {\r\n\r\n\t\t\t},\r\n\t\t\terror : function(data) {\r\n\t\t\t\talert(data)\r\n\r\n\t\t\t}\r\n\t\t})\r\n\t}", "sendEmail() {\n email([EMAIL], null, null, null, null);\n }", "function sendMailOld() {\n // Just for testing\n console.log(\"Aha, you want to email us!\");\n\n // Remember that here we need to copy the full template of EmailJS send() method\n // No need to worry! you can take the following code from EmailJS docs ;-)\n\n // Here is one of the ways by placing the object and all its properties \n // directly inside the emailjs.send() method:\n // serviceID: \"outlook\"\n // templateID: \"cbc_demo3\"\n\n /*\n instead of passing the full object, we can create this object \"templateParams\" \n */\n /*\n var templateParams = {\n // The sender information based on our HTML form\n // our HTML form has only 3 input fields: name, email, and message\n // we are just hard coding the values! But we need to retrieve the user's input\n main_subject: \"Project Request\",\n from_name: 'Anmar with his students',\n from_email: 'Valid and Exist Email Address',\n project_request: 'here is my request to build for me a project'\n }\n\n emailjs.send('outlook', 'cbc_demo3', templateParams);\n */\n\n /*\n Notice that the keys for this object are all equal to the parameter names that we've set in our email template back on EmailJS.\n\n Also remember the number of the templateParams variable properties, ]\n like how many properties I need to use and it depends on how many input fields we have in our HTML form\n\n In our HTML form we have the following form fields:\n - Input field for name\n - Input field for email\n - Textarea for message\n\n Since we have 3 inputs/fields, so we need to prepare three properties as placeholders:\n\n we can create a variable like \"templateParams\" with the required properties\n OR \n we can just pass these properties with their values directly inside emailjs send function \n */\n var templateParams = {\n // Notice that our template (EmailJS) has the parameter named \"main_subject\"\n // it's good to give a value for this property\n // Remember it is just an optional field!\n main_subject: \"Project Request\",\n // we need to get the value of user name/full name:\n from_name: document.getElementById(\"full-name\").value,\n // we need to get the value of user's email:\n from_email: document.getElementById(\"email-address\").value,\n // we need to get the value of user's project request message:\n project_request: document.getElementById(\"project-summary\").value\n }\n\n // for testing/learning:\n // templateParams is just a JS object ==> objectName.property or objectName.method()\n console.log(\"the form_name property of templateParams object : \" + templateParams.from_name);\n console.log(\"the from_email property of templateParams object: \" + templateParams.from_email);\n console.log(\"the project_request property of templateParams object: \" + templateParams.project_request);\n\n\n // Remember that we can also add \"userID\" to send() method but it is optional :-)\n // These lines of code is from EmailJS docs\n // Below we run our promise/code: emailjs.send()...\n emailjs.send('outlook', 'cbc_demo3', templateParams)\n /*\n now we can supply the \"then()\"\" method for our promise.\n And we can provide two functions:\n - the first one will run when the promise is done/met (pass => run our first anonymous function)\n - the second one will run when the promise is not done (fail => run our second anonymous function)\n */\n .then(function (response) {\n console.log('SUCCESS!', response.status, response.text);\n // output: SUCCESS! 200 OK\n\n // This line of code is from the Code Institute (LMS Learning):\n console.log(\"SUCCESS\", response); // simpler\n // output: the response object with its two properties: status and text\n\n // Here we can add our own custom message (using literal Template):\n alert(`\n Thank you ${templateParams.from_name} for emailing us,\n We will reply to you on this address ${templateParams.from_email}\n `);\n }, function (error) {\n console.log('FAILED...', error);\n /*\n Adding our own code for console/alert the reason of the error!\n An extra based on our understanding of the object \"error\"\n this object has two properties:\n - status\n - text\n */\n console.log(\"Error: \" + error.text);\n // using \\n for displaying the rest of the output message in a new line\n alert('Error in sending your message: \\n' + error.text);\n }); // the end of method then() for emailjs.send()\n\n /*\n Notice every time we click the submit button of our form,\n we will have our page to be reloaded (refreshed).\n \n This will prevent us from:\n - reading the content of the console window as it will be very fast will disappear quickly.\n - sending the email!\n\n There is a simple trick that we have covered before in our previous lectures \n to prevent the page from being reloaded after calling this function\n\n We just need to do the following two steps:\n 1. Ask this function to return false by adding return false at the very end of the function (last line of the function code)\n 2. We have to add the keyword return before our function name inside the value of the event handler attribute of the HTML \n */\n\n // Return false is required so \"email.min.js\" file can have the time to read the content of the HTML form before being refreshed\n // email.min.js is the minified version of email.js code file that will be run by EmailJS services\n return false; // to prevent the default behaviour of the browser of reloading or refreshing the pages\n}", "function sendMail() {\n let emailTo = toEmail.value;\n let emailFrom = fromEmail.value;\n let uuid = downloadLink.value.split(\"/\").splice(-1, 1)[0];\n const data = {\n uuid,\n emailTo,\n emailFrom,\n };\n fetch(emailUrl, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(data),\n })\n .then((res) => res.json())\n .then((data) => {\n if (data.success) {\n toEmail.value = \"\";\n fromEmail.value = \"\";\n sharingContainer.style.display = \"none\";\n showPrompt(\"Email Sent Successfully\");\n }\n });\n}", "function mail(firstName, lastName, email) { \n //use predefined auth variables to send email with Habitack gmail\n return transporter.sendMail({\n from: 'Habitack Team <[email protected]>', // sender address\n to: email, // list of receivers\n subject: \"Welcome to Habitack!\", // Subject line\n //body\n html: `<h1>Hello ${firstName} ${lastName},</h1> <br /> \n <p>Welcome to your journey towards self improvement! Below is an introduction guide to help get you started</p><br />\n <p>Habitack is a habit tracker designed to facilitate users with tracking goals that can change your life for the better. <br />\n Our job is to calculate your progress and show you results. Your job is to attack daily challenges with the help of habitack. </p> <br />\n <p>Pages: </p> <br />\n <ol> \n <li>Goals Page</li>\n <ul>\n <li>List goals for the user</li>\n <li>Add new goal</li>\n <li>Delete goal</li>\n <li>Add photo to goal</li>\n </ul>\n <li>Stats Page</li>\n <ul>\n <li>Display the stats for a current goal</li>\n </ul>\n <li>Account Page</li>\n <ul>\n <li>Change account information</li>\n </ul>\n </ol>`\n })\n .then(r => console.log(r))\n .catch(e => console.log(e))\n}", "async function main(){\n\n\t\t\t// create reusable transporter object using the default SMTP transport\n\t\t\tlet transporter = nodemailer.createTransport({\n\t\t\t\thost: keys.host,\n\t\t\t\tport: keys.port,\n\t\t\t\tsecure: true, // true for 465, false for other ports\n\t\t\t\tauth: {\n\t\t\t\t\tuser: keys.auth.user,\n\t\t\t\t\tpass: keys.auth.pass\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tlet info = await transporter.sendMail({\n\t\t\t\tfrom: req.body.from,\n\t\t\t\tto: '[email protected]', // list of receivers\n\t\t\t\tsubject: 'New Inquiry From: alonzoalden.com', // Subject line\n\t\t\t\t//text: req.body.from + ' /n ' + req.body.text, // plain text body\n\t\t\t\thtml: 'From: ' + req.body.from + ' <br /><br /> '\n\t\t\t\t\t+ 'Subject: ' + req.body.subject + ' <br /><br /> '\n\t\t\t\t\t+ 'Text: ' + req.body.text\n\t\t\t});\n\n\t\t\tconsole.log(\"Message sent: %s\", info.messageId);\n\t\t\t// Message sent: <[email protected]>\n\n\t\t\t// Preview only available when sending through an Ethereal account\n\t\t\tconsole.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n\t\t\t// Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n\t\t}", "function sendMail(contactForm) {\n // Function copied from Code Institute 'Putting it All Together' project and then modified\n let messageContainer = document.getElementById(\"messages\");\n emailjs.send(\"gmail\", \"read_n_reviewed_template\", {\n \"from_name\": contactForm.name.value,\n \"from_email\": contactForm.email.value,\n \"message\": contactForm.message.value,\n })\n .then(function (response) {\n console.log(\"SUCCESS\", response.status, response.text);\n messageContainer.innerHTML += `<div class=\"row flashed-messages\">\\\n <div class=\"col s12\">\\\n <h4>Your message has been sent.<br>A member of staff will be in touch shortly.</h4>\\\n </div></div>`;\n // Visually clear the form input fields\n contactForm.name.value = \"\";\n contactForm.email.value = \"\";\n contactForm.message.value = \"\";\n }, function (error) {\n console.log(\"FAILED...\", error);\n messageContainer.innerHTML += `<div class=\"row flashed-messages\">\\\n <div class=\"col s12\">\\\n <h4>Error: Your message failed to send. Please try again.</h4>\\\n </div></div>`;\n });\n return false; //to block from loading a new page\n}", "function validate()\n{\n\tvar name, email, state, city, zip, newsletter;\n\tvar nameFlag, emailFlag, stateFlag, cityFlag, zipFlag, newsFlag = 0;\n\tvar message = \"ATTENTION! The following inputs have problems: \";\n\n\tname = document.getElementById(\"name\").value;\n\temail = document.getElementById(\"email\").value;\n\tstate = document.getElementById(\"state\").value;\n\tcity = document.getElementById(\"city\").value;\n\tzip = document.getElementById(\"zip\").value;\n\tif(document.getElementById(\"newsletterY\").checked)\n\t{\n\t\tnewsletter = \"Yes\";\n\t}\n\telse if (document.getElementById(\"newsletterN\").checked)\n\t{\n\t\tnewsletter = \"No\";\n\t}\n\telse\n\t{\n\t\tnewsletter = \"\";\n\t}\n\n//\talert (\"The input is \" +name+\" , \"+email+\" , \"+state+\" , \"+city+\" , \"+zip+\" , \"+newsletter);\n\n\t//Validating the name\n\n\tif(name !== \"\")\n\t{\n\t\tvar letters = /^[a-zA-Z\\s]*$/;\n\t\tif(name.match(letters))\n\t\t{\n\t\t\tnameFlag = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmessage = message + \"\\nThe name field must not be empty and should only contain letters and spaces.\";\n\t\t\tnameFlag = 0;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\tmessage = message + \"\\nThe name field must not be empty and should only contain letters and spaces.\";\n\t\tnameFlag = 0;\n\t}\n\n\t//Validating the email\n\n\tif (email !== \"\")\n\t{\n\t\temailFlag = 1;\n\t}\n\telse\n\t{\n\t\tmessage = message + \"\\nThe email field must not be empty.\";\n\t\temailFlag = 0;\n\t}\n\n\t//Validating the state\n\n\tif(state !== \"default\")\n\t{\n\t\tstateFlag = 1;\n\t}\n\telse\n\t{\n\t\tmessage = message + \"\\nYou must select a valid state.\";\n\t\tstateFlag = 0;\n\t}\n\n\t//Validating the city\n\n\tif(city !== \"\")\n\t{\n\t\tvar letters = /^[a-zA-Z\\s]*$/;\n\t\tif (city.match(letters))\n\t\t{\n\t\t\tcityFlag = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmessage = message + \"\\nThe city name must consist of only letters and spaces.\";\n\t\t\tcityFlag = 0;\n\t\t}\n\t}\n\telse\n\t{\n\t\tcityFlag = 1;\n\t}\n\n\t//Validating the zipcode\n\n\tif(zip !== \"\")\n\t{\n\t\tvar numbers = /^\\d{5}$/;\n\t\tif(zip.length == 5 && zip.match(numbers))\n\t\t{\n\t\t\tzipFlag = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmessage = message + \"\\nThe zipcode must be a five-digit number.\";\n\t\t\tzipFlag = 0;\n\t\t}\n\t}\n\telse\n\t{\n\t\tzipFlag = 1;\n\t}\n\n\t//Validating the Newsletter radio button\n\n\tif(newsletter !== \"\")\n\t{\n\t\tnewsFlag = 1;\n\t}\n\telse\n\t{\n\t\tmessage = message + \"\\nYou must select whether or not you wish to subscribe to the newsletter.\";\n\t\tnewsFlag = 0;\n\t}\n\n\tif(message !== \"ATTENTION! The following inputs have problems: \")\n\t{\n\t\talert(message);\n\t}\n\telse\n\t{\n\t\talert (\"Thank you for your submission. Welcome to the community!\");\n\t}\n}", "function main(data ,done){\n\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n // let account = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n service: 'gmail',\n auth: {\n user: process.env.email, // generated ethereal user\n pass: process.env.password // generated ethereal password\n }\n });\n\n // setup email data with unicode symbols\n let mailOptions = {\n from: '\"HacktivOverflow\" <[email protected]>', // sender address\n to: data.email, // list of receivers\n subject: data.title, // Subject line\n // text: \"Hello world?\", // plain text body\n html: data.message // html body\n };\n\n // send mail with defined transport object\n transporter.sendMail(mailOptions, (err, info) => {\n if (err) {\n console.log(err);\n } else {\n console.log(info);\n done()\n }\n })\n\n // Message sent: <[email protected]>\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n}", "function emailJS() {\n// Function to send information from the form\ndocument.getElementById('emailBtn').addEventListener('click', function(){\n\t// Check that there is a valid email address\n\tvar email = document.getElementById('email').value;\n\tif (email == \"\") {\n\t\tM.toast({html: 'Please enter a valid email address'});\n\t} else {\n\t\t// gather information from form\n\tvar from = document.getElementById('first').value + \" \" + document.getElementById('last').value;\n\tvar org = document.getElementById('org').value; \n\tvar desc = document.getElementById('describe').value;\n// Check all checkboxes \n\tvar checked = document.querySelectorAll('input[type=checkbox]');\n\tvar checkedArray = [];\n\t\tfor (var i = 0; i < checked.length; i++) {\n\t\t\tif (checked[i].checked == true) {\n\t\t\t\tcheckedArray.push(checked[i].id)\n\t\t\t}\n\t\t}\n\tvar message = document.getElementById('textarea1').value;\n// Compose message\n\tfullMessage = \"email: \" + email +\n\t\t\t\t\t\"<br> Organization: \" + org + \n\t\t\t\t\t\"<br> Affiliation: \" + desc +\n\t\t\t\t\t\"<br>Data of interest: \" + checkedArray + \n\t\t\t\t\t\"<br>\" + message;\n// Send email\n\temailjs.send(\"cbrectool_gmail_com\", \"template_4KPMWmIu\", \n\t\t{\"to_name\":\"SERC Staff\",\n\t\t\"from_name\": from,\n\t\t\"message_html\": fullMessage})\n// modal message of success\n\tif (email != \"\") {\n\t\telem = document.getElementById('modal2');\n\t\tinstance = M.Modal.init(elem);\n\t\tinstance.open();\n\t\t\t}\n\t}\n});\n}", "function send_mails_to_volunteers(){\r\n console.log(\"sending alerts\");\r\n document.getElementById(\"mailing_confirmation_id\").innerHTML=\"processing...\";\r\n\r\n\r\n console.log(volunteer_mail_str);\r\n\r\nvar name = getInputVal('name');\r\nvar age = getInputVal('age');\r\nvar sex = getInputVal('sex');\r\nvar bloodGroup = getInputVal('bloodGroup');\r\nvar state = getInputVal('stateSelect');\r\nvar district = getInputVal('districtSelect');\r\nvar email = getInputVal('email');\r\nvar phone = getInputVal('phone');\r\nvar address = getInputVal('address');\r\n\r\n console.log(name+age+sex+bloodGroup+state+district+email+phone+address);\r\n\r\n\r\n var volunteer_mail_str=\"\";\r\n for(volunteer_mail_str of volunteer_mail_arr){\r\n volunter_alerts_mails_sending(name,age,sex,bloodGroup,state,district,email,phone,address,volunteer_mail_str);\r\n\r\n }\r\n \r\n\r\n}", "function sendmail(){\n \n var name = $('#Name').val();\n var email = $('#Email').val();\n var project = $('#Project').val();\n var message = $('#Message').val();\n var Body='Name: '+name+'<br>Email: '+email+'<br>Project: '+project+'<br>Message: '+message;\n\n const errorMessage=document.getElementById('display-message');\n errorMessage.style.padding=\"8px\"\n if(!name){\n errorMessage.innerText='Name is missing';\n return;\n }\n if(!email)\n {\n errorMessage.innerText='Email is missing';\n return;\n }\n if(!project)\n {\n errorMessage.innerText='Projects is missing';\n return;\n }\n if(!message)\n {\n errorMessage.innerText='You must Provide your Message';\n return;\n }\n Email.send({\n \n SecureToken:\"fbf31702-bb7f-4a4e-9c1c-4ccf17ee777f\",\n // SecureToken=\"20b444a2-b3af-4eb8-bae7-911f6097521c\",\n To: '[email protected]',\n From: \"[email protected]\",\n Subject: \"New message on contact from \"+name,\n Body: Body\n }).then(\n message =>{\n const errorMessage=document.getElementById('display-message');\n errorMessage.style.padding=\"8px\"\n \n if(message=='OK'){\n errorMessage.innerText='Your mail has been send. Thank you for connecting.';\n }\n else{\n errorMessage.innerText='There is error at sending message';\n }\n\n }\n );\n \n\n\n\n}", "function send() {\r\n\tcheckName();\r\n\tcheckMessage();\r\n\tcheckEmail();\r\n\t//when all are right, show the successful message in the div which id is sendsuccessfully and return true\r\n\tif(checkName()==true && checkMessage()==true && checkEmail()==true) {\r\n\t\tdocument.getElementById(\"sendsuccessfully\").innerHTML=\"Message successfully sent\";\r\n\t\treturn true;\r\n\t}\r\n\t//if one of name, message and email is not right, return false\r\n\treturn false;\r\n}", "async function main() {\n \n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: \"smtp.live.com\",\n port: 587,\n secure: false, // true for 465, false for other ports\n auth: {\n user: emailData.mailUser,\n pass: emailData.mailPassword, \n },\n });\n \n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: `www.aleksandergorecki.com ${emailData.mailUser}`, // sender address\n to: \"[email protected]\", // list of receivers\n subject: \"New info from www.aleksandergorecki.com\", // Subject line\n text: \"Hello world?\", // plain text body\n html: output, // html body\n });\n \n console.log(\"Message sent: %s\", info.messageId);\n \n // Preview only available when sending through an Ethereal account\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n }", "function sendmail(){\t\n\n\tvar mailOptions = {\n\t from: 'Fred Foo ✔ <[email protected]>', // sender address\n\t to: '[email protected]', // list of receivers\n\t subject: 'Hello ✔', // Subject line\n\t text: 'Hello world ✔', // plaintext body\n\t html: '<b>Hello world ✔</b>' // html body\n\t};\n\n\t// send mail with defined transport object\n\ttransporter.sendMail(mailOptions, function(error, info){\n\t if(error){\n\t console.log(error);\n\t }else{\n\t console.log('Message sent: ' , info);\n\t }\n\t});\n}", "sendEmail() {\n this.validationController.validate().then(errors => {\n if (errors.length === 0) {\n var email = this;\n\n this.api.email.sendToStaff(this.subject, this.message)\n .then(function() {\n log.debug('Email sent succesfully. Rerouting to program page.');\n email.router.navigateToRoute('program');\n });\n }\n });\n }", "async send(data) {\n const from = data.username;\n // 1) Render HTML based on a pug template\n if (!data.template) data.template = \"general\";\n\n const html = pug.renderFile(`${__dirname}/../views/email/${data.template}.pug`, {\n message: data.message,\n title: data.title \n });\n\n // 2) Define email options\n const msg = {\n to: data.email,\n from: email,\n subject: data.subject,\n text: data.message,\n html,\n text: htmlToText.fromString(html)\n };\n \n // 3) Create a transport and send email\n await sgMail.send(msg);\n }", "function sendEmailToUser(address, firstName, lastName, email, phoneNumber, zestimate) {\n const emailText = `Hi ${firstName}!, thank you for signing up! Here are your account details: \n \\n Name: ${firstName}\n \\n Last name: ${lastName}\n \\n Phone: ${phoneNumber !== 'null' ? phoneNumber : ''}\n \\n\\n And here is the zestimate we found for the address: ${address}\n \\n ${zestimate} $ (per month)\n \\n Thank you, \n \\n The Rent-With-Me team :)`;\n const mailOptions = {\n from: companyEmail,\n to: email,\n subject: 'Congrats for joining Rent-With-Me!',\n text: emailText\n };\n transporter.sendMail(mailOptions, function(error, info){\n if (error) {\n console.log(error);\n } else {\n console.log('Email sent: ' + info.response);\n }\n });\n}", "function mailConfirmation(user, info, form, mail, callback) {\n var msg = \"Dear \" + form.firstName + \" \" + form.lastName + \"\\n\\n\";\n msg += \"Thank you for your purchase of \" + form.shares + \" shares on Pool Play.\\n\";\n msg += \"You've been charged $\" + info.price + \".00 for this purchase.\\n\";\n msg += \"If you have any questions, don't hesitate to contact us!\\n\\n\";\n msg += \"Thanks,\\n\";\n msg += \" The Pool Play team\";\n console.log(\"mailto: \" + form.email);\n var mailInfo = {\n from: \"Pool Play <[email protected]>\",\n to: form.email,\n subject: \"Confirmation of your Pool Play purchase\",\n text: msg\n };\n \n var smtpTransport = mail.createTransport(\"SMTP\", {\n service: \"Gmail\",\n auth: {\n user: \"[email protected]\",\n pass: \"165198795\"\n }\n });\n smtpTransport.sendMail(mailInfo, function(error, response) {\n if (error) {\n console.log(error);\n } else {\n console.log(\"Message sent: \" + response.message);\n }\n callback();\n });\n}", "async function main(){\r\n\r\n // Generate test SMTP service account from ethereal.email\r\n // Only needed if you don't have a real mail account for testing\r\n\r\n\r\n // create reusable transporter object using the default SMTP transport\r\n let transporter = nodemailer.createTransport({\r\n host: \"some host\",\r\n port: 465,\r\n secure: true, // true for 465, false for other ports\r\n auth: {\r\n user:\"some user\", // generated ethereal user\r\n pass:\"some password\" // generated ethereal password\r\n }\r\n });\r\n\r\n // setup email data with unicode symbols\r\n let mailOptions = {\r\n from: \"some user\",\r\n to: myMail, // list of receivers\r\n subject: myTask, // Subject line\r\n text: myTekst, // plain text body\r\n html: myTekst // html body\r\n\r\n };\r\n\r\n // send mail with defined transport object\r\n let info = await transporter.sendMail(mailOptions)\r\n\r\n console.log(\"Message sent: %s\", info.messageId);\r\n // Preview only available when sending through an Ethereal account\r\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\r\n\r\n // Message sent: <[email protected]>\r\n // Preview URL: Status change from 1 to 0\r\n}", "function sendMail(contactForm) {\n emailjs.send(\"service_0gbqz3i\", \"template_ouiouibaguette\", {\n \"from_fname\": contactForm.fname.value,\n \"from_lname\": contactForm.lname.value,\n \"from_email\": contactForm.email.value,\n \"message\": contactForm.message.value\n })\n .then(\n function(response) {\n console.log(\"SUCCESS - Email sent\", response);\n $('#contact-form-title').text(\"Thank you!\");\n $('#contact-form-text').text(\"Your email has been sent, we will get back to you soon!\");\n $('#contact-form-content form').hide();\n\n resetForm();\n },\n function(error) {\n console.log(\"FAILED - The email has not been sent\", error);\n $('#contact-form-title').text(\"Oops...\");\n $('#contact-form-text').text(\"It seems something went wrong. We are probably already working on a fix, so try again later!\");\n $('#contact-form-content form').hide();\n\n resetForm();\n }\n );\n return false; // To block from loading a new page\n}", "function sendResponseEmail (recipientEmail, errorObj, dataFileName, submissionTime, formUrl) {\n Logger.log('Function sendResponseEmail has been reached.');\n var successSubject = 'Authorized Vaccination Scheduler Form - Successful Submission';\n var failSubject = 'Authorized Vaccination Scheduler Form - Submission Error';\n var dupeSubject = 'Authorized Vaccination Scheduler Form - Duplicate Request Received';\n var subject = '';\n var message = '';\n \n //if submission was for an individual user account...\n if (!bulk) {\n Logger.log('Not bulk.');\n //...and submission was not a duplicate, then compose success email\n if (!isIndivDupe) { \n subject = successSubject;\n var userInfo = 'User Name: ' + userFirst + ' ' + userLast + '<br>User Email: ' + userEmail + '<br>User Organization: ' + userOrg;\n message = \"Your submission on \" + submissionTime + \" to the \" + '<a href=\\\"' + formUrl + '\">Authorized Schedulers New User Signup</a>' + \" form was successful!<br><br>The following information has been received:<br><br>\" + userInfo + \"<br><br>Please note: It may take up to 24 hours for users to receive their account log-in credentials. Credentials will be sent directly to the email address(es) you provided. Please do not resubmit this form.<br><br>If after 24 hours user(s) have not received the account credentials, first, users should check their spam folders. If nothing is there, please reply and let us know the accounts that are missing.<br><br>-Vaccine Command Center Equity Team<br>\"; \n \n //...and submission was a duplicate, then compose duplicate email \n } else {\n Logger.log('Is dupe');\n subject = dupeSubject;\n message = \"An account has already been requested for the email address \" + userEmail + \". The original request was made by \" + origRespFirst + \" \" + origRespLast + \" on \" + origTime + \" with the following information:<br><br>\"\n + \"User Name: \" + origUserFirst + \" \" + origUserLast + \"<br>User Email: \" + origUserEmail + \"<br>User Organization: \" + origUserOrg + \"<br><br>\"\n + \"Please note: It may take up to 24 hours for users to receive their account log-in credentials. Credentials will be sent directly to the email address provided. Please do not resubmit this form.<br><br>If after 24 hours user(s) have not received the account credentials, first, users should check their spam folders. If nothing is there, please reply and let us know the accounts that are missing.<br><br>-Vaccine Command Center Equity Team<br>\";\n Logger.log('Message: ' + message);\n } \n \n //if submission was a bulk upload...\n } else if (bulk) {\n \n //...and submission was valid, then compose success email\n if (isValid) {\n subject = successSubject;\n message = \"Your submission of \" + dataFileName + \" on \" + submissionTime + \" to the \" + '<a href=\\\"' + formUrl + '\">Authorized Schedulers New User Signup</a>' + \" form was successful!<br><br>Please note: It may take up to 24 hours for users to receive their account log-in credentials. Credentials will be sent directly to the email address(es) you provided. Please do not resubmit this form.<br><br>If after 24 hours user(s) have not received the account credentials, first, users should check their spam folders. If nothing is there, please reply and let us know the accounts that are missing.<br><br>-Vaccine Command Center Equity Team<br>\";\n \n //...and submission was invalid, then compose fail email \n } else {\n \n subject = failSubject;\n \n // combine failStrings into one message\n var errorString = '';\n Object.values(errorObj).forEach(validObj => {\n if (!validObj.valid) {\n errorString += validObj.failString;\n }\n });\n \n //set the message\n message = \"Your submission of \" + dataFileName + \" on \" + submissionTime + \" to the Authorized Schedulers New User Signup form failed for the following reasons:<br>\" + errorString + \"<br>Please resubmit with corrections at \" + formUrl + \", thank you!<br><br>-Vaccine Command Center Equity Team<br>\"; \n } //close invalid \n \n } //close bulk\n \n //set the components of the email\n var emailTemplate = {\n to: recipientEmail,\n subject: subject,\n htmlBody: message,\n name: 'NYC Vaccine Command Center Equity Team',\n replyTo: '[email protected]'\n }\n \n //send the email\n MailApp.sendEmail(emailTemplate);\n return message; \n }", "async send(options) {\n // 1) Parse HTML\n const html = await util.promisify(fs.readFile)(\n `${__dirname}/../mail_templates/${options.templateName}.html`,\n {\n encoding: 'utf-8',\n }\n );\n\n let ParsedHtml = html.replace('{%URL%}', this.url);\n\n if (options.organization) {\n ParsedHtml = ParsedHtml.replace('{%ORG_NAME%}', options.organization.name);\n ParsedHtml = ParsedHtml.replace(\n '{%ORG_PROFILE__PICTURE%}',\n options.organization.profilePicture\n );\n }\n\n // 2) Define email options\n const mailOptions = {\n from: this.from,\n to: this.to,\n subject: options.subject,\n html: ParsedHtml,\n text: options.plainText,\n };\n\n // 3) Create a transport and send email\n await this.newTransport().sendMail(mailOptions, function (error, info) {\n if (error) {\n console.log('Email error: ' + error.message);\n } else {\n console.log('Email sent to: ' + mailOptions.to);\n }\n });\n }", "function mailSend(){\r\n\t\t\r\n\t\talert(\"Τhe e-mail has been sent!!!\");\r\n\t\t\r\n\t\t// Clear Form\r\n\t\tvar nameStr=document.getElementById(\"fullName\").value = \"\";\r\n\t\tvar mailStr=document.getElementById(\"email\").value = \"\";\r\n\t\tvar textSt=document.getElementById(\"textAr\").value = \"\";\r\n\t\t\r\n\t\treturn false;\t\t\r\n\t}", "function sendMail(contactForm) {\n emailjs.send(\"girls on the run\", \"Run\", {\n \"from_name\": contactForm.name.value,\n \"from_email\": contactForm.emailaddress.value,\n \"message\": contactForm.message.value,\n\n })\n .then(\n function (response) {\n console.log(\"SUCCESS\", response);\n contactForm.name.value = \"\"\n contactForm.emailaddress.value = \"\"\n contactForm.message.value = \"\"\n\n // show message when form sent\n $(document).ready(function () {\n $('#email-sent').show();\n });\n\n\n },\n function (error) {\n console.log(\"FAILED\", error);\n }\n );\n return false;\n}", "async function main(email, otp) {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n let testAccount = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: \"smtp.ethereal.email\",\n port: 587,\n secure: false, // true for 465, false for other ports\n auth: {\n user: '[email protected]',\n pass: 'qcAufJ9Dn3NwXq2yxh'\n },\n });\n\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: 'Fred Foo 👻\" <[email protected]>', // sender address\n to: email, // list of receivers\n subject: \"OTP Secure✔\", // Subject line\n text: \"Hello world?\", // plain text body\n html: `<div style=\"font-family: Helvetica,Arial,sans-serif;min-width:1000px;overflow:auto;line-height:2\">\n <div style=\"margin:50px auto;width:70%;padding:20px 0\">\n <div style=\"border-bottom:1px solid #eee\">\n <a href=\"\" style=\"font-size:1.4em;color: #00466a;text-decoration:none;font-weight:600\">Doctor Mine</a>\n </div>\n <p style=\"font-size:1.1em\">Hi,</p>\n <p>Thank you for choosing Doctor Mine. Use the following OTP to complete your Sign Up procedures. OTP is valid for 5 minutes</p>\n <h2 style=\"background: #00466a;margin: 0 auto;width: max-content;padding: 0 10px;color: #fff;border-radius: 4px;\">`+ otp + `</h2>\n <p style=\"font-size:0.9em;\">Regards,<br />Doctor Mine</p>\n <hr style=\"border:none;border-top:1px solid #eee\" />\n <div style=\"float:right;padding:8px 0;color:#aaa;font-size:0.8em;line-height:1;font-weight:300\">\n <p>Doctor Mine</p>\n <p>1FUTA WEST GATEy</p>\n <p>Nigeria</p>\n </div>\n </div>\n </div> ` , // html body\n });\n\n console.log(\"Message sent: %s\", info.messageId);\n // Message sent: <[email protected]>\n\n // Preview only available when sending through an Ethereal account\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n}", "function btn() {\n var name = document.getElementById('artistName').value;\n var email = document.getElementById('email').value;\n var phone = document.getElementById('phoneNum').value;\n var message = document.getElementById('statement').value;\n var artTitle = document.getElementById('artworkTitle').value;\n var body = \"\";\n\n\n if (name != \"\" && email != \"\" && phone != \"\" && message != \"\" && artTitle != \"\") {\n var valid = true;\n\n } else {\n var valid = false;\n }\n\n if (valid) {\n body = \"Dear Art Gallery,%0D%0A%0D%0A\" +\n artTitle + \" is the title of this art piece.%0D%0A\" +\n \"Here is a statement about this piece: %0D%0A\" +\n message + \"%0D%0A%0D%0A\" +\n \"Thank you,%0D%0A\" +\n name + \"%0D%0A\" +\n email + \"%0D%0A\" +\n phone;\n\n // constructed the body of the message above.\n window.open('mailto:[email protected]?subject=Artwork Submission&body=' + body);\n alert('Thank you for the submission! If we choose your artwork, we will be in contact shortly.');\n\n\n } else {\n alert(\"Please fill in all fields.\");\n }\n}", "function sendEmail(e) {\n e.preventDefault();\n emailjs.sendForm('gmail', 'template_pz4qfec', e.target, 'user_HYImqyNA2H0p8YsBrLgBT')\n .then((result) => {\n console.log(result.text);\n setMail('success')\n }, (error) => {\n console.log(error.text);\n setMail('error')\n });\n setEmail('')\n setMessage('')\n setName('')\n \n }", "function sendMail(contactForm) {\n emailjs.send(\"gmail\", \"newsletter\", {\n \"from_firstname\": contactForm.firstname.value,\n \"from_lastname\": contactForm.lastname.value,\n \"from_email\": contactForm.emailaddress.value\n })\n .then(\n function(response) {\n console.log(\"SUCCESS\", response);\n // Shows modal when the all fields have been completed in the form and the user has clicked on the submit button\n $(\"#myModal\").modal(\"toggle\");\n $(\"#close-modal\").click(function() {\n location.reload();\n });\n },\n function(error) {\n console.log(\"FAILED\", error);\n },\n );\n return false; // To block from loading a new page\n}", "function sendMail() {\n document.getElementById('contact-form').addEventListener('submit', async function (event) {\n event.preventDefault();\n const output = `\n <p>You have a new contact request</p>\n <h3>Contact Details</h3>\n <ul>\n <li>Name: ${this.name.value}</li>\n <li>Fone: ${this.fone.value}</li>\n <li>Email: ${this.email.value}</li>\n </ul>\n <h3>Message</h3>\n <p>${this.textMessage.value}</p>\n `;\n const nome = this.name.value;\n await Email.send({\n SecureToken: \"a1f72705-1616-4b97-adbc-332baa92ee34\",\n To: '[email protected]',\n From: \"[email protected]\",\n\n Subject: this.subject.value,\n Body: output\n }).then(\n /* message => alert(`Obrigado pela visita Sr(a) ${nome}, entrarei em contato o mais breve possível!`) */\n message => modalSet('modal-confirm', `Obrigado pela visita Sr(a) ${nome}, entrarei em contato o mais breve possível! Tenha um excelente dia.`)\n );\n document.getElementById('contact-form').reset();\n });\n}", "async function main() {\n // create reusable transporter object using the default SMTP transport\n var transporter = nodemailer.createTransport({\n host: \"smtp.gmail.com\", // hostname\n auth: {\n user: \"[email protected]\",\n pass: \"Moon_2021!\",\n },\n });\n\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: email, // sender address\n to: \"[email protected]\", // list of receivers\n subject: email, // Subject line\n text: message, // plain text body\n html: message, // html body\n });\n\n console.log(\"Message sent: %s\", info.messageId);\n // Message sent: <[email protected]>\n }", "function sendMail(contactform) {\n emailjs.send(\"gmail\", \"patagonianexperience\", {\n \"first_name\": contactform.firstname.value,//Link to contactForm input on contact page\n \"last_name\": contactform.lastname.value,\n \"from_email\": contactform.emailaddress.value,\n \"travel_query\": contactform.query.value\n })\n .then(\n function(response) {\n console.log(\"SUCCESS\", response);\n },\n function(error) {\n console.log(\"FAILED\", error);\n }\n );\n return false; // To block from loading a new page\n}", "function sendMail(contactForm) {\n emailjs\n .send(\"gmail\", \"googleplaces_milestoneproject\", {\n from_name: contactForm.fullname.value,\n from_email: contactForm.emailaddress.value,\n project_request: contactForm.textarea.value\n })\n .then(\n function(response) {\n if (submit_fail) {\n submit_fail.classList.add(\"d-none\");\n }\n resetForm();\n submit_success.classList.remove(\"d-none\");\n setTimeout(() => {\n submit_success.classList.add(\"d-none\");\n }, 3000);\n console.log(\"SUCCESS\", response);\n },\n function(error) {\n submit_fail.classList.remove(\"d-none\");\n console.log(\"FAILED:\",error, response);\n }\n );\n return false;\n}", "async function received(params ) {\n let transporter = nodemailer.createTransport(smtpTransport({\n host: \"mail.hiltonparkerng.com\",\n tls:{\n rejectUnauthorized: false\n },\n port: 465,\n secure: true,\n auth: {\n user: '[email protected]', \n pass: process.env.MAIL_PASSWORD\n },\n }));\n\n\n let info = await transporter.sendMail({\n from: '\"Hilton Parker Services\" <[email protected]>',\n to: `${params.email}`,\n subject:`Application Received`,\n html: ` \n <!doctype html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <title></title>\n <style>\n /* -------------------------------------\n INLINED WITH htmlemail.io/inline\n ------------------------------------- */\n /* -------------------------------------\n RESPONSIVE AND MOBILE FRIENDLY STYLES\n ------------------------------------- */\n @media only screen and (max-width: 620px) {\n table[class=body] h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important;\n }\n table[class=body] p,\n table[class=body] ul,\n table[class=body] ol,\n table[class=body] td,\n table[class=body] span,\n table[class=body] a {\n font-size: 16px !important;\n }\n table[class=body] .wrapper,\n table[class=body] .article {\n padding: 10px !important;\n }\n table[class=body] .content {\n padding: 0 !important;\n }\n table[class=body] .container {\n padding: 0 !important;\n width: 100% !important;\n }\n table[class=body] .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important;\n }\n table[class=body] .btn table {\n width: 100% !important;\n }\n table[class=body] .btn a {\n width: 100% !important;\n }\n table[class=body] .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important;\n }\n }\n\n /* -------------------------------------\n PRESERVE THESE STYLES IN THE HEAD\n ------------------------------------- */\n @media all {\n .ExternalClass {\n width: 100%;\n }\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%;\n }\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important;\n }\n #MessageViewBody a {\n color: inherit;\n text-decoration: none;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .btn-primary table td:hover {\n background-color: #34495e !important;\n }\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important;\n }\n }\n </style>\n </head>\n <body class=\"\" style=\"background-color: #f6f6f6; font-family: sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;\">\n <span class=\"preheader\" style=\"color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;\"></span>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #f6f6f6;\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">&nbsp;</td>\n <td class=\"container\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; display: block; Margin: 0 auto; max-width: 580px; padding: 10px; width: 580px;\">\n <div class=\"content\" style=\"box-sizing: border-box; display: block; Margin: 0 auto; max-width: 580px; padding: 10px;\">\n\n <!-- START CENTERED WHITE CONTAINER -->\n <table class=\"main\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: #ffffff; border-radius: 3px;\">\n\n <!-- START MAIN CONTENT AREA -->\n <tr>\n <td class=\"wrapper\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; box-sizing: border-box; padding: 20px;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Dear ${params.firstname + ' ' + params.lastname}</p>\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Your Application is under review,\n <br>\n Our Agent Officers will get back to you<br> \n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Thank you.</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n\n <!-- END MAIN CONTENT AREA -->\n </table>\n\n <!-- START FOOTER -->\n <div class=\"footer\" style=\"clear: both; Margin-top: 10px; text-align: center; width: 100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\">\n <tr>\n <td class=\"content-block\" style=\"font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: #999999; text-align: center;\">\n <span class=\"apple-link\" style=\"color: #999999; font-size: 12px; text-align: center;\">1 Rahman Adeboyejo St, Lekki Phase I, Lagos</span>\n </td>\n </tr>\n <tr>\n <td class=\"content-block powered-by\" style=\"font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: #999999; text-align: center;\">\n <a href=\"www.hiltonparkerng.com\" style=\"color: #999999; font-size: 12px; text-align: center; text-decoration: none;\">www.hiltonparkerng.com</a>.\n </td>\n </tr>\n </table>\n </div>\n <!-- END FOOTER -->\n\n <!-- END CENTERED WHITE CONTAINER -->\n </div>\n </td>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">&nbsp;</td>\n </tr>\n </table>\n </body>\n </html>\n `\n });\n\n}", "function testEmail(doSort, AddAnn, AddComic) {\r\n\r\nvar subject = \"Test Newsletter Week \" + getWeek();\r\nvar body = createEmail(AddAnn, AddComic, doSort);\r\nvar recipient = userEmail;\r\n\r\nsendAndSaveEmail(subject, recipient, body, false);\r\n}", "function sendMail(contactForm) {\n emailjs.send(\"template_ho1z60q\", \"Learn Gaeilge for Primary School\", {\n \"from_name\": contactForm.name.value,\n \"from_email\": contactForm.emailaddress.value,\n \"message\": contactForm.message.value\n })\n .then(\n function (response) {\n alert(\"Thanks for contacting Learn Gaeilge\");\n window.location.replace(\"/\");\n },\n function (error) {\n alert(\"Whoops! There seems to be a problem. Please try again.\");\n });\n return false;\n \n\n}", "async function main(data) {\n // create reusable transporter object using the default SMTP transport\n var transporter = nodemailer.createTransport({\n service: 'Gmail',\n auth: {\n user: process.env.OFFICER_EMAIL,\n pass: process.env.OFFICER_EMAIL_PASS\n }\n });\n\n // setup email data with unicode symbols\n let mailOptions = {\n from: `\"Fauzan Bank 👻\" <${process.env.OFFICER_EMAIL}>`, // sender address\n to: data.email, // list of receivers\n subject: `${data.subject} ✔`, // Subject line\n text: `${data.text}` // plain text body\n };\n\n // send mail with defined transport object\n transporter.sendMail(mailOptions)\n}", "async function main() {\r\n let transporter = nodemailer.createTransport({\r\n host: `${keys.host}`, // Make sure to set up these in the config file.\r\n port: `${keys.port}`, // Refer to your email provider for your mail provider's configuration.\r\n secure: false,\r\n auth: {\r\n user: `${keys.user}`,\r\n pass: `${keys.password}`,\r\n },\r\n });\r\n\r\n let subject = date.getMonth + \" \" + date.getDate\r\n\r\n let info = await transporter.sendMail({\r\n from: `${keys.from}`,\r\n to: `${keys.to}`,\r\n subject: subject,\r\n text: \"Hello, Email World.\",\r\n html: undefined, // none, we are using text\r\n });\r\n\r\n console.log(\"Message Sent: %s\", info.subject);\r\n}", "async function main() {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n// let testAccount = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: \"smtp.163.com\",\n port: 465,\n secure: true, // true for 465, false for other ports\n auth: {\n user: '[email protected]', // generated ethereal user\n pass: '93thing51' // generated ethereal password\n }\n });\n\n var date=new Date()\n var currentDate=date.toLocaleDateString()\n\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: '\"认证邮件\" <[email protected]>', // sender address\n to: \"[email protected]\", // list of receivers\n subject: \"[QA][周报]李黎明工作周报\", // Subject line\n text: \"Hello world?\", // plain text body\n html: `<!doctype html>\n <html lang='en'>\n \n <head>\n <!-- Required meta tags -->\n <meta charset='utf-8'>\n <meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'>\n <title>email</title>\n <style>\n table,td,th\n {\n border:1px solid green;\n }\n th\n {\n background-color:green;\n color:white;\n }\n </style>\n </head>\n \n <body>\n <div>\n <p>Hi all:</p>\n <br>\n <p>这是我上周(20200330-20200403)的工作周报,内容如下:</p>\n <b>一、A15 QA 工作量统计数据:</b>\n <table>\n <thead>\n <tr>\n <th>产品代号</th>\n <th>策划人数</th>\n <th>程序人数</th>\n <th>QA 人数</th>\n <th>测试单量</th>\n <th>人均测试单量</th>\n <th>bug 数量</th>\n <th>人均 bug 数量</th>\n <th>缺陷率</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>A15</td>\n <td>6</td>\n <td>10</td>\n <td>2</td>\n <td>10</td>\n <td>5</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n </tr>\n </tbody>\n </table>\n <br>\n <b>二、项目组情况及本周工作计划:</b>\n <ol>\n <li>测试各游戏在平台过审环境的情况</li>\n <li>学习 ODC UI 布局方案</li>\n <li>odc 系统和发烧游戏平台日常回归测试</li>\n </ol>\n \n <b>三、上周工作内容总结及完成情况:</b>\n <table>\n <thead>\n <tr>\n <th>序号</th>\n <th>系统</th>\n <th>任务单内容</th>\n <th>负责人员</th>\n <th>完成日期</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>1</td>\n <td>others</td>\n <td>delivery the test materials of coin reward game.</td>\n <td>李黎明</td>\n <td>30 Mar-5 Apr 2020</td>\n </tr>\n <tr>\n <td>2</td>\n <td>oddish</td>\n <td>testing the system adujustments for mournting activities in staging env.</td>\n <td>李黎明</td>\n <td>30 Mar-5 Apr 2020</td>\n </tr>\n <tr>\n <td>3</td>\n <td>skills</td>\n <td>study the acknowledge of mixins and filters.</td>\n <td>李黎明</td>\n <td>30 Mar-5 Apr 2020</td>\n </tr>\n <tr>\n <td>4</td>\n <td>oddish</td>\n <td>testing the system adujustments for mournting activities in release env.</td>\n <td>李黎明</td>\n <td>30 Mar-5 Apr 2020</td>\n </tr>\n <tr>\n <td>5</td>\n <td>skills</td>\n <td>study the knowledge of Vue Router.</td>\n <td>李黎明</td>\n <td>30 Mar-5 Apr 2020</td>\n </tr>\n </tbody>\n </table>\n <br>\n <p>谢谢!</p>\n \n <br>\n <br>\n <br>\n \n <p>`+currentDate+`</p>\n <p>——————————</p>\n <p><small>QA|李黎明</small></p>\n <p><small>Email/POPO:[email protected]</small></p>\n <p><small>Tel: 13268314162</small></p>\n </div>\n <script src=\"trello_operation.js\"></script>\n </body>\n \n </html>`// html body\n });\n\n console.log(\"Message sent: %s\", info.messageId);\n // Message sent: <[email protected]>\n\n // Preview only available when sending through an Ethereal account\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n}", "function sendMail(){\n async function main() {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n // let testAccount = await nodemailer.createTestAccount();\n \n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: \"gmail\", // true for 465, false for other ports\n auth: {\n user: '[email protected]', // generated ethereal user\n pass: '*peter319645296@', // generated ethereal password\n },\n });\n \n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: '\"[email protected]', // sender address\n to: \"[email protected]\", // list of receivers\n subject: \"Hello ✔\", // Subject line\n text: \"Hello world!\", // plain text body\n // html body\n });\n \n console.log(\"Message sent: %s\", info.messageId);\n // Message sent: <[email protected]>\n \n // Preview only available when sending through an Ethereal account\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n }\n}", "async function main() {\n\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n let testAccount = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: \"smtp.ethereal.email\",\n port: 587,\n secure: false, // true for 465, false for other ports\n auth: {\n user: testAccount.user, // generated ethereal user\n pass: testAccount.pass // generated ethereal password\n }\n });\n\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from:`admin <${req.body.email}>`, // sender address\n to: \"[email protected]\", // list of receivers\n subject: `Application - ${req.body.subject}`, // Subject line\n html: output,\n });\n\n console.log(\"Message sent: %s\", info.messageId);\n // Message sent: <[email protected]>\n\n // Preview only available when sending through an Ethereal account\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n \n res.render('contact')\n \n }", "async function contactus(msg) {\n let transporter = nodemailer.createTransport(smtpTransport({\n host: \"mail.hiltonparkerng.com\",\n tls:{\n rejectUnauthorized: false\n },\n port: 465,\n secure: true,\n auth: {\n user: '[email protected]',\n pass: process.env.MAIL_PASSWORD \n },\n }));\n\n\n let info = await transporter.sendMail({\n from: '\"Hilton Parker Services\" <[email protected]>',\n to: '[email protected]', \n subject: 'Contact us form',\n html: ` \n <!doctype html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <title>Simple Transactional Email</title>\n <style>\n /* -------------------------------------\n INLINED WITH htmlemail.io/inline\n ------------------------------------- */\n /* -------------------------------------\n RESPONSIVE AND MOBILE FRIENDLY STYLES\n ------------------------------------- */\n @media only screen and (max-width: 620px) {\n table[class=body] h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important;\n }\n table[class=body] p,\n table[class=body] ul,\n table[class=body] ol,\n table[class=body] td,\n table[class=body] span,\n table[class=body] a {\n font-size: 16px !important;\n }\n table[class=body] .wrapper,\n table[class=body] .article {\n padding: 10px !important;\n }\n table[class=body] .content {\n padding: 0 !important;\n }\n table[class=body] .container {\n padding: 0 !important;\n width: 100% !important;\n }\n table[class=body] .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important;\n }\n table[class=body] .btn table {\n width: 100% !important;\n }\n table[class=body] .btn a {\n width: 100% !important;\n }\n table[class=body] .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important;\n }\n }\n\n /* -------------------------------------\n PRESERVE THESE STYLES IN THE HEAD\n ------------------------------------- */\n @media all {\n .ExternalClass {\n width: 100%;\n }\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%;\n }\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important;\n }\n #MessageViewBody a {\n color: inherit;\n text-decoration: none;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .btn-primary table td:hover {\n background-color: #34495e !important;\n }\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important;\n }\n }\n </style>\n </head>\n <body class=\"\" style=\"background-color: #f6f6f6; font-family: sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;\">\n <span class=\"preheader\" style=\"color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;\">Contact us Mail</span>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #f6f6f6;\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">&nbsp;</td>\n <td class=\"container\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; display: block; Margin: 0 auto; max-width: 580px; padding: 10px; width: 580px;\">\n <div class=\"content\" style=\"box-sizing: border-box; display: block; Margin: 0 auto; max-width: 580px; padding: 10px;\">\n\n <!-- START CENTERED WHITE CONTAINER -->\n <table class=\"main\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: #ffffff; border-radius: 3px;\">\n\n <!-- START MAIN CONTENT AREA -->\n <tr>\n <td class=\"wrapper\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; box-sizing: border-box; padding: 20px;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Hi there,</p>\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">This is a contact us message.<br>\n Find the contact information below:<br>\n\n NAME : ${msg.name},<br>\n EMAIL: ${msg.email},<br>\n MESSAGE: ${msg.message}<br>\n\n \n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Kindly act upon...</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n\n <!-- END MAIN CONTENT AREA -->\n </table>\n\n <!-- START FOOTER -->\n <div class=\"footer\" style=\"clear: both; Margin-top: 10px; text-align: center; width: 100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\">\n <tr>\n <td class=\"content-block\" style=\"font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: #999999; text-align: center;\">\n <span class=\"apple-link\" style=\"color: #999999; font-size: 12px; text-align: center;\">1 Rahman Adeboyejo St, Lekki Phase I, Lagos</span>\n </td>\n </tr>\n <tr>\n <td class=\"content-block powered-by\" style=\"font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: #999999; text-align: center;\">\n <a href=\"www.hiltonparkerng.com\" style=\"color: #999999; font-size: 12px; text-align: center; text-decoration: none;\">www.hiltonparkerng.com</a>.\n </td>\n </tr>\n </table>\n </div>\n <!-- END FOOTER -->\n\n <!-- END CENTERED WHITE CONTAINER -->\n </div>\n </td>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">&nbsp;</td>\n </tr>\n </table>\n </body>\n </html>\n `\n });\n\n}", "function processForm(){\t\n\t//set an error message variable (start as an empty string)\n\tvar msg = \"\";\n\t\n\t//validate the name! (call a function to do this)\n\tvar name = checkName();\n\t//check for a return...if it is returned, set error variable to false\n\tif(name == true){\n\t\tmsg\t= false;\n\t}\t\n\t\n\t//validate email!\n\tvar email = checkEmail();\n\t//check for a return...\n\tif(email == true){\n\t\tmsg = false;\t\n\t}\n\t\n\t//validate select menus\n\t//this is easier if we use separate functions, because here we only have to check for false (if they have entered something correct, no reason to change it). modifying the original functions to work both on submit and on change would be harder, though certainly possible. something for them to consider in the future.\n\tvar charType = theForm.charType;\n\t\n\tif(charType.options[charType.selectedIndex].value == \"X\"){\n\t\tcharType.parentNode.childNodes[5].innerHTML = '<span class=\"error\">Please choose a character.</span>';\n\t\tmsg = false;\n\t}\n\t\n\tvar job = theForm.charJob;\n\t\n\tif(job.options[job.selectedIndex].value == \"X\"){\n\t\tjob.parentNode.childNodes[5].innerHTML = '<span class=\"error\">Please choose a job.</span>';\n\t\tmsg = false;\n\t}\n\t\n\t\n\t/*validate checkbox*/\n\tvar spam = checkChecker();\n\tif(spam == true){\n\t\tmsg = false;\t\n\t}\n\t\n\t//finally, check for errors\n\tif(msg == false){\n\t\t//return false, normally, but we are always returning false\tfor testing purposes\n\t}else{\n\t\t//submit form\n\t}\n\t//alert(msg);\n\t//prevent form from submitting\n\treturn false;\n}", "function sendResultMail(resultdata,answerDetail,studentEmail){\n\n var FROM_ADDRESS = '[email protected]';\n var TO_ADDRESS = studentEmail;\n var html = \"\";\n var SUBJECT = 'Test Results';\n var greetingStr = \"\";\n var answerData = \"<table><tr><th>Question</th><th>Your Answer</th></tr>\"\n\n if(resultdata['pass_fail']==1){\n greetingStr = \"Congratulation! You passed test successfully <br/>\";\n } else {\n greetingStr = \"Oops, You did not Pass. <br/>\";\n }\n\n answerDetail.forEach(function(value,key){\n answerData = \"<tr>\";\n answerData += \"<td>\" + value['question_text'] + \"</td>\";\n answerData += \"<td>\" + value['your_answer'] + \"</td>\";\n answerData = \"</tr>\";\n });\n\n answerData += \"</table>\";\n\n var footer = \"Best regards,<br>The Certspring Team<br>\" +\n \"[email protected]\";\n\n html = greetingStr + answerData + footer;\n\n mailer.sendMail(FROM_ADDRESS, TO_ADDRESS, SUBJECT, html, function(err, success){\n if(err){\n throw new Error('Problem sending email to: ' + TO_ADDRESS);\n }\n // Yay! Email was sent, now either do some more stuff or send a response back to the client\n res.send('Email sent: ' + success);\n });\n}", "function sendMail(contactForm) {\n emailjs.send(\"service_htxlx5m\",\"template_hcxua4p\", {\n \"message\": contactForm.message.value,\n \"from_email\": contactForm.emailaddress.value,\n \"from_name\": contactForm.name.value\n })\n .then(\n function(response) {\n alert(\"Thank you, your form has been submitted.\")\n location.reload();\n },\n function(error) {\n console.log(\"FAILED\", error);\n });\n return false; //To block from loading a new page\n}", "function sendEmail(variables) {\n \"use strict\";\n var xmlhttp;\n if (window.XMLHttpRequest) {\n xmlhttp = new XMLHttpRequest(); \n }\n \n xmlhttp.open(\"POST\",\"http://localhost/interviewQuest/email.php\",true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(variables);\n hideContactForm();\n document.getElementById(\"feedbackText\").innerHTML=\"This might take a few seconds. Thank you for submitting your comment.\";\n showFeedback();\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {\n var response = xmlhttp.responseText;\n document.getElementById(\"feedbackText\").innerHTML = response;\n $(\"#cancelButton2\").prop('disabled', false);\n document.getElementById(\"cancelButton2\").innerHTML = \"Close\";\n clearForm();\n }\n }\n \n}", "async function main() {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n let testAccount = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: process.env.SMTP_HOST,\n port: process.env.SMTP_PORT,\n secure: true, // true for 465, false for other ports\n auth: {\n user: process.env.SITE_EMAIL_ADDRESS, // generated ethereal user\n pass: process.env.SITE_EMAIL_PASSWD // generated ethereal password\n },\n });\n \n let info = await transporter.sendMail({\n from: process.env.SITE_EMAIL_USER, \n to:props.recipientEmail,\n subject: \"Reset Your Password on Dig2Pin\", \n // text: \"Hello world?\", \n html: '<div><p>Hi '+props.recipientEmail+'</p><div><p> We have received your request to reset your password. Please follow the link below to reset your password. </p><ul><li><a href=' + props.forgotPasswordUrl + '> Reset Password </a></li></ul><p>If you didn’t ask for your password to be reset, you can safely ignore this email.</p></div></div></body>',\n });\n }", "function sendMail(contactForm) {\n emailjs.send(\"gmail\", \"template_vn6mied\", {\n \"name\": contactForm.name.value, \n \"email_address\": contactForm.email.value, \n \"feedback\": contactForm.feedback.value,\n })\n .then(\n function(response) {\n $(\"#full_name\").val(\"\");\n $(\"#email_address\").val(\"\");\n $(\"#feedback\").val(\"\");\n $(\"#sendButton\").html(\"<i class='far fa-check-square'></i>Message sent!\");\n $(\"#sendButton\").prop('disabled', true);\n },\n\n function(error) {\n alert(\"Please complete all fields.\");\n }\n );\n return false;\n}", "function Email(emailAddress, emailMessage, signature) {\n\n if (emailAddress == null | emailMessage == null | signature == null) {\n alert (\"You did not fill in all the fields.\\n\\nPlease try again\")\n } else {\n\n var emailMessageString = emailMessage.value + \" --- \" + signature\n\n sendEmail(emailAddress, emailMessageString, signature) \n }\n}", "async function sendEmail(details, receiver) {\n console.log(receiver, 'RECEIVER EMAIL')\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n pool: true,\n host: 'cmail01.mc-host24.de',\n port: 25,\n secure: false, // true for 465, false for other ports\n auth: {\n user: drgnNoreplyEmail.user, // generated ethereal user\n pass: drgnNoreplyEmail.password // generated ethereal password\n }\n });\n\n const username = await getUserByToken(details.dragonflyToken)\n\n // setup email data with unicode symbols\n let mailOptions = {\n from: `\"Dragonfly Store\" ${drgnNoreplyEmail.user}`, // sender address\n // bcc: `${receiver}, [email protected]`, list of receivers\n to: receiver,\n subject: 'Order confirmation', // Subject line\n text: `Hey ${username}, thank you for purchasing ${details.itemName} from our Shop.`,\n html: `\n<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Document</title>\n</head>\n<style>\n @import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&display=swap');\n\n * {\n font-family: Rubik;\n }\n\n * {\n font-size: 1rem;\n }\n\n a[href] {\n color: #15c;\n }\n\n b,\n strong {\n font-weight: 500;\n }\n</style>\n\n<body>\n <div>\n\n <table cellpadding=\"0\" cellspacing=\"0\" style=\"border-radius:4px;border:1px #ccc solid;font-size:12.8px\"\n border=\"0\" align=\"center\">\n <tbody>\n <tr>\n <td colspan=\"3\" height=\"20\"></td>\n </tr>\n <tr style=\"line-height:0px;\">\n <td width=\"100%\" style=\"font-size:0px;\" align=\"center\" height=\"1\">\n <img width=\"40px\" style=\"max-height:73px;width:160px\" alt=\"\"\n src=\"https://playdragonfly.net/assets/Dragon.png\" class=\"CToWUd hoverZoomLink\">\n </td>\n </tr>\n <tr>\n <td>\n <table cellpadding=\"0\" cellspacing=\"0\" style=\"line-height:25px\" border=\"0\" align=\"center\">\n <tbody>\n <tr>\n <td colspan=\"3\" height=\"20\"></td>\n </tr>\n <tr>\n <td width=\"36\"></td>\n <td width=\"454\" align=\"left\" valign=\"top\">\n <p>Hey <b>${username}</b>,</p>\n <p><span>Thank you for your purchase! This email confirms that we have received\n your\n payment and you should receive your items soon. If you do not receive\n your\n items within the next hour, please contact our support. Please do not\n email\n Mojang.</span></p>\n\n <p>\n <strong>Order summary: </strong>\n </p>\n <p>\n </p>\n <ul>\n <li>1 <b>x</b> ${details.itemName}</li>\n </ul>\n <div><b>Total</b>: <b>${convertToEuros(details.receivedAmount).toFixed(2)} ${(details.receivedCurrency).toUpperCase()}</b></div>\n <p>For further questions we are available on our <a href=\"https://icnet.dev/discord\">Discord</a> server and by <a href=\"mailto:[email protected]\">email</a>.\n </p>\n <a href=\"https://store.playdragonfly.net/?utm_source=store&utm_medium=email&utm_campaign=purchase_confirmation\" target=\"_blank\">Store</a> - <a href=\"https://ideas.playdragonfly.net/?utm_source=store&utm_medium=email&utm_campaign=purchase_confirmation\" target=\"_blank\">Ideas</a> - <a href=\"https://playdragonfly.net/releasenotes?utm_source=store&utm_medium=email&utm_campaign=purchase_confirmation\" target=\"_blank\">Updates</a>\n </td>\n <td width=\"36\"></td>\n </tr>\n <tr>\n <td colspan=\"3\" height=\"36\"></td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n</body>\n\n</html>\n` // html body\n };\n\n // send mail with defined transport object\n transporter.sendMail(mailOptions, (error, info) => {\n if (error) {\n return console.log(error);\n }\n console.log('EMAIL SENT')\n console.log(moment().format('MMMM Do YYYY, h:mm:ss a') + \" | \" + `Message sent! Accepted Emails: ${info.accepted}, Rejected Emails: ${info.rejected}, Message time: ${info.messageTime}`);\n });\n}", "async function sendFormSubmission(options) {\n let transporter = nodemailer.createTransport({\n service: \"hotmail\",\n auth: {\n user: \"[email protected]\",\n pass: \"j883Kf@Rmr4g!\"\n }\n });\n\n // Waiting for the Promise and returning it to the calling function\n return await transporter.sendMail(options);\n}", "async send(template, subject) {\n const html = pug.renderFile(`${__dirname}/email/${template}.pug`, {\n url: this.url,\n inviteCode: this.inviteCode,\n subject,\n });\n\n const mailOptions = {\n from: this.from,\n to: this.to,\n subject,\n html,\n text: htmlToText(html),\n };\n\n // This will be used when sending out invitation\n const mailOptions2 = {\n from: this.from,\n to: this.InviteEmail,\n subject,\n html,\n text: htmlToText(html),\n };\n\n if (this.InviteEmail !== '')\n await this.newTransport().sendMail(mailOptions2);\n else {\n await this.newTransport().sendMail(mailOptions);\n }\n }", "function checkFields()\n\t\t{\n\t\t\t\n\t\t\tvar fill = jQuery(\"input[name=fill]\").val();\n\t\t\tif (fill==\"EMAIL\"){\n\t\t\t\tvar cc = jQuery(\"input[name=cc]\").val();\n\t\t\t\tvar bcc = jQuery(\"input[name=bcc]\").val();\n\t\t\t\tvar i;\n\t\t\t\t//check cc email format\n\t\t\t\tvar ccs = cc.split(\",\");\n\t\t\t\tvar filter = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\t\t\t\tfor(i=0;i<ccs.length;i++){\n\t\t\t\t\tif(!filter.test(jQuery.trim(ccs[i]))){\n\t\t\t\t\t\tif (jQuery.trim(ccs[i])!=\"\"){\n\t\t\t\t\t\t\talert(\"One of the email used in cc is invalid. Please try again.\");\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar bccs = bcc.split(\",\");\n\t\t\t\t//console.log(bccs);\n\t\t\t\tfor(i=0;i<bccs.length;i++){\n\t\t\t\t\tif(!filter.test(jQuery.trim(bccs[i]))){\n\t\t\t\t\t\tif (jQuery.trim(bccs[i])!=\"\"){\n\t\t\t\t\t\t\talert(\"One of the email used in bcc is invalid. Please try again.\");\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(document.form.star.selectedIndex==0)\n\t\t\t{\n\t\t\t\tmissinginfo = \"\";\n\t\t\t\tif(document.form.txt.value==\"\")\n\t\t\t\t{\n\t\t\t\t\tmissinginfo += \"\\n - There is no message or details to be save or send \\t \\n Please enter details.\";\n\t\t\t\t}\n\t\t\t\tif (document.form.mode.value ==\"\")\n\t\t\t\t{\n\t\t\t\t\tif (document.form.fill.value==\"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\tmissinginfo += \"\\n - Please choose actions.\";\n\t\t\t\t\t}\n\t\t\t\t\tif (document.form.fill.value==\"EMAIL\" )\n\t\t\t\t\t{\n\t\t\t\t\t\tif (document.form.subject.value==\"\" )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmissinginfo += \"\\n - Please enter a subject in your Email.\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (document.form.templates[0].checked==false && document.form.templates[1].checked==false && document.form.templates[2].checked==false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmissinginfo += \"\\n - Please choose email templates.\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t//if (missinginfo != \"\")\n\t\t\t\t//{\n\t\t\t\t\t//missinginfo =\" \" + \"You failed to correctly fill in the required information:\\n\" +\n\t\t\t\t\t//missinginfo + \"\\n\\n\";\n\t\t\t\t\t//alert(missinginfo);\n\t\t\t\t\t//return false;\n\t\t\t\t//}\n\t\t\t\t//else return true;\n\t\t\t}\n\t\t}", "function sendMail(contactForm, level) {\n $(\"form button\").html(\"Sending...\");\n\n emailjs.send(\"service_wofndpb\", \"template_8yl86a3\", {\n \"level\": level,\n \"form_email\": contactForm.userEmail.value\n })\n .then(\n function() {\n $(\"form button\").html(\"Sent!\");\n },\n function(error) {\n alert(\"Email could not be sent. Error:\" + error);\n }\n );\n\n return false;\n}", "function sendMail(fromMailAddress,subject, message,attachments) {\n\n\tvar port = MFP.Server.getPropertyValue(\"drivers_and_vehicles_mail_port\");\n\tvar host = MFP.Server.getPropertyValue(\"drivers_and_vehicles_mail_host\");\n\tvar toMailAddress = MFP.Server.getPropertyValue(\"drivers_and_vehicles_mail_toMailAddress\");\n\tvar user = null;\n\ttry {user = MFP.Server.getPropertyValue(\"drivers_and_vehicles_mail_user\");} catch(ex){}\n\tvar pass = null;\n\ttry {pass = MFP.Server.getPropertyValue(\"drivers_and_vehicles_mail_pass\");} catch(ex){}\n\tvar sendEmail = new com.ibm.drivers_and_vehicles.MailSender();\n\tvar sendNewEmail= sendEmail.sendNewEmail(host,port,toMailAddress,user,pass,fromMailAddress,subject, message,JSON.stringify(attachments));\n\treturn {isSent : sendNewEmail};\n}", "function mailIt(options) {\n /**\n * We only send email if the host field is defined\n */\n if (svmp.config.get(\"smtp:host\")) {\n smtpTransport.sendMail(options, function (error, responseStatus) {\n if (error) {\n console.log(\"Error sending email to user: \", error);\n }\n });\n }\n}", "async function main() {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n let testAccount = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n service: \"Gmail\",\n\n auth: {\n user: \"yuval2604\", // generated ethereal user\n pass: \"Yuval15230\" // generated ethereal password\n }\n });\n\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: from, // sender address\n to: to, // list of receivers\n subject: \"פגישה עם רופא\", // Subject line\n text: text // plain text body\n });\n\n console.log(\"Message sent: %s\", info.messageId);\n // Message sent: <[email protected]>\n\n // Preview only available when sending through an Ethereal account\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n }", "function sendEmail()\r\n{\r\n $('#send-button').addClass('disabled');\r\n\r\n sendMessage(\r\n {\r\n 'To': $('#compose-to').val(),\r\n 'Subject': $('#compose-subject').val()\r\n },\r\n $('#compose-message').val(),\r\n composeTidy\r\n );\r\n\r\n return false;\r\n}", "async send(template, subject) {\n // 1) Render HTML based on a pug template\n const html = pug.renderFile(`${__dirname}/../views/email/${template}.pug`, {\n name: this.name,\n url: this.url,\n role: this.role,\n subject,\n });\n\n // 2) Define email options\n const mailOptions = {\n from: this.from,\n to: this.receiver,\n subject,\n html,\n text: htmlToText.fromString(html),\n };\n\n // 3) Create a transport and send email\n this.transport().sendMail(mailOptions);\n }", "function submitForm(e) {\n e.preventDefault(); \n\n // //get the value of all input \n\n var user_name = getInputVal(\"firstName\");\n var last_Name = getInputVal(\"userLastName\"); \n var user_phone = getInputVal(\"userPhone\");\n var user_email = getInputVal(\"userEmail\");\n var user_message = getInputVal(\"userMessage\");\n var user_password = getInputVal(\"user_Password\");\n var user_confirm_password = getInputVal(\"user_Confirm_Password\"); \n\n \n // //save the message \n if(user_name === \"\") {\n document.getElementById(\"firstNameError\").innerHTML = \"Enter the user name\";\n }\n else {\n document.getElementById(\"firstNameError\").innerHTML = \"\";\n }\n if (last_Name === \"\") {\n document.getElementById(\"firstLastError\").innerHTML = \"Enter the user email\";\n }\n else {\n document.getElementById(\"firstLastError\").innerHTML = \"\";\n }\n if (user_email === \"\") {\n document.getElementById(\"firstEmailError\").innerHTML = \"Enter the user email\";\n }\n else {\n document.getElementById(\"firstEmailError\").innerHTML = \"\";\n }\n if (user_phone === \"\") {\n document.getElementById(\"phoneNumber\").innerHTML = \"Enter the user phone\";\n }\n if (user_password === \"\") {\n document.getElementById(\"password_Error\").innerHTML = \"Enter the password\";\n }\n if (user_confirm_password === \"\") {\n document.getElementById(\"confirm_password_Error\").innerHTML = \"Confirm your password\";\n }\n else if(user_password != user_confirm_password) {\n document.getElementById(\"confirm_password_Error\").innerHTML = \"password not match\";\n }\n if(isNaN(user_phone)){\n document.getElementById(\"phoneNumber\").innerHTML = \"Enter the numeric value\";\n }\n else if(user_phone.length !== 11){\n document.getElementById(\"phoneNumber\").innerHTML = \"Please enter valid mobile number\"; \n }\n else if(user_phone === \"\"){\n document.getElementById(\"phoneNumber\").innerHTML = \"\";\n } \n else {\n saveMessage(user_name, last_Name, user_email, user_phone, user_message, user_password, user_confirm_password); \n \n document.querySelector(\"h1\").innerHTML = \"user added succesfully\"; \n setTimeout(function(){\n document.querySelector(\"h1\").innerHTML = \"\";\n }, 3000) \n } \n }", "function postsValidatedEmail() {\r\n if ($(\"#email\").val().length === 0) {\r\n //sets the background\r\n sendState(on, \"email\");\r\n\r\n //adds the data to the array\r\n addDataAllErrors(allErrorMess[0]);\r\n } else if (!validateEmail($(\"#email\").val())) {\r\n //sets the background\r\n sendState(on, \"email\");\r\n\r\n //adds the data to the array\r\n addDataAllErrors(allErrorMess[1]);\r\n\r\n //resets the email field\r\n $(\"#email\").val(\"\");\r\n } else {\r\n //Value validated put an element like a \"tick\"\r\n //image next to the element\r\n\r\n //sends the state and the object source\r\n sendState(off, \"email\");\r\n //clears the element\r\n $(\"#lblEmailError\").html(\"\");\r\n console.log(`the email element entered is correct!`);\r\n }\r\n }", "function sendEmails() {\n var d = new Date();\n var ONE_HOUR = 60 * 60 * 1000; /* ms */\n\n var transporter = nodemailer.createTransport({\n service: 'gmail',\n auth: {\n user: \"[email protected]\",\n pass: \"sharks@123\"\n }\n });\n\n MongoClient.connect(url, function(err, db) {\n if (err) throw err;\n var dbo = db.db(\"NHL\");\n dbo.collection(\"Match-schedule\").find({}).toArray(function(err, result) {\n if (err) throw err;\n for (var i = 0; i < result.length; i++) {\n console.log(result[i].Date - (new Date));\n if ((result[i].Date - (new Date)) > 0 && (result[i].Date - (new Date)) < ONE_HOUR) {\n message = 'Among teams Home Team:' + result[i].homeTeam + ' and Away Team:' + result[i].awayTeam + ', '\n exec('python \"NHL_274.py\" ' + result[i].homeTeamId + ' ' + result[i].awayTeamId, (error, stdout, stderr) => {\n console.log(error)\n console.log(stderr)\n console.log(stdout)\n if (stdout == 2) {\n message += '-> Home Team Wins.'\n } else if (stdout == 0) {\n message += '-> Away Team Wins.'\n } else {\n message += ' the match will draw.'\n }\n console.log(message);\n MongoClient.connect(url, function(err, db) {\n if (err) throw err;\n var dbo = db.db(\"NHL\");\n dbo.collection(\"Users\").find({}).toArray(function(err, result) {\n if (err) throw err;\n userList = result;\n for (var i = 0; i < result.length; i++) {\n var mailOptions = {\n from: '[email protected]',\n to: result[i].Email,\n subject: 'Ice Hockey Game Predictor by Sharks',\n text: \"Hello \" + result[i].FirstName + \" \" + result[i].LastName + \",\\r\\n\\r\\n\" + message + \"\\r\\n\\r\\nThank you\"\n };\n transporter.sendMail(mailOptions, function(error, info) {\n if (error) {\n console.log(error);\n } else {\n console.log(\"success\");\n }\n });\n }\n db.close();\n });\n });\n })\n }\n }\n db.close();\n });\n });\n}", "sendTextEmail() {\n email([EMAIL], null, null, null, this.state.text);\n }", "function submitForm(){\n checkRequired(formInputs);\n checkEmail(useremail);\n checkValidUsername(username);\n checkValidPassword(password, password2);\n}", "async function main(user, err, pathinfo) {\n\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\";\n \n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: \"xxxxxxxxx.xxxxxxxxx.com\",\n port: 25,\n secure: false, // true for 465, false for other ports\n tls: { secureProtocol: \"TLSv1_method\" }\n });\n\nlet uname = \"[email protected], \" + user;\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: '\"Consumer Affairs App\" <[email protected]>', // sender address\n to: uname, // list of receivers\n subject: \"Consumer Affairs App: An error has occured.\", // Subject line\n html: \"An error has just occurred in the Consumer Affairs application, and your application administrator has been notified. Details are below. <br> <br> <hr> <br> Username: \" + user + \" <br> Date: \" + moment().format('L') + \"<br> Time: \" + moment().format('LT') + \"<br> Error: <b style='color:red'>\" + err + \"</b> <br> URL where error occurred: \" + pathinfo + \"<br><br> <i>This is an automated message. Please do not reply.</i>\" // body\n });\n}", "function sendMail(newsletterSignup) {\n emailjs.send(\"service_c5ljukn\", \"template_a4yyv0p\", {\n \"from_name\": newsletterSignup.name.value,\n \"from_email\": newsletterSignup.email.value,\n })\n .then(\n function (response) {\n $('#msgModal').modal('show');\n console.log(\"SUCCESS\", response);\n },\n function (error) {\n console.error(\"FAILED\", error);\n }\n );\n return false;\n}", "async function main() {\r\n // Generate test SMTP service account from ethereal.email\r\n // Only needed if you don't have a real mail account for testing\r\n let testAccount = await nodemailer.createTestAccount();\r\n\r\n // create reusable transporter object using the default SMTP transport\r\n const transporter = nodemailer.createTransport({\r\n host: 'smtp.ethereal.email',\r\n port: 587,\r\n auth: {\r\n user: '[email protected]',\r\n pass: 'MME2hAbsDsUvDVJ2e3'\r\n }\r\n});\r\n\r\n // send mail with defined transport object\r\n let info = await transporter.sendMail({\r\n from: '[email protected]', // sender address\r\n to: \"Usermail\" , // list of receivers\r\n subject: \"confirmatiom email\", // Subject line\r\n text: \"You have subscribed successfully\", // plain text body\r\n html: \"<b>Hello world?</b>\", // html body\r\n });\r\n\r\n console.log(\"Message sent: %s\", info.messageId);\r\n // Message sent: <[email protected]>\r\n\r\n // Preview only available when sending through an Ethereal account\r\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\r\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\r\n}", "async send(template, subject) {\n // 1 ) Render The HTML based on a pub template\n const html = pug.renderFile(\n `${__dirname}/../../views/email/${template}.pug`,\n {\n firstName: this.firstName,\n url: this.url,\n subject\n }\n );\n\n // 2) Define email options\n const mailOptions = {\n from: this.from,\n to: this.to,\n subject,\n html,\n text: htmlToText.fromString(html)\n };\n\n // 3) Create a transport and send email\n await this.newTransport().sendMail(mailOptions);\n }", "function sendEmail() {\n var milestoneData = getMilestoneData();\n var htmlBody = getEmailHtml(milestoneData);\n var recipients = getMailAddress();\n var projectTitle = getProjectTitle();\n MailApp.sendEmail({\n to : recipients,\n subject : 'Weekly Updates (' + projectTitle + ')',\n htmlBody : htmlBody\n });\n}", "function sendEmail(args) {\n Ti.API.info(\"[lLOGGER] :: log.event called with args: \" + JSON.stringify(\n args));\n var to = args.to ? args.to : false;\n var from = args.from ? args.from : \"[email protected]\"\n // need to implement this\n var sendgrid = require('/utils/tisendgrid')(args.username, args.password);\n sendgrid.send({\n to: args.to,\n from: args.from,\n subject: args.subject,\n text: args.text\n }, function (e) {\n if (e) {\n console.log(e); // Email wasn't sent\n alert(\"It didn't work! e = \" + JSON.stringify(e, null, 4));\n }\n });\n }", "function submitAction(e) {\r\n // Remove refresh from submit\r\n e.preventDefault();\r\n\r\n //Set variables equal to what the user has inputted in to the form\r\n NameContent = document.getElementById(\"NameContent\").value;\r\n EmailContent = document.getElementById(\"EmailAddressContent\").value;\r\n MessageContent = document.getElementById(\"MessageContent\").value;\r\n\r\n //Checks if the content of the name input box is empty and sets property values if the statement is true\r\n if (NameContent.length <= 0) {\n document.getElementById(\"NameContent\").placeholder = \"* This field must be filled in!\";\r\n document.getElementById(\"NameContent\").style.border = \"2px solid #cc0000\";\r\n document.getElementById(\"NameContent\").style.boxShadow = \"0px 0px 3px 1px #CC0000 inset\";\r\n NameContentCheck = false;\r\n } else { //Sets property values if the statement is false\r\n document.getElementById(\"NameContent\").placeholder = \"Type here.\";\r\n document.getElementById(\"NameContent\").style.border = \"2px solid #00e600\";\r\n document.getElementById(\"NameContent\").style.boxShadow = \"0px 0px 3px 1px #00e600 inset\";\r\n NameContentCheck = true;\r\n }\r\n\r\n //Checks the E-Mail input box for an \"@\" symbol and returns that symbols index\r\n EmailIndex = EmailContent.indexOf(\"@\");\r\n\r\n //Checks if the content of the E-Mail input box is empty and sets property values if the statement is true\r\n if (EmailContent.length <= 0) {\r\n document.getElementById(\"EmailAddressContent\").placeholder = \"* This field must be filled in!\";\r\n document.getElementById(\"EmailAddressContent\").style.border = \"2px solid #cc0000\";\r\n document.getElementById(\"EmailAddressContent\").style.boxShadow = \"0px 0px 3px 1px #CC0000 inset\";\r\n EmailContentCheck = false;\r\n } else if ( EmailIndex <= -1) { //Checks if the content of the E-Mail input box has an \"@\" symbol in it and sets property values if the statement is true\r\n document.getElementById(\"EmailAddressContent\").placeholder = '* \"@\" not detected! Please use a valid Email address.';\r\n document.getElementById(\"EmailAddressContent\").style.border = \"2px solid #cc0000\";\r\n document.getElementById(\"EmailAddressContent\").style.boxShadow = \"0px 0px 3px 1px #CC0000 inset\";\r\n EmailContentCheck = false;\r\n } else { //Sets property values if both statements are false\r\n document.getElementById(\"EmailAddressContent\").placeholder = \"Type here.\";\r\n document.getElementById(\"EmailAddressContent\").style.border = \"2px solid #00e600\";\r\n document.getElementById(\"EmailAddressContent\").style.boxShadow = \"0px 0px 3px 1px #00e600 inset\";\r\n EmailContentCheck = true;\r\n }\r\n\r\n //Checks if the content of the Message input box is empty and sets property values if the statement is true\r\n if (MessageContent.length <= 0) {\r\n document.getElementById(\"MessageContent\").placeholder = \"* Please insert a mesage for me to read.\";\r\n document.getElementById(\"MessageContent\").style.border = \"2px solid #cc0000\";\r\n document.getElementById(\"MessageContent\").style.boxShadow = \"0px 0px 3px 1px #CC0000 inset\";\r\n MessageContentCheck = false;\r\n } else { //Sets property values if the statement is false\r\n document.getElementById(\"MessageContent\").placeholder = \"Type here.\";\r\n document.getElementById(\"MessageContent\").style.border = \"2px solid #00e600\";\r\n document.getElementById(\"MessageContent\").style.boxShadow = \"0px 0px 3px 1px #00e600 inset\";\r\n MessageContentCheck = true;\r\n }\r\n\r\n //If the statement is true, return a message to the user that their E-Mail has been sent\r\n if (NameContentCheck == true && EmailContentCheck == true && MessageContentCheck == true) {\r\n document.getElementById(\"UserMessage\").innerHTML = \"Thank you for getting in touch \" + NameContent + \"!\"\r\n } else { //If the statement is false, return a message to the user that their E-Mail hasn't been sent\r\n document.getElementById(\"UserMessage\").innerHTML = \"Please check the contact form for any errors!\";\r\n }\r\n\r\n //Clear the input boxes\r\n document.getElementById(\"NameContent\").value = \"\";\r\n document.getElementById(\"EmailAddressContent\").value = \"\";\r\n document.getElementById(\"MessageContent\").value = \"\";\r\n\r\n }", "send(options) {\n\t\tif (!this._transport) return;\n\n\t\t// Get the default values from the config file, if html and text\n\t\t// templates are both specified, then\n\t\tlet cfgOpts = {};\n\t\tif (!!this._config.mailer.templates) cfgOpts = this._config.mailer.templates[options.template] || {};\n\n\t\t// Merge the config file and parameters passed, where the\n\t\t// parameters passed take precedence over the config\n\t\tconst opts = Object.assign({}, cfgOpts, options);\n\n\t\t// Load up the template(s) and populate the message\n\t\tif (!!opts.textfile) {\n\t\t\tconst textContent = this._loadTemplate(opts.textfile);\n\t\t\tconst textTemplate = handlebars.compile(textContent);\n\t\t\topts.text = textTemplate(opts);\n\t\t}\n\n\t\tif (!!opts.htmlfile) {\n\t\t\tconst htmlContent = this._loadTemplate(opts.htmlfile);\n\t\t\tconst htmlTemplate = handlebars.compile(htmlContent);\n\t\t\topts.html = htmlTemplate(opts);\n\t\t}\n\n\t\t// Sendmail runs asynchronously (which is what we want), but\n\t\t// the error handling cannot return the information back to\n\t\t// the user when this happens. It can, however, go to the\n\t\t// log file\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis._transport.sendMail(opts, (error, data) => {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(data);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function emailSender(){\n // console.log('xxx')\n var emailObject = {\n name: document.getElementById('name').value,\n email: document.getElementById('email').value,\n emailBody: document.getElementById('emailBody').value\n }\n console.log(emailObject);\n if(emailObject.name && emailObject.email && emailObject.emailBody){\n //send Email\n console.log('email Being sent!')\n // document.getElementById('myModal').style.display = 'none';\n\n }\n}", "function sendEmail(e) {\n e.preventDefault();\n\n emailjs\n .sendForm(\n \"service_1itvl2g\",\n \"template_wkao8d5\",\n e.target,\n \"user_Cu7YtNY74RV8gPluq9tNI\"\n )\n .then(\n (result) => {\n console.log(result.text);\n alert(\"Message sent!\");\n },\n (error) => {\n console.log(error.text);\n alert(\"Error: Something went wrong, please try again.\");\n }\n );\n\n e.target.reset();\n setEmail(\"\");\n }", "function sendEmail(e) {\n e.preventDefault();\n \n emailjs.sendForm('gmail', 'template_w.jake.fullmer', '#contactForm', 'user_OY02r5T8KPqVR1frBk330')\n .then(function(response) {\n console.log(response.text);\n setFormMessage(\"Message sent!\");\n }, function(error) {\n console.log(error.text);\n setFormMessage(\"Your message couldn't be sent. Please email Jake directly at [email protected]@gmail.com\");\n });\n }", "function submitForm(){\n console.log(\"entered submit function\");\n// e.preventDefault();\n\n // Get values\n var type=\"cc\"\n var name = \"ram\";\n var age = \"\";\n var email = getInputVal('mail');\n var phone = \"num\";\n\n // Save message\n saveMessage(type,name,age,email, phone);\n}", "function EmailObj(){\n var self = this;\n self.config = {\n host: config.emailHost,\n port: config.emailPort,\n secure: 'SSL', // use SSL\n auth: {\n user: config.emailUser,\n pass: config.emailPassword\n }\n },\n\n self.emailFrom = config.emailFrom,\n self.emailFromName = config.emailFromName,\n self.emailAdmin = config.emailAdmin,\n self.fromName = '\"' + config.emailFromName + '\"' + '<' + config.emailFrom + '>',\n\n self.transporter = function(mailData){\n var transporter = nodemailer.createTransport(self.config);\n\n transporter.sendMail(mailData, function(error, info) {\n if(error) {\n console.log('Message not sent');\n console.log(info);\n return false;\n }\n else{\n console.log('Message sent: ' + info.response);\n console.log(info);\n return true;\n };\n });\n },\n\n self.transporterTemplate = function(mailData, subDir){\n var path = require('path');\n // var EmailTemplate = require('email-templates').EmailTemplate;\n var transporter = nodemailer.createTransport(self.config);\n\n var templateDir = path.join(__dirname, '../../views/emailTemplates', subDir);\n\n //--------- v4 using jade\n var jade = require('jade');\n var transporter = nodemailer.createTransport(self.config);\n\n var header = config.emailFromName;\n var link = mailData.link;\n\n var html = jade.renderFile(templateDir+'/html.jade', {header: header, link:link});\n\n var options = {\n from: self.emailAdmin,\n to: mailData.to,\n // to: self.emailAdmin,\n subject: mailData.subject,\n html: html\n };\n\n transporter.sendMail(options, callback);\n function callback(error, info) {\n if(error) {\n console.log('Message not sent');\n console.log(info);\n return false;\n }\n else{\n console.log('Message sent: ' + info.response);\n console.log(info);\n return true;\n };\n }\n\n },\n\n self.newTask = function (data) {\n\n var subject = self.emailFromName + \": new task: \" + data.subject;\n var plainText = 'Task description: ';\n plainText += data.message;\n var htmlText = '<h2>Task description: </h2>';\n htmlText += '<p>' + data.message + '</p>';\n\n var mailOptions = {\n // Sender address\n from: self.fromName,\n // List of receivers\n to: data.emailFrom,\n // to: data.toEmail,\n\n subject: subject,\n // Plaintext body\n text: plainText,\n // You can choose to send an HTML body instead\n html:htmlText\n }\n // console.log(mailOptions);\n self.transporter(mailOptions);\n },\n\n // Users\n self.newRegistrationToAdmin = function (data) {\n var mailOptions = {\n // Sender address\n from: self.fromName,\n // List of receivers\n to: self.emailAdmin,\n // Subject line\n subject: self.emailFromName + ' Registration ',\n // Plaintext body\n text: 'New user has been registered.',\n // You can choose to send an HTML body instead\n html: '<b>New user has been registered. ✔</b>' + '<p>' + data.user + '</p>',\n }\n\n self.transporter(mailOptions);\n },\n\n self.newRegistrationToUser = function (data) {\n var mailOptions = {\n // Sender address\n from: self.fromName,\n // List of receivers\n to: self.emailFrom,\n // to: data.toEmail,\n //\n // Subject line\n subject: self.emailFromName + ' Registration ',\n // Plaintext body\n text: 'Your registration was successful.',\n // You can choose to send an HTML body instead\n html: '<b>Your registration was successful. ✔</b>' + '<p> Your data: <br />' + data.username + '</p><p>Please activate your account by clicking on the link: <br />' + data.link\n }\n self.transporter(mailOptions);\n },\n\n self.activatedEmail = function (data) {\n var mailOptions = {\n // Sender address\n from: self.fromName,\n // List of receivers\n to: self.emailFrom,\n // to: data.toEmail,\n //\n // Subject line\n subject: self.emailFromName + ' Account is activated ',\n // Plaintext body\n text: 'Your account has been successfully activated.',\n // You can choose to send an HTML body instead\n html: '<b>Your account has been successfully activated. ✔</b>'\n }\n self.transporter(mailOptions);\n },\n\n // Send notification about updated password\n self.resetPaswordEmail = function (data) {\n var mailOptions = {\n // Sender address\n from: self.fromName,\n // List of receivers\n to: self.emailFrom,\n // to: data.toEmail,\n //\n // Subject line\n subject: self.emailFromName + ' Updated Password ',\n // Plaintext body\n text: 'Your password was successfully changed',\n // You can choose to send an HTML body instead\n html: '<b>Your password was successfully changed. ✔</b>'\n }\n\n self.transporter(mailOptions);\n },\n\n // send req email with link - set data.link\n self.reqPaswordEmail = function (data) {\n var mailData = {\n from: self.fromName,\n to: data.toEmail,\n link: data.link,\n subject: self.emailFromName + ' Reset Password ',\n }\n\n self.transporterTemplate(mailData, 'requestResetEmail');\n }\n\n\n/*----------------- end obj ---------------------*/\n}", "function sendMail(){\n\tvar email = Session.getActiveUser().getEmail();\n\tMailApp.sendEmail(email, \"Your Putzparty form was submitted!\", \"yeah!\");\n}", "function sendMail(contactForm) {\n emailjs.send(\"carpet_specialist\", \"carpet_specialist\", {\n \"from_name\": contactForm.name.value,\n \"from_email\": contactForm.email.value,\n \"subject\": contactForm.subject.value,\n \"message\": contactForm.message.value\n });\n return false;\n}", "async function application_verified(output) {\n let transporter = nodemailer.createTransport(smtpTransport({\n host: \"mail.hiltonparkerng.com\",\n tls:{\n rejectUnauthorized: false\n },\n port: 465,\n secure: true,\n auth: {\n user: '[email protected]', \n pass: process.env.MAIL_PASSWORD\n },\n }));\n\n\n let info = await transporter.sendMail({\n from: '\"Hilton Parker Services\" <[email protected]>',\n to: `${output[0].email}`,\n subject:`Application Verified`,\n html: `\n <!doctype html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <title>Simple Transactional Email</title>\n <style>\n /* -------------------------------------\n INLINED WITH htmlemail.io/inline\n ------------------------------------- */\n /* -------------------------------------\n RESPONSIVE AND MOBILE FRIENDLY STYLES\n ------------------------------------- */\n @media only screen and (max-width: 620px) {\n table[class=body] h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important;\n }\n table[class=body] p,\n table[class=body] ul,\n table[class=body] ol,\n table[class=body] td,\n table[class=body] span,\n table[class=body] a {\n font-size: 16px !important;\n }\n table[class=body] .wrapper,\n table[class=body] .article {\n padding: 10px !important;\n }\n table[class=body] .content {\n padding: 0 !important;\n }\n table[class=body] .container {\n padding: 0 !important;\n width: 100% !important;\n }\n table[class=body] .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important;\n }\n table[class=body] .btn table {\n width: 100% !important;\n }\n table[class=body] .btn a {\n width: 100% !important;\n }\n table[class=body] .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important;\n }\n }\n\n /* -------------------------------------\n PRESERVE THESE STYLES IN THE HEAD\n ------------------------------------- */\n @media all {\n .ExternalClass {\n width: 100%;\n }\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%;\n }\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important;\n }\n #MessageViewBody a {\n color: inherit;\n text-decoration: none;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .btn-primary table td:hover {\n background-color: #34495e !important;\n }\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important;\n }\n }\n </style>\n </head>\n <body class=\"\" style=\"background-color: #f6f6f6; font-family: sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;\">\n <span class=\"preheader\" style=\"color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;\">Application Verification Mail</span>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #f6f6f6;\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">&nbsp;</td>\n <td class=\"container\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; display: block; Margin: 0 auto; max-width: 580px; padding: 10px; width: 580px;\">\n <div class=\"content\" style=\"box-sizing: border-box; display: block; Margin: 0 auto; max-width: 580px; padding: 10px;\">\n\n <!-- START CENTERED WHITE CONTAINER -->\n <table class=\"main\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: #ffffff; border-radius: 3px;\">\n\n <!-- START MAIN CONTENT AREA -->\n <tr>\n <td class=\"wrapper\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; box-sizing: border-box; padding: 20px;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Dear ${output[0].firstname + ' ' + output[0].lastname}</p>\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Your application with Hilton Parker Services has been accepted and verified. Expect further instructions from your immigration officer.\n <br>\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Thank you</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n\n <!-- END MAIN CONTENT AREA -->\n </table>\n\n <!-- START FOOTER -->\n <div class=\"footer\" style=\"clear: both; Margin-top: 10px; text-align: center; width: 100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\">\n <tr>\n <td class=\"content-block\" style=\"font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: #999999; text-align: center;\">\n <span class=\"apple-link\" style=\"color: #999999; font-size: 12px; text-align: center;\">1 Rahman Adeboyejo St, Lekki Phase I, Lagos</span>\n </td>\n </tr>\n <tr>\n <td class=\"content-block powered-by\" style=\"font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: #999999; text-align: center;\">\n <a href=\"www.hiltonparkerng.com\" style=\"color: #999999; font-size: 12px; text-align: center; text-decoration: none;\">www.hiltonparkerng.com</a>.\n </td>\n </tr>\n </table>\n </div>\n <!-- END FOOTER -->\n\n <!-- END CENTERED WHITE CONTAINER -->\n </div>\n </td>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">&nbsp;</td>\n </tr>\n </table>\n </body>\n </html>\n `\n });\n\n}", "function send(to, from, cc, subject, body, attch) {\n\n\t//build the mail options\n\tvar mailOptions = _defineMailOptions(to, from, cc, subject, body, attch);\n\n\t//return async work\n\treturn new Promise(function(resolve, reject) {\n\n\t\tconsole.log('sending mail');\n\n\t\t//send mail with the defined transport object\n\t\tTRANSPORTER.sendMail(mailOptions, function results(error, info){\n\n\t\t\t//if there was an error notify the user\n\t\t\tif(error) reject(info);\n\t\t\telse resolve('Message sent: ' + info.response);\n\t\t\t//if not send a positive response\n\n\t\t});\n\n\t});\n\n}", "function sendMail(contactForm) {\n emailjs\n .send(\"gmail\", \"copenhagen\", {\n from_name: contactForm.name.value,\n from_email: contactForm.emailaddress.value,\n your_query: contactForm.query.value,\n })\n .then(\n function (response) {\n document.getElementById(\"form-reset\").reset();\n $(\".modal\").modal(\"toggle\");\n $(function () {\n setTimeout(function () {\n $(\"#send-message\").show();\n }, 1000);\n });\n\n $(function () {\n setTimeout(function () {\n $(\"#send-message\").show().hide();\n }, 5000);\n });\n },\n function (error) {\n console.log(\"FAILED\", error);\n }\n );\n return false;\n}", "function sendReceiptEmail() {\n emailjs\n .send(\"servce_alin5647\", \"receipt-form\", {\n orderNumber: $(\".order-number\").text().toString(),\n bananaQt: $(\".checkout-quantity-banana\").text(),\n bananaUnitPrice: 30,\n bananaSum: $(\".banana-total\").text(),\n cauliflowerQt: $(\".checkout-quantity-cauliflower\").text(),\n cauliflowerUnitPrice: 30,\n cauliflowerSum: $(\".cauliflower-total\").text(),\n loquatQt: $(\".checkout-quantity-loquat\").text(),\n loquatUnitPrice: 50,\n loquatSum: $(\".loquat-total\").text(),\n subTotal: totalCost,\n shipping: $(\".shipping-total\").text(),\n finalSum: grandTotal,\n userMail: $(\".form-email > .form-input\").val().toString(),\n address: $(\".form-address > .form-input\").val().toString(),\n name: $(\".form-name > .form-input\").val().toString(),\n })\n .then(\n function () {\n console.log(\n \"SUCCESS! Receipt has been sent to email address provided!\"\n );\n window.location.href = \"checkout-finish.html\"; // Redirects user back to checkout-finish.html\n },\n function (error) {\n console.log(\"FAILED...\", error);\n }\n );\n }", "function sendMessage() {\n var patternEmail = /^[A-Za-z0-9\\u4e00-\\u9fa5]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$/;\n var patternPhone = /^1[3|4|5|7|8][0-9]{9}$/;\n var oUserName = $(\"#username\");\n var oEmail = $(\"#email\");\n var oPhone = $(\"#phone\");\n var oMessage = $(\"#message\");\n var flag1 = false;//for username\n var flag2 = false;//for email\n var flag3 = false;//for phone\n var flag4 = false;//for message\n\n function checkNull(target) {\n if (!target.val()) {\n target.addClass(\"error\");\n return false;\n } else {\n target.removeClass(\"error\");\n return true;\n }\n }\n\n function checkFormat(target, pattern) {\n if (!target.val()) {\n target.addClass(\"error\");\n return false;\n } else {\n if (pattern.test(target.val())) {\n target.removeClass(\"error\");\n return true;\n } else {\n target.addClass(\"error\");\n return false;\n }\n }\n }\n\n oUserName.blur(function () {\n flag1 = checkNull($(this), flag1)\n });\n oEmail.blur(function () {\n flag2 = checkFormat($(this), patternEmail, flag2)\n });\n oPhone.blur(function () {\n flag3 = checkFormat($(this), patternPhone, flag3)\n });\n oMessage.blur(function () {\n flag4 = checkNull($(this), flag4)\n });\n $(\"#send\").click(function () {\n if (flag1 && flag2 && flag3 && flag4) {\n oUserName.val(\"\");\n oEmail.val(\"\");\n oPhone.val(\"\");\n oMessage.val(\"\");\n }\n })\n}", "function emailSend(){\n var email = document.getElementById('email_submission');\n var name = document.getElementById('name_submission');\n var message = document.getElementById('message_submission');\n var successOrNot = document.getElementById('success_email');\n\n if (!email.value || !name.value || !message.value){\n /* This will print an error because there is nothing in those fields */\n successOrNot.innerHTML = \"You didn't fill everything out!\";\n } else {\n successOrNot.innerHTML = \"Success! Email sent!\";\n }\n\n}", "function fcnSendCnfrmEmailEN(Player, Week, EmailAddresses, PackData, shtConfig) {\n \n // Variables\n var EmailSubject;\n var EmailMessage;\n var Address;\n var Language;\n \n // Open Email Templates\n var ssEmailID = shtConfig.getRange(47,2).getValue(); \n var Headers = SpreadsheetApp.openById(ssEmailID).getSheetByName('Templates').getRange(12,2,20,1).getValues();\n \n // Get Document URLs\n var UrlValues = shtConfig.getRange(17,2,3,1).getValues();\n var urlStandings = UrlValues[0][0];\n var urlCardPool = UrlValues[1][0];\n var urlMatchReporter = UrlValues[2][0];\n \n // League Name\n var Location = shtConfig.getRange(11,2).getValue();\n var LeagueTypeEN = shtConfig.getRange(13,2).getValue();\n var LeagueNameEN = Location + ' ' + LeagueTypeEN;\n \n // Player Email and Language Preference\n Language = EmailAddresses[0];\n Address = EmailAddresses[1];\n \n // Add Masterpiece mention if necessary\n if (PackData[15][2] == 'Masterpiece'){\n //var Masterpiece = PackData[14][2];\n PackData[14][2] += ' (Masterpiece)' \n }\n \n // Set Email Subject\n EmailSubject = LeagueNameEN + \" - Week \" + Week + \" - Weekly Booster\" ;\n \n // Start of Email Message\n EmailMessage = '<html><body>';\n \n EmailMessage += 'Hi ' + Player + ',<br><br>You have succesfully added a Booster to your Card Pool for the ' + LeagueNameEN + ', Week ' + Week + '.' +\n '<br><br>Here is the list of cards added to your pool.';\n \n // Builds the Pack Table\n EmailMessage = subMatchReportTable(EmailMessage, Headers, PackData, Language, 1);\n \n EmailMessage += \"<br><br>Click below to access your Card Pool.\"+\n \"<br>\"+ urlCardPool +\n \"<br><br>Thank you for using TCG Booster League Manager from Turn 1 Gaming Leagues & Tournaments\";\n \n // End of Email Message\n EmailMessage += '</body></html>';\n \n // Send Email to player\n MailApp.sendEmail(Address, EmailSubject, \"\",{name:'Turn 1 Gaming League Manager',htmlBody:EmailMessage});\n}", "function sendWeeklyEmail() {\r\n\t\r\n\tdocument.getElementById(\"weekalert2\").innerHTML = \"JS sendWeeklyEmail() Mail send function is activated!\" ;\r\n\t\r\n $.post(\"weeklyMail.php\",\r\n {\r\n \tThursdayOpeningPrice: ThursdayOpeningPrice,\r\n \tThursdayLastTrade: ThursdayLastTrade,\r\n \tThursdayPreviousClose: ThursdayPreviousClose,\r\n \tThursdayDayHigh: ThursdayDayHigh,\r\n \tThursdayDayLow: ThursdayDayLow,\r\n \tThursdayVolume: ThursdayVolume,\r\n \tWednesdayOpeningPrice: WednesdayOpeningPrice,\r\n \tWednesdayLastTrade: WednesdayLastTrade,\r\n \tWednesdayPreviousClose: WednesdayPreviousClose,\r\n \tWednesdayDayHigh: WednesdayDayHigh,\r\n \tWednesdayDayLow: WednesdayDayLow,\r\n \tWednesdayVolume: WednesdayVolume,\r\n \tTuesdayOpeningPrice: TuesdayOpeningPrice,\r\n \tTuesdayLastTrade: TuesdayLastTrade,\r\n \tTuesdayPreviousClose: TuesdayPreviousClose,\r\n \tTuesdayDayHigh: TuesdayDayHigh,\r\n \tTuesdayDayLow: TuesdayDayLow,\r\n \tTuesdayVolume: TuesdayVolume,\r\n \tMondayOpeningPrice: MondayOpeningPrice,\r\n \tMondayLastTrade: MondayLastTrade,\r\n \tMondayPreviousClose: MondayPreviousClose,\r\n \tMondayDayHigh: MondayDayHigh,\r\n \tMondayDayLow: MondayDayLow,\r\n \tMondayVolume: MondayVolume,\r\n \tSundayOpeningPrice: SundayOpeningPrice,\r\n \tSundayLastTrade: SundayLastTrade,\r\n \tSundayPreviousClose: SundayPreviousClose,\r\n \tSundayDayHigh: SundayDayHigh,\r\n \tSundayDayLow: SundayDayLow,\r\n \tSundayVolume: SundayVolume,\r\n },\r\n function(data,status){\r\n document.getElementById(\"mailSenderWeek\").innerHTML = data;\r\n });\r\n \r\n document.getElementById(\"weekalert3\").innerHTML = \"JS sendWeeklyEmail() Mail send function is finished!\" ;\r\n \r\n}" ]
[ "0.70699155", "0.6474504", "0.633365", "0.63208544", "0.6298", "0.62426984", "0.6143947", "0.6096317", "0.60901135", "0.60720444", "0.60468954", "0.6040679", "0.60349", "0.6030001", "0.6027417", "0.60139537", "0.6006004", "0.59976214", "0.595445", "0.595014", "0.5929794", "0.5926512", "0.58855593", "0.5884637", "0.58831614", "0.58689916", "0.58683413", "0.58613074", "0.58504236", "0.5831847", "0.58124626", "0.58102465", "0.5803199", "0.5797252", "0.57947105", "0.57839876", "0.5782241", "0.57756543", "0.57646054", "0.57559854", "0.57480466", "0.5743403", "0.57394093", "0.57247937", "0.5713546", "0.5704035", "0.569937", "0.5695265", "0.5687728", "0.56866205", "0.56846464", "0.5677349", "0.5676347", "0.56750804", "0.5673214", "0.5666178", "0.5663827", "0.56567085", "0.5653976", "0.56502193", "0.56447434", "0.5633224", "0.5632148", "0.562827", "0.5621688", "0.5614072", "0.5613528", "0.5611884", "0.5606831", "0.55993754", "0.5596052", "0.5589579", "0.5588571", "0.55850697", "0.55814373", "0.55779916", "0.55779654", "0.5576842", "0.55741954", "0.55741405", "0.5560421", "0.5560309", "0.5558135", "0.5558059", "0.5553603", "0.5549703", "0.5541202", "0.55354625", "0.5532757", "0.55296147", "0.5520883", "0.5510217", "0.5506671", "0.5500466", "0.5495202", "0.5493676", "0.54927236", "0.54903", "0.54899096", "0.54856384" ]
0.76435506
0
========================================================================= mailReturn ========================================================================= Function does any finishing touches depending on if the email was able to sent or not.
function mailReturn(data, status){ var obj = jQuery.parseJSON(data); alert("test"); alert(obj); // There was no error if (obj.error == ""){ //alert("Success : " + obj.success); $("#sendmessage").addClass("show"); } // There was an error else { //alert("Error : " + obj.error); $("#errormessage").html("An unexpected error has occured. Please try again."); $("#errormessage").removeClass("show"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emailSuccess() {}", "function tryEmail() {\n emailTimeSent = new Date();\n emailSentSuccess = true;\n try {\n emailMessage = sendResponseEmail(respEmail, validResults, dataFileName, emailDate, formUrl);\n } catch (error) {\n emailSentSuccess = false;\n }\n }", "function send() {\r\n\tcheckName();\r\n\tcheckMessage();\r\n\tcheckEmail();\r\n\t//when all are right, show the successful message in the div which id is sendsuccessfully and return true\r\n\tif(checkName()==true && checkMessage()==true && checkEmail()==true) {\r\n\t\tdocument.getElementById(\"sendsuccessfully\").innerHTML=\"Message successfully sent\";\r\n\t\treturn true;\r\n\t}\r\n\t//if one of name, message and email is not right, return false\r\n\treturn false;\r\n}", "async resend() {\n const ctx = this.ctx;\n const user = ctx.user;\n await ctx.service.mail.sendVerificationMail(user);\n\n ctx.flash('resent', true);\n ctx.redirect(ctx.get('referer'));\n }", "function checkMail() {\n if (getMail().length > 0) {\n if (isSignExist() && isSignSame() && isCharbefSign() && isDotExist() && isDotSame() && isCharbefDotAfSign() && isAfterDot()) {\n return true;\n }\n else {\n return false;\n }\n }\n //nothing put in mail box\n else {\n document.eMail.uMail.style.borderColor = \"grey\";\n document.getElementById(\"errMail\").style.display = \"none\";\n return false;\n }\n}", "function handleMailSend( data, selectedResult, email, callback ) {\n \n if (params.groupedResults) {\n //Logger.log(selectedResult);\n mailSendGroupedResults(data, selectedResult, email, function(error, callbackResult) {\n // If grouped mail is too big, try to send in separate results\n if (error) {\n \n mailSendSeparateResults(data, selectedResult, email, callback);\n } else {\n \n if (callback && typeof(callback) === \"function\") {\n return callback(error, callbackResult);\n } \n }\n });\n \n } else {\n \n mailSendSeparateResults(data, selectedResult, email, callback);\n }\n}", "function sendMail(){ \n\tlogincontroller.logincheck(name,password,(err,data)=>{\n \tif(err) throw err;\n \telse{\n \t\tconsole.log(\"\\n------------------------------Compose Mail---------------------------------\\n\\n\")\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n \t\tconsole.log(\"Sender Name=> \"+data[0].name+\" ---------Sender Email ID => \"+data[0].emailid);\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n \t\tvar reciever = readline.question(\"Reciever Email Id => \");\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n \t\tvar subject = readline.question(\"Subject => \");\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n \t\tvar message = readline.question(\"Message = >\")\n \t\tconsole.log(\"------------------------------------------------------------------------------\\n\")\n\t\tmailcontroller.sendmail(data[0].emailid,reciever,subject,message,(err)=>{\n\t\t\tif(err) throw err;\n\t\t\telse{\n\t\t\t\tconsole.log(\"\\n---------Mail Sent Successfully---------\");\n\t\t\t\tconsole.log(\"\\n---------------------------Welcome \"+data[0].name+\"------------------------\");\n\t\t\t\thomeUI();\n\t\t\t}\n\t\t});\t\n\t\n \t}\n\n });\n\n}", "function mailSend(){\r\n\t\t\r\n\t\talert(\"Τhe e-mail has been sent!!!\");\r\n\t\t\r\n\t\t// Clear Form\r\n\t\tvar nameStr=document.getElementById(\"fullName\").value = \"\";\r\n\t\tvar mailStr=document.getElementById(\"email\").value = \"\";\r\n\t\tvar textSt=document.getElementById(\"textAr\").value = \"\";\r\n\t\t\r\n\t\treturn false;\t\t\r\n\t}", "function emailCheck(){\n return false;\n }", "function send_email() {\n let recipientsvalue = document.querySelector('#compose-recipients').value;\n let subjectvalue = document.querySelector('#compose-subject').value;\n let bodyvalue = document.querySelector('#compose-body').value;\n \n fetch('/emails', {\n method: 'POST',\n body: JSON.stringify({\n recipients: recipientsvalue,\n subject: subjectvalue,\n body: bodyvalue\n })\n })\n .then(response => response.json())\n .then(result => {\n if(!result['error']) {\n load_mailbox('sent');\n }\n else {\n if(document.querySelector('#errorp')) {\n let oldp = document.querySelector('#errorp');\n let parent = document.querySelector(\"#compose-view\");\n parent.removeChild(oldp);\n }\n let newp = document.createElement(\"p\");\n newp.setAttribute(\"id\", \"errorp\");\n let error = document.createTextNode(`${result['error']}`);\n newp.appendChild(error);\n newp.style.color = \"red\";\n document.querySelector('#compose-view').prepend(newp);\n return false;\n }\n });\n}", "function sendEmail(email){\n\tif(emails.indexOf(email) > -1){\n\t\tlet code = createCode();\n\t\t// send user email\n\t\tconst request = mailjet\n\t\t.post(\"send\", {'version': 'v3.1'})\n\t\t.request({\n\t\t \"Messages\":[\n\t\t {\n\t\t \"From\": {\n\t\t \"Email\": \"[email protected]\",\n\t\t \"Name\": \"Ajah Chukwuemeka\"\n\t\t },\n\t\t \"To\": [\n\t\t {\n\t\t \"Email\": email,\n\t\t \"Name\": \"Corona Virus Volunteer\"\n\t\t }\n\t\t ],\n\t\t \"Subject\": \"Your login pass code: COVID-19 Team\",\n\t\t \"TextPart\": `Please use this pass code to login on the push notification service ${code}`,\n\t\t \"HTMLPart\": `<p>Please use this pass code to login on the push notification service <b>${code}</b></p>`,\n\t\t \"CustomID\": \"AppGettingStartedTest\"\n\t\t }\n\t\t ]\n\t\t});\n\t\trequest.then((result) => {\n\t\t console.log(result.body)\n\t\t })\n\t\t.catch((err) => {\n\t\t console.log(err)\n\t\t})\n\n\t\treturn {email:email, code:code, success:true}\n\t}\n\treturn {email:email, code:undefined, success:false}\n}", "function send(to, from, cc, subject, body, attch) {\n\n\t//build the mail options\n\tvar mailOptions = _defineMailOptions(to, from, cc, subject, body, attch);\n\n\t//return async work\n\treturn new Promise(function(resolve, reject) {\n\n\t\tconsole.log('sending mail');\n\n\t\t//send mail with the defined transport object\n\t\tTRANSPORTER.sendMail(mailOptions, function results(error, info){\n\n\t\t\t//if there was an error notify the user\n\t\t\tif(error) reject(info);\n\t\t\telse resolve('Message sent: ' + info.response);\n\t\t\t//if not send a positive response\n\n\t\t});\n\n\t});\n\n}", "function sendMail(contactForm) {\n emailjs.send(\"girls on the run\", \"Run\", {\n \"from_name\": contactForm.name.value,\n \"from_email\": contactForm.emailaddress.value,\n \"message\": contactForm.message.value,\n\n })\n .then(\n function (response) {\n console.log(\"SUCCESS\", response);\n contactForm.name.value = \"\"\n contactForm.emailaddress.value = \"\"\n contactForm.message.value = \"\"\n\n // show message when form sent\n $(document).ready(function () {\n $('#email-sent').show();\n });\n\n\n },\n function (error) {\n console.log(\"FAILED\", error);\n }\n );\n return false;\n}", "function mail(){\n return mail;\n}", "function isOkEmail() {\n\n //The program looks there is the right format.\n let indexOfAt = emailUser.value.indexOf('@');\n let textBeforeAt = emailUser.value.slice(0, indexOfAt);\n let textAfterAt = emailUser.value.slice(indexOfAt+1, emailUser.value.length);\n let indexOfDot = textAfterAt.indexOf('.');\n let textBeforeDot = textAfterAt.slice(0, indexOfDot);\n let textAfterDot = textAfterAt.slice(indexOfDot+1, emailUser.value.length);\n\n //fThe program that there are all the elements and later the right format\n if (emailUser.value === \"\") {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_mailEmpty_EM');\n okEmail = false;\n } else if (!emailUser.value.includes('@')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_At_EM');\n return false;\n } else if(textAfterAt.length == 0 || (textAfterAt.length == 1 && indexOfDot == 0)) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_domain_EM');\n return false;\n } else if (!emailUser.value.includes('.')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_dot_EM');\n return false;\n } else if (emailUser.value.includes(' ')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_blank_Space_EM');\n return false;\n } else if (textBeforeAt.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else if (textBeforeDot.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else if (textAfterDot.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else {\n clearAllEmailErrors();\n return true;\n }\n }", "function sendMail(contactForm) {\n emailjs.send(\"template_ho1z60q\", \"Learn Gaeilge for Primary School\", {\n \"from_name\": contactForm.name.value,\n \"from_email\": contactForm.emailaddress.value,\n \"message\": contactForm.message.value\n })\n .then(\n function (response) {\n alert(\"Thanks for contacting Learn Gaeilge\");\n window.location.replace(\"/\");\n },\n function (error) {\n alert(\"Whoops! There seems to be a problem. Please try again.\");\n });\n return false;\n \n\n}", "function sendMail(){\n\t\n\terror = false;\t\t// Reset error to assume there's no errors\n\t\n\t// Fetch user's information\n\tvar name = document.getElementById('name').value;\n\tvar email = document.getElementById('email').value;\n\tvar subject = document.getElementById('subject').value;\n\tvar message = document.getElementById('message').value;\n\t\n\t//-----------------------------//\n\t// Validate user's information //\n\t//-----------------------------//\n\t\n\t// Did user input their name?\n\tif (name == ''){\n\t\tvalidateActions(\"nameVal\", \"nameGroup\", \"Name field is empty\", true);\n\t}\n\telse{\n\t\tvalidateActions(\"nameVal\", \"nameGroup\", \"\", false);\n\t}\n\t\n\t\n\t// Did user input their email?\n\tif (email == ''){\n\t\tvalidateActions(\"emailVal\", \"emailGroup\", \"Email field is empty\", true);\n\t}\n\telse{\n\t\t// Email Regex\n\t\tvar re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\t\t\n\t\t// Is the email invalid?\n\t\tif (!re.test(email)){\n\t\t\tvalidateActions(\"emailVal\", \"emailGroup\", \"Given email is invalid\", true);\n\t\t}\n\t\telse{\n\t\t\tvalidateActions(\"emailVal\", \"emailGroup\", \"\", false);\n\t\t}\n\n\t}\n\t\n\t// Did user input an email subject?\n\tif (subject == ''){\n\t\tvalidateActions(\"subjectVal\", \"subjectGroup\", \"Subject field is empty\", true);\n\t}\n\telse{\n\t\t// Is the email subject ridiculously long?\n\t\tif (subject.length > 100){\n\t\t\tvalidateActions(\"subjectVal\", \"subjectGroup\", \"We appreciate the long subject title but please shorten it to 100 words or less.\", true);\n\t\t}\n\t\telse{\n\t\t\tvalidateActions(\"subjectVal\", \"subjectGroup\", \"\", false);\n\t\t}\n\t}\n\t\n\t\n\t// Did user input their email message?\n\tif (message == ''){\n\t\tvalidateActions(\"messageVal\", \"messageGroup\", \"Message field is empty\", true);\n\t}\n\telse{\n\t\t// Is the email message ridiculously long?\n\t\tif (message.length > 2000){\n\t\t\tvalidateActions(\"messageVal\", \"messageGroup\", \"We appreciate the long message but please shorten it to 2000 words or less.\", true);\n\t\t}\n\t\telse{\n\t\t\tvalidateActions(\"messageVal\", \"messageGroup\", \"\", false);\n\t\t}\n\t}\n\t\n\t// Did we have an error?\n\tif (error){\n\t\t$(\"#errormessage\").addClass(\"show\");\n\t\t$(\"#sendmessage\").removeClass(\"show\");\n\t\treturn false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Prevent form from sending\n\t}\n\telse{\n\t\t// Empty each field (to prevent submit button spam)\n\t\tdocument.getElementById('name').value = \"\";\n\t\tdocument.getElementById('email').value = \"\";\n\t\tdocument.getElementById('subject').value = \"\";\n\t\tdocument.getElementById('message').value = \"\";\n\t\t\n\t\t$(\"#errormessage\").removeClass(\"show\");\n\t\t$(\"#sendmessage\").addClass(\"show\");\n\t}\n\t\n\t\n\t//----------------------------------------//\n\t// Send user's information to create mail //\n\t//----------------------------------------//\n\t\n\t// Stores user's information\n\tvar data = {};\n\tdata.name = name;\n\tdata.email = email;\n\tdata.subject = subject;\n\tdata.message = message;\n\t\n\t//alert(data.name + \" || \" + data.email + \" || \" + data.subject + \" || \" + data.message); \n\t\n\t//var loc = window.location.pathname;\n\t//var dir = loc.substring(0, loc.lastIndexOf('/'));\n\t//alert(dir);\n\t\n\t//$.post(dir + \"/contactform/emailtransfer.php\", data, mailReturn);\n}", "function sendMail(contactForm, level) {\n $(\"form button\").html(\"Sending...\");\n\n emailjs.send(\"service_wofndpb\", \"template_8yl86a3\", {\n \"level\": level,\n \"form_email\": contactForm.userEmail.value\n })\n .then(\n function() {\n $(\"form button\").html(\"Sent!\");\n },\n function(error) {\n alert(\"Email could not be sent. Error:\" + error);\n }\n );\n\n return false;\n}", "function sendMail(contactForm) {\n emailjs.send(\"gmail\", \"joinMailList\", {\n from_email: contactForm.email.value,\n })\n .then(\n function(response) {\n console.log(\"SUCCESS\", response);\n },\n function(error) {\n console.log(\"FAILED\", error);\n }\n );\n $('#modalJoinMail').modal('hide');\n $('#modalJoinSuccess').modal('show');\n return false;\n}", "function emailReturning(survey_id,event_id,participant_id,hash,email,page) {\r\n\t$.get(page, { s: hash, survey_id: survey_id, event_id: event_id, participant_id: participant_id, email: email }, function(data) {\r\n\t\tif (data == '0') {\r\n\t\t\talert(woops);\r\n\t\t} else if (data == '2') {\r\n\t\t\t$('#autoEmail').hide();\r\n\t\t\t$('#provideEmail').show();\r\n\t\t} else if (email != '') {\r\n\t\t\tsimpleDialog('The email was successfully sent to '+data,'Email sent!');\r\n\t\t}\r\n\t});\r\n}", "function sendMail(newsletterSignup) {\n emailjs.send(\"service_c5ljukn\", \"template_a4yyv0p\", {\n \"from_name\": newsletterSignup.name.value,\n \"from_email\": newsletterSignup.email.value,\n })\n .then(\n function (response) {\n $('#msgModal').modal('show');\n console.log(\"SUCCESS\", response);\n },\n function (error) {\n console.error(\"FAILED\", error);\n }\n );\n return false;\n}", "function startupEmailsResult(response) {\n var pLine;\n if (response === 'fail') {\n if (D1846.mailError === false) {\n var errmsg = 'Sending an email to a player failed.\\n';\n errmsg += 'Please contact the DRAFT1846 webmaster.\\n';\n errmsg += D1846.adminName + '\\n';\n errmsg += D1846.adminEmail;\n alert(errmsg);\n D1846.mailError = true;\n }\n }\n else if (response !== 'success') {\n // Something is definitly wrong in the code.\n var nerrmsg = 'Invalid return code from emailPlayer.php.\\n';\n nerrmsg += 'Please contact the DRAFT1846 webmaster.\\n';\n nerrmsg += D1846.adminName + '\\n';\n nerrmsg += D1846.adminEmail;\n alert(nerrmsg);\n }\n else {\n pLine = \"<br>A confirmation email has been sent.\"; \n $(\"#did\").append(pLine);\n if (D1846.firstReply === true){ // Only do this once.\n D1846.firstReply = false;\n D1846.dbDone = true;\n // Clear player fields on form.\n $('.fn1').each(function(i){\n $(this).val(\"\");\n });\n $('.fn2').each(function(i){\n $(this).val(\"\");\n });\n // Hide \"Process Form\" button.\n $(\"#button1\").hide();\n // Uncheck Private Company boxes.\n $('.boxes:checked').each(function(){\n $(this).attr('checked', false);\n });\n }\n }\n}", "function sendEmail()\r\n{\r\n $('#send-button').addClass('disabled');\r\n\r\n sendMessage(\r\n {\r\n 'To': $('#compose-to').val(),\r\n 'Subject': $('#compose-subject').val()\r\n },\r\n $('#compose-message').val(),\r\n composeTidy\r\n );\r\n\r\n return false;\r\n}", "function sendEmail(itemID, id, newReturnDate, where) {\n var emailAddress = IDtoEmail(id);\n var item = inventory(itemID);\n var user = IDtoUser(id);\n var message;\n var subject;\n \n // message should depend if they just checked something out or in (and if it's a kit or not)\n if (where == 'Out') { \n subject = 'You just checked out: ' + item;\n if (itemID[0] == 2) { // if it's a kit\n message = 'Hello, ' + user + '! You recently checked out ' + item + ' with individual parts: ' + associatedItems(itemID) + '. It needs to be returned by ' + newReturnDate + '. Thank you, The Organization Team at the CEEO';\n }\n else {\n message = 'Hello, ' + user + '! You recently checked out ' + item + ' and it needs to be returned by ' + newReturnDate + '. Thank you, The Organization Team at the CEEO';\n }\n MailApp.sendEmail(emailAddress, subject, message);\n }\n else if (where == 'In') {\n subject = 'You just returned: ' + item;\n if (itemID[0] == 2) { // if it's a kit\n message = 'Hello, ' + user + '! You recently checked in ' + item + ' with individual parts: ' + associatedItems(itemID) + '. Thank you for bringing it back! Dr. E greatly appreciates it. Thank you, The Organization Team at the CEEO';\n }\n else {\n message = 'Hello, ' + user + '! You recently checked in ' + item + '. Thank you for bringing it back! Dr. E greatly appreciates it. Thank you, The Organization Team at the CEEO';\n }\n MailApp.sendEmail(emailAddress, subject, message);\n }\n}", "retrieveEmail(req, res) {\n // NEVER TRUST USER INPUTS\n if(!req.body.email) return res.status(400).send('NOT ALLOWED')\n if(!validator.isEmail(req.body.email)) return res.status(400).send('NOT ALLOWED')\n\n let emailFormatted = req.body.email.toLowerCase();\n \n return User\n .findByEmail(emailFormatted)\n .then((email) => {\n\n if(email === false) {\n Verifications\n .sendMail(emailFormatted, 1)\n .then(() => {\n res.status(200).send({\n 'email:':emailFormatted,\n 'result': 'an email has been sent'\n });\n })\n .catch((error) => {\n res.status(400).send({message: error.message})\n });\n \n } else {\n return res.status(200).send({'email': emailFormatted});\n }\n \n })\n .catch((error) => {\n console.error(error)\n res.status(400).send( {'message:':error.message})\n });\n }", "function reply(mailId) {\n fetch(`/emails/${mailId}`)\n .then(response => response.json())\n .then(email => {\n // Print emails\n if (!email.subject.includes(\"Re: \")) {\n email.subject = \"Re: \" + email.subject;\n }\n email.body = `\"On ${email.timestamp} ${email.sender} wrote: ${email.body}\" `\n compose_email(event, email.sender, email.subject, email.body);\n\n });\n return false;\n\n}", "async action() {\n let result = await this.userServiceDI.checkMailInDb({\n email: this.model.email\n });\n if (result != null) {\n let model = {\n body: {\n email: this.model.email,\n uid: result.uid,\n href: (new URL(this.referer)).origin,//this.referer,//CONFIG.FRONT_END_URL,\n name: result.name\n }\n };\n this.mailSenderDI.mailSend({\n xslt_file: EMAIL_TEMPLATE.forgot_password_step_1,\n model,\n email_to: this.model.email,\n language: result.language,\n mail_title: new CodeDictionary().get_trans(\n \"FORGOT_PASSWORD_FIRST_MAIL\",\n \"EMAIL\",\n result.language\n )\n });\n }\n }", "function checkMail() {\n return new Promise((resolve, reject)=>{\n resolve({success: true});\n if(Math.random() > 0.5) {\n resolve({success: true});\n } else {\n reject({success:false});\n }\n });\n }", "function attemptContact() {\n \"use strict\";\n var variables = getVariables();\n if (variables) {\n sendEmail(variables);\n }\n}", "function reply(email) {\n\n // Show compose view and hide other views\n document.querySelector('#emails-view').style.display = 'none';\n document.querySelector('#compose-view').style.display = 'block';\n document.querySelector('#single-email-view').style.display = 'none';\n\n // Fill in some fields but leave others blank\n document.querySelector('#compose-recipients').value = email.sender;\n document.querySelector('#compose-subject').value = `RE: ${email.subject}`;\n document.querySelector('#compose-body').value = '';\n\n // Add query selector for clicking on the button to send a new email\n document.querySelector('#compose-form').onsubmit = function() {\n // Assign each of the form fields to const variables\n const submitted_recipients = document.querySelector('#compose-recipients').value;\n const submitted_subject = document.querySelector('#compose-subject').value;\n const submitted_body = document.querySelector('#compose-body').value;\n\n // Send the POST request to our API\n fetch('/emails', {\n method: 'POST',\n body: JSON.stringify({\n recipients: submitted_recipients,\n subject: submitted_subject,\n body: submitted_body,\n })\n })\n // Then put the response from the API request into JSON form\n .then(response => response.json())\n // Finally load the Sent mailbox\n .then(result => {\n load_mailbox('sent');\n })\n\n return false;\n };\n\n \n}", "function mail(firstName, lastName, email) { \n //use predefined auth variables to send email with Habitack gmail\n return transporter.sendMail({\n from: 'Habitack Team <[email protected]>', // sender address\n to: email, // list of receivers\n subject: \"Welcome to Habitack!\", // Subject line\n //body\n html: `<h1>Hello ${firstName} ${lastName},</h1> <br /> \n <p>Welcome to your journey towards self improvement! Below is an introduction guide to help get you started</p><br />\n <p>Habitack is a habit tracker designed to facilitate users with tracking goals that can change your life for the better. <br />\n Our job is to calculate your progress and show you results. Your job is to attack daily challenges with the help of habitack. </p> <br />\n <p>Pages: </p> <br />\n <ol> \n <li>Goals Page</li>\n <ul>\n <li>List goals for the user</li>\n <li>Add new goal</li>\n <li>Delete goal</li>\n <li>Add photo to goal</li>\n </ul>\n <li>Stats Page</li>\n <ul>\n <li>Display the stats for a current goal</li>\n </ul>\n <li>Account Page</li>\n <ul>\n <li>Change account information</li>\n </ul>\n </ol>`\n })\n .then(r => console.log(r))\n .catch(e => console.log(e))\n}", "async function main () {\n // send mail with defined transport object\n transporter.sendMail({\n from: email, // sender address\n to: '[email protected]', // list of receivers\n subject: 'Client Enquiry', // Subject line\n html: message\n }, function (err) {\n if (err) {\n console.log(err)\n res.render('error')\n } else {\n console.log('Message sent successfully:')\n res.render('confirmation')\n }\n })\n }", "function sendMail(contactForm) {\n emailjs\n .send(\"gmail\", \"googleplaces_milestoneproject\", {\n from_name: contactForm.fullname.value,\n from_email: contactForm.emailaddress.value,\n project_request: contactForm.textarea.value\n })\n .then(\n function(response) {\n if (submit_fail) {\n submit_fail.classList.add(\"d-none\");\n }\n resetForm();\n submit_success.classList.remove(\"d-none\");\n setTimeout(() => {\n submit_success.classList.add(\"d-none\");\n }, 3000);\n console.log(\"SUCCESS\", response);\n },\n function(error) {\n submit_fail.classList.remove(\"d-none\");\n console.log(\"FAILED:\",error, response);\n }\n );\n return false;\n}", "function sendResponseEmail (recipientEmail, errorObj, dataFileName, submissionTime, formUrl) {\n Logger.log('Function sendResponseEmail has been reached.');\n var successSubject = 'Authorized Vaccination Scheduler Form - Successful Submission';\n var failSubject = 'Authorized Vaccination Scheduler Form - Submission Error';\n var dupeSubject = 'Authorized Vaccination Scheduler Form - Duplicate Request Received';\n var subject = '';\n var message = '';\n \n //if submission was for an individual user account...\n if (!bulk) {\n Logger.log('Not bulk.');\n //...and submission was not a duplicate, then compose success email\n if (!isIndivDupe) { \n subject = successSubject;\n var userInfo = 'User Name: ' + userFirst + ' ' + userLast + '<br>User Email: ' + userEmail + '<br>User Organization: ' + userOrg;\n message = \"Your submission on \" + submissionTime + \" to the \" + '<a href=\\\"' + formUrl + '\">Authorized Schedulers New User Signup</a>' + \" form was successful!<br><br>The following information has been received:<br><br>\" + userInfo + \"<br><br>Please note: It may take up to 24 hours for users to receive their account log-in credentials. Credentials will be sent directly to the email address(es) you provided. Please do not resubmit this form.<br><br>If after 24 hours user(s) have not received the account credentials, first, users should check their spam folders. If nothing is there, please reply and let us know the accounts that are missing.<br><br>-Vaccine Command Center Equity Team<br>\"; \n \n //...and submission was a duplicate, then compose duplicate email \n } else {\n Logger.log('Is dupe');\n subject = dupeSubject;\n message = \"An account has already been requested for the email address \" + userEmail + \". The original request was made by \" + origRespFirst + \" \" + origRespLast + \" on \" + origTime + \" with the following information:<br><br>\"\n + \"User Name: \" + origUserFirst + \" \" + origUserLast + \"<br>User Email: \" + origUserEmail + \"<br>User Organization: \" + origUserOrg + \"<br><br>\"\n + \"Please note: It may take up to 24 hours for users to receive their account log-in credentials. Credentials will be sent directly to the email address provided. Please do not resubmit this form.<br><br>If after 24 hours user(s) have not received the account credentials, first, users should check their spam folders. If nothing is there, please reply and let us know the accounts that are missing.<br><br>-Vaccine Command Center Equity Team<br>\";\n Logger.log('Message: ' + message);\n } \n \n //if submission was a bulk upload...\n } else if (bulk) {\n \n //...and submission was valid, then compose success email\n if (isValid) {\n subject = successSubject;\n message = \"Your submission of \" + dataFileName + \" on \" + submissionTime + \" to the \" + '<a href=\\\"' + formUrl + '\">Authorized Schedulers New User Signup</a>' + \" form was successful!<br><br>Please note: It may take up to 24 hours for users to receive their account log-in credentials. Credentials will be sent directly to the email address(es) you provided. Please do not resubmit this form.<br><br>If after 24 hours user(s) have not received the account credentials, first, users should check their spam folders. If nothing is there, please reply and let us know the accounts that are missing.<br><br>-Vaccine Command Center Equity Team<br>\";\n \n //...and submission was invalid, then compose fail email \n } else {\n \n subject = failSubject;\n \n // combine failStrings into one message\n var errorString = '';\n Object.values(errorObj).forEach(validObj => {\n if (!validObj.valid) {\n errorString += validObj.failString;\n }\n });\n \n //set the message\n message = \"Your submission of \" + dataFileName + \" on \" + submissionTime + \" to the Authorized Schedulers New User Signup form failed for the following reasons:<br>\" + errorString + \"<br>Please resubmit with corrections at \" + formUrl + \", thank you!<br><br>-Vaccine Command Center Equity Team<br>\"; \n } //close invalid \n \n } //close bulk\n \n //set the components of the email\n var emailTemplate = {\n to: recipientEmail,\n subject: subject,\n htmlBody: message,\n name: 'NYC Vaccine Command Center Equity Team',\n replyTo: '[email protected]'\n }\n \n //send the email\n MailApp.sendEmail(emailTemplate);\n return message; \n }", "function sendResultMail(resultdata,answerDetail,studentEmail){\n\n var FROM_ADDRESS = '[email protected]';\n var TO_ADDRESS = studentEmail;\n var html = \"\";\n var SUBJECT = 'Test Results';\n var greetingStr = \"\";\n var answerData = \"<table><tr><th>Question</th><th>Your Answer</th></tr>\"\n\n if(resultdata['pass_fail']==1){\n greetingStr = \"Congratulation! You passed test successfully <br/>\";\n } else {\n greetingStr = \"Oops, You did not Pass. <br/>\";\n }\n\n answerDetail.forEach(function(value,key){\n answerData = \"<tr>\";\n answerData += \"<td>\" + value['question_text'] + \"</td>\";\n answerData += \"<td>\" + value['your_answer'] + \"</td>\";\n answerData = \"</tr>\";\n });\n\n answerData += \"</table>\";\n\n var footer = \"Best regards,<br>The Certspring Team<br>\" +\n \"[email protected]\";\n\n html = greetingStr + answerData + footer;\n\n mailer.sendMail(FROM_ADDRESS, TO_ADDRESS, SUBJECT, html, function(err, success){\n if(err){\n throw new Error('Problem sending email to: ' + TO_ADDRESS);\n }\n // Yay! Email was sent, now either do some more stuff or send a response back to the client\n res.send('Email sent: ' + success);\n });\n}", "function sendMail(contactForm) {\n emailjs\n .send(\"gmail\", \"copenhagen\", {\n from_name: contactForm.name.value,\n from_email: contactForm.emailaddress.value,\n your_query: contactForm.query.value,\n })\n .then(\n function (response) {\n document.getElementById(\"form-reset\").reset();\n $(\".modal\").modal(\"toggle\");\n $(function () {\n setTimeout(function () {\n $(\"#send-message\").show();\n }, 1000);\n });\n\n $(function () {\n setTimeout(function () {\n $(\"#send-message\").show().hide();\n }, 5000);\n });\n },\n function (error) {\n console.log(\"FAILED\", error);\n }\n );\n return false;\n}", "function emailSuccessful(field) {\n //Saves the URL of the current page to the variable\n var href = window.location.href;\n //RegEx to find the value of the querystring\n //[?&] - matches any characters in the character set between the []\n //=([^&#]*) - matches anything after the equals sign zero or more times that is NOT a & or #\n var reg = new RegExp('[?&]' + field + '=([^&#]*)', 'i');\n //Pass the URL to check the value of the querystring, returns a result array or null\n var string = reg.exec(href);\n //If there are results in the array, return the recond element, otherwise, return null\n return string ? string[1] : null;\n }", "function compose_email(event, recipients_mail=\"\", subject_mail=\"\", body_mail=\"\") {\n document.querySelector('#alert').innerHTML= \"\";\n\n // Show compose view and hide other views\n document.querySelector('#emails-view').style.display = 'none';\n document.querySelector('#email-detail').style.display = 'none';\n document.querySelector('#compose-view').style.display = 'block';\n make_active(\"compose\");\n\n // Clear out composition fields\n document.querySelector('#compose-recipients').value = recipients_mail;\n document.querySelector('#compose-subject').value = subject_mail;\n document.querySelector('#compose-body').value = body_mail;\n\n document.querySelector(\"form\").onsubmit = function() {\n const send_to = document.querySelector(\"#compose-recipients\").value;\n const subject = document.querySelector(\"#compose-subject\").value;\n const content = document.querySelector(\"#compose-body\").value;\n\n fetch('/emails', {\n method: 'POST',\n body: JSON.stringify({\n recipients: send_to,\n subject: subject,\n body: content\n })\n })\n .then(response => response.json())\n .then(result => {\n // Print result\n\n // console.log(result);\n load_mailbox('sent');\n\n if (result.message) {\n document.querySelector('#alert').innerHTML = `<div class=\"alert alert-primary\" role=\"alert\">\n ${result.message}\n </div>`;\n } else if (result.error){\n document.querySelector('#alert').innerHTML = `<div class=\"alert alert-danger\" role=\"alert\">\n ${result.error}\n </div>`;\n }\n });\n\n return false;\n };\n}", "function getAcceptedRiderMailBody\n(\n name,\n lift\n)\n{\n var date = $.getDateTime.formatDate(lift.dt);\n var time = $.getDateTime.formatTime(lift.dt);\n var smoker = lift.smoker == true? 'yes': 'No';\n var emailBody = '<div><p><strong>Dear '+ \n name +'</strong>,</p><br />';\n emailBody +='<p>You request for the ride has been accepted by the driver.</p>';\n emailBody +='<p>Please login into your account and pay for the ride.</p>';\n emailBody +='<p><strong>Ride Request Detail</strong></p>';\n emailBody +='<table border=\"1px\">';\n emailBody +='<tr><td>Date</td><td>'+\n date+'</td></tr>';\n emailBody +='<tr><td>Time</td><td>'+\n time+'</td></tr>';\n emailBody +='<tr><td>Pick Up</td><td>'+\n lift.start+'</td></tr>';\n emailBody +='<tr><td>Drop Off</td><td>'+\n lift.to+'</td></tr>';\n emailBody +='<tr><td> Seats </td><td>'+\n lift.seats+'</td></tr>';\n emailBody +='<tr><td> Smoker </td><td>'+\n smoker+'</td></tr>';\n emailBody +='<tr><td> Bags </td><td>'+\n lift.bags+'</td></tr>';\n emailBody +='<tr><td> Bag Size </td><td>'+\n lift.bagSize+'</td></tr>';\n emailBody +='</table>';\n /* \n emailBody +='<tr><td> Rider Email </td><td>'+\n rider.email+'</td></tr></table>'; \n */\n emailBody +='<br /><p>Regards:-</p>';\n emailBody +='<p>Airpnd Team.</p>';\n emailBody +='<p><sub><i>This is a system generated';\n emailBody +='&nbsp;mail. Please do not reply to it.';\n emailBody +='</i><sub></p></div>';\n return emailBody;\n}", "function sendMail(contactForm) {\n emailjs.send(\"service_0gbqz3i\", \"template_ouiouibaguette\", {\n \"from_fname\": contactForm.fname.value,\n \"from_lname\": contactForm.lname.value,\n \"from_email\": contactForm.email.value,\n \"message\": contactForm.message.value\n })\n .then(\n function(response) {\n console.log(\"SUCCESS - Email sent\", response);\n $('#contact-form-title').text(\"Thank you!\");\n $('#contact-form-text').text(\"Your email has been sent, we will get back to you soon!\");\n $('#contact-form-content form').hide();\n\n resetForm();\n },\n function(error) {\n console.log(\"FAILED - The email has not been sent\", error);\n $('#contact-form-title').text(\"Oops...\");\n $('#contact-form-text').text(\"It seems something went wrong. We are probably already working on a fix, so try again later!\");\n $('#contact-form-content form').hide();\n\n resetForm();\n }\n );\n return false; // To block from loading a new page\n}", "function resendEmail(){\n $('#createAccountSubmitMessage').html(\"Loading...\");\n resendVerifyEmail($('#emailAddressValue').val(),function(tf){\n if (tf){\n $('#createAccountSubmitMessage').html(createAccountMessage);\n } else {\n var dumStr = '<p>An error has occurred: Unable to find email address in database. Please try creating account again.<p>';\n $('#createAccountSubmitMessage').html(dumStr);\n }\n });\n}", "async function handleReturn() {\n if (\n name !== \"\" ||\n cpf_cnpj !== \"\" ||\n rg !== \"\" ||\n phone !== \"\" ||\n email !== \"\"\n ) {\n confirmationAlert(\n \"Atenção!\",\n \"Deseja realmente VOLTAR para a página de consulta de pessoas? Os dados não salvos serão perdidos.\",\n \"returnPageConsult\"\n );\n } else {\n returnPageConsult();\n }\n }", "function sendmail(to,subject,content) {\n from = '[email protected]'\n var mailOptions = {\n from: from,\n to: to,\n subject: subject,\n html: content\n };\n\n transporter.sendMail(mailOptions, function(error, info){\n if (error) {\n console.log(error);\n } else {\n //console.log('Email sent: ' + info.response);\n }\n }); \n\n}", "function sendMail(fromMailAddress,subject, message,attachments) {\n\n\tvar port = MFP.Server.getPropertyValue(\"drivers_and_vehicles_mail_port\");\n\tvar host = MFP.Server.getPropertyValue(\"drivers_and_vehicles_mail_host\");\n\tvar toMailAddress = MFP.Server.getPropertyValue(\"drivers_and_vehicles_mail_toMailAddress\");\n\tvar user = null;\n\ttry {user = MFP.Server.getPropertyValue(\"drivers_and_vehicles_mail_user\");} catch(ex){}\n\tvar pass = null;\n\ttry {pass = MFP.Server.getPropertyValue(\"drivers_and_vehicles_mail_pass\");} catch(ex){}\n\tvar sendEmail = new com.ibm.drivers_and_vehicles.MailSender();\n\tvar sendNewEmail= sendEmail.sendNewEmail(host,port,toMailAddress,user,pass,fromMailAddress,subject, message,JSON.stringify(attachments));\n\treturn {isSent : sendNewEmail};\n}", "function emailSuccess(response) {\n showSuccessMessage(\"Email sent successfully.\");\n $rootScope.closeSpinner();\n }", "function reminderEmail() {\n var checkOut = SpreadsheetApp.getActive().getSheetByName('Check Out');\n var values = checkOut.getRange(1, 1, checkOut.getLastRow(), checkOut.getLastColumn()).getDisplayValues();\n \n for (var i=0; i < values.length; i++) {\n // if object has NOT been returned AND has 7 days until return, send an email\n if (values[i][6] == 'no') { // if item has not been returned\n if (values[i][7] == 7) {\n var id = values[i][0];\n var itemID = values[i][2];\n var item = values[i][3];\n var emailAddress = IDtoEmail(id);\n var user = IDtoUser(id);\n var subject = 'You have one week to return: ' + item;\n if (itemID[0] == 2) {\n var message = 'Hello, ' + user + '! You checked out ' + item + ' with individual parts: ' + associatedItems(itemID) + ' on ' + values[i][5] + '. It need to be returned in a week: ' + values[i][4] + '. Thank you, The Organization Team at the CEEO';\n }\n else {\n var message = 'Hello, ' + user + '! You checked out ' + item + ' on ' + values[i][5] + '. It needs to be returned in a week: ' + values[i][4] + '. Thank you, The Organization Team at the CEEO';\n }\n MailApp.sendEmail(emailAddress, subject, message);\n }\n // if object has NOT been returned AND has 0 or less days until return, send an email\n else if (values[i][7] < 0) {\n var id = values[i][0];\n var itemID = values[i][2];\n var item = values[i][3]\n var emailAddress = IDtoEmail(id);\n var user = IDtoUser(id);\n var subject = 'Please return your overdue item: ' + item;\n if (itemID[0] == 2) {\n var message = 'Hello, ' + user + '. You checked out ' + item + ' with individual parts: ' + associatedItems(itemID) + ' on ' + values[i][5] + '. It was supposed to be returned ' + values[i][7] + ' day(s) ago. Please get it in as soon as possible. Thank you, The Organization Team at the CEEO';\n }\n else {\n var message = 'Hello, ' + user + '. You checked out ' + item + ' on ' + values[i][5] + '. It was supposed to be returned ' + values[i][7] + ' day(s) ago. Please get it in as soon as possible. Thank you, The Organization Team at the CEEO';\n }\n MailApp.sendEmail(emailAddress, subject, message);\n }\n }\n }\n}", "function MessageSender(returnFile) {\n\tg_attachment = returnFile;\n\t////\n\tvar url_file = \"sendMailMessage\";\n\tsendToUrl(url_file);\n\t//\n}", "function sendMail(contactForm) {\n emailjs.send(\"gmail\", \"template_vn6mied\", {\n \"name\": contactForm.name.value, \n \"email_address\": contactForm.email.value, \n \"feedback\": contactForm.feedback.value,\n })\n .then(\n function(response) {\n $(\"#full_name\").val(\"\");\n $(\"#email_address\").val(\"\");\n $(\"#feedback\").val(\"\");\n $(\"#sendButton\").html(\"<i class='far fa-check-square'></i>Message sent!\");\n $(\"#sendButton\").prop('disabled', true);\n },\n\n function(error) {\n alert(\"Please complete all fields.\");\n }\n );\n return false;\n}", "function sendMail(from, toEmail, subject, body){\n\tvar ss = new com.ibm.cio.sendemail.MailBean();\n\tvar content =ss.sendMail(from,toEmail,subject,body);\n\treturn {\n\t\tresult : content\n\t};\n}", "async function sendEmail(req, res, email_content, mail, updated){\n /* Set the email content */\n const mailDetails = {\n from: '[email protected]',\n to: mail,\n subject: 'Changes in Profile',\n text: email_content.text_content,\n html: email_content.html_content,\n attachments: [{\n filename: 'TABCORE_FOOTER.png',\n path: __dirname + '/../views/assets/img/email/TABCORE_FOOTER.png',\n cid: 'tabcore_attach.png'\n }]\n };\n /* Send the email */\n transpo.sendMail(mailDetails, async function(err, result){\n if(err){\n req.session.message = email_content.error_mess;\n goMessage(req, res);\n }else{\n req.session.message = email_content.success_mess;\n goMessage(req, res);\n }\n });\n}", "function sendEmails(row,ss,i,signature,examineeEmailColumn, examinerEmailColumn){\n\n var subject = \"RSP \"+row.exam+\" Exam\"; // The subject Line\n var date = Utilities.formatDate(new Date(row.date), 'America/New_York', 'MM/dd/yyyy');\n\n //Message for Examinee\n var examineeEmail = `<p>Your <b>${row.exam} Exam</b> has been scheduled for <b>${date}</b> with <b>${row.examinerNum}</b>.</p>`+\n `<p>\\n\\nIf you have any questions and/or concerns, please reach out to me</p>`+\n `<p>\\n\\nThank you,<br\\>\\n${signature}</p>`;\n\n //Message for examiner\n var examinerEmail = `<p>A <b>${row.exam} Exam</b> has been scheduled for <b>${date}</b> with <b>${row.examineeNum}</b>.</p>`+\n `<p>\\n\\nThe exam rubric has been shared with you via Google Drive.</p>`+\n `<p>\\n\\nIf you have any questions and/or converns, please reach out to me.</p>`+\n `<p>\\n\\nThank you,\\n<br/>${signature}</p>`;\n\n var examineePlain = examineeEmail.replace(/(<([^>]+)>)/ig, \"\"); // clear html tags for plain mail\n \n\n if(row.examineeEmailSent!=\"SENT\"){ //If not marked as completed. send examinee email and mark as done\n MailApp.sendEmail(row.examineeEmail, subject,examineePlain,{ htmlBody: examineeEmail });\n ss.getRange(i,examineeEmailColumn).setValue(\"SENT\");\n }\n\n var examinerPlain = examinerEmail.replace(/(<([^>]+)>)/ig, \"\"); // clear html tags for plain mail\n\n if(row.examinerEmailSent!=\"SENT\"){ //If not marked as completed, send examiner email and mark as done\n MailApp.sendEmail(row.examinerEmail,subject,examinerPlain,{ htmlBody: examinerEmail });\n ss.getRange(i,examinerEmailColumn).setValue(\"SENT\");\n }\n}", "function sendMail(contactForm) {\n emailjs.send(\"gmail\", \"template_trivaworld\", {\n \"from_name\": contactForm.name.value,\n \"from_email\": contactForm.email.value,\n \"message\": contactForm.message.value,\n })\n\n .then(function(response) {\n console.log('SUCCESS!', response.status, response.text);\n // Turn the text inside the button to Sent\n $(\"#btn-submit\").html('<i class=\"fas fa-check\"></i> Sent');\n $(\"#btn-submit i\").css(\"color\", \"#01a74b\");\n $('#contact-form')[0].reset();\n // After 3 seconds turn it back to Send Message\n setTimeout(function(){\n $(\"#btn-submit\").html('Send Message');\n }, 3000);\n\n }, function(error) {\n console.log('FAILED...', error);\n $(\"#btn-submit\").html('Send Message');\n });\n return false;\n}", "function sendMail(contactForm) {\n emailjs.send(\"gmail\", \"newsletter\", {\n \"from_firstname\": contactForm.firstname.value,\n \"from_lastname\": contactForm.lastname.value,\n \"from_email\": contactForm.emailaddress.value\n })\n .then(\n function(response) {\n console.log(\"SUCCESS\", response);\n // Shows modal when the all fields have been completed in the form and the user has clicked on the submit button\n $(\"#myModal\").modal(\"toggle\");\n $(\"#close-modal\").click(function() {\n location.reload();\n });\n },\n function(error) {\n console.log(\"FAILED\", error);\n },\n );\n return false; // To block from loading a new page\n}", "function sendMail(contactForm) {\n emailjs.send(\"service_htxlx5m\",\"template_hcxua4p\", {\n \"message\": contactForm.message.value,\n \"from_email\": contactForm.emailaddress.value,\n \"from_name\": contactForm.name.value\n })\n .then(\n function(response) {\n alert(\"Thank you, your form has been submitted.\")\n location.reload();\n },\n function(error) {\n console.log(\"FAILED\", error);\n });\n return false; //To block from loading a new page\n}", "function tryEmail(email, time) {\n emailTimeSent = new Date();\n emailSentSuccess = true;\n try {\n emailMessage = sendConfirmEmail(email, time);\n } catch (error) {\n emailSentSuccess = false;\n }\n }", "function sendMail(e){\n\te.preventDefault()\n\tconst receiver = document.querySelector(\"#receiverName\").value\n\tconst content = document.querySelector(\"#inputContent\").value\n\t//const appendMail = new Mail(receiver.value, content)\n\t//auser.send.push(newMail)\n\n const newMail = {\n \"receiver\":receiver,\n \"content\":content\n }\n RequestModule.sendmail(newMail, function(newmail){\n sent.insertBefore(mailHTML(newmail), sent.children[1])\n if(receiver === currentUser){\n inbox.insertBefore(mailHTML(newmail), inbox.children[1])\n }\n })\n\n // Server side funtions will be added below in phase2.\n}", "function reply_email(email){\n var subject = email.subject;\n if (!subject.startsWith(\"Re:\")){\n subject = `Re: ${subject}`\n }\n compose_email();\n document.querySelector('#compose-recipients').value = `${email.sender}`;\n document.querySelector('#compose-subject').value = `${subject}`;\n document.querySelector('#compose-body').value = `\\n\\n------------------\\nOn ${email.timestamp} ${email.sender} wrote: \\n${email.body}\\n`;\n}", "function ERSendEmail() {\n\n if (!ExcelGenerated) {\n\n $.ajax({\n async: false,\n url: GenerateReport(false)\n }).done(function () {\n\n setTimeout(function () {\n\n if (hasExcelData) {\n fromemail = true;\n\n if ($('input[name=L1selectView]:checked').val() === \"L1selectGraph\") {\n\n ERPDFExportByLevel();\n } else {\n ERExcelExportByLevel();\n }\n\n\n }\n else {\n fromemail = false;\n //$('#emailerror_msg').removeClass(\"alert-info\").addClass(\"alert-danger\");\n //$('#emailerror_msg').css(\"display\", \"block\");\n //$('#email_msg').html(\"No data found matching your Criteria. Change Criteria and try again.\");\n ShowEmailStatus(\"No data found matching your Criteria. Change Criteria and try again.\", 'failure');\n }\n\n\n\n }, 2000);\n })\n\n\n }\n else {\n if (hasExcelData) {\n\n fromemail = true;\n\n if ($('input[name=L1selectView]:checked').val() === \"L1selectGraph\") {\n\n ERPDFExportByLevel();\n } else {\n ERExcelExportByLevel();\n }\n\n\n }\n else {\n fromemail = false;\n //$('#emailerror_msg').removeClass(\"alert-info\").addClass(\"alert-danger\");\n //$('#emailerror_msg').css(\"display\", \"block\");\n //$('#email_msg').html(\"No data found matching your Criteria. Change Criteria and try again.\");\n ShowEmailStatus(\"No data found matching your Criteria. Change Criteria and try again.\", 'failure');\n }\n }\n}", "function SendEmailRequest() {\r\n\t$(\"#ll_p3_MSG_Email\").css(\"display\", \"block\");\r\n\t$(\"#lnk_p3_Email\").css(\"display\", \"none\");\r\n\t$(\"#ctl00_head_txt_EmailRequested\").val(\"Y\");\r\n\treturn false;\r\n}", "function sendMail() {\n let emailTo = toEmail.value;\n let emailFrom = fromEmail.value;\n let uuid = downloadLink.value.split(\"/\").splice(-1, 1)[0];\n const data = {\n uuid,\n emailTo,\n emailFrom,\n };\n fetch(emailUrl, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(data),\n })\n .then((res) => res.json())\n .then((data) => {\n if (data.success) {\n toEmail.value = \"\";\n fromEmail.value = \"\";\n sharingContainer.style.display = \"none\";\n showPrompt(\"Email Sent Successfully\");\n }\n });\n}", "function submitFinished( response ) {\n\n response = $.trim( response );\n \n $('#sendingMessage').fadeOut();\n\n if ( response == \"success\" ) {\n\n // Form submitted successfully:\n // 1. Display the success message\n // 2. Clear the form fields\n // 3. Fade the content back in\n\n $('#successMessage').fadeIn().delay(messageDelay).fadeOut();\n $('#senderName').val( \"\" );\n $('#senderEmail').val( \"\" );\n $('#message').val( \"\" );\n $('#content').delay(messageDelay + 500).fadeTo( 'slow', 1 );\n //$('.email-form').delay(messageDelay + 500).remove();\n\n } else {\n\n // Form submission failed: Display the failure message,\n // then redisplay the form\n $('#failureMessage').fadeIn().delay(messageDelay).fadeOut();\n $('#contactForm').delay(messageDelay + 500).fadeIn();\n }\n }", "function sendmail(){\n\tvar iddd = addLoadingImage($(\"#send_message\"), \"before\");\n\t$str = $(\"form#send_message_form\").serialize();\n\t$.ajax({\n\t\turl : \"/\" + PROJECT_NAME + \"mail/send-mail\",\n\t\tmethod : \"POST\",\n\t\tdata : $str,\n\t\ttype : \"post\",\n\t\tdataType : \"json\",\n\t\tsuccess : function(jsonData) {\n\t\t\t\n\t\t\tif(jsonData == \"success\")\n\t\t\t{\n\t\t\t\t$(\"span#\"+iddd).remove();\n\t\t\t\t$(\"form#send_message_form\").trigger('reset');\n\t\t\t\t$(\"div.alert-box\").remove();\n\t\t\t\tshowDefaultMsg( \"Mail sent.\", 1 );\n\t\t\t\t$(\"#receiver_id\").tokenInput(\"clear\");\n\t\t\t\t$(\"div.mail-sendmsg-outer\").slideUp();\n\t\t\t\t$('#subject').focus();\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t});\n}", "function mailConfirmation(user, info, form, mail, callback) {\n var msg = \"Dear \" + form.firstName + \" \" + form.lastName + \"\\n\\n\";\n msg += \"Thank you for your purchase of \" + form.shares + \" shares on Pool Play.\\n\";\n msg += \"You've been charged $\" + info.price + \".00 for this purchase.\\n\";\n msg += \"If you have any questions, don't hesitate to contact us!\\n\\n\";\n msg += \"Thanks,\\n\";\n msg += \" The Pool Play team\";\n console.log(\"mailto: \" + form.email);\n var mailInfo = {\n from: \"Pool Play <[email protected]>\",\n to: form.email,\n subject: \"Confirmation of your Pool Play purchase\",\n text: msg\n };\n \n var smtpTransport = mail.createTransport(\"SMTP\", {\n service: \"Gmail\",\n auth: {\n user: \"[email protected]\",\n pass: \"165198795\"\n }\n });\n smtpTransport.sendMail(mailInfo, function(error, response) {\n if (error) {\n console.log(error);\n } else {\n console.log(\"Message sent: \" + response.message);\n }\n callback();\n });\n}", "function ERSendEmail() {\n\n if (!ExcelGenerated) {\n\n $.ajax({\n async: false,\n cache: false,\n url: GenerateReport(false)\n }).done(function () {\n\n setTimeout(function () {\n\n if (hasExcelData) {\n fromemail = true;\n\n if ($('input[name=L1selectView]:checked').val() === \"L1selectGraph\") {\n\n ERPDFExportByLevel();\n } else {\n ERExcelExportByLevel();\n }\n\n\n }\n else {\n fromemail = false;\n ShowEmailStatus(\"No data found matching your Criteria. Change Criteria and try again.\", 'failure');\n }\n\n\n\n }, 2000);\n })\n\n\n }\n else {\n if (hasExcelData) {\n\n fromemail = true;\n\n if ($('input[name=L1selectView]:checked').val() === \"L1selectGraph\") {\n\n ERPDFExportByLevel();\n } else {\n ERExcelExportByLevel();\n }\n\n\n }\n else {\n fromemail = false;\n ShowEmailStatus(\"No data found matching your Criteria. Change Criteria and try again.\", 'failure');\n }\n }\n}", "function send(maildata){\n \tvar deferred = Q.defer();\n \tvar userReceive = userService.getUsersMail()\n \t\t.then(function(str_user){\n \t\t\tvar mailOptions = {\n\t\t\t from: maildata.from +' <[email protected]>', // sender address\n\t\t to: str_user, // list of receivers\n\t\t\t subject: maildata.subject, // Subject line\n\t\t\t text: maildata.text, // plain text body\n\t\t\t html: maildata.html, // html body\n\t\t\t attachments: maildata.attachments\n\t\t\t};\n\t\t \ttransporter.sendMail(mailOptions, (error, info) => {\n\t\t\t if (error) deferred.reject(err);\n\t\t\t deferred.resolve(maildata.server);\n\t\t\t});\n \t\t})\n \t\t.catch(function (err) {\n deferred.reject(err);\n });\n return deferred.promise;\n}", "sendMail(options) {}", "async function SendMail(targetForm) {\n // mail stuff goes here\n let formData = new FormData(targetForm);\n\n // TODO: examine the method and incrementally build out the fetch call. currently it assumes POST\n\n let result = await fetch(`${targetForm.getAttribute(\"action\")}`, {\n method: targetForm.method,\n // TODO: a GET request doesn't use body, so this member should be conditional\n body: formData,\n }).then(response => {\n if (response.status !== 200) {\n throw new Error(`Mail submission failed: ${response.status}`);\n\n // could examine status code here and return it as part of an error object to the .catch handler in the SendMail then-able chain in main.js\n }\n\n return response;\n })\n\n let mailStatus = await result.json();\n\n return mailStatus;\n}", "function sendEMail(emailTo, ccTo, bccTo, subject, emailBody) {\n //separated as two lines, for debug\n var mailParamStr =\n 'mailto:' + emailTo + \"?\" +\n (ccTo ? ('cc=' + ccTo + \"&\") : \"\") +\n (bccTo ? ('bcc=' + bccTo + \"&\") : \"\") +\n 'subject=' + subject + \"&\" +\n 'body=' + emailBody;\n\n window.location = encodeURI(mailParamStr);\n}", "function getAcceptedDriverMailBody\n(\n name,\n ride\n)\n{\n var date = $.getDateTime.formatDate(ride.dt);\n var time = $.getDateTime.formatTime(ride.dt);\n var smoker = ride.smoker == true ? 'yes' : 'No';\n var emailBody = '<div><p><strong>Dear '+ \n name +'</strong>,</p><br />';\n emailBody +='<p>You offer for the drive has been accepted by the rider.</p>';\n emailBody +='<p>The rider was inform to pay for the ride.</p>';\n emailBody +='<p><strong>Ride Offer Detail</strong></p>';\n emailBody +='<table border=\"1px\">';\n emailBody +='<tr><td>Date</td><td>'+\n date+'</td></tr>';\n emailBody +='<tr><td>Time</td><td>'+\n time+'</td></tr>';\n emailBody +='<tr><td> From </td><td>'+\n ride.start+'</td></tr>';\n emailBody +='<tr><td> To </td><td>'+\n ride.to+'</td></tr>';\n emailBody +='<tr><td> Seats </td><td>'+\n ride.seats+'</td></tr>';\n emailBody +='<tr><td> Smoker </td><td>'+\n smoker+'</td></tr>';\n emailBody +='<tr><td> Bags </td><td>'+\n ride.bags+'</td></tr>';\n emailBody +='<tr><td> Bag Size </td><td>'+\n ride.bagSize+'</td></tr>';\n emailBody +='</table>';\n /* \n emailBody +='<tr><td> Rider Email </td><td>'+\n rider.email+'</td></tr></table>'; \n */\n emailBody +='<br /><p>Regards:-</p>';\n emailBody +='<p>Airpnd Team.</p>';\n emailBody +='<p><sub><i>This is a system generated';\n emailBody +='&nbsp;mail. Please do not reply to it.';\n emailBody +='</i><sub></p></div>';\n return emailBody;\n}", "function sendEmail(sender,recipient,title,content) {\n var transporter = nodemailer.createTransport({\n service: 'gmail',\n auth: {\n user: '[email protected]',\n pass: 'jiayehvinay'\n },\n tls: {\n rejectUnauthorized: false\n }\n });\n\n var mailOptions = {\n from: sender,\n to: recipient,\n subject: title,\n text: content\n };\n\n var response = transporter.sendMail(mailOptions, function(error, info){\n if (error) {\n console.log(error);\n var sent = false;\n } else {\n console.log('Email sent: ' + info.response);\n var sent = true;\n }\n return sent;\n });\n return response;\n}", "function checkUpdate(k,mail_format){\n if(k == 0){\n console.log('No data!');\n return false;\n }else{ \n // sendMail.sendMail(mail_format);\n console.log('send');\n }\n}", "function checkMailExistence(email) {\n var res;\n $.ajax({\n\turl: 'resources/check-mail.php',\n\ttype: 'POST',\n\tasync: false,\n\tdata: { mail: email },\n\tsuccess: function(result) {\n\t res=result.existence;\n\t}\n });\n return res;\n}", "function processEmail(theid, type){\r\n\t\t\t\t\tvar email_list =\"\";\r\n\t\t\t\t\tif(theid ==\"final_email_list\"){\t\r\n\t\t\t\t\t\tvar lines = $('textarea[name =final_email_list]').val().split('\\n');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t//then we split it on ; instead \r\n\t\t\t\t\t\tvar lines = $(\"#\"+theid).val().split(';');\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\t$.each(lines, function(){\r\n \t\t\t\t\t\t\t\r\n \t\t\t\t\t\t\tif(this.length >0){\r\n \t\t\t\t\t\t\t\temail_flag=isEmail(this);\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(email_flag){\r\n \t\t\t\t\t\t\t\temail_list = email_list+this+\"\\n\";\r\n \t\t\t\t\t\t\t}else{\r\n \t\t\t\t\t\t\t\treturn false;\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\tif(email_flag){\r\n\t\t\t\t\t\t\t$.post(\"includes/interface.php\", {list:email_list , page: 'update', id_string:\"<?php echo $id_string; ?>\", type:type} , function(data){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tsetTimeout(function(){ window.location.replace(\"thanks.php\"); }, 800);\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}else{\r\n\t\t\t\t\t\t\talert(\"One of your emails is not in the correct format\");\r\n\t\t\t\t\t\t\t$('#progress').hide();\r\n\t\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t}", "async function received(params ) {\n let transporter = nodemailer.createTransport(smtpTransport({\n host: \"mail.hiltonparkerng.com\",\n tls:{\n rejectUnauthorized: false\n },\n port: 465,\n secure: true,\n auth: {\n user: '[email protected]', \n pass: process.env.MAIL_PASSWORD\n },\n }));\n\n\n let info = await transporter.sendMail({\n from: '\"Hilton Parker Services\" <[email protected]>',\n to: `${params.email}`,\n subject:`Application Received`,\n html: ` \n <!doctype html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <title></title>\n <style>\n /* -------------------------------------\n INLINED WITH htmlemail.io/inline\n ------------------------------------- */\n /* -------------------------------------\n RESPONSIVE AND MOBILE FRIENDLY STYLES\n ------------------------------------- */\n @media only screen and (max-width: 620px) {\n table[class=body] h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important;\n }\n table[class=body] p,\n table[class=body] ul,\n table[class=body] ol,\n table[class=body] td,\n table[class=body] span,\n table[class=body] a {\n font-size: 16px !important;\n }\n table[class=body] .wrapper,\n table[class=body] .article {\n padding: 10px !important;\n }\n table[class=body] .content {\n padding: 0 !important;\n }\n table[class=body] .container {\n padding: 0 !important;\n width: 100% !important;\n }\n table[class=body] .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important;\n }\n table[class=body] .btn table {\n width: 100% !important;\n }\n table[class=body] .btn a {\n width: 100% !important;\n }\n table[class=body] .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important;\n }\n }\n\n /* -------------------------------------\n PRESERVE THESE STYLES IN THE HEAD\n ------------------------------------- */\n @media all {\n .ExternalClass {\n width: 100%;\n }\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%;\n }\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important;\n }\n #MessageViewBody a {\n color: inherit;\n text-decoration: none;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .btn-primary table td:hover {\n background-color: #34495e !important;\n }\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important;\n }\n }\n </style>\n </head>\n <body class=\"\" style=\"background-color: #f6f6f6; font-family: sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;\">\n <span class=\"preheader\" style=\"color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;\"></span>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #f6f6f6;\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">&nbsp;</td>\n <td class=\"container\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; display: block; Margin: 0 auto; max-width: 580px; padding: 10px; width: 580px;\">\n <div class=\"content\" style=\"box-sizing: border-box; display: block; Margin: 0 auto; max-width: 580px; padding: 10px;\">\n\n <!-- START CENTERED WHITE CONTAINER -->\n <table class=\"main\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: #ffffff; border-radius: 3px;\">\n\n <!-- START MAIN CONTENT AREA -->\n <tr>\n <td class=\"wrapper\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; box-sizing: border-box; padding: 20px;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Dear ${params.firstname + ' ' + params.lastname}</p>\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Your Application is under review,\n <br>\n Our Agent Officers will get back to you<br> \n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Thank you.</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n\n <!-- END MAIN CONTENT AREA -->\n </table>\n\n <!-- START FOOTER -->\n <div class=\"footer\" style=\"clear: both; Margin-top: 10px; text-align: center; width: 100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\">\n <tr>\n <td class=\"content-block\" style=\"font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: #999999; text-align: center;\">\n <span class=\"apple-link\" style=\"color: #999999; font-size: 12px; text-align: center;\">1 Rahman Adeboyejo St, Lekki Phase I, Lagos</span>\n </td>\n </tr>\n <tr>\n <td class=\"content-block powered-by\" style=\"font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: #999999; text-align: center;\">\n <a href=\"www.hiltonparkerng.com\" style=\"color: #999999; font-size: 12px; text-align: center; text-decoration: none;\">www.hiltonparkerng.com</a>.\n </td>\n </tr>\n </table>\n </div>\n <!-- END FOOTER -->\n\n <!-- END CENTERED WHITE CONTAINER -->\n </div>\n </td>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">&nbsp;</td>\n </tr>\n </table>\n </body>\n </html>\n `\n });\n\n}", "function sendReceiptEmail() {\n emailjs\n .send(\"servce_alin5647\", \"receipt-form\", {\n orderNumber: $(\".order-number\").text().toString(),\n bananaQt: $(\".checkout-quantity-banana\").text(),\n bananaUnitPrice: 30,\n bananaSum: $(\".banana-total\").text(),\n cauliflowerQt: $(\".checkout-quantity-cauliflower\").text(),\n cauliflowerUnitPrice: 30,\n cauliflowerSum: $(\".cauliflower-total\").text(),\n loquatQt: $(\".checkout-quantity-loquat\").text(),\n loquatUnitPrice: 50,\n loquatSum: $(\".loquat-total\").text(),\n subTotal: totalCost,\n shipping: $(\".shipping-total\").text(),\n finalSum: grandTotal,\n userMail: $(\".form-email > .form-input\").val().toString(),\n address: $(\".form-address > .form-input\").val().toString(),\n name: $(\".form-name > .form-input\").val().toString(),\n })\n .then(\n function () {\n console.log(\n \"SUCCESS! Receipt has been sent to email address provided!\"\n );\n window.location.href = \"checkout-finish.html\"; // Redirects user back to checkout-finish.html\n },\n function (error) {\n console.log(\"FAILED...\", error);\n }\n );\n }", "async sendMailToActive (req, res) {\n const email = req.body.email \n if (!email)\n return res.status(400).json({\n message: 'Please provide email to active'\n })\n\n let account = await accountModel.singleByEmail(email)\n if(account === null)\n return res.status(400).json({\n message: 'Email not exist'\n })\n\n const user = await userModel.getById(account.userid)\n if(user.statuscode === 'ACTIVE')\n return res.status(400).json({\n message: 'Email actived'\n })\n \n await accountModel.getOtp(req.hostname, req.protocol, account)\n return res.status(200).json({\n message: \"Email active sent, please check!\"\n })\n }", "async function application_verified(output) {\n let transporter = nodemailer.createTransport(smtpTransport({\n host: \"mail.hiltonparkerng.com\",\n tls:{\n rejectUnauthorized: false\n },\n port: 465,\n secure: true,\n auth: {\n user: '[email protected]', \n pass: process.env.MAIL_PASSWORD\n },\n }));\n\n\n let info = await transporter.sendMail({\n from: '\"Hilton Parker Services\" <[email protected]>',\n to: `${output[0].email}`,\n subject:`Application Verified`,\n html: `\n <!doctype html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <title>Simple Transactional Email</title>\n <style>\n /* -------------------------------------\n INLINED WITH htmlemail.io/inline\n ------------------------------------- */\n /* -------------------------------------\n RESPONSIVE AND MOBILE FRIENDLY STYLES\n ------------------------------------- */\n @media only screen and (max-width: 620px) {\n table[class=body] h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important;\n }\n table[class=body] p,\n table[class=body] ul,\n table[class=body] ol,\n table[class=body] td,\n table[class=body] span,\n table[class=body] a {\n font-size: 16px !important;\n }\n table[class=body] .wrapper,\n table[class=body] .article {\n padding: 10px !important;\n }\n table[class=body] .content {\n padding: 0 !important;\n }\n table[class=body] .container {\n padding: 0 !important;\n width: 100% !important;\n }\n table[class=body] .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important;\n }\n table[class=body] .btn table {\n width: 100% !important;\n }\n table[class=body] .btn a {\n width: 100% !important;\n }\n table[class=body] .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important;\n }\n }\n\n /* -------------------------------------\n PRESERVE THESE STYLES IN THE HEAD\n ------------------------------------- */\n @media all {\n .ExternalClass {\n width: 100%;\n }\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%;\n }\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important;\n }\n #MessageViewBody a {\n color: inherit;\n text-decoration: none;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .btn-primary table td:hover {\n background-color: #34495e !important;\n }\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important;\n }\n }\n </style>\n </head>\n <body class=\"\" style=\"background-color: #f6f6f6; font-family: sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;\">\n <span class=\"preheader\" style=\"color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;\">Application Verification Mail</span>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #f6f6f6;\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">&nbsp;</td>\n <td class=\"container\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; display: block; Margin: 0 auto; max-width: 580px; padding: 10px; width: 580px;\">\n <div class=\"content\" style=\"box-sizing: border-box; display: block; Margin: 0 auto; max-width: 580px; padding: 10px;\">\n\n <!-- START CENTERED WHITE CONTAINER -->\n <table class=\"main\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: #ffffff; border-radius: 3px;\">\n\n <!-- START MAIN CONTENT AREA -->\n <tr>\n <td class=\"wrapper\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; box-sizing: border-box; padding: 20px;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Dear ${output[0].firstname + ' ' + output[0].lastname}</p>\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Your application with Hilton Parker Services has been accepted and verified. Expect further instructions from your immigration officer.\n <br>\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Thank you</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n\n <!-- END MAIN CONTENT AREA -->\n </table>\n\n <!-- START FOOTER -->\n <div class=\"footer\" style=\"clear: both; Margin-top: 10px; text-align: center; width: 100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\">\n <tr>\n <td class=\"content-block\" style=\"font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: #999999; text-align: center;\">\n <span class=\"apple-link\" style=\"color: #999999; font-size: 12px; text-align: center;\">1 Rahman Adeboyejo St, Lekki Phase I, Lagos</span>\n </td>\n </tr>\n <tr>\n <td class=\"content-block powered-by\" style=\"font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: #999999; text-align: center;\">\n <a href=\"www.hiltonparkerng.com\" style=\"color: #999999; font-size: 12px; text-align: center; text-decoration: none;\">www.hiltonparkerng.com</a>.\n </td>\n </tr>\n </table>\n </div>\n <!-- END FOOTER -->\n\n <!-- END CENTERED WHITE CONTAINER -->\n </div>\n </td>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">&nbsp;</td>\n </tr>\n </table>\n </body>\n </html>\n `\n });\n\n}", "function sendmail(){\n \n var name = $('#Name').val();\n var email = $('#Email').val();\n var project = $('#Project').val();\n var message = $('#Message').val();\n var Body='Name: '+name+'<br>Email: '+email+'<br>Project: '+project+'<br>Message: '+message;\n\n const errorMessage=document.getElementById('display-message');\n errorMessage.style.padding=\"8px\"\n if(!name){\n errorMessage.innerText='Name is missing';\n return;\n }\n if(!email)\n {\n errorMessage.innerText='Email is missing';\n return;\n }\n if(!project)\n {\n errorMessage.innerText='Projects is missing';\n return;\n }\n if(!message)\n {\n errorMessage.innerText='You must Provide your Message';\n return;\n }\n Email.send({\n \n SecureToken:\"fbf31702-bb7f-4a4e-9c1c-4ccf17ee777f\",\n // SecureToken=\"20b444a2-b3af-4eb8-bae7-911f6097521c\",\n To: '[email protected]',\n From: \"[email protected]\",\n Subject: \"New message on contact from \"+name,\n Body: Body\n }).then(\n message =>{\n const errorMessage=document.getElementById('display-message');\n errorMessage.style.padding=\"8px\"\n \n if(message=='OK'){\n errorMessage.innerText='Your mail has been send. Thank you for connecting.';\n }\n else{\n errorMessage.innerText='There is error at sending message';\n }\n\n }\n );\n \n\n\n\n}", "function sendEmail(toEmail,subject,body) {\n Email.send({\n Host: \"smtp.gmail.com\",\n Username: \"[email protected]\",\n Password: \"NclStubank2021\",\n To: toEmail,\n From: \"[email protected]\",\n Subject: subject,\n Body: body,\n })\n .then(function (message) {\n alert(\"Recovery email sent\");\n });\n}", "function getEmailBody\n(\n messageType,\n name,\n userName,\n password,\n activationLink,\n rideDate,\n rideTime,\n lift\n)\n{\n var emailBody; \n var activationBody = \n String.format('<a href=\"{0}activation.php{1}\">Click Here </a>',\n SITE_URL,activationLink); \n switch(messageType)\n {\n case 'owner_registration' :\n case 'renter_registration':\n emailBody = '<div><p><strong>Dear '+ name +'</strong>,</p><br />';\n emailBody +='<p>You have successfully registered with AIRPND.</p>';\n emailBody +='<p>Please click on the link to activate your account.';\n emailBody +='</p><p>'+activationBody+'<br><br></p>';\n emailBody +='<p><strong>Your Credentials:-</strong>:-</p><br />';\n emailBody +='<p>User Name:<b> '+ userName +'</b></p>';\n// emailBody +='<p>Password:<b> '+ password +'</b></p>';\n emailBody +='<br /><p>Regards:-</p>';\n emailBody +='<p>Airpnd Team.</p>';\n emailBody +='<p><sub><i>This is a system generated';\n emailBody +='&nbsp;mail. Please do not reply to it.';\n emailBody +='</i><sub></p></div>';\n break;\n case 'fb_registration':\n emailBody = '<div><p><strong>Dear '+ name +'</strong>,</p><br />';\n emailBody +='<p>Please click on the link to complete your ';\n emailBody +='registration.</p><p>'+activationBody+'<br><br></p>';\n emailBody +='<p><strong>Your Credentials:-</strong>:-</p><br />';\n emailBody +='<p>User Name:<b> '+ userName +'</b></p>';\n// emailBody +='<p>Password:<b> '+ password +'</b></p>';\n emailBody +='<br /><p>Regards:-</p>';\n emailBody +='<p>Airpnd Team.</p>';\n emailBody +='<p><sub><i>This is a system generated';\n emailBody +='&nbsp;mail. Please do not reply to it.';\n emailBody +='</i><sub></p></div>'; \n break; \n case 'forgot_password':\n emailBody = '<div><p><strong>Dear '+ name +'</strong>,</p><br />';\n emailBody +='<p>Please click on the link to sign in ';\n emailBody +='AirPnd.</p><p>'+'<a href='+SITE_URL+'>Click here</a>';\n emailBody +='<br><br></p><p><strong>Your login details:-</strong>';\n emailBody +='</p><br /><p>User Name:<b> '+ userName +'</b></p>';\n emailBody +='<p>Password:<b> '+ password +'</b></p>';\n emailBody +='<br /><p>Regards:-</p>';\n emailBody +='<p>Airpnd Team.</p>';\n emailBody +='<p><sub><i>This is a system generated';\n emailBody +='&nbsp;mail. Please do not reply to it.';\n emailBody +='</i><sub></p></div>'; \n break; \n case 'payment':\n var date = $.getDateTime.formatDate(lift.dt);\n var time = $.getDateTime.formatTime(lift.dt);\n \n emailBody = '<div><p><strong>Dear '+ name +'</strong>,</p><br />';\n emailBody +='<p><strong>Your Confirmation code is:-</strong></p><br />';\n emailBody +='<p>Confirmation code :<b> '+ $.session.get('confirmationNo') +'</b></p>';\n emailBody +='<p><strong>The ride information as follow:</p><br />';\n emailBody +='<p>Paid Amount: '+ lift.contribution +'</b></p>';\n emailBody +='<p>Pick Up: '+ lift.start +'</b></p>';\n emailBody +='<p>Drop Off: '+ lift.to +'</b></p>';\n emailBody +='<p>Date: '+ date +'</b></p>';\n emailBody +='<p>Time: '+ time +'</b></p>';\n emailBody +='<br /><p>Regards:-</p>';\n emailBody +='<p>Airpnd Team.</p>';\n emailBody +='<p><sub><i>This is a system generated';\n emailBody +='&nbsp;mail. Please do not reply to it.';\n emailBody +='</i><sub></p></div>'; \n break;\n case 'paymentForDriver':\n var date = $.getDateTime.formatDate(lift.dt);\n var time = $.getDateTime.formatTime(lift.dt);\n \n emailBody = '<div><p><strong>Dear '+ name +'</strong>,</p><br />';\n emailBody +='<p><strong>The rider has paid for the following ride</p><br />';\n emailBody +='<p>Pick Up: '+ lift.start +'</b></p>';\n emailBody +='<p>Drop Off: '+ lift.to +'</b></p>';\n emailBody +='<p>Date: '+ date +'</b></p>';\n emailBody +='<p>Time: '+ time +'</b></p>';\n emailBody +='<p>Please login into your accout for detailed information. '+'</b></p>';\n emailBody +='<br /><p>Regards:-</p>';\n emailBody +='<p>Airpnd Team.</p>';\n emailBody +='<p><sub><i>This is a system generated';\n emailBody +='&nbsp;mail. Please do not reply to it.';\n emailBody +='</i><sub></p></div>'; \n break;\n }\n return emailBody; \n}", "function closeMail() {\n\t\tshutDown = true\n\t\tif (smtpTransport && pendingSends == 0) {\n\t\t\tsmtpTransport.close()\n\t\t\tsmtpTransport = undefined\n\t\t\tlogger('mail shut down')\n\t\t}\n\t}", "sendMail() {\n return __awaiter(this, void 0, void 0, function* () {\n var contra = this.generateRandomString(10);\n var mensaje = \"hola tu usuario es \" +\n this.nombre +\n this.apellido +\n \" y tu contrasena es \" +\n contra +\n \"\\n esperamos sea util\";\n var mailOptions = {\n from: \"[email protected]\",\n to: this.correo,\n subject: \"credenciales\",\n text: mensaje,\n };\n yield this.transporter.sendMail(mailOptions, (error, info) => {\n if (error) {\n console.log(error);\n }\n else {\n console.log(\"email enviado: \", info.response);\n }\n });\n return contra;\n });\n }", "function sendMail(contactForm) {\n // Function copied from Code Institute 'Putting it All Together' project and then modified\n let messageContainer = document.getElementById(\"messages\");\n emailjs.send(\"gmail\", \"read_n_reviewed_template\", {\n \"from_name\": contactForm.name.value,\n \"from_email\": contactForm.email.value,\n \"message\": contactForm.message.value,\n })\n .then(function (response) {\n console.log(\"SUCCESS\", response.status, response.text);\n messageContainer.innerHTML += `<div class=\"row flashed-messages\">\\\n <div class=\"col s12\">\\\n <h4>Your message has been sent.<br>A member of staff will be in touch shortly.</h4>\\\n </div></div>`;\n // Visually clear the form input fields\n contactForm.name.value = \"\";\n contactForm.email.value = \"\";\n contactForm.message.value = \"\";\n }, function (error) {\n console.log(\"FAILED...\", error);\n messageContainer.innerHTML += `<div class=\"row flashed-messages\">\\\n <div class=\"col s12\">\\\n <h4>Error: Your message failed to send. Please try again.</h4>\\\n </div></div>`;\n });\n return false; //to block from loading a new page\n}", "function submitEmailForm()\n{\n var fromemail=document.getElementById('fromemail').value;\n var toemail=document.getElementById('toemail').value;\n var terms=document.getElementById('terms');\n if(fromemail.length==0&&toemail.length!=0)\n {\n alert(FromemailNeeded);\n return false;\n }\n else\n {\n if(uploadDone==0)\n {\n var iread = document.getElementById('itotal').innerHTML;\n var dtremainingf = \"00:00:00\";\n var dtelapsedf = document.getElementById('dtelapsedf').innerHTML;\n var bspeedf = document.getElementById('bspeedf').innerHTML;\n var percent = \"100\";\n\n showProgress(iread+\",\"+iread+\",\"+dtremainingf+\",\"+dtelapsedf+\",\"+bspeedf+\",\"+percent);\n }\n document.emailform.uploadmode.value=currentmode;\n\n\t\t\n setTimeout(\"document.emailform.submit();\", 2000);\n //return document.emailform.submit();\n }\n}", "function sendOffRampEmail(html, plainText,to_email){\n // build email message\n var message = {\n from: \"[email protected]\",\n to: to_email,\n subject: \"ETHDenver - Vendor Cashout Request\",\n text: plainText,\n html: html\n };\n // send mail\n transport.sendMail(message, (err, res) => {\n if(err != undefined){\n console.log(err)\n }\n if(res.rejected.length != 0){ // res.rejected contains the list of emails that couldn't receive the sent email\n console.log(\"An email address was incorrect\")\n } else {\n console.log(\"Succesfully delivered email\")\n }\n })\n}", "async function sendEmailTo(response){\n console.log(response);\n const user = process.env.EMAIL_USERNAME;\n const pass = process.env.EMAIL_PASSWORD;\n let transporter = nodemailer.createTransport({\n host: \"smtp.gmail.com\",\n port: 587,\n secure: false, // true for 465, false for other ports\n auth: {\n user: user,\n pass: pass, \n },\n });\n\n let contacter = await transporter.sendMail({\n from: user, // sender address\n to: response.email, // list of receivers\n subject: \"Reply Message from 'EasyFind'\", // Subject line\n text: \"Thank you for showing interest for the 'EasyFind' Website. You will receive a reply from our administrator in a short time. \\nHave a great day! \\nSincerely, \\nAlexandru\", // plain text body\n html: \"<p>Thank you for showing interest for the 'EasyFind' Website. You will receive a reply from our administrator in a short time.</p><p>Have a great day!</p><p>Sincerely,<br>Alexandru</p>\" // html body\n });\n\n let you = await transporter.sendMail({\n from: user, // sender address\n to: user, // list of receivers\n subject: response.subject, // Subject line\n text: `Email from: ${response.email} \\n${response.message}`, // plain text body\n html: `<p>Message: ${response.message}</p>`\n });\n\n console.log(contacter);\n console.log(you);\n\n console.log(\"Message sent: %s\", contacter.messageId);\n console.log(\"Message sent: %s\", you.messageId);\n //Example: Message sent: <[email protected]>\n\n}", "function sendEmail (obj) {\n return transporter.sendMail(obj);\n}", "function resultsSendHandler ()\n{\n\tswitch(req.readyState)\n\t{\n\t\tcase 4:\n\t\t\tif(req.status!=200)\n\t\t\t{\n\t\t\t\talert(\"Beim Senden der Ergebnisse ist ein Fehler entstanden.\\nBitte versuchen Sie es ein weiteres Mal oder versenden das generierte XML mit ihrem Email-Programm.\\n(Request-Status: \" + req.status + \"; Request-Statustext: \" + req.statusText + \")\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\talert(\"Die Ergebnisse wurden erfolgreich gesendet.\");\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault: return false; break;\n\t}\n}", "async function notify(lead, mail) {\n let transporter = nodemailer.createTransport(smtpTransport({\n host: \"mail.hiltonparkerng.com\",\n tls:{\n rejectUnauthorized: false\n },\n port: 465,\n secure: true,\n auth: {\n user: '[email protected]',\n pass: process.env.MAIL_PASSWORD \n },\n }));\n\n\n let info = await transporter.sendMail({\n from: '\"Hilton Parker Services\" <[email protected]>',\n to: `${mail}`,\n subject:`Agent Application Mail`,\n html: `\n <!doctype html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <title>Simple Transactional Email</title>\n <style>\n /* -------------------------------------\n INLINED WITH htmlemail.io/inline\n ------------------------------------- */\n /* -------------------------------------\n RESPONSIVE AND MOBILE FRIENDLY STYLES\n ------------------------------------- */\n @media only screen and (max-width: 620px) {\n table[class=body] h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important;\n }\n table[class=body] p,\n table[class=body] ul,\n table[class=body] ol,\n table[class=body] td,\n table[class=body] span,\n table[class=body] a {\n font-size: 16px !important;\n }\n table[class=body] .wrapper,\n table[class=body] .article {\n padding: 10px !important;\n }\n table[class=body] .content {\n padding: 0 !important;\n }\n table[class=body] .container {\n padding: 0 !important;\n width: 100% !important;\n }\n table[class=body] .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important;\n }\n table[class=body] .btn table {\n width: 100% !important;\n }\n table[class=body] .btn a {\n width: 100% !important;\n }\n table[class=body] .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important;\n }\n }\n\n /* -------------------------------------\n PRESERVE THESE STYLES IN THE HEAD\n ------------------------------------- */\n @media all {\n .ExternalClass {\n width: 100%;\n }\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%;\n }\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important;\n }\n #MessageViewBody a {\n color: inherit;\n text-decoration: none;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .btn-primary table td:hover {\n background-color: #34495e !important;\n }\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important;\n }\n }\n </style>\n </head>\n <body class=\"\" style=\"background-color: #f6f6f6; font-family: sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;\">\n <span class=\"preheader\" style=\"color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;\">Agent Registration Mail</span>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #f6f6f6;\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">&nbsp;</td>\n <td class=\"container\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; display: block; Margin: 0 auto; max-width: 580px; padding: 10px; width: 580px;\">\n <div class=\"content\" style=\"box-sizing: border-box; display: block; Margin: 0 auto; max-width: 580px; padding: 10px;\">\n\n <!-- START CENTERED WHITE CONTAINER -->\n <table class=\"main\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: #ffffff; border-radius: 3px;\">\n\n <!-- START MAIN CONTENT AREA -->\n <tr>\n <td class=\"wrapper\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; box-sizing: border-box; padding: 20px;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Hi there,</p>\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">${lead.firstname + ' ' + lead.lastname} just completed registration for verification. <br>\n Find below agent information:<br>\n NAME: ${lead.firstname + ' ' + lead.lastname},<br>\n EMAIL: ${lead.email},<br>\n PHONE: ${lead.phonenumber}\n <br>\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\"> Kindly check your Dashboard to verify...</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n\n <!-- END MAIN CONTENT AREA -->\n </table>\n\n <!-- START FOOTER -->\n <div class=\"footer\" style=\"clear: both; Margin-top: 10px; text-align: center; width: 100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\">\n <tr>\n <td class=\"content-block\" style=\"font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: #999999; text-align: center;\">\n <span class=\"apple-link\" style=\"color: #999999; font-size: 12px; text-align: center;\">1 Rahman Adeboyejo St, Lekki Phase I, Lagos</span>\n </td>\n </tr>\n <tr>\n <td class=\"content-block powered-by\" style=\"font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-size: 12px; color: #999999; text-align: center;\">\n <a href=\"www.hiltonparkerng.com\" style=\"color: #999999; font-size: 12px; text-align: center; text-decoration: none;\">www.hiltonparkerng.com</a>.\n </td>\n </tr>\n </table>\n </div>\n <!-- END FOOTER -->\n\n <!-- END CENTERED WHITE CONTAINER -->\n </div>\n </td>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">&nbsp;</td>\n </tr>\n </table>\n </body>\n </html>\n `\n });\n\n}", "function employeOrderComplete(emp_data) {\n let html = fs.readFileSync(process.cwd() + '/server/templates/employee_email.html', 'utf8', (err) => {\n if (err)\n return console.error(err);\n });\n html = html.replace('#employee_email', emp_data.employee_email);\n html = html.replace('#customer_email', emp_data.customer_email);\n html = html.replace('#amount', emp_data.price);\n html = html.replace('#employee_email', emp_data.employee_email);\n html = html.replace('#service_type', emp_data.service_type);\n html = html.replace('#status', emp_data.order_status);\n\n let mailOptions = {\n from: EMAIL,\n to: emp_data.customer_email,\n subject: 'Order Completion Confirmation',\n html: html,\n };\n return new Promise((resolve, reject) => {\n transporter.sendMail(mailOptions, function (error, info) {\n if (error) return reject(error);\n else return resolve(true);\n });\n });\n}", "function onSendDraft(click) {\n\n\t//to validate email id\n\tvar emailID=document.frmMain.bookedByPartyEmail;\n\t\n\tif ((emailID.value==null)||(emailID.value==\"\")){\n\t\talert(\"Please provide the Email Id of the notification receiver in Email Id field to send the notification\");\n\t\temailID.focus();\n\t\treturn false;\n\t}\n\tif (echeck(emailID.value)==false){\n//\t\temailID.value=\"\";\n\t\temailID.focus();\n\t\treturn false;\n\t}\n\t\n\tdocument.getElementById('click').value = click;\n\treturn true;\n}", "function postsValidatedEmail() {\r\n if ($(\"#email\").val().length === 0) {\r\n //sets the background\r\n sendState(on, \"email\");\r\n\r\n //adds the data to the array\r\n addDataAllErrors(allErrorMess[0]);\r\n } else if (!validateEmail($(\"#email\").val())) {\r\n //sets the background\r\n sendState(on, \"email\");\r\n\r\n //adds the data to the array\r\n addDataAllErrors(allErrorMess[1]);\r\n\r\n //resets the email field\r\n $(\"#email\").val(\"\");\r\n } else {\r\n //Value validated put an element like a \"tick\"\r\n //image next to the element\r\n\r\n //sends the state and the object source\r\n sendState(off, \"email\");\r\n //clears the element\r\n $(\"#lblEmailError\").html(\"\");\r\n console.log(`the email element entered is correct!`);\r\n }\r\n }", "async function email(eventName, eventKey, list) { \n await new Promise(resolve => setTimeout(resolve, 1000));\n for (var i = 0; i < list.length; i++) {\n let returnCode = await sendEmail(eventName, eventKey, list[i]);\n console.log('Email return code: ', returnCode);\n if (returnCode !== '200') {\n return returnCode;\n }\n }\n return '200';\n}", "function validateEmail (email) {\n var requested;\n var emailEntryGood = 'Thanks for signing up! You’ll recieve an email with your invitation.';\n var emailEntryBad = 'There was a problem with your Request: Valid email address not provided.';\n\n // If user inputs a good email\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email)) {\n\n // Send the email address to the emailSave function to send to the database\n emailSave(email, submitTime);\n\n $('#js-message-endpoint').html(emailEntryGood);\n\n // Remove display-none on checkbox\n $('.checkbox').removeClass('display-none');\n\n // Switch over to email--sent\n $('.invite__request').removeClass('email--unsent');\n $('.invite__request').addClass('email--sent');\n\n // Change submit button text\n requested = 'REQUESTED';\n $('#buttontext').html(requested);\n\n }\n \n // If user enters a forbidden email\n else {\n\n $('#js-message-endpoint').html(emailEntryBad);\n\n // Hide checkbox\n $('.checkbox').addClass('display-none');\n\n // Switch over to email--unsent\n $('.invite__request').removeClass('email--sent');\n $('.invite__request').addClass('email--unsent');\n\n // Change submit button text\n requested = 'REQUEST INVITE';\n $('#buttontext').html(requested);\n\n }\n }", "function checkEmail() {}", "sendIsfMail() {\n var _a, _b;\n // this.updateValues('save');\n // this.updateSubValues();\n // [\n // \"[email protected]\",\n // \"[email protected]\",\n // \"[email protected]\",\n // \"[email protected]\",\n // \"[email protected]\"\n // ]\n const payload = {\n \"to\": this.sendMailList,\n \"cc\": ((_a = this.sendCCMailList) === null || _a === void 0 ? void 0 : _a.length) ? this.sendCCMailList : [],\n \"bcc\": [],\n \"replyTo\": [\n this.userData.email, \"[email protected]\"\n ],\n \"id\": (_b = this.editValues) === null || _b === void 0 ? void 0 : _b.id\n };\n this.CommonService.isfMail(payload).subscribe((response) => {\n if ((response === null || response === void 0 ? void 0 : response.statusCode) === 200) {\n this.values[\"isf_status\"] = \"ISF SENT BUT PENDING CONFIRMATION\";\n let d = new Date(), month = '' + (d.getMonth() + 1), day = '' + d.getDate(), year = d.getFullYear();\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n this.values[\"isf_sent_on\"] = [year, month, day].join('-');\n this.updateValues('save');\n this.CommonService.showSnackbar('Successfully Mail Sended', ['green-growl']);\n // this.updateValues('save');\n this.closeIsfMail();\n }\n else {\n this.CommonService.showSnackbarUnhide('Failure, Mail Not Sent, please Try Again', ['red-growl']);\n this.closeIsfMail();\n }\n }, (error) => {\n this.CommonService.showSnackbarUnhide('Failure, Mail Not Sent, please Try Again', ['red-growl']);\n });\n }", "function sendEmail() {\n\n\tvar name = $(\"#fname\").val()\n\tvar email = $(\"#email\").val()\n\tvar mesg = $(\"#message\").val()\n\n\t$.ajax({\n\t url: '/send',\n\t method: 'POST',\n\t data: {name : name, email : email, message : mesg},\n\t async: false,\n\t}).done(function(r){\n\n\t\t\t$(\"#loadingModal\").modal(\"close\")\n\n\t\t\tif (r) {\n\t\t\t\t$(\"#alertModal .modal-body\").empty().append(\"E-mail Sent\")\n\t\t\t\t$(\"#alertModal\").modal(\"open\")\n\t\t\t\t$(\"#fname, #email, #message\").val(\"\").removeClass(\"valid\")\n\t\t\t\t$(\".prefix, label\").removeClass(\"active\")\n\t\t\t\t$(\"#message\").characterCounter()\n\t\t\t} else {\n\t\t\t\t$(\"#alertModal .modal-body\").empty().append(\"E-mail Not Sent\")\n\t\t\t\t$(\"#alertModal\").modal(\"open\")\n\t\t\t}\n\t\n\t });\n\n}", "function triggerMail(completeResponse) {\n\n\tvar triggerMail = false;\n\n\tif (completeResponse.hasOwnProperty(\"intents\")) {\n\t\tvar intents = completeResponse.intents;\n\t\ttriggerMail = true;\n\t}\n\n\tif (triggerMail) {\n\t\tvar nodemailer = require('nodemailer');\n\t\tvar transporter = nodemailer.createTransport({\n\t\t\tservice: 'gmail',\n\t\t\tauth: {\n\t\t\t\tuser: senderEmailAddress,\n\t\t\t\tpass: senderEmailPassword\n\t\t\t}\n\t\t});\n\t\tvar mailOptions1 = {\n\t\t\t\tfrom: senderEmailAddress,\n\t\t\t\tto: receiverEmailAddress,\n\t\t\t\tsubject: 'Intent detected in Conversation',\n\t\t\t\ttext: 'This mail is to notify detection of Intent in Conversation.'\n\t\t};\n\t\ttransporter.sendMail(mailOptions1, function(error, info){\n\t\t\tif (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t} else {\n\t\t\t\tconsole.log('Email sent: ' + info.response);\n\t\t\t}\n\t\t});\n\t}\n}", "sendEmail() {\n email([EMAIL], null, null, null, null);\n }", "sendEmail() {\n this.validationController.validate().then(errors => {\n if (errors.length === 0) {\n var email = this;\n\n this.api.email.sendToStaff(this.subject, this.message)\n .then(function() {\n log.debug('Email sent succesfully. Rerouting to program page.');\n email.router.navigateToRoute('program');\n });\n }\n });\n }" ]
[ "0.65813243", "0.64366025", "0.62018806", "0.6144422", "0.6086133", "0.6010962", "0.5983848", "0.59792596", "0.5965081", "0.5815481", "0.58072644", "0.58011085", "0.5782231", "0.5781725", "0.57719654", "0.57717156", "0.5757699", "0.57420784", "0.5725638", "0.5713802", "0.57098794", "0.57029486", "0.5700063", "0.569444", "0.56873065", "0.5681114", "0.56401336", "0.5637706", "0.56081223", "0.5586778", "0.5576318", "0.5566224", "0.5559136", "0.55316573", "0.55299985", "0.5524879", "0.55141973", "0.5512798", "0.55070907", "0.5504143", "0.5495906", "0.5477311", "0.54772276", "0.5470369", "0.5463355", "0.5463346", "0.5462241", "0.5458541", "0.5443301", "0.54358953", "0.54277223", "0.54021084", "0.5389521", "0.5387188", "0.53798205", "0.5372238", "0.536768", "0.5364324", "0.5359086", "0.5349932", "0.53370935", "0.5335248", "0.5329612", "0.532608", "0.532409", "0.53037006", "0.529766", "0.52804595", "0.52778983", "0.5258343", "0.5255612", "0.52547455", "0.5254708", "0.52429616", "0.52349025", "0.5231579", "0.5227099", "0.52218276", "0.5214229", "0.52139926", "0.5210428", "0.5205935", "0.5196716", "0.5196245", "0.5187367", "0.51835763", "0.51721954", "0.5172094", "0.5171688", "0.51655465", "0.5162001", "0.5160524", "0.51499", "0.5141823", "0.5135763", "0.51308954", "0.5130712", "0.5129952", "0.51289785", "0.5128361" ]
0.5880084
9
holds and updates state
constructor() { super(); this.state = { cards: data, id: 0 }; this.increment = this.increment.bind(this); this.decrement = this.decrement.bind(this); this.delete = this.delete.bind(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "stateUpdate() {\n this.handlestateVariable();\n this.handlestateVariable2();\n this.handleCChange();\n this.handleAChange();\n this.handleidCapture();\n this.handleimgCapture();\n this.handleConfigChange();\n this.idcaptureVal();\n this.imgcaptureVal();\n }", "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "function updateState() {\n gState.push({\n board: copyMat(gBoard),\n shownCount: gGame.shownCount,\n markedCount: gGame.markedCount,\n lives: gGame.lives,\n safeClick: gGame.safeClick,\n hints: gGame.hints,\n manualMode: gGame.isManualOn,\n gManualMode: gManualMode.isManualOn\n });\n}", "function state_update(st) {\n state = st;\n if (callback) {\n callback(st);\n }\n}", "handle() {\n if(!this.enabled)\n return;\n\n Object.assign(this.previousState, this.state); // Save the previous state\n this.update(); // Update the current state\n this.notify();\n }", "syncState() {\n }", "get state() { return this._state; }", "function State() {\n\n }", "function updateState() {\n //create our state object and notify our listener\n var state = {\n currentUniverseTime: new Date(currentUniverseTime)\n };\n\n fireStateChanged(state);\n\n // call update() again in a certain number of milliseconds\n updateStateTimeout = setTimeout(function () {\n updateState();\n }, timeBetweenStateUpdatesMs);\n }", "async updateState(state) {\n let key = this.ctx.stub.createCompositeKey(this.name, [state.getKey()]);\n let data = Utils.serialize(state);\n await this.ctx.stub.putState(key, data);\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "update(data = {}) {\n this.state = Object.assign(this.state, data);\n this.notify(this.state);\n }", "update() {\n BaseState.update.call(this);\n }", "get state(){return this._state;}", "get state(){return this._state;}", "get state(){return this._state;}", "refresh() {\n this.stateCounter(this.stateCounter() + 1);\n }", "updateState (val, key) {\n this.state[key] = val\n this.updateUI()\n }", "get state() {return this._p.state;}", "update () {}", "state(s){if (s) this.memory.state = s; return this.memory.state;}", "update(data = {}) {\r\n console.log(data);\r\n this.state = Object.assign(this.state, data);\r\n this.notify(this.state);\r\n }", "stateChanged(state) {\n this._clicks = state.counter.clicks;\n this._value = state.counter.value;\n }", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function update() {\n // ... no implementation required\n }", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "function State() { }", "update() {\n this.poll();\n }", "get state() { return this._publicState; }", "updateState(newState) {\n this.setState(newState);\n }", "function update(){\n keepResources()\n keepPopulation();\n keepProtection();\n keepPolitics();\n keepTech();\n}", "update() { }", "update() { }", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "function StateManager_ProcessState()\n{\n\t//in advance state mode?\n\tif (this.AdvancingStates > 0)\n\t{\n\t\t//decrease counter\n\t\tthis.AdvancingStates--;\n\t}\n\t//Process State Data\n\tthis.SetInterpreterData();\n\t//still in advance state mode? and current has default action?\n\tif (this.AdvancingStates > 0 && this.CurrentState.ListOfPaths.length > 0)\n\t{\n\t\t//notify history\n\t\t__SIMULATOR.History.StateLoaded(this.CurrentState);\n\t\t//notify the scores\n\t\t__SIMULATOR.Scores.StateLoaded(this.CurrentState);\n\t\t//load next state\n\t\tthis.LoadState(this.CurrentState.ListOfPaths[0].Destiny);\n\t\t//stop waiting\n\t\t__WAIT_MANAGER.StopWaiting();\n\t}\n\telse\n\t{\n\t\t//ensure that the advancing state marker is 0\n\t\tthis.AdvancingStates = 0;\n\t\t//stop waiting\n\t\t__WAIT_MANAGER.StopWaiting();\n\t\t//Inform the simulator that a new state has just been loaded (after we reset it back visually)\n\t\t__SIMULATOR.StateLoaded(this.CurrentState);\n\t}\n}", "set state (value) {\n this._mem.state = value;\n }", "prepareState() {\n /* ... */\n }", "update()\n {\n \n }", "if (newFirstUpdate === null) {\n // This is the first skipped update. It will be the first update in\n // the new list.\n newFirstUpdate = update;\n // Since this is the first update that was skipped, the current result\n // is the new base state.\n newBaseState = resultState;\n }", "updateState(state, val) {\n if (this.state[ state ] !== val) {\n const temp = {};\n temp[ state ] = val;\n this.setState(temp);\n }\n }", "function updateState() {\n\n\t\teditHistory.pushState();\n\t\tupdatePageBackground();\n\t}", "function updateState(data) {\n updateVoteFinishArea(data.state);\n}", "update() {\n // Subclasses should override\n }", "setState(newState) {\n this.state = {\n ...this.state,\n ...newState\n }\n this.#updater()\n }", "onStateChange() {\n\t\tthis.forceUpdate();\n\t}", "function updateState(s) {\n s.wkWidth != null && (state.wkWidth = s.wkWidth);\n s.wkHeight != null && (state.wkHeight = s.wkHeight);\n s.bkWidth != null && (state.bkWidth = s.bkWidth);\n s.bkHeight != null && (state.bkHeight = s.bkHeight);\n s.x != null && (state.x = s.x);\n s.y != null && (state.y = s.y);\n }", "get state() {\r\n return this._state;\r\n }", "increment (state) {\n state.count++;\n }", "stateChanged(state) { }", "stateChanged(state) {\n this._name = state.profile.name;\n this._position = state.profile.position;\n this._skill = state.profile.skill;\n this._saved = state.profile.saved;\n }", "async updatePrivateState(state) {\n let key = this.ctx.stub.createCompositeKey(this.name, state.getSplitKey());\n let data = State.serialize(state);\n await this.ctx.stub.putPrivateData(this.collectionName, key, data);\n return true;\n }", "updateState(state) {\n this.updateStateInner(state, this._props);\n }", "updateDecks() {\n this.setState(HearthstoneStore.getComposedState());\n }", "SaveSourceState() {\n\n }", "changeState() {\n const newState = this.machineTable[this.state][this.lastRead].state;\n\n this.state = parseInt(newState, 10);\n }", "_onChangeState() {\n\n\n }", "async updateState() {\n const stateResponses = await Promise.all([\n this.bulb.getLightState(),\n this.bulb.getDeviceInfo()\n ]).catch(err => {\n console.error(err.message);\n generateErrorQRCode(`Could not get status of ${deviceName}`);\n });\n const newState = lifxStateToCapstone_Yeet(\n stateResponses[0],\n stateResponses[1]\n );\n\n if (!_.isEqual(this.bulbState, newState)) {\n // the light bulb state has changed\n console.debug(\"State has changed\");\n this.bulbState = newState;\n // TODO: remove console.log once we can correctly pad the image. Instead\n // of logging this object, we will display it on the e-ink display.\n generateQRCode(this.bulbState);\n }\n }", "function instructionState() {\n sea.update();\n //player.update();\n }", "_update() {\n }", "changeState(state)\r\n {\r\n if(state==\"hungry\"||state==\"busy\"||state==\"normal\"||state==\"sleeping\")\r\n {\r\n this.usteps.push(this.initial);\r\n this.rsteps=[];\r\n this.initial=state;\r\n }\r\n else\r\n {\r\n throw new Error();\r\n }\r\n }", "function State() {\n\n }", "enterState(oldState){}", "updateData(config) {\r\n this.setState(config);\r\n }", "update() {\n this.fsm.update();\n }", "function updateStateMaps() {\n // XXX\n }", "changeState(state) {\r\n\r\n\r\n if (!this.statuses.includes(state)) {\r\n throw new Error(\"yryjinug\")\r\n }\r\n this.history1.push(this.activeState);\r\n this.activeState = state;\r\n this.history2 = [];\r\n\r\n\r\n }", "changeState(state) {\r\n for (let key in this.states){\r\n // console.log(this.states[key])\r\n if (key==state) {\r\n this.statesStack.append(this.state);\r\n this.state=state;\r\n this.undoStack.clear();\r\n return this;\r\n }\r\n } \r\n throw new Error();\r\n }", "function update() {}", "function OnStateUpdate(self, state)\n {\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n }", "enterState (state = this.Data) {\n this.State = state;\n }", "function _update() {\r\n this.component[this.prop] = this.control[this.prop];\r\n }", "get state() \n{ return this._state; \n}", "handerUpdate() {\n const that = this;\n this.setState({ page: this.state.page + 1 });\n api.getActivities(this.state.page, (err, result) => {\n if (err) {\n this.setState({ status_load: false })\n } else {\n this.setState({ status_load: true })\n that.setState({ max: this.state.max + 10 });\n let state = Object.assign({}, that.state);\n for (let i = 0; i < result.length; i++) {\n state.dataTimeline.push(result[i])\n }\n that.setState(state);\n }\n })\n }", "rerender() {\n\t\tthis.setState(this.state)\n\t}", "_mergeWithCurrentState(change) {\n return assign(this.props.data, change);\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "constructor(props) {\n super(props)\n this.state = { \n topic: \"\",\n startYr: \"\",\n endYr: \"\" \n // results:\"\", \n // saved:[]\n };\n this.handleChange = this.handleChange.bind(this);\n this.handleReset = this.handleReset.bind(this);\n }", "update(startingData) {}", "function update_state() {\n \"use strict\"\n // Only update if we are actually changing states\n if (current_slide != new_slide) {\n // Go from slide 0 to slide 1\n if (new_slide == 1) {\n // Reset zoom, then load second slide\n reset_zoom(to_second_slide, current_slide)\n } else if (new_slide == 2) {\n // Load third slide\n reset_zoom(to_third_slide, current_slide)\n } else if (new_slide == 3) {\n // Load fourth slide\n reset_zoom(to_fourth_slide, current_slide)\n } else if (new_slide == 4) {\n // Load fifth slide\n // Add zoom capabilities for the points\n zoom.on(\"zoom\", zoomed)\n // canvas.call(zoom)\n to_fifth_slide(current_slide)\n } else if (new_slide == 5) {\n // Load sixth slide\n reset_zoom(to_sixth_slide, current_slide)\n } else if (new_slide == 6) {\n // Load seventh slide\n reset_zoom(to_seventh_slide, current_slide)\n } else if (current_slide != -1 & new_slide == 0) {\n // Add zoom capabilities for the points\n zoom.on(\"zoom\", zoomed)\n // svg.call(zoom)\n // canvas.call(zoom)\n to_first_slide(current_slide)\n }\n current_slide = new_slide\n }\n}", "function updateValuesAndStates() {\n [values, states] = generateDefaultStateArray(getItemCount());\n}", "updated() {}", "notify() {\n this.observer[0].update(this.state);\n }", "async setState(state) {\n\n const chrChanged = !this.state || this.state.chr1 !== state.chr1 || this.state.chr2 !== state.chr2\n this.state = state\n // Possibly adjust pixel size\n const minPS = await this.minPixelSize(this.state.chr1, this.state.chr2, this.state.zoom)\n this.state.pixelSize = Math.max(state.pixelSize, minPS)\n\n let hicEvent = new HICEvent(\"LocusChange\", {\n state: this.state,\n resolutionChanged: true,\n chrChanged: chrChanged\n })\n\n this.update(hicEvent)\n this.eventBus.post(hicEvent)\n }", "get state() {\n return this._state;\n }" ]
[ "0.7255192", "0.70365983", "0.702881", "0.69399273", "0.6881865", "0.6847718", "0.68105674", "0.67217463", "0.67167586", "0.66709465", "0.6654572", "0.65905696", "0.6563447", "0.6560559", "0.655718", "0.655399", "0.655399", "0.655399", "0.64857495", "0.6468861", "0.6462766", "0.6432659", "0.6431334", "0.642841", "0.6414833", "0.6413735", "0.6413735", "0.6413735", "0.6413735", "0.6413735", "0.6413735", "0.6413735", "0.6413735", "0.6413735", "0.640035", "0.6384974", "0.63703066", "0.63598967", "0.6352311", "0.6352311", "0.6344965", "0.63415766", "0.63121545", "0.6310436", "0.6300406", "0.62972116", "0.62972116", "0.62960374", "0.62960374", "0.6292173", "0.62700874", "0.6268203", "0.62622815", "0.6252238", "0.624666", "0.62373996", "0.6205262", "0.61952245", "0.6191441", "0.6188086", "0.6187371", "0.6186481", "0.61859864", "0.61828554", "0.6177627", "0.61706316", "0.6152951", "0.61476034", "0.61430675", "0.61413866", "0.6140582", "0.6136731", "0.6129604", "0.61182684", "0.6118251", "0.61116135", "0.6111437", "0.61089945", "0.61060965", "0.61056286", "0.61023325", "0.6093961", "0.6093698", "0.6088504", "0.60848165", "0.6077949", "0.60767084", "0.60641456", "0.60607505", "0.60605556", "0.60587734", "0.60587734", "0.60587734", "0.60557175", "0.605567", "0.60546535", "0.60534567", "0.6049877", "0.6046302", "0.6042419", "0.603942" ]
0.0
-1
communication with components using props
render() { const { cards, id } = this.state; return ( <div className="App"> <div className="ButtonContainer"> <nav className="NavBar">Home</nav> <div className="CardContainer"> <Cards id={cards[id].id} firstName={cards[id].name.first} lastName={cards[id].name.last} city={cards[id].city} country={cards[id].country} jobTitle={cards[id].employer} employer={cards[id].title} movies={cards[id].favoriteMovies} cardsLength={cards.length} /> </div> <div className="buttons"> <PrevButton previous={this.decrement} /> <Delete delete={this.delete} /> <NextBtn next={this.increment} /> </div> </div> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get props () { return this.target.props }", "render() {\n \n // of course, there is no props\n // need to have this.props\n return <PassedComponent {...this.props}/>\n }", "get props() { return this._props }", "render(){\n const testValue = `All the names ${this.state.input}`\n return(\n <test value ={testValue} name={this.state.name} /> //How to render components from other files. value gives testValue as a PROP \n );\n }", "componentWillReceiveProps(newProps) {\n this.type = newProps.p.parameter_spec.type;\n this.name = newProps.p.parameter_spec.name;\n\n // update form controls to current values\n if (this.stringRef) this.stringRef.value = newProps.p.value;\n if (this.numberRef) this.numberRef.value = newProps.p.value;\n if (this.checkboxRef) this.checkboxRef.value = newProps.p.value;\n }", "constructor(props){\n //used to receive props and apply them to the appripriate location\n super(props)\n }", "constructor(props) {\n this.component = props;\n }", "constructor(props) {\n this.component = props;\n }", "render() { \n return ( \n <div>\n<h1>Componente de tipo Clase</h1>\n\n{/* Accedemos al estado \"texto\" del objeto state */}\n<h2 style={{color:this.props.colorText}}>{this.state.texto}</h2>\n<h3>Hola, {this.props.name}</h3>\n<ExampleProps nombre={this.props.name}/>\n</div>\n );\n }", "render(){\n return <WrappedComponent name='Marco' \n count={this.state.count} \n increment={this.clickHandler} \n // send props from Parent to wrapped Component\n {...this.props}\n />\n }", "function PropsDemo(props) {\n console.log(props)//{ user:\"abc\"}\n // props.user = \"qwer\" //not allowed\n return (\n <div>\n <i>PropsDemo</i>\n <h2>Username is {props.user} and he is {props.isActive}</h2>\n </div>\n )\n}", "set props(p) {\n props = p;\n }", "render() {\n return <ComposedComponent {...this.props}/>\n }", "render(){\n return (\n <ChildComponent {...this.props}/>\n );\n }", "render() {\n return <ChildComponent {...this.props} />;\n }", "render() {\n return <ChildComponent {...this.props} />;\n }", "render() {\n return <ComposedComponent {...this.props} />\n }", "componentWillReceiveProps(props) {\n console.log('bubble props ', props)\n this.props = props;\n this.update();\n }", "get props() {\n return this._props;\n }", "render(props) {\n return (\n <div>{props.hello}</div>\n )\n }", "render() {\n return <ComponentToBeRendered {...this.props} />;\n }", "function App() {\n const add = (a, b) => a+b;\n return (\n <div className=\"App\">\n <br/>\n {/* // <Login/> */}\n\n <br/>\n <Header title={\"Continent Africa\"} \n myInt = {4} \n myFunc = {add} \n myArray = {[1, 2, 3, 4]}\n myObject = {{ a:5, b:6}}\n />\n\n <ClassProps \n title=\"lion from Europe\"\n myInt = {5} \n myFunc = {add} \n myArray = {[1, 4, 6, 9]}\n myObject = {{ a:7, b:9}}\n />\n\n <FunctProps title=\"Welcome to the Functionnal Component..\"\n myInt = {5} \n myFunc = {add} \n myArray = {[1, 4, 6, 9]}\n myObject = {{ a:7, b:9}}\n />\n \n {/* Here i'm printing a second sricpt from same component */}\n <FuncProps2/>\n <br/>\n <Counter/>\n <br/>\n <SlideImages/>\n <br/>\n <Myform/>\n <br/>\n <Formtag/>\n <br/>\n <AdvcedFormtag/>\n <br/>\n <SecondAdvcedFormtag/>\n <br/>\n <FetchApi/>\n <br/>\n <AdvancedFetch/>\n\n </div> \n );\n}", "function mapStateToProps (state) {\n //return object of what you want to pass to component as a prop\n\n}", "render() {\n return <div>Start of comments: {this.props.number} {this.props.greeting} Comments:\n </div>\n {/* // You cannot change props^^ inside this .props. */}\n {/* //props is a read only variable. This is important to react's one way flow architecture. You can only pass fromp parent to child. */}\n }", "render() {\n // console.log('navigace render:', msg, this.props);\n return <SomeComponent {...this.props} {...this.props.screenProps}/>\n }", "mountComponent(/* instance, ... */) { }", "render() {\n // in class components as in function component we can access props\n //const { name } = this.props;\n return <p> This is a class component</p>\n }", "passToParent() {\n if (this.props.cb) {\n //this.props.cb.setState('info':data);\n this.props.cb(this.state.info);\n }\n }", "renderNotConnected() {\n return <Component {...this.props} />;\n }", "function Machine() {\n\n\n return (\n <div>\n <TransportComponent />\n </div>\n )\n\n}", "render() {\n\n //DESTRUCTORING TO AVOID USING THIS.PROPS ETC\n // (this, this.props.todo.id)} turns into (this, id)\n // {this.props.todo.title} turns into { title } \n // adding events \n const{ id, title } = this.props.todo;\n return (\n <div style={this.getStyle()}>\n <p>\n <input type=\"checkbox\" onChange={this.props.markComplete.bind\n (this, id)} /> {' '}\n { title }\n <button onClick={this.props.delTodo.bind(this, id)} style={btnStyle}> X </button>\n </p>\n </div>\n )\n }", "testFunction(){\n console.log('this is the props ' + this.props.name);\n }", "componentWillReceiveProps(props) {\n actions.get(props.visible)(\n props.title,\n props.message,\n props.buttons,\n );\n }", "render() {\n return (<Component {...this.props} fetchHero=\"I am a bug\" />);\n }", "componentWillReceiveProps(nextProps) {\n this.props.onProps(nextProps);\n }", "function Hello(helloprops) {\n console.log(\"My props are \");\n console.log(helloprops);\n return (\n <div>\n <p>The Hello Component - { helloprops.username } and { helloprops.friendlyname } </p>\n <p>Click <button onClick={() => helloprops.modifyUser(\"Amith\")}>here</button> to set name to Amith</p>\n <p>Click <button onClick={() => helloprops.modifyUser()}>here</button> to reset to Null</p>\n <p>Click <button onClick={() => helloprops.modifyUserAsync(\"Amith\")}>here</button> to set name to Amith after 5 seconds.</p>\n </div>\n )\n}", "componentWillReceiveProps(nextprops) {\n this.props = nextprops;\n }", "componentWillReceiveProps(nextprops) {\n this.props = nextprops;\n }", "componentWillReceiveProps(nextprops) {\n this.props = nextprops;\n }", "render() {\n // contents of the return() function are what will be rendered to the screen\n return (\n <div className=\"App\">\n <AddProject addProject={this.handleAddProject.bind(this)}/>\n\n {/* Pass properties (props) to other components by passing them as parameters */}\n <Projects projects={this.state.projects} onDelete={this.handleDeleteProject.bind(this)} />\n\n <hr />\n\n <Todos todos={this.state.todos}/>\n </div>\n );\n }", "render(){\n return(\n <div>\n <h2>The First React Component!!!!!! {this.props.msg} {this.props.newmsg}</h2>\n </div>\n )\n }", "function TypescriptComponent(props: {\n data: {\n title: string;\n intro: string;\n }[];\n}) {\n return <p onClick={props.someFunc(props[0].title)}>{props[0].title}</p>\n}", "function handleClick() {\nconsole.log(props)\n}", "constructor(props){\n super(props);\n console.log('[SendProps.js] inside constructor :',props);\n }", "render() {\r\n return<OriginalComponent {...this.props}/>\r\n }", "function ItemContainer( props ) {\n return (\n <div>\n <h4> Item - { props.type} - { props.item } </h4>\n <button onClick = { () => props.buyItem() }> Buy { props.type }</button> \n </div>\n )\n}", "componentWillReceiveProps(nextProps) {\n //pass props to update player\n this.updatePlayers(nextProps);\n }", "componentWillReceiveProps(newProps) { //chay khi Props component thay doi truoc khi render\n // newProps dong vai tro la this.props sau khi lay du lieu tu redux ve\n // Dung du lieu do set lai state dong bo hoa du lieu giua props va state\n this.setState(newProps.sinhVienSua)\n\n }", "componentWillMount() {\n this.handleProps(this.props);\n }", "render() {\n //Get the channel names to be displayed in DDL\n const names = this.state.channels.map((channel, idx) => {\n return { text: channel.name, key: idx, value: channel.liveaudio.url, id:channel.id };\n });\n\n //Here we start by using the Header component\n //Channels component and RadioPlyer component\n return (\n <div className=\"App\">\n <Header title=\"Consume SR REST-API\" channelNames={names}\n onClickScroll={this.onClickScroll} /* Prepare radio player */\n onChange={this.onChange} /* Update state for mp3 */\n />\n \n <Channels mp3 ={this.state.mp3} onAdd={this.onAdd} channels={this.state.channels} programs={this.state.prgm} subTitle=\"SR-Sveriges Radio\" onClickTbl={this.onClickTbl} />\n </div>\n );\n }", "render() {\n console.log(this.props.items);\n return (\n <div className=\"shopping-list\">\n \n <h3>{ this.props.name }</h3>\n <h4>Item | Qty</h4>\n \n { this.props.items.map( (i) =>// this tells the component to find items component and render it here\n <ItemContainer key={i.get('id')}\n id={i.get('id')}\n item={i.get('item')}\n quantity={i.get('quantity')}\n purchased={i.get('purchased')}\n />\n )}\n \n </div>\n );\n }", "function Props(props) {\n return <h1>{props.value}</h1>;\n}", "constructor(props) {\n //counter uses a class named react componenent which takes care of loading of props. if you create own constrcutor, say 'handle the props so I don't have to do it'\n super(props);\n\n this.state = {\n bgColor: 'peru',\n value: this.props.value\n };\n }", "prop(prop) { return this.props[prop.id]; }", "render() {\n const { Component, pageProps } = this.props;\n\n return (\n <Container>\n <Component {...pageProps} />\n </Container>\n );\n }", "componentWillReceiveProps() {\n \n }", "function Grid(props) {\n return <Component {...props} />;\n}", "render() {\n return (\n <p>Hello, {this.props.Layten}</p>\n );\n }", "function Person(props) {\n return <div>Name : {props.name}</div>; // will dynamically access the props by using single curly braces and accessing the props\n}", "function PPHOC (WrappedComponent){\n return class PP extends Component {\n constructor(props){\n super(props) ;\n this.state = {fileds:{}} ;\n }\n getField(filedName){\n if(!this.state.fileds[filedName]){\n this.state.fileds[filedName] ={\n value:'',\n onChange:event=>{\n this.state.fileds[filedName].value = event.target.value ;\n this.forceUpdate() ;\n }\n };\n }\n return {\n value:this.state.fileds[filedName].value,\n onChange:this.state.fileds[filedName].onChange\n } ;\n }\n render(){\n const props = Object.assign({},this.props,{\n fileds:this.getField.bind(this) \n }) ;\n return (\n <div>\n <h2>PP HOC</h2>\n <p>Im a Props Proxy HOC that abstracts controlled inputs</p>\n <WrappedComponent {...props} /> \n </div>\n ) ;\n }\n }\n}", "function ReactComponent(props,context){this.props=props;this.context=context;}", "render() {\n const total = Object.keys(this.state.selected)\n .reduce((acc, curr) => acc + this.state.selected[curr].cost, 0); \n\nconsole.log('from app.js calling props.js ', this.props);\nconsole.log('from app.js calling props.features.Processor ', this.props.features.Processor);\nconsole.log('from app.js calling state.selected ', this.state.selected.Processor)\n\nconsole.log('from app.js calling props.features.OS ', this.props.features['Operating System']);\n\n return( \n <div className=\"App\"> \n <Header/>\n <main>\n <section className='main_form'>\n <h3>TECH SPECS AND customIZATIONS</h3>\n\n <section id='processor'>\n <Processor \n //three things that each processor component is made of. Name, whether it;s selected or not, and click function\n myProcessors = {this.props.features.Processor}\n userSelected= {this.state.selected.Processor}\n //lets pass the function updateFeature() as a prop to all the features\n handle_update_feature = {(processors, value)=> this.updateFeature(processors, value)}\n />\n </section>\n\n <section id='os'>\n <OS\n myOS = {this.props.features['Operating System']}\n userSelectedOS= {this.state.selected.OS}\n handle_update_feature = {(OS, value)=> this.updateFeature(OS, value)}\n />\n </section>\n\n <section id='video'>\n <Video\n myVideoCard = {this.props.features['Video Card']}\n userSelectedVideo= {this.state.selected.VideoCard}\n handle_update_feature = {(Video, value)=> this.updateFeature(Video, value)}\n /> \n </section>\n <section id='display'>\n <Display\n myDisplay = {this.props.features.Display}\n userSelectedDisplay= {this.state.selected.Display}\n handle_update_feature = {(Display, value)=> this.updateFeature(Display, value)}\n />\n </section> \n </section> \n </main>\n <section className='main_summary'>\n <Summary selected={this.state.selected} />\n <Total total={total} />\n </section> \n </div>\n )\n }", "function ReactComponent(props,context){this.props = props;this.context = context;}", "static get props () {\n return assign({}, super.props, this[ctorProps]);\n }", "static get props () {\n return assign({}, super.props, this[$ctorProps]);\n }", "componentWillReceiveProps(nextProps) {}", "componentWillReceiveProps(nextProps) {}", "render(){\n return (\n <div className=\"ui grid container\">\n <VideoDetail video={this.props.selectedVideo} />\n <VideoList videos={this.props.videos} handleClick={this.props.selectVideo} />\n </div>\n )\n }", "constructor(props) {\n // Pass props back to parent\n super(props);\n }", "componentWillReceiveProps(newProps){\n\t}", "constructor(props = {}) {\n super();\n this.props = props;\n }", "render () {\n // since its a class, props accessed using this keyword\n return (<h1>\n {this.props.name}\n </h1>)\n }", "componentWillReceiveProps(props) {\n if (props.points) {\n this.updateMarkers(props.points);\n }\n }", "render() {\n console.log(this.props)\n return <div>\n <input type=\"text\" placeholder=\"Search\" onChange={this.props.Changer} value={this.props.input} />\n <button type=\"button\" onClick={this.props.titleSearch} style={{ marginBottom: \"30px\" }}>Search</button>\n </div>\n }", "componentWillReceiveProps(newProps) {\n //console.log('this.props.imgSrc: ', this.props.imgSrc);\n //render the children\n this.renderDialogContent(newProps);\n }", "renderPage() {\n console.log(this.props.followers)\n console.log(this.props.routinesOfFollower)\n return (\n <Container>\n <Header as=\"h2\" textAlign=\"center\">Followers</Header>\n \n {this.props.followers.map((follower) => <StuffItemAdmin key={follower._id} stuff={follower} routines={this.props.routinesOfFollower[follower._id]} />)}\n </Container>\n );\n }", "render() {\n console.log(\"this is the userlist component, are we getting the users:\", this.props.users);\n return (\n <ListItems users={this.props.users} onUserSelect={this.props.onUserSelect} />\n )\n }", "function Item(props) {\r\n let test = {\r\n example: \"object contents\"\r\n };\r\n console.log(test.example);\r\n\r\n // below are console logs showing your CUSTOM props!\r\n // to get things \"out\" of props, use \"dot notation\"\r\n // price lives INSIDE of props\r\n console.log(props.price);\r\n // product lives INSIDE of props\r\n console.log(props.product);\r\n\r\n // React will give you a param named \"props\" which is an object\r\n // THIS IS A REACT *FUNCTION* COMPONENT\r\n /*\r\n everything is trapped in the func,\r\n until you return it to whoever called it\r\n */\r\n return (\r\n // whatever we \"return\" will be what \"renders\" on the screen\r\n <div className=\"tile\">\r\n {/* prod ADD the product name here :-) */}\r\n <div className=\"pricebox\">{props.price}</div>\r\n </div>\r\n );\r\n}", "constructor(props){\n //Call the constrictor of Super class i.e The Component\n super(props);\n }", "constructor(props) {\n super(props);\n\n this.inputTitle = () => <input \n type = \"text\"\n name = \"title\"\n placeholder = \"Work title...\"\n value = {this.props.fields.title} \n onChange = {this.props.inputChange}\n disabled = {!this.props.editable}\n />\n\n this.searchResults = () => <ul className=\"search-results\">\n {this.props.searchResults.map((x, i) => \n <li onClick = {() => this.props.okReadClick(x.id)}>\n {x.title}\n </li>\n )}\n </ul>\n\n this.questionsList = () => <RunQuestionsList\n mode = {this.props.mode}\n questions = {this.props.fields.questions}\n changeAnswer = {this.props.changeAnswer}\n editable = {this.props.editable}\n />\n }", "function App() {\n return (\n <div className=\"App\">\n <UserProvider value=\"Prince\">\n <ComponentC />\n </UserProvider>\n\n {/*\n <ClickCounter name=\"Prince\" />\n <HoverCounter name=\"Prince\"/>\n <ErrorBoundary>\n <Hero heroName=\"superman\"/>\n </ErrorBoundary>\n <ErrorBoundary>\n <Hero heroName=\"batman\"/>\n </ErrorBoundary>\n <ErrorBoundary>\n <Hero heroName=\"joker\"/>\n </ErrorBoundary>\n <PortalsDemo />\n <FRParentInput />\n <Focusfile />\n <RefsDemo />\n <ParentComp />\n <Fragmentdemo />\n <Column />\n <LifecycleA />\n <Form />\n <Namelist />\n <Usergreeting />\n <Parentcomponent />\n {/* <Eventbind />\n */}\n {/* <Functionclick />\n <Classclick />\n /* /* < Counter />\n <Message />\n <Hello lastname=\" Roy\">\n <p>Your age is 22 Years</p>\n </Hello>\n <Greet name=\"abhishek\" lastname=\" kumar\">\n <p>Your age is 31 Years</p>\n </Greet>\n <Greet name=\"Ram\" lastname=\" singh\">\n <button>show</button>\n <p>\n Your Age is 32 Years\n </p></Greet>\n <Welcome name='one'/>\n <Welcome name='two' />\n <Welcome name='three' /> } */}\n </div>\n );\n}", "constructor(props){\n\t\tsuper(props);\n\n\t}", "componentWillReceiveProps(newProps){\n this.setState({\n active: newProps.value.active,\n }); \n }", "renderFlow() {\n\n\n return (\n <HttpListener componentProperties={{avatar: 'L', name: 'Mocky'}}/>\n );\n }", "function PropsEx({ name, description, price }) {\n return (\n <div>\n <conPropFC name={name} description={description} />\n <conPropCL name={name} description={description} />\n <h3>${price}</h3>\n <h4>-------------------------------------------------</h4>\n </div>\n );\n}", "render() {\n const { name, code } = this.props\n return (\n <div>\n <h1>This is a Class Components</h1>\n <p>I am {name}, and I love {code}</p>\n </div>\n )\n }", "render() {\n return(\n <div className='ChatWindow'>\n <MessagesPresentation messages_array={this.state.messages_array} />\n <SendMessageForm ws={ws} room_id={this.props.room_id} room_name={this.props.room_name}/>\n </div>\n )\n\n }", "componentDidMount() {\n this.update(this.props)\n }", "constructor(props = {}) {\n this.props = props\n }", "function Navbar(props) {\n \n\n // NO Function\n // No states\n\n\n return(\n <div>\n <p>My name is {props.name}</p>\n\n <p>I am {props.age} years old</p>\n\n <p>I am a {props.status} at AT&T</p>\n\n <button onClick = { props.clickMe }> Click me!!! </button>\n </div>\n );\n}", "componentWillReceiveProps(newProps){\n this.update_d3(newProps);\n }", "componentDidUpdate(props_) {}", "componentDidMount() {\n actions.get(this.props.visible)(\n this.props.title,\n this.props.message,\n this.props.buttons,\n );\n }", "componentWillReceiveProps (props) {\n this.setState({\n name: props.name,\n value: props.value\n })\n }", "render(){\n\n // How do we know courses will always be props? Anyway, it keeps things shorter\n const {courses} = this.props;\n\n // This becomes quite clean\n return(\n <div>\n <h1>Courses</h1>\n <CourseList courses={courses}/>\n </div>\n );\n }", "render() {\n return (\n <h1>{ this.props.value }</h1>\n )\n }", "function componentProps(){\n\t\tvar props = {};\n\t\tlog(arguments);\n\t\tfor(var i = 0; i< arguments.length; i++){\n\t\t\tvar arg = arguments[i];\n\t\t\tlog(arg);\n\t\t\tvar prop = String.prototype.split.call(arg,\"=\"); // key value pairs\n\t\t\tif(prop.length > 1) {\n\t\t\t\tprops[prop[0]] = prop[1];\n\t\t\t} else {\n\t\t\t\tprops[prop[0]] = null; // properties like selected, disabled, etc.\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn props;\n\t}", "componentWillReceiveProps(props) {\n ReactDOM.findDOMNode(this.refs.inputText).value = props.task.text;\n ReactDOM.findDOMNode(this.refs.inputDescription).value = props.task.description;\n ReactDOM.findDOMNode(this.refs.completed).checked = props.task.completed;\n }", "render() {\n return (\n <>\n {/* A file container where I attach props. And I export */}\n <HeroList\n questions={this.props.questions}\n history={this.props.history}\n currentQuestion={this.props.currentQuestion}\n listItem={this.props.listItem}\n buttonList={this.props.buttonList}\n closeModal={this.props.closeModal}\n />\n <Question\n showResult={this.props.showResult}\n currentQuestion={this.props.currentQuestion}\n questions={this.props.questions}\n showButtons={this.props.showButtons}\n nextQuestion={this.props.nextQuestion}\n backHandle={this.props.backHandle}\n returnQuestions={this.props.returnQuestions}\n />\n </>\n );\n }", "constructor(title, author, text) {\n ///Prop for Title\n this.props = {};\n ///Prop for Author\n this.props.author = author;\n ///Prop for Text\n this.props.content = text;\n }", "componentWillReceiveProps(newProps) {\n this.tabInfo = newProps.tabInfo;\n this.tabToDisplay = newProps.tabToDisplay;\n this.registerFinalStateFunc = newProps.registerFinalStateFunc;\n }" ]
[ "0.6620023", "0.6423086", "0.6407961", "0.63540137", "0.63030547", "0.628188", "0.6255439", "0.6255439", "0.6216379", "0.61872846", "0.61624825", "0.6069475", "0.60612625", "0.6051446", "0.6049362", "0.6049362", "0.6048623", "0.604398", "0.6015258", "0.60135376", "0.6006178", "0.5968876", "0.5964863", "0.5941901", "0.59355974", "0.5918326", "0.5915833", "0.5903868", "0.58944035", "0.58939946", "0.5892026", "0.5859153", "0.58573365", "0.584348", "0.5832431", "0.58316135", "0.581852", "0.581852", "0.581852", "0.5818236", "0.58147734", "0.58137393", "0.5812029", "0.5811788", "0.57960343", "0.57836944", "0.5769193", "0.57538104", "0.5749116", "0.5748308", "0.57330614", "0.57308954", "0.57104605", "0.5703539", "0.569988", "0.56979287", "0.5693677", "0.5689134", "0.56884253", "0.56844497", "0.5671977", "0.5658209", "0.56545275", "0.56463206", "0.5643596", "0.56410706", "0.56410706", "0.56326365", "0.563069", "0.56261414", "0.56161886", "0.5615767", "0.5610247", "0.5602031", "0.55991864", "0.55969083", "0.5586669", "0.55859107", "0.55737376", "0.5572052", "0.55703306", "0.5569351", "0.5567264", "0.5560281", "0.5559101", "0.5556106", "0.55512315", "0.5545155", "0.5542401", "0.5532745", "0.5531956", "0.55270404", "0.55268645", "0.5523599", "0.551823", "0.55151504", "0.5510342", "0.5504424", "0.5502386", "0.55019605", "0.5489589" ]
0.0
-1
Rescale maze dimensions on density change
densityChanged(e, oldWidth, oldHeight, mazeWidth, mazeHeight) { const density = parseInt(e.target.value); const maxWidth = Math.floor(mazeWidth / density); const maxHeight = Math.floor(mazeHeight / density); let relWidth = Math.round((oldWidth.val / oldWidth.max) * maxWidth); let relHeight = Math.round((oldHeight.val / oldHeight.max) * maxHeight); if (relWidth === 0) { relWidth = 1; } if (relHeight === 0) { relHeight = 1; } this.props.setDensity(density); this.props.setWidth(relWidth, maxWidth); this.props.setHeight(relHeight, maxHeight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeMaze() {\n var jq = $(\"#maze\");\n jq[0].width = jq[0].clientWidth;\n jq[0].height = jq[0].clientHeight;\n}", "function resize() {\n width = parseInt(d3.select('#viz').style('width'));\n width = width - margin.left - margin.right;\n height = width * mapRatio;\n\n // update projection\n projection.translate([width / 2, height / 2])\n .center(ca_center)\n .scale(width * [mapRatio + mapRatioAdjuster]);\n\n // resize map container\n svg.style('width', width + 'px')\n .style('height', height + 'px');\n\n // resize map\n svg.selectAll(\"path\").attr('d', path);\n}", "function resize() {\r\n \r\n // redefine width and height\r\n width = window.innerWidth; //canvas.offsetWidth;\r\n height = window.innerHeight; //canvas.offsetHeight;\r\n \r\n if (height > width * (3/4)) height = width * (3/4); // scale to meet the ratio of the fov\r\n //projmidx = width/2;\r\n //projmidy = height/2;\r\n\r\n // reset the canvas element's size\r\n canvas.width = width;\r\n canvas.height = height;\r\n //*/\r\n\r\n}", "function resizeCanvas(){\n canvasSize = Math.min(window.innerWidth, window.innerHeight) - offset;\n leinwand.width = canvasSize;\n leinwand.height = canvasSize;square\n tileSize = canvasSize/8;\n\n //draw();\n }", "resize(width, height) {\n\n let dd2 = (width > height) ? width / 2 : height / 2;\n \n m4_ortho_res(this.projectionMatrix, width, height, -dd2, dd2); \n\n this.near = -dd2;\n this.far = dd2;\n }", "function handleMazeSize() {\n \"use strict\";\n var r = document.getElementById(\"height\"),\n c = document.getElementById(\"width\");\n NUM_COLS = parseInt(c.value, 10) || NUM_COLS;\n if (NUM_COLS % 2 !== 1) {\n // Don't want an even number...\n NUM_COLS += 1;\n }\n // Update the width input box..\n c.value = NUM_COLS;\n NUM_ROWS = parseInt(r.value, 10) || NUM_ROWS;\n if (NUM_ROWS % 2 !== 1) {\n NUM_ROWS += 1;\n }\n // Update the height input box..\n r.value = NUM_ROWS;\n}", "function doResize() {\n var canvas = document.getElementById(\"drone-sim-canvas\");\n if((window.innerWidth > 40) && (window.innerHeight > 240)) {\n console.log(\"Canvas size changed.\");\n canvas.width = window.innerWidth-16;\n canvas.height = window.innerHeight-200;\n var w=canvas.clientWidth;\n var h=canvas.clientHeight;\n\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.viewport(0.0, 0.0, w, h);\n\n aspectRatio = w/h;\n }\n}", "function resize() {\n width = window.innerWidth*.8, height = window.innerHeight*.9;\n svg.attr(\"width\", width).attr(\"height\", height);\n force.size([width, height]).resume();\n node = svg.selectAll(\".node\")\n }", "function resize() {\r\n // redefine width and height\r\n width = window.innerWidth; //canvas.offsetWidth;\r\n height = window.innerHeight; //canvas.offsetHeight;\r\n \r\n if (height > width * (3/4)) height = width * (3/4); // scale to meet the ratio of the fov\r\n\r\n // reset the canvas element's size\r\n canvas.width = width;\r\n canvas.height = height;\r\n \r\n MID_VERT = height/2;\r\n MID_HORIZ = width/2;\r\n\r\n changed = true;\r\n}", "function resizeCanvas() {\n setInnerHeight()\n \n let minDimensionScreen = Math.min(window.innerWidth, window.innerHeight)\n\n if(minDimensionScreen === window.innerHeight)\n minDimensionScreen *= 0.5\n else\n minDimensionScreen *= 0.9\n\n screen.width = screen.height = worldSize\n\n screen.style.minWidth = `${ minDimensionScreen }px`\n screen.style.minHeight = `${ minDimensionScreen }px`\n\n document.documentElement.style.setProperty('--map-width', `${minDimensionScreen * 0.01}px`)\n}", "function matteDim() {\t\n\tvar outer = document.getElementById('outer'); \n\tvar outerWidth = outer.clientWidth; \n\tvar outerHeight = outer.clientHeight; \n\tvar boxSize\n\tvar scale\n\tif (outerHeight > 2500 || outerWidth > 2500) {\n\t\tboxSize = 2500\n\t\tscale = 1\t\t\n\t} else {\n\t\tif (outerHeight < outerWidth) {\n\t\t\tboxSize = outerWidth\n\t\t} else {\n\t\t\tboxSize = outerHeight\n\t\t}\n\t\tscale = outerWidth/2500\n\t}\n\t//$('#scenesContainer').height(boxSize+'px')\n\t//$('#scenesContainer').width(boxSize+'px')\n\t//console.log('Outer Height: ' + outerHeight + ' Width: ' + outerWidth)\n\t//console.log('Scenes Height: ' + $('#scenesContainer').height() + ' Width: ' + $('#scenesContainer').width())\n\tvar hoffset = (outerWidth - boxSize)/2\n\tvar voffset = (outerHeight - boxSize)/2\n\t//console.log(hoffset)\n\t$('#scenesContainer').css({left:hoffset,top:voffset})\n\treturn(scale)\t\n}", "function resize() {\n\n const bodyWidth = parseInt(getComputedStyle(document.body).width.slice(0, -2), 10);\n\n if (bodyWidth < screenWidth) { //TODO fix width change\n screenWidth = bodyWidth;\n screenHeight = screenWidth / roadWidthSegments * roadHeightSegments;\n } else {\n screenHeight = parseInt(getComputedStyle(domElement).height.slice(0, -2), 10);\n screenWidth = Math.floor(screenHeight / roadHeightSegments * roadWidthSegments);\n }\n\n squareWidth = Math.floor(screenWidth / roadWidthSegments);\n screenWidth = roadWidthSegments * squareWidth; // pixel perfect :v\n\n domElement.setAttribute('height', screenHeight);\n domElement.setAttribute('width', screenWidth);\n\n render();\n }", "function resizeEverything() {\n scale = Math.max(0.5, Math.min(1.3, Math.min((window.innerHeight - 100) / defaultHeight, (window.innerWidth - 100) / defaultWidth)));\n canvas.width = defaultWidth * scale;\n canvas.height = defaultHeight * scale;\n grid *= scale;\n minEnemySpeed *= scale;\n maxEnemySpeed *= scale;\n //enemyRadius*=scale;\n bulletRadius *= scale;\n playerWidth *= scale;\n playerHeight *= scale;\n bulletSpeed *= scale;\n ghostSpeed *= scale;\n //playerY = canvas.height-playerHeight;\n //playerX=Math.max(0,canvas.width-distFromRight);\n //console.log(scale);\n\n }", "canvasResize()\n {\n View.canvas.setAttribute(\"width\", this.floatToInt(window.innerWidth*0.95));\n View.canvas.setAttribute(\"height\",this.floatToInt(window.innerHeight*0.95));\n\n //update objects with the new size\n this.updateCharacterDim();\n this.updateVirusDim();\n this.updateSyringesDim();\n this.background.resize();\n\n }", "function resize(width, height) {\n var ratio = config.width/config.height;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n if (width / height >= ratio) {\n w = height * ratio;\n x = (width - w)/2;\n h = height;\n } else {\n w = width;\n h = width / ratio;\n y = (height - h)/2;\n }\n renderer.view.style.width = w + 'px';\n renderer.view.style.height = h + 'px';\n renderer.view.style.left = x + 'px';\n renderer.view.style.top = y + 'px';\n renderer.view.style.position = \"relative\";\n}", "function resize(width, height) {\n var ratio = config.width/config.height;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n if (width / height >= ratio) {\n w = height * ratio;\n x = (width - w)/2;\n h = height;\n } else {\n w = width;\n h = width / ratio;\n y = (height - h)/2;\n }\n renderer.view.style.width = w + 'px';\n renderer.view.style.height = h + 'px';\n renderer.view.style.left = x + 'px';\n renderer.view.style.top = y + 'px';\n renderer.view.style.position = \"relative\";\n}", "function windowResized() {\n canvasContainer = select(\"#tiling-generator\");\n var w = canvasContainer.width;\n w = Math.min(w, 1000);\n padding = 15 * (w / 1000);\n if (w < 550) {\n gridXAmount = 18;\n gridYAmount = 18;\n } else if (w >= 550 && w < 750) {\n gridXAmount = 24;\n gridYAmount = 24;\n } else if (w >= 751) {\n gridXAmount = 32;\n gridYAmount = 18;\n }\n cnvs = resizeCanvas(w, ((w - (padding * 2)) * gridYAmount / gridXAmount) + padding * 2);\n tileWidth = (width - (padding * 2)) / gridXAmount;\n ran = 0.4;\n ranFloor = 0.7;\n ranCeiling = 1.5;\n linesMult = 2;\n // var strokeFloorScalar = (w > 500) ? 1.125 : 1.5;\n strokeFloor = 1 * (tileWidth * 32 / 1280);\n strokeCeiling = 1.5 * (tileWidth * 32 / 1280);\n if (!looping) {\n redraw();\n }\n}", "function updateDimensions() {\n\n\t\twindowHeight \t\t= main.innerHeight()-350;\n\t\t\n\t\twindowWidth \t\t= virtualhand.innerWidth();\n\n\t\t/*\n\t\t * The three.js area and renderer are resized to fit the page\n\t\t */\n\t\tvar renderHeight \t= windowHeight - 5;\n\n\t\trenderArea.css({width: windowWidth, height: renderHeight});\n\n\t\trenderer.setSize(windowWidth, renderHeight);\n\n\t}", "resizeToChildren() {\n let totalBounds = this.recurseThroughChildren(this, []);\n let minX;\n let minY;\n let maxX;\n let maxY;\n for (let bound in totalBounds) {\n if (!minX) {\n minX = this.x;\n maxX = totalBounds[bound].x + totalBounds[bound].width;\n minY = this.y;\n maxY = totalBounds[bound].y + totalBounds[bound].height\n continue;\n }\n if (totalBounds[bound].x + totalBounds[bound].width > maxX) {\n maxX = totalBounds[bound].x + totalBounds[bound].width\n }\n if (totalBounds[bound].y + totalBounds[bound].height > maxY) {\n maxY = totalBounds[bound].y + totalBounds[bound].height\n }\n }\n this.x = minX;\n this.y = minY;\n this.width = maxX - minX;\n this.height = maxY - minY;\n this.sizeUpdated = true;\n }", "updateDimensions() {\n let height = 0.0;\n let depth = 0.0;\n let maxFontSize = 1.0;\n if (this.children) {\n this.children.forEach(x => {\n if (x.height > height) height = x.height;\n if (x.depth > depth) depth = x.depth;\n if (x.maxFontSize > maxFontSize) maxFontSize = x.maxFontSize;\n });\n }\n this.height = height;\n this.depth = depth;\n this.maxFontSize = maxFontSize;\n }", "resize() {\n this.recompute();\n var oldScale = this.rootMesh.scaling.y;\n var oldHeadPos = this.headPos();\n var scale = oldScale*this.userHeight/oldHeadPos.y;\n this.rootMesh.scaling = new BABYLON.Vector3(scale,scale,scale);\n this.recompute();\n this.initialHeadPos = this.headPos();\n this.log(\"Rescaling from \"+oldScale+ \" to \"+scale+\", head position from \"+oldHeadPos+\" to \"+this.initialHeadPos);\n this.changed();\n return scale;\n }", "function onResize() {\n\t\tvar dimenson = window.innerWidth / window.innerHeight;\n\n\t\tcamera.left = - frustum*dimenson/2;\n\t\tcamera.right = frustum*dimenson/2;\n\t\tcamera.top = frustum/2;\n\t\tcamera.bottom = - frustum/2;\n\n\t\tcamera.updateProjectionMatrix();\n\n\t\trenderer.setSize( window.innerWidth, window.innerHeight );\n}", "resize() {\n\t\t/* Update width and height just incase canvas size has changed */\n \tthis.menuWidth = $(\"#pixel-analysis-menu\").width();\n \tthis.menuHeight = $(\"#pixel-analysis-menu\").height();\n\t\tthis.menuSVG.attr(\"width\", this.menuWidth)\n\t\t\t\t\t\t.attr(\"height\", this.menuHeight);\n\n\t\tif (this.checkpoint == 0) {\n\t\t\tthis.rayTreeView.resize();\n\t\t\tthis.parallelBarView.resize();\n\t\t} else if (this.checkpoint = 1) {\n\t\t\tthis.parallelBarView.resize();\n\t\t\t\n\t\t\tthis.rayTreeView.resize();\n\t\t}\n\t\t\t\t\t\t\n\t\tthis.update()\n\t}", "_size() {\n const scaleRatio = (window.innerHeight) / (this.gameBoard.height + 2 * config.board.padding);\n this.renderer.resize(window.innerWidth, window.innerHeight);\n this.gameBoard.height *= scaleRatio;\n this.gameBoard.width *= scaleRatio;\n this.gameBoard.position.set((this.screen.width / 2) - (this.gameBoard.width / 2), config.board.padding);\n }", "function resize() {\n // Set renderer size and pixel ratio\n renderer.setSize(xSize, ySize, false);\n renderer.setPixelRatio(1);\n // renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1);\n // Set camera aspect ratio\n dummy_camera.aspect = window.innerWidth / window.innerHeight;\n dummy_camera.updateProjectionMatrix();\n}", "resizeFactor() {\n var i;\n for (i = 0; i < this.NUMBER_DIMENSIONS; i++) {\n this.resizeVec[i] = this.initialDimensions[i] / this.websiteDimensions[i];\n }\n }", "function onResize() {\n updateSpanning();\n}", "updateDimensions() {\r\n\r\n let viewport = {...this.state.viewport};\r\n\r\n let constant = 0;\r\n if (window.innerWidth >= 1200) constant = 3/4.;\r\n else if (window.innerWidth >= 992) constant = 2/3.;\r\n else if (window.innerWidth >= 768) constant = 7/12.;\r\n else constant = 1.;\r\n\r\n viewport.width=window.innerWidth*constant - 60;\r\n viewport.height=viewport.width/3.;\r\n\r\n this.setState({viewport:viewport})\r\n }", "function adjustSize() {\n var\n prevW = canvasW,\n prevH = canvasH;\n canvasW = $(svgContainer).innerWidth();\n canvasH = $(svgContainer).innerHeight();\n canvasR = canvasW / canvasH;\n boxW *= canvasW / prevW ;\n boxH *= canvasH / prevH ;\n svgRoot.setAttribute( 'width', canvasW );\n svgRoot.setAttribute( 'height', canvasH );\n //console.log('called adjustSize: '+canvasW+' '+canvasH);\n }", "function recalc() {\r\n //boxize calc = physical screen size to yield a 3\" grid on full screen, times zoom factor, then modified by \"resolution?\"\r\n boxsizeX = Math.floor((screenWidth * 0.3 * (zoomlevel / 100)) / numG) //.15 is 3\" divided by the 20\" of my monitor width (physically) to be modified for responsiveness later\r\n boxsizeY = Math.floor((screenHeight * 0.5 * (zoomlevel / 100)) / numG) //.27 is 3\" divided by the 11\" of my monitor height (physically) to be modified for responsiveness later\r\n\r\n g_width = numG * boxsizeX\r\n g_height = numG * boxsizeY\r\n\r\n //calculate starting point\r\n if (!isDown) {\r\n start_x = cnv.width / 2 - g_width / 2\r\n start_y = cnv.height / 2 - g_height / 2\r\n }\r\n\r\n drawGrid()\r\n}", "function resize () {\n const width = viewportElement.clientWidth\n const height = viewportElement.clientHeight\n if (canvas.width !== width || canvas.height !== height) {\n // console.log(\"Canvas resized from \", canvas.width, canvas.height, \" to \", width, height)\n canvas.clientWidth = width\n canvas.clientHeight = height\n canvas.width = width\n canvas.height = height\n\n camera.aspect = (width / height)\n camera.updateProjectionMatrix()\n renderer.setSize(width, height)\n\n calculateBoardCornerScreenCoordinates()\n }\n}", "resize(multAmount, resizeRelativeTo) {\n if (!resizeRelativeTo) {\n resizeRelativeTo = this.center;\n }\n\n let vectorsRelativeToCenter = [];\n\n for (var v of this.pixelVectorPositions) {\n vectorsRelativeToCenter.push(p5.Vector.sub(v, resizeRelativeTo));\n }\n\n for (var v of vectorsRelativeToCenter) {\n v.mult(multAmount);\n }\n\n for (var i = 0; i < this.pixelVectorPositions.length; i++) {\n this.pixelVectorPositions[i] = p5.Vector.add(vectorsRelativeToCenter[i], resizeRelativeTo);\n }\n this.setCenter();\n this.setShape();\n this.resetFixture();\n\n }", "function onResize(){\n\twindowFullWidth = window.innerWidth;\n\twindowFullHeight = window.innerHeight;\n\twindowHalfWidth = windowFullWidth / 2;\n\twindowHalfHeight = windowFullHeight / 2;\n\t\n\tratioSiteWidth = Math.min(windowFullWidth, 1180);\n\tratioSiteHeight = Math.min(windowFullHeight, 1080);\n\t\n\t// ONLY GET RATIO FROM WIDTH\n\tratioPercentage = Math.min((ratioSiteWidth/1180));\n\tratioPercentageHeight = Math.min((ratioSiteHeight/1080));\n\t\n\tminSiteWidth = Math.max(windowFullWidth, 1180);\n\tminSiteHeight = Math.max(windowFullHeight, 1080);\n\t\n\trenderer.resize( windowFullWidth, windowFullHeight );\n\tvizGroup.width = minSiteWidth;\n\tvizGroup.position.y = windowFullHeight;\n\tvizGroup.scale.x = vizGroup.scale.y = ratioPercentage;\n\t\n\tvizGroupCenter.width = minSiteWidth;\n\tvizGroupCenter.position.y = windowHalfHeight;\n\tvizGroupCenter.scale.x = vizGroupCenter.scale.y = ratioPercentage;\n\t\n\tcoverupGroup.width = minSiteWidth;\n\tcoverupGroup.position.y = windowFullHeight;\n\tcoverupGroup.scale.x = coverupGroup.scale.y = ratioPercentage;\n\t\n\tredrawMasks();\n\t\n\twindowFullWidthDifference = windowFullWidth * (windowFullWidth / (windowFullWidth * ratioPercentage));\n\twindowFullHeightDifference = windowFullHeight * (windowFullHeight / (windowFullHeight * ratioPercentage));\n\tvar upscalePercentageX = Math.max((Math.max(windowFullWidth, 1920)/1920));\n\tvar upscalePercentageY = Math.max((Math.max(windowFullHeight, 1080)/1080));\n\tvar rainRatio = Math.max(upscalePercentageX, upscalePercentageY);\n\tvar upscaleBackgroundY = Math.max((Math.max(windowFullHeightDifference, 1080)/1080));\n\t\n\tif (scene0Loaded) {\n\t\tscene0Car.position.x = minSiteWidth/2;\n\t\tscene0Swipe.position.x = minSiteWidth/2;\n\t\tscene0Water.tilePosition.x = minSiteWidth/2;\n\t\tscene0CoverRight.position.x = windowFullWidth - 250;\n\t\t// POSITION THE RIGHT LAND MASS\n\t\tif (ratioPercentage < 1) {\n\t\t\tscene0CoverRight.position.x = windowFullWidthDifference - 275;\n\t\t}\n\t\tvar scene0ScaleFactor = Math.min((Math.min(windowFullHeight, 800)/800));\n\t\tif ($html.hasClass(\"touch\")) scene0ScaleFactor = .70;\n\t\tscene0Car.scale.x = scene0Car.scale.y = scene0ScaleFactor;\n\t}\n\t\n\tif (scene1Loaded) scenes[1].car.position.x = minSiteWidth/2;\n\tif (scene2Loaded) {\n\t\tscene2Car.position.x = minSiteWidth/2;\n\t\tscene2Bg.scale.x = scene2Bg.scale.y = upscaleBackgroundY;\n\t}\n\tif (scene3Loaded) scenes[3].car.position.x = minSiteWidth/2;\n\tif (scene4Loaded) {\n\t\tscene4SidewalkTop.position.y = -((minSiteHeight - 1080) / 2);\n\t\tscene4SidewalkBottom.position.y = 1080 + ((minSiteHeight - 1080) / 2);\n\t\tscene4Car.position.x = minSiteWidth/2;\n\t}\n\tif (scene5Loaded) {\n\t\tscenes[5].car.position.x = minSiteWidth/2;\n\t\tscene5GlowNight.position.x = minSiteWidth/2;\n\t}\n\tif (scene6Loaded) {\n\t\tscene6Car.position.x = minSiteWidth/2;\n\t\tscene6Glow.position.x = minSiteWidth/2;\n\t\tscene6Bg.scale.x = scene6Bg.scale.y = upscaleBackgroundY;\n\t}\n\tif (scene7Loaded) {\n\t\tscenes[7].car.position.x = minSiteWidth/2;\n\t\tscene7Glow.position.x = minSiteWidth/2;\n\t}\n\tif (scene8Loaded) {\n\t\tscene8Car.position.x = minSiteWidth/2;\n\t\tscene8Dots.width = minSiteWidth/2;\n\t}\n\tif (scene9Loaded) {\n\t\tscenes[9].car.position.x = minSiteWidth/2;\n\t\tscene9Glow.position.x = minSiteWidth/2;\n\t\t// scenes[9].rain.scale.x = scenes[9].rain.scale.y = assetRatio * 2;\n\t\t// scenes[9].rain.position.x = minSiteWidth / 2;\n\t\t// scenes[9].rain.position.y = minSiteHeight;\n\t}\n\tif (scene10Loaded) {\n\t\tscene10Puddles.position.x = minSiteWidth/2;\n\t\tscene10Puddles.position.y = -((minSiteHeight - 1080) / 2);\n\t\tscene10Car.position.x = minSiteWidth/2;\n\t\tscene10Car.position.y = -((minSiteHeight - 1080) / 2);\n\t\tscene10CarLight.position.x = minSiteWidth/2;\n\t\tscene10CarLight.position.y = -((minSiteHeight - 1080) / 2);\n\t\tscene10Glow.position.x = minSiteWidth/2;\n\t\tscene10Glow.position.y = -((minSiteHeight - 1080) / 2);\n\t}\n\tif (scene11Loaded) {\n\t\tscenes[11].car.position.x = minSiteWidth/2;\n\t\tscene11Glow.position.x = minSiteWidth/2;\n\t}\n\tif (safeAreaMarker){\n\t\tsafeAreaMarker.position.x = minSiteWidth/2;\n\t\tsafeAreaMarker.position.y = minSiteHeight;\n\t}\n}", "function resize() {\n //resize the canvas\n c.width = window.innerWidth;\n c.height = window.innerHeight;\n //resize the circle\n factor = Math.round(Math.min(window.innerWidth, window.innerHeight) / 4);\n if(running){running = false;update_canvas()}else{running = false}\n\n}", "resizeImmediate() {\n this.size = vec2.fromValues(this.canvas.parentElement.clientWidth, this.canvas.parentElement.clientHeight);\n this.dpi = window.devicePixelRatio;\n\n this.canvas.style.width = '100%';\n this.canvas.style.height = '100%';\n\n vec2.scale(this.size, this.size, this.options.scale);\n\n this.canvas.width = this.size[0] * this.dpi;\n this.canvas.height = this.size[1] * this.dpi;\n\n this.flagDirty();\n this.draw_required = true;\n\n Logger.debug(`Resizing renderer to ${this.size} @ ${this.dpi}x`);\n }", "function updateTileBounds() {\n zoom = Math.round(fixedZoom || Map.zoom);\n\n var\n ratio = Math.pow(2, zoom-Map.zoom)/TILE_SIZE,\n mapBounds = Map.bounds,\n perspectiveBuffer = 1;\n\n minX = (mapBounds.minX*ratio <<0) - perspectiveBuffer;\n minY = (mapBounds.minY*ratio <<0) + 1 - perspectiveBuffer;\n maxX = Math.ceil(mapBounds.maxX*ratio) + perspectiveBuffer;\n maxY = Math.ceil(mapBounds.maxY*ratio) + 1 + perspectiveBuffer;\n }", "resizeCanvas() {\n const containerWidth = this.worldContainer.offsetWidth;\n this.canvasWidth = containerWidth;\n this.canvasHeight = containerWidth;\n\n this.canvas.width = this.canvasWidth;\n this.canvas.height = this.canvasHeight;\n\n this.cellSize = this.canvasWidth / this.colNumber;\n this.renderWorld();\n }", "function windowResized() {\n\n //Sore previous canvas size\n let pWidth = width;\n let pHeight = height;\n\n // Resize the canvas\n\tresizeCanvas(document.getElementById('moonAnimation').offsetWidth - 10,\n \t\t\t\tdocument.getElementById('moonAnimation').offsetHeight - 10);\n\n\t// Recalculate stars position\n\tfor(let i = 0; i < stars.length; i++){\n\t stars[i].x = stars[i].x * width/pWidth;\n stars[i].y = stars[i].y * height/pHeight;\n }\n\n\t// Recalculate the moon center\n\tmoon.pos.x = width/2;\n\tmoon.pos.y = height/2;\n\n\t// Recalculate moon radius\n\tmoon.rad = max(min(150, min(width/2 - 20, height/2 - 20)), 50);\n}", "function resize() {\r\n \r\n var aspect = window.innerWidth / window.innerHeight;\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n camera.aspect = aspect;\r\n camera.updateProjectionMatrix();\r\n// printMatrix('camera',camera.projectionMatrix);\r\n}", "buildRandomMaze(dimensions, scale) {\n const gridSize = dimensions;\n const gridScale = scale;\n for (let level = 0; level <= gridSize; level++) { \n if (level < gridSize) {\n this.addMazeLevel(level, gridSize, gridScale);\n }\n if (level == 0 || level == gridSize) {\n this.addFloor(level, gridSize, gridScale, false);\n }\n else {\n this.addFloor(level, gridSize, gridScale, true);\n }\n } \n }", "function resize() \n{\n // Get the canvas from the WebGL context\n var canvas = gl.canvas;\n \n // Lookup the size the browser is displaying the canvas.\n var displayWidth = canvas.clientWidth;\n var displayHeight = canvas.clientHeight;\n \n // Check if the canvas is not the same size.\n if (canvas.width != displayWidth ||\n canvas.height != displayHeight) \n {\n \n // Make the canvas the same size\n canvas.width = displayWidth;\n canvas.height = displayHeight;\n \n // Set the viewport to match\n console.log(\"canvas: resize\");\n gl.viewport(0, 0, canvas.width, canvas.height);\n }\n pixelsToWebGLMatrix.set([2/canvas.width, 0, 0, 0, 0, -2/canvas.height, 0, 0, 0, 0, 0, 0, -1, 1, 0, 1]);\n}", "function resize() {\n var canvas = document.querySelector(\"canvas\");\n var parent = document.getElementById('wheel_game');\n var windowWidth = parent.offsetWidth;\n var windowHeight = parent.offsetHeight;\n var windowRatio = windowWidth / windowHeight;\n var gameRatio = game.config.width / game.config.height;\n if (windowRatio < gameRatio) {\n canvas.style.width = windowWidth + \"px\";\n canvas.style.height = (windowWidth / gameRatio) + \"px\";\n } else {\n canvas.style.width = (windowHeight * gameRatio) + \"px\";\n canvas.style.height = windowHeight + \"px\";\n }\n}", "function resize() {\n\t\tpositionExpandedLevels();\n\t}", "function resizeHandler() {\n\tfor( let world of worlds ) {\n\t\tlet parent_elem = world.renderer.domElement.parentNode;\n\t\tlet w = parent_elem.clientWidth;\n\t\tlet h = parent_elem.clientHeight;\n\t\tworld.Resize( w, h );\n\n\t}\n}", "function doResize()\r\n{\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix(); // Need to call this for the change in aspect to take effect.\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n}", "_setWorldSizes() {\n const ratios = this.camera.getScreenRatiosFromFov();\n\n // our plane world informations\n // since our vertices values range from -1 to 1, it is supposed to draw a square\n // we need to scale them under the hood relatively to our canvas\n // to display an accurately sized plane\n this._boundingRect.world = {\n width: (this._boundingRect.document.width / this.renderer._boundingRect.width) * ratios.width / 2,\n height: (this._boundingRect.document.height / this.renderer._boundingRect.height) * ratios.height / 2,\n ratios\n };\n\n // set transformation origin relative to world space as well\n this._setWorldTransformOrigin();\n }", "function resize() {\n var width = container.offsetWidth;\n var height = container.offsetHeight;\n\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n\n renderer.setSize(width, height);\n renderer.setSize(width, height);\n }", "function resize() {\n _screenWidth = window.innerWidth\n _screenHeight = window.innerHeight\n\n // camera settings for to be actual size\n _mainCamera.aspect = _screenWidth / _screenHeight\n _mainCamera.updateProjectionMatrix()\n _mainCamera.position.z = (_screenHeight * 0.5) / Math.tan((_mainCamera.fov * 0.5) * Math.PI / 180)\n\n _renderer.setSize(_screenWidth, _screenHeight)\n\n // update something\n}", "function resize() {\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix();\r\n}", "function resize() {\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix();\r\n}", "function resize() {\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix();\r\n}", "function resizeViewport() {\n\tvar width = window.innerWidth;\n\tvar height = window.innerHeight;\n\trenderer.setSize(width, height);\n\tcamera.aspect = width / height;\n\tcamera.updateProjectionMatrix();\n}", "function resize_all(){\n\t\tclear_map();\n\t\tinit_map();\n\t\tresize_graphs();\n\t // Haven't resized in 100ms!\n\t}", "function setSize(){\n\t\tif(window.innerWidth > window.innerHeight * (2/1)){\n\t\t\tcanvas.style.height = window.innerHeight + \" px\";\n\t\t\tcanvas.style.width = window.innerHeight * (2/1);\n\t\t}else{\n\t\t\tcanvas.style.height = window.innerHeight * (1/2) + \" px\";\n\t\t\tcanvas.style.width = window.innerHeight + \" px\";\n\t\t}\n\t}", "function onResize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n // Reset the art particles, and align again on the center of screen\n nextArt = [];\n updateArt();\n }", "function resizeShip(toChange1, toChange2, dimension, invert) {\n var secondPart;\n var thirdPart;\n var fourthPart;\n if (invert != true) {\n if (toChange2 != 0 && toChange2 != (mapSize - 1)) {\n secondPart = toChange2 - 1;\n thirdPart = toChange2 + 1;\n if (toChange2 < mapSize - 2) fourthPart = toChange2 + 2;\n else\n fourthPart = toChange2 - 2;\n } else if (toChange2 === 0) {\n secondPart = toChange2 + 1;\n thirdPart = toChange2 + 2;\n fourthPart = toChange2 + 3;\n\n } else if (toChange2 === mapSize - 1) {\n secondPart = toChange2 - 1;\n thirdPart = toChange2 - 2;\n fourthPart = toChange2 - 3;\n }\n switch (dimension) {\n case 4:\n if (checkShips(toChange1, secondPart) && checkShips(toChange1, thirdPart) && checkShips(toChange1, fourthPart)) {\n map[toChange1][secondPart] = \"ship\";\n map[toChange1][thirdPart] = \"ship\";\n map[toChange1][fourthPart] = \"ship\";\n shipsContainer[counterShips - 1].setShip([toChange1, secondPart]);\n shipsContainer[counterShips - 1].setShip([toChange1, thirdPart]);\n shipsContainer[counterShips - 1].setShip([toChange1, fourthPart]);\n break;\n }\n case 3:\n if (checkShips(toChange1, secondPart) && checkShips(toChange1, thirdPart)) {\n map[toChange1][secondPart] = \"ship\";\n map[toChange1][thirdPart] = \"ship\";\n shipsContainer[counterShips - 1].setShip([toChange1, secondPart]);\n console.log(\"Dodaje do\" + (counterShips - 1) + \" \" + toChange1 + \" i \" + secondPart);\n shipsContainer[counterShips - 1].setShip([toChange1, thirdPart]);\n console.log(\"Dodaje \" + (counterShips - 1) + \" \" + toChange1 + \" i \" + thirdPart);\n } else {\n resizeShip(toChange1, toChange2, 3, true);\n }\n break;\n case 2:\n if (checkShips(toChange1, secondPart)) {\n map[toChange1][secondPart] = \"ship\";\n shipsContainer[counterShips - 1].setShip([toChange1, secondPart]);\n } else {\n resizeShip(toChange1, toChange2, 2, true);\n }\n //console.log(\"Pierwszy element: \" + shipsContainer[2].position[0]);\n //console.log(\"Drugi element: \" + shipsContainer[2].position[1]);\n //console.log(\"Trzeci element: \" + shipsContainer[2].position[2]);\n //console.log(\"Czwarty element: \" + shipsContainer[0].position[3]);\n //for (i = 0; i < shipsContainer[9].position.length; i++)\n // console.log(\"Element: \" + i + \" = \" +\n // shipsContainer[9].position[i]);\n break;\n default:\n break;\n }\n\n } else {\n if (toChange1 != 0 && toChange1 != (mapSize - 1)) {\n secondPart = toChange1 - 1;\n thirdPart = toChange1 + 1;\n if (toChange1 < mapSize - 2)\n fourthPart = toChange1 + 2;\n else\n fourthPart = toChange1 - 2;\n } else if (toChange1 === 0) {\n\n secondPart = toChange1 + 1;\n thirdPart = toChange1 + 2;\n fourthPart = toChange1 + 3;\n\n } else if (toChange1 === mapSize - 1) {\n secondPart = toChange1 - 1;\n thirdPart = toChange1 - 2;\n fourthPart = toChange1 - 3;\n\n }\n switch (dimension) {\n case 4:\n if (checkShips(secondPart, toChange2) && checkShips(thirdPart, toChange2) && checkShips(fourthPart, toChange2)) {\n\n map[secondPart][toChange2] = \"ship\";\n map[thirdPart][toChange2] = \"ship\";\n map[fourthPart][toChange2] = \"ship\";\n shipsContainer[counterShips - 1].setShip([secondPart, toChange2]);\n shipsContainer[counterShips - 1].setShip([thirdPart, toChange2]);\n shipsContainer[counterShips - 1].setShip([fourthPart, toChange2]);\n\n }\n break;\n case 3:\n if (checkShips(secondPart, toChange2) && checkShips(thirdPart, toChange2)) {\n map[secondPart][toChange2] = \"ship\";\n map[thirdPart][toChange2] = \"ship\";\n shipsContainer[counterShips - 1].setShip([secondPart, toChange2]);\n console.log(\"Dodaje do\" + (counterShips - 1) + \" \" + secondPart + \" i \" + toChange2);\n shipsContainer[counterShips - 1].setShip([thirdPart, toChange2]);\n console.log(\"Dodaje do\" + (counterShips - 1) + \" \" + thirdPart + \" i \" + toChange2);\n\n } else {\n map[toChange1][toChange2] = \"\";\n shipsContainer[counterShips - 1].removeShip([toChange1, toChange2]);\n console.log(\"Usuwam z \" + (counterShips - 1) + toChange1 + \" i \" + toChange2);\n counterShips--;\n initPoints(3, 1);\n }\n break;\n case 2:\n if (checkShips(secondPart, toChange2)) {\n map[secondPart][toChange2] = \"ship\";\n shipsContainer[counterShips - 1].setShip([secondPart, toChange2]);\n\n } else {\n map[toChange1][toChange2] = \"\";\n shipsContainer[counterShips - 1].removeShip([toChange1, toChange2]);\n console.log(\"Usuwam z \" + (counterShips - 1) + toChange1 + \" i \" + toChange2);\n counterShips--;\n initPoints(2, 1);\n }\n default:\n {\n break;\n }\n\n }\n\n }\n}", "function resize() {\n var canvas = document.querySelector(\"canvas\");\n var windowWidth = window.innerWidth;\n var windowHeight = window.innerHeight;\n var windowRatio = windowWidth / windowHeight;\n var gameRatio = game.config.width / game.config.height;\n if (windowRatio < gameRatio) {\n canvas.style.width = windowWidth + \"px\";\n canvas.style.height = (windowWidth / gameRatio) + \"px\";\n } else {\n canvas.style.width = (windowHeight * gameRatio) + \"px\";\n canvas.style.height = windowHeight + \"px\";\n }\n}", "function reSize(){\n \twindowHeight = window.innerHeight;\n\twindowWidth = window.innerWidth;\n\trenderer.setSize(windowWidth, windowHeight);\n\tcamera.aspect = windowWidth/windowHeight;\n\tcamera.updateProjectionMatrix();\n}", "function resizeVisualization() {\n oldWidth = width;\n oldHeight = height;\n width = document.getElementById('allFunerals').clientWidth - margin.left - margin.right,\n height = Math.min(700, window.innerHeight - 124);\n\n let newScale = (width * 1.0 / oldWidth);\n zoomScreenSizeMulti *= newScale;\n currentZoom.x *= newScale;\n currentZoom.y *= newScale;\n currentZoom.k *= newScale;\n\n d3.select(\"#allFunerals svg\")\n .attr(\"width\", width + margin.right + margin.left - 20)\n .attr(\"height\", height + margin.top + margin.bottom)\n\n setZoom();\n}", "function resize() {\n renderer.setSize(window.innerWidth, window.innerHeight);\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n}", "function resize() {\n renderer.setSize(window.innerWidth, window.innerHeight);\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n}", "function update() {\n var width = window.innerWidth;\n var height = window.innerHeight;\n canvas.style.width = width + \"px\";\n canvas.style.height = height + \"px\";\n canvas.width = width * ratio;\n canvas.height = height * ratio;\n gl.viewport(0, 0, width * ratio, height * ratio);\n\n exports.width = width;\n exports.height = height;\n\n if (initialized) {\n mat4.ortho(perspectiveMatrix, 0, width, 0, height, 0, 1);\n gl.uniformMatrix4fv(shader.perspective, false, perspectiveMatrix);\n }\n Event.fire('resize');\n }", "function resize() {\n var targetWidth = window.innerWidth;\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "function increaseWallSize() {\n\tif (wallSelected==null) {\n\t\treturn 0;\n\t}\n\t\n\telse if (wallSelected.depth < (2*cellLen)) {\n\t\twallSelected.depth += (0.1 * cellLen);\n\t\twallSelected.rLen= 3/4*wallSelected.depth;\n\t\treturn 1;\n\t}\n\t\n\telse {\n\t\treturn 0;\n\t}\n\t\n\tinvalidated= true;\n}", "function resizeCanvas() {\n\tvar newHeight = window.innerHeight;\n\tvar newWidth = initWidth/initHeight * newHeight;\n\tcanvas.setWidth(newWidth);\n\tcanvas.setHeight(newHeight);\n\tcanvas.calcOffset();\n}", "function resize() {\n const w = parseInt(container.offsetWidth);\n node.attr('width', w);\n node.attr('height', Math.round(w / aspect));\n }", "function onResize() {\n if (camera instanceof PerspectiveCamera) {\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n }\n renderer.setSize(window.innerWidth, window.innerHeight);\n}", "resizeCanvas() {\n this.canvas.width = window.innerWidth;\n this.canvas.height = window.innerHeight;\n\n // Figure out how many cells wide and tall we want the canvas to be.\n this.horizontalPixelCount = Math.trunc((this.canvas.width / this.pixelSize) + 0.5);\n this.verticalPixelCount = Math.trunc((this.canvas.height / this.pixelSize) + 0.5);\n\n // Setup our array of \"flagged pixels\". This will be used internally\n // to keep track of all pixels that have been updated since the last\n // draw call. We can use it to optimally redraw only the pixels that\n // have changed to cutdown on draw time.\n this.flaggedPixels = [];\n\n\n let count = 0;\n // Create our 2d array to hold our cells and populate it.\n this.pixelGrid = new Array(this.horizontalPixelCount);\n for (let x = 0; x < this.horizontalPixelCount; x++) {\n this.pixelGrid[x] = new Array(this.verticalPixelCount);\n for (let y = 0; y < this.verticalPixelCount; y++) {\n this.pixelGrid[x][y] = new Cell(x, y, this.pixelSize, this);\n count = count + 1;\n }\n }\n\n rulesetSetup(this.pixelGrid, this.horizontalPixelCount, this.verticalPixelCount);\n\n // Draw all the cells to the canvas\n this.drawFlagged();\n }", "function resize() {\n const container = document.getElementById('container');\n const w = container.offsetWidth;\n const h = container.offsetHeight;\n renderer.setSize(w, h);\n camera.aspect = w / h;\n camera.updateProjectionMatrix();\n}", "function resize() {\n renderer.setSize(window.innerWidth,window.innerHeight);\n camera.aspect = window.innerWidth/window.innerHeight;\n camera.updateProjectionMatrix();\n}", "function resize() {\n renderer.setSize(window.innerWidth,window.innerHeight);\n camera.aspect = window.innerWidth/window.innerHeight;\n camera.updateProjectionMatrix();\n}", "function scale(s){\ndWidth = 90;\ndHeight = 45;\nwallHeight = 135;\n\ndWidth = dWidth * s;\ndHeight = dHeight * s;\nwallHeight = wallHeight * s;\n\n}", "function resize() {\n var nativePixelRatio = window.devicePixelRatio = window.devicePixelRatio ||\n Math.round(window.screen.availWidth / document.documentElement.clientWidth);\n\n var devicePixelRatio = nativePixelRatio;\n\n var width = window.innerWidth;\n var height = window.innerHeight;\n self.camera.aspect = devicePixelRatio;\n self.camera.updateProjectionMatrix();\n self.renderer.setSize(width, height);\n self.effect.setSize(width, height);\n }", "function resizeCanvas() {\r\n winWidth = window.innerWidth;\r\n winHeight = window.innerHeight;\r\n cnvs.width = winWidth;\r\n cnvs.height = winHeight;\r\n\r\n // Create star field\r\n buildStars();\r\n}", "function resize(){\n rect = Canvas.getBoundingClientRect()\n ratio = S/rect.height\n Canvas.width = S\n Canvas.height = S\n\n for (let i=0; i<Class('image').length; i++){\n let c = Class('image')[i]\n c.width = S\n c.height = S\n }\n}", "updateGeometry() {\n this.cols = this.engine.getCols();\n this.rows = this.engine.getRows();\n let maxWidth = displayContainer.clientWidth;\n let maxHeight = displayContainer.clientHeight;\n console.log(\"maxWidth: \" + maxWidth + \"maxHeight\" + maxHeight);\n let displayAspectRatio = this.cols / this.rows;\n let containerAspectRatio = maxWidth / maxHeight;\n if (displayAspectRatio > containerAspectRatio) { \n this.canvas.width = maxWidth;\n this.canvas.height = (this.rows / this.cols)* maxWidth;\n this.cellSize = this.canvas.width / this.cols;\n } else {\n this.canvas.height = maxHeight;\n this.canvas.width = (this.cols / this.rows) * maxHeight;\n this.cellSize = this.canvas.height / this.rows;\n }\n this.top = this.canvas.offsetTop;\n this.left = this.canvas.offsetLeft;\n }", "function resize() {\r\n var canvas = document.querySelector(\"canvas\");\r\n var windowWidth = window.innerWidth;\r\n var windowHeight = window.innerHeight;\r\n var windowRatio = windowWidth / windowHeight;\r\n var gameRatio = game.config.width / game.config.height;\r\n if(windowRatio < gameRatio){\r\n canvas.style.width = windowWidth + \"px\";\r\n canvas.style.height = (windowWidth / gameRatio) + \"px\";\r\n }\r\n else{\r\n canvas.style.width = (windowHeight * gameRatio) + \"px\";\r\n canvas.style.height = windowHeight + \"px\";\r\n }\r\n}", "function enlarge()\r\n\t{\r\n\t\t//var portwidth = (gl.viewportWidth-2) * 2 + 2;\r\n\t\t//gl.viewportWidth = portwidth;\r\n\t\tvar canvas = document.getElementById(\"lesson01-canvas\");\r\n\t\tvar cwidth = canvas.width;\r\n\t\tvar cheigth = canvas.heigth;\r\n\t\tcanvas.width = (cwidth-2)*2 + 2;\r\n\t\tdrawScene();\r\n\t}", "function onReshape() {\n\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n renderer.setSize( window.innerWidth, window.innerHeight );\n\n}", "function resizeView(){\n\n width = window.innerWidth;\n height = window.innerHeight;\n\n console.log(width, height);\n\n canvas.clientWidth = width;\n canvas.clientHeight = height;\n\n d3.select('#fpsvgbkgrd').attr('width',width).attr('height',height);\n d3.select('#fpbkgrd').attr('width',width).attr('height',height);\n //svg.clientWidth = width;\n //svg.clientHeight = height;\n\n resetScales();\n\n}", "resize(factorX, factorY, graphMax) {\n this.resizing = true;\n\n this.surface.removeAttribute(\"d\");\n\n for (var i in this.pairs) {\n this.pairs[i].x *= factorX;\n if(!isNaN(graphMax)) {\n var oldScale = graphMax / this.clientHeight;\n var beforeConversion = graphMax - (this.pairs[i].y * oldScale);\n this.pairs[i].y = this.clientHeight - (beforeConversion * factorY);\n } else {\n this.pairs[i].y *= factorY;\n }\n\n this.draw(this.pairs[i].x, this.pairs[i].y);\n }\n\n this.resizing = false;\n }", "function configure_plane_size(){\n\tplane_width = global.stage.width;\n\tconfigure_plane_height();\n\tconfigure_plane_offset();\n}", "onWindowResize() {\n for(var scene in this.scenes){\n scene.camera.aspect = this.screenWidth / this.screenHeight;\n scene.camera.updateProjectionMatrix();\n }\n this.renderer.setSize( this.screenWidth, this.screenHeight );\n }", "setScale() {\n document.body.style.width = `${this.w}px`;\n document.body.style.height = `${this.h}px`;\n // style used on html els and not for canvas, since canvas css doesn't determine actual available coords -- actual obj size defaults to 300x150 n if only css is changed it just scales from that n looks rly bad\n canvas.width = this.w;\n canvas.height = this.h;\n\n road.draw();\n }", "function MyResize() {\n var raycaster = new THREE.Raycaster();\n var mouse = new THREE.Vector2();\n\n raycaster.setFromCamera(mouse, camera);\n var intersects = raycaster.intersectObjects(scene.children);\n var width = window.innerWidth;\n var height = window.innerHeight;\n renderer.setSize(width, height);\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n renderer.render(scene, camera);\n}", "function changeAreaSize() {\n changeBackgroundSize();\n for (i = 0; i <= width; i++) {\n changeLineSize(0, i);\n }\n for (i = 0; i <= height; i++) {\n changeLineSize(1, i);\n }\n for (i = 0; i < $MAX_WIDTH_DIMENSION; i++) {\n for (j = 0; j < $MAX_HEIGTH_DIMENSION; j++) {\n changeSquareSize(i, j);\n changeSquareAuxSize(i, j);\n }\n }\n changeCalculatedSize(0);\n changeCalculatedSize(1);\n changeDecreaseArrowSize(0);\n changeIncreaseArrowSize(0);\n changeDecreaseArrowSize(1);\n changeIncreaseArrowSize(1);\n changeDecreaseArrowSize(2);\n changeIncreaseArrowSize(2);\n}", "function onWindowResize() {\n\tscene.setCameraAspect(window.innerWidth / window.innerHeight);\n\trenderer.setSize(window.innerWidth, window.innerHeight);\n}", "function setGridSize(){\n numHorzItems = Math.floor(screenWidth/originalImageSize);\n\n \n var widthOffset = (numHorzItems*originalImageSize) - screenWidth;\n widthOffset = widthOffset/numHorzItems;\n var newwidth = originalImageSize - widthOffset;\n var newHeight = newwidth;\n imageHeight = imageWidth = newwidth;\n\n numVertItems = Math.ceil(screenHeight/newHeight);\n\n numItems = numHorzItems * numVertItems;\n\n if(numItems > 20){\n originalImageSize += 50;\n\n setGridSize();\n }\n else{\n for (var j=0; j<numVertItems; j++)\n {\n for (var i=0; i<numHorzItems; i++)\n {\n var xPos = 0 + (i*newwidth);\n var yPos = 0 + (j*newHeight);\n\n var index = (numHorzItems * j) + i;\n\n indexIsAnimating[index] = false;\n\n $grid = $(\".grid\").append(\"<div class='grid-item' id='image\" + index + \"' style='width:\" + newwidth + \"px; left: \" + xPos + \"px; top: \" + yPos + \"px'></div>\");\n $tiles = $grid.children('.grid-item');\n\n }\n }\n }\n}", "function resize() {\n width = canvas.width = window.innerWidth;\n height = canvas.height = window.innerHeight - 60;\n }", "function resizeWindowChanges(){\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n\t\tcamera.updateProjectionMatrix();\r\n\t\trenderer.setSize( window.innerWidth, window.innerHeight );\r\n\t\trender();\r\n}", "function resize() {\n let canvas = document.querySelector(\"canvas\");\n let windowWidth = window.innerWidth;\n let windowHeight = window.innerHeight;\n let windowRatio = windowWidth / windowHeight;\n let gameRatio = game.config.width / game.config.height;\n if (windowRatio < gameRatio) {\n canvas.style.width = windowWidth + \"px\";\n canvas.style.height = (windowWidth / gameRatio) + \"px\";\n }\n else {\n canvas.style.width = (windowHeight * gameRatio) + \"px\";\n canvas.style.height = windowHeight + \"px\";\n }\n}", "function resizeHandler() {\n\tcanvas.height = H;\n\tcanvas.width = W;\n\t_objects = [];\n\t_planet = null;\n\t_cannon = null;\n\t_cannonball = null;\n\tisrunnning = true;\n\tinit(null, true);\n}", "function onWindowResize() {\n \n\n var aspect = window.innerWidth / window.innerHeight;\n camera.left = - frustumSize * aspect / 2;\n camera.right = frustumSize * aspect / 2;\n camera.top = frustumSize / 2;\n camera.bottom = - frustumSize / 2;\n camera.updateProjectionMatrix();\n\n renderer.setSize( window.innerWidth, window.innerHeight );\n}", "function resize(){\n let canvas = document.querySelector(\"canvas\");\n let windowWidth = window.innerWidth;\n let windowHeight = window.innerHeight;\n let windowRatio = windowWidth / windowHeight;\n let gameRatio = game.config.width / game.config.height;\n if(windowRatio < gameRatio){\n canvas.style.width = windowWidth + \"px\";\n canvas.style.height = (windowWidth / gameRatio) + \"px\";\n }\n else{\n canvas.style.width = (windowHeight * gameRatio) + \"px\";\n canvas.style.height = windowHeight + \"px\";\n }\n}", "function resizeCanvas() {\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n\n renderer.setSize( window.innerWidth, window.innerHeight );\n}", "function ResizeGraph() {\n\n}", "function onWindowResize() {\r\n\r\n windowHalfX = window.innerWidth / 2;\r\n windowHalfY = window.innerHeight / 2;\r\n\r\n width = $('#target').width();\r\n height = $('#target').height();\r\n\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize( width, height );\r\n postprocessing.composer.setSize( width, height );\r\n\r\n}", "updateSize() {\n const totalWidth = Math.round(this.width / this.params.pixelRatio);\n const requiredCanvases = Math.ceil(\n totalWidth / this.maxCanvasElementWidth\n );\n\n while (this.canvases.length < requiredCanvases) {\n this.addCanvas();\n }\n\n while (this.canvases.length > requiredCanvases) {\n this.removeCanvas();\n }\n\n this.canvases.forEach((entry, i) => {\n // Add some overlap to prevent vertical white stripes, keep the width even for simplicity.\n let canvasWidth =\n this.maxCanvasWidth + 2 * Math.ceil(this.params.pixelRatio / 2);\n\n if (i == this.canvases.length - 1) {\n canvasWidth =\n this.width -\n this.maxCanvasWidth * (this.canvases.length - 1);\n }\n\n this.updateDimensions(entry, canvasWidth, this.height);\n this.clearWaveForEntry(entry);\n });\n }", "function resize() {\n let canvas = document.querySelector(\"canvas\");\n const windowWidth = window.innerWidth;\n const windowHeight = window.innerHeight;\n const windowRatio = windowWidth / windowHeight;\n const gameRatio = game.config.width / game.config.height;\n if (windowRatio < gameRatio) {\n canvas.style.width = windowWidth + \"px\";\n canvas.style.height = (windowWidth / gameRatio) + \"px\";\n }\n else {\n canvas.style.width = (windowHeight * gameRatio) + \"px\";\n canvas.style.height = windowHeight + \"px\";\n }\n}", "function resize() {\n\tmap.setSize();\n}" ]
[ "0.7010467", "0.63734335", "0.63519555", "0.63437974", "0.63088465", "0.62070334", "0.6169253", "0.6115766", "0.61015874", "0.6095648", "0.60470426", "0.60360193", "0.60012406", "0.5950517", "0.59253323", "0.59253323", "0.5924455", "0.592156", "0.5919924", "0.59141785", "0.5909724", "0.5907157", "0.5894019", "0.588447", "0.58712703", "0.58637434", "0.5851476", "0.5846372", "0.5843765", "0.58363813", "0.58317894", "0.5827017", "0.58235985", "0.5817707", "0.581108", "0.57923776", "0.5791168", "0.5790619", "0.5783343", "0.57825637", "0.5779391", "0.5767003", "0.57622147", "0.5758768", "0.5756375", "0.5749453", "0.57472515", "0.5740748", "0.5731778", "0.5731778", "0.5731778", "0.5726745", "0.5717772", "0.5709664", "0.5706126", "0.5705406", "0.57038665", "0.5703299", "0.5700803", "0.5700604", "0.5700604", "0.57001936", "0.5700164", "0.5699549", "0.5688629", "0.56876314", "0.56868976", "0.5683412", "0.56808716", "0.56807244", "0.56807244", "0.56800145", "0.5674324", "0.56739616", "0.56735194", "0.56730175", "0.56684893", "0.5668306", "0.56622493", "0.5661282", "0.5657442", "0.56564474", "0.5656062", "0.5654979", "0.5654883", "0.5648987", "0.5648937", "0.56374496", "0.5633712", "0.5629743", "0.5627202", "0.5626395", "0.5622871", "0.56223917", "0.5622133", "0.5622086", "0.56181055", "0.56155604", "0.5614263", "0.56121695" ]
0.73660415
0
includes Navbar + dropdown.
function MyApp({ Component, pageProps }) { return ( <div className="bg"> <CartProvider> <Navbar /> <Component {...pageProps} /> </CartProvider> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNavBar(){\n\t$(\"header\").html(\"<nav class=\\\"navbar navbar-inverse navbar-fixed-top\\\" style=\\\"margin-bottom: 0px; border-radius: 0px;\\\">\\n\" +\n\t\t\" <div class=\\\"container-fluid\\\">\\n\" +\n\t\t\" <div class=\\\"navbar-header\\\">\\n\" +\n\t\t\"\t\t\t\t\t\t\t\t\t\t<button type=\\\"button\\\" class=\\\"navbar-toggle\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#myNavbar\\\">\\n\" +\n\t\t\"\t\t\t\t\t\t\t\t\t\t<span class=\\\"icon-bar\\\"></span>\\n\" +\n\t\t\"\t\t\t\t\t\t\t\t\t\t<span class=\\\"icon-bar\\\"></span>\\n\" +\n\t\t\"\t\t\t\t\t\t\t\t\t\t<span class=\\\"icon-bar\\\"></span>\\n\"+\n\t\t\"\t\t\t\t\t\t\t\t\t\t</button>\\n\" +\n\t\t\" <a class=\\\"navbar-brand\\\" href=\\\"#\\\"><strong>La Bahía del Momo</strong></a>\\n\" +\n\t\t\" </div>\\n\" +\n\t\t\" <div class=\\\"collapse navbar-collapse\\\" id=\\\"myNavbar\\\">\\n\"+\n\t\t\" <ul class=\\\"nav navbar-nav\\\">\\n\" +\n\t\t\" <li class=\\\"dropdown\\\">\\n\" +\n\t\t\" <a class=\\\"dropdown-toggle\\\" data-toggle=\\\"dropdown\\\" href=\\\"#\\\">Categorías\\n\" +\n\t\t\" <span class=\\\"caret\\\"></span></a>\\n\" +\n\t\t\" <ul class=\\\"dropdown-menu\\\">\\n\" +\n\t\t\" <li><a id=\\\"featuredLink\\\" href=\\\"#featured\\\">Momos Destacados</a></li>\\n\" +\n\t\t\" <li><a id=\\\"pepeLink\\\" href=\\\"#pepe\\\">Pepe</a></li>\\n\" +\n\t\t\" <li><a id=\\\"feelLink\\\" href=\\\"#feel\\\">Feel</a></li>\\n\" +\n\t\t\" <li><a id=\\\"dogeLink\\\" href=\\\"#doge\\\">Doge</a></li>\\n\" +\n\t\t\" </ul>\\n\" +\n\t\t\" </li>\\n\" +\n\t\t\" </ul>\\n\" +\n\t\t\" <ul class=\\\"nav navbar-nav navbar-right\\\" id=\\\"right-navBar\\\">\\n\" +\n\t\t\" <!--<li><a href=\\\"#\\\"><span class=\\\"glyphicon glyphicon-user\\\"></span> Sign Up</a></li>-->\\n\" +\n\t\t\" <li><a id=\\\"wishList\\\" href=\\\"#\\\">Mi lista de deseos</a></li>\\n\" +\n\t\t\" <li><a id=\\\"cartIcon\\\" href=\\\"src/views/cart.html\\\"><span class=\\\"glyphicon glyphicon-shopping-cart\\\"></span></a></li>\\n\" +\n\t\t\"\t\t\t\t\t<li><a href=\\\"src/views/register.html\\\" id=\\\"loginBtn\\\"></a></li>\\n\"+\n\t\t\" </ul>\\n\" +\n\t\t\" </div>\\n\" +\n\t\t\" </div>\\n\" +\n\t\t\" </nav>\");\n\n}", "function navbar() {\r\n $('.site-header .primary-navigation .toggle-btn').click(function() {\r\n $('body').addClass('openNav');\r\n });\r\n $('.site-header .main-navigation .close-btn').click(function() {\r\n $('body').removeClass('openNav');\r\n });\r\n }", "function bindNavbar() {\n if ($(window).width() > 768) {\n $('.navbar .dropdown').on('mouseover', function() {\n $('.dropdown-toggle', this).next('.dropdown-menu').show();\n }).on('mouseout', function() {\n $('.dropdown-toggle', this).next('.dropdown-menu').hide();\n });\n\n $('.dropdown-toggle').on('click', function() {\n if ($(this).next('.dropdown-menu').is(':visible')) {\n window.location = $(this).attr('href');\n }\n });\n } else {\n $('.navbar-default .dropdown').off('mouseover').off('mouseout');\n }\n }", "function dropDown() {\n\t\t$navButton = $('.navbar-toggler');\n\t\t$navButton.on('click', () => {\n\t\t\t$('#navbarTogglerDemo03').toggle('collapse');\n\t\t});\n\t}", "function _enableNavBar() {\n if (_options.enableNavBar) {\n var $navBar = $(_renderDirNavbar(_currentDir));\n\n if ($(\"#pfsd-navbar-container\").length === 0) {\n $('<div id=\"pfsd-navbar-container\"></div>').insertBefore(\".modal-body\");\n }\n $(\"#pfsd-navbar-container\").empty();\n $(\"#pfsd-navbar-container\").append($navBar);\n _arrangeNavBar();\n }\n }", "function navbarShow() {\n $$('.main--navbar').removeClass('navbar-hidden');\n $$('.main--content').removeClass('align-top');\n}", "function menu () {\n document.getElementById('navbar').innerHTML = '<nav class=\"navbar navbar-inverse navbar-fixed-top shadow3\"><div class=\"container\"> <div id=\"navbar\" class=\"navbar-collapse collapse navbar-ex1-collapse\"> <ul class=\"nav navbar-nav\"> <li><a href=\"/mahamudh/it2805p/hjem.html\">Hjem</a></li> <li class=\"dropdown\"><a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Kamper <span class=\"caret\"></span></a> <ul class=\"dropdown-menu\"> <li><a href=\"/mahamudh/it2805p/kamper/fixtures.html\">Program</a></li> <li><a href=\"/mahamudh/it2805p/kamper/valg.html\">Kaptein valg</a></li> </ul> </li> <li><a href=\"/mahamudh/it2805p/Liga/liga.html\">Liga</a></li> <li class=\"dropdown\"><a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Kunnskap <span class=\"caret\"></span></a> <ul class=\"dropdown-menu\"> <li><a href=\"/mahamudh/it2805p/kunnskap/formasjoner.html\">Formasjoner</a></li> <li><a href=\"/mahamudh/it2805p/kunnskap/kaptein.html\">Kaptein</a></li> <li><a href=\"/mahamudh/it2805p/kunnskap/overganger.html\">Overganger</a></li><li><a href=\"/mahamudh/it2805p/kunnskap/vitemer.html\">Nyttige kilder</a></li> </ul> </li> <li><a href=\"/mahamudh/it2805p/om/om.html\">Om</a></li> </ul> </div><!--/.nav-collapse --></div></nav>'\n}", "function addNavbar() {\n waitForKeyElements(`nav > a[href=\"/home\"]`, () => {\n if ($(\".gt2-nav\").length) return\n\n $(\"main\").before(`\n <nav class=\"gt2-nav\">\n <div class=\"gt2-nav-left\"></div>\n <div class=\"gt2-nav-center\">\n <a href=\"/home\"></a>\n </div>\n <div class=\"gt2-nav-right\">\n <div class=\"gt2-search\"></div>\n <div class=\"gt2-toggle-navbar-dropdown\">\n <img src=\"${getInfo().avatarUrl.replace(\"normal.\", \"bigger.\")}\" />\n </div>\n <div class=\"gt2-compose\">${getLocStr(\"composeNewTweet\")}</div>\n </div>\n </nav>\n <div class=\"gt2-search-overflow-hider\"></div>\n `)\n\n // home, notifications, messages\n for (let e of [\n \"Home\",\n \"Notifications\",\n \"Messages\",\n window.innerWidth < 1005 ? \"Explore\" : null\n ]) {\n if (!e) continue\n let $e = $(`nav > a[href=\"/${e.toLowerCase()}\"]`)\n if (!e.length) continue\n $e.appendTo(\".gt2-nav-left\")\n $(`.gt2-nav a[href=\"/${e.toLowerCase()}\"] > div`)\n .append(`\n <div class=\"gt2-nav-header\">\n ${getLocStr(`nav${e}`)}\n </div>\n `)\n .attr(\"data-gt2-color-override-ignore\", \"\")\n }\n\n // highlight current location\n $(`.gt2-nav a[href^='/${getPath().split(\"/\")[0]}']`).addClass(\"active\")\n\n // twitter logo\n $(\"h1 a[href='/home'] svg\")\n .appendTo(\".gt2-nav-center a\")\n })\n }", "function navbar() {\n var active = $('.nav-two li:not(.slide)'),\n ctrlMenu = $('.logo-nav > .fa');\n active.on('click', function () {\n $(this).addClass('active').siblings().removeClass('active');\n });\n $('*:not(.logo-nav > .fa, .logo-nav .nav-two, .nav-two li)').click(function () {\n if (ctrlMenu.hasClass('fa-close')) {\n ctrlMenu.click();\n }\n });\n ctrlMenu.on('click', function () {\n $(this).toggleClass('fa-bars fa-close').next('ul').slideToggle();\n });\n $('.logo-nav > .fa, .logo-nav .nav-two, .nav-two li').click(function (event) {\n event.stopPropagation();\n });\n $(window).on('resize', function () {\n if ($(window).innerWidth() >= 800) {\n $('.nav-two').css('display', 'block');\n } else {\n $('.nav-two').css('display', 'none');\n ctrlMenu.addClass('fa-bars').removeClass('fa-close');\n }\n });\n }", "function initializeNavBar()\n {\n\n // Add event listeners to handle click of Open option in command bar\n var mainNavBar = document.getElementById(\"mainNavBar\");\n if (!mainNavBar)\n return;\n\n // Add event listeners to handle click of Open option in command bar\n var close = document.getElementById(\"close\");\n if (!close)\n return;\n\n close.addEventListener(\"click\", closeClick, false);\n }", "function navSettings() {\r\n\t// menu-popper is for showing navigation that has been hidden. Hide this initally.\r\n\t$(\".menu-popper\").hide();\r\n\r\n // disable bootstrap's default click event which changes background-color of button.\r\n\t$(\"#menu-up\").click(function() {\r\n // override bootstrap's change of background-color with navbar's color.\r\n\t\t$(this).css({\"background-color\":\"#222\"});\r\n\t});\r\n\r\n // indicator to check if navbar is opened (event for when navbar is collapsed)\r\n var isNavbarOpened = false;\r\n var $navbarMenu= $(\"#navbar-toggle\");\r\n // change background-color of menu button according to indicator.\r\n\t$navbarMenu.click(function() {\r\n\t\tvar menuBgColor = $(this).css(\"background-color\");\r\n if (isNavbarOpened) {\r\n \t$(this).css({\"background-color\":\"rgb(34, 34, 34)\"});\r\n } else {\r\n $(this).css({\"background-color\":\"rgb(51, 51, 51)\"});\r\n }\r\n isNavbarOpened = !isNavbarOpened;\r\n\t});\r\n \r\n // change background-color of menu button according to indicator\r\n\t$navbarMenu.hover(function() {\r\n \t$(this).css({\"background-color\":\"rgb(51, 51, 51)\"});\r\n }, function() {\r\n \tif (!isNavbarOpened) {\r\n \t $(this).css({\"background-color\":\"rgb(34, 34, 34)\"});\r\n \t}\r\n });\r\n\r\n //change dropdown caret to caret-up, or vice-versa, when clicked\r\n $(\".dropdown\").on(\"hide.bs.dropdown\", function(){\r\n $(\"#user-caret\").html('<span class=\"glyphicon glyphicon-user\">' \r\n + '</span><span class=\"caret\"></span>');\r\n });\r\n $(\".dropdown\").on(\"show.bs.dropdown\", function(){\r\n $(\"#user-caret\").html('<span class=\"glyphicon glyphicon-user\">' \r\n + '</span><span class=\"caret caret-up\"></span>');\r\n });\r\n\r\n // toggle navbar when clicking menu-up/down button.\r\n $(\".menu-toggle\").click(function() {\r\n \t$(\".menu-controller\").toggle();\r\n });\r\n\r\n //animate sliding when dropdown menu is clicked\r\n $(\"#user-caret\").click(function() {\r\n toggleNavWindows(\"#user-caret\", \".nav-window.dropdown-menu\");\r\n });\r\n\r\n //toggle messanger/notification blocks (go to nav_settings_ajax.js)\r\n}", "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}", "function _render() {\n _$navbar.setMod(_B_BAR, _M_WEBAPP, _isWebapp);\n _renderBtn(_$btnL);\n _renderBtn(_$btnR);\n _renderDropdown();\n _renderSearch();\n _renderHead();\n }", "function addNavbar() {\n var h1 = document.getElementById('header');\n h1.insertAdjacentHTML('afterend', `<div id=\"topbar\" class=\"navbar-fixed hoverable\">\n <nav class=\"navbar\">\n <div class=\"nav-wrapper\">\n <a class=\"left logo\">Wadun</a>\n <ul id=\"nav-mobile\" class=\"right\">\n <!-- View button -->\n <li>\n <a id=\"viewBtn\" class=\"tooltipped waves-effect waves-light\" data-tooltip=\"Change View\">\n <i id=\"viewBtnIcon\" class=\"material-icons\">view_module</i>\n </a>\n </li>\n <!-- Bookmarks button -->\n <li>\n <a id=\"bookmarksBtn\" class=\"dropdown-button tooltipped waves-effect waves-light\" data-tooltip=\"Bookmarks\">\n <i class=\"material-icons\">bookmark</i>\n </a>\n </li>\n <!-- Settings button -->\n <li>\n <a id=\"settings-button\" class=\"tooltipped waves-effect waves-light\" href=\"#optionModal\" data-tooltip=\"Settings\">\n <i class=\"material-icons\">settings</i>\n </a>\n </li>\n </ul>\n <form>\n <div class=\"input-field\">\n <input id=\"search\" type=\"search\" required>\n <label class=\"label-icon\" for=\"search\"><i class=\"material-icons\">search</i></label>\n <i id=\"clearSearchBtn\" class=\"material-icons\">close</i>\n </div>\n </form>\n </div>\n </nav>\n </div>`);\n}", "function showNavMenu() {\n burgerBtn.classList.toggle(\"burger-btn--open\");\n mainNav.classList.toggle(\"main-nav--visible\");\n overlay.classList.toggle(\"navbar__dark-overlay--visible\");\n setAriaExpandedOnBtn();\n toggleTabIndex();\n }", "function toggleFunction() {\n //this one is the mobile dropdown\n var x = document.getElementById(\"navDemo\");\n //this is the regular dropdown\n var navbar = document.getElementById(\"myNavbar\");\n if (x.className.indexOf(\"w3-show\") == -1) {\n\t//If dropdown isn't showing\n\t// - make dropdown show, give it shadow\n\t// - give navbar color \n \tx.className += \" w3-card\";\n\tx.className += \" w3-show\";\n\tnavbar.className = \" w3-bar\" + \" w3-white\";\n } else {\n\t//if dropdown needs to be minimized\n\t // - make invisible\n\t // - remove shadow\n\tx.className = x.className.replace(\" w3-card\", \"\");\n\tx.className = x.className.replace(\" w3-show\", \"\");\n\t//depending on page locaiton, modify uppermost navbar\t\n\tif (document.body.scrollTop > transitionPoint || document.documentElement.scrollTop > transitionPoint) {\n \tnavbar.className = \"w3-bar\" + \" w3-card\" + \" w3-white\";\n\t} else {\n \tnavbar.className = navbar.className.replace(\" w3-white\", \"\");\n \tnavbar.style.backgroundColor = \"transparent!important\";\n\t}\n }\n}", "function populateNavBar() {\n const nav = document.getElementById('nav');\n nav.className = 'navbar navbar-expand navbar-light bg-light';\n\n const title = document.createElement('span');\n title.className = 'navbar-brand center';\n title.innerHTML = 'WorldStats';\n nav.appendChild(title);\n\n const outerContainer = document.createElement('div');\n outerContainer.id = 'navbarNavAltMarkup';\n outerContainer.className = 'collapse navbar-collapse';\n nav.appendChild(outerContainer);\n\n const innerContainer = document.createElement('div');\n innerContainer.className = 'navbar-nav';\n outerContainer.appendChild(innerContainer);\n\n const about = document.createElement('a');\n about.className = 'nav-item nav-link';\n about.href = '/about';\n about.innerHTML = 'About';\n innerContainer.appendChild(about);\n\n const cards = document.createElement('a');\n cards.className = 'nav-item nav-link';\n cards.href = '/cards';\n cards.innerHTML = 'Country Cards';\n innerContainer.appendChild(cards);\n\n const graphs = document.createElement('a');\n graphs.className = 'nav-item nav-link';\n graphs.href = '/graphs';\n graphs.innerHTML = 'Country Graphs';\n innerContainer.appendChild(graphs);\n}", "function updateNavigation() {\n\tvar btnTop = $('#btnTop');\n\tvar dropDownMenu = $('.dropdown-menu');\n\tvar scroll = $(window).scrollTop();\n\tvar win_height = ($(\"header\").height())/3;\n\tvar $myNavBar = $(\".navbar\");\n\tvar $navElt = $(\".navbar-left a\");\n\tvar heightClient = win_height - scroll;\n\n\tif (heightClient <= 0) {\n\t\t$myNavBar.css({\"background-color\": \"#FFA1B5\"});\n\t\t$navElt.css({\"color\": \"white\"});\n\t\tdropDownMenu.css({\"width\": \"100%\"}, {\"background-color\": \"#FFA1B5 !important\"});\n\t\tbtnTop.show();\n\t\tsocialMenu.show();\n\n\t} else {\n\t\t$myNavBar.css({\"background-color\": \"transparent\"});\n\t\tdropDownMenu.css({\"background-color\": \"#FFA1B5 !important\"});\n\t\t$navElt.css({\"color\": \"white\"});\n\t\tbtnTop.hide();\n\t\tsocialMenu.hide();\n\t}\n}", "function App() {\n return (\n <Navbar>\n <navItem icon=\"album\"/>\n <navItem icon=\"artist\"/>\n <navItem icon=\"genre\"/>\n <navItem icon=\"song title\"/>\n <navItem icon=\"release date\"/>\n <DropDownMenu/>\n </Navbar>\n \n );\n}", "function navbarHidden() {\n $$('.main--navbar').addClass('navbar-hidden');\n $$('.main--content').addClass('align-top');\n}", "function btmNavBar(t='',admin=false){\r\n\ta = \"\";\r\n\ta += '<nav class=\"navbar fixed-bottom navbar-expand-sm navbar-dark bg-dark\">';\r\n\ta += ' <a class=\"navbar-brand\" href=\"index.html\">Hotel ICONIA</a>';\r\n\ta += ' <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarCollapse\" aria-controls=\"navbarCollapse\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">';\r\n\ta += ' <span class=\"navbar-toggler-icon\"></span>';\r\n\ta += ' </button>';\r\n\ta += ' <div class=\"collapse navbar-collapse\" id=\"navbarCollapse\">';\r\n\ta += ' <ul class=\"navbar-nav mr-auto\"><li class=\"nav-item active\">';\r\n\ta += ' <a class=\"nav-link\" href=\"index.html\">Home <span class=\"sr-only\">(current)</span></a></li>';\r\n\tif(admin)a += ' <li class=\"nav-item\"><a class=\"nav-link\" href=\"update-password.html\">Modify Password</a></li>';\r\n\ta += '<li class=\"nav-item dropup\">';\r\n\ta += '<a class=\"nav-link dropdown-toggle\" id=\"dropdown10\" role=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Contact Us</a>';\r\n\ta += '<div class=\"dropdown-menu\" aria-labelledby=\"dropdown10\">';\r\n\ta += '<a class=\"dropdown-item\" href=\"#\">&nbsp;<span class=\"oi oi-phone\"></span>&nbsp;&nbsp;(+852) 56781234 (office hour)</a>';\r\n\ta += '<a class=\"dropdown-item\" href=\"mailto:[email protected]\"><span class=\"oi oi-envelope-closed\"></span>&nbsp;&nbsp;yiran.cheng+polyu.edu.hk (replace + with @)</a>';\r\n\ta += '<a class=\"dropdown-item\" href=\"#\"><span class=\"oi oi-compass\"></span>&nbsp;&nbsp;The Hong Kong Polytechnic University</a>';\r\n\ta += '</div>';\r\n\ta += '</li>';\r\n\ta += '</li>';\r\n\ta += '<li class=\"nav-item\">';\r\n\tif(t!='')\r\n\t\ta += '\t<a id=\"manager-btn\" class=\"nav-link disabled\" onclick=\"javascript: Logout();\"><span class=\"oi oi-key\"></span><span id=\"admin-email\" sytle=\"font-size: 10px;\"> ['+t+'] Logout</span></a>';\r\n\telse\r\n\t\ta += '\t<a id=\"manager-btn\" class=\"nav-link disabled\" href=\"admin-login.html\"><span class=\"oi oi-key\"></span><span id=\"admin-email\" sytle=\"font-size: 10px;\"> Admin Login</span></a>';\r\n\ta += '</li>';\r\n\ta += '</ul>';\r\n\ta += '</div>';\r\n\ta += '</nav>';\r\n\tdocument.write(a);\r\n}", "render() {\n return (\n <div>\n <Navbar inverse collapseOnSelect>\n <Navbar.Header>\n <Navbar.Brand\n onClick={this.handleShowDefault}>\n Admin Portal\n </Navbar.Brand>\n <Navbar.Toggle />\n </Navbar.Header>\n <Navbar.Collapse>\n <Nav>\n <NavDropdown title=\"Users\" id=\"basic-nav-dropdown\">\n <NavItem eventKey={1} onClick={this.handlePendingRequests}>Upgrade Requests</NavItem>\n <NavItem eventKey={2} onClick={this.handleCreateUser}>Create User</NavItem>\n <NavItem eventKey={3} onClick={this.handleShowUsers}>View Users</NavItem>\n </NavDropdown>\n\n <NavDropdown title=\"Teams\" id=\"basic-nav-dropdown\">\n <NavItem eventKey={4} onClick={this.handleCreateTeam}>Create Team</NavItem>\n <NavItem eventKey={5} onClick={this.handleAddToTeam}>Add User</NavItem>\n <NavItem eventKey={6} onClick={this.handleShowTeams}>View Teams</NavItem>\n </NavDropdown>\n\n <NavDropdown title=\"Events\" id=\"basic-nav-dropdown\">\n <NavItem eventKey={7} onClick={this.handleEventSignIn}>Begin Event</NavItem>\n <NavItem eventKey={8} onClick={this.handleAddTeamToEvent}>Add Team</NavItem>\n <NavItem eventKey={9} onClick={this.handleCreateEvent}>Schedule Event</NavItem>\n <NavItem eventKey={10} onClick={this.handleShowEventHistory}>View Schedule</NavItem>\n </NavDropdown>\n\n <NavDropdown title=\"Scoreboard\" id=\"basic-nav-dropdown\">\n <NavItem eventKey={11} onClick={this.handleShowScore}>View Board</NavItem>\n </NavDropdown>\n\n <NavDropdown title=\"Resources\" id=\"basic-nav-dropdown\">\n <NavItem eventKey={13} onClick={this.handlePublishPractice}>Publish Practice Questions</NavItem>\n <NavItem eventKey={14} onClick={this.handlePublishScores}>Publish Scorecards</NavItem>\n <NavItem eventKey={15} onClick={this.handleCreateEmail}>Create Email Alert</NavItem>\n <NavItem eventKey={16} onClick={this.handleCreateNews}>Update Newsfeed</NavItem>\n </NavDropdown>\n\n </Nav>\n </Navbar.Collapse>\n </Navbar>\n <Jumbotron className=\"page-body\">\n <StatusMessages ref={this.statusMessages}></StatusMessages>\n {currentView}\n </Jumbotron>\n </div>\n )\n }", "function nav(path) {\n var model = window.MODEL;\n var html = \"\";\n var cur = window.current_drive_order || 0;\n html += `<nav class=\"navbar navbar-expand-lg navbar-light bg-light\">\n <a class=\"navbar-brand\" href=\"/${cur}:/\"><img border=\"0\" alt=\"Shinobi Cloud\" src=\"https://user-images.githubusercontent.com/64221555/92332342-ee306400-f09a-11ea-9e61-0c246c3e0bae.png\" height=\"50px\"></a>\n <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarSupportedContent\" aria-controls=\"navbarSupportedContent\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n <span class=\"navbar-toggler-icon\"></span>\n </button>\n\n <div class=\"collapse navbar-collapse\" id=\"navbarSupportedContent\">\n <ul class=\"navbar-nav mr-auto\">\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"/${cur}:/\">Home</a>\n </li>`;\n var names = window.drive_names;\n var drive_name = window.drive_names[cur];\n /*html += `<button class=\"mdui-btn mdui-btn-raised\" mdui-menu=\"{target: '#drive-names'}\"><i class=\"mdui-icon mdui-icon-left material-icons\">share</i> ${names[cur]}</button>`;\n html += `<ul class=\"mdui-menu\" id=\"drive-names\" style=\"transform-origin: 0px 0px; position: fixed;\">`;\n names.forEach((name, idx) => {\n html += `<li class=\"mdui-menu-item ${(idx === cur) ? 'mdui-list-item-active' : ''} \"><a href=\"/${idx}:/\" class=\"mdui-ripple\">${name}</a></li>`;\n });\n html += `</ul>`;*/\n\n // Dropdown to select different drive roots.\n html += `<li class=\"nav-item dropdown\"><a class=\"nav-link dropdown-toggle\" href=\"#\" id=\"navbarDropdown\" role=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">${drive_name}</a><div class=\"dropdown-menu\" aria-labelledby=\"navbarDropdown\">`;\n names.forEach((name, idx) => {\n html += `<a class=\"dropdown-item\" href=\"/${idx}:/\">${name}</a>`;\n });\n html += `</div></li>`;\n\n html += `<li class=\"nav-item dropdown\"><a class=\"nav-link dropdown-toggle\" href=\"#\" id=\"navbarDropdown\" role=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Current Path</a><div class=\"dropdown-menu\" aria-labelledby=\"navbarDropdown\"><a class=\"dropdown-item\" href=\"/${cur}:/ \">> Home</a>`;\n\n if (!model.is_search_page) {\n var arr = path.trim('/').split('/');\n var p = '/';\n if (arr.length > 1) {\n arr.shift();\n for (i in arr) {\n var n = arr[i];\n n = decodeURI(n);\n p += n + '/';\n if (n == '') {\n break;\n }\n html += `<a class=\"dropdown-item\" href=\"/${cur}:${p}\">> ${n}</a>`;\n }\n }\n }\n\n html += `</div></li><li class=\"nav-item\">\n <a class=\"nav-link\" href=\"//www.facebook.com/imsjana/\">Know More About Me</a>\n </li>`;\n\n var search_text = model.is_search_page ? (model.q || '') : '';\n const isMobile = Os.isMobile;\n var search_bar = `\n</ul>\n<form class=\"form-inline my-2 my-lg-0\" method=\"get\" action=\"/${cur}:search\">\n<input class=\"form-control mr-sm-2\" name=\"q\" type=\"search\" placeholder=\"Search\" aria-label=\"Search\" value=\"${search_text}\">\n<button class=\"btn btn-outline-success my-2 my-sm-0\" onclick=\"if($('#search_bar').hasClass('mdui-textfield-expanded') && $('#search_bar_form>input').val()) $('#search_bar_form').submit();\" type=\"submit\">Search</button>\n</form>\n</div>\n</nav>\n`;\n\n // Personal or team\n if (model.root_type < 2) {\n // Show search box\n html += search_bar;\n }\n\n $('#nav').html(html);\n mdui.mutation();\n mdui.updateTextFields();\n}", "function Navbar() {\n return (\n <nav className=\"mainNav navbar navbar-light navbar-expand-lg fixed-top\">\n <div className=\"container\">\n <a className=\"navbar-brand\" href=\"#pageTop\">Samuel Yoo</a>\n <button className=\"navbar-toggler ml-auto\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarContents\" aria-controls=\"navbarContents\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n <span className=\"navbar-toggler-icon\"></span>\n </button>\n <div className=\"collapse navbar-collapse justify-content-end\" id=\"navbarContents\">\n <ul className=\"navbar-nav nav ml-auto\">\n <li className=\"nav-item\">\n <a className=\"nav-link js-scroll-trigger\" href=\"#info\">About</a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link js-scroll-trigger\" href=\"#portfolio\">Portfolio</a>\n </li>\n <li className=\"nav-item dropdown\">\n <a className=\"nav-link js-scroll-trigger dropdown-toggle\" href=\"#\" id=\"navbarDropdownMenuLink\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n Contact\n </a>\n <div className=\"dropdown-menu\" aria-labelledby=\"navbarDropdown\">\n <a className=\"dropdown-item\" href=\"https://github.com/samuelyoo/\" alt=\"GitHub Url\"><i className=\"fab fa-github\"></i>GitHub</a>\n <a className=\"dropdown-item\" href=\"https://www.linkedin.com/in/samuel-hc-yoo/\" alt=\"linkedin Url\"><i className=\"fab fa-linkedin-in\"></i>LinkedIn</a>\n <a className=\"dropdown-item\" href=\"assets/documents/resume_SamuelYoo.pdf\" alt=\"resume Url\"><i className=\"fab fa-instagram\"></i>Resume</a>\n <div className=\"dropdown-divider\"></div>\n <a className=\"dropdown-item\" href=\"#contactInfo\">Contact Info</a>\n </div>\n </li>\n </ul>\n </div>\n </div>\n </nav>\n );\n}", "function navEvents() {\n \n /*---- Dropdown Menu Events ----*/\n \n $('.main-nav .navbar-nav > .dropdown > .dropdown-menu').click(function(event) {\n if(screenWidth <= 991) {\n event.stopPropagation();\n }\n });\n\n $( \".main-nav .navbar-nav>.dropdown>.dropdown-menu>.dropdown-submenu\" ).click(function(event) {\n if(screenWidth < 991) {\n $this = $(this);\n $this.siblings(\".dropdown-submenu\").removeClass(\"open\").end(); \n $this.parents(\".dropdown-submenu\").addClass('open');\n $this.toggleClass('open');\n event.stopPropagation();\n }\n });\n\n $('.main-nav .navbar-nav > .dropdown > a').click(function(event) {\n $('.main-nav .navbar-nav .dropdown-submenu').removeClass('open');\n });\t\n\n $('.navbar-toggle').click(function(event){\n $(this).toggleClass('active')\n })\n\n $('.main-nav .nav > li .dropdown-submenu > a').click(function(event) {\n if(screenWidth > 991) {\n event.stopPropagation();\n }\n });\n\t\n\tif (screenWidth < 991) {\n\t\t\n\t\t$('.header-side').removeClass('in');\n\t\t$('.side-header').removeClass('active');\n\t\n\t}\n \n $('.main-nav .nav > li').hover(function() {\n var dropdownList = $(this).find(\"> .dropdown-menu\");\n\n if (screenWidth > 991) {\n \n /*---- Dropdown Animation on Hover ----*/\n \n dropdownList.addClass('animated fadeIn'); \n window.setTimeout( function(){\n dropdownList.removeClass('animated fadeIn');\n }, 500); \n\n /*---- Positioning Dropdown Menu ----*/\n \n if(!dropdownList.hasClass('megamenu')){\n var childDropdownList = $(this).find(\".dropdown-submenu .dropdown-menu\"),\n dropdownOffset = $(this).offset(),\n offsetLeft = dropdownOffset.left,\n dropdownWidth = dropdownList.width(),\n childWidth = childDropdownList.width(),\n docWidth = $(window).width(),\n aWidth = $(this).children(\"a\").outerWidth(),\n shiftWidth = Math.abs(dropdownWidth - aWidth),\n childShiftWidth = dropdownWidth + childWidth - 1,\n isDropdownVisible = (offsetLeft + dropdownWidth <= docWidth),\n isChildDropdownVisible = (offsetLeft + dropdownWidth + childWidth <= docWidth);\n if (!isDropdownVisible) {\n dropdownList.css('margin-left','-'+shiftWidth+'px')\n childDropdownList.css('margin-left','-'+childShiftWidth+'px')\n } else if (!isChildDropdownVisible) {\n childDropdownList.css('margin-left','-'+childShiftWidth+'px')\n }\n else {\n dropdownList.removeAttr('style')\n childDropdownList.removeAttr('style')\n }\n }\n \n /*---- Positioning Mega Menu ----*/\n \n else if(dropdownList.hasClass('megamenu')){\n var dropdownOffset = $(this).offset(),\n linkWidth = $(this).width(),\n dropdownListOffset = dropdownList.offset(),\n offsetLeft = dropdownOffset.left,\n dropdownListoffsetLeft = dropdownListOffset.left,\n dropdownWidth = dropdownList.width(),\n docWidth = $(window).width(),\n shiftOffset = (($('.navigation').hasClass('transparent')) ? 30 : 30),\n positionedValue = Math.abs(offsetLeft),\n shiftWidth = Math.abs(positionedValue + dropdownWidth + shiftOffset),\n isDropdownVisible = (shiftWidth <= docWidth);\n if (!isDropdownVisible) {\n calculateOffset = docWidth - dropdownWidth - shiftOffset;\n dropdownList.css('left',+calculateOffset+'px');\n }\n else {\n dropdownList.css('left',+positionedValue+'px');\n }\n }\n }\n });\n\t\n /*---- Full-screen Menu Events ----*/\n \n $('.full-screen-menu-trigger').click(function(event) {\n event.preventDefault();\n $('.full-screen-header').fadeToggle();\n $(this).toggleClass('active');\n $('html, body').toggleClass('full-screen-header-active');\n });\n\n /*---- Side Menu Events ----*/\n \n $('.side-menu-trigger').click(function(event) {\n event.preventDefault();\n $(this).toggleClass('active');\n $('body').toggleClass('in');\n $('.side-header').toggleClass('active');\n\t\tif(!$('.chart-container').hasClass('admin-chart-js')){\n\t\t\tsetTimeout(function(){$('.chart-container').trigger('resize');},300);\n\t\t}\n });\n\t\n\t$('.navbar-icons .navbar-left li a').click(function(){\n\t\tif (screenWidth < 991 && $(this).parents('li').hasClass('dropdown')) {\n\t\t\tvar dropdownList = $(this).parents('li.dropdown').find(\"> .dropdown-menu\");\n\t\t\tvar dropdownOffset = dropdownList.offset().left,\n\t\t\t\tdropdownOffset = Math.abs(dropdownOffset),\n\t\t\t\tlinkWidth = dropdownList.width(),\n\t\t\t\tdocWidth = $(window).width();\n\t\t\t\t\n\t\t\tsetTimeout(function(){\n\t\t\t\tdropdownOffset = dropdownList.offset().left;\n\t\t\t\tif((dropdownOffset+linkWidth)>docWidth){\n\t\t\t\t\tvar calc = docWidth-dropdownOffset-linkWidth-30;\n\t\t\t\t\tdropdownList.css('margin-left',calc+'px')\n\t\t\t\t}\n\t\t\t},1);\n\t\t}\t\n\t\telse {\n\t\t\treturn;\n\t\t}\n\t});\n\n\t$('.side-header-close').click(function(event){\n event.preventDefault();\n if ($('.side-header').hasClass('active')) {\n $('.side-menu-trigger').removeClass('active');\n $('.side-header').removeClass('active');\n $('body').removeClass('in');\n }\n });\n\t\n\n /*---- Sub-menu Events ----*/\n \n $( \".menu-dropdown-link\" ).click(function(event) {\n\t\tif(!$(this).hasClass('inner') && !$(this).hasClass('third')){\n\t\t\t\n\t\t\t$(this)\n\t\t\t\t.parent(\".with-dropdown\")\n\t\t\t\t.siblings(\".with-dropdown\")\n\t\t\t\t.children(\".menu-dropdown.collapse\")\n\t\t\t\t.removeClass(\"in\")\n\t\t\t\t.end(); \n\t\t\t$(this).parents(\".with-dropdown\").children(\".menu-dropdown.collapse\").toggleClass('in');\n\t\t\t//$( this ).parents(\".with-dropdown\").find(\".menu-dropdown.collapse\").toggleClass('in');\n\t\t\t event.stopPropagation();\n\t\t\t\t$(\".with-dropdown-2\").find(\"> .menu-dropdown.collapse\").removeClass('in')\n\t\t}\n\t\telse if ($(this).hasClass('inner')){\n\t\t\t\n\t\t\t$(this)\n\t\t\t\t.parent(\".with-dropdown-2\")\n\t\t\t\t.siblings(\".with-dropdown-2\")\n\t\t\t\t.children(\".menu-dropdown.collapse\")\n\t\t\t\t.removeClass(\"in\")\n\t\t\t\t.end(); \n\t\t\t$( this ).parents(\".with-dropdown-2\").children(\".menu-dropdown.collapse\").toggleClass('in');\n\t\t\t$(\".with-dropdown-3\").find(\"> .menu-dropdown.collapse\").removeClass('in')\n\t\t\tevent.stopPropagation();\n\t\t\t\n\t\t}\n\t\telse if ($(this).hasClass('third')){\n\t\t\t$(this)\n\t\t\t\t.parent(\".with-dropdown-3\")\n\t\t\t\t.siblings(\".with-dropdown-3\")\n\t\t\t\t.children(\".menu-dropdown.collapse\")\n\t\t\t\t.removeClass(\"in\")\n\t\t\t\t.end(); \n\t\t\t$( this ).parents(\".with-dropdown-3\").children(\".menu-dropdown.collapse\").toggleClass('in');\n\t\t\tevent.stopPropagation();\n\t\t}\n });\n\t\n $('li.with-dropdown a.menu-dropdown-link').click(function () {\n\t\tif(!$(this).hasClass('inner') && !$(this).hasClass('third')){\n\t\t\tvar dh = $( this ).parents(\".with-dropdown\").children(\".menu-dropdown.collapse\").outerHeight();\n\t\t\tif(!$(this).hasClass('active-dropdown')) {\n\t\t\t\t$( this ).parents(\".with-dropdown\").children(\".menu-dropdown.collapse\").css('height',dh+'px');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$( this ).parents(\".with-dropdown\").children(\".menu-dropdown.collapse\").attr('style','').removeClass('in');\n\t\t\t}\n\t\t\t$('.active-dropdown').not($(this)).removeClass('active-dropdown');\n\t\t\t$(this).children(\".with-dropdown-2,.with-dropdown-3\").find(\" > .menu-dropdown-link\").addClass('active-dropdown');\n\t\t\t$(this).toggleClass('active-dropdown');\n\t\t}\n\t\telse if ($(this).hasClass('inner')){\n\t\t\tvar dh = $( this ).parents(\".with-dropdown-2\").children(\".menu-dropdown.collapse\").outerHeight();\n\t\t\tvar sh = $( this ).parents(\".with-dropdown\").children(\".menu-dropdown.collapse\").outerHeight();\n\t\t\tvar th = dh + sh;\n\t\t\tvar mh = sh - dh;\n\t\t\tif(!$(this).hasClass('active-dropdown')) {\n\t\t\t\t$( this ).parents(\".with-dropdown-2\").children(\".menu-dropdown.collapse\").css('height',dh+'px');\n\t\t\t\t$( this ).parents(\".with-dropdown\").find(\" > .menu-dropdown.collapse\").css('height',th+'px');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$( this ).parents(\".with-dropdown-2\").children(\".menu-dropdown.collapse\").attr('style','');\n\t\t\t\t$( this ).parents(\".with-dropdown\").find(\" > .menu-dropdown.collapse\").css('height',mh+'px');\n\t\t\t}\n\t\t\t$('.active-dropdown').not($(this)).removeClass('active-dropdown');\n\t\t\t$(this).parents(\".with-dropdown\").find(\" > .menu-dropdown-link\").addClass('active-dropdown');\n\t\t\t$(this).children(\".with-dropdown-3\").find(\" > .menu-dropdown-link\").addClass('active-dropdown');\n\t\t\t$(this).toggleClass('active-dropdown');\n\t\t}\n\t\telse if ($(this).hasClass('third')){\n\t\t\tvar ah = $( this ).parents(\".with-dropdown-3\").children(\".menu-dropdown.collapse\").outerHeight();\n\t\t\tvar dh = $( this ).parents(\".with-dropdown-2\").children(\".menu-dropdown.collapse\").outerHeight();\n\t\t\tvar sh = $( this ).parents(\".with-dropdown\").children(\".menu-dropdown.collapse\").outerHeight();\n\t\t\tvar th = ah + dh;\n\t\t\tvar yh = ah + dh + sh;\n\t\t\tvar mh = dh - ah;\n\t\t\tvar nh = sh - dh - ah;\n\t\t\tif(!$(this).hasClass('active-dropdown')) {\n\t\t\t\t$( this ).parents(\".with-dropdown-3\").children(\".menu-dropdown.collapse\").css('height',ah+'px');\n\t\t\t\t$( this ).parents(\".with-dropdown-2\").children(\".menu-dropdown.collapse\").css('height',th+'px');\n\t\t\t\t$( this ).parents(\".with-dropdown\").find(\" > .menu-dropdown.collapse\").css('height',yh+'px');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$( this ).parents(\".with-dropdown-3\").children(\".menu-dropdown.collapse\").attr('style','');\n\t\t\t\t$( this ).parents(\".with-dropdown-2\").find(\" > .menu-dropdown.collapse\").css('height',mh+'px');\n\t\t\t\t$( this ).parents(\".with-dropdown\").find(\" > .menu-dropdown.collapse\").css('height',nh+'px');\n\t\t\t}\n\t\t\t$('.active-dropdown').not($(this)).removeClass('active-dropdown');\n\t\t\t$(this).parents(\".with-dropdown,.with-dropdown-2\").find(\" > .menu-dropdown-link\").addClass('active-dropdown');\n\t\t\t$(this).toggleClass('active-dropdown');\n\t\t}\n });\n\n /*---- Search Box Events ----*/\n \n $('.search-box-trigger').click(function(event) {\n if($(window).width() < 992) {\n if($('.navbar-collapse').hasClass('in')){\n $('.navbar-collapse').removeClass('in');\n }\n }\n event.preventDefault();\n $('.full-screen-search').fadeToggle();\n $(this).toggleClass('active');\n });\n\n $(\".search-field\").keyup(function (e) {\n if (e.keyCode == 13) {\n $('#searchForm').submit();\n }\n });\n\t\n}", "function loadNavbar(){\n\n\t// append a div to the body of the page\n\tvar body = document.getElementById(\"body\");\n\tvar navbar = document.createElement(\"div\");\n\tnavbar.id = \"navbar\";\n\tbody.appendChild(navbar);\n\n\t// choose the correct navbar for case that user is logged in\n\tif(sessionStorage.getItem(\"userLoggedIn\") == \"true\"){\n\t\ttemplateByIdFromFile(navbar, 'common/navbar-logged-in.html');\n\t}\n\telse{\n\t\ttemplateByIdFromFile(navbar, 'common/navbar.html');\n\t}\n}", "function Navbar() {\n return (\n <header id=\"masthead\">\n {/* <div className=\"container\"> */}\n <nav className=\"navbar navbar-default navbar-expand-lg navbar-light\">\n <div className=\"navbar-header d-flex col\">\n <Link className=\"navbar-brand\"></Link>{\" \"}\n <Link to=\"foodhub\">\n <Link className=\"index.html\" id=\"logo\">\n S & S CateringHub\n </Link>\n </Link>\n ,\n <button\n type=\"button\"\n data-target=\"#navbarCollapse\"\n data-toggle=\"collapse\"\n className=\"navbar-toggle navbar-toggler ml-auto\"\n >\n <span className=\"navbar-toggler-icon\"></span>\n <span className=\"icon-bar\"></span>\n <span className=\"icon-bar\"></span>\n <span className=\"icon-bar\"></span>\n </button>\n </div>\n {/* <!-- Collection of nav links, forms, and other content for toggling --> */}\n <div\n id=\"navbarCollapse\"\n className=\"collapse navbar-collapse justify-content-start\"\n >\n <ul className=\"nav navbar-nav\">\n <li className=\"nav-item\">\n <Link to=\"/\" className=\"nav-link\">\n <strong>Home</strong>\n </Link>\n </li>\n <li className=\"nav-item\">\n <Link to=\"/about\" className=\"nav-link\">\n <strong>About</strong>\n </Link>\n </li>\n <li className=\"nav-item dropdown\">\n <a\n data-toggle=\"dropdown\"\n className=\"nav-link dropdown-toggle\"\n href=\"#\"\n >\n <strong>Services</strong> <b className=\"caret\"></b>\n </a>\n <ul className=\"dropdown-menu\">\n <li>\n <Link to=\"/caterers\" className=\"dropdown-item\">\n Caterers\n </Link>\n </li>\n <li>\n <Link to=\"/chefs\" className=\"dropdown-item\">\n Chefs\n </Link>\n </li>\n <li>\n <Link to=\"/nutrionists\" className=\"dropdown-item\">\n Nutrionists\n </Link>\n </li>\n <li>\n <Link to=\"/foodies\" className=\"dropdown-item\">\n Foodies\n </Link>\n </li>\n </ul>\n </li>\n <li className=\"nav-item active\">\n <Link to=\"/createstore\" className=\"nav-link\">\n <strong>Createstore</strong>\n </Link>\n </li>\n <li className=\"nav-item\">\n <Link to=\"/blog</li>\" className=\"nav-link\">\n <strong>Blog</strong>\n </Link>\n </li>\n <li className=\"nav-item\">\n <Link to=\"/contact\" className=\"nav-link\">\n <strong>Contact</strong>\n </Link>\n </li>\n </ul>\n <form className=\"navbar-form form-inline\">\n <div className=\"input-group search-box\">\n <input\n type=\"text\"\n id=\"search\"\n className=\"form-control\"\n placeholder=\"Search here...\"\n />\n <span className=\"input-group-addon\">\n <i className=\" fa fa-search\"></i>\n </span>\n </div>\n </form>\n <ul className=\"nav navbar-nav navbar-right ml-auto\">\n <li className=\"nav-item\">\n <Link data-toggle=\"dropdown\">\n <Link to=\"login\" className=\"nav-link dropdown-toggle\">\n <strong>Login</strong>\n </Link>\n </Link>\n <ul className=\"dropdown-menu form-wrapper\">\n <li>\n <form\n action=\"/examples/actions/confirmation.php\"\n method=\"post\"\n >\n <p className=\"hint-text\">\n Sign in with your social media account\n </p>\n <div className=\"form-group social-btn clearfix\">\n <a href=\"#\" className=\"btn btn-primary pull-left\">\n <i className=\"fa fa-facebook\"></i> Facebook\n </a>\n <a href=\"#\" className=\"btn btn-info pull-right\">\n <i className=\"fa fa-twitter\"></i> Twitter\n </a>\n </div>\n <div className=\"or-seperator\">\n <b>or</b>\n </div>\n <div className=\"form-group\">\n <input\n type=\"text\"\n className=\"form-control\"\n placeholder=\"Username\"\n required=\"required\"\n />\n </div>\n <div className=\"form-group\">\n <input\n type=\"password\"\n className=\"form-control\"\n placeholder=\"Password\"\n required=\"required\"\n />\n </div>\n <input\n type=\"submit\"\n className=\"btn btn-primary btn-block\"\n value=\"Login\"\n />\n <div className=\"form-footer\">\n <a href=\"#\">Forgot Your password?</a>\n </div>\n </form>\n </li>\n </ul>\n </li>\n <li className=\"nav-item\">\n <a\n href=\"#\"\n data-toggle=\"dropdown\"\n className=\"btn btn-primary dropdown-toggle get-started-btn mt-1 mb-1\"\n >\n Sign up\n </a>\n <ul className=\"dropdown-menu form-wrapper\">\n <li>\n <form\n action=\"/examples/actions/confirmation.php\"\n method=\"post\"\n >\n <p className=\"hint-text\">\n Fill in this form to create your account!\n </p>\n <div className=\"form-group\">\n <input\n type=\"text\"\n className=\"form-control\"\n placeholder=\"Username\"\n required=\"required\"\n />\n </div>\n <div className=\"form-group\">\n <input\n type=\"password\"\n className=\"form-control\"\n placeholder=\"Password\"\n required=\"required\"\n />\n </div>\n <div className=\"form-group\">\n <input\n type=\"password\"\n className=\"form-control\"\n placeholder=\"Confirm Password\"\n required=\"required\"\n />\n </div>\n <div className=\"form-group\">\n <label className=\"checkbox-inline\">\n <input type=\"checkbox\" required=\"required\" /> I accept\n the <a href=\"#\">Terms &amp; Conditions</a>\n </label>\n </div>\n <input\n type=\"submit\"\n className=\"btn btn-primary btn-block\"\n value=\"Sign up\"\n />\n </form>\n </li>\n </ul>\n </li>\n </ul>\n </div>\n </nav>\n {/* / </div> */}\n </header>\n );\n}", "function homeToggleFunction() {\n //this one is the mobile dropdown\n var x = document.getElementById(\"navDemo\");\n //this is the regular dropdown\n var navbar = document.getElementById(\"myNavbar\");\n if (x.className.indexOf(\"w3-show\") != -1) {\n\t//if dropdown needs to be minimized\n\t // - make invisible\n\t // - remove shadow\n\tx.className = x.className.replace(\" w3-card\", \"\");\n\tx.className = x.className.replace(\" w3-show\", \"\");\n\t//depending on page locaiton, modify uppermost navbar\t\n\tif (document.body.scrollTop > transitionPoint || document.documentElement.scrollTop > transitionPoint) {\n \tnavbar.className = \"w3-bar\" + \" w3-card\" + \" w3-white\";\n\t} else {\n \t// navbar.className = \"w3-bar\";\n \tnavbar.className = navbar.className.replace(\" w3-white\", \"\");\n \tnavbar.style.backgroundColor = \"transparent!important\";\n\t}\n }\n}", "function NavBar() {\n const [openNav, setOpenNav] = useState(false);\n\n function toggleOpen() {\n setOpenNav(!openNav);\n }\n\n return (\n <nav className=\"navbar navbar-expand navbar-light\">\n <div>\n <ul className=\"navbar-nav\">\n <li className=\"nav-item\">\n <div\n className=\"nav-link dropdown-toggle\"\n onClick={toggleOpen}\n role=\"button\">\n <div className=\"navbar-toggler-icon\" ></div>\n </div>\n\n <div className={`dropdown-menu${openNav ? \" show\" : \"\"}`}>\n <Link to=\"/blog\" className=\"dropdown-item\">B l o g</Link>\n <Link to=\"/new\" className=\"dropdown-item\">N e w P o s t</Link>\n </div>\n\n </li>\n </ul>\n </div>\n <Link to=\"/\" className=\"navbar-title\"> M i c r o b l o g </Link>\n </nav>\n );\n}", "function navBarClick () {\n let $navbar = $('#settings');\n $navbar.on('click', (event) => {\n let $settingOptions = $('.setting-options')\n $settingOptions.toggle('.setting-hidden')\n })\n}", "function showNavbar() {\r\n if ($location.path() === '/') {\r\n return false;\r\n }\r\n return true;\r\n }", "#renderMenu() {\n return html`\n <div class=\"collapse navbar-collapse navbar-ex1-collapse admin-side-navbar\" id=\"${this.#divMenu}\">\n <!-- To check the visibility of each menu and submenu item-->\n <ul class=\"nav navbar-nav left\">\n ${\n UtilsNew.getVisibleItems(this._config.menu, this.opencgaSession)\n .map(item => item.submenu && UtilsNew.hasVisibleItems(item.submenu, this.opencgaSession) ? html `\n <li class=\"dropdown open\">\n <!-- CAUTION: href attribute removed. To discuss: toggle open always-->\n <a class=\"dropdown-toggle\" data-toggle=\"dropdown open\"\n role=\"button\" aria-haspopup=\"true\" aria-expanded=\"true\">\n ${item.name} <!-- <span class=\"caret\"></span> -->\n </a>\n <ul class=\"dropdown-menu\" @click=\"${this._onItemNavClick}\">\n ${\n UtilsNew.getVisibleItems(item.submenu, this.opencgaSession)\n .map(subItem => {\n const type = [\"category\", \"separator\"].find(type => type in subItem);\n switch (type) {\n case \"category\":\n return html `\n <li>\n <a class=\"nav-item-category\"\n style=\"cursor:auto!important;\">\n <strong>${subItem.name}</strong>\n </a>\n <!--<p class=\"navbar-text\">$submenuItem.name}</p>-->\n </li>\n `;\n case \"separator\":\n return html `\n <li role=\"separator\" class=\"divider\"></li>\n `;\n default:\n return html `\n <li class=\"nav-item\" data-id=\"${subItem.id}\">\n <!-- TODO: fix for formatting icon | name -->\n <a class=\"nav-link\">${subItem.name}</a>\n </li>\n `;\n }\n })\n }\n </ul>\n </li>\n ` : html `\n <li>TODO: NO SUBMENU</li>\n `)}\n </ul>\n </div>\n `;\n }", "function navOpen() {\n\t\t\t$('.navbar-toggle').on('click', function() {\n\t\t\t\t$('body').toggleClass('nav-open');\n\t\t\t});\n\t\t}", "function navbarfunction(language_data) {\r\n\r\n /*Hides the OLD html code from navbar*/\r\n /*$(document.getElementById('nav')).hide(); */\r\n\r\n /*Creates an empty unsorted list (will add the navbar in here)*/\r\n let ul_sv = $('<ul/>').attr('class', 'navbar-nav');\r\n let ul_en = $('<ul/>').attr('class', 'navbar-nav');\r\n\r\n /*Create four empty sorted lists (will add the idividual items (higscor, historia etc)into these lists. */\r\n let navitem1_sv = $('<li/>').attr('class', 'nav-item nav-margin');\r\n let navitem2_sv = $('<li/>').attr('class', 'nav-item nav-margin');\r\n let navitem3_sv = $('<li/>').attr('class', 'nav-item nav-margin');\r\n let navitem4_sv = $('<li/>').attr('class', 'nav-item nav-margin');\r\n let navitem5_sv = $('<li/>').attr('class', 'nav-item icon-resize')\r\n\r\n /*Create four empty sorted lists (will add the idividual items (higscor, history etc)into these lists. */\r\n let navitem1_en = $('<li/>').attr('class', 'nav-item nav-margin');\r\n let navitem2_en = $('<li/>').attr('class', 'nav-item nav-margin');\r\n let navitem3_en = $('<li/>').attr('class', 'nav-item nav-margin');\r\n let navitem4_en = $('<li/>').attr('class', 'nav-item nav-margin');\r\n let navitem5_en = $('<li/>').attr('class', 'nav-item icon-resize')\r\n\r\n /* Append adds the text stored in langu age-date (taken from JSON file)and html-code to the navbar item (empty list)*/\r\n navitem5_sv.append('<a class=\"nav-link\" href=\"' + language_data[0].link + '\"><i class=\"' + language_data[0].icon + '\"></i>' + language_data[0].title.sv + '</a>');\r\n navitem1_sv.append('<a class=\"nav-link\" href=\"' + language_data[1].link + '\"><i class=\"' + language_data[1].icon + '\"></i>' + language_data[1].title.sv + '</a>');\r\n navitem2_sv.append('<a class=\"nav-link\" href=\"' + language_data[2].link + '\"><i class=\"' + language_data[2].icon + '\"></i>' + language_data[2].title.sv + '</a>');\r\n navitem3_sv.append('<a class=\"nav-link\" href=\"' + language_data[3].link + '\"><i class=\"' + language_data[3].icon + '\"></i>' + language_data[3].title.sv + '</a>');\r\n navitem4_sv.append('<a class=\"nav-link\" href=\"' + language_data[4].link + '\"><i class=\"' + language_data[4].icon + '\"></i>' + language_data[4].title.sv + '</a>');\r\n\r\n /* Append adds the text stored in language-date (taken from JSON file)and html-code to the navbar item (empty list)*/\r\n navitem5_en.append('<a class=\"nav-link\" href=\"' + language_data[0].link + '\"><i class=\"' + language_data[0].icon + '\"></i>' + language_data[0].title.en + '</a>');\r\n navitem1_en.append('<a class=\"nav-link\" href=\"' + language_data[1].link + '\"><i class=\"' + language_data[1].icon + '\"></i>' + language_data[1].title.en + '</a>');\r\n navitem2_en.append('<a class=\"nav-link\" href=\"' + language_data[2].link + '\"><i class=\"' + language_data[2].icon + '\"></i>' + language_data[2].title.en + '</a>');\r\n navitem3_en.append('<a class=\"nav-link\" href=\"' + language_data[3].link + '\"><i class=\"' + language_data[3].icon + '\"></i>' + language_data[3].title.en + '</a>');\r\n navitem4_en.append('<a class=\"nav-link\" href=\"' + language_data[4].link + '\"><i class=\"' + language_data[4].icon + '\"></i>' + language_data[4].title.en + '</a>');\r\n\r\n /* Adds the navitems to the unsorted list*/\r\n ul_sv.append(navitem5_sv);\r\n ul_sv.append(navitem1_sv);\r\n ul_sv.append(navitem2_sv);\r\n ul_sv.append(navitem3_sv);\r\n ul_sv.append(navitem4_sv);\r\n\r\n ul_en.append(navitem5_en);\r\n ul_en.append(navitem1_en);\r\n ul_en.append(navitem2_en);\r\n ul_en.append(navitem3_en);\r\n ul_en.append(navitem4_en);\r\n\r\n /*Adds the unsorted list that stores the sorted list to the navbar*/\r\n $(document.getElementById('navbarNavDropdown')).append(ul_sv);\r\n $(document.getElementById('navbarNavDropdown')).append(ul_en);\r\n\r\n /*The English are hidden (until English flag is clicked on)*/\r\n ul_en.hide();\r\n\r\n /* When the Swedish flag is clicked on, the Swedish is shown and the English is hidden*/\r\n $('.svflag').click(function () {\r\n ul_sv.show();\r\n ul_en.hide();\r\n });\r\n /* When the English flag is clicked on, the English is shown and Swedish is hidden*/\r\n $('.ukflag').click(function () {\r\n ul_sv.hide();\r\n ul_en.show();\r\n });\r\n\r\n /* Attach click eventlistener on the whole UL since it's more effective to use event delegation \r\n rather than attaching event on every single LI item\r\n */\r\n ul_sv.click(function (event) {\r\n let target = event.target;\r\n\r\n /* Since we have an icon inside an a-tag we need to be sure that we can access the link because\r\n because it's cruical since the link is what we are going to use as a reference to distinguish\r\n between the a-tags that we are going to set as active\r\n */\r\n if (target.tagName == 'I') {\r\n target = target.parentElement;\r\n }\r\n\r\n /* If the item that we are clicking on is an a-tag, only then should we perform this action, since we don't \r\n want other obscure and unpredictable actions to be performed on wrong elements \r\n */\r\n if (target.tagName == 'A') {\r\n const targetUrl = target.pathname;\r\n\r\n /* Since we are clicking somewhere inside the UL we should look for all the a-tags and to \r\n safe than sorry, so we simply remove all the tags on every single one \r\n */\r\n $(this).find('a').removeClass('active');\r\n /* Also remove the active class on all the items in the english version just to be safe */\r\n $(ul_en).find('a').removeClass('active')\r\n\r\n /* Set the current element we clicked with the class active to indicate.. obviously that it's definately is active...\r\n Based on url that lies within the a-tag and that we extracted to the variable \"targetUrl\". We use \"targetUrl\" to find the corresponding\r\n item in the english version of the navbar and set it to active so we can toggle back and forth between english and swedish.\r\n */\r\n $(target).addClass('active');\r\n $(ul_en).find('a[href=\"' + targetUrl + '\"]').addClass('active');\r\n\r\n }\r\n })\r\n\r\n ul_en.click(function (event) {\r\n let target = event.target;\r\n if (target.tagName == 'I') {\r\n target = target.parentElement;\r\n }\r\n\r\n if (target.tagName == 'A') {\r\n const targetUrl = target.pathname;\r\n $(this).find('a').removeClass('active');\r\n $(ul_sv).find('a').removeClass('active')\r\n $(target).addClass('active');\r\n $(ul_sv).find('a[href=\"' + targetUrl + '\"]').addClass('active');\r\n }\r\n })\r\n\r\n /* Initially set the state in the navbar based on the location.pathname by querying the links in swedish and english ULs\r\n and set the class active.\r\n */\r\n $(ul_sv).find('a[href=\"' + location.pathname + '\"]').addClass('active');\r\n $(ul_en).find('a[href=\"' + location.pathname + '\"]').addClass('active');\r\n}", "function initNavbarToggle() {\n $('.navbar-toggle').on('click', function(e) {\n e.preventDefault();\n $('body').toggleClass('nav-active');\n\n });\n}", "function Navbar() {\n return (\n \n<nav className=\"navbar navbar-expand-lg navbar-light \">\n <div className=\"container-fluid divdata ft_face1\">\n <button className=\"navbar-toggler\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#navbarTogglerDemo01\" aria-controls=\"navbarTogglerDemo01\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n <span className=\"navbar-toggler-icon\"></span>\n </button>\n <a className=\"navbar-brand\" href=\"#\" style={{color:'indigo',fontSize:'20px',fontWeight:'400'}}><i class=\"fab fa-google\"></i> Let's Gok</a>\n \n <div className=\"collapse navbar-collapse data1\" id=\"navbarTogglerDemo01\">\n \n <ul className=\"navbar-nav me-auto mb-2 mb-lg-0\">\n <li className=\"nav-item\">\n <a className=\"nav-link active\" aria-current=\"page\" href=\"#\">About</a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link active\" href=\"#\">Blog</a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link active\" href=\"#\">career</a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link active\" href=\"#\">ContactUs</a>\n </li>\n </ul>\n \n </div>\n </div>\n</nav>\n\n\n )\n}", "function searchNavbar() {\r\n $('body').on('click', '.search-link', function(event) {\r\n $('.search-screen').fadeIn(500);\r\n $('.page').addClass('blur');\r\n $('body').addClass('overflow-hidden');\r\n });\r\n\r\n $('body').on('click', '.search-close', function(event) {\r\n $('.search-screen').fadeOut(500, function() {\r\n $('body').removeClass('overflow-hidden');\r\n });\r\n $('.page').removeClass('blur');\r\n });\r\n $('body').on('click', '.open-search', function(event) {\r\n $('.main-search').toggle(100);\r\n $('.open-search').find('.fa-times').toggleClass('hide');\r\n $('.open-search').find('.fa-search').toggleClass('hide');\r\n return false;\r\n });\r\n }", "function dropdownNav() {\n\n\tvar productsLinks = [\"Lorem\", \"Ipsum\", \"Radish\"];\n\tvar servicesLinks = [\"Dolor\", \"Volutpat\", \"Harvesting\"];\n\n\t//create drop-down container\n\tvar dropDown = $(\"<ul></ul>\").prop(\"class\", \"drop\");\n\t$(\".drop-down a\").append(dropDown);\n\n\t//add products links\n\tfor (var i = 0; i<productsLinks.length; i++) {\n\t\t$(\".drop-down:eq(0) a ul\").append(\"<li><a href='#'>\" + productsLinks[i] + \"</li></a>\");\n\t}\n\n\t//add services links\n\tfor (var i = 0; i<servicesLinks.length; i++) {\n\t\t$(\".drop-down:eq(1) a ul\").append(\"<li><a href='#'>\" + servicesLinks[i] + \"</li></a>\");\n\t}\n\n\t//hover unhides products menu\n\t$(\".drop-down\").hover(function() {\n\t\t$(this).find(\".drop\").show();\n\t}, function() {\n\t\t$(this).find(\".drop\").hide();\n\t});\n}", "_initNavbarClickHandler() {\n this._navbar = document.getElementById('navbar');\n\n this._navbar.addEventListener('click', (ev) => {\n ev.preventDefault();\n if (ev.target.tagName === 'A') {\n this._clearNavbarSelectedItems(this._navbar);\n\n const item = ev.target;\n const sectionName = item.getAttribute('data-section');\n if (sectionName) {\n const sectionElem = document.querySelector(`section[data-name=\"${sectionName}\"]`);\n if (sectionElem) {\n sectionElem.scrollIntoView();\n } else {\n document.vody.scrollIntoView();\n }\n }\n item.parentNode.classList.add('active');\n }\n }, true);\n }", "function _initNavbarDropEffect() {\n var self = this;\n var $navbars = $('.nk-navbar-side, .nk-navbar-full');\n\n // add perspective\n $navbars.find('.nk-nav:eq(0)').css({\n perspective: '600px',\n perspectiveOrigin: 'center top'\n });\n\n // add back item for dropdowns\n $navbars.find('.dropdown').prepend('<li class=\"bropdown-back\"><a href=\"#\">' + self.options.templates.secondaryNavbarBackItem + '</a></li>');\n\n // change height of opened dropdown\n function updateSideNavDropdown($item) {\n var $nav = $item.parents('.nk-navbar:eq(0)');\n var $khNav = $nav.find('.nk-nav');\n var $drop = $nav.find('.nk-drop-item.open > .dropdown:not(.closed)');\n var $nano = $item.parents('.nano:eq(0)');\n var $nanoCont = $nano.children('.nano-content');\n var $rows = $item.parents('.nk-nav-row:eq(0)').siblings('.nk-nav-row');\n if ($drop.length) {\n var dropHeight = $drop.innerHeight();\n\n // vertical center for dropdown\n if ($nav.hasClass('nk-navbar-align-center')) {\n (function () {\n $drop.css({\n top: 0\n });\n\n var nanoHeight = $nano.innerHeight();\n var nanoNavRowHeight = nanoHeight;\n var nanoTop = $nano.offset().top;\n var dropTop = $drop.offset().top;\n\n // remove additional rows size\n if ($rows.length) {\n $rows.each(function () {\n nanoNavRowHeight = nanoNavRowHeight - $(this).innerHeight();\n });\n }\n\n if (dropHeight < nanoNavRowHeight) {\n var top = nanoTop - dropTop - $nanoCont.scrollTop();\n top += (nanoHeight - dropHeight) / 2;\n\n $drop.css({\n top: top\n });\n }\n })();\n }\n\n $khNav.css('height', dropHeight);\n self.initPluginNano($nav);\n\n // scroll to top\n tween.to($nanoCont, 0.3, {\n scrollTo: { y: 0 },\n delay: 0.2\n });\n } else {\n $khNav.css('height', '');\n }\n self.initPluginNano($nav);\n }\n\n // open / close submenu\n function toggleSubmenu(open, $drop) {\n var $newItems = $drop.find('> .dropdown > li > a');\n var $oldItems = $drop.parent().find('> li > a');\n\n if (open) {\n $drop.addClass('open').parent().addClass('closed');\n } else {\n $drop.removeClass('open').parent().removeClass('closed');\n\n var tmp = $newItems;\n $newItems = $oldItems;\n $oldItems = tmp;\n }\n\n // show items\n tween.set($newItems, {\n x: open ? '30%' : '-30%',\n rotationY: open ? '30deg' : '-30deg',\n opacity: 0,\n display: 'block'\n }, 0.1);\n tween.to($newItems, 0.3, {\n x: '0%',\n rotationY: '0deg',\n opacity: 1,\n delay: 0.1\n });\n\n // hide items\n tween.to($oldItems, 0.3, {\n x: open ? '-30%' : '30%',\n rotationY: open ? '-30deg' : '30deg',\n opacity: 0,\n onComplete: function onComplete() {\n $oldItems.css('display', 'none');\n }\n });\n }\n\n $navbars.on('click', '.nk-drop-item > a', function (e) {\n toggleSubmenu(true, $(this).parent());\n updateSideNavDropdown($(this));\n e.preventDefault();\n });\n $navbars.on('click', '.bropdown-back > a', function (e) {\n toggleSubmenu(false, $(this).parent().parent().parent());\n updateSideNavDropdown($(this));\n e.preventDefault();\n });\n}", "function navControl() {\n\n if(burger.classList.contains('burger--active')) {\n nav.classList.remove('nav_open');\n burger.classList.remove('burger--active');\n $('#menuBlockOut').addClass('hidden');\n } \n else {\n burger.classList.add('burger--active');\n nav.classList.add('nav_open');\n $('#menuBlockOut').removeClass('hidden');\n }\n }", "function toggleNavBar () {\n $('#navigatorbar').toggleClass('show');\n $('.sub-nav').toggleClass('show');\n $('#thumbnail').removeClass('active');\n }", "function ActivateSideNav() {\n $('.button-collapse').sideNav();\n }", "function navbarCollapse() {\n if ($(window).width() < 992) {\n $(document).on('click', function (event) {\n var clickover = $(event.target);\n var _opened = $(\"#navbar-collapse\").hasClass(\"in\");\n if (_opened === true && !(clickover.is('.dropdown'))) {\n $(\"button.navbar-toggle\").trigger('click');\n }\n });\n\n $('.dropdown').unbind('click');\n $('.dropdown').on('click', function () {\n $(this).children('.dropdown-menu').slideToggle();\n });\n\n $('.dropdown *').on('click', function (e) {\n e.stopPropagation();\n });\n }\n }", "function dropDown() {\n document.getElementById(\"myTopnav\").classList.toggle(\"show\");\n }", "function dropDownMenus() {\n\t\t\t/**\n\t\t\t * Toggle the dropdown menus when hovering \n\t\t\t * over the menu items whilst not in a mobile \n\t\t\t * view.\n\t\t\t */\n\t\t\t$( '.site-navigation-item' ).hover( function() {\n\t\t\t\t/**\n\t\t\t\t * On hover hide all the dropdowns but \n\t\t\t\t * show the one for the current item\n\t\t\t\t */\n\t\t\t\tif( !mobileView ) {\n\t\t\t\t\t$( '.top-level-nav-link' ).addClass( 'dimmed-nav-item' ).removeClass( 'active-sub-nav' ); // Dim all top level nav items\n\t\t\t\t\t$( '.fa-caret-up' ).removeClass( 'fa-caret-up' ).addClass( 'fa-caret-down' ); // Point all the nav arrows down\n\t\t\t\t\t$(this).find( '.sub-nav' ).slideDown(); // Show the current dropdown menu\n\t\t\t\t\t$(this).find( '.fa-caret-down' ).removeClass( 'fa-caret-down' ).addClass( 'fa-caret-up' ); // Change the current nav arrow to down\n\t\t\t\t\t$(this).find( '.top-level-nav-link' ).removeClass( 'dimmed-nav-item' ).addClass( 'active-sub-nav' ); // Make sure the current nav item isn't dimmed\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}, function() {\n\t\t\t\t/**\n\t\t\t\t * On hover off the hide all sub navs and \n\t\t\t\t * return everything to their default states\n\t\t\t\t */\n\t\t\t\tif(!mobileView) {\n\t\t\t\t\t$( '.sub-nav' ).hide();\n\t\t\t\t\t$( '.top-level-nav-link' ).removeClass( 'dimmed-nav-item' ).removeClass( 'active-sub-nav' ); // Turn all the nav items into their default state\n\t\t\t\t\t$( '.fa-caret-up' ).removeClass( 'fa-caret-up' ).addClass( 'fa-caret-down' ); // Change all the nav arrows back to down\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 * Toggle the top level mobile dropdown menu when \n\t\t\t * the menu icon is clicked\n\t\t\t */\n\t\t\t$( '#mobile-nav-icon' ).click( function() {\n\t\t\t\t$( '.fa-caret-up' ).removeClass( 'fa-caret-up' ).addClass( 'fa-caret-down' ); // Change all the nav arrows to down\n\t\t\t\t\n\t\t\t\tif( $( '#mobile-nav-dropdown' ).is( ':visible' ) ) {\n\t\t\t\t\t$( '#mobile-nav-dropdown' ).slideUp(); // Hide the top level nav\n\t\t\t\t\t$( '.sub-nav' ).slideUp(); // Hide the sub menu\n\t\t\t\t} else {\n\t\t\t\t\t$( '#mobile-nav-dropdown' ).slideDown(); // Show the top level nav\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t/**\n\t\t\t * Toggle the submenus on a mobile layout when the nav items are clicked\n\t\t\t */\n\t\t\t$( '.top-level-nav-link' ).click( function() {\n\t\t\t\t$( '.fa-caret-up' ).removeClass( 'fa-caret-up' ).addClass( 'fa-caret-down' ); // Change all the nav arrows to down\n\t\t\t\t\n\t\t\t\tif( mobileView && $( this ).siblings( '.sub-nav' ).is( ':visible' ) ) {\n\t\t\t\t\t$( '.sub-nav' ).slideUp(); // Hide all the sub navs\n\t\t\t\t} else if( mobileView ) {\n\t\t\t\t\t$( '.sub-nav' ).slideUp(); // Hide all the sub navs\n\t\t\t\t\t$( this ).siblings( '.sub-nav' ).slideDown(); // Show the current sub nav\n\t\t\t\t\t$( this ).find( '.fa-caret-down' ).removeClass( 'fa-caret-down' ).addClass( 'fa-caret-up' ); // Change the current nav arrow to down\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t/**\n\t\t\t * If there is a click anywhere outside the \n\t\t\t * visible dropdown nav then hide the navigation\n\t\t\t */\n\t\t\t$( document ).on( 'click', function( event ) {\n\t\t\t\tif( !$( event.target ).closest( '#site-navigation-items' ).length && mobileView ) {\n\t\t\t\t\t$( '#mobile-nav-dropdown' ).slideUp(); // Hide the main nav\n\t\t\t\t\t$( '.sub-nav' ).slideUp(); // Hide the sub nav\n\t\t\t\t\t$( '.fa-caret-up' ).removeClass( 'fa-caret-up' ).addClass( 'fa-caret-down' ); // Point all the nav arrows down\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function openNavbar() {\r\n navbarIconMenu.classList.add('navbar-close');\r\n navbarIconMenu.classList.remove('navbar-open');\r\n document.querySelector('.menu-icon-open').remove();\r\n navbarIconMenu.innerHTML = variables.menuIconClose;\r\n navbarMenu.style.bottom = '0';\r\n // if (smallPhoneMax.matches) {\r\n // navbarMenu.style.top = '60px';\r\n // } else if (phabletMax.matches) {\r\n // navbarMenu.style.top = '72px';\r\n // } else if (laptopMax.matches) {\r\n // navbarMenu.style.top = '84px';\r\n // } else if (desktopMin.matches) {\r\n // navbarMenu.style.top = '96px';\r\n // }\r\n }", "function AgregarMenu() {\n var menu = document.getElementById(\"Menu\");\n menu.innerHTML = '<header>'+\n '<nav class=\"navbar navbar-expand-lg navbar-dark ftco_navbar bg-dark ftco-navbar-light site-navbar-target\" id=\"ftco-navbar\">'+\n\t '<div class=\"container\">'+\n\t '<a class=\"navbar-brand\" href=\"../Assitriage\">AssisTriage</a>'+\n\t '<button class=\"navbar-toggler js-fh5co-nav-toggle fh5co-nav-toggle\" type=\"button\" data-toggle=\"collapse\" data-target=\"#ftco-nav\" aria-controls=\"ftco-nav\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">'+\n\t '<span class=\"oi oi-menu\"></span> Menú </button>'+\n\t '<div class=\"collapse navbar-collapse\" id=\"ftco-nav\">'+\n\t '<ul class=\"navbar-nav nav ml-auto\">'+\n\t '<li class=\"nav-item cta mr-md-2\"><a class=\"nav-link\" data-toggle=\"modal\" data-target=\"#Login\">Iniciar Sesión</a></li>'+\n '<li class=\"nav-item cta mr-md-2\"><a href=\"../Assitriage/views/Registro.html\" class=\"nav-link\">Registro</a></li>'+\n\t '</ul>'+\n '</div>'+\n\t '</nav></header>';\n}", "function displayHeader(){\r\n\r\n var headerContent = '<nav class=\"navbar navbar-inverse navbar-fixed-top \">'\r\n headerContent += ' <div class=\"container\">'\r\n headerContent += ' <div class=\"navbar-header\"></div>'\r\n headerContent += ' <div id=\"navbar\" class=\"navbar-collapse collapse\"></div> <!--/.navbar -->'\r\n headerContent += ' <ul class=\"list-unstyled\">'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/index.html\"><strong>HOME</strong></a></li> '\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/functions.html\">FUNCTIONS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/primeNumGen.html\">CONTROL FLOW</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/debug.html\">DEGUB CODE</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/DOM.html\">DOM/DHTML</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/forms.html\">FORMS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/objects.html\"> OBJECTS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP8</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP9</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP10</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP11</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP12</a></li></ul>'\r\n headerContent += ' </div>'\r\n headerContent += '</nav>'\r\n headerContent += '<!-- Main jumbotron -->'\r\n headerContent += ' <div class=\"jumbotron\">'\r\n headerContent += ' <div class=\"container\">'\r\n headerContent += ' <h2><span class=\"glyphicon glyphicon-king\" aria-hidden=\"true\"></span> Tyler Hunt\\'s <code>CS-2513 JavaScript Website</code> </h2>'\r\n headerContent += ' </div>'\r\n headerContent += ' </div>'\r\n headerContent += ' <!-- Main jumbotron -->'\r\n\r\n var pageHeader = document.getElementsByTagName('header');\r\n pageHeader[0].innerHTML = headerContent;\r\n}", "getNavbar() {\n const navbar = document.querySelectorAll(\".c-navbar\");\n\n navbar.forEach((element) => {\n //this.addTriggers(element)\n })\n }", "render() {\n let userName = (\n <div>\n <Button className=\"AccountItself\">\n <DropdownToggle nav caret className=\"WritingInsideAccountItself\">\n <i class=\"fa fa-user-secret\"></i>\n {this.props.data_be.data_be.name}\n </DropdownToggle>\n </Button>\n </div>\n );\n return (\n <Navbar className=\"NavBar\" sticky=\"top\" expand=\"md\">\n <div className=\"container\">\n <NavbarBrand className=\"mr-auto\" href=\"/\">\n <img\n src=\"https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSBmnPgQKW4JLrNcSFhPFCLHz3t8kT1pZl0PVkLYsa8FoScWYda\"\n height=\"65px\"\n width=\"200px\"\n alt=\"\"\n />\n </NavbarBrand>\n <NavbarToggler\n className=\"NavBarToggle\"\n onClick={this.state.toggleNav}\n >\n ☰\n </NavbarToggler>\n\n <Collapse isOpen={this.state.isNavOpen} navbar>\n <Nav navbar className=\"ml-auto\">\n <NavItem>\n <NavLink className=\"nav-link\" to=\"/premium\">\n Premium\n </NavLink>\n </NavItem>\n <NavItem>\n <NavLink className=\"nav-link\" to=\"/help\">\n Help\n </NavLink>\n </NavItem>\n <NavItem>\n <NavLink className=\"nav-link\" to=\"/\">\n Download\n </NavLink>\n </NavItem>\n <NavItem className=\"nav-link\" id=\"NavSlash\">\n |\n </NavItem>\n {this.props.isSignedIn.isSignedIn == null && (\n <NavItem>\n <NavLink className=\"nav-link\" to=\"/signup\">\n Sign up\n </NavLink>\n </NavItem>)\n }\n {this.props.isSignedIn.isSignedIn == null && (\n <NavItem>\n <NavLink className=\"nav-link\" to=\"/signin\">\n Log In\n </NavLink>\n </NavItem>)\n }\n <NavItem>\n {this.props.isSignedIn.isSignedIn != null && (\n <UncontrolledDropdown nav inNavbar>\n {userName}\n <DropdownMenu className=\"StaticNav\" right>\n <DropdownItem className=\"StaticNavChildContainer\">\n <NavLink\n className=\"StaticNavChild\"\n to=\"/account/overview\">\n Account\n </NavLink>\n </DropdownItem>\n <DropdownItem className=\"StaticNavChildContainer\">\n <Button\n onClick={() => { this.handleLogout() }}\n className=\"StaticNavChild\">\n Log out\n </Button>\n </DropdownItem>\n </DropdownMenu>\n </UncontrolledDropdown>)\n }\n </NavItem>\n </Nav>\n </Collapse>\n </div>\n </Navbar>\n );\n }", "function showNav() {\n\t\tnav.classList.remove('inActiveNav');\n\t\theader.classList.remove('inActiveNav');\n\t\tnav.classList.add('activeNav');\n\t\theader.classList.add('activeNav');\n\t}", "render() {\n // Display landing page navbar if user not logged in.\n if (!localStorage.getItem('isAuthenticated')) {\n return (\n <nav className=\"navbar\">\n <a className=\"navbar-brand brand-log\" href=\"/\">hello\n <b style={{ color: 'tomato' }}>books</b>\n </a>\n </nav>\n );\n }\n\n // Set navbar dropdown values eg. user and isAdmin/admin only links(if necessary)\n const { dropdownOpen } = this.state;\n const role = localStorage.getItem('hb_user_role');\n const user = localStorage.getItem('user');\n const isAdmin = role === 'admin';\n\n return (\n <nav className=\"navbar fixed-top\">\n <a className=\"navbar-brand brand-main\" href=\"/home\">\n hello\n <b style={{ color: 'white' }}>\n books\n </b>\n </a>\n\n <Dropdown isOpen={dropdownOpen} toggle={this.toggle}>\n <DropdownToggle caret>\n <span className=\"user-id-nav\">{user}</span> <i className=\"fa fa-user-circle-o\" />\n </DropdownToggle>\n <DropdownMenu>\n <DropdownItem id=\"prof-btn\"><Link to=\"/profile\"><i className=\"fa fa-user\" />Profile</Link></DropdownItem>\n <DropdownItem id=\"history\"><Link to=\"/borrow-history\"><i className=\"fa fa-history\" />History</Link></DropdownItem>\n {/* Displayed only if user logged in with admin account */}\n <div hidden={!isAdmin}>\n <DropdownItem divider />\n <DropdownItem header>Admin</DropdownItem>\n <DropdownItem id=\"add-book\"><Link to=\"/add-book\"><i className=\"fa fa-plus\" />Add Book</Link></DropdownItem>\n <DropdownItem id=\"members\"><Link to=\"/all-members\"><i className=\"fa fa-users\" />Members&apos; List</Link></DropdownItem>\n <DropdownItem id=\"logs\"><Link to=\"/action-logs\"><i className=\"fa fa-th\" />Logs</Link></DropdownItem>\n </div>\n <DropdownItem divider />\n <DropdownItem onClick={this.handleLogOut}><i className=\"fa fa-power-off\" />Logout</DropdownItem>\n\n </DropdownMenu>\n </Dropdown>\n </nav>\n );\n }", "extendNav(){\n const navbar = document.getElementById(\"navbar\");\n navbar.classList.add(\"extend_nav\");\n\n const openContainer = document.getElementById(\"open_nav_list_container\");\n openContainer.style.display = \"flex\";\n\n //call function to dim screen\n\n this.dimScreen(\"dim\");\n\n //call all animation functions to open navbar\n this.animateElements(\"in\");\n this.animateClosedNav();\n }", "render() {\r\n return (\r\n <div>\r\n\r\n <ul id=\"dropdown1\" className=\"dropdown-content\">\r\n <li>\r\n <NavLink\r\n className={\"dropdown-link\", \"black-text\"}\r\n to=\"/reklamation-og-returregler\"\r\n activeClassName=\"active\">Reklamation og Returregler\r\n </NavLink>\r\n </li>\r\n <li>\r\n <NavLink\r\n className={\"dropdown-link\", \"black-text\"}\r\n to=\"/om-os\"\r\n activeClassName=\"active\">Om os\r\n </NavLink>\r\n </li>\r\n <li className=\"divider\"></li>\r\n <li><a className=\"black-text disabled\" href=\"#!\">Medarbejder</a></li>\r\n </ul>\r\n\r\n <div className=\"\">\r\n <nav className=\"z-depth-0 nav-extended\">\r\n <div className=\"nav-wrapper\">\r\n\r\n <NavLink to={'/'} className=\"brand-logo\" activeClassName=\"active\">Bike Shop</NavLink>\r\n <a href=\"#\" data-activates=\"slide-out\" className=\"button-collapse\"><i className=\"material-icons\">menu</i></a>\r\n\r\n <ul className=\"navlinks right hide-on-med-and-down\">\r\n <li>\r\n <NavLink exact\r\n key=\"home\"\r\n to=\"/\"\r\n activeStyle={{opacity: 0.65, color: 'white'}}\r\n activeClassName=\"active\">FORSIDE\r\n </NavLink>\r\n </li>\r\n\r\n <li>\r\n <NavLink\r\n\r\n key=\"brands\"\r\n to=\"/maerker\"\r\n activeStyle={{opacity: 0.65, color: 'white'}}\r\n activeClassName=\"active\">MÆRKER\r\n </NavLink>\r\n </li>\r\n\r\n <li>\r\n <NavLink\r\n\r\n key=\"workshop\"\r\n to=\"/vaerksted-og-priser\"\r\n activeStyle={{ opacity: 0.65, color: 'white'}}\r\n activeClassName=\"active\">VÆRKSTED OG PRISER\r\n </NavLink>\r\n </li>\r\n\r\n <li>\r\n <NavLink\r\n\r\n key=\"contact\"\r\n to=\"/kontakt\"\r\n activeStyle={{ opacity: 0.65, color: 'white'}}\r\n activeClassName=\"active\">KONTAKT\r\n </NavLink>\r\n </li>\r\n\r\n <li>\r\n <a className=\"dropdown-button\" data-activates='dropdown1'>MERE<i className=\"material-icons right\">arrow_drop_down</i></a>\r\n </li>\r\n </ul>\r\n\r\n <SideNav/>\r\n </div>\r\n </nav>\r\n </div>\r\n </div>\r\n\r\n );\r\n }", "function initNavbar() {\n\n \t\tvar distanceY = window.pageYOffset || document.documentElement.scrollTop,\n \t\t\tshrinkOn = 1,\n \t\t\theader = document.querySelector(\"header\");\n \t\t//expandNav = document.querySelector(\"#header-wrap .header\");\n \t\tif (distanceY > shrinkOn) {\n \t\t\tclassie.add(header, \"smaller\");\n \t\t\t//classie.add(expandNav, \"expandedNav\");\n \t\t} else {\n \t\t\tif (classie.has(header, \"smaller\")) {\n \t\t\t\tclassie.remove(header, \"smaller\");\n \t\t\t\t//classie.remove(expandNav, \"expandedNav\");\n \t\t\t}\n \t\t}\n\n \t}", "function displaySignedIn(){\n\temail = localStorage[\"email\"];\n\tdropDownMeta = \"<button class=\\\"btn btn-success dropdown-toggle\\\" type=\\\"\\\" id=\\\"dropdownMenu1\\\" data-toggle=\\\"dropdown\\\" aria-expanded=\\\"false\\\">\";\n\tdropDownTitle = email;\n\tdropDownEndMeta = \"<span class=\\\"caret\\\"></span></button>\";\n\tdropDownMenu = \"<ul class=\\\"dropdown-menu\\\" role=\\\"menu\\\" aria-labelledby=\\\"dropdownMenu1\\\">\";\n\tdropDownItem1 = \"<li role=\\\"presentation\\\"><a id=\\\"changepassword\\\" role=\\\"menuitem\\\" tabindex=\\\"-1\\\" href=\\\"#\\\">Change Password</a></li>\";\n\tdropDownItem2 = \"<li role=\\\"presentation\\\"><a id=\\\"signedindropdown\\\" role=\\\"menuitem\\\" tabindex=\\\"-1\\\" href=\\\"#\\\">Sign Out</a></li>\";\n\tdropDownEndMenu = \"</ul>\";\n\tsignedInDropDown = \"<div class=\\\"dropdown\\\">\"+dropDownMeta+dropDownTitle+dropDownEndMeta+dropDownMenu+dropDownItem1+dropDownItem2+dropDownEndMenu+\"</div>\"; \n\t$(\"#navbar-signedin\").append(signedInDropDown);\n}", "function renderNavBar() {\n\t //if navBar, delete\n\t var oldNav = document.querySelector('.cat-nav-bar');\n\n\t if (oldNav) {\n\t oldNav.parentNode.removeChild(oldNav);\n\t }\n\n\t var newNavBar = createNavBar(cats);\n\n\t catHolderMaster.appendChild(newNavBar);\n\n\t}", "function navButton() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function handleMobileHeaderNavbar() {\n $('.nav-left-item, .nav-right-item').click(function (e) {\n if ($(this).children('.dropdown-menu').hasClass('dropdown-menu-up') && !e.target.closest('.dropdown-menu')) {\n $(this).children('.dropdown-menu').removeClass('dropdown-menu-up');\n } else {\n $('.nav-left-item, .nav-right-item').find('.dropdown-menu-up').removeClass('dropdown-menu-up');\n $(this).children('.dropdown-menu').addClass('dropdown-menu-up');\n }\n })\n\n $(document).click(function (e) {\n if (!e.target.closest('.nav-left-item, .nav-right-item, .dropdown-menu')) {\n $('.nav-left-item, .nav-right-item').find('.dropdown-menu-up').removeClass('dropdown-menu-up');\n }\n })\n\n if (window.matchMedia('(max-width: 768px)').matches) {\n $('.dropdown-menu-sub').slideUp();\n\n $('.dropdown-menu-item').click(function () {\n // $('.dropdown-menu-sub').slideUp(0);\n\n // setTimeout(() => { \n // }, timeout);\n $(this).children('.dropdown-menu-sub').slideToggle(250);\n })\n }\n}", "function initNavBar() {\n // Get the nav list element\n const navbar = document.querySelector(\"#navbar__list\");\n // Get all sections\n const sections = document.querySelectorAll(\"section\");\n // Iterate through sections to build nav\n for (let i = 0; i < sections.length; i++) {\n // function create nav Item => Create Item in navbar\n const navItem = createNavItem(sections[i]);\n navbar.appendChild(navItem);\n }\n }", "function displayHeader(){\r\n\r\n var headerContent = '<nav class=\"navbar navbar-inverse navbar-fixed-top \">'\r\n headerContent += ' <div class=\"container\">'\r\n headerContent += ' <div class=\"navbar-header\"></div>'\r\n headerContent += ' <div id=\"navbar\" class=\"navbar-collapse collapse\"></div> <!--/.navbar -->'\r\n headerContent += ' <ul class=\"list-unstyled\">'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/index.html\"><strong>HOME</strong></a></li> '\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/functions.html\">FUNCTIONS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/primeNumGen.html\">CONTROL FLOW</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/debug.html\">DEGUB CODE</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/DOM.html\">DOM/DHTML</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/forms.html\">FORMS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 07</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 08</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 09</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 10</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 11</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 12</a></li></ul>'\r\n headerContent += ' </div>'\r\n headerContent += '</nav>'\r\n headerContent += '<!-- Main jumbotron -->'\r\n headerContent += ' <div class=\"jumbotron\">'\r\n headerContent += ' <div class=\"container\">'\r\n headerContent += ' <h2><span class=\"glyphicon glyphicon-king\" aria-hidden=\"true\"></span> Tyler Hunt\\'s <code>CS-2513 JavaScript Website</code> </h2>'\r\n headerContent += ' </div>'\r\n headerContent += ' </div>'\r\n headerContent += ' <!-- Main jumbotron -->'\r\n\r\n var pageHeader = document.getElementsByTagName('header');\r\n pageHeader[0].innerHTML = headerContent;\r\n}", "render() {\n let content;\n switch (this.state.page) {\n case 'Home':\n content = <Home />;\n break;\n case 'Snake':\n content = <Board />;\n break;\n case 'Senior':\n content = <Senior />;\n break;\n default:\n content = null;\n break;\n }\n return (\n <div>\n <nav className=\"navbar navbar-expand-md navbar-dark bg-dark fixed-top\">\n <a className=\"navbar-brand\" href=\"#\" onClick={this.setPage} data-id=\"Home\">\n Home\n </a>\n <button\n className=\"navbar-toggler\"\n type=\"button\"\n data-toggle=\"collapse\"\n data-target=\"#navbarsExampleDefault\"\n aria-controls=\"navbarsExampleDefault\"\n aria-expanded=\"false\"\n aria-label=\"Toggle navigation\"\n >\n <span className=\"navbar-toggler-icon\"></span>\n </button>\n\n <div className=\"collapse navbar-collapse\" id=\"navbarsExampleDefault\">\n <ul className=\"navbar-nav mr-auto\">\n <li className=\"nav-item active\">\n <a className=\"nav-link\" href=\"#\" onClick={this.setPage} data-id=\"Senior\">\n Senior Project\n </a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link\" href=\"#\" onClick={this.setPage} data-id=\"Snake\">\n Snake Game\n </a>\n </li>\n <li className=\"nav-item\">\n <a\n className=\"nav-link disabled\"\n href=\"#\"\n tabIndex=\"-1\"\n aria-disabled=\"true\"\n >\n ???\n </a>\n </li>\n <li className=\"nav-item dropdown\">\n <a\n className=\"nav-link dropdown-toggle\"\n href=\"#\"\n id=\"dropdown01\"\n data-toggle=\"dropdown\"\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n >\n Check These Out\n </a>\n <div className=\"dropdown-menu\" aria-labelledby=\"dropdown01\">\n <a className=\"dropdown-item\" href=\"#\">\n Action\n </a>\n <a className=\"dropdown-item\" href=\"#\">\n Another action\n </a>\n <a className=\"dropdown-item\" href=\"#\">\n Something else here\n </a>\n </div>\n </li>\n </ul>\n <form className=\"form-inline my-2 my-lg-0\">\n <input\n className=\"form-control mr-sm-2\"\n type=\"text\"\n placeholder=\"Search\"\n aria-label=\"Search\"\n />\n <button className=\"btn btn-secondary my-2 my-sm-0\" type=\"submit\">\n Search\n </button>\n </form>\n </div>\n </nav>\n {content}\n </div>\n );\n }", "function homeDropdown() {\n\t\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\t}", "function loadNavBar() {\n $('#navBar').load('navBar.html');\n $('#navModal').load('navModal.html');\n}", "function Navbar() {\n\n const [isLoggedIn, setLoggedIn] = useState()\n const [userName, setUserName] = useState()\n\n firebase.auth().onAuthStateChanged(function(user) {\n if (user) {\n console.log(\"NAVBAR \" + user.email)\n // User is signed in.\n setLoggedIn(true)\n setUserName(user.email)\n } else {\n // No user is signed in.\n setLoggedIn(false)\n }\n }\n );\n return ( \n<nav id=\"nav\" className=\"navbar navbar-expand-lg navbar bg-dark\" >\n<img src=\"https://media.tenor.com/images/e19b269522c8b038097086e5703d192b/tenor.gif\" alt=\"This will display an animated GIF\" />\n <Link className=\"navbar-brand\" to=\"/\">AXOLOTL</Link>\n <button className=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarNav\" aria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n <span className=\"navbar-toggler-icon\"></span>\n </button>\n <div className=\"collapse navbar-collapse\" id=\"navbarNav\">\n <ul className=\"navbar-nav\">\n <li className=\"nav-item\">\n <Link\n to=\"/search\"\n className={\n window.location.pathname === \"/Search\" || window.location.pathname === \"/\"\n ? \"nav-link active\"\n : \"nav-link\"\n }\n >\n Search\n </Link>\n </li>\n <li className=\"nav-item\">\n <Link\n to=\"/saved\"\n className={\n window.location.pathname === \"/Saved\" || window.location.pathname === \"/\"\n ? \"nav-link active\"\n : \"nav-link\"\n }\n >\n Saved\n </Link>\n </li>\n </ul>\n <ul className=\"navbar-nav ml-auto\">\n <li className=\"nav-item\">\n {\n isLoggedIn ? (\n <Dropdown>\n <Dropdown.Toggle variant=\"dark\" id=\"dropdown-basic\">\n {userName}\n </Dropdown.Toggle>\n <Dropdown.Menu>\n <Dropdown.Item><Link to=\"/dashboard\" className={window.location.pathname === \"/dashboard\" || window.location.pathname === \"/\" ? \"nav-link\": \"nav-link\"}>Dashboard</Link></Dropdown.Item>\n </Dropdown.Menu>\n </Dropdown>\n )\n :\n (\n <ul className=\"navbar-nav ml-auto\">\n <li className=\"nav-item\">\n <Link to=\"/login\" className={window.location.pathname === \"/login\" || window.location.pathname === \"/\" ? \"nav-link\" : \"nav-link\"}>Login </Link>\n </li>\n <li className=\"nav-item\">\n <Link to=\"/signup\" className={window.location.pathname === \"/signup\" || window.location.pathname === \"/\" ? \"nav-link\" : \"nav-link\"}>Sign Up </Link>\n </li>\n </ul>\n )\n }\n\n </li>\n </ul>\n </div>\n</nav>\n\n )}", "function renderNavbar() {\n const logo = $(\n '<li class=\"nav-item logo\"><button class=\"nav-link\"><span class=\"link-text\">School Tools</span><i class=\"fas fa-bars fa-2x\"></i></button></li>'\n );\n const home = $(\n '<li class=\"nav-item\"><a href=\"/\" id=\"homeLink\" class=\"nav-link\" title=\"Home\"><i class=\"fas fa-home fa-2x\"></i><span class=\"link-text\">Home</span></a></li>\"'\n );\n const prioritizer = $(\n '<li class=\"nav-item\"><a href=\"prioritizer\" id=\"prioritizerLink\" class=\"nav-link\" title=\"Prioritizer\"><i class=\"fas fa-calendar-check fa-2x\"></i><span class=\"link-text\">Prioritizer</span></a></li>\"'\n );\n const calculator = $(\n '<li class=\"nav-item\"><a href=\"calculator\" id=\"calcLink\" class=\"nav-link\" title=\"Calculator\"><i class=\"fas fa-calculator fa-2x\"></i><span class=\"link-text\">Calculator</span></a></li>\"'\n );\n const planner = $(\n '<li class=\"nav-item\"><a href=\"planner\" id=\"plannerLink\" class=\"nav-link\" title=\"Planner\"><i class=\"fas fa-calendar-alt fa-2x\"></i><span class=\"link-text\">Planner</span></a></li>\"'\n );\n const essay = $(\n '<li class=\"nav-item\"><a href=\"writing-counter\" id=\"essayLink\" class=\"nav-link\" title=\"Essay Counter\"><i class=\"fas fa-file fa-2x\"></i><span class=\"link-text\">Essay Counter</span></a></li>\"'\n );\n const theme = $(\n '<li class=\"nav-item\"><a class=\"nav-link\" title=\"Switch Theme\"><i class=\"fas fa-adjust fa-2x\"></i><span class=\"link-text\">Theme</span></a></li>\"'\n );\n const ul = $('<ul class=\"navbar-nav\"></ul>').append(\n logo,\n home,\n prioritizer,\n calculator,\n planner,\n essay,\n theme\n );\n\n return ul;\n}", "function initNavbar() {\n const navbarContainer = document.getElementById('navbar-container');\n navbarContainer.classList.add('sticky-top');\n ReactDOM.render(\n <DataFetcher\n createFetchRequest={() => authDataFetch}\n render={renderNavbar} />,\n navbarContainer);\n}", "static openNav() {\n ElementHandler.setElementCSSById('sidebarMenu', 'width', \"250px\");\n ElementHandler.setElementCSSById('openSidebar', 'width', \"250px\");\n ElementHandler.hideElementById('openSidebar');\n }", "function navBar(){\n\t\t$('.nav-button').click(function(){\n\t\t\t$('.nav-content').toggleClass('nav-hide');\n\t\t});\t\n\t}", "render() {\n const { data } = this.state;\n return (\n\n <BrowserRouter>\n\n <Navbar className=\"navbar\" light expand=\"md\">\n <NavbarBrand className=\"navHeader\" href=\"/\">\n {/* <img className=\"logoHeader\" src={logoBrand} alt=\"Logo\" />\n or */}\n <img className=\"logoHeader\" src={logo} alt=\"Logo\" />\n </NavbarBrand>\n <NavbarToggler onClick={this.toggle} />\n <Collapse isOpen={this.state.isOpen} navbar>\n <Nav className=\"ml-auto\" navbar>\n <NavItem>\n <NavLink className='navLink' href=\"/\">Things</NavLink>\n </NavItem>\n <NavItem>\n <NavLink className='navLink' href=\"/\">Stuff</NavLink>\n </NavItem>\n <NavItem>\n <NavLink className='navLink' href=\"/\">Junk</NavLink>\n </NavItem>\n <UncontrolledDropdown nav inNavbar>\n <DropdownToggle className='navLink' nav caret>\n GAMES\n </DropdownToggle>\n <DropdownMenu className=\"gamesDropDown\">\n <DropdownItem className=\"gamesDropDownItem\">\n <span>\n <img className=\"dotaLogoDropDown\" src={dotaLogo} alt=\"Logo\" />\n </span>\n DOTA 2\n </DropdownItem>\n <DropdownItem className=\"gamesDropDownItem\">\n <span>\n <img className=\"dotaLogoDropDown\" src={leagueLogo} alt=\"Logo\" />\n </span>\n LEAGE OF LEGENDS\n </DropdownItem>\n <DropdownItem className=\"gamesDropDownItem\">\n <span>\n <img className=\"dotaLogoDropDown\" src={overwatchLogo} alt=\"Logo\" />\n </span>\n OVERWATCH\n </DropdownItem>\n <DropdownItem className=\"gamesDropDownItem\">\n <span>\n <img className=\"dotaLogoDropDown\" src={csgoLogo} alt=\"Logo\" />\n </span>\n CS:GO\n </DropdownItem>\n <DropdownItem className=\"gamesDropDownItem\">\n <span>\n <img className=\"dotaLogoDropDown\" src={r6Logo} alt=\"Logo\" />\n </span>\n Rainbow Six Seige\n </DropdownItem>\n <DropdownItem className=\"gamesDropDownItem\">\n <span>\n <img className=\"dotaLogoDropDown\" src={rocketLeagueLogo} alt=\"Logo\" />\n </span>\n ROCKET LEAGUE\n </DropdownItem>\n {/* <DropdownItem divider />\n <DropdownItem className=\"gamesDropDownItem\">\n ALL GAMES\n </DropdownItem> */}\n </DropdownMenu>\n </UncontrolledDropdown>\n <NavItem>\n <Button className='signupBtn' variant=\"outlined\" href=\"signup\">\n Sign Up\n </Button>\n </NavItem>\n\n </Nav>\n </Collapse>\n </Navbar>\n <container>\n <Row className='mainRow'>\n <Col xs=\"12\">\n <UncontrolledCarousel className=\"headerCarousel\" items={items} />\n </Col>\n <Col xs=\"3\">\n <Card className=\"card leftTopSection\">\n <CardHeader className=\"cardHeader slim\">\n Content 001\n </CardHeader>\n <CardBody className=\"cardBody leftSectionCardBody\">\n <ExpansionPanel className=\"leftSectionExpansion\">\n <ExpansionPanelSummary\n expandIcon={<ExpandMoreIcon />}\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\">\n <Typography className=\"big fontBlack\">Expansion Panel 1</Typography>\n </ExpansionPanelSummary>\n <ExpansionPanelDetails>\n <Typography>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex,\n sit amet blandit leo lobortis eget.\n </Typography>\n </ExpansionPanelDetails>\n </ExpansionPanel>\n <ExpansionPanel className=\"leftSectionExpansion\">\n <ExpansionPanelSummary\n expandIcon={<ExpandMoreIcon />}\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\">\n <Typography className=\"big fontBlack\">Expansion Panel 2</Typography>\n </ExpansionPanelSummary>\n <ExpansionPanelDetails>\n <Typography>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex,\n sit amet blandit leo lobortis eget.\n </Typography>\n </ExpansionPanelDetails>\n </ExpansionPanel>\n <ExpansionPanel className=\"leftSectionExpansion\">\n <ExpansionPanelSummary\n expandIcon={<ExpandMoreIcon />}\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\">\n <Typography className=\"big fontBlack\">Expansion Panel 3</Typography>\n </ExpansionPanelSummary>\n <ExpansionPanelDetails>\n <Typography>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex,\n sit amet blandit leo lobortis eget.\n </Typography>\n </ExpansionPanelDetails>\n </ExpansionPanel>\n <ExpansionPanel className=\"leftSectionExpansion\">\n <ExpansionPanelSummary\n expandIcon={<ExpandMoreIcon />}\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\">\n <Typography className=\"big fontBlack\">Expansion Panel 4</Typography>\n </ExpansionPanelSummary>\n <ExpansionPanelDetails>\n <Typography>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex,\n sit amet blandit leo lobortis eget.\n </Typography>\n </ExpansionPanelDetails>\n </ExpansionPanel>\n </CardBody>\n <CardFooter>Footer</CardFooter>\n </Card>\n </Col>\n <Col>\n <Card className=\"card\">\n <CardHeader className=\"cardHeader slim\">\n Content 002\n </CardHeader>\n <CardBody className=\"cardBody\">\n <CardTitle className=\"openSans\">Special Title Treatment</CardTitle>\n <CardText className=\"openSans\">With supporting text below as a natural lead-in to additional content.</CardText>\n <Button className=\"openSans\">Go somewhere</Button>\n </CardBody>\n <CardFooter>Footer</CardFooter>\n </Card>\n <Card className=\"card\">\n <CardHeader className=\"cardHeader slim\">\n Content 003\n </CardHeader>\n <CardBody className=\"cardBody\">\n <CardTitle className=\"openSans\">Special Title Treatment</CardTitle>\n <CardText className=\"openSans\">With supporting text below as a natural lead-in to additional content.</CardText>\n <Button className=\"openSans\">Go somewhere</Button>\n </CardBody>\n <CardFooter>Footer</CardFooter>\n </Card>\n </Col>\n <Col xs=\"3\">\n <Card className=\"card\">\n <CardHeader className=\"cardHeader slim\">\n Your Leagues\n </CardHeader>\n <CardBody className=\"cardBody\">\n <CardTitle className=\"openSans\">Special Title Treatment</CardTitle>\n <CardText className=\"openSans\">With supporting text below as a natural lead-in to additional content.</CardText>\n <Button className=\"openSans\">Go somewhere</Button>\n </CardBody>\n <CardFooter>Footer</CardFooter>\n </Card>\n <Card className=\"card\">\n <CardHeader className=\"cardHeader slim\">\n Your Matches\n </CardHeader>\n <CardBody className=\"cardBody\">\n <CardTitle className=\"openSans\">Special Title Treatment</CardTitle>\n <CardText className=\"openSans\">With supporting text below as a natural lead-in to additional content.</CardText>\n <Button className=\"openSans\">Go somewhere</Button>\n </CardBody>\n <CardFooter>Footer</CardFooter>\n </Card>\n </Col>\n </Row>\n\n\n\n </container>\n <div>\n <br>\n </br>\n <br>\n </br><br>\n </br><br>\n </br><br>\n </br><br>\n </br><br>\n </br><br>\n </br><br>\n </br><br>\n </br><br>\n </br><br>\n </br><br>\n </br>\n <Route exact={true} path='/signin' render={() => (\n <div className=\"App\">\n <createUser />\n </div>\n )} />\n <ul>\n {data.length <= 0\n ? 'NO DB ENTRIES YET'\n : data.map((dat) => (\n <li style={{ padding: '10px' }} key={data.message}>\n <span style={{ color: 'gray' }}> id: </span> {dat.id} <br />\n <span style={{ color: 'gray' }}> data: </span>\n {dat.message}\n </li>\n ))}\n </ul>\n <div style={{ padding: '10px' }}>\n <input\n type=\"text\"\n onChange={(e) => this.setState({ message: e.target.value })}\n placeholder=\"add something in the database\"\n style={{ width: '200px' }}\n />\n <button onClick={() => this.putDataToDB(this.state.message)}>\n ADD\n </button>\n </div>\n <div style={{ padding: '10px' }}>\n <input\n type=\"text\"\n style={{ width: '200px' }}\n onChange={(e) => this.setState({ idToDelete: e.target.value })}\n placeholder=\"put id of item to delete here\"\n />\n <button onClick={() => this.deleteFromDB(this.state.idToDelete)}>\n DELETE\n </button>\n </div>\n <div style={{ padding: '10px' }}>\n <input\n type=\"text\"\n style={{ width: '200px' }}\n onChange={(e) => this.setState({ idToUpdate: e.target.value })}\n placeholder=\"id of item to update here\"\n />\n <input\n type=\"text\"\n style={{ width: '200px' }}\n onChange={(e) => this.setState({ updateToApply: e.target.value })}\n placeholder=\"put new value of the item here\"\n />\n <button\n onClick={() =>\n this.updateDB(this.state.idToUpdate, this.state.updateToApply)\n }\n >\n UPDATE\n </button>\n </div>\n </div>\n </BrowserRouter >\n );\n }", "function ligh() {\n\n // Cleaning and setting a new navbar\n let el = $('#navbar');\n el.html('');\n el.html(` \n <div class=\"nav-container container-fluid\">\n <a class=\"navbar-icon\">Where in the world?</a>\n <span onclick=\"dark()\" class=\"navbar-dark-mode\">\n <i class=\"icon far fa-moon\"></i>Dark Mode\n </span>\n </div>`);\n\n // Changing the color of each element\n var searchback = document.getElementsByClassName('content-search');\n for(var i = 0; i < searchback.length; i++){\n searchback[i].style.backgroundColor = \"hsl(0, 0%, 98%)\";\n }\n\n var elements = document.getElementsByClassName('card'); \n for(var i = 0; i < elements.length; i++){\n elements[i].style.backgroundColor = \"hsl(0, 0%, 100%)\";\n elements[i].style.color = \"black\";\n }\n\n var elements = document.getElementsByClassName('btn');\n for(var i = 0; i < elements.length; i++){\n elements[i].style.backgroundColor = \"hsl(0, 0%, 100%)\";\n elements[i].style.color = \"black\";\n }\n\n var elements = document.getElementsByClassName('btn2');\n for(var i = 0; i < elements.length; i++){\n elements[i].style.backgroundColor = \"hsl(0, 0%, 100%)\";\n elements[i].style.color = \"black\";\n }\n\n var elements = document.getElementsByClassName('dropdown-menu');\n for(var i = 0; i < elements.length; i++){\n elements[i].style.backgroundColor = \"hsl(0, 0%, 100%)\";\n }\n\n var elements = document.getElementsByClassName('dropdown-item');\n for(var i = 0; i < elements.length; i++){\n elements[i].style.backgroundColor = \"hsl(0, 0%, 100%)\";\n elements[i].style.color = \"black\";\n }\n\n var elements = document.getElementsByClassName('searchInfo');\n for(var i = 0; i < elements.length; i++){\n elements[i].style.color = \"black\";\n }\n\n var elements = document.getElementsByClassName('btnCountries'); \n for(var i = 0; i < elements.length; i++){\n elements[i].style.backgroundColor = \"hsl(0, 0%, 100%)\";\n elements[i].style.color = \"black\";\n }\n\n document.body.style.backgroundColor = \"hsl(0, 0%, 98%)\";\n document.getElementById('countrieslist').style.backgroundColor = \"hsl(0, 0%, 98%)\"; \n document.getElementById('content-search').style.backgroundColor = \"hsl(0, 0%, 98%)\"; \n document.getElementById('navbar').style.backgroundColor = \"hsl(0, 0%, 100%)\"; \n document.getElementById('navbar').style.color = \"black\"; \n document.getElementById('country-search').style.backgroundColor = \"hsl(0, 0%, 100%)\"; \n\n }", "render() {\n return (\n <nav className=\"navbar navbarstyle navbar-static-top\">\n <div className=\"navbar-inner\">\n <div className=\"container\">\n <div className=\"navbar-header\">\n <div className=\"navbar-brand\">\n <Link to=\"/\">\n <img alt=\"uGate Icon\" src=\"./images/ugatelogo.png\"/>\n\n uGate &reg;</Link>\n </div>\n </div>\n\n <ul className=\"nav navbar-nav navbar-right\">\n <li>\n\n\n <p className=\"navbar-text\">New to uGate?</p>\n </li>\n <li>\n <Link to=\"/SignUp\">\n <span className=\"glyphicon glyphicon-user\"></span> Sign Up\n </Link>\n </li>\n </ul>\n\n </div>\n </div>\n </nav>\n );\n }", "function _arrangeNavBar() {\n var widthCounter = 0,\n paddingOffset = 26,\n $button,\n $nextButtons,\n $navbar = $(\"#pfsd-navbar\"),\n $navbarButtons = $navbar.children(),\n containerWidth = $(\"#pfsd-navbar-container\").css(\"width\").replace(\"px\", \"\") * 1;\n\n var breakButton = Mustache.render(NavBarButton, {\n currentPath: _currentDir,\n buttonLabel: \">\"\n });\n\n $navbarButtons.each(function () {\n var width = 0;\n if (!$(this).hasClass(\"dropdown-menu\")) { // Prevents wrong width on Windows due to dropdown menu.\n width = ($(this).css(\"width\").replace(\"px\", \"\") * 1) + paddingOffset;\n }\n widthCounter += width;\n if (widthCounter > containerWidth - 40) {\n $nextButtons = $(this).nextAll().detach();\n $button = $(this).detach();\n $navbar.append(breakButton).append(\"</br>\").append($button).append($nextButtons);\n widthCounter = width;\n }\n });\n }", "function Menu () {\r\n return (\r\n <Navbar bg=\"light\" expand=\"lg\">\r\n <Navbar.Brand href=\"#home\">My Profile:</Navbar.Brand>\r\n <Navbar.Toggle aria-controls=\"basic-navbar-nav\" />\r\n <Navbar.Collapse id=\"basic-navbar-nav\">\r\n <Nav className=\"mr-auto\">\r\n <Nav.Link href=\"#home\">Home</Nav.Link>\r\n <Nav.Link href=\"https:www.linkedin.com/in/martinreedsafari\" target=\"_blank\">LinkedIn Profile:</Nav.Link>\r\n <NavDropdown title=\"Dropdown\" id=\"basic-nav-dropdown\">\r\n <NavDropdown.Item href=\"#Connect-div\">Projects:</NavDropdown.Item>\r\n <NavDropdown.Item href=\"#AboutMe-div\">About Me:</NavDropdown.Item>\r\n <NavDropdown.Item href=\"#Education-div\">Education:</NavDropdown.Item>\r\n <NavDropdown.Item href=\"#App-logos\">Skills:</NavDropdown.Item>\r\n </NavDropdown>\r\n </Nav>\r\n <Form inline>\r\n <FormControl type=\"text\" placeholder=\"Search\" className=\"mr-sm-2\" />\r\n <Button variant=\"outline-success\">Search</Button>\r\n </Form>\r\n </Navbar.Collapse>\r\n </Navbar>\r\n );\r\n}", "function updateNavbar(path) {\n const navbarIdSuffix = '_navbar'\n const subnavbarIdSuffix = '_subnavbar'\n\n let splitPath = path.split('.')\n\n $('[id*=\"navbar\"]').removeClass('active')\n\n if (path === '') {\n $('#wpaudit_navbar').addClass('active')\n } else if (splitPath[0] === 'services') {\n const service = splitPath[1]\n let element = $('#' + service + subnavbarIdSuffix)\n while (element.length > 0 && (!element.attr('id') || !element.attr('id').endsWith(navbarIdSuffix))) {\n element = element.parent()\n }\n\n if (element.length > 0) {\n element.addClass('active')\n }\n } else if (splitPath[0] === 'service_groups' && splitPath.length >= 2) {\n const group = splitPath[1]\n $('#' + group + navbarIdSuffix).addClass('active')\n }\n\n $('[id*=\"navbar\"]').show()\n}", "function open () {\n\t\tdocument.querySelector (\"#navbar\").className = \"container-fluid\";\n\t\tdocument.querySelector (\"#homeBtn\").onclick = close;\n\t}", "function CreateMenu() {\n var strMenu;\n strMenu = '<nav class=\"navbar navbar-expand-lg\">\\n'\n strMenu += '<button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\".navbar-collapse\" aria-controls=\"navbarText\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\\n'\n strMenu += ' <span class=\"navbar-toggler-icon\"></span>\\n'\n strMenu += '</button>\\n'\n strMenu += '<div class=\"collapse navbar-collapse\" id=\"navbarNav\">\\n'\n strMenu += ' <ul class=\"navbar-nav\">\\n'\n strMenu += '\t <li class=\"nav-item\"><a class=\"nav-link\" id=\"l_Index\" href=\"index.html\">Welcome</a></li>\\n'\n strMenu += '\t <li class=\"nav-item dropdown\">\\n'\n strMenu += '\t\t <a class=\"nav-link dropdown-toggle\" id=\"HomeDropdownMenuLink\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Club Information</a>\\n'\n strMenu += '\t\t <div class=\"dropdown-menu\" aria-labelledby=\"HomeDropdownMenuLink\">\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_history\" href=\"history.htm\">Club history</a>\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_location\" href=\"location.htm\">Location</a>\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_schedule\" href=\"schedule.htm\">Schedule</a>\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_faq\" href=\"faq.htm\">FAQ </a>\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_rules\" href=\"rules.htm\">Range safety</a>\\n'\n strMenu += '\t\t </div>\\n'\n strMenu += '\t </li>\\n'\n strMenu += '\t <li class=\"nav-item dropdown\">\\n'\n strMenu += '\t\t <a class=\"nav-link dropdown-toggle\" id=\"MembershipDropdownMenuLink\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Membership</a>\\n'\n strMenu += '\t\t <div class=\"dropdown-menu\" aria-labelledby=\"MembershipDropdownMenuLink\">\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_membership\" href=\"membership.htm\">Info</a>\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_forms\" href=\"forms.htm\">Forms</a>\\n'\n strMenu += '\t\t </div>\\n'\n strMenu += '\t </li>\\n'\n strMenu += '\t <li class=\"nav-item dropdown\">\\n'\n strMenu += '\t\t <a class=\"nav-link dropdown-toggle\" id=\"MembershipDropdownMenuLink\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Links</a>\\n'\n strMenu += '\t\t <div class=\"dropdown-menu\" aria-labelledby=\"MembershipDropdownMenuLink\">\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_shows\" href=\"shows.htm\">Shows & Auctions </a>\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_links\" href=\"links.htm\">Shooting links</a>\\n'\n strMenu += '\t\t </div>\\n'\n strMenu += '\t </li>\\n'\n strMenu += '\t <li class=\"nav-item\"><a class=\" nav-link\" id=\"l_events\" href=\"calendar.htm\">CALENDAR</a></li>\\n'\n strMenu += '\t <li class=\"nav-item\"><a class=\" nav-link\" id=\"l_news\" href=\"news.htm\">News</a></li>\\n'\n strMenu += '\t <li class=\"nav-item dropdown\">\\n'\n strMenu += '\t\t <a class=\"nav-link dropdown-toggle\" id=\"FacilitiesDropdownMenuLink\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Facilities</a>\\n'\n strMenu += '\t\t <div class=\"dropdown-menu\" aria-labelledby=\"FacilitiesDropdownMenuLink\">\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_indoors\" href=\"indoors.htm\">Indoors </a>\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_outdoors\" href=\"outdoors.htm\">Outdoor </a>\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_courses\" href=\"courses.htm\">Courses </a>\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_property\" href=\"propertymap.htm\">Property map </a>\\n'\n strMenu += '\t\t </div>\\n'\n strMenu += '\t </li>\\n'\n strMenu += '\t <li class=\"nav-item dropdown\">\\n'\n strMenu += '\t\t <a class=\"nav-link dropdown-toggle\" id=\"SectionsDropdownMenuLink\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Sections</a>\\n'\n strMenu += '\t\t <div class=\"dropdown-menu\" aria-labelledby=\"SectionsDropdownMenuLink\">\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_junior\" href=\"junior.htm\">Junior program </a>\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_archery\" href=\"archery.htm\">Archery </a>\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_smallbore\" href=\"smallbore.htm\">Smallbore rifles </a>\\n'\n strMenu += '\t\t\t <a class=\"dropdown-item\" id=\"l_handgun\" href=\"handgun.htm\">Handguns </a>\\n'\n strMenu += '\t\t </div>\\n'\n strMenu += '\t </li>\\n'\n strMenu += '\t <li class=\"nav-item\"><a class=\"nav-link\" href=\"board/index.php\" target=\"new\">Message Board</a></li>\\n'\n strMenu += '\t <li class=\"nav-item\"><a class=\"nav-link\" id=\"l_contact\" href=\"contact.htm\">Contact us </a></li>\\n'\n strMenu += ' </ul>\\n'\n strMenu += '</div>\\n'\n strMenu += '</nav>\\n'\n\n // Add the menu to the DOM\n $(\"#menu\").append(strMenu);\n}", "function activateDropdown(elem) {\n var menu = elem.parents('.dropdown-menu');\n if ( menu.length ) {\n var toggle = menu.prev('button, a');\n toggle.text ( elem.text() );\n }\n }", "function activateDropdown(elem) {\n var menu = elem.parents('.dropdown-menu');\n if ( menu.length ) {\n var toggle = menu.prev('button, a');\n toggle.text ( elem.text() );\n }\n }", "function dropNavigation() {\n\t$('.header').on('click', '.btn-filters', function (e) {\n\t\tvar btn = $(this);\n\t\tbtn\n\t\t\t.closest('.wrapper')\n\t\t\t.toggleClass('expanded-filters')\n\t\t\t.find('.filters')\n\t\t\t.stop()\n\t\t\t.slideToggle();\n\n\t\te.preventDefault();\n\t});\n\t$('.filters').on('click', 'a', function (e) {\n\t\tif ($(window).width() > 767) { return; }\n\n\t\tvar item = $(this).closest('li');\n\t\tvar filterDrop = item.find('.filters-drop');\n\t\tif (!filterDrop.length){return;}\n\t\te.preventDefault();\n\t\t$('.filters-drop')\n\t\t\t.stop()\n\t\t\t.slideUp();\n\t\t$('.filters .expanded-drop').each(function () {\n\t\t\t$(this).removeClass('expanded-drop');\n\t\t});\n\t\tif(filterDrop.is(':hidden')){\n\t\t\titem\n\t\t\t\t.addClass('expanded-drop')\n\t\t\t\t.find('.filters-drop')\n\t\t\t\t.stop()\n\t\t\t\t.slideToggle();\n\t\t}\n\t});\n}", "render() {\n return (\n <Navbar fluid>\n <Nav pullLeft>\n <NavItem eventKey={1} href=\"/\">\n Social Network\n </NavItem>\n <NavItem>\n <Glyphicon glyph=\"list-alt\" />\n </NavItem>\n </Nav>\n <Navbar.Form pullLeft>\n <form onSubmit={this.handleSubmit}>\n <FormGroup>\n <FormControl type=\"text\" placeholder=\"Search\" />\n </FormGroup>{' '}\n <Button type=\"submit\">\n <Glyphicon glyph=\"search\"/>\n </Button>\n </form>\n </Navbar.Form>\n <Nav pullRight>\n <NavItem eventKey={1} href=\"/\">\n Account Settings\n </NavItem>\n <NavItem eventKey={1} href=\"/\">\n Sign in\n </NavItem>\n </Nav>\n </Navbar>\n );\n }", "function showDropdown() {\n\t$('.dropdown-toggle').click(function(){\n\t\tvar dropdown = $(this).parent().find('.m-dropdown-menu');\n\t\tif( dropdown.css('display') == 'none' )\n\t\t\tdropdown.show();\n\t\telse\n\t\t\tdropdown.hide();\n\n\t\t// clicks out the dropdown\n\t $('body').click(function(event){\n\t \tif(!$(event.target).is('.m-dropdown-menu a')) {\n\t \t\t$(this).find('.m-dropdown-menu').hide();\n\t \t}\n\t });\n\t\tevent.stopPropagation();\n\t});\n}", "render() {\n return( \n <nav className=\"navbar navbar-default\">\n <div className=\"navbar-header\">\n </div>\n <ul className=\"nav navbar-nav navbar-right\">\n <li> <a href=\"/home\"> HOME </a> </li>\n <li> <a href=\"/submit\"> SUBMIT </a> </li>\n </ul>\n </nav>\n )\n }", "function Navbar () {\n return (\n <nav id=\"navbar\" className=\"navbar navbar-expand-lg bg-dark navbar-dark justify-content-between\">\n <div id=\"navbar-logo-container\">\n <img id=\"navbar-logo\" src={require('../images/thinking.svg')} alt=\"Logo\"/>\n <span id=\"navbar-title\">PIX2PIX</span>\n </div>\n {/*\n <div id=\"navbar-buttons-wrapper\">\n <button id=\"navbar-about\" href=\"#\">\n <span>ABOUT</span>\n </button>\n <button id=\"navbar-create\" href=\"#\">\n <span>CREATE</span>\n </button>\n </div>\n */}\n </nav>\n )\n}", "function Nav() {\n return (\n <nav className=\"navbar\">\n <span id=\"header\" className=\"navbar-brand mb-1 h1\">\n Natalie Michelsen\n </span>\n <div className=\"stretch\">\n <ul id=\"items\" className=\"nav navbar-nav navbar-right\">\n <li className=\"nav-item1\">\n <Link className=\"nav-link\" to=\"About\">\n About\n </Link>\n </li>\n <li className=\"nav-item1\">\n <Link className=\"nav-link\" to=\"Portfolio\">\n Portfolio\n </Link>\n </li>\n <li className=\"nav-item2\">\n <Link className=\"nav-link\" to=\"Contact\">\n Contact\n </Link>\n <Link className=\"dropdown-item\" to=\"\">\n Heroku\n </Link>\n </li>\n </ul>\n </div>\n </nav>\n );\n}", "function Navigation() {\n return (\n <Container>\n <Navbar bg=\"light\" className=\"mb-4\" expand=\"lg\">\n <Navbar.Brand href=\"#home\"><Sun className=\"ms-4\"/>Pogoda dziś</Navbar.Brand>\n <Navbar.Toggle aria-controls=\"basic-navbar-nav\" />\n <Navbar.Collapse id=\"basic-navbar-nav\">\n <Nav className=\"me-auto text-center\">\n <Nav.Link href=\"#warning\">Ostrzeżenia</Nav.Link>\n <Nav.Link href=\"#info\">Informacje</Nav.Link>\n </Nav>\n </Navbar.Collapse>\n </Navbar>\n </Container>\n );\n}", "function Navigation()\n{\n return(\n <div className='navi'>\n <Navbar className=\"toDoBar\"variant=\"dark\" collapseOnSelect expand=\"lg\" fixed=\"top\">\n <Container>\n <Navbar.Brand href='/'>ToDo</Navbar.Brand>\n <Navbar.Toggle aria-controls=\"responsive-navbar-nav\" />\n <Navbar.Collapse id=\"responsive-navbar-nav\">\n <Nav className=\"me-auto\">\n <Nav.Link href='/product'>Product</Nav.Link>\n <Nav.Link href='/'>Company</Nav.Link>\n <Nav.Link href='/'>Pricing</Nav.Link>\n </Nav>\n <Nav>\n <Button href=\"/login\" className=\"navBtn\">Sign In</Button>\n </Nav>\n </Navbar.Collapse>\n </Container>\n </Navbar>\n </div>\n );\n}", "function _navBarList(req, res, next) {\n var session = req.session,\n user = session.user;\n\n if (!navbars[session.language] || !navbars[session.language][user.rank]) {\n _createNavbarLists(session.language, user.rank, user.allowedPages);\n }\n res.locals.navbarList = navbars[session.language][session.user.rank];\n\n next();\n}", "function initNavbarDropEffect1() {\n var self = this;\n var $navbars = (0, _utility.$)('.nk-navbar-side, .nk-navbar-full').find('.nk-nav');\n\n // add perspective\n $navbars.css({\n perspective: '600px',\n perspectiveOrigin: 'center top'\n });\n\n // add back item for dropdowns\n $navbars.find('.dropdown').prepend('<li class=\"bropdown-back\"><a href=\"#\">' + self.options.templates.secondaryNavbarBackItem + '</a></li>');\n\n // change height of opened dropdown\n function updateSideNavDropdown($item) {\n var $nav = $item.parents('.nk-navbar:eq(0)');\n var $khNav = $nav.find('.nk-nav');\n var $nanoCont = $khNav.children('.nano-content');\n var $khNavRow = $khNav.parent();\n var $drop = $nav.find('.nk-drop-item.open > .dropdown:not(.closed)');\n\n if ($drop.length) {\n var dropHeight = $drop.innerHeight();\n\n // vertical center for dropdown\n if ($khNavRow.hasClass('nk-nav-row-center')) {\n $drop.css({\n top: 0\n });\n\n $khNav.hide();\n var nanoHeight = $khNavRow.innerHeight();\n $khNav.show();\n var nanoNavRowHeight = nanoHeight;\n var nanoTop = $khNavRow.offset().top;\n var dropTop = $drop.offset().top;\n\n var top = nanoTop - dropTop;\n if (dropHeight < nanoNavRowHeight) {\n top += (nanoHeight - dropHeight) / 2;\n }\n\n $drop.css({\n top: top\n });\n }\n\n $khNav.css('height', dropHeight);\n self.initPluginNano($nav);\n\n // scroll to top\n _utility.tween.to($nanoCont, 0.3, {\n scrollTo: { y: 0 },\n delay: 0.2\n });\n } else {\n $khNav.css('height', '');\n }\n self.initPluginNano($nav);\n }\n\n // open / close submenu\n function toggleSubmenu(open, $drop) {\n var $newItems = $drop.find('> .dropdown > li > a');\n var $oldItems = $drop.parent().find('> li > a');\n\n if (open) {\n $drop.addClass('open').parent().addClass('closed');\n } else {\n $drop.removeClass('open').parent().removeClass('closed');\n\n var tmp = $newItems;\n $newItems = $oldItems;\n $oldItems = tmp;\n }\n\n // show items\n _utility.tween.set($newItems, {\n x: open ? '30%' : '-30%',\n rotationY: open ? '30deg' : '-30deg',\n opacity: 0,\n display: 'block'\n }, 0.1);\n _utility.tween.to($newItems, 0.3, {\n x: '0%',\n rotationY: '0deg',\n opacity: 1,\n delay: 0.1\n });\n\n // hide items\n _utility.tween.to($oldItems, 0.3, {\n x: open ? '-30%' : '30%',\n rotationY: open ? '-30deg' : '30deg',\n opacity: 0,\n onComplete: function onComplete() {\n $oldItems.css('display', 'none');\n }\n });\n }\n\n $navbars.on('click', '.nk-drop-item > a', function navbarDropItemClick(e) {\n toggleSubmenu(true, (0, _utility.$)(this).parent());\n updateSideNavDropdown((0, _utility.$)(this));\n e.preventDefault();\n });\n $navbars.on('click', '.bropdown-back > a', function navbarDropItemBackClick(e) {\n toggleSubmenu(false, (0, _utility.$)(this).parent().parent().parent());\n updateSideNavDropdown((0, _utility.$)(this));\n e.preventDefault();\n });\n}", "function menu_dropdown_open() {\r\n var width = $(window).width();\r\n if (width > 991) {\r\n if ($(\".ow-navigation .nav li.ddl-active\").length) {\r\n $(\".ow-navigation .nav > li\").removeClass(\"ddl-active\");\r\n $(\".ow-navigation .nav li .dropdown-menu\").removeAttr(\"style\");\r\n }\r\n } else {\r\n $(\".ow-navigation .nav li .dropdown-menu\").removeAttr(\"style\");\r\n }\r\n }", "function toggleNavbarButton(){\n\t\tjq(\"#mainHeader #mainMenu .navbar-toggle\").click(function(){\n\t\t\tjq(\"#mainHeader #mainMenu .navbar-toggle i.menu-icon\").toggleClass(\"close\");\n\t\t\tjq(\"#mainHeader #mainMenu .navbar-header\").toggleClass(\"collapsed\");\n\n\t\t\tif(jq(window).innerWidth() <= 768){\n\t\t\t\tif(!jq(\"#mainHeader #mainMenu #navbar\").hasClass(\"in\")){\n\t\t\t\t\tjq(\"#mainHeader #mainMenu .navbar-toggle\").attr(\"style\", \"background-color: transparent !important\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tjq(\"#mainHeader #mainMenu .navbar-toggle\").attr(\"style\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "render() {\n return (\n <Navbar dark expand=\"md\" fixed=\"top\" >\n <NavbarToggler onClick={this.toggleNav} />\n <NavbarBrand className=\"mr-auto\" href=\"/jeopardy/\"><img className='logo' src='./assets/images/logo.png' alt='Jeopardy!' /></NavbarBrand>\n <Collapse isOpen={this.state.isNavOpen} navbar>\n <Nav navbar>\n <NavItem>\n <NavLink className=\"nav-link\" to='/search'><span className=\"fa fa-search fa-lg\"></span> Search</NavLink>\n </NavItem>\n <NavItem>\n <NavLink className=\"nav-link\" to='/play'><span className=\"fa fa-gamepad fa-lg\"></span> Play</NavLink>\n </NavItem>\n </Nav>\n </Collapse>\n </Navbar>\n );\n }", "function navResponsive() {\n \n if (screenWidth > 991) {\n \n $(\".main-nav .navbar-nav > .dropdown > a\").attr(\"data-toggle\", \"\");\n $(\".main-nav .navbar-nav.nav-search > .dropdown > a\").attr(\"data-toggle\", \"dropdown\");\n $('.main-nav .navbar-nav > .dropdown').removeClass('open');\n $('.main-nav .navbar-nav .dropdown-submenu').removeClass('open');\n $('.main-nav .navbar-nav > li').find(':focus').blur();\n if ( $('.main-nav .navbar-collapse').hasClass('in') ) {\n $('.main-nav .navbar-collapse').removeClass('in');\n }\n if($('.navbar-toggle').hasClass('active')){\n $('.navbar-toggle').removeClass('active');\n }\n \n }\n else if (screenWidth <= 991) {\n \n $(\".main-nav .navbar-nav > .dropdown > a\").attr(\"data-toggle\", \"dropdown\");\n $('.main-nav .nav > li .dropdown-menu').removeAttr('style');\n $('.main-nav .nav > li > .dropdown-menu').removeAttr('style');\n \n }\n}", "function HeaderNav() {\n return (\n <div>\n <Navbar collapseOnSelect fixed='top' expand='sm' bg='dark' variant='dark'>\n <Container> \n {/*<Navbar.Brand className=\"brand\" href=\"#home\">Lougine Scott</Navbar.Brand>*/}\n <Navbar.Toggle aria-controls='responsive-navbar-nav' />\n <Navbar.Collapse id ='responsive-navbar-nav'>\n <Nav>\n <Nav.Link href=\"/\">Home</Nav.Link>\n <Nav.Link href=\"/About Me\">About Me</Nav.Link>\n <Nav.Link href=\"/Projects\">Project</Nav.Link>\n <Nav.Link href=\"/Contact Me\">Contact Me</Nav.Link>\n <Nav.Link href=\"/Resume\">Resume</Nav.Link>\n </Nav>\n </Navbar.Collapse>\n </Container> \n </Navbar>\n \n </div>\n\n );}", "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 }", "function Header() {\n return (\n <nav className=\"navbar navbar-expand-lg\">\n <div className=\"container-fluid\">\n <h1 className=\"navbar-brand\">Amanda MacDonald</h1>\n <button className=\"navbar-toggler\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#navbarNavAltMarkup\" aria-controls=\"navbarNavAltMarkup\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n <span className=\"navbar-toggler-icon\"></span>\n </button>\n <div className=\"collapse navbar-collapse\" id=\"navbarNavAltMarkup\">\n <div className=\"navbar\">\n <a className=\"navbar\" aria-current=\"page\" href=\"/\">Home</a>\n <a className=\"navbar\" href=\"/about\">About Me</a>\n <a className=\"navbar\" href=\"/portfolio\">Portfolio</a>\n <a className=\"navbar\" href=\"/contact\">Contact Me</a>\n </div>\n </div>\n </div>\n </nav>\n\n\n )\n}", "function mainMenu() {\n // Variables\n var var_window = $(window),\n navContainer = $('.nav-container'),\n pushedWrap = $('.nav-pushed-item'),\n pushItem = $('.nav-push-item'),\n pushedHtml = pushItem.html(),\n pushBlank = '',\n navbarToggler = $('.navbar-toggler'),\n navMenu = $('.nav-menu'),\n navMenuLi = $('.nav-menu ul li ul li'),\n closeIcon = $('.navbar-close');\n // navbar toggler\n navbarToggler.on('click', function() {\n navbarToggler.toggleClass('active');\n navMenu.toggleClass('menu-on');\n });\n // close icon\n closeIcon.on('click', function() {\n navMenu.removeClass('menu-on');\n navbarToggler.removeClass('active');\n });\n\n // adds toggle button to li items that have children\n navMenu.find('li a').each(function() {\n if ($(this).next().length > 0) {\n $(this)\n .parent('li')\n .append(\n '<span class=\"dd-trigger\"><i class=\"flaticon-down-arrow\"></i></span>'\n );\n }\n });\n // expands the dropdown menu on each click\n navMenu.find('li .dd-trigger').on('click', function(e) {\n e.preventDefault();\n $(this)\n .parent('li')\n .children('ul')\n .stop(true, true)\n .slideToggle(350);\n $(this).parent('li').toggleClass('active');\n });\n\n // check browser width in real-time\n function breakpointCheck() {\n var windoWidth = window.innerWidth;\n if (windoWidth <= 1199) {\n navContainer.addClass('breakpoint-on');\n\n pushedWrap.html(pushedHtml);\n pushItem.hide();\n } else {\n navContainer.removeClass('breakpoint-on');\n\n pushedWrap.html(pushBlank);\n pushItem.show();\n }\n }\n\n breakpointCheck();\n var_window.on('resize', function() {\n breakpointCheck();\n });\n }", "function McDropdownPanel() { }", "render() {\n \t\treturn(\n \t\t\t<nav className=\"navbar navbar-inverse\">\n \t\t\t\t<div className=\"container\">\n \t\t\t\t\t<Link className=\"navbar-brand\" to=\"/\">Quotes</Link>\n \t\t\t\t\t<ul className=\"nav navbar-nav\">\n \t\t\t\t\t<li><Link to=\"/\">Home</Link></li>\n \t\t\t\t\t<li><Link to=\"/favorites\">Favorites</Link></li> \t\t\t\t\t\n \t\t\t\t\t</ul> \t\t\t\t\t \n \t\t\t\t</div>\n \t\t\t</nav>\n \t\t\t)\n }", "getNavbarItems() {\n return null;\n }" ]
[ "0.7267558", "0.71692914", "0.70294404", "0.701039", "0.6757659", "0.6650825", "0.66297", "0.662937", "0.650255", "0.6477782", "0.6405027", "0.6395082", "0.638674", "0.6382124", "0.6361062", "0.63587135", "0.6341309", "0.6320697", "0.63098747", "0.63021636", "0.62921125", "0.6264673", "0.6253819", "0.6234485", "0.62279737", "0.6203445", "0.62025744", "0.61981046", "0.61633784", "0.6141224", "0.6127229", "0.61230195", "0.6103028", "0.6092646", "0.60875964", "0.60859424", "0.60624313", "0.60598445", "0.6043479", "0.6042993", "0.6030513", "0.6030497", "0.60224634", "0.60111773", "0.600743", "0.60060084", "0.5994945", "0.5991739", "0.59883803", "0.5988075", "0.59864134", "0.5982305", "0.5981822", "0.5970568", "0.5969055", "0.5968559", "0.5968029", "0.5966718", "0.5954618", "0.5954492", "0.5951734", "0.59488934", "0.5941382", "0.59328735", "0.5927286", "0.5916718", "0.59152496", "0.5914567", "0.5901795", "0.5901422", "0.58966446", "0.5888749", "0.58875966", "0.58846104", "0.5884377", "0.5878468", "0.5877626", "0.5868633", "0.5866926", "0.5866926", "0.5860643", "0.58599585", "0.58460647", "0.58439547", "0.5836727", "0.5832928", "0.5828635", "0.5827846", "0.58246475", "0.5823894", "0.58226216", "0.582236", "0.5821543", "0.58196896", "0.5819332", "0.5817033", "0.58168614", "0.5816505", "0.5811994", "0.58114356", "0.5810514" ]
0.0
-1
set y get nunca se nombran igual, se trabajan como si fueran propiedades
get mostrarNombre(){ return this.nombre; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set nombre(nom){\n this._nombres = nom;\n }", "setNom(nom){\n this.nom = nom;\n }", "function criaProduto (nome, preco, estoque){\n return{\n get nome(){\n return nome;\n },\n set nome(valor){\n valor = valor.replace(' vermelho','');\n nome = valor;\n }\n };\n}", "setNombre(nombre){\n this.#nombre = nombre;\n }", "set name(value) { this._name = value || \"unknown\"; }", "set property(){}", "setNombre (precio) {\n this.nombre = nombre;\n }", "set name(value) {}", "set name(value) {}", "set name(value) {}", "set name(value) {}", "set name(value) {}", "set name(value) {}", "set name(value) {}", "set setName(name){\n _name=name;\n }", "set name(pkmnName){\n if(typeof(pkmnName)==='string'){\n this._name = pkmnName;\n return true;\n } else {\n return \"Invalid name type\";\n }\n }", "set(target, prop, val) {\r\n target[prop] = val;\r\n return true;\r\n }", "set(target, prop, val) {\r\n target[prop] = val;\r\n return true;\r\n }", "set(target, prop, val) {\r\n target[prop] = val;\r\n return true;\r\n }", "function Produto(nome, preco, estoque){\n this.nome = nome;\n this.preco = preco;\n // this.estoque = estoque;\n let estoquePrivado = estoque;\n Object.defineProperty(this, \"estoque\", {\n enumerable:true,\n configurable:true,\n\n get: function(){\n return estoquePrivado;\n },\n\n //set só convigura não mostra nada\n set: function(valor){\n if(typeof valor !== 'number'){\n console.log('Invalido');\n return;\n }\n estoquePrivado = valor;\n }\n });\n}", "set modificarNombre(nuevoNombre) {\n this.nombre = nuevoNombre;\n }", "set name(nuevoNombrecito) {\n // Evitar nombres al ser llamado / Condicional => Validar que no puedan cambiar el nombre.\n if (nuevoNombrecito === \"Curso Malito de Programación Básica\") {\n console.error(\"Web... no!\");\n } else {\n this._name = nuevoNombrecito;\n }\n }", "set NomFilm(_nomFilm) {\n this.nomFilm = _nomFilm;\n }", "function atr$(obj, name, get, set, metamodel,settermm) {\nObject.defineProperty(obj, name, {get: get, set: set, configurable: true, enumerable: true});\n//if (name[0]==='$')name=name.substring(1);//names matching reserved words are prefixed with $\nobj['$prop$get'+name[0].toUpperCase()+name.substring(1)] = {get:get, set:set, $crtmm$:metamodel};\nif (settermm)set.$crtmm$=settermm;\n}", "setName(value){\n\t\tthis.name = value;\n\t}", "static set property(){}", "set setRaza(newName){\n this.raza = newName;\n }", "set name(x) { this._name = x; }", "function setName(n) {\n\tname = n;\n}", "set Name(MyName){\n this._Name = MyName;\n }", "set nom(unNom) {\n\t\tthis._nom = unNom;\n\t}", "get nombre(){\n return this._nombre\n }", "setLastName(aLastName){\n this.lastname = aLastName;\n }", "set name(value) {\n // this replaces the name as the value. whatever the user has inputted becomes \"value\"\n this._name = value;\n }", "set(name, value, s, extra) {\n\t\tlet thiz = this;\n\t\textra = extra || {};\n\t\tif ( !Object.prototype.hasOwnProperty.call(this.properties, name) ) {\n\t\t\tif ( !this.extensable ) {\n\t\t\t\t//TODO: Should we throw here in strict mode?\n\t\t\t\treturn Value.undef.fastGen();\n\t\t\t}\n\t\t\tlet v = new PropertyDescriptor(value);\n\t\t\tv.enumerable = 'enumerable' in extra ? extra.enumerable : true;\n\t\t\tthis.properties[name] = v;\n\n\t\t\treturn v.setValue(this, value, s);\n\t\t}\n\n\t\treturn this.properties[name].setValue(this, value, s);\n\n\t}", "function setName(obj) {\r\n obj.name = \"Nicholas\";\r\n}", "get mostrarNombre() {\n return this.nombre;\n }", "set() {}", "setName(name){\n this.name = name;\n }", "function Produto(nome, preco, estoque){\n this.nome = nome;\n this.preco = preco;\n let etqPvd = estoque\n Object.defineProperty(this, 'estoque', {\n enumerable: true, // exibe a chave ou não\n // value: estoque, // valor da chave\n // writable: true, // alteração do valor da chave\n configurable: true, // configurável ou não\n get: function (){\n return etqPvd\n },\n set: function(valor){\n if (typeof valor !== 'number'){\n throw new TypeError('Informar somente número');\n }\n etqPvd = valor;\n },\n });\n}", "set Auto(value) {}", "set Prologic(value) {}", "setName(value) {\n return this.request(`${this.prefix}set_name`, [value]);\n }", "set(target, prop, value) {\n instance.cmp[prop] = value\n return true\n }", "setName(name) { }", "set name(value) {\n if (typeof value !== \"string\") throw new Error(\"Name must be a string\");\n _name.set(this, value);\n }", "function MANDATORY_SETTER_FUNCTION(name) {\n function SETTER_FUNCTION(value) {\n var m = exports.peekMeta(this);\n if (!m.isInitialized(this)) {\n m.writeValues(name, value);\n } else {\n true && !false && emberDebug.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);\n }\n }\n\n SETTER_FUNCTION.isMandatorySetter = true;\n return SETTER_FUNCTION;\n }", "setMethods(name, type){\r\n return \"\\tvoid set\" + name +\r\n \"(\" + type + \" val) {\\n \\t \\t\" + name + \" = val;\\n\\t} \\n\";\r\n }", "get nombre(){\n\t\treturn this._nombre\n\t}", "set Custom(value) {}", "get getName(){\n return _name;\n }", "function MANDATORY_SETTER_FUNCTION(name) {\n function SETTER_FUNCTION(value) {\n var m = peekMeta(this);\n if (!m.isInitialized(this)) {\n m.writeValues(name, value);\n } else {\n true && !false && emberDebug.assert('You must use set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);\n }\n }\n\n SETTER_FUNCTION.isMandatorySetter = true;\n return SETTER_FUNCTION;\n }", "function MANDATORY_SETTER_FUNCTION(name) {\n function SETTER_FUNCTION(value) {\n var m = peekMeta(this);\n if (!m.isInitialized(this)) {\n m.writeValues(name, value);\n } else {\n true && !false && emberDebug.assert('You must use set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);\n }\n }\n\n SETTER_FUNCTION.isMandatorySetter = true;\n return SETTER_FUNCTION;\n }", "function MANDATORY_SETTER_FUNCTION(name) {\n function SETTER_FUNCTION(value) {\n var m = peekMeta(this);\n if (!m.isInitialized(this)) {\n m.writeValues(name, value);\n } else {\n true && !false && emberDebug.assert('You must use set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);\n }\n }\n\n SETTER_FUNCTION.isMandatorySetter = true;\n return SETTER_FUNCTION;\n }", "set(name, value) {\n return this.clone({\n name,\n value,\n op: 's'\n });\n }", "setVal(val_id, val_name, val_age, val_profession) {\n\n\n this.e_id = val_id;\n this.e_name = val_name;\n this.e_age = val_age;\n this.e_profession = val_profession;\n \n }", "get set () {\n\t\treturn this._set;\n\t}", "get nombre() {\n return this._nombre;\n }", "get property(){}", "function MANDATORY_SETTER_FUNCTION(name) {\n return function SETTER_FUNCTION(value) {\n _emberMetalCore.default.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);\n };\n }", "function MANDATORY_SETTER_FUNCTION(name) {\n return function SETTER_FUNCTION(value) {\n _emberMetalCore.default.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);\n };\n }", "set name(value) {\n\t\tthis._name = value;\n\t}", "function Fruta(nombre){\n//para poner cosas\n\n this.setNombre = function(valor){\n\n nombre=valor;\n };\n this.getNombre = function(){\n return nombre;\n };\n\n\n\n\n\n}", "static set one(value) {}", "setName( name ) {\n this.name = name;\n }", "getNom(){\n return this.nom;\n }", "set(name4cc, value) {\nthis.fourCCName = name4cc;\nreturn this.amount = value;\n}", "get name() {\n return \"Rybu\";\n }", "setName(name) {\n\t\tthis.name = name;\n\t}", "setFirstName(aFirstName){\n this.firstname = aFirstName;\n }", "function makeProperty( obj, name, predicate ) {\r\n\tvar value; // this is the property value, current goal in this application.\r\n\t\r\n\tobj[\"get\" + name] = function() {\r\n\t\treturn value; \r\n\t};\r\n\t\r\n\tobj[\"set\" + name] = function(v) {\r\n\t\tif ( predicate && !predicate(v))\r\n\t\t\tthrow \"set\" + name + \": invalid value \" + v;\r\n\t\telse\t\r\n\t\t\tvalue = v;\r\n\t};\r\n\t\t\r\n}", "static get properties() {\n return {\n clase: { type: String },\n disabled: { type: Boolean },\n texto: { type: String },\n };\n }", "set(target, prop, value) {\n base.update(store => Object.assign(store, { [prop]: value }));\n return true;\n }", "set(options){\n for (var k in options) {\n if (options.hasOwnProperty(k) && this.hasOwnProperty(k) && k != 'get' && k != 'set') {\n this[k] = options[k];\n }\n }\n }", "set velocidade(valor) {\n\n console.log('SETTER');\n if(typeof valor !== 'number') return;\n if(valor >= 100 || valor <= 0) return;\n this[velocidadePriv] = valor;\n\n }", "function meHeena(ht) {\n ht.lastName = 'thaseen';\n console.log(ht);\n}", "set normal(value) {}", "set normal(value) {}", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(target, prop, val) {\r\n if (prop.startsWith(\"_\"))\r\n throw new Error(\"You can't change the value of secret\");\r\n else {\r\n target[prop] = val;\r\n return true;\r\n }\r\n }", "set Automatic(value) {}", "saisir(p,n,m,a){\r\n this.prenom = p;\r\n this.nom = n;\r\n this.mail = m;\r\n this.promotion = a;\r\n\r\n }", "setName(name) {\n this.name = name;\n }", "setName(namePicked) {\n this.name = namePicked; //refer to the object itself using 'this'\n }", "function sc_setCarBang(p, val) {\n p.car = val;\n}", "set (obj, prop, value) {\n let store = obj.store;\n let setStore = controller.setState.bind ({controller, store});\n setStore ({[prop]: value});\n\n return true;\n }", "set_hasil() {\n this.get_hasil();\n document.getElementById(\"nilai-hasil\").innerHTML = this.nilai_hasil;\n }", "constructor(nom, prenom){\n this.nom = nom;\n this.prenom = prenom;\n }", "set human(value) {}", "setTelefono (precio) {\n this.telefono = telefono;\n }", "set playerName(value) {\n console.log('set playerName Method '+ value)\n this._playerName = value;\n }", "setAutor(autor){\r\n this.autor =autor;\r\n }", "function Manusia(nama,umur){\n let manusia = {}; //* inisiasi objek biar nanti diisi\n manusia.nama = nama; //* menambahkan properti objek manusia dengan simbol (.) dan assign (=) dari parameter\n manusia.umur = umur;\n manusia.energi = 0; //* menambahkan properti objek manusia bukan dari parameter\n\n manusia.makan = function(porsi){ //* membuat method makan untuk manusia\n this.energi += porsi \n return this.nama + \" telah makan sebanyak \" + porsi\n }\n\n return manusia //* mereturn objek yang sudah diisi\n}", "function setter() {\n\t throw new Error('vuex getter properties are read-only.');\n\t }", "function Produto(nome, preço, codigo) {\n\n this.nome = nome;\n this.preço = preço;\n //Caso eu queira que o codigo seja privado.\n Object.defineProperty(this, 'codigo', {\n\n //Para mostrar a chave\n enumerable: true,\n //Valor que a variável vai ter\n value: codigo,\n //Pode alterar o valor ou não\n writable: false,\n //Pode editar, reconfigurar ou apagar a chave\n configurable: false\n\n });\n\n \n}", "function HidPrivate (age, status){\n\n var abullah = {\n x : 20,\n y : 30\n }\n// 1 number way to get\n this.getAbdulla = function (){\n return abullah\n }\n\n// 2 number way to get\n Object.defineProperty(this, 'getabdullah', {\n get:function(){\n return abullah\n },\n // setter\n set:function (value){\n abullah = value;\n }\n })\n\n var rahim = function (){\n lg( 'I am ' + age +'and ' + status +'marriged')\n }\nthis.age = age;\nthis.status = status;\n\nthis.all = function(){\n\n\n lg( this.age + this.status)\n\n function Naem (){\n lg(age - status)\n }\n\n this.she = function (){\n return Naem()\n \n\n}\nrahim()\n}\n}" ]
[ "0.7297205", "0.6923301", "0.6745769", "0.6584452", "0.6514841", "0.6508665", "0.6490742", "0.64034516", "0.64034516", "0.64034516", "0.64034516", "0.64034516", "0.64034516", "0.64034516", "0.63227904", "0.62466484", "0.6207394", "0.6207394", "0.6207394", "0.6203547", "0.6191625", "0.6160043", "0.61035675", "0.61031365", "0.60987014", "0.6091562", "0.60634124", "0.60579133", "0.5978469", "0.5922246", "0.591852", "0.58843356", "0.5844423", "0.58350444", "0.582447", "0.58061856", "0.57893", "0.5781887", "0.57566166", "0.5739474", "0.5735158", "0.5715959", "0.5699059", "0.56694645", "0.5667476", "0.56589246", "0.56578", "0.56369096", "0.56347305", "0.5627694", "0.5627173", "0.5624509", "0.5624509", "0.5624509", "0.56195307", "0.5617725", "0.5607126", "0.56046283", "0.55989933", "0.5574104", "0.5574104", "0.55714893", "0.5562175", "0.5560818", "0.55546623", "0.555417", "0.55427074", "0.55193716", "0.5508479", "0.54966784", "0.5489045", "0.5484549", "0.5484233", "0.54740846", "0.54687977", "0.5467792", "0.5461798", "0.5461798", "0.5458059", "0.5458059", "0.5458059", "0.5458059", "0.5458059", "0.5449217", "0.5445447", "0.54419565", "0.5439619", "0.543547", "0.543143", "0.54103196", "0.53941107", "0.538604", "0.53854585", "0.5381169", "0.5379913", "0.5379671", "0.5378734", "0.53595465", "0.535651", "0.5351581" ]
0.5924147
29
Throws a `Cancel` if cancellation has been requested.
function throwIfCancellationRequested(config) { if (config.cancelToken) { config.cancelToken.throwIfRequested(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async cancel() {\n throw new Error(this.cancelMessage);\n }", "cancel() {\n throw new Error(\"Not implemented.\")\n }", "isCanceled(cancelled) {\n if (cancelled) {\n throw new Error(\"Cancelled request\");\n }\n }", "function throwIfCancellationRequested(config) {\n if (config.cancelToken) config.cancelToken.throwIfRequested();\n if (config.signal && config.signal.aborted) throw new Cancel('canceled');\n}", "function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new Cancel('canceled');\n }\n}", "function throwIfCancellationRequested(config){if(config.cancelToken){config.cancelToken.throwIfRequested();}}", "function throwIfCancellationRequested(config){if(config.cancelToken){config.cancelToken.throwIfRequested();}}", "function throwIfCancellationRequested(config){if(config.cancelToken){config.cancelToken.throwIfRequested();}}", "function throwIfCancellationRequested(config){if(config.cancelToken){config.cancelToken.throwIfRequested();}}", "function throwIfCancellationRequested(config){if(config.cancelToken){config.cancelToken.throwIfRequested();}}", "function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n }", "function throwIfCancellationRequested(config){\nif(config.cancelToken){\nconfig.cancelToken.throwIfRequested();\n}\n}", "function cancel () {\n const e = new Error('Coroutine canceled.');\n e.cause = 'canceled';\n this.resume(e);\n}", "function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n }", "function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n }", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n }", "actionCancel() {\n this.source && this.source.cancel('Operation canceled by the user.');\n }", "cancel() {\n cancel();\n }", "function throwIfCancellationRequested(config) {\r\n if (config.cancelToken) {\r\n config.cancelToken.throwIfRequested();\r\n }\r\n}", "cancel() {\n if (this.isCloseable_) {\n this.userActed('cancel');\n }\n }", "cancel() {}" ]
[ "0.79483205", "0.7736851", "0.7534211", "0.74465257", "0.742381", "0.7385535", "0.7385535", "0.7385535", "0.7385535", "0.7385535", "0.7205974", "0.71676105", "0.7164012", "0.71617556", "0.71423924", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7138887", "0.7079481", "0.7069105", "0.7050596", "0.7023946", "0.7013692", "0.7005419" ]
0.0
-1
Determine if we're running in a standard browser environment This allows axios to run in a web worker, and reactnative. Both environments support XMLHttpRequest, but not fully standard globals. web workers: typeof window > undefined typeof document > undefined reactnative: navigator.product > 'ReactNative'
function isStandardBrowserEnv() { if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { return false; } return ( typeof window !== 'undefined' && typeof document !== 'undefined' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isStandardBrowserEnv() {\n if (\n typeof navigator !== 'undefined' &&\n (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')\n ) {\n return false;\n }\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n }", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}" ]
[ "0.81452763", "0.81342584", "0.8130257", "0.8129432", "0.8120384", "0.8120384", "0.81187594", "0.81022084", "0.81022084", "0.81022084", "0.81022084", "0.81022084", "0.81022084", "0.81022084", "0.81022084", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782", "0.8098782" ]
0.0
-1
For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _node_p(){\n\tvar ret = false;\n\tif( anchor.environment() == 'Node.js' ){ ret = true; }\n\treturn ret;\n }", "function node_error(err) {\r\n node.error(err, err);\r\n }", "private public function m246() {}", "function NodeFsHandler() {}", "function NodeFsHandler() {}", "static reset(){\n _NODE_UID = 0;\n }", "static final private internal function m106() {}", "private internal function m248() {}", "function NodeHandler() { }", "function _isNodeInternal (line) {\n return ~line.indexOf('(timers.js:') ||\n ~line.indexOf('(node.js:') ||\n ~line.indexOf('(module.js:') ||\n ~line.indexOf('_stream_readable.js') ||\n ~line.indexOf('process._tickDomainCallback') ||\n ~line.indexOf('GeneratorFunctionPrototype.next (native)') ||\n ~line.indexOf('GeneratorFunctionPrototype.throw (native)') ||\n // co\n ~line.indexOf('/co/index.js') ||\n // koa-router\n ~line.indexOf('Object.dispatch') ||\n // bluebird\n ~line.indexOf('Promise._settlePromise') ||\n ~line.indexOf('Async._drainQueues') ||\n ~line.indexOf('Immediate.Async.drainQueues') ||\n false;\n}", "function Node() {}", "transient private protected internal function m182() {}", "function runIfNewNode( task ) {\n\t\treturn nodeV16OrNewer ? task : \"print_old_node_message:\" + task;\n\t}", "function isNode(){\r\n\treturn typeof module !== 'undefined' && module.exports;\r\n}", "function node_enable() {\n if(typeof process === 'object' && process + '' === '[object process]'){\n return true;\n }\n else{\n return false;\n }\n}", "function RNode() {}", "function RNode() {}", "function RNode() {}", "function noOp(err) { if (err) { throw err; } }", "function isNode() {\n return (typeof module !== 'undefined' && this.module !== module);\n}", "protected internal function m252() {}", "function version(){ return \"0.13.0\" }", "function NodeLogger() {}", "function NodeLogger() {}", "function NodeLogger() {}", "getHostNode() {}", "function NodeLogger() { }", "function NodeLogger() { }", "getNode() {\n throw new Error(\"Must be implemented\");\n }", "transient private internal function m185() {}", "function NodeLogger(){}", "function getBasicNodeMethods(){return['get','post','put','head','delete','options','trace','copy','lock','mkcol','move','purge','propfind','proppatch','unlock','report','mkactivity','checkout','merge','m-search','notify','subscribe','unsubscribe','patch','search','connect'];}", "static final protected internal function m110() {}", "getAllNodes () {\n client.getAllNodes(this.host, 4369, function (err, nodes) {\n if (err) {\n console.error(err)\n return\n }\n console.log(nodes)\n })\n }", "extend(config, ctx) {\n config.node = {\n console: true,\n fs: 'empty',\n net: 'empty',\n tls: 'empty',\n }\n }", "function is_node() {\r\n if (is_node_ === null)\r\n is_node_ = typeof global === \"object\"\r\n && typeof global.process === \"object\"\r\n && typeof global.process.versions === \"object\"\r\n && typeof global.process.versions.node !== \"undefined\";\r\n return is_node_;\r\n}", "function assertNodeEnv() {\r\n return assert(isNode, 'This feature is only available in NodeJS environments');\r\n }", "transient protected internal function m189() {}", "function RNode(){}", "upgrade() {}", "function _detectNodeCrypto(fn) {\n\t return forge.util.isNodejs && typeof _crypto[fn] === 'function';\n\t}", "function TNode() {}", "function TNode() {}", "function TNode() {}", "_handleNodeError(newValue,oldValue){if(typeof oldValue!==typeof void 0&&null!=newValue&&0!=newValue.length){// @todo, need support for a failed to load state; could be useful\n// if we go into an offline capability in the future\nthis._responseList[this.active]=newValue;this.activeNodeResponse=this._responseList[this.active];// set available because we don't have a failed state\nthis.items[this.active].metadata.status=\"available\";this.set(\"items.\"+this.active+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+this.active+\".metadata.status\");// fire an event that this isn't really available so we know an issue occured\nthis.dispatchEvent(new CustomEvent(\"node-load-failed\",{bubbles:!0,cancelable:!0,composed:!0,detail:this.items[this.active]}))}}", "_read () {}", "_read () {}", "_read () {}", "function DWRUtil() { }", "_isValidContext() {\n const isNode = (typeof process !== 'undefined')\n && (typeof process.release !== 'undefined')\n && (process.release.name === 'node');\n return isNode;\n }", "function NWTNode() {\n\t\n}", "function getBasicNodeMethods() {\n return ['get', 'post', 'put', 'head', 'delete', 'options', 'trace', 'copy', 'lock', 'mkcol', 'move', 'purge', 'propfind', 'proppatch', 'unlock', 'report', 'mkactivity', 'checkout', 'merge', 'm-search', 'notify', 'subscribe', 'unsubscribe', 'patch', 'search', 'connect'];\n}", "_read() {}", "_read() {}", "static transient final private protected internal function m40() {}", "function getSystemNodeVers(cb) {\n exec('node -v', function(err, stdout) {\n if (err) {\n return cb(err, null);\n }\n cb(null, stdout.slice(1).replace('\\n',''));\n });\n}", "function r() {}", "function r() {}", "function r() {}", "function Node(){}", "transient private protected public internal function m181() {}", "static isNode(n) {\n return n && typeof n === \"object\" && typeof n.type === \"string\";\n }", "async initialize()\n\t{ \n\t\tthrow new Error(\"initialize() method not implemented\");\n\t}", "static transient final protected public internal function m46() {}", "extend (config, ctx) {\n config.node = {\n fs: 'empty'\n }\n }", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function isNode() {\n return typeof module !== 'undefined' &&\n module.exports &&\n typeof window === 'undefined';\n}", "initiator() {\n throw new Error('Not implemented');\n }", "static runningOnNode ()\n\t\t{ let ud = \"undefined\";\n\n\t\t\tif (typeof process === ud)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (! process )\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (! process.versions )\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (! process.versions.node )\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (typeof __dirname === ud)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (typeof __filename === ud)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (typeof require === ud)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (require === null)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (! require.resolve)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\tif (typeof module === ud)\n\t\t\t{ return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function node(){}", "async init( callback ) {\n throw \"implement me!\";\n }", "constructor() {\n this.startTime = Date.now();\n this.attributes = {\n \"version\": 0.5, \n \"lang\": \"node.js\",\n \"startTime\": this.startTime\n };\n\n this.inspectedCPU = false;\n this.inspectedMemory = false;\n this.inspectedContainer = false;\n this.inspectedPlatform = false;\n this.inspectedLinux = false;\n }", "function Node() {\n}", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function getLocalNodeVers(cb) {\n var nave_path = process.env.HOME + \"/.nave/installed/\";\n\n fs.readdir(nave_path, cb);\n}", "static get ERROR () { return 0 }", "static transient final private internal function m43() {}", "extend(config, {isDev, isClient}) {\n config.node = {\n fs: 'empty'\n }\n }", "static init() {\n\t\tprocess.on('unhandledRejection', (reason, p) => { throw reason });\n\t}", "static transient final protected internal function m47() {}", "_read() {\n }", "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}" ]
[ "0.5863474", "0.5705808", "0.568645", "0.55544066", "0.55544066", "0.5446477", "0.5434516", "0.5381192", "0.5356294", "0.53282356", "0.53189546", "0.52043676", "0.51996946", "0.5156968", "0.51501393", "0.51281303", "0.51281303", "0.51281303", "0.5112595", "0.5100047", "0.50906795", "0.5088863", "0.5087259", "0.5087259", "0.5087259", "0.5080389", "0.5072706", "0.5072706", "0.5068706", "0.50571835", "0.50298", "0.50214815", "0.501945", "0.50129956", "0.5000925", "0.4991448", "0.49863955", "0.49858886", "0.49840045", "0.4981576", "0.4970059", "0.4949551", "0.4949551", "0.4949551", "0.4927342", "0.49235627", "0.49235627", "0.49235627", "0.49222878", "0.49209145", "0.4916484", "0.48980445", "0.48758933", "0.48758933", "0.48750284", "0.4857348", "0.48530325", "0.48530325", "0.48530325", "0.4848229", "0.4847861", "0.48425364", "0.48396116", "0.48373815", "0.48351088", "0.48342466", "0.48342466", "0.48342466", "0.48342466", "0.48342466", "0.48342466", "0.48342466", "0.48342466", "0.48342466", "0.48342466", "0.48342466", "0.48342466", "0.48342466", "0.48302492", "0.48184085", "0.48170963", "0.4817076", "0.48170155", "0.48130047", "0.48075417", "0.48001215", "0.48001215", "0.48001215", "0.48001215", "0.48001215", "0.48001215", "0.48001215", "0.47976673", "0.4785643", "0.477728", "0.47741026", "0.47708902", "0.47680405", "0.47660002", "0.47642508", "0.47642508" ]
0.0
-1
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n if (each.score >= 0.4) {\n objectDescription = objectDescription + \", \" + each.class\n }\n })\n tj.speak(\"The objects I see are: \" + objectDescription)\n });\n}", "function recommendNewPosts() {\n model.loadModel();\n getNewPosts(function (err, posts) {\n var label\n ;\n posts.forEach(function (post) {\n label = model.classifyPost(post);\n if (label == 'like') {\n console.log(post);\n }\n });\n });\n }", "function BOT_onLike() {\r\n\tBOT_traceString += \"GOTO command judge\" + \"\\n\"; // change performative\r\n\tBOT_theReqJudgement = \"likeable\";\r\n\tBOT_onJudge(); \t\r\n\tif(BOT_reqSuccess) {\r\n\t\tvar ta = [BOT_theReqTopic,BOT_theReqAttribute]; \r\n\t\tBOT_del(BOT_theUserTopicId,\"distaste\",\"VAL\",ta);\r\n\t\tBOT_add(BOT_theUserTopicId,\"preference\",\"VAL\",ta);\r\n\t}\r\n}", "function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "function LanguageUnderstandingModel() {\n }", "function guess() {\n classifier.predict(video.elt, 5, gotResult);\n}", "function theBigBang() {\n\t\tinitLibs();\n\t\tinitFuncs();\n\t\tObject.setPrototypeOf(Universe.prototype, universe.kjsclasses._primitive_prototype);\n\t\tObject.setPrototypeOf(Object.prototype, universe); // [0]\n\t}", "function readOwn(obj, name, pumpkin) {\n if (typeof obj !== 'object' || !obj) {\n if (typeOf(obj) !== 'object') {\n return pumpkin;\n }\n }\n if (typeof name === 'number' && name >= 0) {\n if (myOriginalHOP.call(obj, name)) { return obj[name]; }\n return pumpkin;\n }\n name = String(name);\n if (obj[name + '_canRead___'] === obj) { return obj[name]; }\n if (!myOriginalHOP.call(obj, name)) { return pumpkin; }\n // inline remaining relevant cases from canReadPub\n if (endsWith__.test(name)) { return pumpkin; }\n if (name === 'toString') { return pumpkin; }\n if (!isJSONContainer(obj)) { return pumpkin; }\n fastpathRead(obj, name);\n return obj[name];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach(function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)})}", "function NXObject() {}", "function isPrimative(val) { return (typeof val !== 'object') }", "function like (data, duck) {\n var name;\n\n assert.object(data);\n assert.object(duck);\n\n for (name in duck) {\n if (duck.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof duck[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], duck[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "static get observedAttributes() {\n return ['rainbow', 'lang'];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach((function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)}))}", "function testSimpleHole_prototype() {\n var theHole = Object.create({ x: \"in proto\" });\n var theReplacement = \"yay\";\n var serialized = bidar.serialize(theHole, holeFilter);\n var parsed = bidar.parse(serialized, holeFiller);\n\n assert.equal(parsed, theReplacement);\n\n function holeFilter(x) {\n assert.equal(x, theHole);\n return { data: \"blort\" };\n }\n\n function holeFiller(x) {\n assert.equal(x, \"blort\");\n return theReplacement;\n }\n}", "function test() {\n\t// \"ex nihilo\" object creation using the literal\n\t// object notation {}.\n\tvar foo = {\n\t\tname : \"foo\",\n\t\tone : 1,\n\t\ttwo : 2\n\t};\n\n\t// Another \"ex nihilo\" object.\n\tvar bar = {\n\t\ttwo : \"two\",\n\t\tthree : 3\n\t};\n\n\t// Gecko and Webkit JavaScript engines can directly\n\t// manipulate the internal prototype link.\n\t// For the sake of simplicity, let us pretend\n\t// that the following line works regardless of the\n\t// engine used:\n\tbar.__proto__ = foo; // foo is now the prototype of bar.\n\n\t// If we try to access foo's properties from bar\n\t// from now on, we'll succeed.\n\tlog(bar.one) // Resolves to 1.\n\n\t// The child object's properties are also accessible.\n\tlog(bar.three) // Resolves to 3.\n\n\t// Own properties shadow prototype properties\n\tlog(bar.two); // Resolves to \"two\"\n\tlog(foo.name); // unaffected, resolves to \"foo\"\n\tlog(bar.name); // Resolves to \"foo\"\n log(foo.__proto__);\n}", "function wrappedPrimitivePreviewer(className, classObj, objectActor, grip) {\r\n let {_obj} = objectActor;\r\n\r\n if (!_obj.proto || _obj.proto.class != className) {\r\n return false;\r\n }\r\n\r\n let raw = _obj.unsafeDereference();\r\n let v = null;\r\n try {\r\n v = classObj.prototype.valueOf.call(raw);\r\n } catch (ex) {\r\n // valueOf() can throw if the raw JS object is \"misbehaved\".\r\n return false;\r\n }\r\n\r\n if (v === null) {\r\n return false;\r\n }\r\n\r\n let canHandle = GenericObject(objectActor, grip, className === \"String\");\r\n if (!canHandle) {\r\n return false;\r\n }\r\n\r\n grip.preview.wrappedValue = objectActor.getGrip(makeDebuggeeValueIfNeeded(_obj, v));\r\n return true;\r\n}", "function DartObject(o) {\n this.o = o;\n}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function likeVsLikes(toyLikeCount){\n\t\tif (toyLikeCount == 1){\n\t\t\treturn 'Like';\n\t\t} else {\n\t\t\treturn 'Likes';\n\t\t}\n\t}", "constructor(spec) {\n this.cached = /* @__PURE__ */ Object.create(null);\n let instanceSpec = this.spec = {};\n for (let prop in spec)\n instanceSpec[prop] = spec[prop];\n instanceSpec.nodes = OrderedMap.from(spec.nodes), instanceSpec.marks = OrderedMap.from(spec.marks || {}), this.nodes = NodeType$1.compile(this.spec.nodes, this);\n this.marks = MarkType.compile(this.spec.marks, this);\n let contentExprCache = /* @__PURE__ */ Object.create(null);\n for (let prop in this.nodes) {\n if (prop in this.marks)\n throw new RangeError(prop + \" can not be both a node and a mark\");\n let type = this.nodes[prop], contentExpr = type.spec.content || \"\", markExpr = type.spec.marks;\n type.contentMatch = contentExprCache[contentExpr] || (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));\n type.inlineContent = type.contentMatch.inlineContent;\n type.markSet = markExpr == \"_\" ? null : markExpr ? gatherMarks(this, markExpr.split(\" \")) : markExpr == \"\" || !type.inlineContent ? [] : null;\n }\n for (let prop in this.marks) {\n let type = this.marks[prop], excl = type.spec.excludes;\n type.excluded = excl == null ? [type] : excl == \"\" ? [] : gatherMarks(this, excl.split(\" \"));\n }\n this.nodeFromJSON = this.nodeFromJSON.bind(this);\n this.markFromJSON = this.markFromJSON.bind(this);\n this.topNodeType = this.nodes[this.spec.topNode || \"doc\"];\n this.cached.wrappings = /* @__PURE__ */ Object.create(null);\n }", "wordClass(word) {\r\n return {\r\n der: word.artikel == \"der\",\r\n die: word.artikel == \"die\",\r\n das: word.artikel == \"das\",\r\n marked: word.marker\r\n }\r\n }", "function dummyObjects(name, age){\n this.name = name\n this.age = age\n}", "function handleLikes() {\n // Get a random number\n let randomNumber = Math.random();\n // To make it unpredictable, only change the likes if =>\n if (randomNumber < REVEAL_PROBABILITY) {\n defineLikes();\n }\n}", "constructor() { \n \n Like.initialize(this);\n }", "like() {\r\n return this.clone(Comment, \"Like\").postCore();\r\n }", "like() {\r\n return this.getItem().then(i => {\r\n return i.like();\r\n });\r\n }", "added(vrobject){}", "classify(phrase) { return this.clf.classify(phrase) }", "function badIdea(){\n this.idea = \"bad\";\n}", "shouldSerialize(prop, dataKey) {\n const contains = (str, re) => (str.match(re) || []).length > 0;\n const a = contains(dataKey, /\\./g);\n const b = contains(dataKey, /\\[/g);\n return !!prop.object && !(a || b);\n }", "static get observedAttributes(){this.finalize();const e=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nreturn this._classProperties.forEach((t,n)=>{const r=this._attributeNameForProperty(n,t);void 0!==r&&(this._attributeToPropertyMap.set(r,n),e.push(r))}),e}", "function oldAndLoud(object){\n\tobject.age++;\n\tobject.name = object.name.toUpperCase();\n}", "like() {\r\n return this.clone(Item, \"like\").postCore();\r\n }", "function classifyPose() {\n if (pose && working) {\n inputs = [];\n for (let i = 0; i < pose.landmarks.length; i++) {\n inputs.push(pose.landmarks[i][0]);\n inputs.push(pose.landmarks[i][1]);\n inputs.push(pose.landmarks[i][2]);\n }\n brain.classify(inputs, gotResult)\n }\n }", "function PropertyDetection() {}", "constructor()\n {\n this.likes = [];\n }", "async TestLikeDoctorPost(){\n var response = await entity.Likes(6,28,true,true);\n //console.log(response)\n if(response != null){\n console.log(\"\\x1b[32m%s\\x1b[0m\",\"TestDOctorRating Passed\");\n }else{\n console.log(\"\\x1b[31m%s\\x1b[0m\",\"TestDOctorRating Failed\");\n }\n\n }", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function showLikes(likes) {\n\tconsole.log(`THINGS I LIKE:\\n`);\n\tfor(let like of likes) {\n\t\tconsole.log(like);\n\t}\n}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function Nevis() {}", "function Nevis() {}", "function Nevis() {}", "test_primitivesExtended() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitivesExtended);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.PrimitivesExtended\", object.constructor.__getClass());\n Assert.equals(\"alpha16\", object.string);\n }", "function buildObjectsObj(gCloudV, azureCV, minScore = 0.0){\n let objects = [];\n\n if(gCloudV) {// gcloud vision results are available\n let gCloudObjects = gCloudV['localizedObjectAnnotations'];\n\n //apply standard bounding box to all the detected objects\n if(azureCV)// azure computer vision results are available\n gCloudVObjsToCogniBoundingBox(gCloudObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n\n else//need to retrieve image sizes from gcloud (already done and put in the metadata tag of gcloudv with appropriate calls)\n gCloudVObjsToCogniBoundingBox(gCloudObjects, gCloudV['metadata']['width'], gCloudV['metadata']['height']);\n\n for (let gCloudObj of gCloudObjects) {\n if (gCloudObj['score'] > minScore) { //filter out unwanted tags\n objects.push({\n name: gCloudObj['name'],\n mid: (gCloudObj['mid'] && gCloudObj['mid']!= '')? gCloudObj['mid']: undefined,\n confidence: gCloudObj['score'],\n boundingBox: gCloudObj['boundingBox']\n });\n }\n }\n }\n\n if(azureCV){// azure computer vision results are available\n let azureObjects = azureCV['objects'];\n //apply standard bounding box to all the detected objects\n azureCVObjsToCogniBoundingBox(azureObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n for(let aObj of azureObjects){\n if(aObj['confidence'] > minScore) { //filter out unwanted tags\n objects.push({\n name: aObj['object'],\n confidence: aObj['confidence'],\n boundingBox: aObj['boundingBox']\n });\n }\n }\n }\n\n objects = combineObjectsArray(objects);// build an array where labels regarding the same exact object are combined with averaged confidence\n\n objects.sort((a, b) => {\n if(a['confidence']>b['confidence'])\n return -1;\n else if(a['confidence']==b['confidence'])\n return 0;\n else\n return 1;\n });\n\n return objects;\n}", "function V(e){if(null===e||\"[object Object]\"!==function(e){return Object.prototype.toString.call(e)}(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}", "function classifyVideo() {\r\n classifier.classify(vid, gotResult);\r\n\r\n}", "function test_nountag_does_not_think_it_has_watch_tag_when_it_does_not() {\n Assert.equal(TagNoun.fromJSON(\"watch\"), undefined);\n}", "function v11(v12,v13) {\n const v15 = v11(Object,Function);\n // v15 = .unknown\n const v16 = Object(v13,v8,0,v6);\n // v16 = .object()\n const v17 = 0;\n // v17 = .integer\n const v18 = 1;\n // v18 = .integer\n const v19 = 512;\n // v19 = .integer\n const v20 = \"-1024\";\n // v20 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v21 = isFinite;\n // v21 = .function([.anything] => .boolean)\n const v23 = [1337];\n // v23 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v24 = {};\n // v24 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v25 = v23;\n const v26 = -29897853;\n // v26 = .integer\n const v27 = \"replace\";\n // v27 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v28 = Boolean;\n // v28 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v30 = [13.37,13.37];\n // v30 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v31 = 1337;\n // v31 = .integer\n let v32 = 13.37;\n const v36 = [13.37,13.37,13.37];\n // v36 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v38 = [1337,1337];\n // v38 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v39 = [13.37,1337,v38,1337,\"-128\",13.37,\"-128\",\"-128\",2147483647,1337];\n // v39 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v40 = {__proto__:v36,length:v39};\n // v40 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"length\"])\n const v41 = \"0\";\n // v41 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v42 = -4130093409;\n // v42 = .integer\n const v44 = {b:2147483647,e:v38,valueOf:v36};\n // v44 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"b\", \"valueOf\", \"e\"])\n const v45 = \"k**baeaDif\";\n // v45 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v46 = 65536;\n // v46 = .integer\n const v47 = \"k**baeaDif\";\n // v47 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v48 = 13.37;\n // v48 = .float\n const v50 = [13.37,13.37];\n // v50 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v51 = ~v50;\n // v51 = .boolean\n const v53 = [13.37];\n // v53 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n let v54 = v53;\n const v55 = gc;\n // v55 = .function([] => .undefined)\n const v58 = [13.37,13.37,13.37,13.37];\n // v58 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v60 = [1337,1337,1337,1337];\n // v60 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v61 = [3697200800,v58,v60];\n // v61 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v62 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v61};\n // v62 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"length\", \"constructor\", \"toString\", \"valueOf\"])\n const v65 = [13.37,13.37,13.37,13.37];\n // v65 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v67 = [1337,1337,1337,1337];\n // v67 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v68 = [3697200800,v65,v67];\n // v68 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v69 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v68};\n // v69 = .object(ofGroup: Object, withProperties: [\"e\", \"constructor\", \"__proto__\", \"length\", \"toString\", \"valueOf\"])\n const v70 = Object;\n // v70 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n function v71(v72) {\n }\n const v74 = [13.37];\n // v74 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v75 = 1337;\n // v75 = .integer\n const v76 = v44 ** 13.37;\n // v76 = .integer | .float | .bigint\n function v77(v78,v79,v80,v81,v82) {\n }\n let v83 = v74;\n const v84 = \"2\";\n // v84 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v85 = \"2\";\n // v85 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v88 = [13.37,13.37,1337,13.37];\n // v88 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v89(v90,v91,v92) {\n }\n const v94 = [1337,1337,1337,1337];\n // v94 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v95 = [3697200800,v88,v94];\n // v95 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v96(v97,v98) {\n }\n const v99 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,d:v95};\n // v99 = .object(ofGroup: Object, withProperties: [\"toString\", \"length\", \"constructor\", \"__proto__\", \"e\", \"d\"])\n let v100 = 13.37;\n const v101 = typeof v74;\n // v101 = .string\n const v102 = \"symbol\";\n // v102 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v103 = 3697200800;\n // v103 = .integer\n const v104 = \"2\";\n // v104 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v105 = Boolean;\n // v105 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v106 = Function;\n // v106 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v107 = 13.37;\n // v107 = .float\n const v108 = 1337;\n // v108 = .integer\n const v109 = \"2\";\n // v109 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v110 = Function;\n // v110 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v112 = [13.37,13.37,13.37,13.37];\n // v112 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v113 = 1337;\n // v113 = .integer\n let v114 = 13.37;\n const v116 = {...3697200800,...3697200800};\n // v116 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n const v117 = Object;\n // v117 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v118 = Function;\n // v118 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v119 = {};\n // v119 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v120 = v119;\n const v121 = (3697200800).constructor;\n // v121 = .unknown\n function v122(v123,v124) {\n }\n const v125 = Promise;\n // v125 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"race\", \"allSettled\", \"reject\", \"all\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"]))\n const v128 = 4;\n // v128 = .integer\n let v129 = 0;\n const v131 = [13.37,13.37,13.37,13.37];\n // v131 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v133 = [1337,1337,1337,1337];\n // v133 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v134 = [3697200800,v131,v133];\n // v134 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v135 = Object;\n // v135 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v136 = -944747134;\n // v136 = .integer\n const v139 = [13.37,13.37,13.37,13.37];\n // v139 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v141 = [1337,1337,1337,1337];\n // v141 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v142 = [3697200800,v139,v141];\n // v142 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v143 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v142};\n // v143 = .object(ofGroup: Object, withProperties: [\"toString\", \"constructor\", \"e\", \"__proto__\", \"valueOf\", \"length\"])\n let v144 = v143;\n const v145 = gc;\n // v145 = .function([] => .undefined)\n let v146 = 13.37;\n const v150 = [13.37,13.37,13.37,Function];\n // v150 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v152 = [1337,1337,1337,1337];\n // v152 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v153 = [3697200800,v150,v152];\n // v153 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v154 = v153 + 1;\n // v154 = .primitive\n let v155 = 0;\n const v156 = v155 + 1;\n // v156 = .primitive\n const v158 = \"2\";\n // v158 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v160 = [13.37,13.37,13.37,13.37];\n // v160 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v162 = 0;\n // v162 = .integer\n const v163 = [1337,1337,1337,1337];\n // v163 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v164 = [3697200800,1337,v163];\n // v164 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v166 = 1337;\n // v166 = .integer\n let v167 = 2594067260;\n const v169 = 4;\n // v169 = .integer\n let v170 = 0;\n const v171 = v167 + 1;\n // v171 = .primitive\n const v172 = {__proto__:3697200800,constructor:v163,e:3697200800,length:13.37,toString:3697200800,valueOf:v164};\n // v172 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"constructor\", \"valueOf\", \"length\", \"toString\"])\n const v173 = 0;\n // v173 = .integer\n const v174 = 5;\n // v174 = .integer\n const v175 = 2937513072;\n // v175 = .integer\n const v176 = Object;\n // v176 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v177 = v172.constructor;\n // v177 = .unknown\n const v178 = 0;\n // v178 = .integer\n const v179 = 1;\n // v179 = .integer\n try {\n } catch(v180) {\n const v182 = [13.37,13.37,13.37,13.37];\n // v182 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v183 = v182.__proto__;\n // v183 = .object()\n function v185(v186) {\n }\n const v187 = Object >>> v183;\n // v187 = .integer | .bigint\n }\n function v188(v189,v190,v191,v192,...v193) {\n }\n}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "transient private internal function m185() {}", "function rekognizeLabels(bucket, key) {\n let params = {\n Image: {\n S3Object: {\n Bucket: bucket,\n Name: key\n }\n },\n MaxLabels: 3,\n MinConfidence: 80\n };\n\n return rekognition.detectLabels(params).promise()\n}", "test_doNotRetainAnno(){\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.doNotRetainAnno);\n let object1 = translator.decode(text).getRoot();\n let object2 = translator.decode(text).getRoot();\n\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object1.constructor.__getClass());\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object2.constructor.__getClass());\n Assert.notEquals(object1, object2);\n }", "function LK_likeIt(elem) {\n var likeGroup = elem.getAttribute(LK_LIKEGROUP);\n var likeValue = elem.getAttribute(LK_LIKEVALUE);\n localStorage[likeGroup] = likeValue;\n\n // Change the style of the liker nodes\n var siblings = elem.parentNode.childNodes;\n for (var i = 0; i < siblings.length; i++) {\n if (siblings[i].style) { \n LK_applyNormalStyle(siblings[i]);\n }\n }\n LK_applySelectedStyle(elem, likeValue);\n\n // Change the value of any mini likers\n var allSpans = document.getElementsByTagName('span');\n for (var i = 0; i < allSpans.length; i++) {\n var span = allSpans[i];\n if (span.getAttribute(LK_LIKEGROUP) == likeGroup) {\n if (span.getAttribute(LK_LIKETYPE) == 'mini') {\n span.innerHTML = LK_MAPPINGS[likeValue].label;\n LK_applySelectedStyle(allSpans[i], likeValue);\n }\n }\n }\n}", "function OOPExample(who) {\n this.me = who;\n}", "getLikes(state, data) {\n state.likes = data\n }", "function _isAlternativeRecognitionResult(obj) {\r\n return obj && typeof obj === 'object';\r\n}", "function addLikes() {\n if (propLike?.includes(user.username)) {\n let index = propLike.indexOf(user.username);\n let removeLike = [\n ...propLike.slice(0, index),\n ...propLike.slice(index + 1),\n ];\n setLikeGet(removeLike);\n setPropLike(removeLike);\n setRedLike(\"\");\n\n addToLike(eventid, removeLike);\n } else {\n let likesArr = [...propLike, `${user.username}`];\n\n setLikeGet(likesArr);\n setPropLike(likesArr);\n setRedLike(\"red\");\n addToLike(eventid, likesArr);\n }\n }", "function LiteralObject() {\r\n}", "function Komunalne() {}", "function Bevy() {}", "function Prediction() {\n this.score = {};\n}", "function Object() {}", "function Object() {}", "function canEnumPub(obj, name) {\n if (obj === null) { return false; }\n if (obj === void 0) { return false; }\n name = String(name);\n if (obj[name + '_canEnum___']) { return true; }\n if (endsWith__.test(name)) { return false; }\n if (!isJSONContainer(obj)) { return false; }\n if (!myOriginalHOP.call(obj, name)) { return false; }\n fastpathEnum(obj, name);\n if (name === 'toString') { return true; }\n fastpathRead(obj, name);\n return true;\n }", "function Obj(){ return Literal.apply(this,arguments) }", "test_primitives() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitives);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.Primitives\", object.constructor.__getClass());\n Assert.equals(\"alpha9\", object.string);\n }", "function hello()\n{\n /* ATTRIBUTES */\n this.coolbeans = 'class';\n this.something = 'hello-class';\n\n}", "function test_cluster_tagged_crosshair_op_vsphere65() {}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "constructor(papa,mummy,sivlings,belongs,loving_bro,favs_bro){\n super(papa,mummy,sivlings,belongs)\n this.loving_bro=loving_bro\n this.favs_bro=favs_bro\n }", "function v8(v9,v10) {\n const v16 = [1337,1337];\n // v16 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v17 = [\"536870912\",-3848843708,v16,-3848843708,1337,13.37,13.37,WeakMap,-3848843708];\n // v17 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v18 = {constructor:13.37,e:v16};\n // v18 = .object(ofGroup: Object, withProperties: [\"constructor\", \"e\", \"__proto__\"])\n const v19 = {__proto__:-3848843708,a:v18,b:-3848843708,constructor:1337,d:v18,e:v17,length:WeakMap};\n // v19 = .object(ofGroup: Object, withProperties: [\"d\", \"b\", \"a\", \"__proto__\", \"e\", \"constructor\", \"length\"])\n const v21 = new Float64Array(v19);\n // v21 = .object(ofGroup: Float64Array, withProperties: [\"byteOffset\", \"constructor\", \"buffer\", \"__proto__\", \"byteLength\", \"length\"], withMethods: [\"map\", \"values\", \"subarray\", \"find\", \"fill\", \"set\", \"findIndex\", \"some\", \"reduceRight\", \"reverse\", \"join\", \"includes\", \"entries\", \"reduce\", \"every\", \"copyWithin\", \"sort\", \"forEach\", \"lastIndexOf\", \"indexOf\", \"filter\", \"slice\", \"keys\"])\n v6[6] = v7;\n v7.toString = v9;\n }", "function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol[\"a\" /* default */]) {\n classObject.prototype[nodejsCustomInspectSymbol[\"a\" /* default */]] = fn;\n }\n}", "annotate(message: string, data: Object) {\n this.message = message;\n this.data = assign(this.data, data);\n }", "function encodeObject(o) {\n if (_.isNumber(o)) {\n if (_.isNaN(o)) {\n return ['SPECIAL_FLOAT', 'NaN'];\n } else if (o === Infinity) {\n return ['SPECIAL_FLOAT', 'Infinity'];\n } else if (o === -Infinity) {\n return ['SPECIAL_FLOAT', '-Infinity'];\n } else {\n return o;\n }\n } else if (_.isString(o)) {\n return o;\n } else if (_.isBoolean(o) || _.isNull(o) || _.isUndefined(o)) {\n return ['JS_SPECIAL_VAL', String(o)];\n } else if (typeof o === 'symbol') {\n // ES6 symbol\n return ['JS_SPECIAL_VAL', String(o)];\n } else {\n // render these as heap objects\n\n // very important to use _.has since we don't want to\n // grab the property in your prototype, only in YOURSELF ... SUBTLE!\n if (!_.has(o, 'smallObjId_hidden_')) {\n // make this non-enumerable so that it doesn't show up in\n // console.log() or other inspector functions\n Object.defineProperty(o, 'smallObjId_hidden_', { value: smallObjId,\n enumerable: false });\n smallObjId++;\n }\n assert(o.smallObjId_hidden_ > 0);\n\n var ret = ['REF', o.smallObjId_hidden_];\n\n if (encodedHeapObjects[String(o.smallObjId_hidden_)] !== undefined) {\n return ret;\n }\n else {\n assert(_.isObject(o));\n\n var newEncodedObj = [];\n encodedHeapObjects[String(o.smallObjId_hidden_)] = newEncodedObj;\n\n var i;\n\n if (_.isFunction(o)) {\n var funcProperties = []; // each element is a pair of [name, encoded value]\n\n var encodedProto = null;\n if (_.isObject(o.prototype)) {\n // TRICKY TRICKY! for inheritance to be displayed properly, we\n // want to find the prototype of o.prototype and see if it's\n // non-empty. if that's true, then even if o.prototype is\n // empty (i.e., has no properties of its own), then we should\n // still encode it since its 'prototype' \"uber-hidden\n // property\" is non-empty\n var prototypeOfPrototype = Object.getPrototypeOf(o.prototype);\n if (!_.isEmpty(o.prototype) ||\n (_.isObject(prototypeOfPrototype) && !_.isEmpty(prototypeOfPrototype))) {\n encodedProto = encodeObject(o.prototype);\n }\n }\n\n if (encodedProto) {\n funcProperties.push(['prototype', encodedProto]);\n }\n\n // now get all of the normal properties out of this function\n // object (it's unusual to put properties in a function object,\n // but it's still legal!)\n var funcPropPairs = _.pairs(o);\n for (i = 0; i < funcPropPairs.length; i++) {\n funcProperties.push([funcPropPairs[i][0], encodeObject(funcPropPairs[i][1])]);\n }\n\n var funcCodeString = o.toString();\n\n /*\n\n #craftsmanship -- make nested functions look better by indenting\n the first line of a nested function definition by however much\n the LAST line is indented, ONLY if the last line is simply a\n single ending '}'. otherwise it will look ugly since the\n function definition doesn't start out indented, like so:\n\nfunction bar(x) {\n globalZ += 100;\n return x + y + globalZ;\n }\n\n */\n var codeLines = funcCodeString.split('\\n');\n if (codeLines.length > 1) {\n var lastLine = _.last(codeLines);\n if (lastLine.trim() === '}') {\n var lastLinePrefix = lastLine.slice(0, lastLine.indexOf('}'));\n funcCodeString = lastLinePrefix + funcCodeString; // prepend!\n }\n }\n\n newEncodedObj.push('JS_FUNCTION',\n o.name,\n funcCodeString, /* code string*/\n funcProperties.length ? funcProperties : null, /* OPTIONAL */\n null /* parent frame */);\n } else if (_.isArray(o)) {\n newEncodedObj.push('LIST');\n for (i = 0; i < o.length; i++) {\n newEncodedObj.push(encodeObject(o[i]));\n }\n } else if (o.__proto__.toString() === canonicalSet.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n newEncodedObj.push('SET');\n // ES6 Set (TODO: add WeakSet)\n for (let item of o) {\n newEncodedObj.push(encodeObject(item));\n }\n } else if (o.__proto__.toString() === canonicalMap.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n // ES6 Map (TODO: add WeakMap)\n newEncodedObj.push('DICT'); // use the Python 'DICT' type since it's close enough; adjust display in frontend\n for (let [key, value] of o) {\n newEncodedObj.push([encodeObject(key), encodeObject(value)]);\n }\n } else {\n // a true object\n\n // if there's a custom toString() function (note that a truly\n // prototypeless object won't have toString method, so check first to\n // see if toString is *anywhere* up the prototype chain)\n var s = (o.toString !== undefined) ? o.toString() : '';\n if (s !== '' && s !== '[object Object]') {\n newEncodedObj.push('INSTANCE_PPRINT', 'object', s);\n } else {\n newEncodedObj.push('INSTANCE', '');\n var pairs = _.pairs(o);\n for (i = 0; i < pairs.length; i++) {\n var e = pairs[i];\n newEncodedObj.push([encodeObject(e[0]), encodeObject(e[1])]);\n }\n\n var proto = Object.getPrototypeOf(o);\n if (_.isObject(proto) && !_.isEmpty(proto)) {\n //log('obj.prototype', proto, proto.smallObjId_hidden_);\n // I think __proto__ is the official term for this field,\n // *not* 'prototype'\n newEncodedObj.push(['__proto__', encodeObject(proto)]);\n }\n }\n }\n\n return ret;\n }\n\n }\n assert(false);\n}", "function dist_index_esm_contains(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}", "function isRawPostcodeObject(o, additionalAttr, blackListedAttr) {\n\tif (!additionalAttr) additionalAttr = [];\n\tif (!blackListedAttr) blackListedAttr = [];\n\tisSomeObject(o, rawPostcodeAttributes, additionalAttr, blackListedAttr);\n}", "function _meta_(v,m){var ms=v['__meta__']||{};for(var k in m){ms[k]=m[k]};v['__meta__']=ms;return v}", "function Animal() {\n this.kind = \"Dog\"\n}", "function Kitten(name, photo, interests, isGoodWithKids, isGoodWithDogs, isGoodWithCats) {\n this.name = name;\n this.photo = photo;\n this.interests = interests;\n this.isGoodWithKids = isGoodWithKids;\n this.isGoodWithCats = isGoodWithCats;\n this.isGoodWithDogs = isGoodWithDogs;\n}", "getMeta () {\n }", "function np(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function Obj() {}", "function isFriend(name, object) {\n//use hasWord function to check object names array\n// console.log(object);\n// console.log(name);\n//conditional to check for property\nif (object['friends'] !== undefined) {\nreturn hasWord(object.friends.join(' '), name);\n}\nelse {return false};\n \n}", "function test_fail_hole_prototype() {\n var obj = Object.create({ stuff: \"in prototype\" });\n obj.foo = \"bar\";\n\n function f1() {\n bidar.serialize(obj);\n }\n assert.throws(f1, /Hole-ful graph, but no hole filter/);\n}", "function Person(saying) {\n this.saying = saying;\n /*\n return {\n dumbObject: true\n }\n */\n}", "transient private protected internal function m182() {}", "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "function Surrogate(){}", "function Surrogate(){}", "function Surrogate(){}", "static serialize(obj, allowPrimitives, fallbackToJson, requireJsonType = false) {\n if (allowPrimitives) {\n if (typeof obj === \"string\") {\n return this.serializePrimitive(obj, \"string\");\n } else if (typeof obj === \"number\") {\n return this.serializePrimitive(obj, \"double\");\n } else if (Buffer.isBuffer(obj)) {\n return this.serializePrimitive(obj, \"bytes\");\n } else if (typeof obj === \"boolean\") {\n return this.serializePrimitive(obj, \"bool\");\n } else if (Long.isLong(obj)) {\n return this.serializePrimitive(obj, \"int64\");\n }\n }\n if (obj.constructor && typeof obj.constructor.encode === \"function\" && obj.constructor.$type) {\n return Any.create({\n // I have *no* idea why it's type_url and not typeUrl, but it is.\n type_url: \"type.googleapis.com/\" + AnySupport.fullNameOf(obj.constructor.$type),\n value: obj.constructor.encode(obj).finish()\n });\n } else if (fallbackToJson && typeof obj === \"object\") {\n let type = obj.type;\n if (type === undefined) {\n if (requireJsonType) {\n throw new Error(util.format(\"Fallback to JSON serialization supported, but object does not define a type property: %o\", obj));\n } else {\n type = \"object\";\n }\n }\n return Any.create({\n type_url: CloudStateJson + type,\n value: this.serializePrimitiveValue(stableJsonStringify(obj), \"string\")\n });\n } else {\n throw new Error(util.format(\"Object %o is not a protobuf object, and hence can't be dynamically \" +\n \"serialized. Try passing the object to the protobuf classes create function.\", obj));\n }\n }" ]
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992", "0.46990207", "0.4690639", "0.46904448", "0.46862254", "0.46716532", "0.46667543", "0.46522382", "0.46354175", "0.46053663", "0.46017453", "0.45926702", "0.45891586", "0.45877746", "0.458541", "0.45851982", "0.45847243", "0.4584686", "0.458378", "0.45767823", "0.45753202", "0.45753202", "0.45753202", "0.45713404", "0.45637134", "0.45637134", "0.4557141", "0.4557141", "0.4557141", "0.45494914", "0.45366898", "0.45342454", "0.4533338", "0.45322663", "0.45229813", "0.452288", "0.452288", "0.45159692", "0.45102093", "0.45099118", "0.45062032", "0.4506134", "0.45033473", "0.4502599", "0.44998378", "0.4497197", "0.44843012", "0.44764578", "0.44738895", "0.44715428", "0.44715428", "0.4471341", "0.44594073", "0.44552016", "0.44538808", "0.44522536", "0.44464657", "0.44464657", "0.4443469", "0.4443427", "0.44433454", "0.4437557", "0.4436382", "0.4430658", "0.4429719", "0.4428169", "0.44260293", "0.4420813", "0.44155774", "0.44130567", "0.4406073", "0.4401904", "0.44010627", "0.43994573", "0.43948644", "0.43847254", "0.43847254", "0.43830302", "0.43830302", "0.43830302", "0.4381413" ]
0.0
-1
funcion DataTablelibreria ///LENADO DE TABLA POR DEFECTO
function addRowDT(data) { //DESCRIPCION : Funcion que me crea el listado de rutas en el body del DataTable for (var i = 0; i < data.length; i++) { var aux; if (data[i].marcaBaja == 0) { aux = btnEditar + btnDesactivar } else { aux = btnEditar + btnActivar } tabla.fnAddData([ data[i].ntraTipoMovimiento, data[i].descripcion, data[i].codTipoRegistro, data[i].tipoRegistro, aux ]); } $("body").on('click', '.btnEditar', function () { lblTitle.text("Actualizar Tipo de Movimiento"); btnGuardar.css("display", "block"); btnRegistrar.css("display", "none"); Mmensaje.css('display', 'none'); var tr = $(this).parent().parent(); pCodTipoMovimiento.val(table.row(tr).data()[0]); pDescripcion.val(table.row(tr).data()[1]); tregistro.val(table.row(tr).data()[2]); }) $("body").on('click', '.btnBlocked', function () { //Obtengo los valores de mi tr seleccionado. var tr = $(this).parent().parent(); var codTipoMovimiento = table.row(tr).data()[0]; swal({ title: "Se desactivará el registro", text: "¿Esta seguro que desea desactivar el registro?", icon: "warning", buttons: true, dangerMode: true, }) //Promesa que me trae el valor true al confirmar OK. .then((willDelete) => { if (willDelete) { DesactivarTipoMov(codTipoMovimiento) swal("Se desactivó el Registro", { icon: "success", }); } else { swal("Se canceló la desactivación"); } }); }); $("body").on('click', '.btnCheck', function () { //Obtengo los valores de mi tr seleccionado. var tr = $(this).parent().parent(); var codTipoMovimiento = table.row(tr).data()[0]; swal({ title: "Se activará el registro", text: "¿Esta seguro que desea activar el registro?", icon: "success", buttons: true, dangerMode: false, }) //Promesa que me trae el valor true al confirmar OK. .then((result) => { if (result) { ActivarTipoMov(codTipoMovimiento) swal("Se activó el Registro", { icon: "success", }); } else { swal("Se canceló la activación"); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listar() {\n\n\t\ttabla=$('#resolucion_data').dataTable({\n\t\t\t\"aProcessing\":true,//Activamos procesamiento de datatable\n\t\t\t\"aServerSide\":true,//Paginacion y filtrado realizados por el servidor\n\t\t\tdom:'Bfrtip',//Definimos los elementos del control de table\n\t\t\tbuttons:[\n\t\t\t\t'copyHtml5',\n\t\t\t\t'excelHtml5',\n\t\t\t\t'pdf'//para los botones en el datatable\n\t\t\t\t],\n\t\t\t\"ajax\":\n\t\t\t{\n\t\t\t\turl:'../ajax/resolucion.php?op=buscar_resolucion',//enviamos el parametro \n\t\t\t\ttype:\"get\",//el tipo del parametro\n\t\t\t\tdataType:\"json\",//formato de la data\n\n\t\t\t\terror: function (e) {\n\t\t\t\t\tconsole.log(e.responseText);//para hacer la verificacion de errores\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"bDestroy\":true,\n\t\t\t\"responsive\":true,\n\t\t\t\"bInfo\":true,//informacion del los datatable\n\t\t\t\"iDisplayLength\":20,//Pora cada 10 registros hace una paginacion\n\t\t\t\"order\":[[0,\"desc\"]],//Ordenar (Columna,orden)\n \t\t\t\n \t\t\t\"language\": {\n \n\t\t\t \"sProcessing\": \"Procesando...\",\n\t\t\t \n\t\t\t \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\t\t\t \n\t\t\t \"sZeroRecords\": \"No se encontraron resultados\",\n\t\t\t \n\t\t\t \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\t\t\t \n\t\t\t \"sInfo\": \"Mostrando un total de _TOTAL_ registros\",\n\t\t\t \n\t\t\t \"sInfoEmpty\": \"Mostrando un total de 0 registros\",\n\t\t\t \n\t\t\t \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\t\t\t \n\t\t\t \"sInfoPostFix\": \"\",\n\t\t\t \n\t\t\t \"sSearch\": \"Buscar:\",\n\t\t\t \n\t\t\t \"sUrl\": \"\",\n\t\t\t \n\t\t\t \"sInfoThousands\": \",\",\n\t\t\t \n\t\t\t \"sLoadingRecords\": \"Cargando...\",\n\t\t\t \n\t\t\t \"oPaginate\": {\n\t\t\t \n\t\t\t \"sFirst\": \"Primero\",\n\t\t\t \n\t\t\t \"sLast\": \"Último\",\n\t\t\t \n\t\t\t \"sNext\": \"Siguiente\",\n\t\t\t \n\t\t\t \"sPrevious\": \"Anterior\"\n\t\t\t \n\t\t\t },\n\t\t\t \n\t\t\t \"oAria\": {\n\t\t\t \n\t\t\t \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\t\t\t \n\t\t\t \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\t\t\t\n\t\t\t }\n\n\t\t\t }//cerrando language\n\t\t}).DataTable();\n\t}", "function listar() {\n tabla = $(\"#inventario\").DataTable({\n serverSide: true,\n responsive: true,\n ajax: \"api/reporte/inventario\",\n dom: \"Bfrtip\",\n iDisplayLength: 10,\n buttons: [\n \"pageLength\",\n \"copyHtml5\",\n {\n extend: \"excelHtml5\",\n autoFilter: true,\n sheetnombre: \"Exported data\"\n },\n \"csvHtml5\",\n {\n extend: \"pdfHtml5\",\n orientation: \"landscape\",\n pageSize: \"LEGAL\"\n }\n ],\n columns: [\n { data: \"nombre\", name: \"ingrediente.nombre\" },\n { data: \"disponible\", name: \"inventario.disponible\" },\n { data: \"costo\", name: \"inventario.costo\"},\n { data: \"nota\", name: \"inventario.nota\"},\n { data: \"fecha_ingreso\", name: \"inventario.fecha_ingreso\"},\n ],\n order: [[1, \"asc\"]]\n // rowGroup: {\n // dataSrc: \"role\"\n // }\n });\n }", "function CargarTablaPorFechasEmision()\n {\n var table = $(\"#TablaPolizaPorFecha\").DataTable({\n //Especificacion de Ancho y Alto de la tabla\n \"rowCallback\": function( row, data, index ) {\n if ( data.Activo == \"1\" ) \n {\n $('td:eq(3)', row).html( '<b>Activo</b>' );\n $('td:eq(3)', row).css('background-color', '#98FEE6');\n }\n else\n {\n $('td:eq(3)', row).html( '<b>Inactivo</b>' );\n $('td:eq(3)', row).css('background-color', '#FEE698');\n }\n $('td:eq(0)', row).css('background-color', '#ECECEC');\n },\n \"scrollY\": \"200px\",\n \"scrollX\": \"600px\",\n \"destroy\": true,\n //Especificaciones de las Columnas que vienen y deben mostrarse\n \"columns\" : [\n { data : 'Idn' },\n { data : 'Codigo' },\n { data : 'Cliente.CedulaRif' },\n { data : 'Cliente.Nombre' },\n { data : 'Cliente.Apellido' },\n { data : 'Analista.CedulaRif' },\n { data : 'Analista.Nombre' },\n { data : 'Aseguradora.Nombre' },\n { data : 'Relacionado.Cedula' },\n { data : 'Relacionado.Nombre' },\n { data : 'Relacionado.Apellido' },\n { data : 'Producto.Nombre' },\n { data : 'Productor.RIF' },\n { data : 'Productor.Nombre' },\n { data : 'Moneda.Nombre' },\n { data : 'TipoPoliza.Nombre' },\n { data : 'TipoPago.Nombre' },\n { data : 'EstatusPoliza.Nombre' },\n { data : 'Comision' },\n { data : 'FechaEmision' },\n { data : 'FechaInicio' },\n { data : 'FechaRegistro' },\n { data : 'FechaVencimiento' },\n { data : 'Observacion' },\n { data : 'Deducible' },\n { data : 'SumaAseguradora' },\n { data : 'PrimaAseguradora' }\n \n ,\n { data : 'Activo' }\n ], \n //Especificaciones de la URL del servicio para cargar la tabla\n \"ajax\": {\n url:''+ global + '/Poliza/Fecha',\n dataSrc : ''\n }\n\n }); \n //Al hacer clic en la tabla carga los campos en los TXT\n}", "function CargarTablaPorFechasRegistro()\n {\n var table = $(\"#TablaPolizaPorFecha\").DataTable({\n //Especificacion de Ancho y Alto de la tabla\n \"rowCallback\": function( row, data, index ) {\n if ( data.Activo == \"1\" ) \n {\n $('td:eq(3)', row).html( '<b>Activo</b>' );\n $('td:eq(3)', row).css('background-color', '#98FEE6');\n }\n else\n {\n $('td:eq(3)', row).html( '<b>Inactivo</b>' );\n $('td:eq(3)', row).css('background-color', '#FEE698');\n }\n $('td:eq(0)', row).css('background-color', '#ECECEC');\n },\n \"scrollY\": \"200px\",\n \"scrollX\": \"600px\",\n \"destroy\": true,\n //Especificaciones de las Columnas que vienen y deben mostrarse\n \"columns\" : [\n { data : 'Idn' },\n { data : 'Codigo' },\n { data : 'Cliente.CedulaRif' },\n { data : 'Cliente.Nombre' },\n { data : 'Cliente.Apellido' },\n { data : 'Analista.CedulaRif' },\n { data : 'Analista.Nombre' },\n { data : 'Aseguradora.Nombre' },\n { data : 'Relacionado.Cedula' },\n { data : 'Relacionado.Nombre' },\n { data : 'Relacionado.Apellido' },\n { data : 'Producto.Nombre' },\n { data : 'Productor.RIF' },\n { data : 'Productor.Nombre' },\n { data : 'Moneda.Nombre' },\n { data : 'TipoPoliza.Nombre' },\n { data : 'TipoPago.Nombre' },\n { data : 'EstatusPoliza.Nombre' },\n { data : 'Comision' },\n { data : 'FechaEmision' },\n { data : 'FechaInicio' },\n { data : 'FechaRegistro' },\n { data : 'FechaVencimiento' },\n { data : 'Observacion' },\n { data : 'Deducible' },\n { data : 'SumaAseguradora' },\n { data : 'PrimaAseguradora' }\n \n ,\n { data : 'Activo' }\n ], \n //Especificaciones de la URL del servicio para cargar la tabla\n \"ajax\": {\n url: \"\"+ global + \"/Polizas/FechaEmision\",\n dataSrc : ''\n }\n\n }); \n //Al hacer clic en la tabla carga los campos en los TXT\n\n\n }", "function listar()\n{\n\t tabla=$('#listado').dataTable(\n\t{\n\t\t\"aProcessing\": true,//Activamos el procesamiento del datatables\n\t \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n\t dom: 'Bfrtip',//Definimos los elementos del control de tabla\n\t buttons: [\t\t \n\t \n\t\t 'copyHtml5',\n\t\t 'excelHtml5',\n\t\t 'csvHtml5',\n\t\t 'pdf'\n\t\t ],\n\t\t\"ajax\":\n\t\t\t\t{\n\n\t\t\turl: '../controller/persona.php?op=listarc',\n type: \"GET\",\n\t\t\t\t\tdataType : \"json\",\t\t\t\t\t\t\n\t\t\t\t\terror: function(e){\n\t\t\t\t\t\tconsole.log(e.responseText);\t\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\"bDestroy\": true,\n\t\t\"iDisplayLength\": 5,//Paginación\n\t \"order\": [[ 0, \"desc\" ]]//Ordenar (columna,orden)\n\t}).DataTable();\n}", "function listarArticulos(){\n\ttabla=$('#tblarticulos').dataTable({\n\t\t\"aProcessing\": true,//activamos el procedimiento del datatable\n\t\t\"aServerSide\": true,//paginacion y filrado realizados por el server\n\t\tdom: 'Bfrtip',//definimos los elementos del control de la tabla\n\t\tbuttons: [\n\n\t\t],\n\t\t\"ajax\":\n\t\t{\n\t\t\turl:'../ajax/venta.php?op=listarArticulos',\n\t\t\ttype: \"get\",\n\t\t\tdataType : \"json\",\n\t\t\terror:function(e){\n\t\t\t\tconsole.log(e.responseText);\n\t\t\t}\n\t\t},\n\t\t\"bDestroy\":true,\n\t\t\"iDisplayLength\":5,//paginacion\n\t\t\"order\":[[0,\"desc\"]]//ordenar (columna, orden)\n\t}).DataTable();\n}", "function tabla() {\n\n $('#tblRol').dataTable({\n \"bProcessing\": true,\n \"sServerMethod\": 'GET',\n \"bServerSide\": true,\n \"bRetrieve\": true,\n \"info\": false,\n \"bFilter\": true,\n \"ordering\": true,\n \"bAutoWidth\": false,\n \"bLengthChange\": false,\n \"bPaginate\": true,\n \"iDisplayLength\": 10,\n \"sAjaxSource\": \"Departamentos/consultarDatosTablaDepartamentos.php\",\n \"order\": [[1, \"asc\"]],\n \"aoColumnDefs\": [{\n \"aTargets\": [2],\n \"sType\": \"html\"\n , \"mRender\": function (date, type, full) {\n return (\"\" + full[2].toString());\n }\n }],\n \"oLanguage\": {\n \"oPaginate\": {\n \"sFirst\": \"Primera\",\n \"sPrevious\": \"Anterior\",\n \"sNext\": \"Siguiente\",\n \"sLast\": \"&Uacute;ltima\"\n },\n \"sZeroRecords\": \"No se encontraron registros\",\n \"sEmptyTable\": \"No hay registros\",\n \"sSearch\": \"B&uacute;squeda R&aacute;pida\"\n }\n }).fnSetFilteringDelay(250);\n}", "function getCombustivelTable() {\n //Populates Table with Json\n tableCombustivel = $('table#table-combustivel').DataTable({\n ajax: {\n url: urlApi + \"combustivel\",\n contentType: 'application/json; charset=UTF-8',\n dataType: 'json'\n },\n columns: [{\n data: \"id\"\n }, {\n data: \"tipo\"\n }],\n columnDefs: [\n {\n width: '20%',\n targets: 'combIdCol'\n }\n ],\n select: true,\n lengthChange: false,\n pageLength: 5,\n dom: 'lrti<\"right\"p>',\n language: {\n url: \"../../doc/Portuguese-Brasil.json\"\n }\n });\n}", "function cargarInformacionEnTabla(data)\n{\n\t\t\n\t\t//se destruye el datatable al inicio\n\tif(typeof table !== \"undefined\")\n\t{\n\t\t\n table.destroy(); \n $('#tablaModulos').empty();\n }\n\t\t\n\t\t\t\n\t\t table = $('#tablaModulos').DataTable({\n\t\t\t\"data\": data,\n\t\t\tcolumns: [\n\t\t\t{ data: \"bloques\"},\n\t\t\t{ data: \"LUNES\"},\n\t\t\t{ data: \"MARTES\"},\n\t\t\t{ data: \"MIERCOLES\" },\n\t\t\t{ data: \"JUEVES\" },\n\t\t\t{ data: \"VIERNES\" },\n\t\t\t{ data: \"SABADO\" },\n\t\t\t{ data: \"DOMINGO\" },\n\t\t\t\n\t\t\t// {data: null, className: \"center\", defaultContent: '<a id=\"view-link\" class=\"edit-link\" href=\"#\" title=\"Edit\">Estudiantes por Salón </a>'},\n\t\t\t// {data: null, className: \"center\", defaultContent: '<a id=\"asistencias-link\" class=\"asistencias-link\" href=\"#\" title=\"Edit\">Asistencias</a>'}\n\t\t\t],\n\t\t\t\"info\": false,\n\t\t\t\"order\": [[ 0, \"asc\" ]],\n\t\t\t\"scrollY\": \"300px\",\n\t\t\t\"scrollX\": true,\n\t\t\t\"bDestroy\": true,\n\t\t\t\"bSort\": false,\n\t\t\t\"scrollCollapse\": true,\n\t\t\t\"searching\": false,\n\t\t\t\"paging\": false,\n\t\t\t\"filter\":false,\n\t\t\t\"columnDefs\": [\n\t\t\t// {\"targets\": [ 0 ],\"visible\": true,\"searchable\": true},\n\t\t\t// {\"targets\": [ 1 ],\"visible\": true,\"searchable\": false},\n\t\t\t// {\"targets\": [ 3 ],\"visible\": false,\"searchable\": false},\n\t\t\t// {\"targets\": [ 5 ],\"visible\": false,\"searchable\": false},\n\t\t\t// {\"targets\": [ 15 ],\"visible\": false,\"searchable\": false},\n\t\t\t// {\"targets\": [ 13 ],\"visible\": false,\"searchable\": false},\n\t\t\t// {\"targets\": [ 16 ],\"visible\": false,\"searchable\": false},\n\t\t\t// {\"targets\": [ 17 ],\"visible\": false,\"searchable\": false}\n\t\t\t],\n\t\t\t\"language\": {\n\t\t\t\t\"url\": \"//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Spanish.json\",\n \"sProcessing\": \"Procesando...\",\n\t\t\t\t\"sSearch\": \"Filtrar:\",\n\t\t\t\t\"zeroRecords\": \"Ningún resultado encontrado\",\n\t\t\t\t\"infoEmpty\": \"No hay registros disponibles\",\n\t\t\t\t\"Search:\": \"Filtrar\"\n\t\t\t}\n\t\t});\n\t\t\n}", "function tabla() {\n\n $('#tblRol').dataTable({\n \"bProcessing\": true,\n \"sServerMethod\": 'GET',\n \"bServerSide\": true,\n \"bRetrieve\": true,\n \"info\": false,\n \"bFilter\": true,\n \"ordering\": true,\n \"bAutoWidth\": false,\n \"bLengthChange\": false,\n \"bPaginate\": true,\n \"iDisplayLength\": 10,\n \"sAjaxSource\": \"Usuarios/consultarDatosTablaUsuariosLaboratorio.php\",\n \"order\": [[1, \"asc\"]],\n \"aoColumnDefs\": [{\n \"aTargets\": [2],\n \"sType\": \"html\"\n , \"mRender\": function (date, type, full) {\n return (\"\" + full[2].toString());\n }\n }],\n \"oLanguage\": {\n \"oPaginate\": {\n \"sFirst\": \"Primera\",\n \"sPrevious\": \"Anterior\",\n \"sNext\": \"Siguiente\",\n \"sLast\": \"&Uacute;ltima\"\n },\n \"sZeroRecords\": \"No se encontraron registros\",\n \"sEmptyTable\": \"No hay registros\",\n \"sSearch\": \"B&uacute;squeda R&aacute;pida\"\n }\n }).fnSetFilteringDelay(250);\n}", "function cargarTableEstu(){\n\t$(\"#TDataEstudiante\").DataTable({\n\t\t\"ajax\": {\n\t\t\t\"method\" : \"Get\",\n\t\t\t\"url\" : \"/grupoestudiantes/allEstudiantes\"\n\t\t\t\t},\n\t\t\"columns\" :[{\n\t\t\t\"data\" : \"id_estudiante\"\n\t\t},{\n\t\t\t\"data\" : \"nombre\"\n\t\t},{\n\t\t\t\"data\" : \"apellido\"\n\t\t},{\n\t\t\t\"data\" : \"id_institucion\"\n\t\t},{\n\t\t\t\"data\" : \"opciones\"\n\t\t}],\n\t\t\n\t\t\"language\" : {\n \"lengthMenu\" : \"Mostrar _MENU_ \",\n \"zeroRecords\" : \"Datos no encontrados\",\n \"info\" : \"Mostar páginas _PAGE_ de _PAGES_\",\n \"infoEmpty\" : \"Datos no encontrados\",\n \"infoFiltered\" : \"(Filtrados por _MAX_ total registros)\",\n \"search\" : \"Buscar:\",\n \"paginate\" : {\n \"first\" : \"Primero\",\n \"last\" : \"Anterior\",\n \"next\" : \"Siguiente\",\n \"previous\" : \"Anterior\"\n },\n }\n\t});\n}", "function llenarTabla() {\n const usuario = document.getElementById('idRegistrador').value;\n const rol = document.getElementById('rolRegistrador').value;\n const tipo = \"llenarTabla\";\n\n var table = $('#tablaRegistros').DataTable({\n \"ajax\": {\n type: \"POST\",\n url: \"inc/modelos/modelo-lista-registros.php\", \n data: {\n 'usuario' : usuario,\n 'rol' : rol,\n 'tipo': tipo\n }\n }, \n \"autoWidth\": false,\n \"columns\": [\n {\n \"className\": 'details-control',\n \"orderable\": false,\n \"data\": null,\n \"defaultContent\": '<span title=\"Ver Más\" style=\"opacity:0\">Tip</span>'\n },\n {\n \"className\": 'cerrarReg',\n \"orderable\": false,\n \"data\":null,\n \"defaultContent\": '<span title=\"Cerrar\" style=\"opacity:0\">Tip</span>'\n },\n {\n \"className\": 'editarReg',\n \"orderable\": false,\n \"data\":null,\n \"defaultContent\": '<span title=\"Editar\" style=\"opacity:0\">Tip</span>'\n },\n {\n \"className\": 'borrarReg',\n \"orderable\": false,\n \"data\":null,\n \"defaultContent\": '<span title=\"Borrar\" style=\"opacity:0\">Tip</span>'\n },\n { \"data\": \"id_reg_act\" },\n { \"data\": \"consecutivo\" },\n { \"data\": \"ost\" },\n { \"data\": \"siga\" },\n { \"data\": \"numero_servicio\" },\n { \"data\": \"actividad\" },\n { \"data\": \"cantidad_eventos\" },\n { \"data\": \"peso_total\" },\n { \"data\": \"fecha_hora_apertura\" },\n { \"data\": \"nombre\" },\n { \"data\": \"detalle\" },\n { \"data\": \"grupo\" }\n ],\n \"columnDefs\": [\n {\n \"targets\": [4],\n \"visible\": false,\n \"searchable\": false\n },\n {\n \"targets\": [6],\n \"visible\": false,\n },\n {\n \"targets\": [7],\n \"visible\": false,\n },\n {\n \"targets\": [8],\n \"visible\": false,\n },\n {\n \"targets\": [11],\n \"visible\": false,\n \"searchable\": false\n },\n {\n \"targets\": [14],\n \"visible\": false,\n },\n {\n \"targets\": [15],\n \"visible\": false,\n \"searchable\": false\n }\n ],\n \"order\": [[4, \"desc\"]],\n \"language\": {\n \"sProcessing\": \"Procesando...\",\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n \"sZeroRecords\": \"No se encontraron resultados\",\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n \"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros\",\n \"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0 registros\",\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n \"sInfoPostFix\": \"\",\n \"sSearch\": \"Buscar:\",\n \"sUrl\": \"\",\n \"sInfoThousands\": \",\",\n \"sLoadingRecords\": \"Cargando...\",\n \"oPaginate\": {\n \"sFirst\": \"Primero\",\n \"sLast\": \"Último\",\n \"sNext\": \"Siguiente\",\n \"sPrevious\": \"Anterior\"\n },\n \"oAria\": {\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n },\n \"buttons\": {\n \"copy\": \"Copiar\",\n \"colvis\": \"Visibilidad\"\n },\n \"select\": {\n \"rows\": {\n _: \"You have selected %d rows\",\n 0: \"\",\n 1: \"1 fila seleccionada\"\n }\n }\n },\n \"select\": 'single'\n });\n\n // Si el rol del usuario es vista o tecnico, se ocultan las siguientes opciones\n if(rol === \"Vista\" || rol === \"Tecnico\"){\n // Oculta opcion de cerrar registros\n table.column( 1 ).visible( false );\n table.column( 2 ).visible( false );\n table.column( 3 ).visible( false );\n } else if(rol === \"Operador\"){\n table.column( 3 ).visible( false );\n }\n\n // Se agrega el evento para mostrar u ocultar los detalles\n $('#tablaRegistros tbody').on('click', 'td.details-control', function () {\n var tr = $(this).closest('tr');\n var row = table.row(tr);\n\n if (row.child.isShown()) {\n // Si la fila se está mostrando, se oculta\n row.child.hide();\n tr.removeClass('shown');\n }\n else {\n // Muestra ésta fila\n row.child(format(row.data())).show();\n tr.addClass('shown');\n }\n });\n\n // Se agrega el evento para cerrar un registro\n $('#tablaRegistros tbody').on( 'click', 'td.cerrarReg', function () {\n var data = table.row( $(this).parents('tr') ).data();\n var todos = table.data();\n let tipo = \"cerrar\";\n modalAccionesRegistro(data, todos, tipo);\n } );\n\n // Se agrega el evento para editar un registro\n $('#tablaRegistros tbody').on( 'click', 'td.editarReg', function () {\n var data = table.row( $(this).parents('tr') ).data();\n var todos = table.data();\n let tipo = \"editar\";\n modalAccionesRegistro(data, todos, tipo);\n } );\n\n // Se agrega el evento para editar un registro\n $('#tablaRegistros tbody').on( 'click', 'td.borrarReg', function () {\n var data = table.row( $(this).parents('tr') ).data();\n var todos = table.data();\n let tipo = \"borrar\";\n modalAccionesRegistro(data, todos, tipo);\n } );\n\n}", "function make_table(tabla){\n $(tabla).dataTable({\n \"bDestroy\": true,\n \"sPaginationType\": \"full_numbers\", \n \"oLanguage\": {\n \"sProcessing\": \"Procesando...\",\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n \"sZeroRecords\": \"No se encontraron resultados\",\n \"sEmptyTable\": \"No se encontraron disponibles para liberar o rechazar\",\n \"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros\",\n \"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0 registros\",\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n \"sInfoPostFix\": \"\",\n \"sSearch\": \"Buscar:\",\n \"sUrl\": \"\",\n \"sInfoThousands\": \",\",\n \"sLoadingRecords\": \"Cargando...\",\n \"oPaginate\": {\n \"sFirst\": \"Primero\",\n \"sLast\": \"Ultimo\",\n \"sNext\": \"Siguiente\",\n \"sPrevious\": \"Anterior\"\n },\n \"oAria\": {\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n }\n }\n });//fin data table\n}", "function mgrilla_item_obtener_datos_01(){\n\ttblregistro_vista_data = $(\"#grdregistro_vista_data\").dataTable({\n\t\t\"aProcessing\": true,\n\t\t\"aServerSide\": true,\n\t\tdom: \"Bfrtip\",\n\t\t\"searching\": true,\n\t\tlengthChange: false,\n\t\tcolReorder: true,\n\t\tbuttons: [\t\n\t\t\t\"copyHtml5\",\n\t\t\t\"excelHtml5\",\n\t\t\t\"csvHtml5\",\n\t\t\t{\n\t\t\t\textend: \"pdfHtml5\",\n\t\t\t\torientation: \"landscape\",\n\t\t\t\tdownload: \"open\",\n\t\t\t\tpageSize: \"A4\",\n\t\t\t\ttext: \"PDF\"\n\t\t\t},\n\t\t\t\"colvis\"\n\t\t],\n\t\t\"ajax\":{\n\t\t\turl: \"../../controller/arc_producto.php?caso=ctrl_obtener_vista_00\",\n\t\t\ttype : \"post\",\n\t\t\tdataType : \"json\",\n\t\t\terror: function(e){\n\t\t\t\tconsole.log(e.responseText);\n\t\t\t}\n\t\t},\n\t\t\"bDestroy\": true,\n\t\t\"responsive\": true,\n\t\t\"bInfo\":true,\n\t\t\"iDisplayLength\": 10,\n\t\t\"language\": { \"url\": \"//cdn.datatables.net/plug-ins/1.10.21/i18n/Spanish.json\" }\n\t}).DataTable();\n}", "function listar_lentes_tratamientos()\n{\n tabla_lentes_tratamientos=$('#data_lente_tratamientos').dataTable(\n {\n \"aProcessing\": true,//Activamos el procesamiento del datatables\n \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n dom: 'Bfrtip',//Definimos los elementos del control de tabla\n responsive: true,\n buttons: [\n 'copyHtml5',\n 'excelHtml5',\n 'csvHtml5',\n 'pdf'\n ],\n \"ajax\":\n {\n url: 'ajax/productos.php?op=lista_lentes_tratamientos',\n type : \"get\",\n dataType : \"json\",\n error: function(e){\n console.log(e.responseText);\n }\n },\n \"bDestroy\": true,\n \"responsive\": true,\n \"bInfo\":true,\n \"iDisplayLength\": 10,//Por cada 10 registros hace una paginación\n \"order\": [[ 0, \"desc\" ]],//Ordenar (columna,orden)\n\n \"language\": {\n\n \"sProcessing\": \"Procesando...\",\n\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\n \"sZeroRecords\": \"No se encontraron resultados\",\n\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\n \"sInfo\": \"Mostrando un total de _TOTAL_ registros\",\n\n \"sInfoEmpty\": \"Mostrando un total de 0 registros\",\n\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\n \"sInfoPostFix\": \"\",\n\n \"sSearch\": \"Buscar:\",\n\n \"sUrl\": \"\",\n\n \"sInfoThousands\": \",\",\n\n \"sLoadingRecords\": \"Cargando...\",\n\n \"oPaginate\": {\n\n \"sFirst\": \"Primero\",\n\n \"sLast\": \"Último\",\n\n \"sNext\": \"Siguiente\",\n\n \"sPrevious\": \"Anterior\"\n\n },\n\n \"oAria\": {\n\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\n }\n\n }//cerrando language\n\n }).DataTable();\n}", "function listar() {\n var fecha_inicio = $(\"#fecha_inicio\").val();\n var fecha_fin = $(\"#fecha_fin\").val();\n var idcliente = $(\"#idcliente\").val();\n tabla = $('#tbllistado').dataTable({\n \"aProcessing\": true, //Activamos el procesamiento del datatables\n \"sServerSide\": true, //paginaciion y filtrado realizados por el servidor\n \"sSearch\": true,\n dom: 'Bfrtip', //definimos los elementos del control de tablas\n \n \n buttons: [{\n //Botón para Excel\n extend: 'excel',\n footer: true,\n title: 'Archivo',\n filename: 'Consultas_Ventas',\n \n //Aquí es donde generas el botón personalizado\n text: '<button class=\"btn btn-success \">Exportar a Excel <i class=\"fas fa-file-excel\"></i></button>'\n },\n //Botón para PDF\n {\n extend: 'pdf',\n footer: true,\n title: 'Archivo PDF',\n filename: 'Consultas_Ventas',\n text: '<button class=\"btn btn-danger\">Exportar a PDF <i class=\"far fa-file-pdf\"></i></button>'\n }\n ],\n \n\n \"ajax\": \n {\n url: '../ajax/consultas.php?op=ventasfechascliente',\n data:{fecha_inicio: fecha_inicio,fecha_fin: fecha_fin,idcliente: idcliente},\n type: \"get\",\n dataType: \"json\",\n error: function(e){\n console.log(e.responseText);\n }\n },\n language: {\n \"sProcessing\": \"Procesando...\",\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n \"sZeroRecords\": \"No se encontraron resultados\",\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla =(\",\n \"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros\",\n \"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0 registros\",\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n \"sInfoPostFix\": \"\",\n \"sSearch\": \"Buscar:\",\n \"sUrl\": \"\",\n \"sInfoThousands\": \",\",\n \"sLoadingRecords\": \"Cargando...\",\n \"oPaginate\": {\n \"sFirst\": \"Primero\",\n \"sLast\": \"Último\",\n \"sNext\": \"Siguiente\",\n \"sPrevious\": \"Anterior\"\n },\n \n \n },\n \"bDestroy\": true,\n \"iDisplayLength\": 7, //paginacion\n \"order\":[[0, \"desc\"]], //ordenar (columna,orden)\n\n \n\n \n }).DataTable();\n\n}", "creaTabella(result){\n\t\tthis.data = this.ricreaArrJson(result);\t\n\t\tthis.createColumn();\n\t\tthis.myTable = $('#flussi').DataTable({\n\t\t \"sPaginationType\": \"full_numbers\",\n\t\t data: this.data,\n\t\t columns: this.ArrCol,\n\t\t\tdom: 'Bfrtip', // Needs button container\n\t\t select: 'single',\n\t\t responsive: true,\n\t\t altEditor: true, // Enable altEditor\n\t\t onDeleteRow:this.deleteRow,\n\t\t onEditRow: this.editRow,\n\t\t onAddRow: this.addRow,\n\t\t buttons: [{\n\t\t text: 'Add',\n\t\t name: 'add' // do not change name\n\t\t },\n\n\t\t {\n\t\t extend: 'selected', // Bind to Selected row\n\t\t text: 'Edit',\n\t\t name: 'edit' // do not change name\n\t\t },\n\n\t\t {\n\t\t extend: 'selected', // Bind to Selected row\n\t\t text: 'Delete',\n\t\t name: 'delete' // do not change name\n\t\t }]\n\t\t });\n\t}", "function cargarDataT(){\n\t$(\"#TDataEstu\").DataTable({\n\t\t\"ajax\":{\n\t\t\t\"method\" : \"Get\",\n\t\t\t\"url\" : \"/estudiantes/allEstudiantes\"\n\t\t},\n\t\t\"columns\" :[{\n\t\t\t\"data\" : \"id_estudiante\",\n\t\t\t\"width\" : \"5%\"\n\t\t},{\n\t\t\t\"data\" : \"institucion\",\n\t\t\t\"width\" : \"20%\"\n\t\t},{\n\t\t\t\"data\" : \"nombre\",\n\t\t\t\"width\" : \"12%\"\n\t\t},{\n\t\t\t\"data\" : \"apellido\",\n\t\t\t\"width\" : \"12%\"\n\t\t},{\n\t\t\t\"data\" : \"email\",\n\t\t\t\"width\" : \"15%\"\n\t\t},{\n\t\t\t\"data\" : \"telefono\",\n\t\t\t\"width\" : \"10%\"\n\t\t},{\n\t\t\t\"data\" : \"opciones\",\n\t\t\t\"width\" : \"26%\"\n\t\t}],\n\t\t\"scrollY\":400,\n\t\t\n\t\t\"language\" : {\n \"lengthMenu\" : \"Mostrar _MENU_ \",\n \"zeroRecords\" : \"Datos no encontrados\",\n \"info\" : \"Mostar páginas _PAGE_ de _PAGES_\",\n \"infoEmpty\" : \"Datos no encontrados\",\n \"infoFiltered\" : \"(Filtrados por _MAX_ total registros)\",\n \"search\" : \"Buscar:\",\n \"paginate\" : {\n \"first\" : \"Primero\",\n \"last\" : \"Anterior\",\n \"next\" : \"Siguiente\",\n \"previous\" : \"Anterior\"\n },\n }\n\t});\n}", "function dataTable() {\r\n //llenando la variable datatable\r\n table = $('#table-casa').DataTable({\r\n destroy: true,\r\n //realizando peticion ajax para traer datos\r\n ajax: {\r\n method: 'POST',\r\n //url de controlador adonde se traeran los datos\r\n url: '../app/controllers/CasaController.php',\r\n //datos que iran por el post\r\n data: {\r\n tabla: \"casa\"\r\n },\r\n //agregarndole el nombre del array que se traera\r\n dataSrc: 'data'\r\n },\r\n //agregando datos a las columnas\r\n columns: [{\r\n //agregando datos de codigo de categoria\r\n data: 'codi_casa',\r\n //pasar a invisible esa columna\r\n \"visible\": false\r\n }, {\r\n data: \"logo_casa\",\r\n \"aTargets\": [0],\r\n \"render\": function(data) {\r\n return '<img class=\"circle\" width=\"100px\" src=\"../web/img/logos/' + data + '\" />';\r\n }\r\n }, {\r\n //agregando datos de nombre de categoria\r\n data: 'nomb_casa'\r\n }, {\r\n //agregando dato de estado de categoria\r\n data: 'dire_casa',\r\n }, {\r\n data: 'esta_casa',\r\n \"visible\": false\r\n }, {\r\n //agregando botones para abrir el modal de modificar o de eliminar categoria\r\n defaultContent: \"<a href='#deleCasa' class='delete btn-small red darken-1 waves-effect waves-ligth modal-trigger'>Eliminar</a>\"\r\n }],\r\n //cambiando el idioma de las diferentes opciones\r\n language: {\r\n //procesando informacion\r\n \"sProcessing\": \"Procesando...\",\r\n //Drop para mostrar diferentes cantidades de registros\r\n \"sLengthMenu\": \"Mostrar cantidad de registros _MENU_ \",\r\n //cuando no se encuentran registros\r\n \"sZeroRecords\": \"No se encontraron resultados\",\r\n //cuando no hay ningun dato en la tabla\r\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\r\n //informacion de los registros que se estan viendo y el total de registros\r\n \"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros\",\r\n //informacion de registros nulos\r\n \"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0 registros\",\r\n //total de registros que concuerdan con el filtro de buscar\r\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\r\n \"sInfoPostFix\": \"\",\r\n //Buscar\r\n \"sSearch\": \"Buscar:\",\r\n \"sUrl\": \"\",\r\n \"sInfoThousands\": \",\",\r\n //cargando datos\r\n \"sLoadingRecords\": \"Cargando...\",\r\n //paginacion\r\n \"oPaginate\": {\r\n //primer dato\r\n \"sFirst\": \"Primero\",\r\n //ultimo dato\r\n \"sLast\": \"Último\",\r\n //siguiente\r\n \"sNext\": \"Siguiente\",\r\n //anterior\r\n \"sPrevious\": \"Anterior\"\r\n },\r\n \"oAria\": {\r\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\r\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\r\n }\r\n },\r\n //cantidad de datos que se van a mostrar al cargar los datos por defecto\r\n iDisplayLength: 5\r\n });\r\n $('select').formSelect();\r\n // Llamamos al metodo para obtener el id del registro, para eliminar\r\n getIdToDelete(\"#table-casa tbody\", table);\r\n}", "function listar(cuadro){\n\t\t$('#tabla tbody').off('click');\n\t\tcuadros(cuadro, \"#cuadro1\");\n\t\tvar url=document.getElementById('ruta').value; //obtiene la ruta del input hidden con la variable <?=base_url()?>\n\t\tvar table=$(\"#tabla\").DataTable({\n\t\t\t\"destroy\":true,\n\t\t\t\"stateSave\": true,\n\t\t\t\"serverSide\":false,\n\t\t\t\"ajax\":{\n\t\t\t\t\"method\":\"POST\",\n\t\t\t\t\"url\": url + \"EsquemaComision/listado_esquema_comision\",\n\t\t\t\t\"dataSrc\":\"\"\n\t\t\t},\n\t\t\t\"columns\":[\n\t\t\t\t{\"data\": \"id_esquema_comision\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\treturn \"<input type='checkbox' class='checkitem chk-col-blue' id='item\"+data+\"' value='\"+data+\"'><label for='item\"+data+\"'></label>\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"idVendedor\"},\n\t\t\t\t{\"data\":\"tipoVendedor\"},\n\t\t\t\t{\"data\":\"num_ventas_mes\"},\n\t\t\t\t{\"data\":\"tipoPlazo\"},\n\t\t\t\t{\"data\":\"porctj_comision\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\treturn data.replace('.',',') + \" %\";\n\t \t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"fec_regins\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\treturn cambiarFormatoFecha(data);\n\t \t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"correo_usuario\"},\n\t\t\t\t{\"data\": null,\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\tvar botones = \"\";\n\t\t\t\t\t\tif(consultar == 0)\n\t\t\t\t\t\t\tbotones += \"<span class='consultar btn btn-xs btn-info waves-effect' data-toggle='tooltip' title='Consultar'><i class='fa fa-eye' style='margin-bottom:5px'></i></span> \";\n\t\t\t\t\t\tif(actualizar == 0)\n\t\t\t\t\t\t\tbotones += \"<span class='editar btn btn-xs btn-primary waves-effect' data-toggle='tooltip' title='Editar'><i class='fa fa-pencil-square-o' style='margin-bottom:5px'></i></span> \";\n\t\t\t\t\t\tif(data.status == 1 && actualizar == 0)\n\t\t\t\t\t\t\tbotones += \"<span class='desactivar btn btn-xs btn-warning waves-effect' data-toggle='tooltip' title='Desactivar'><i class='fa fa-unlock' style='margin-bottom:5px'></i></span> \";\n\t\t\t\t\t\telse if(data.status == 2 && actualizar == 0)\n\t\t\t\t\t\t\tbotones += \"<span class='activar btn btn-xs btn-warning waves-effect' data-toggle='tooltip' title='Activar'><i class='fa fa-lock' style='margin-bottom:5px'></i></span> \";\n\t\t\t\t\t\tif(borrar == 0)\n\t\t \t\tbotones += \"<span class='eliminar btn btn-xs btn-danger waves-effect' data-toggle='tooltip' title='Eliminar'><i class='fa fa-trash-o' style='margin-bottom:5px'></i></span>\";\n\t\t \t\treturn botones;\n\t\t \t}\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"language\": idioma_espanol,\n\t\t\t\"dom\": 'Bfrtip',\n\t\t\t\"responsive\": true,\n\t\t\t\"buttons\":[\n\t\t\t\t'copy', 'csv', 'excel', 'pdf', 'print'\n\t\t\t]\n\t\t});\n\t\tver(\"#tabla tbody\", table);\n\t\teditar(\"#tabla tbody\", table);\n\t\teliminar(\"#tabla tbody\", table);\n\t\tdesactivar(\"#tabla tbody\", table);\n\t\tactivar(\"#tabla tbody\", table);\n\t}", "function tabla_tecnicos(){\n var tabla_html = $(\"#datatable-tecnicos\")\n\n // Inicializacion y referencia al DataTable, con la config ajax de cada columna\n var dtabla = tabla_html.DataTable({\n // \"ajax\": {'url':'localhost:8000/orden/lista_clientes'},//tabla_html.attr('data-ajax_url'),\n \"autoWidth\": false,\n \"columns\": [\n {\"data\":\"\"},\n {\"data\": \"nombre\"},\n ],\n \"dom\": \"Bfrtip\",\n \"buttons\": [{\n extend: \"copy\",\n text: \"Copiar tabla\",\n className: \"btn-sm\"\n }, {\n extend: \"csv\",\n text: \"Exportar tabla a CSV\",\n className: \"btn-sm\"\n }, {\n extend: \"print\",\n text: \"Imprimir tabla\",\n className: \"btn-sm\"\n }, ],\n });\n\n // Click en la fila para seleccionar\n tabla_html.on('click', 'tr', function() {\n var radio = $(this).find('input');\n if (radio[0]) {\n dtabla.$('tr.row_selected').removeClass('row_selected');\n $(this).addClass('row_selected');\n radio.iCheck('checked');\n }\n });\n \n return dtabla\n}", "function DataTable() {}", "function cargarTablaProduccionTrusas(fechaInicial,fechaFinal) {\n\t$('.tablaProduccionTrusas').DataTable( {\n\t\t\"ajax\": \"ajax/produccion/tabla-producciontrusas.ajax.php?perfil=\"+$(\"#perfilOculto\").val() +\"&fechaInicial=\" + fechaInicial + \"&fechaFinal=\" + fechaFinal,\n\t\t\"deferRender\": true,\n\t\t\"retrieve\": true,\n\t\t\"processing\": true,\n\t\t\"order\": [[1, \"desc\"]],\n\t\t\"pageLength\": 20,\n\t\t\"lengthMenu\": [[20, 40, 60, -1], [20, 40, 60, 'Todos']],\n\t\t\"language\": {\n\n\t\t\t\t\"sProcessing\": \"Procesando...\",\n\t\t\t\t\"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\t\t\t\t\"sZeroRecords\": \"No se encontraron resultados\",\n\t\t\t\t\"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\t\t\t\t\"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_\",\n\t\t\t\t\"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0\",\n\t\t\t\t\"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\t\t\t\t\"sInfoPostFix\": \"\",\n\t\t\t\t\"sSearch\": \"Buscar:\",\n\t\t\t\t\"sUrl\": \"\",\n\t\t\t\t\"sInfoThousands\": \",\",\n\t\t\t\t\"sLoadingRecords\": \"Cargando...\",\n\t\t\t\t\"oPaginate\": {\n\t\t\t\t\"sFirst\": \"Primero\",\n\t\t\t\t\"sLast\": \"Último\",\n\t\t\t\t\"sNext\": \"Siguiente\",\n\t\t\t\t\"sPrevious\": \"Anterior\"\n\t\t\t\t},\n\t\t\t\t\"oAria\": {\n\t\t\t\t\t\"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\t\t\t\t\t\"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\t\t\t\t}\n\n\t\t},\n\t\t\"drawCallback\":function(){\n\t\t\tvar api=this.api();\n\t\t\t$(api.column(18).footer()).html(\n\t\t\t\tapi.column(18,{page:'current'}).data().sum().toFixed(2)\n\t\t\t)\n\t\t\t$(api.column(19).footer()).html(\n\t\t\t\tapi.column(19,{page:'current'}).data().sum().toFixed(2)\n\t\t\t)\n\t\t} \n\t} );\n}", "function listar() {\n\ttabla = $('#tbllistado').dataTable({\n\t\t\"aProcessing\": true,\n\t\t\"aServerSide\": true,\n\t\tdom: 'Bfrtip',\n\t\tbuttons: ['copyHtml5', 'excelHtml5', 'csvHtml5', 'pdf', 'print'],\n\t\t\"ajax\": {\n\t\t\turl: '../ajax/venta.php?op=listar',\n\t\t\ttype: \"get\",\n\t\t\tdataType: \"json\",\n\t\t\terror: function(e) {\n\t\t\t\tconsole.log(e.responseText);\n\t\t\t}\n\t\t},\n\t\t\"bDestroy\": true,\n\t\t\"iDisplayLength\": 5,\n\t\t\"order\": [\n\t\t\t[0, \"desc\"]\n\t\t]\n\t}).DataTable();\n}", "function reno_contado(){\n\t\t$('#listado').DataTable({\n\t\t\t\"bJQueryUI\": false,\n\t\t \"bDeferRender\": false,\n\t\t \"bInfo\" : false,\n\t\t \"bSort\" : false,\n\t\t \"bDestroy\" : true,\n\t\t \"bFilter\" : false,\n\t\t \"bLengthChange\": false,\n\t\t \"bPagination\" : false,\n\t \"aoColumnDefs\": [\n\t { \"bVisible\": false, \"aTargets\": [6] },\n\t { \"bVisible\": true, \"aTargets\": [7] },\n\t { \"bVisible\": false, \"aTargets\": [8] },\n\t { \"bVisible\": false, \"aTargets\": [9] },\n\t { \"bVisible\": false, \"aTargets\": [10] },\n\t { \"bVisible\": false, \"aTargets\": [11] },\n\t { \"bVisible\": false, \"aTargets\": [12] },\n\t { \"bVisible\": false, \"aTargets\": [13] },\n\t { \"bVisible\": false, \"aTargets\": [14] },\n\t { \"bVisible\": false, \"aTargets\": [15] },\n\t { \"bVisible\": false, \"aTargets\": [16] },\n\t { \"bVisible\": false, \"aTargets\": [17] }\n\t ], \n\t });\n\t }", "function tablaCarrito(){\n $.ajax({\n type : \"POST\",\n url : urlTodoCarrito,\n dataType : \"JSON\",\n data : {},\n success: function(data){\n tablecarrito = $('#tablaCarrito').DataTable({\n \"data\": data,\n \"bDestroy\": true,\n \"dom\": 'B<\"float-left\"i><\"float-right\"f>t<\"float-left\"l><\"float-right\"p><\"clearfix\">',\n \"order\": [[ 0, \"asc\" ]],\n \"lengthMenu\": [ [10, 25, 50, -1], [10,25, 50, \"Todo\"] ],\n \"searching\": false,\n \"autoWidth\": false,\n \"language\": {\n \"url\": \"https://cdn.datatables.net/plug-ins/1.10.19/i18n/Spanish.json\"\n },\n \"initComplete\": function () {\n //Apply text search\n this.api().columns([0,1,2,3]).every(function () {\n var title = $(this.footer()).text();\n \n $(this.footer()).html('<input type=\"text\" class=\"form-control \" placeholder=\"Buscar...\" />');\n var that = this;\n $('input',this.footer()).on('keyup change', function () {\n if (that.search() !== this.value) {\n that\n .search(this.value)\n .draw();\n }\n });\n\n });\n /*\n this.api().columns([3]).every(function () {\n var title = $(this.footer()).text();\n \n $(this.footer()).html('<input type=\"date\" class=\"form-control form-control-sm\" placeholder=\"Buscar...\" />');\n var that = this;\n $('input',this.footer()).on('keyup change', function () {\n if (that.search() !== this.value) {\n that\n .search(this.value)\n .draw();\n }\n });\n\n });*/\n\n },\n \"columns\": [\n { \n \"data\": null,\n \"mRender\": function(data, type, full) {\n \n return '<div class=\"text-center\"><a><img src=\"'+url+full.imageurl+'\" alt=\"Imagen del porducto\" class=\"thumbnail\" width=\"40px\" /></a></div>';\n\n }\n },\n { \"data\": \"nomart\"},\n { \"data\": \"c_und\"},\n { \"data\": \"c_totalvalor\", render: $.fn.dataTable.render.number(\",\", \".\", 0, '$ ')},\n { \n \"data\": null,\n \"mRender\": function(data, type, full) {\n \n return '<div class=\"text-center\"><button type=\"button\" class=\"btn btn-outline-danger fa fa-trash-o\" id=\"eliminarCarrito\"></button></div>';\n\n }\n },\n ],\n buttons: [\n /* {\n extend: 'excelHtml5',\n title: 'Estados',\n text: '<i class=\"fa fa-file-excel-o\"></i> Excel',\n \n },*/\n ]\n });\n }\n });\n}", "function listarp()\n{\n\t tablaprovedor=$('#listadop').dataTable(\n\t{\n\t\t\"aProcessing\": true,//Activamos el procesamiento del datatables\n\t \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n\t dom: 'Bfrtip',//Definimos los elementos del control de tabla\n\t buttons: [\t\t \n\t \n\t\t 'copyHtml5',\n\t\t 'excelHtml5',\n\t\t 'csvHtml5',\n\t\t 'pdf'\n\t\t ],\n\t\t\"ajax\":\n\t\t\t\t{\n\n\t\t\turl: '../controller/persona.php?op=listarp',\n\t\t\t\t\tdataType : \"json\",\t\t\t\t\t\t\n\t\t\t\t\terror: function(e){\n\t\t\t\t\t\tconsole.log(e.responseText);\t\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\"bDestroy\": true,\n\t\t\"iDisplayLength\": 5,//Paginación\n\t \"order\": [[ 0, \"desc\" ]]//Ordenar (columna,orden)\n\t}).DataTable();\n}", "function listar_lentes_venta(){\n tabla_lentes_venta=$('#lista_lentes_ventas_data').dataTable(\n {\n \"aProcessing\": true,//Activamos el procesamiento del datatables\n \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n dom: 'Bfrtip',//Definimos los elementos del control de tabla\n responsive: true,\n buttons: [\n 'copyHtml5',\n 'excelHtml5',\n 'csvHtml5',\n 'pdf'\n ],\n \"ajax\":\n {\n url: 'ajax/productos.php?op=listar_lentes_venta',\n type : \"get\",\n dataType : \"json\",\n error: function(e){\n console.log(e.responseText);\n }\n },\n \"bDestroy\": true,\n \"responsive\": true,\n \"bInfo\":true,\n \"iDisplayLength\": 10,//Por cada 10 registros hace una paginación\n \"order\": [[ 0, \"desc\" ]],//Ordenar (columna,orden)\n\n \"language\": {\n\n \"sProcessing\": \"Procesando...\",\n\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\n \"sZeroRecords\": \"No se encontraron resultados\",\n\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\n \"sInfo\": \"Mostrando un total de _TOTAL_ registros\",\n\n \"sInfoEmpty\": \"Mostrando un total de 0 registros\",\n\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\n \"sInfoPostFix\": \"\",\n\n \"sSearch\": \"Buscar:\",\n\n \"sUrl\": \"\",\n\n \"sInfoThousands\": \",\",\n\n \"sLoadingRecords\": \"Cargando...\",\n\n \"oPaginate\": {\n\n \"sFirst\": \"Primero\",\n\n \"sLast\": \"Último\",\n\n \"sNext\": \"Siguiente\",\n\n \"sPrevious\": \"Anterior\"\n\n },\n\n \"oAria\": {\n\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\n }\n\n }//cerrando language\n\n }).DataTable();\n}", "function listar_ar_venta(){\n tabla_ar_venta=$('#lista_ar_ventas_data').dataTable(\n {\n \"aProcessing\": true,//Activamos el procesamiento del datatables\n \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n dom: 'Bfrtip',//Definimos los elementos del control de tabla\n responsive: true,\n buttons: [\n 'copyHtml5',\n 'excelHtml5',\n 'csvHtml5',\n 'pdf'\n ],\n \"ajax\":\n {\n url: 'ajax/productos.php?op=listar_ar_venta',\n type : \"get\",\n dataType : \"json\",\n error: function(e){\n console.log(e.responseText);\n }\n },\n \"bDestroy\": true,\n \"responsive\": true,\n \"bInfo\":true,\n \"iDisplayLength\": 10,//Por cada 10 registros hace una paginación\n \"order\": [[ 0, \"desc\" ]],//Ordenar (columna,orden)\n\n \"language\": {\n\n \"sProcessing\": \"Procesando...\",\n\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\n \"sZeroRecords\": \"No se encontraron resultados\",\n\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\n \"sInfo\": \"Mostrando un total de _TOTAL_ registros\",\n\n \"sInfoEmpty\": \"Mostrando un total de 0 registros\",\n\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\n \"sInfoPostFix\": \"\",\n\n \"sSearch\": \"Buscar:\",\n\n \"sUrl\": \"\",\n\n \"sInfoThousands\": \",\",\n\n \"sLoadingRecords\": \"Cargando...\",\n\n \"oPaginate\": {\n\n \"sFirst\": \"Primero\",\n\n \"sLast\": \"Último\",\n\n \"sNext\": \"Siguiente\",\n\n \"sPrevious\": \"Anterior\"\n\n },\n\n \"oAria\": {\n\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\n }\n\n }//cerrando language\n\n }).DataTable();\n}", "function carregarTabelaLoteAnt()\n{\n $.getJSON('../api/bndes/v1/siaf_amortizacoes_lote_anterior', function(json){\n\n $.each(json, function (key, value){\n \n linha = atualizaTabela(value);\n $('#tabelaLoteAnterior>tbody').append(linha);\n\n });\n \n $('#tabelaLoteAnterior').DataTable();\n \n });\n \n}", "function listar_acc_compras()\n{\n tabla_acc_compras=$('#data_acc_compras').dataTable(\n {\n \"aProcessing\": true,//Activamos el procesamiento del datatables\n \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n dom: 'Bfrtip',//Definimos los elementos del control de tabla\n responsive: true,\n buttons: [\n 'copyHtml5',\n 'excelHtml5',\n 'csvHtml5',\n 'pdf'\n ],\n \"ajax\":\n {\n url: 'ajax/productos.php?op=listar_acc_compras',\n type : \"get\",\n dataType : \"json\",\n error: function(e){\n console.log(e.responseText);\n }\n },\n \"bDestroy\": true,\n \"responsive\": true,\n \"bInfo\":true,\n \"iDisplayLength\": 10,//Por cada 10 registros hace una paginación\n \"order\": [[ 0, \"desc\" ]],//Ordenar (columna,orden)\n\n \"language\": {\n\n \"sProcessing\": \"Procesando...\",\n\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\n \"sZeroRecords\": \"No se encontraron resultados\",\n\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\n \"sInfo\": \"Mostrando un total de _TOTAL_ registros\",\n\n \"sInfoEmpty\": \"Mostrando un total de 0 registros\",\n\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\n \"sInfoPostFix\": \"\",\n\n \"sSearch\": \"Buscar:\",\n\n \"sUrl\": \"\",\n\n \"sInfoThousands\": \",\",\n\n \"sLoadingRecords\": \"Cargando...\",\n\n \"oPaginate\": {\n\n \"sFirst\": \"Primero\",\n\n \"sLast\": \"Último\",\n\n \"sNext\": \"Siguiente\",\n\n \"sPrevious\": \"Anterior\"\n\n },\n\n \"oAria\": {\n\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\n }\n\n }//cerrando language\n\n }).DataTable();\n}", "function preecheTabela(){\n\t\t//acessa a pagina /frequencia.php\n\t\t$.ajax({\n\t\t\tmethod: 'get',\n\t\t\turl: 'select.php',\n\t\t\t//obtem dados dos campos de select, através dos ids dos elementos e\n\t\t\t//funcao val() do jquery\n\t\t\tdata: {cur_id: $('#turma').val()},\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(dados){\n\t\t\t\t//verifica se a variavel \"dados\" possui as informações de data e nomes\n\t\t\t\tvar data = dados.hasOwnProperty('data') ? dados.data : null;\n\t\t\t\tvar nomes = dados[0];\n\t\t\t\t\n\t\t\t\t//limpa e adiciona dados em campos ...\n\t\t\t\t$('#dataCabecalho').html('');\n\t\t\t\t$('#dataCabecalho').append('Data - ' + data);\n\t\t\t\t\n\t\t\t\tvar listaNomes = $('#listaNomes');\n\t\t\t\t\n\t\t\t\tlistaNomes.html('');\n\t\t\t\tvar j=1;\n\t\t\t\t//adiciona nomes na tabela\n\t\t\t\tfor(var i = 0; i < nomes.length; i++){\n\t\t\t\t\t//adiciona linhas com e colunas com td. \n\t\t\t\t\tlistaNomes.append('<tr>'+\n\t\t\t\t\t\t\t'<td>' + \n\t\t\t\t\t\t\tj +'</td>' +\n\t\t\t\t\t\t\t'<td>' + \n\t\t\t\t\t\t\tnomes[i].alu_nome +'</td>' +\n\t\t\t\t\t\t\t'<td>' + '<input type=\"number\" name=\"' + \n\t\t\t\t\t\t\tnomes[i].alu_id + '\"' + '></td>'\n\t\t\t\t\t\t\t+'</tr>');\n\t\t\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function cargarTablas() {\n\n\n\n var dataTableRutas_const = function () {\n if ($(\"#dt_rutas\").length) {\n $(\"#dt_rutas\").DataTable({\n dom: \"Bfrtip\",\n bFilter: true,\n ordering: false,\n buttons: [\n {\n extend: \"copy\",\n className: \"btn-sm\",\n text: \"Copiar\"\n },\n {\n extend: \"csv\",\n className: \"btn-sm\",\n text: \"Exportar a CSV\"\n },\n {\n extend: \"print\",\n className: \"btn-sm\",\n text: \"Imprimir\"\n }\n\n ],\n \"columnDefs\": [\n {\n targets: 4,\n className: \"dt-center\",\n render: function (data, type, row, meta) {\n var botones = '<button type=\"button\" class=\"btn btn-default btn-xs\" aria-label=\"Left Align\" onclick=\"showRutasByID(\\''+row[0]+'\\');\">Cargar</button> ';\n botones += '<button type=\"button\" class=\"btn btn-default btn-xs\" aria-label=\"Left Align\" onclick=\"deleteRutasByID(\\''+row[0]+'\\');\">Eliminar</button>';\n return botones;\n }\n }\n\n ],\n pageLength: 2,\n language: dt_lenguaje_espanol,\n ajax: {\n url: '../backend/agenda/controller/rutasController.php',\n type: \"POST\",\n data: function (d) {\n return $.extend({}, d, {\n action: \"showAll_rutas\"\n });\n }\n },\n drawCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {\n $('#dt_rutas').DataTable().columns.adjust().responsive.recalc();\n }\n });\n }\n };\n\n\n\n TableManageButtons = function () {\n \"use strict\";\n return {\n init: function () {\n dataTableRutas_const();\n $(\".dataTables_filter input\").addClass(\"form-control input-rounded ml-sm\");\n }\n };\n }();\n\n TableManageButtons.init();\n}", "function consultaAperturaYCorteDelDia(fecha){\n // debugger;\n \t\tvar datos = {\n \t\t\t\tfecha : fecha,\n \t\t }\n \t\t$.ajax({\n url: base_url+'Cajero/CorteCaja/consultarApertura',\n type: \"post\",\n dataType: \"json\",\n \t\t\tdata : (datos),\n \t\t\tsuccess : function(response){\n $(\"#tbl_consultaCortesDelDia\").DataTable({\n data: response,\n responsive: true,\n columns: [\n {\n data: \"monto\",\n \"className\": \"text-center\",\n // \"visible\": false, // ocultar la columna\n render: function(data, type, row, meta) {\n var hayApertura = `${row.monto}`;\n var idApertura = `${row.id_apertura}`;\n if (hayApertura == 'null'){\n var a = '<div text-white\">'+'No hay apertura'+'</div>';\n $(\"#id_ventas\").val(\"No hay apertura\");\n }else {\n $(\"#id_apertura\").val(idApertura);\n $(\"#monto_apertura\").val(hayApertura);\n var a = '<div text-white\">'+hayApertura+'</div>';\n }\n return a;\n },\n },\n {\n data: \"monto_entregado\",\n \"className\": \"text-center\",\n },\n {\n data: \"gastos\",\n \"className\": \"text-center\",\n },\n {\n data: \"ventas\",\n // \"visible\": false, // ocultar la columna\n },\n {\n data: \"diferencia\",\n \"className\": \"text-center\",\n },\n {\n data: \"fecha\",\n \"className\": \"text-center\",\n },\n {\n data: \"usuario\",\n \"className\": \"text-center\",\n },\n\n ],\n \"language\" : language_espaniol,\n });\n \t\t\t }\n \t\t});\n }", "function tablausuarios(){\n\t\t$('#tablausuarios').dataTable().fnDestroy();\t\t \t\n\t\t$('#tablausuarios').DataTable({\n\n\t\t\t//PARA EXPORTAR\n\t\t\tdom: \"Bfrtip\",\n\t\t\tbuttons: [{\n\t\t\t\textend: \"copy\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"csv\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"excel\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"pdf\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"print\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}],\n\t\t\tresponsive: !0,\n\t\t\t\n\t\t\t\"order\" : [ [ 1, \"asc\" ] ],\n\t\t\t\"ajax\" : \"../usuario/getusuarios\",\n\t\t\t\"columns\" : [{\n\t\t\t\t\"data\" : \"IDUSUARIO\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"NOMBRE\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"AREA\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"STATUS\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"OPCIONES\"\n\t\t\t},\t\t\n\t\t\t],\n\t\t\t\"language\": {\n\t\t\t\t\"url\": \"/ugel06_dev/public/cdn/datatable.spanish.lang\"\n\t\t\t} \n\t\t});\t\n\t}", "function construirTabla() {\n let tabla = document.createElement(\"table\");\n let body = document.getElementById(\"paraTablas\");\n body.appendChild(tabla);\n tabla.setAttribute(\"id\", \"table\");\n tabla.setAttribute(\"class\", \"table table-hover\");\n let trheadcabeza = document.createElement(\"thead\");\n tabla.appendChild(trheadcabeza);\n trheadcabeza.setAttribute(\"class\", \"tabla_primerFila\");\n let trhead = document.createElement(\"tr\");\n trheadcabeza.appendChild(trhead);\n let tdhead0 = document.createElement(\"td\");\n tdhead0.innerHTML = \"Número de cuota\";\n trhead.appendChild(tdhead0);\n let tdhead1 = document.createElement(\"td\");\n tdhead1.innerHTML = \"Saldo pendiente al inicio\";\n trhead.appendChild(tdhead1);\n let tdhead2 = document.createElement(\"td\");\n tdhead2.innerHTML = \"Intereses sobre saldo\";\n trhead.appendChild(tdhead2);\n let tdhead3 = document.createElement(\"td\");\n tdhead3.innerHTML = \"Saldo con intereses\";\n trhead.appendChild(tdhead3);\n let tdhead4 = document.createElement(\"td\");\n tdhead4.innerHTML = \"Cuota a pagar\";\n trhead.appendChild(tdhead4);\n let tdhead5 = document.createElement(\"td\");\n tdhead5.innerHTML = \"Remanente post pago\";\n trhead.appendChild(tdhead5);\n let tbody = document.createElement(\"tbody\");\n tabla.appendChild(tbody);\n let prestamo = datosDePrestamo.length;\n for (let i = 0; i < prestamo; i++) {\n let tr1 = document.createElement(\"tr\");\n tbody.appendChild(tr1);\n let info0 = document.createElement(\"td\");\n info0.innerHTML = i + 1;\n tr1.appendChild(info0);\n let info = document.createElement(\"td\");\n info.innerHTML = redondear(datosDePrestamo[i].capital);\n tr1.appendChild(info);\n let info4 = document.createElement(\"td\");\n info4.innerHTML = redondear(datosDePrestamo[i].intereses);\n tr1.appendChild(info4);\n let info5 = document.createElement(\"td\");\n info5.innerHTML = redondear(datosDePrestamo[i].capitalPostInt);\n tr1.appendChild(info5);\n let info2 = document.createElement(\"td\");\n info2.innerHTML = redondear(datosDePrestamo[i].cuota);\n tr1.appendChild(info2);\n let info3 = document.createElement(\"td\");\n info3.innerHTML = redondear(datosDePrestamo[i].saldoRem);\n tr1.appendChild(info3);\n }\n $(\"#paraTablas\").append(`<button id=\"solicitarPrestamo\" class=\"btn btn-dark btn-align btn-margin\" onclick=\"solicitarPrestamo()\">Solicitar prestamo</button>`)\n $(\".tablaa\").fadeIn(\"slow\");\n}", "function genera_tabla(nombrecontenedor, nombretabla) {\n //// Obtener la referencia del elemento body\n //var body = document.getElementsByTagName(\"body\")[0];\n\n //// Crea un elemento <table> y un elemento <tbody>\n //var tabla = document.createElement(\"table\");\n //var tblBody = document.createElement(\"tbody\");\n\n //// Crea las celdas\n //for (var i = 0; i < 2; i++) {\n // // Crea las hileras de la tabla\n // var hilera = document.createElement(\"tr\");\n\n // for (var j = 0; j < 2; j++) {\n // // Crea un elemento <td> y un nodo de texto, haz que el nodo de\n // // texto sea el contenido de <td>, ubica el elemento <td> al final\n // // de la hilera de la tabla\n // var celda = document.createElement(\"td\");\n // var textoCelda = document.createTextNode(\"celda en la hilera \" + i + \", columna \" + j);\n // celda.appendChild(textoCelda);\n // hilera.appendChild(celda);\n // }\n\n // // agrega la hilera al final de la tabla (al final del elemento tblbody)\n // tblBody.appendChild(hilera);\n //}\n\n //// posiciona el <tbody> debajo del elemento <table>\n //tabla.appendChild(tblBody);\n //// appends <table> into <body>\n //body.appendChild(tabla);\n //// modifica el atributo \"border\" de la tabla y lo fija a \"2\";\n //tabla.setAttribute(\"border\", \"2\");\n\n //var resultArr = JSON.parse(datos);\n //alert(resultArr[0].name);\n \n var tabla = '<table id=\"' + nombretabla + '\">';\n tabla += '<caption>Lista de Items</caption>';\n tabla += '<thead>';\n tabla += '<tr>';\n tabla += '<th>Codigo</th>';\n tabla += '<th>Descripcion</th>';\n tabla += '<th>Tipo Item</th>';\n tabla += '<th>Uni. Med.</th>';\n tabla += '<th>Stck. Min.</th>';\n tabla += '<th>Stck. Max</th>';\n tabla += '<th>Cantidad</th>';\n tabla += '<th>Id</th>';\n tabla += '</tr>';\n tabla += '</thead>';\n\n tabla += '<tr class=\"color\">';\n tabla += '<td>11' + datos + '</td>';\n tabla += '<td>Daniel</td>';\n tabla += '</tr>';\n tabla += '<tr class=\"coloralter\">';\n tabla += '<td>12</td>';\n tabla += '<td>Carlos</td>';\n tabla += '</tr>';\n tabla += '<tr class=\"color\"\">';\n tabla += '<td>13</td>';\n tabla += '<td>kike</td>';\n tabla += '</tr>';\n tabla += '</table>';\n\n //var tabla = '<table id=\"table\">';\n //tabla += '<tr><td>Celda 1</td><td>Celda 2</td><td> Celda 3</td></tr>';\n //tabla += '<tr><td>Celda 1</td><td>Celda 2</td><td> Celda 3</td></tr>';\n //tabla += '<tr><td>Celda 1</td><td>Celda 2</td><td> Celda 3</td></tr>';\n //tabla += '</table>';\n document.getElementById(nombrecontenedor).innerHTML = tabla;\n\n //alert('hola');\n}", "function tabla2() {\n\n $('#tblRol2').dataTable({\n \"bProcessing\": true,\n \"sServerMethod\": 'GET',\n \"bServerSide\": true,\n \"bRetrieve\": true,\n \"info\": false,\n \"bFilter\": true,\n \"ordering\": true,\n \"bAutoWidth\": false,\n \"bLengthChange\": false,\n \"bPaginate\": true,\n \"iDisplayLength\": 10,\n \"sAjaxSource\": \"Usuarios/consultarDatosTablaUsuariosLaboratorioEliminado.php\",\n \"order\": [[1, \"asc\"]],\n \"aoColumnDefs\": [{\n \"aTargets\": [2],\n \"sType\": \"html\"\n , \"mRender\": function (date, type, full) {\n return (\"\" + full[2].toString());\n }\n }],\n \"oLanguage\": {\n \"oPaginate\": {\n \"sFirst\": \"Primera\",\n \"sPrevious\": \"Anterior\",\n \"sNext\": \"Siguiente\",\n \"sLast\": \"&Uacute;ltima\"\n },\n \"sZeroRecords\": \"No se encontraron registros\",\n \"sEmptyTable\": \"No hay registros\",\n \"sSearch\": \"B&uacute;squeda R&aacute;pida\"\n }\n }).fnSetFilteringDelay(250);\n}", "function listarAlumnosBec() {\n\ttablabecAlm = $(\"#tbListadoBecadosAlm\").dataTable({\n\t\t\"aProcessing\" : true,\n\t\t\"aServerSide\" : true,\n\t\tdom : 'Bftrip',\n\t\tbuttons: [\n\t\t],\n\t\t\"ajax\" : {\n\t\t\turl : \"../ajax/doc/tutFunctions.php?oper=listarAlumnosBec\",\n\t\t\ttype : \"GET\",\n\t\t\tdataType : \"json\",\n\t\t\terror : function(e) {\n\t\t\t\tconsole.log(e.responseText);\n\t\t\t}\n\t\t},\n\t\t\"bDestroy\" : true,\n\t\t\"iDisplayLength\" : 5,\n\t\t\"order\" : [[0, \"desc\"]]\n\t}).DataTable();\n}", "function cargarTablaProduccionBrasier(fechaInicial,fechaFinal) {\n\t$('.tablaProduccionBrasier').DataTable( {\n\t\t\"ajax\": \"ajax/produccion/tabla-produccionbrasier.ajax.php?perfil=\"+$(\"#perfilOculto\").val() + \"&fechaInicial=\" + fechaInicial + \"&fechaFinal=\" + fechaFinal,\n\t\t\"deferRender\": true,\n\t\t\"retrieve\": true,\n\t\t\"processing\": true,\n\t\t\"order\": [[1, \"desc\"]],\n\t\t\"pageLength\": 20,\n\t\t\"lengthMenu\": [[20, 40, 60, -1], [20, 40, 60, 'Todos']],\n\t\t\"language\": {\n\n\t\t\t\t\"sProcessing\": \"Procesando...\",\n\t\t\t\t\"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\t\t\t\t\"sZeroRecords\": \"No se encontraron resultados\",\n\t\t\t\t\"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\t\t\t\t\"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_\",\n\t\t\t\t\"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0\",\n\t\t\t\t\"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\t\t\t\t\"sInfoPostFix\": \"\",\n\t\t\t\t\"sSearch\": \"Buscar:\",\n\t\t\t\t\"sUrl\": \"\",\n\t\t\t\t\"sInfoThousands\": \",\",\n\t\t\t\t\"sLoadingRecords\": \"Cargando...\",\n\t\t\t\t\"oPaginate\": {\n\t\t\t\t\"sFirst\": \"Primero\",\n\t\t\t\t\"sLast\": \"Último\",\n\t\t\t\t\"sNext\": \"Siguiente\",\n\t\t\t\t\"sPrevious\": \"Anterior\"\n\t\t\t\t},\n\t\t\t\t\"oAria\": {\n\t\t\t\t\t\"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\t\t\t\t\t\"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\t\t\t\t}\n\n\t\t},\n\t\t\"drawCallback\":function(){\n\t\t\tvar api=this.api();\n\t\t\t$(api.column(18).footer()).html(\n\t\t\t\tapi.column(18,{page:'current'}).data().sum().toFixed(2)\n\t\t\t)\n\t\t\t$(api.column(19).footer()).html(\n\t\t\t\tapi.column(19,{page:'current'}).data().sum().toFixed(2)\n\t\t\t)\n\t\t} \n\t} );\n}", "function rafraichirTable() {\n\n\trafraichirPages();\n\n\tvar tbody = '';\n\tvar i = 0;\n\t/* Mon Dieu, un calcul scientifique ! */\n\tvar debut = (page_courante-1) * max_utilisateur_par_page;\n\tvar index = debut;\n\n\t/* Parcourons les utilisateurs */\n\twhile( i < liste_utilisateurs.length ) {\n\n\t\t/* StaticPages des filtres s'ils sont présents */\n\t\tif( filtre_service.length > 0 ) {\n\t\t\tif( liste_services[liste_utilisateurs[i].service] != filtre_service ) {\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif( filtre_type.length > 0 ) {\n\t\t\tif( liste_types[liste_utilisateurs[i].type] != filtre_type ) {\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t/* On applique les bornes */\n\t\tif( i < debut ) {\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tif( i == debut + max_utilisateur_par_page ) break; \n\n\t\ttbody += '<tr>';\n\t\ttbody += '<td>' + (++index) + '</td>';\n\t\ttbody += '<td>' + liste_utilisateurs[i].login + '</td>';\n\t\ttbody += '<td>' + liste_services[liste_utilisateurs[i].service] + '</td>';\n\t\ttbody += '<td>' + liste_types[liste_utilisateurs[i].type] + '</td>';\n\t\ttbody += '<td>';\n\t\tif( liste_utilisateurs[i].nom != null ) {\n\t\t\ttbody += liste_utilisateurs[i].nom;\n\t\t}\n\t\ttbody += '</td>';\n\t\ttbody += '<td>';\n\t\tif( liste_utilisateurs[i].prenom != null ) {\n\t\t\ttbody += liste_utilisateurs[i].prenom;\n\t\t}\n\t\ttbody += '</td>';\n\n\t\t/* Les actions, à savoir Editer et Bannir */\n\t\tvar id = liste_utilisateurs[i].id;\n\t\ttbody += '<td style=\"text-align: center;\">';\n\t\ttbody += '<a href=\"#\" class=\"edit\" uid=\"' + id + '\" title=\"Editer\"><i class=\"icon-pencil\"></i></a> ';\n\t\ttbody += '<a href=\"#\" class=\"del\" uid=\"' + id + '\" title=\"Bannir\"><i class=\"icon-remove\"></i></a>';\n\t\ttbody += '</td>';\n\t\ttbody += '</tr>';\n\n\t\ti++;\n\t}\n\n\t$( '#admin_utilisateurs #liste_utilisateurs' ).html( tbody );\n\n\t/* Ajout des triggers */\n\t$( \"a.edit\" ).click( editerUtilisateur );\n\t$( \"a.del\" ).click( supprimerUtilisateur );\n\t\n\t/*\n\t// Tri possible sur la table :\n\t$(\"#table_liste_utilisateurs\").tablesorter({\n\t\t// On désactive le tri sur la dernière colonne (celle des boutons) \n\t\theaders: { \n 0: {sorter: false},\n\t\t\t1: {sorter: false},\n\t\t\t2: {sorter: false},\n\t\t\t3: {sorter: false},\n\t\t\t4: {sorter: false},\n\t\t\t10: {sorter: false},\n }\n\t}); \n\t*/\n}", "function cargarTablaApuestas(fechaInicial,fechaFinal,empresa) {\n$('.tablaApuestas').DataTable({\n \"ajax\": \"ajax/apuestas/tabla-apuestas.ajax.php?perfil=\"+$(\"#perfilOculto\").val()+ \"&fechaInicial=\" + fechaInicial + \"&fechaFinal=\" + fechaFinal+ \"&empresa=\" +$(\"#empresaDate2\").val(),\n \"deferRender\": true,\n \"retrieve\": true,\n \"processing\": true,\n \"order\": [[7, \"desc\"]],\n\t\"pageLength\": 20,\n\t\"lengthMenu\": [[20, 40, 60, -1], [20, 40, 60, 'Todos']],\n \"language\": {\n \"sProcessing\": \"Procesando...\",\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n \"sZeroRecords\": \"No se encontraron resultados\",\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n \"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_\",\n \"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0\",\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n \"sInfoPostFix\": \"\",\n \"sSearch\": \"Buscar:\",\n \"sUrl\": \"\",\n \"sInfoThousands\": \",\",\n \"sLoadingRecords\": \"Cargando...\",\n \"oPaginate\": {\n \"sFirst\": \"Primero\",\n \"sLast\": \"Último\",\n \"sNext\": \"Siguiente\",\n \"sPrevious\": \"Anterior\"\n },\n \"oAria\": {\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n }\n },\n});\n}", "function listar_servicios_venta(){\n tabla_servicios_venta=$('#lista_servicios_ventas_data').dataTable(\n {\n \"aProcessing\": true,//Activamos el procesamiento del datatables\n \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n dom: 'Bfrtip',//Definimos los elementos del control de tabla\n responsive: true,\n buttons: [\n 'copyHtml5',\n 'excelHtml5',\n 'csvHtml5',\n 'pdf'\n ],\n \"ajax\":\n {\n url: 'ajax/productos.php?op=listar_servicios_venta',\n type : \"get\",\n dataType : \"json\",\n error: function(e){\n console.log(e.responseText);\n }\n },\n \"bDestroy\": true,\n \"responsive\": true,\n \"bInfo\":true,\n \"iDisplayLength\": 10,//Por cada 10 registros hace una paginación\n \"order\": [[ 0, \"desc\" ]],//Ordenar (columna,orden)\n\n \"language\": {\n\n \"sProcessing\": \"Procesando...\",\n\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\n \"sZeroRecords\": \"No se encontraron resultados\",\n\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\n \"sInfo\": \"Mostrando un total de _TOTAL_ registros\",\n\n \"sInfoEmpty\": \"Mostrando un total de 0 registros\",\n\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\n \"sInfoPostFix\": \"\",\n\n \"sSearch\": \"Buscar:\",\n\n \"sUrl\": \"\",\n\n \"sInfoThousands\": \",\",\n\n \"sLoadingRecords\": \"Cargando...\",\n\n \"oPaginate\": {\n\n \"sFirst\": \"Primero\",\n\n \"sLast\": \"Último\",\n\n \"sNext\": \"Siguiente\",\n\n \"sPrevious\": \"Anterior\"\n\n },\n\n \"oAria\": {\n\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\n }\n\n }//cerrando language\n\n }).DataTable();\n}", "function cargarTablaApuestasPlayer(fechaInicial,fechaFinal,empresa,usuario) {\n\n$('.tablaApuestasPlayer').DataTable({\n \"ajax\": \"ajax/apuestas/tabla-apuestas-player.ajax.php?perfil=\"+$(\"#perfilOculto\").val() + \"&fechaInicial2=\" + fechaInicial + \"&fechaFinal2=\" + fechaFinal+ \"&empresa=\" + $(\"#empresaDate\").val() + \"&usuario=\" + $(\"#userDate\").val(),\n \"deferRender\": true,\n \"retrieve\": true,\n \"processing\": true,\n \"order\": [[7, \"desc\"]],\n\t\"pageLength\": 20,\n\t\"lengthMenu\": [[20, 40, 60, -1], [20, 40, 60, 'Todos']],\n \"language\": {\n \"sProcessing\": \"Procesando...\",\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n \"sZeroRecords\": \"No se encontraron resultados\",\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n \"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_\",\n \"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0\",\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n \"sInfoPostFix\": \"\",\n \"sSearch\": \"Buscar:\",\n \"sUrl\": \"\",\n \"sInfoThousands\": \",\",\n \"sLoadingRecords\": \"Cargando...\",\n \"oPaginate\": {\n \"sFirst\": \"Primero\",\n \"sLast\": \"Último\",\n \"sNext\": \"Siguiente\",\n \"sPrevious\": \"Anterior\"\n },\n \"oAria\": {\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n }\n },\n});\n\n}", "function obtener_datos_por_establecimiento() {\n var lista = conexion_resultados();\n //var promedios = conexion_resultados_promedio_por_fecha();\n var contenido = \"\";\n var fecha = \"\";\n\n //removemos los datos previos de la tabla\n\n //checamos si la tabla tiene datos\n if (lista.length > 0) {\n $(\".celda_tabla_res\").remove();\n $.each(lista, function (index, item) {\n\n //obtenemos el nombre de usuario por medio de una consulta\n //var nombre_cuest = nombres_cuestionarios_por_folio(item.zona);\n var cuestionario = resultados_cuestionario_por_dia(item.fecha, item.id_cuestionario);\n\n if (index == 0) {\n fecha = item.fecha;\n // console.log(fecha + \">\");\n //creamos el contenido\n contenido = \" <tr class='celda_tabla_res fecha'> <td id='indice'colspan='6' > \" + nombre_fecha(fecha) + \"<td></tr><tr class='celda_tabla_res'> <th>#</th><th>CUESTIONARIO</th> <th>LIMPIEZA %</th> <th>SURTIDO % </th> <th>IMAGEN %</th> <th>APLICADOR</th> </tr>\"\n // $(\"#tabla_res\").append(contenido);\n }//fin if\n if (fecha == item.fecha) {\n\n //creamos el contenido\n contenido += \" <tr class='celda_tabla_res dato' onclick='llenar_modal_cuestionarios(\\\"\" + item.fecha + \"\\\",\" + item.id_cuestionario + \")'> <td id='indice'>\" + item.id_cuestionario + \"</td><td class='nombre' >\" + cuestionario.cuestionario + \"</td> <td id='zona_lim' >\" + cuestionario.limpieza + \"</td> <td id='zona_surt' >\" + cuestionario.surtido + \"</td> <td id='zona_imag' >\" + cuestionario.imagen + \"</td> <td id='zona_aplicador'>\" + item.aplicador + \"</td> </tr>\";\n //$(\"#tabla_res\").append(contenido);\n //llenamos los datos de pie\n }//fin if\n else if (fecha != item.fecha) {\n\n //$(\"#tabla_res\").append(contenido);\n\n var promedio = conexion_resultados_promedio_por_fecha(fecha);\n\n // console.log(promedios[contador_fecha].fecha + \":\" + promedios[contador_fecha].aspecto+\":\"+promedios[contador_fecha].aspecto);\n fecha = item.fecha;\n //creamos el contenido\n contenido += \" <tr class='celda_tabla_res'><th colspan='2'>Total:</th> <th>\" + promedio.limpieza + \"</th> <th>\" + promedio.surtido + \"</th> <th>\" + promedio.imagen + \"</th><th>\" + promedio.total + \"</th> </tr><tr class='celda_tabla_res fecha'> <td id='indice'colspan='6' > \" + nombre_fecha(fecha) + \"<td> <tr class='celda_tabla_res'> <th>#</th><th>CUESTIONARIO</th> <th>LIMPIEZA %</th> <th>SURTIDO %</th> <th>IMAGEN %</th> <th>APLICADOR</th> </tr> </tr><tr class='celda_tabla_res dato' onclick='llenar_modal_cuestionarios(\\\"\" + item.fecha + \"\\\",\" + item.id_cuestionario + \")' > <td id='indice'>\" + item.id_cuestionario + \"</td><td class='nombre' >\" + cuestionario.cuestionario + \"</td> <td id='zona_lim' >\" + cuestionario.limpieza + \"</td> <td id='zona_surt' >\" + cuestionario.surtido + \"</td> <td id='zona_imag' >\" + cuestionario.imagen + \"</td> <td id='zona_aplicador'>\" + item.aplicador + \"</td> <</tr>\"\n // $(\"#tabla_res\").append(contenido);\n \n }//fin if\n\n });\n var promedio = conexion_resultados_promedio_por_fecha(fecha);\n contenido += \" <tr class='celda_tabla_res'><th colspan='2'>Total:</th> <th>\" + promedio.limpieza + \"</th> <th>\" + promedio.surtido + \"</th> <th>\" + promedio.imagen + \"</th><th>\" + promedio.total + \"</th></tr>\"\n $(\"#tabla_res\").append(contenido);\n //ajustamos los decimales de total \n // total_limpieza = r(total_limpieza) ;\n //total_limpieza = Math.round(total_limpieza);\n //total_limpieza = total_limpieza / 100;\n var totales = conexion_resultados_ckl_total_por_fechas_establecimiento();\n //console.log(r(total_limpieza / contador) + \":\" + r(total_surtido / contador) + \":\" + r(total_imagen / contador));\n $(\"#total_limpieza\").val(totales.limpieza), $(\"#total_surtido\").val(totales.surtido), $(\"#total_imagen\").val(totales.imagen);\n var res = (total_limpieza + total_surtido + total_imagen);\n //console.log(res);\n $(\"#total_neto\").val(totales.total);\n\n }//fin\n //si no hay datos manda una advertencia\n else {\n alert(\"No Hay Datos...\");\n }\n\n}//fin", "function listarEmpresa() {\n\tvar estado = 1;\n\t$(document).ready(function () {\n\t\t$('#tablaempresa').DataTable({\n\t\t\t\"destroy\": true,\n\t\t\t\"searching\": true,\n\t\t\t\"ajax\": \"../models/empresa/listar.php\",\n\t\t\t\"dataSrc\": \"\",\n\t\t\t\"method\": \"POST\",\n\t\t\t\"columns\": [{\n\t\t\t\t\t\"data\": \"nit\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"data\": \"nombre\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"data\": \"marca\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"data\": \"telefono\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"data\": \"correo\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"data\": \"estado\",\n\t\t\t\t\trender: function (data) {\n\t\t\t\t\t\testado = data;\n\t\t\t\t\t\tif (data == 'Activo') {\n\t\t\t\t\t\t\treturn \"<span class='badge badge-success badge-pill text-center'>Activo</span>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn \"<span class='badge badge-danger badge-pill text-center'>Inactivo</span>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"data\": \"codigo\",\n\t\t\t\t\trender: function (data) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (estado == 'Activo') {\n\t\t\t\t\t\t\treturn \"<div class='dropdown dropdown-action'><a href='#'' class='action-icon dropdown-toggle' data-toggle='dropdown' aria-expanded='false'><i class='fa fa-ellipsis-v'></i></a><div class='dropdown-menu dropdown-menu-right'><a class='dropdown-item' href='#' onclick='preparar(\" + data + \")' data-toggle='modal' data-target='#editarempresa'><i class='si si-pencil'></i> Editar</a><a class='dropdown-item' href='#' onclick='eliminar(\" + data + \")'><i class='si si-trash'></i> Eliminar</a></div></div>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn \"<div class='dropdown dropdown-action'><a href='#'' class='action-icon dropdown-toggle' data-toggle='dropdown' aria-expanded='false'><i class='fa fa-ellipsis-v'></i></a><div class='dropdown-menu dropdown-menu-right'><a class='dropdown-item' href='#'' value=\" + data + \" onclick='renovar(\" + data + \")'><i class='fa fa-undo'></i> Renovar</a></div></div>\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t]\n\t\t});\n\t});\n}", "function Tabla_consulta() {\n\n var html_Paises = \"<table id='TPaises' border='1' cellpadding='1' cellspacing='1' style='width: 100%'><thead><tr><th>Pais</th></tr></thead><tbody>\";\n var ruta;\n\n for (itemArray in ArrayPaises) {\n if (ArrayPaises[itemArray].Pais_ID != 0) {\n html_Paises += \"<tr style='font-size: 13px;' id= 'Paises_\" + ArrayPaises[itemArray].Pais_ID + \"'><td>\" + ArrayPaises[itemArray].Pais_Nombre + \"</td></tr>\";\n }\n }\n html_Paises += \"</tbody></table>\";\n $(\"#Container_Grid\").html(\"\");\n $(\"#Container_Grid\").html(html_Paises);\n\n $(\"#TPaises\").dataTable({\n \"bJQueryUI\": true,\n \"bDestroy\": true\n });\n $(\"#Dialog_Grid\").dialog(\"open\");\n $(\"#Dialog_Grid\").dialog(\"option\", \"title\", \"Consulta Paises\");\n\n}", "function renderTable() {\n\n var table = $('<table>', { \"id\": \"group\", \"class\": \"mdl-data-table\"}).appendTo('#content');\n var thead = $('<thead>').appendTo(table);\n var tr = $('<tr>').appendTo(thead);\n var name = $('<th>').html(\"Имя\").appendTo(tr);\n var discipline = $('<th>').html(\"Предмет\").appendTo(tr);\n var grade = $('<th>').html(\"Оценка\").appendTo(tr);\n var edit = $('<th>').html(\"Изменить\").appendTo(tr);\n\n/*jquery plugin for work with tables*/\n $('#group').DataTable({\n \"ajax\": '../arrays.json',\n \"language\": {\n \"url\": 'tableLangRus.json'\n }\n });\n}", "function datatables_boletas(){\n\t\t$('#datatables_boletas').DataTable({\n\t\t language: {\n \"lengthMenu\": \"Mostrar _MENU_ por pagina\",\n \"zeroRecords\": \"Ningun registro encontrado\",\n \"info\": \"Pagina _PAGE_ de _PAGES_\",\n \"infoEmpty\": \"No se encontraron resultados\",\n \"infoFiltered\": \"(filtro _MAX_ registro maximo)\",\n \"search\":\"Buscar:\",\n \"paginate\":{\"next\":\">>\",\n \t\t\t\t\"previous\":\"<<\"}\n },\n /*language: {\n \"url\": \"//cdn.datatables.net/plug-ins/1.10.11/i18n/Spanish.json\"\n },*/\n\t\tdom: 'Bfrtip',\n buttons: [\n \t\t'pageLength',\n 'copy',\n 'csv',\n 'pdf'\n ],\n lengthMenu: [\n\t\t\t[10, 20, 50],\n\t\t\t['10 registros', '20 registros', '50 registros', 'Show all']\n\t\t\t],\n scrollY: 250\n\t\t});\n\t}", "function drawTablePlugin(tabla) {\n $(\"#\" + tabla).DataTable({\n scrollX: true,\n scrollY: '50vh',\n sort: false,\n scrollCollapse: true,\n aLengthMenu: [\n [10, 25, 50, 75, -1],\n [10, 25, 50, 75, \"Todos\"]\n ],\n iDisplayLength: -1,\n \"language\": {\n \"lengthMenu\": \"Mostrar _MENU_ registros por página\",\n \"zeroRecords\": \"No se encontraron coincidencias\",\n \"info\": \"Mostrando página _PAGE_ de _PAGES_\",\n \"infoEmpty\": \"No hay registros disponibles\",\n \"infoFiltered\": \"(filtrado de _MAX_ registros totales)\",\n \"sSearch\": \"Buscar: \",\n \"paginate\": {\n \"first\": \"Primera\",\n \"last\": \"Ultima\",\n \"next\": \"Siguiente\",\n \"previous\": \"Anterior\"\n }\n }\n\n });\n}", "function listarTraspasoProducto()\n{\n\ttabla=$('#tbllistado').dataTable(\n\t{\n\t\t\"aProcessing\": true,//Activamos el procesamiento del datatables\n\t \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n\t dom: 'Bfrtip',\n\t\t\t//Definimos los elementos del control de tabla\n\t buttons: [\n\t\t // 'copyHtml5',\n\t\t // 'excelHtml5',\n\t\t // 'csvHtml5',\n\t\t // 'pdf'\n\t\t ],\n\t\t\"ajax\":\n\t\t\t\t{\n\t\t\t\t\turl: '../ajax/transferencia.php?op=listarTraspaso',\n\t\t\t\t\ttype : \"get\",\n\t\t\t\t\tdataType : \"json\",\n\t\t\t\t\terror: function(e){\n\t\t\t\t\t\tconsole.log(e.responseText);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\"bDestroy\": true,\n\t\t\"iDisplayLength\": 5,//Paginación\n\t \"order\": [[ 0, \"desc\" ]]//Ordenar (columna,orden)\n\t}).DataTable();\n\n\tvar buttons = new $.fn.dataTable.Buttons(tabla, {\n buttons: [\n {\n extend: 'excelHtml5',\n text: 'Reportes EXCEL',\n\t\t\t\t\tclassName: \"btn btn-sm btn-success\",\n\t\t\t\t\tinit: function( api, node, config) {\n\t\t\t\t\t\t $(node).removeClass('btn-default')\n\t\t\t\t\t}\n },\n {\n extend: 'pdfHtml5',\n text: 'Reportes PDF',\n\t\t\t\t\tclassName: \"btn btn-sm btn-warning\",\n\t\t\t\t\tinit: function( api, node, config) {\n\t\t\t\t\t\t $(node).removeClass('btn-default')\n\t\t\t\t\t}\n },\n ]\n}).container().appendTo($('#buttons'));\n\n}", "function listar() {\n $(document).ready(function () {\n $(\"#table\").DataTable({\n iDisplayLength: 5, // Modificamos show Entries\n ajax: {\n url: \"../controller/ClientesController.php?opcion=listar\",\n type: \"get\",\n dataType: \"json\",\n error: function (e) {\n console.log(e.responseText);\n },\n },\n });\n });\n}", "function cargarTablaProduccionVasco(mesV) {\n\t$('.tablaProduccionVasco').DataTable( {\n\t\t\"ajax\": \"ajax/produccion/tabla-produccionvasco.ajax.php?perfil=\"+$(\"#perfilOculto\").val() + \"&mesV=\" + mesV,\n\t\t\"deferRender\": true,\n\t\t\"retrieve\": true,\n\t\t\"processing\": true,\n\t\t\"order\": [[1, \"desc\"]],\n\t\t\"pageLength\": 20,\n\t\t\"lengthMenu\": [[20, 40, 60, -1], [20, 40, 60, 'Todos']],\n\t\t\"language\": {\n\n\t\t\t\t\"sProcessing\": \"Procesando...\",\n\t\t\t\t\"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\t\t\t\t\"sZeroRecords\": \"No se encontraron resultados\",\n\t\t\t\t\"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\t\t\t\t\"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_\",\n\t\t\t\t\"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0\",\n\t\t\t\t\"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\t\t\t\t\"sInfoPostFix\": \"\",\n\t\t\t\t\"sSearch\": \"Buscar:\",\n\t\t\t\t\"sUrl\": \"\",\n\t\t\t\t\"sInfoThousands\": \",\",\n\t\t\t\t\"sLoadingRecords\": \"Cargando...\",\n\t\t\t\t\"oPaginate\": {\n\t\t\t\t\"sFirst\": \"Primero\",\n\t\t\t\t\"sLast\": \"Último\",\n\t\t\t\t\"sNext\": \"Siguiente\",\n\t\t\t\t\"sPrevious\": \"Anterior\"\n\t\t\t\t},\n\t\t\t\t\"oAria\": {\n\t\t\t\t\t\"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\t\t\t\t\t\"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\t\t\t\t}\n\n\t\t} \n\t} );\n}", "function loadTableUsuarios(){\n\n var domContent = '<\"DTextraToolbar\">rftip';\n \n let tableUsuarios = $('#tableUsuarios').DataTable( {\n \"language\": jsonEsp,\n \"ajax\":{\n url :\"../../api/usuario/getAll\", // json datasource\n type: \"get\", // method , by default get\n scriptCharset: 'utf-8',\n\t dataSrc: '',\n\t\t\tdataType: 'json',\n\t\t\tcontentType: 'application/json; charset=utf-8',\n error: function(){ // error handling\n alertaFallo(\"Error al obtener los usuarios\");\n }\n },\n \"columns\" : columns,\n \"autoWidth\": false,\n dom: domContent,\n 'columnDefs': [\n {\n targets: [0, 6],\n width: '5%'\n }\n ],\n \n } );\n}", "function Tabla_consulta_Ciudad() {\n\n var html_Paises = \"<table id='TPaises' border='1' cellpadding='1' cellspacing='1' style='width: 100%'><thead><tr><th>Pais</th><th>Ciudad</th></tr></thead><tbody>\";\n var ruta;\n\n for (itemArray in ArrayPaises) {\n if (ArrayPaises[itemArray].Ciudad_ID != 0) {\n html_Paises += \"<tr style='font-size: 13px;' id= 'Paises_\" + ArrayPaises[itemArray].Ciudad_ID + \"'><td>\" + ArrayPaises[itemArray].Pais_Nombre + \"</td><td>\" + ArrayPaises[itemArray].Ciudad_Nombre + \"</td></tr>\";\n }\n }\n html_Paises += \"</tbody></table>\";\n $(\"#Container_Grid\").html(\"\");\n $(\"#Container_Grid\").html(html_Paises);\n\n $(\"#TPaises\").dataTable({\n \"bJQueryUI\": true,\n \"bDestroy\": true\n });\n $(\"#Dialog_Grid\").dialog(\"open\");\n $(\"#Dialog_Grid\").dialog(\"option\", \"title\", \"Consulta Ciudades\");\n\n}", "function listar_aros_creados(){\n tabla_aros_creados=$('#data_lista_aros_creados').dataTable(\n {\n \"aProcessing\": true,//Activamos el procesamiento del datatables\n \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n dom: 'Bfrtip',//Definimos los elementos del control de tabla\n buttons: ['copyHtml5', {\n extend: 'excelHtml5',\n text: 'Descargar Excel',\n filename: function() {\n var date_edition = 'Productos creados '+moment().format(\"DD-MM-YYYY HH[h]mm\")\n var selected_machine_name = $(\"#output_select_machine select option:selected\").text()\n return date_edition + ' - ' + selected_machine_name\n },\n sheetName: 'Output logiciel complet',\n title : null\n }],\n \"ajax\":\n {\n url: 'ajax/productos.php?op=listar_aros_creados',\n type : \"get\",\n dataType : \"json\",\n error: function(e){\n console.log(e.responseText);\n }\n },\n \"bDestroy\": true,\n \"responsive\": true,\n \"bInfo\":true,\n \"iDisplayLength\": 10,//Por cada 10 registros hace una paginación\n \"order\": [[ 0, \"desc\" ]],//Ordenar (columna,orden)\n\n \"language\": {\n\n \"sProcessing\": \"Procesando...\",\n\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\n \"sZeroRecords\": \"No se encontraron resultados\",\n\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\n \"sInfo\": \"Mostrando un total de _TOTAL_ registros\",\n\n \"sInfoEmpty\": \"Mostrando un total de 0 registros\",\n\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\n \"sInfoPostFix\": \"\",\n\n \"sSearch\": \"Buscar:\",\n\n \"sUrl\": \"\",\n\n \"sInfoThousands\": \",\",\n\n \"sLoadingRecords\": \"Cargando...\",\n\n \"oPaginate\": {\n\n \"sFirst\": \"Primero\",\n\n \"sLast\": \"Último\",\n\n \"sNext\": \"Siguiente\",\n\n \"sPrevious\": \"Anterior\"\n\n },\n\n \"oAria\": {\n\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\n }\n\n }//cerrando language\n\n }).DataTable();\n}", "function dtProductos() {\n var table = $(\"#tabla-productos\").DataTable({\n destroy: true,\n responsive: true,\n ajax: { //Datatables usa Jquery, por lo que tiene incorporado AJAX para cargar datos\n method: \"POST\",\n url: \"frmAdministrarProductos.aspx/obtenerProductos\", //llama al web method de la ruta\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n data: function (d) {\n return JSON.stringify(d); //convierte json a string\n },\n dataSrc: \"d.data\" //usa la data (convertida a string) del json como fuente de datos para llenar la tabla\n },\n columns: [\n { \"data\": \"idProducto\" },\n { \"data\": \"Nombre\" },\n { \"data\": \"Marca\" },\n { \"data\": \"Contenido\" },\n { \"data\": \"Categoria\" },\n { \"data\": \"Descripcion\" },\n { \"data\": \"Foto\" },\n { \"data\": \"Estatus\" }\n ]\n });\n}", "function createAnzeige(data) {\n var e, i = 0, j, l = data.entries.length,\n lang = data.lang, id,\n barcode_present = ['&#10007;', '&#8730;'];\n createTableHeader(data.fields);\n\n\n\n\tvar tabledata = [];\n for ( var i=0 ; i<l; i++ ) {\n\t e = data.entries[i];\n\t tablerow = {};\n\n\t if (e.barcode != '0') {\n tablerow['DT_RowClass'] = 'has_barcode';\n }\n\n\t for (var j=0; j < data.fields.length; j++) {\n\t\tid = data.fields[j][0];\n\n if (id == 93) {\n tablerow[j] = barcode_present[e.barcode];\n } else if (id == 27) {\n tablerow[j] = e.species;\n } else if (id == 28) {\n tablerow[j] = e.vernacular;\n } else if (id == 19) {\n tablerow[j] = e.taxon;\n } else if (id == 22) {\n tablerow[j] = e.institute;\n } else {\n if (e.data[id]) {\n tablerow[j] = e.data[id];\n } else {\n tablerow[j] = '';\n }\n }\n\t }\n\t tabledata.push(tablerow);\n\t}\n\n\n\tvar tablecolumns = [];\n\n\tfor (var j=0; j < data.fields.length; j++) {\n\t // generate array of {tabledata: 'index'} objects \n\t tablecolumns.push({'data': j})\n\t}\n\n\n if (i > 0) {\n\n\t // set table generation parameters depending on row number\n\t var paging = false;\n\t var defrender = false;\n\t var scroller = false;\n\t if (i > 10000) {\n\t\tpaging = true;\n\t\tdefrender = true;\n\t\t//scroller = {\n\t\t// loadingIndicator: true \n\t\t//}\n\t\t// switch line break off in cells to enable scrollers.js deferred loading capabilities\n\t\t//$('.dataTable').css('white-space', 'nowrap');\n\t }\n\n\n var resulttable = $('#viewTable').DataTable({\n\t\t'data': tabledata,\n\t\t'columns': tablecolumns,\n\t\t// try scroller\n\t\t\"scroller\": scroller,\n\t\t\"deferRender\": defrender,\n \"pagingType\": \"full_numbers\",\n \"scrollX\": true,\n \"scrollY\": 200,\n \"scrollCollapse\": false,\n \"paging\": paging,\n\t\t\"lengthMenu\": [ 10, 50, 100, 500, 1000 ],\n\t\t//wait 400ms between each keypress adding a letter in search field \n\t\t\"searchDelay\": 400,\n\t\t// pageLength is set below because of performance problems when set here\n\t\t//\"pageLength\": \"100\",\n \"language\": {\n \"url\": \"/static/js/DataTables/\" + BOL.get_lang() + \".txt\"\n }\n //\"order\": [[1, \"asc\"]]\n });\n\n\t // setting pageLength in parameters kills performance when loading new pages\n\t resulttable.page.len(1000).draw;\n\n $(\"#viewTable\").removeClass('hidden');\n $(\"#viewCounter\").html(BOL.sentences(0) + i);\n }\n }", "function tablaCoS(data){\n var tabuladoCoS = '<table class=\"striped tablaArmada\"><thead><tr>';\n var cabezera = false;\n console.log(data);\n for (var i = 0; i < data.Coberturas.length; i++) {\n\n //tomamos las cabezeras, años del primer dato\n if(!cabezera){\n tabuladoCoS += '<th> Entidad Federativa </th>';\n for (var j = 0; j < data.Coberturas[i].ValorDato.length; j++) {\n if(data.Coberturas[i].ValorDato[j].Leyenda_ser == '' || data.Coberturas[i].ValorDato[j].Leyenda_ser == null){\n tabuladoCoS += '<th>' + data.Coberturas[i].ValorDato[j].AADato_ser + '</th>';\n }else{\n tabuladoCoS += '<th>' + data.Coberturas[i].ValorDato[j].Leyenda_ser + '</th>';\n }\n\n }//fin for j\n cabezera = true;\n }\n\n tabuladoCoS += '</tr></thead><tr><td>' + '<span style=\"display:none;\">'+data.Coberturas[i].ClaveCobGeo_cg+ '</span>' + data.Coberturas[i].Descrip_cg +'</td>';\n for (var j = 0; j < data.Coberturas[i].ValorDato.length; j++) {\n if(data.Coberturas[i].ValorDato[j].Dato_Formato == \"\"){\n tabuladoCoS += '<td style=\"text-align:right;\"> '+ data.Coberturas[i].ValorDato[j].NoDatos.Codigo_nd +' </td>';\n }else{\n tabuladoCoS += '<td style=\"text-align:right;\">' + data.Coberturas[i].ValorDato[j].Dato_Formato + '</td>';\n }\n }//fin for j\n tabuladoCoS += '</tr>';\n }//fin for i\n tabuladoCoS += '</table>';\n\n //$('#tabla').html(tabuladoCoS);\n return tabuladoCoS;\n}//fin funcion", "function datatables(tableId, columnOrder) {\n $(tableId).DataTable({\n 'language': {\n 'lengthMenu': 'Desplegando _MENU_ registros por página',\n 'zeroRecords': 'No se encontraron resultados',\n 'info': 'Mostrando página _PAGE_ de _PAGES_',\n 'infoEmpty': 'Sin resultados',\n 'infoFiltered': '(filtrado de _MAX_ registros totales)',\n 'search': 'Buscar:',\n 'paginate': {\n 'previous': 'Anterior <<',\n 'next': 'Siguiente >>'\n }\n },\n 'order': [[columnOrder, 'desc']]\n });\n}", "function requieren_repa_externa()\r\n{\r\n \r\n if ( $.fn.dataTable.isDataTable( '#tbl_sin_reparar' ) ) {\r\n $('#tbl_sin_reparar').DataTable().destroy();\r\n }\r\n var t = $('#tbl_sin_reparar').DataTable(\r\n {\r\n 'language':\r\n {\r\n 'url':'//cdn.datatables.net/plug-ins/1.10.19/i18n/Spanish.json'\r\n },\r\n 'lengthMenu': [[10, 25, 50,100, -1], [10, 25, 50, 100, 'Todos']],\r\n \r\n dom: '<<\"col-md-3\"B><\"#buscar.col-sm-4\"f><\"pull-right\"l><t>pr>',\r\n buttons:{\r\n buttons: [\r\n { extend: 'pdf', className: 'btn btn-flat btn-warning',text:' <i class=\"fa fa-file-pdf-o\"></i> Exportar a PDF' },\r\n { extend: 'excel', className: 'btn btn-success btn-flat',text:' <i class=\"fa fa-file-excel-o\"></i> Exportar a Excel' }\r\n ]\r\n } \r\n }\r\n );\r\n $.ajax({\r\n url: 'controller/puente.php',\r\n type: 'POST',\r\n dataType: 'json',\r\n data: {option: '59'},\r\n async:false,\r\n })\r\n .done(function(bienes) {\r\n //$('#tbl_sin_reparar tbody').empty();\r\n $.each(bienes, function(i, bien) {\r\n var acciones ='<div class=\"btn-group \">'+\r\n '<button type=\"button\" class=\"btn btn-info dropdown-toggle\" data-toggle=\"dropdown\" aria-expanded=\"true\">'+\r\n '<span class=\"caret\"></span>'+\r\n '<span class=\"sr-only\">Toggle Dropdown</span>'+\r\n '</button>'+\r\n '<ul class=\"dropdown-menu\" role=\"menu\">'+\r\n '<li><a href=\"#\" onclick=\"modal_reparar('+bien.id+');\">Mandar a reparar</a></li>'+\r\n \r\n '</ul>'+\r\n '</div>';\r\n var detalle = \r\n '<ul>'+\r\n '<li><label>Marca: </label> '+bien.marca+' </li>'+\r\n '<li><label>Modelo: </label> ' +bien.modelo+' </li>'+\r\n '<li><label>Serie: </label> '+bien.serie+' </li>'+\r\n '<li><label>Inventario: </label> '+bien.inventario+' </li>'+\r\n '</ul>';\r\n /*Agregar la info a la tabla*/\r\n t.row.add( [\r\n acciones,\r\n bien.id,\r\n detalle,\r\n bien.asignadoa\r\n ] ).draw( false );\r\n \r\n });\r\n })\r\n .fail(function() {\r\n console.log(\"error\");\r\n });\r\n \r\n return false;\r\n}", "function traerVisitas(Fecha_Inicio,Fecha_Fin)\n{\n $(\"#tblvisitas\").DataTable({\n responsive: true,\n language: {\n url: base_url+\"public/libs/DataTables/json/spanish.json\",\n },\n ajax:{\n url: base_url+\"bi/muestraVisitasFechas/\",\n data:{\n Fecha_Inicio: Fecha_Inicio,\n Fecha_Fin: Fecha_Fin\n },\n type: \"post\",\n },\n columns: [\n { data: \"Fecha_Ejecucion\" },\n { data: \"Pais\" },\n { data: \"Region\"}, \n { data: \"Ciudad\"}\n ]\n })\n}", "function getOrdenes() {\n\tvar tabla = $(\"#ordenes_trabajo\").anexGrid({\n\t class: 'table-striped table-bordered table-hover',\n\t columnas: [\n\t \t{ leyenda: 'Acciones', style: 'width:100px;', columna: 'Sueldo' },\n\t \t{ leyenda: 'ID', style:'width:20px;', columna: 'id', ordenable:true},\n\t { leyenda: 'Clave de orden de trabajo', style: 'width:200px;', columna: 'o.clave', filtro:true},\n\t { leyenda: 'Tipo de orden', style: 'width:100px;', columna: 'o.t_orden', filtro:function(){\n\t \treturn anexGrid_select({\n\t data: [\n\t { valor: '', contenido: 'Todos' },\n\t { valor: '1', contenido: 'INSPECCIÓN' },\n\t { valor: '2', contenido: 'VERIFICACIÓN' },\n\t { valor: '3', contenido: 'SUPERVISIÓN' },\n\t { valor: '4', contenido: 'INVESTIGACIÓN' },\n\t ]\n\t });\n\t }},\n\t { leyenda: 'Número de oficio', style: 'width:200px;', columna: 'of.no_oficio',filtro:true},\n\t { leyenda: 'Fecha', columna: 'o.f_creacion', filtro: function(){\n \t\treturn anexGrid_input({\n \t\t\ttype: 'date',\n \t\t\tattr:[\n \t\t\t\t'name=\"f_ot\"'\n \t\t\t]\n \t });\n\t } },\n\t //{ leyenda: 'Participantes', style: 'width:300px;', columna: 'Correo' },\n\t { leyenda: 'Estado', style: 'width:120px;', columna: 'o.estatus', filtro:function(){\n\t \treturn anexGrid_select({\n\t data: [\n\t { valor: '', contenido: 'Todos' },\n\t { valor: '1', contenido: 'Cumplida' },\n\t { valor: '2', contenido: 'Parcial sin resultado' },\n\t { valor: '3', contenido: 'Parcial con resultado' },\n\t { valor: '4', contenido: 'Cumplida sin resultado' },\n\t { valor: '5', contenido: 'Cancelada' },\n\t ]\n\t });\n\t }},\n\t \n\t ],\n\t modelo: [\n\t \t\n\t \t{ class:'',formato: function(tr, obj, valor){\n\t \t\tvar acciones = [];\n\t \t\tif (obj.estatus == 'Cancelada') {\n\t \t\t\tacciones = [\n { href: \"javascript:open_modal('modal_ot_upload',\"+obj.id+\");\", contenido: '<i class=\"glyphicon glyphicon-cloud\"></i> Adjuntar documento' },\n { href: \"javascript:open_modal('modal_add_obs');\", contenido: '<i class=\"glyphicon glyphicon-comment\"></i>Agregar observaciones' },\n { href: 'index.php?menu=detalle&ot='+obj.id, contenido: '<i class=\"glyphicon glyphicon-eye-open\"></i>Ver detalle' },\n ];\n\t \t\t}else{\n\t \t\t\tacciones = [\n { href: \"javascript:open_modal('modal_ot_upload',\"+obj.id+\");\", contenido: '<i class=\"glyphicon glyphicon-cloud\"></i> Adjuntar documento' },\n { href: \"javascript:open_modal('modal_add_obs');\", contenido: '<i class=\"glyphicon glyphicon-comment\"></i>Agregar observaciones' },\n { href: 'index.php?menu=detalle&ot='+obj.id, contenido: '<i class=\"glyphicon glyphicon-eye-open\"></i>Ver detalle' },\n { href: \"javascript:open_modal('modal_cancelar_ot',\"+obj.id+\");\", contenido: '<i class=\"fa fa-ban text-red\"></i><b class=\"text-red\">Cancelar</b> '},\n ];\n\t \t\t}\n\t return anexGrid_dropdown({\n contenido: '<i class=\"glyphicon glyphicon-cog\"></i>',\n class: 'btn btn-primary ',\n target: '_blank',\n id: 'editar',\n data: acciones\n });\n\t }},\n\t \t\n\t { class:'',formato: function(tr, obj, valor){\n\t \t\tvar acciones = [];\n\t \t\tif (obj.estatus == 'Cancelada') {\n\t \t\t\ttr.addClass('bg-red-active');\n\t \t\t}\n\t return obj.id;\n\t }},\n\t { propiedad: 'clave' },\n\t { propiedad: 't_orden' },\n\t { propiedad: 'oficio' },\n\t { propiedad: 'f_creacion' },\n\t //{ propiedad: 'id'},\n\t { propiedad: 'estatus'}\n\t \n\t \n\t ],\n\t url: 'controller/puente.php?option=8',\n\t filtrable: true,\n\t paginable: true,\n\t columna: 'id',\n\t columna_orden: 'DESC'\n\t});\n\treturn tabla;\n}", "function listar_photo_venta(){\n tabla_photo_venta=$('#lista_photo_ventas_data').dataTable(\n {\n \"aProcessing\": true,//Activamos el procesamiento del datatables\n \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n dom: 'Bfrtip',//Definimos los elementos del control de tabla\n responsive: true,\n buttons: [\n 'copyHtml5',\n 'excelHtml5',\n 'csvHtml5',\n 'pdf'\n ],\n \"ajax\":\n {\n url: 'ajax/productos.php?op=listar_photo_venta',\n type : \"get\",\n dataType : \"json\",\n error: function(e){\n console.log(e.responseText);\n }\n },\n \"bDestroy\": true,\n \"responsive\": true,\n \"bInfo\":true,\n \"iDisplayLength\": 10,//Por cada 10 registros hace una paginación\n \"order\": [[ 0, \"desc\" ]],//Ordenar (columna,orden)\n\n \"language\": {\n\n \"sProcessing\": \"Procesando...\",\n\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\n \"sZeroRecords\": \"No se encontraron resultados\",\n\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\n \"sInfo\": \"Mostrando un total de _TOTAL_ registros\",\n\n \"sInfoEmpty\": \"Mostrando un total de 0 registros\",\n\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\n \"sInfoPostFix\": \"\",\n\n \"sSearch\": \"Buscar:\",\n\n \"sUrl\": \"\",\n\n \"sInfoThousands\": \",\",\n\n \"sLoadingRecords\": \"Cargando...\",\n\n \"oPaginate\": {\n\n \"sFirst\": \"Primero\",\n\n \"sLast\": \"Último\",\n\n \"sNext\": \"Siguiente\",\n\n \"sPrevious\": \"Anterior\"\n\n },\n\n \"oAria\": {\n\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\n }\n\n }//cerrando language\n\n }).DataTable();\n}", "function settingTable() {\n let title = 'Lista de proyectos';\n // $('#tblProjects').DataTable().destroy();\n let filename = title.replace(/ /g, '_') + '-' + moment(Date()).format('YYYYMMDD');\n var tabla = $('#tblProjects').DataTable({\n order: [[6, 'desc']],\n dom: 'Blfrtip',\n lengthMenu: [\n [50, 100, 200, 300, -1],\n [50, 100, 200, 300, 'Todos'],\n ],\n buttons: [\n {\n //Botón para Excel\n extend: 'excel',\n footer: true,\n title: title,\n filename: filename,\n\n //Aquí es donde generas el botón personalizado\n text: '<button class=\"btn btn-excel\"><i class=\"fas fa-file-excel\"></i></button>',\n },\n {\n //Botón para PDF\n extend: 'pdf',\n footer: true,\n title: title,\n filename: filename,\n\n //Aquí es donde generas el botón personalizado\n text: '<button class=\"btn btn-pdf\"><i class=\"fas fa-file-pdf\"></i></button>',\n },\n {\n //Botón para imprimir\n extend: 'print',\n footer: true,\n title: title,\n filename: filename,\n\n //Aquí es donde generas el botón personalizado\n text: '<button class=\"btn btn-print\"><i class=\"fas fa-print\"></i></button>',\n },\n ],\n pagingType: 'simple_numbers',\n language: {\n url: 'app/assets/lib/dataTable/spanish.json',\n },\n scrollY: 'calc(100vh - 200px)',\n scrollX: true,\n fixedHeader: true,\n createdRow: function (nRow, aData, iDataIndex) {\n $(nRow).attr('id', aData['projecid']);\n },\n processing: true,\n serverSide: true,\n ajax: {url: 'ProjectFiscalFields/tableProjects', type: 'POST'},\n columns: [\n {data: 'smarlock', class: 'smarlock edit fsicon tr', orderable: false},\n {data: 'editable', class: 'editable edit alt tc', orderable: false},\n {data: 'custfill', class: 'custfill tr fw700', orderable: false},\n {data: 'projecid', class: 'projecid id hide'},\n {data: 'projnumb', class: 'projnumb tc'},\n {data: 'projname', class: 'projname product-name'},\n {data: 'custname', class: 'custname product-name'},\n {data: 'dateinit', class: 'dateinit date'},\n {data: 'datefnal', class: 'datefnal date'},\n {data: 'projloca', class: 'projloca product-name'},\n ],\n });\n\n $('.tblProjMaster')\n .delay(1000)\n .slideDown('fast', function () {\n deep_loading('C');\n activeIcons();\n });\n}", "function fnc_tables_cargar_caracteristicas() {\n\n\t$('table').on('keypress', 'input.f_imp, input.f_sin, input.f_tpc, input.f_num', function () {\n\t\treturn filterFloat(event, this);\n\t});\n\n $('table tbody').on('click', 'td.dtr-control', function () {\n\t\tfnc_dataTable_recalc($(this).closest('table').attr('id'));\n });\n\n\t$(\".dataTables_info\").click(function () {\n\t\tvar pc_id = $(this).attr('id');\n\t\tpc_table_select_export = pc_id.substring(0, pc_id.length - 5);\n\t\t$('#mdl_exportar').modal('open');\n\t});\n\n\t// Table Input, Select, etc.\n\t$('table').on('change', 'input', function () {\n\t\tfc_table_id = $(this).closest('table.dataTable').attr('id');\n\t\tfo_table = $('#' + fc_table_id).DataTable();\n\t\tfr_row_data = fo_table.row($(this).parents('tr')).data();\n\t\tfo_columns = fo_table.settings().init().columns;\n\t\tfn_rowIndex = fo_table.cell($(this).parents('td')).index().row;\n\t\tfn_colIndex = fo_table.cell($(this).parents('td')).index().column;\n\t\tfc_colName = fo_columns[fn_colIndex].data;\n\t\t\n\t\tfc_cellData_fnc = $(this).parents('td').data('fnc');\n\t\tfc_cellData_value = fnc_get_value_cell_function(fc_colName, $(this).val(), fc_cellData_fnc);\n\t});\n\n\t$('table').on('focus', 'input', function () {\n\t\t$(this).select();\n\t});\t\n\t\n\t/* --------------------------------- Botones de Navegacion: Inicio --------------------------------- */\n\t//var var_ = 2;\n\tfunction f_dtrg_group_cont(){\n\t\tvar v_dtrg_group_cont = 0;\t\n\t\t$('#grid_lista > tbody > tr.dtrg-group').each(function() {v_dtrg_group_cont++;});\n\t\treturn v_dtrg_group_cont;\n\t}\n\tfunction select_(){\n\t\tt1 = $('#grid_lista').DataTable();\n\t\tvar rowSelected = t1.row().$('tr.selected');\n\t\t$('#grid_lista').DataTable().row( $(rowSelected).closest('tr') ).select();\n\t}\n\t \n\tfunction p_registro(){\n\t\t// <!-- $('#grid_lista').DataTable().rows('.parent').nodes().to$().find('td:first-child').trigger('click'); -->\n\n\t\tvar fila = 1;\n\t\t\n\t\t$('#grid_lista').find('tr.selected').removeClass('selected');\n\t\t$(\"#grid_lista tbody tr:eq(\" + fila + \")\").addClass(\"selected\");\n\t\t$(\"#grid_lista tbody tr:eq(\" + fila + \") td:not(td:first-child)\")[0].click();\n\n\t\tselect_();\n\t}\n\t\t\n\tfunction u_registro(fila){\n\t\t// <!-- $('#grid_lista').DataTable().rows('.parent').nodes().to$().find('td:first-child').trigger('click'); -->\n\n\t\t$('#grid_lista').find('tr.selected').removeClass('selected');\n\t\t$(\"#grid_lista tbody tr:eq(\" + fila + \")\").addClass(\"selected\");\n\t\t$(\"#grid_lista tbody tr:eq(\" + fila + \") td:not(td:first-child)\")[0].click();\n\n\t\tselect_();\n\t};\n\t \n\t$(\"#btn_p_row\").click(function () {\n\t\tt1 = $(\"#grid_lista\").DataTable();\n\t\tif (t1.page.info().recordsDisplay == 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$('#grid_lista').DataTable().rows('.parent').nodes().to$().find('td:first-child').trigger('click');\n\t\t\n\t\tvar rowSelected = t1.row().$('tr.selected');\n\t\tvar rowIndex = $('#grid_lista tr').index($(rowSelected).closest('tr'));\n\n\t\tif (t1.page.info().page == 0 && (rowIndex - var_) == 1)\n\t\t{\n\t\t\t// f_msj('No existen mas registros!','','e','bottomRight','');\n\t\t\tf_msj('El primer registro esta seleccionado!!!','','e','bottomRight','');\n\t\t\treturn;\n\t\t}\n\t\t// <!-- ------------------------------------------------- -->\n\t\t\t\n\t\t$('#grid_lista').dataTable().fnPageChange(0);\n\t\tp_registro();\n\t\t\n\t\tfnc_dataTable_recalc();\n\t});\n\t\t\n\t$(\"#btn_u_row\").click(function () {\n\t\tt1 = $(\"#grid_lista\").DataTable();\n\t\tif (t1.page.info().recordsDisplay == 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$('#grid_lista').DataTable().rows('.parent').nodes().to$().find('td:first-child').trigger('click');\n\n\t\tvar rowSelected = t1.row().$('tr.selected');\n\t\tvar rowIndex = $('#grid_lista tr').index($(rowSelected).closest('tr'));\n\n\t\t// <!-- ------------------------------------------------- -->\n\t\tvar limite_x_page_;\n\t\tvar length_ = t1.page.info().length;\n\t\tif (length_ == -1 || t1.page.info().pages == 1)\n\t\t{\n\t\t\tlength_ = t1.page.info().end;\n\t\t\tlimite_x_page_ = length_ + f_dtrg_group_cont() - 1;\n\t\t}\n\t\tif (t1.page.info().pages > 1)\n\t\t{\n\t\t\tlimite_x_page_ = t1.page.info().recordsDisplay % length_;\n\t\t}\n\t\t// <!-- ----------------------------------------------------------- -->\n\t\tif (t1.page.info().page == t1.page.info().pages - 1 && (rowIndex - var_) == limite_x_page_)\n\t\t{\n\t\t\t// f_msj('No existen mas registros!','','e','bottomRight','');\n\t\t\tf_msj('El ultimo registro esta seleccionado!!!','','e','bottomRight','');\n\t\t\treturn;\n\t\t}\n\t\t// <!-- ----------------------------------------------------------- -->\n\t\t\n\t\t//FALTA AGREGAR CONDICIONAL AND QUE SEA PAGINA IGUAL AL TOTAL DE PAGINAS\n\t\tif (t1.page.info().pages > 1)\n\t\t{\n\t\t\t$('#grid_lista').dataTable().fnPageChange($('#grid_lista').DataTable().page.info().pages - 1);\n\t\t}\n\t\t\n\t\trowIndex = limite_x_page_;\n\t\tu_registro(rowIndex);\n\t\t\n\t\tfnc_dataTable_recalc();\n\t});\n\n\t$(\"#btn_a_row\").click(function () {\n\t\tt1 = $(\"#grid_lista\").DataTable();\n\t\tif (t1.page.info().recordsDisplay == 0)\n\t\treturn;\n\n\t\t$('#grid_lista').DataTable().rows('.parent').nodes().to$().find('td:first-child').trigger('click');\n\t\t\n\t\tvar rowSelected = t1.row().$('tr.selected');\n\t\tvar rowIndex = $('#grid_lista tr').index($(rowSelected).closest('tr'));\n\t\trowIndex = parseInt(rowIndex) - var_;\n\t\t\n\t\tif (rowIndex < 0)\n\t\t{\n\t\t\tvar limite_x_page_;\n\t\t\tvar length_ = t1.page.info().length;\n\t\t\tif (length_ == -1 || t1.page.info().pages == 1)\n\t\t\t{\n\t\t\t\tlength_ = t1.page.info().end;\n\t\t\t\tlimite_x_page_ = length_ + f_dtrg_group_cont() - 1;\n\t\t\t}\n\t\t\tif (t1.page.info().pages > 1)\n\t\t\t{\n\t\t\t\tif ((t1.page.info().page + 1) == t1.page.info().pages)\n\t\t\t\t{\n\t\t\t\t\tlimite_x_page_ = t1.page.info().recordsDisplay % length_;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlimite_x_page_ = length_ + f_dtrg_group_cont() - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\trowIndex = limite_x_page_;\n\t\t\tu_registro(rowIndex);\n\t\t\treturn;\n\t\t// <!-- --------------------------------------------------------------------- -->\n\t\t\n\t\t}\n\t\t//FER77\n\t\tif (t1.page.info().page == 0)\n\t\t{\n\t\t\tif (rowIndex == 1)\n\t\t\t{\n\t\t\t\t// f_msj('No existen mas registros!','','e','bottomRight','');\n\t\t\t\tf_msj('El primer registro esta seleccionado!!!','','e','bottomRight','');\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tif (rowIndex == 1)\n\t\t{\n\t\t\t// <!-- t1.fnPageChange(t1.page.info().page+1); -->\n\t\t\t$('#grid_lista').dataTable().fnPageChange(t1.page.info().page-1);\n\t\t\t\t\t\t\t\n\t\t\trowIndex = t1.page.info().length + f_dtrg_group_cont() - 1;\n\t\t\tu_registro(rowIndex);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar row_class = t1.row(rowIndex).$(rowSelected).prev('tr').attr('class');\n\t\t\trowSelected.removeClass('selected');\n\t\t\tvar f_tipo_row = row_class.indexOf(\"dtrg-group\");\n\t\t\t\n\t\t\tif (f_tipo_row == -1) {\n\t\t\t\trowIndex = parseInt(rowIndex) - 1;\n\t\t\t\tt1.row(rowIndex).$(rowSelected).prev('tr').addClass(\"selected\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\trowIndex = parseInt(rowIndex) - var_;\n\t\t\t\t$(\"#grid_lista tbody tr:eq(\" + rowIndex + \")\").addClass(\"selected\");\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#grid_lista tbody tr:eq(\" + rowIndex + \") td:not(td:first-child)\")[0].click();\n\t\t\tselect_();\n\t\t}\n\t\t\n\t\tfnc_dataTable_recalc();\n\t});\n\n\t$(\"#btn_s_row\").click(function () {\n\n\t\tt1 = $(\"#grid_lista\").DataTable();\n\t\tif (t1.page.info().recordsDisplay == 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$('#grid_lista').DataTable().rows('.parent').nodes().to$().find('td:first-child').trigger('click');\n\t\t\n\t\tvar dtrg_group_cont = f_dtrg_group_cont();\n\t\t\t\n\t\tvar rowSelected = t1.row().$('tr.selected');\n\t\tvar rowIndex = $('#grid_lista tr').index($(rowSelected).closest('tr'));\n\t\trowIndex = parseInt(rowIndex) - var_;\n\t\t\n\t\tif (rowIndex < 0)\n\t\t{\n\t\t\tp_registro();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// <!-- ----------------------------------------------------------- -->\n\t\tvar length_ = t1.page.info().length;\n\t\tif (length_ == -1) {length_ = t1.page.info().end;}\n\t\t// <!-- ----------------------------------------------------------- -->\n\t\t\t\t\n\t\tif ((t1.page.info().page + 1) == t1.page.info().pages)\n\t\t{\n\t\t\tvar limite_x_page_ = (t1.page.info().recordsDisplay % length_) + f_dtrg_group_cont() - 1;\n\t\t\tif (t1.page.info().length == -1) {\n\t\t\t\tlimite_x_page_ = length_ + f_dtrg_group_cont() - 1;\n\t\t\t}\n\t\t\tif (rowIndex == limite_x_page_)\n\t\t\t{\n\t\t\t\t// f_msj('No existen mas registros!','','e','bottomRight','');\n\t\t\t\tf_msj('El ultimo registro esta seleccionado!!!','','e','bottomRight','');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (rowIndex - dtrg_group_cont == length_ - 1)\n\t\t{\n\t\t\t$('#grid_lista').dataTable().fnPageChange(t1.page.info().page + 1);\n\t\t\tp_registro();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar row_class = t1.row(rowIndex).$(rowSelected).next('tr').attr('class');\n\t\t\trowSelected.removeClass('selected');\n\t\t\tvar f_tipo_row = row_class.indexOf(\"dtrg-group\");\n\n\t\t\tif (f_tipo_row == -1) {\n\t\t\t\trowIndex = parseInt(rowIndex) + 1;\n\t\t\t\tt1.row(rowIndex).$(rowSelected).next('tr').addClass(\"selected\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\trowIndex = parseInt(rowIndex) + var_;\n\t\t\t\t$(\"#grid_lista tbody tr:eq(\" + rowIndex + \")\").addClass(\"selected\");\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#grid_lista tbody tr:eq(\" + rowIndex + \") td:not(td:first-child)\")[0].click();\n\t\t\tselect_();\n\t\t}\n\t\t\n\t\tfnc_dataTable_recalc();\n\t});\n\t/* --------------------------------- Botones de Navegacion: Fin --------------------------------- */\n\n\t//fer77\n\t// $(Obj_Col('', 'grid_lista_length_select', 'select')).change(function() {\n\t$('.grid_length_change').change(function() {\n\t\t\n\t\tvar ac_object = fnc_get_object_caracteristicas(this);\n\t\t\n\t\t//f_obj_validar_vacio(ac_object[0].form, ac_object[0].col, ac_object[0].type, '');\n\t\t\n\t\t// alert(ac_object[0].form);\n\t\tpc_select_col = ac_object[0].col;\n\t\tpc_select_col = pc_select_col.substring(4, pc_select_col.length);\n\t\t$(\"select[name='\" + pc_select_col + \"']\") .val($(this).find(':selected').text()).trigger('change');\n\t});\n\n\t\n\t/*\n\t$('.dataTables_length').each(function() {\n\t\tvar obj_id_ = $(this).attr('id');\n\t\tif ($(Obj_Col('', obj_id_ + '_c')).exists()) {\n\t\t\tvar po_contenedor = document.querySelector('[data-col=\"' + obj_id_ + '_c' + '\"]');\n\t\t\tpo_contenedor.appendChild(this);\n\t\t}\n\t});\n\t*/\n\n\t$('table').each(function() {\n\t\tvar obj_id_ = $(this).attr('id');\n\t\tvar f_grid = $(this).DataTable();\n\t\n\t\t// Manejar el evento cuando la celda se enfoca a traves de el teclado\n\t\t$('#' + obj_id_).on('key-focus.dt', function(e, datatable, cell) {\n\t\t\tf_grid.row(cell.index().row).select();\n\t\t});\n\t\t// Manejar clic en celda de tabla\n\t\t$('#' + obj_id_).on('click', 'tbody td:not([colspan]):not(.child)', function(e) {\n\t\t\tif ($('#' + obj_id_).DataTable().page.info().recordsDisplay === 0)\n\t\t\treturn;\n\n\t\t\te.stopPropagation();\n\t\t\t\n\t\t\tvar rowIdx = f_grid.cell(this).index().row;\n\t\t\tf_grid.row(rowIdx).select();\n\t\t});\n\t\t\n\t\t// Key presionado en la tabla (Modal)\n\t\t//$('#' + pi_grid_id + '[data-row_data] tbody').on('click', 'td', function () {\n\t\t//$('#' + obj_id_ + '[data-row_data]').on('key.dt', function(e, datatable, key, cell, originalEvent) {\n\t\t//$('#' + obj_id_ + '[data-row_data] tbody').on('key.dt', function(e, datatable, key, cell, originalEvent) {\n\t\t$('#' + obj_id_).on('key.dt', function(e, datatable, key, cell, originalEvent) {\n\t\t\tif (key === 13) {\n\t\t\t\t/*\n\t\t\t\tvar funcion_ = 'fnc_add_' + obj_id_;\n\t\t\t\teval(funcion_ + '()');\n\t\t\t\t*/\n\t\t\t\tif ($(\"button[data-lnk='_lnk_add_\" + obj_id_ + \"']\").prop('disabled') === false) {\n\t\t\t\t\t$(\"button[data-lnk='_lnk_add_\" + obj_id_ + \"']\")[0].click();\n\t\t\t\t}\n\t\t\t\t// Agregar para el grid_lista y verificar el enter para los que no son grid lista\n\t\t\t}\n\t\t});\n\t\t\n\t\t// Habilitar - Deshabilitar boton add (Modal)\n\t\tf_grid.on('select deselect', function () {\n\t\t\tvar selectedRows = f_grid.rows( { selected: true } ).count();\n\t\t\t//$('#btn_add_' + obj_id_).prop('disabled', selectedRows === 0);\n\t\t\t$(\"button[data-lnk='_lnk_add_\" + obj_id_ + \"']\").prop('disabled', selectedRows === 0);\n\t\t});\n\n\t\t\n\t});\n\n\n}", "function datatableLenguaje(data){\n var data = {\n \"lengthMenu\": 'Mostrar <select class=\"form-control input-sm\">'+\n '<option value=\"5\">5</option>'+\n '<option value=\"10\">10</option>'+\n '<option value=\"15\">15</option>'+\n '<option value=\"20\">20</option>'+\n '<option value=\"30\">30</option>'+\n '<option value=\"-1\">Todos</option>'+\n '</select> registros',\n \"search\": \"Buscar:\",\n \"searchPlaceholder\": data.placeholder,\n \"zeroRecords\": \"No se encontraron registros coincidentes\",\n \"infoEmpty\": \"No hay registros para mostrar\",\n \"infoFiltered\": \" - filtrado de MAX registros\",\n \"info\": \"Mostrando _START_ a _END_ de _TOTAL_ registros\",\n \"paginate\": {\n \"previous\": \"Anterior\",\n \"next\": \"Siguiente\"\n }\n };\n return data;\n }", "function tablaresultadosordencompra(limite)\r\n{\r\n \r\n \r\n var decimales = document.getElementById('decimales').value;\r\n var base_url = document.getElementById('base_url').value;\r\n var controlador = base_url+'orden_compra/buscar_ordenescompra';\r\n let parametro = \"\";\r\n if(limite == 2){\r\n parametro = document.getElementById('filtrar').value;\r\n }else if(limite == 3){\r\n parametro = \"\";\r\n }\r\n //document.getElementById('loader').style.display = 'block'; //muestra el bloque del loader\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{parametro:parametro},\r\n success:function(respuesta){\r\n var registros = JSON.parse(respuesta);\r\n var color = \"\";\r\n if (registros != null){\r\n //var formaimagen = document.getElementById('formaimagen').value;\r\n var n = registros.length; //tamaño del arreglo de la consulta\r\n $(\"#encontrados\").html(n);\r\n html = \"\";\r\n for (var i = 0; i < n ; i++){\r\n html += \"<tr>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+(i+1)+\"</td>\";\r\n html += \"<td style='padding: 2px;'>\"+registros[i]['usuario_nombre']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+registros[i]['ordencompra_id']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\";\r\n html += moment(registros[i][\"ordencompra_fecha\"]).format(\"DD/MM/YYYY\");\r\n html += \"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+registros[i]['ordencompra_hora']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\";\r\n html += moment(registros[i][\"ordencompra_fechaentrega\"]).format(\"DD/MM/YYYY\");\r\n html += \"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+registros[i]['proveedor_nombre']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-right'>\"+Number(registros[i]['ordencompra_totalfinal']).toFixed(decimales)+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+registros[i]['estado_descripcion']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='no-print'>\";\r\n html += \"<a href='\"+base_url+\"orden_compra/edit/\"+registros[i][\"ordencompra_id\"]+\"' class='btn btn-info btn-xs' title='Modificar orden compra' ><span class='fa fa-pencil'></span></a>&nbsp;\";\r\n html += \"<a class='btn btn-success btn-xs' onclick='mostrar_reciboorden(\"+registros[i]['ordencompra_id']+\")' title='Ver reporte orden compra'><fa class='fa fa-print'></fa></a>&nbsp;\";\r\n html += \"<a class='btn btn-facebook btn-xs' onclick='mostrar_reciboordenp(\"+registros[i]['ordencompra_id']+\")' title='Ver reporte orden compra para proveedor'><fa class='fa fa-print'></fa></a>&nbsp;\";\r\n if(registros[i]['estado_id'] == 33){\r\n html += \"<a class='btn btn-danger btn-xs' onclick='modal_ejecutarordencompra(\"+registros[i]['ordencompra_id']+\")' title='Ejecutar orden compra'><fa class='fa fa-bolt'></fa></a>&nbsp;\";\r\n html += \"<a class='btn btn-warning btn-xs' onclick='modal_anularordencompra(\"+registros[i]['ordencompra_id']+\")' title='Anular orden compra'><fa class='fa fa-minus-circle'></fa></a>\";\r\n }/*else if(registros[i]['estado_id'] == 35){\r\n html += \"<a class='btn btn-warning btn-xs' onclick='modal_anularordencmpra(\"+registros[i]['ordencompra_id']+\")' title='Anular orden compra'><fa class='fa fa-minus-circle'></fa></a>\";\r\n }*/\r\n \r\n html += \"</td>\";\r\n html += \"</tr>\";\r\n }\r\n $(\"#tablaresultados\").html(html);\r\n //document.getElementById('loader').style.display = 'none';\r\n }\r\n //document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader\r\n },\r\n error:function(respuesta){\r\n // alert(\"Algo salio mal...!!!\");\r\n html = \"\";\r\n $(\"#tablaresultados\").html(html);\r\n },\r\n complete: function (jqXHR, textStatus) {\r\n //document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader \r\n //tabla_inventario();\r\n }\r\n });\r\n}", "function listarProductos(idalmacen)\n{\ntabla=$('#tblproductos2').dataTable(\n\t{\n\t\t\t\"aProcessing\": true,\n\t \"aServerSide\": true,\n\t dom: 'Brtip',\n\t buttons: [\n\t ],\n\t\t\"ajax\":\n\t\t\t\t{\n\t\t\t\t\turl: \"../ajax/transferencia.php?op=listarProductosTraspaso\",\n\t\t\t\t\ttype : \"get\",\n\t\t\t\t\tdata: {\n\t\t\t\t origen: idalmacen,\n\t\t\t\t },\n\t\t\t\t\tdataType : \"json\",\n\t\t\t\t\terror: function(e){\n\t\t\t\t\t\tconsole.log(e.responseText);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\"bDestroy\": true,\n\t\t\"iDisplayLength\": 5,\n\t \"order\": [[ 0, \"desc\" ]]\n\t}).DataTable();\n}", "function mostrarProveedor() {\n $(document).ready(function () {\n\n var table = $('#listaProveedor').DataTable({\n \"destroy\": true,\n \"bDeferRender\": true,\n \"paging\": true,\n \"lengthChange\": true,\n \"searching\": true,\n \"ordering\": true,\n \"info\": false,\n \"responsive\": true,\n \"autoWidth\": false,\n \"pageLength\": 10,\n \"sPaginationType\": \"full_numbers\",\n \"ajax\": {\n \"url\": \"../../business/proveedoraccion/dataProveedor.php\",\n \"type\": \"POST\"\n },\n \"columns\": [\n {\"data\": \"nombre\"},\n {\"data\": \"apellido1\"},\n {\"data\": \"apellido2\"},\n {\"data\": \"cedula\"},\n {\"data\": \"acciones\"}\n ],\n \"oLanguage\": {\n \"sProcessing\": \"Procesando...\",\n \"sLengthMenu\": 'Mostrar <select>' +\n '<option value=\"10\">10</option>' +\n '<option value=\"20\">20</option>' +\n '<option value=\"30\">30</option>' +\n '<option value=\"40\">40</option>' +\n '<option value=\"50\">50</option>' +\n '<option value=\"60\">60</option>' +\n '<option value=\"70\">70</option>' +\n '<option value=\"80\">80</option>' +\n '<option value=\"-1\">All</option>' +\n '</select> registros',\n \"sZeroRecords\": \"No se encontraron resultados\",\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n \"sInfo\": \"Mostrando del (_START_ al _END_) de un total de _TOTAL_ registros\",\n \"sInfoEmpty\": \"Mostrando del 0 al 0 de un total de 0 registros\",\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n \"sInfoPostFix\": \"\",\n \"sSearch\": \"Filtrar:\",\n \"sUrl\": \"\",\n \"sInfoThousands\": \",\",\n \"sLoadingRecords\": \"Por favor espere - cargando...\",\n \"oPaginate\": {\n \"sFirst\": \"Primero\",\n \"sLast\": \"Último\",\n \"sNext\": \"Siguiente\",\n \"sPrevious\": \"Anterior\"\n },\n \"oAria\": {\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n }\n }\n });\n\n setInterval(function () {\n table.ajax.reload(null, false);\n }, 1000);\n });\n \n\n\n}", "function MostrarLista(){\n //declaramos una viable para guardar los datos\n var listaregistro=Mostrar();\n //selecciono el tbody de la tabla donde voy a mostrar la informacion\n var tbody=document.querySelector(\"#tbAlumno tbody\");\n tbody.innerHTML=\"\";\n //agregamos al tbody las filas que se registren\n for(var i=0;i<listaregistro.length;i++){\n //declaramos una variable para las filas\n var fila=tbody.insertRow(i);\n //declaramos variables para los titulos\n var titulonom=fila.insertCell(0);\n var tituloape=fila.insertCell(1);\n var titulodni=fila.insertCell(2);\n var titulocur=fila.insertCell(3);\n var titulotur=fila.insertCell(4);\n var tituloest=fila.insertCell(5);\n //agregamos los valores\n titulonom.innerHTML=listaregistro[i].nombre;\n tituloape.innerHTML=listaregistro[i].apellido;\n titulodni.innerHTML=listaregistro[i].dni;\n titulocur.innerHTML=listaregistro[i].curso;\n titulotur.innerHTML=listaregistro[i].turno;\n tituloest.innerHTML=listaregistro[i].estado;\n tbody.appendChild(fila); \n }\n}", "function remplirTableau() {\r\n tabIsEmpty = false;\r\n tbody.empty();\r\n var html = \"\";\r\n data.forEach(function (element) {\r\n html = '<tr>' +\r\n '<th>' + element.order + '</th>' +\r\n '<td>' + element.activity + '</td>' +\r\n '<td>' + element.manager + '</td>' +\r\n '<td>' + element.numofsub + '</td>' +\r\n '</tr>';\r\n tbody.append(html);\r\n });\r\n }", "function probar_conexion_red(){\n /*--- primero probamos la conexion a la red \n se crea un campo donde se carga una imagen, si esta carga hay conexion ---*/\n var tabla = $('#dataTable').attr(\"id\");\n addRow(tabla);\n}", "function probar_conexion_red(){\n /*--- primero probamos la conexion a la red \n se crea un campo donde se carga una imagen, si esta carga hay conexion ---*/\n var tabla = $('#dataTable').attr(\"id\");\n addRow(tabla);\n}", "function fn_CargarEgresos(json_Filtro){\n $(\"#tbl_Egresos\").dataTable().fnDestroy();\n $('#tbl_Egresos tbody').empty();\n\n if(json_Filtro === undefined){\n\t\tjson_Filtro = 0;\n\t}\n\n $.post('models/Modulos/Contabilidad/sel_Egreso.php', {fn_Funcion:'CargarPanel', json_Filtro:json_Filtro}, function(res){\n var json_Egresos = $.parseJSON(res);\n \n if(json_Egresos){\n $(\"#lbl_EgresosTotales\").html(\"$ \" + fn_FormatearNumero(json_Egresos[0]['egreso_Total']));\n } \n\n $('#tbl_Egresos').dataTable({\n\t\t\t\"sDom\": \"Tflt<'row DTTTFooter'<'col-sm-6'i><'col-sm-6'p>>\",\n\t\t\t\"iDisplayLength\": 25,\n\t\t\t\"oTableTools\": {\n\t\t\t\t\"aButtons\": [\n\t\t\t\t\t\"xls\"\n\t\t\t\t],\n\t\t\t\t\"sSwfPath\": \"assets/swf/copy_csv_xls_pdf.swf\"\n\t\t\t},\n\t\t\t\"language\": {\n\t\t\t\t\"search\": \"\",\n\t\t\t\t\"emptyTable\": \"No hay registros.\",\n\t\t\t\t\"zeroRecords\": \"No existe ninguna coincidencias en los registros.\",\n\t\t\t\t\"sLengthMenu\": \"_MENU_\",\n\t\t\t\t\"oPaginate\": {\n\t\t\t\t\t\"sPrevious\": \"Ant\",\n\t\t\t\t\t\"sNext\": \"Sig\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"data\": json_Egresos,\n\t\t\t\"aoColumns\": [\n {\"data\": \"egreso_Fecha\"},\n {\"data\": \"egreso_NroDoc\"},\n {\"data\": \"tipoDoc_Nombre\"},\n {\"data\": \"cliente_Nombre\"},\n {\"data\": \"categoria_Nombre\"},\n {\"data\": \"egreso_Monto\"},\n {\"data\": \"egreso_Estado\"},\n {\"data\": \"egreso_Acciones\"}\n\t\t\t],\n columnDefs : [\n {\"targets\": 0, \"width\": \"90px\"},\n {\"targets\": 1, \"width\": \"60px\"},\n {\"targets\": 7, \"width\": \"50px\", \"orderable\": false}\n ],\n\t\t\t\"aaSorting\": [0, 'desc']\n\t\t});\n });\n}", "function obtener_datos_todos_establecimiento() {\n var lista_datos = conexion_cuestionarios_resuelto();\n var contenido = \"\";\n var sucursal = \"\";\n var indice = 1;\n if (lista_datos.length > 0 ) {\n $.each(lista_datos, function (index, item) {\n if (index == 0) {\n contenido = \"<tr class='celda_tabla_res' style='background-color:#cbf1f5' ><th style='width:60px'>#</th><th style='width:30%'>\"+item.establecimiento+\"</th><th style='width:60px' >limpieza %</th><th style='width:60px'>Surtido %</th><th style='width:60px'>Imagen %</th><th style='width:60px'>Total %</th></tr>\"\n $(\"#tabla_res\").append(contenido);\n sucursal=item.establecimiento;\n }//fin if\n if (sucursal == item.establecimiento) {\n contenido = \"<tr class='celda_tabla_res dato'><td style='width:60px'>\" + indice + \"</td><td class='nombre' style='width:30%'>\" + item.cuestionario + \"</td><td style='width:90px' >\" + item.limpieza + \"</td><td style='width:90px'>\" + item.surtido + \"</td><td style='width:90px'>\" + item.imagen + \"</td><td style='width:60px'>\" + item.total + \"</td></tr>\"\n $(\"#tabla_res\").append(contenido);\n indice++;\n }\n else {\n indice = 1;\n contenido = \"<tr class='celda_tabla_res' style='background-color:#cbf1f5' ><th style='width:60px'>#</th><th style='width:30%'>\" + item.establecimiento + \"</th><th style='width:60px' >limpieza %</th><th style='width:60px'>Surtido %</th><th style='width:60px'>Imagen %</th><th style='width:60px'>Total %</th></tr>\"\n $(\"#tabla_res\").append(contenido);\n contenido = \"<tr class='celda_tabla_res dato'><td style='width:60px'>\" + indice + \"</td><td class='nombre' style='width:30%'>\" + item.cuestionario + \"</td><td style='width:90px' >\" + item.limpieza + \"</td><td style='width:90px'>\" + item.surtido + \"</td><td style='width:90px'>\" + item.imagen + \"</td><td style='width:60px'>\" + item.total + \"</td></tr>\"\n $(\"#tabla_res\").append(contenido);\n sucursal = item.establecimiento;\n indice++;\n }//fin if\n });\n }//fin\n else alert(\"No Hay Datos...\");\n}//fin", "function TableLogistics(sth, data,cliConsultar) {\n $(\".overflow\").scrollLeft(0);\n $(\".scroll_header\").scrollLeft(0);\n\n var tbody_hide = $(sth).next()[0].querySelector(\".hide\");\n var this_overflow = d3.select($(sth).next()[0]);\n var span = d3.select($(sth).find(\"span.s\")[0]);\n\n if (this_overflow.style(\"display\") == \"block\") {\n this_overflow.style(\"display\", \"none\");\n d3.select(tbody_hide).html(\"\");\n span.html(plus + \"&ensp;\");\n } else {\n //// <--- !\n var algo = sth;\n\n function nuevaTabla(algo, callback) {\n\n var parentTag = algo.parentNode.getAttribute(\"tag\");\n var Tag = algo.getAttribute(\"tag\");\n\n var tableData = data.filter(function(d) {\n return d[0] == parentTag;\n })[0].filter(function(d) {\n return typeof(d) == \"object\" && d[Tag];\n })\n\n if (tableData[0]) {\n tableData = tableData[0][Tag];\n tableData = formatoData(tableData);\n var parser = new DOMParser();\n var docTable = parser\n\t\t\t\t\t.parseFromString(tableData,\n\t\t\t\t\t\t\t\t\"text/html\");\n docTable = docTable.querySelector(\"table\");\n\n $(docTable).css(\"table-layout\", \"fixed\");\n\n\n d3.selectAll(\"div>label>span.s\")\n\t\t\t\t\t.html(plus + \"&ensp;\");\n span.html(minus + \"&ensp;\");\n d3.selectAll(\"div.overflow\").style(\"display\", \"none\");\n d3.selectAll(\"div.overflow>table>tbody\").html(\"\")\n\n docTable = discriminateRows(docTable);\n\n\n\t\t\tif(caso_especial) {\n\t\t\t// Estas líneas son importantes para que funcione 'nameGasNoil(_td_)'!\n\t\t\t $(docTable).find(\"tr\").each(function(i,d) {\n\t\t\t if(!$(d).find('td:first-child').attr(\"id\")) $(d).attr(\"id\",\"dist\")\n\t\t\t })\n\t\t\t// Estas líneas son importantes para que funcione 'nameGasNoil(_td_)'!\n\t\t\t}\n\n d3.select(tbody_hide.parentNode.parentNode)\n .style(\"display\", \"block\");\n\n\t\t\tvar contenidoEnFiltro = $('#filtroSerie').val();\n\n //--------------FILTRO PARA CASO ESPECIAL-----------------------\n if (caso_especial && contenidoEnFiltro) { //current_TXT ) {\n\n var _docTable = parser\n .parseFromString(docTable.outerHTML,\n\t\t\t\t\t\t\t\t\"text/html\")\n .body.querySelector(\"table\");\n\n/*\n var tds = Array.prototype\n .slice.call(_docTable\n\t\t\t\t.querySelectorAll(\"tr>td:first-child\"));\n\n\n var val,valName;\n\n var prevTD = tds.filter(function(d) {\n return d.textContent.replace(/\\s/g, \"\")\n .toUpperCase() == current_TXT[2]\n\t\t\t\t\t\t\t.replace(/\\s/g, \"\")\n\t\t .toUpperCase();\n })[0];\n\n\n var c = tds.indexOf(prevTD) + 0;\n var tdFromList;\n var referenceTd = current_TXT[3]\n\t\t\t\t\t\t.replace(/\\s/g, \"\")\n\t\t\t\t\t\t.toUpperCase();\n var condTD;\n\n for (c; c < tds.length; c++) {\n tdFromList = tds[c].textContent\n\t\t\t\t .replace(/\\s/g, \"\").toUpperCase();\n condTD = tdFromList == referenceTd;\n\n if (condTD) {\n break;\n }\n };\n*/\n//\t\t\t var textoEnFiltro_ = $('#filtroSerie').val().replace(/^\\s*/,'').split(\" > \")\n//\t\t\t var _td_ = selected_TD(textoEnFiltro_/*current_TXT*/,docTable);\n/*\n\t\t\t var headRow = docTable.querySelector(\"tr\").outerHTML;\n\n\t\t\t val = $(_td_).parent()[0].children;\n\t\t\t val = Array.prototype.slice.call(val);\n\t\t\t val = \"<tr>\" + val.map(function(d) { return d.outerHTML; }).join(\"\") + \"</tr>\";\n\t\t\t val = $(val);\n\n\t\t\t val = $(nameGasNoil(_td_));\n\n $(_docTable.querySelectorAll(\"tbody\")).html(\"\");\n\n $(_docTable.querySelectorAll(\"tbody\"))\n\t\t\t\t.append(val);\n*/\n d3.select(tbody_hide)\n .html(/*_*/docTable.innerHTML);//<--pega la tabla\n\n\n current_TXT = null; // <-- Checar relevancia.\n }\n//--------------FILTRO PARA CASO ESPECIAL-----------------------\n else {\n d3.select(tbody_hide)\n .html(docTable.innerHTML);//<--pega la tabla\n\n\t\t\t if(contenidoEnFiltro) {\n\t\t\t\tvar txtFiltro = contenidoEnFiltro.replace(/^\\s*/,'').split(' > ');\n\t\t\t\tvar filtroEl = selected_TD(txtFiltro)[0];\n\t\t\t\tvar specialType = filtroEl.parentNode.parentNode.querySelectorAll('td#dist_').length;\n\t\t\t\tif(specialType) {\n\t\t\t\t filterSpecialType(filtroEl.parentNode.parentNode,filtroEl);\n\t\t\t\t enableGraphs();\n\t\t\t\t} else {\n\t\t\t\t mostrar(filtroEl);\n\t\t\t\t}\n\t\t\t }\n\n }\n\n $(window).scrollTop(\n $(tbody_hide).offset().top - 250\n );\n\n icons();\n headerScroll();\n colcol();\n callback();\n\n $(\"td#n\").each(function() {\n let color = $(this.parentNode.children[0])\n .css(\"background-color\");\n });\n\n } else {\n\n var params = parametros();\n params[\"title\"] = params_especiales.title;\n params[\"subtitle\"] = params_especiales.subtitle;\n var algo_ = $(\"tbody.hide[tag='\" + params.title\n\t\t\t + \"']>div.labels[tag='\"\n\t\t\t + params.subtitle + \"']\")[0];\n\n $.ajax({\n url: HOSTNAME + \"/cubos_cuadros.py\",\n dataType: 'json',\n data: params,\n success: function(tabla_respuesta) {\n\n\t\t\t\tvar textoEnFiltro = $(\"#filtroSerie\").val();\n\t\t\t\tif(textoEnFiltro) { \n\t\t\t\t\ttabla_respuesta = filtroHandler(textoEnFiltro,formatoData(tabla_respuesta));\n\t\t\t\t} else {\n\t\t\t\t\ttabla_respuesta = formatoData(tabla_respuesta);\n\t\t\t\t}\n\n var sizeStr = JSON\n\t\t\t\t\t.stringify([tabla_respuesta])\n\t\t\t\t\t.length;\n\n if (sizeStr <= threshold) {\n// if(!textoEnFiltro) tabla_respuesta = formatoData(tabla_respuesta);\n TableLogistics(algo_, tabla_respuesta);\n } else {\n\t\t\t\t FILE_NAME = { 'title':params.title, 'subtitle':params.subtitle };\n\t\t\t\t mensajeExplicativo(params.title,params.subtitle,tabla_respuesta);\n }\n\n }\n });\n\n }\n\n\t\t $(\"div#divDefense\").remove();\n\t\t $(\"div#optionsDefense\").remove();\n };\n\n function mensajeEspera() {\n $(\"div#espere\").css(\"visibility\", \"visible\") // aquí\n window.setTimeout(function() {\n nuevaTabla(algo, function() {\n $(\"div#espere\").css(\"visibility\", \"hidden\");\n\n ///// FORZAR TAMAÑOS DE HEADER OCURRENTE CROSS-BROWSER ////////////////////////\n var cellHide = $(\"div.overflow>table>tbody.hide>tr:nth-child(2)>td:nth-child(4)\")\n var cellHead = $(\".scroll_aid_header>th:nth-child(n+2)\");\n\n var CellOffsetWidth = cellHide[0].offsetWidth;\n var jqueryWidth = \"75px\";\n\n\n cellHead.css(\"max-width\", jqueryWidth)\n cellHead.css(\"width\", jqueryWidth)\n cellHead.css(\"min-width\", jqueryWidth)\n\n\n d3.selectAll(\".scroll_aid_header>th:nth-child(n+2)\")\n .style(\"max-width\", jqueryWidth)\n .style(\"width\", jqueryWidth)\n .style(\"min-width\", jqueryWidth)\n\n var posHeader = document\n .querySelector(\".scroll_aid_header>th:nth-child(2)\")\n .getBoundingClientRect();\n\n var posHide = cellHide[0].getBoundingClientRect();\n\n $(\".scroll_aid_header>th:first-child\").css(\"padding\", \"0px\");\n $(\".scroll_aid_header>th:first-child\").css(\"min-width\", \"calc(360px + 55px)\");\n $(\"div.overflow tr>td\").css(\"border-bottom\", \"0px solid white\");\n $(\"div.overflow tr>td\").css(\"border-top\", \"1px solid lightGray\");\n\n if (posHeader.left != posHide.left) {\n\n d3.select(\".scroll_aid_header>th:first-child\")\n .style(\"min-width\", posHeader.left + \"px\");\n }\n\n\n///// FORZAR TAMAÑOS DE HEADER OCURRENTE CROSS-BROWSER ////////////////////////\n\n/*-----------------Quitar scroller horizontal si no se necesita--------------*/\n\n var tabla_overflow_X = $(\"div.overflow\")\n\t\t\t .filter(function() {\n return $(this).css(\"display\") == \"block\";\n });\n\n var row_length_ = tabla_overflow_X[0]\n .querySelector(\"tr:first-child\")\n .getBoundingClientRect().right;\n\n if (row_length_ < window.innerWidth) {\n tabla_overflow_X.css(\"overflow-x\", \"hidden\")\n } else {\n tabla_overflow_X.css(\"overflow-x\", \"scroll\")\n }\n/*-----------------Quitar scroller horizontal si no se necesita--------------*/\n PrincipalCheckBox();\n\n var checkIfDist_ = document\n\t\t\t\t.querySelectorAll(\"#dist_\").length;\n if (checkIfDist_ > 0) {\n d3.selectAll(\"tr#dist\").attr(\"id\", null);\n }\n\n //contratosPemexFIX(); // <-- Arregla \"coloreados no controlados\".\n enableGraphs();\n });\n }, 10);\n }\n mensajeEspera();\n };\n\n }", "function MostrarRegistro(){\n // declaramos una variable para guardar los datos\n var listaregistro=Mostrar();\n // selecciono el tbody de la tabla donde voy a guardar\n tbody=document.querySelector(\"#tbRegistro tbody\");\n tbody.innerHTML=\"\";\n // agregamos las columnas que se registren\n for(var i=0; i<listaregistro.length;i++){\n // declaramos una variable para la fila\n var fila=tbody.insertRow(i);\n // declaramos variables para los titulos\n var titulonombre=fila.insertCell(0);\n var tituloprecio=fila.insertCell(1);\n var titulocategoria=fila.insertCell(2);\n var titulocantidad=fila.insertCell(3);\n // agregamos los valores\n titulonombre.innerHTML=listaregistro[i].nombre;\n tituloprecio.innerHTML=listaregistro[i].precio;\n titulocategoria.innerHTML=listaregistro[i].categoria\n titulocantidad.innerHTML=listaregistro[i].cantidad;\n tbody.appendChild(fila);\n }\n}", "function tablaresultados_asociado(limite)\r\n{\r\n var controlador = \"\";\r\n var parametro = \"\";\r\n var consulta= \"\";\r\n var limit = limite;\r\n var base_url = document.getElementById('base_url').value;\r\n controlador = base_url+'asociado/buscar_asociado';\r\n \r\n if(limit == 1){\r\n consulta = \" limit 300\";\r\n }else if(limit == 3){\r\n consulta =\"\";\r\n }else{\r\n parametro = document.getElementById('filtrar').value;\r\n \r\n } \r\n document.getElementById('loader').style.display = 'block'; //muestra el bloque del loader\r\n \r\n\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{parametro:parametro, consulta:consulta},\r\n success:function(respuesta){\r\n \r\n //$(\"#encontrados\").val(\"- 0 -\");\r\n var registros = JSON.parse(respuesta);\r\n \r\n if (registros != null){\r\n \r\n var n = registros.length; //tamaño del arreglo de la consulta\r\n //$(\"#encontrados\").html(\"Registros Encontrados: \"+n+\" \");\r\n html = \"\";\r\n \r\n for (var i = 0; i < n ; i++){\r\n html += \"<tr>\";\r\n \r\n html += \"<td>\"+(i+1)+\"</td>\";\r\n html += \"<td>\";\r\n html += \"<div style='padding-left: 4px'>\";\r\n tam = 3;\r\n var nombre = registros[i][\"nombres_asoc\"]+\" \"+registros[i][\"apellidos_asoc\"]\r\n if(nombre.length>25){\r\n tam = 1; \r\n }\r\n html += \"<b><font face='Arial' size='\"+tam+\"' >\"+nombre+\"</font></b><br>\";\r\n html += \"<b>ZONA: </b>\"+registros[i]['zona_asoc']+\"<br>\";\r\n html += \"<b>TELF.: </b>\"+registros[i]['telefono_asoc'];\r\n html += \"</div>\";\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"codigo_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"ci_asoc\"]+\" \"+registros[i][\"cudad\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"direccion_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"nit_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"razon_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"medidor_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"servicios_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"categoria_asoc\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += registros[i][\"estado\"];\r\n html += \"</td>\";\r\n html += \"<td>\";\r\n html += \"<a href='\"+base_url+\"asociado/edit/\"+registros[i]['id_asoc']+\"' class='btn btn-info btn-xs' title='Modificar datos'><span class='fa fa-pencil'></span></a>\";\r\n html += \"<a href='\"+base_url+\"imagen_asociado/catalogoasoc/\"+registros[i]['id_asoc']+\"' class='btn btn-soundcloud btn-xs' title='Catálogo de imagenes'><span class='fa fa-image'></span></a>\";\r\n /* html += \"<a class='btn btn-success btn-xs' data-toggle='modal' data-target='#modalecturar\"+registros[i][\"id_asoc\"]+\"' title='Lecturar'><span class='fa fa-file-text'></span></a>\";\r\n \r\n html += \"<!------------------------ INICIO modal para confirmar eliminación ------------------->\";\r\n html += \"<div class='modal fade' id='modalecturar\"+registros[i][\"id_asoc\"]+\"' tabindex='-1' role='dialog' aria-labelledby='myModalLabel\"+i+\"'>\";\r\n html += \"<div style='white-space: normal' class='modal-dialog' role='document'>\";\r\n html += \"<br><br>\";\r\n html += \"<div class='modal-content'>\";\r\n html += \"<div class='modal-header'>\";\r\n html += \"<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>x</span></button>\";\r\n html += \"<div><span class='text-bold'>LECTURAR DE:</span><br>\";\r\n html += \"<span style='display: inherit; text-align: center !important'>\"+registros[i]['nombres_asoc']+\" \"+registros[i]['apellidos_asoc']+\"</span>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<div class='modal-body'>\";\r\n html += \"<!------------------------------------------------------------------->\";\r\n html += \"<div class='col-md-12'>\";\r\n html += \"<div class='input-group' style='width: 100%'>\";\r\n html += \"<span class='input-group-addon' style='width: 20%'>Lect. Anterior</span>\";\r\n html += \"<div style='width: 70%' class='form-control' id='anterior_lec\"+registros[i]['id_asoc']+\"'>\"+registros[i]['ultima_lectura']+\"</div>\";\r\n //html += \"<input style='width: 70%' id='filtrar' type='text' class='form-control' onkeypress='buscar_asociado(event)' autocomplete='off' >\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<div class='col-md-12'>\";\r\n html += \"<div class='input-group' style='width: 100%'>\";\r\n html += \"<span class='input-group-addon' style='width: 20%'>Lect. Actual&nbsp;&nbsp;&nbsp;</span>\";\r\n html += \"<input style='width: 70%' id='actual_lec\"+registros[i]['id_asoc']+\"' type='text' class='form-control' onkeypress='calcular_consumo(event, \"+registros[i]['id_asoc']+\")' autocomplete='off' >\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<div class='col-md-12'>\";\r\n html += \"<div class='input-group' style='width: 100%'>\";\r\n html += \"<span class='input-group-addon' style='width: 20%'>Consumo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>\";\r\n html += \"<div style='width: 70%' class='form-control' id='consumo_lec\"+registros[i]['id_asoc']+\"'></div>\";\r\n //html += \"<input style='width: 70%' id='filtrar' type='text' class='form-control' onkeypress='buscar_asociado(event)' autocomplete='off' >\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<div class='row' id='eldetalle\"+registros[i]['id_asoc']+\"'>\";\r\n html += \"</div>\";\r\n html += \"<input type='hidden' value='\"+registros[i]['fecha_anterior']+\"' id='fecha_anterior\"+registros[i]['id_asoc']+\"' >\";\r\n html += \"<!------------------------------------------------------------------->\";\r\n html += \"</div>\";\r\n html += \"<div class='modal-footer' style='text-align: center !important'>\";\r\n html += \"<a onclick='registrar_lectura(\"+registros[i]['id_asoc']+\")' class='btn btn-success'><span class='fa fa-check'></span> Registrar </a>\";\r\n html += \"<a href='#' class='btn btn-danger' data-dismiss='modal'><span class='fa fa-times'></span> Cancelar </a>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"<!------------------------ FIN modal para confirmar eliminación ------------------->\";\r\n */\r\n html += \"</td>\";\r\n \r\n html += \"</tr>\";\r\n\r\n }\r\n\r\n $(\"#tablaresultados\").html(html);\r\n document.getElementById('loader').style.display = 'none';\r\n }\r\n document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader\r\n },\r\n error:function(respuesta){\r\n // alert(\"Algo salio mal...!!!\");\r\n html = \"\";\r\n $(\"#tablaresultados\").html(html);\r\n },\r\n complete: function (jqXHR, textStatus) {\r\n document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader \r\n //tabla_inventario();\r\n }\r\n \r\n }); \r\n\r\n}", "function golist() {\n /*Ajustar la petición para mostrar la tabla de resultados procesos*/\n var columnasdata = [{ \"data\": \"AA\" },\n { \"data\": \"BB\" },\n { \"data\": \"CC\" },\n { \"data\": \"ACCIONES\" }];\n\n /*Consultar procesos y mostrar*/\n autogenDatatablesminHeaders(columnasdata, \"DT_listado\", \"JFunctionData\", \"listas\", \"{}\");\n document.getElementById(\"FW_resultados\").style.display = \"block\";\n}", "function filtrosMercado(){\n\t\tvar table = document.createElement(\"TABLE\");\n\t\ttable.setAttribute(\"class\", \"tbg\");\n\t\ttable.setAttribute(\"style\", \"width:100%\");\n\t\ttable.setAttribute(\"cellspacing\", \"1\");\n\t\ttable.setAttribute(\"cellpadding\", \"2\");\n\n\t\t// Se crea la tabla con 3 filas, Ofrezco, Busco y Tipo\n\t\tvar etiquetas = [T('OFREZCO'), T('BUSCO')];\n\t\tfor (var j = 0; j < 2; j++){\n\t\t\tvar tr = document.createElement(\"TR\");\n\t\t\ttr.appendChild(elem(\"TD\", etiquetas[j]));\n\t\t\t// Para Ofrezco y Busco se muestran 4 materiales y un quinto comodin\n\t\t\tfor (var i = 0; i < 4; i++){\n\t\t\t\tvar td = document.createElement(\"TD\");\n\t\t\t\ttd.setAttribute(\"id\", \"filtro\" + j + i);\n\t\t\t\tvar ref = elem(\"A\", \"<img src='\" + img('r/' + (i+1) + '.gif') + \"' width='18' height='12' border='0' title='\" + T('RECURSO' + (i+1)) + \"'>\");\n\t\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(j, i+1), 0);\n\t\t\t\ttd.appendChild(ref);\n\t\t\t\ttr.appendChild(td);\n\t\t\t}\n\t\t\tvar td = document.createElement(\"TD\");\n\t\t\ttd.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + j + \"4\");\n\t\t\tvar ref = elem(\"A\", T('CUALQUIERA'));\n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\");\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(j, 5), 0);\n\t\t\ttd.appendChild(ref);\n\t\t\ttr.appendChild(td);\n\t\t\ttable.appendChild(tr);\n\t\t}\n\n\t\t// La fila del tipo especifica transacciones 1:1 o 1:x\n\t\tvar tr = document.createElement(\"TR\");\n\t\ttr.appendChild(elem(\"TD\", T('TIPO')));\n\t\ttable.appendChild(tr);\n\t\tvar etiquetas_tipo = [\"1:1\", \"1:>1\", \"1:<1\", \"1:x\"];\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tvar td = document.createElement(\"TD\");\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + 2 + i);\n\t\t\tif (i == 3) td.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\tvar ref = elem(\"A\", etiquetas_tipo[i]); \n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\"); \n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(2, (i+1)), 0);\n\t\t\ttd.appendChild(ref); \n\t\t\ttr.appendChild(td);\n\t\t}\n\t\ttr.appendChild(document.createElement(\"TD\"));\n\n\t\tvar tr = document.createElement(\"TR\");\n\t\ttr.appendChild(elem(\"TD\", T('MAXTIME')));\n\t\ttable.appendChild(tr);\n\t\tvar etiquetas_tipo = [\"1\", \"2\", \"3\", \">3\"];\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tvar td = document.createElement(\"TD\");\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + 4 + i);\n\t\t\tif (i == 3) td.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\tvar ref = elem(\"A\", etiquetas_tipo[i]); \n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\"); \n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(4, (i+1)), 0);\n\t\t\ttd.appendChild(ref); \n\t\t\ttr.appendChild(td);\n\t\t}\n\t\ttr.appendChild(document.createElement(\"TD\"));\n\n\t\tvar tr = document.createElement(\"TR\");\n\t\ttr.appendChild(elem(\"TD\", T('DISPONIBLE')));\n\t\ttable.appendChild(tr);\n\t\tvar etiquetas_carencia = [T('SI'), T('NO')];\n\t\tfor (var i = 0; i < 2; i++){\n\t\t\tvar td = document.createElement(\"TD\");\n\t\t\ttd.setAttribute(\"colspan\", \"2\");\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + 3 + i);\n\t\t\tif (i == 1) td.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\tvar ref = elem(\"A\", etiquetas_carencia[i]);\n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\");\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(3, (i+1)), 0);\n\t\t\ttd.appendChild(ref);\n\t\t\ttr.appendChild(td);\n\t\t}\n\t\ttr.appendChild(document.createElement(\"TD\"));\n\n\t\t// Busca la tabla de ofertas y la inserta justo antes\n\t\tvar a = find(\"//table[@cellspacing='1' and @cellpadding='2' and @class='tbg' and not(@style)]\", XPFirst);\n\t\tvar p = document.createElement(\"P\");\n\t\tp.appendChild(table);\n\t\ta.parentNode.insertBefore(p, a);\n\t}", "function muestraHistorial(tipo) {\n var tamanio = historial.length;\n var html =\n `<table id=\"myTable\" class=\"table table-bordered table-striped\">\n <thead>\n <tr>\n <th>No. de nomina</th>\n <th>Fecha</th>\n <th>Elaborada por</th>\n <th class=\"text-center\">Acciones</th>\n </tr>\n </thead>\n <tfoot>\n <tr>\n <th>No. de nomina</th>\n <th>Fecha</th>\n <th>Elaborada por</th>\n <th>Acciones</th>\n </tr>\n </tfoot>\n <tbody>`;\n for(var x=0; x<tamanio; x++) {\n\n html += `<tr>\n <td>${historial[x].Semana}</td>\n <td><i class=\"fa fa-clock-o\"></i> ${historial[x].Fecha}</td>\n <td>${historial[x].usuario}</td>\n <td class=\"text-center\">\n <a href=\"nomina${tipo}/detalles/${historial[x].Semana}\" data-toggle=\"tooltip\" data-original-title=\"Ver detalles\"> <i class=\"icon-eye \"></i> </a>\n </td>\n\n </tr>`;\n }\n html += `<tbody>\n </table>`;\n $( \".tablaHistorial\" ).append(html);\n $('#myTable').DataTable({\n \"order\": [[ 1, \"desc\" ]]\n });\n}", "function inizializzaTabellaRisultati() {\n var tableId = 'tabellaRisultatiRicerca';\n var opts = {\n bServerSide: true,\n sServerMethod: 'POST',\n sAjaxSource: 'risultatiRicercaConciliazionePerTitoloAjax.do',\n bPaginate: true,\n bLengthChange: false,\n iDisplayLength: 5,\n bSort: false,\n bInfo: true,\n bAutoWidth: false,\n bFilter: false,\n bProcessing: true,\n bDestroy: true,\n oLanguage: {\n sInfo: '_START_ - _END_ di _MAX_ risultati',\n sInfoEmpty: '0 risultati',\n sProcessing: 'Attendere prego...',\n sZeroRecords: 'Non sono presenti risultati di ricerca secondo i parametri inseriti',\n oPaginate: {\n sFirst: 'inizio',\n sLast: 'fine',\n sNext: 'succ.',\n sPrevious: 'prec.',\n sEmptyTable: 'Nessun dato disponibile'\n }\n },\n fnPreDrawCallback: function () {\n $('#' + tableId + '_processing').parent('div').show();\n },\n fnDrawCallback: function () {\n $('#' + tableId + '_processing').parent('div').hide();\n $('a[rel=\"popover\"]', '#' + tableId).popover();\n },\n aoColumnDefs: [\n {aTargets: [0], mData: 'stringaClassificatore'},\n {aTargets: [1], mData: 'stringaClasse'},\n {aTargets: [2], mData: 'stringaConto'},\n {aTargets: [3], mData: 'stringaDescrizioneConto'},\n {aTargets: [4], mData: function(source) {\n return faseBilancioChiuso ? '' : source.azioni;\n }, fnCreatedCell: function(nTd, sData, oData) {\n $(nTd).find('a.aggiornaConciliazione')\n .eventPreventDefault('click', aperturaAggiornamentoConciliazione.bind(undefined, nTd, oData))\n .end()\n .find('a.annullaConciliazione')\n .eventPreventDefault('click', aperturaAnnullamentoConciliazione.bind(undefined, oData));\n }}\n ]\n };\n return $('#' + tableId).dataTable(opts);\n }", "function tabelDataPegawai()\n {\n var table = \"<table id='datapegawaifinger' class='table table-bordered thead-dark table-striped table-hover'><thead class='bg bg-navy'>\";\n var row = \"<tr>\";\n var column = \"<th class='col-md-1'>ID</th><th class='col-md-1'>NIP</th><th class='col-md-6'>Nama</th><th class='col-md-1'>Aksi</th>\";\n var row_end = \"</tr>\";\n var table_end = \"</thead><tbody></tbody></table>\";\n $(\"#datadarieabsen\").html(table+row+column+row_end+table_end);\n }", "function v3_DOMGerarTabela(){\n let table = [];\n let rows = document.querySelectorAll('tbody tr');\n var keys = document.querySelectorAll('table thead tr th');\n keys = Array.prototype.map.call( keys, function( a ){\n return a.textContent;\n })\n rows.forEach( function(r){\n let linha = new Map();\n let vars = new Map();\n Array.prototype.forEach.call( r.cells, function( d, i ){ \n let value = d.querySelector('input').value\n if( i == 0 ){\n linha.set( keys[ d.cellIndex ], value )\n }else{\n vars.set( keys[ d.cellIndex ], Number(value) )\n }\n })\n linha.set( 'Variaveis', vars );\n table.push( linha )\n })\n return table;\n }", "function fPadraoF10(padrao){\r\n var sql=\"SELECT \"+padrao.fieldCod+\" AS CODIGO,\"+padrao.fieldDes+\" AS DESCRICAO FROM \"+padrao.tableBd+\" A \";\r\n //\r\n //////////////////////////////////////////////////////////////////////////////////////////////////////\r\n // a tbl eh padrao \"tblPas\" mas quando em um mesmo form existir duas chamadas o obj padrao deve ter //\r\n // a propriedade tbl:\"tblXxx\" devido funcao function RetF10tblXxx(arr) que naum pode ser repetida //\r\n ////////////////////////////////////////////////////////////////////////////////////////////////////// \r\n var tblPad=\"tblPad\";\r\n // \r\n if( padrao.opc == 0 ){ \r\n sql+=\"WHERE (\"+padrao.fieldAtv+\"='S')\";\r\n let tamColCodigo = \"6em\"; \r\n let tamColNome = \"30em\";\r\n let divWidth = \"42%\";\r\n for (var key in padrao) {\r\n switch( key ){\r\n case \"tbl\" : tblPad=padrao[key] ;break; \r\n case \"where\" : sql+=padrao[key] ;break; \r\n case \"tamColCodigo\" : tamColCodigo=padrao[key] ;break; \r\n case \"tamColNome\" : tamColNome=padrao[key] ;break; \r\n case \"divWidth\" : divWidth=padrao[key] ;break; \r\n }; \r\n };\r\n //////////////////////////////////////////////////////////////////////////////\r\n // localStorage eh o arquivo .php onde estao os select/insert/update/delete //\r\n //////////////////////////////////////////////////////////////////////////////\r\n var bdPad=new clsBancoDados(localStorage.getItem('lsPathPhp'));\r\n bdPad.Assoc=false;\r\n bdPad.select( sql );\r\n if( bdPad.retorno=='OK'){\r\n var jsPadF10={\r\n \"titulo\":[\r\n {\"id\":0 ,\"labelCol\":\"OPC\" ,\"tipo\":\"chk\" ,\"tamGrd\":\"3em\" ,\"fieldType\":\"chk\"} \r\n ,( padrao.typeCod==\"int\" ? \r\n {\"id\":1 ,\"labelCol\":\"CODIGO\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"6em\" ,\"fieldType\":\"int\",\"formato\":['i4'],\"ordenaColuna\":\"S\",\"align\":\"center\"} : \r\n {\"id\":1 ,\"labelCol\":\"CODIGO\" ,\"tipo\":\"edt\" ,\"tamGrd\":tamColCodigo ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"} )\r\n ,{\"id\":2 ,\"labelCol\":\"DESCRICAO\" ,\"tipo\":\"edt\" ,\"tamGrd\":tamColNome ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"}\r\n ]\r\n ,\"registros\" : bdPad.dados // Recebe um Json vindo da classe clsBancoDados\r\n ,\"opcRegSeek\" : true // Opção para numero registros/botão/procurar \r\n ,\"checarTags\" : \"N\" // Somente em tempo de desenvolvimento(olha as pricipais tags)\r\n ,\"tbl\" : tblPad // Nome da table\r\n ,\"prefixo\" : \"pad\" // Prefixo para elementos do HTML em jsTable2017.js\r\n ,\"tabelaBD\" : padrao.tableBd // Nome da tabela no banco de dados \r\n ,\"width\" : \"52em\" // Tamanho da table\r\n ,\"height\" : \"38em\" // Altura da table\r\n ,\"indiceTable\" : \"DESCRICAO\" // Indice inicial da table\r\n };\r\n if( objPadF10 === undefined ){ \r\n objPadF10 = new clsTable2017(\"objPadF10\");\r\n objPadF10.tblF10 = true;\r\n }; \r\n \r\n if( (padrao.foco != undefined) && (padrao.foco != \"null\") ){\r\n objPadF10.focoF10=padrao.foco; \r\n };\r\n \r\n var html = objPadF10.montarHtmlCE2017(jsPadF10);\r\n var ajudaF10 = new clsMensagem('Ajuda',padrao.topo);\r\n ajudaF10.divHeight= '400px'; /* Altura container geral*/\r\n ajudaF10.divWidth = divWidth;\r\n ajudaF10.tagH2 = false;\r\n ajudaF10.mensagem = html;\r\n ajudaF10.Show('ajudaPad');\r\n document.getElementById(tblPad).rows[0].cells[2].click();\r\n };\r\n }; \r\n if( padrao.opc == 1 ){\r\n sql+=\" WHERE (\"+padrao.fieldCod+\"='\"+document.getElementById(padrao.edtCod).value.toUpperCase()+\"')\"\r\n +\" AND (\"+padrao.fieldAtv+\"='S')\";\r\n var bdPad=new clsBancoDados(localStorage.getItem(\"lsPathPhp\"));\r\n bdPad.Assoc=true;\r\n bdPad.select( sql );\r\n return bdPad.dados;\r\n }; \r\n}", "function dataAjusteInv(){\n let rangodeFecha = $(\"#daterange-btn-Ajuste span\").html();\n console.log(\"Rango de Fecha:\",rangodeFecha);\n if(rangodeFecha==undefined || rangodeFecha==null){\n var FechDev1=moment().format('YYYY-MM-DD');\n var FechDev2=moment().format('YYYY-MM-DD');\n }else{\n\t let arrayFecha = rangodeFecha.split(\" \", 3);\n\t let f1=arrayFecha[0].split(\"-\");\n\t let f2=arrayFecha[2].split(\"-\");\n\n\t var FechDev1=f1[2].concat(\"-\").concat(f1[1]).concat(\"-\").concat(f1[0]); //armar la fecha año-mes-dia\n\n\t var FechDev2=f2[2].concat(\"-\").concat(f2[1]).concat(\"-\").concat(f2[0]);\n }\t \n \n //console.log(FechDev1, FechDev2);\n\n tablaAjusteInv=$('#datatableAI').dataTable(\n\t{\n\t\t\"aProcessing\": true,//Activamos el procesamiento del datatables\n\t \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n \"lengthMenu\": [ [10, 25, 50,100, -1], [10, 25, 50, 100, \"Todos\"] ],\n \"language\": {\n\t\t\"sProcessing\": \"Procesando...\",\n \"sLengthMenu\": \"Mostrar _MENU_ registros &nbsp\",\n \"sZeroRecords\": \"No se encontraron resultados\",\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n \"sInfo\": \"Mostrar registros del _START_ al _END_ de un total de _TOTAL_\",\n\t\t\"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\t\t\"sInfoPostFix\": \"\", \n \"sSearch\": \"Buscar:\",\n \"sInfoThousands\": \",\",\n \"sLoadingRecords\": \"Cargando...\",\n \"oPaginate\": {\n\t\t\"sFirst\": \"Primero\",\n\t\t\"sLast\": \"Último\",\n\t\t\"sNext\": \"Siguiente\",\n\t\t\"sPrevious\": \"Anterior\"}\n },\n\t\t\"oAria\": {\n\t\t\t\"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\t\t\t\"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\t\t},\n dom: '<clear>Bfrtip',\n buttons: [\n {\n text: 'Copiar',\n extend: 'copy'\n },\n 'excelHtml5',\n 'csvHtml5',\n {\n extend: 'pdfHtml5',\n orientation: 'landscape',\n title: \"AdminLTE\",\n customize: function ( doc ) {\n pdfMake.createPdf(doc).open();\n },\n },\n \n {\n extend: 'print',\n text: 'Imprimir',\n className: 'btn btn-success btn-sm',\n autoPrint: false //TRUE para abrir la impresora\n }\n ],\n initComplete: function () {\n var btns = $('.dt-button');\n btns.removeClass('dt-button');\n btns.addClass('btn btn-success btn-sm');\n },\n\t\t\"ajax\":\n\t\t\t\t{\n url: 'ajax/ajusteinventario.ajax.php?op=listar',\n data: {\"FechDev1\": FechDev1, \"FechDev2\": FechDev2}, \n\t\t\t\t\ttype : \"POST\",\n\t\t\t\t\tdataType : \"json\",\t\t\t\t\t\t\n\t\t\t\t\terror: function(e){\n\t\t\t\t\t\tconsole.log(e.responseText);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\"bDestroy\": true,\n\t\t\"iDisplayLength\": 10,//Paginación\n\t \"order\": [[ 0, \"desc\" ]]//Ordenar (columna,orden)\n\t}).DataTable(); \n \n}", "function crearTablaPacientes(resultado) {\n var contenido = JSON.parse(resultado);\n $('#tblPacientes tbody').html(\"\");\n $.each(contenido, function (key, item) {\n var $tr = $('<tr>');\n $.each(item, function (index, data) {\n $tr.append($('<td>').text(data));\n });\n $tr.append($('<td style=\"text-align:center\">').html('<a role=\"button\" class=\"btn btn-default btnEditarPaciente\" data-toggle=\"modal\"><span class=\"glyphicon glyphicon-pencil\" aria-hidden=\"true\"></span></a>'));\n $tr.appendTo('#tblPacientes tbody');\n });\n\n $(\"#tblPacientes\").DataTable({\n \"language\": {\n \"url\": \"//cdn.datatables.net/plug-ins/1.10.15/i18n/Spanish.json\"\n },\n \"responsive\": true,\n \"columnDefs\": [\n { \"visible\": false, \"targets\": 0 }\n ]\n });\n\n clickEditarPaciente();\n}", "function cargarCuerpoTabla(id) {\n var n = $(\".tabla-detalle-indicadores\").find(\"tbody\").find(\"th\").length + 1;\n if (id == 1) {\n cargarCuerpoElectrico(\"\", n, 0, 0);\n } else if (id == 2) {\n cargarCuerpoHibrido(\"\", n, 0, 0)\n } else if (id == 3) {\n cargarCuerpoElectricoConsumo(\"\", n, 0, 0);\n } else if (id == 4) {\n cargarCuerpoHibridoConsumo(\"\", n, 0, 0);\n }\n //$(\"#cuerpoTablaIndicador\").append(t);\n MRV.CargarSelect(baseUrl + \"Gestion/ListarTipoVehiculo\", \"#cbo-det-2-\" + n + \"\", \"ID_TIPO_VEHICULO\", \"DESCRIPCION\");\n MRV.CargarSelect(baseUrl + \"Gestion/ListarTipoCombustible\", \"#cbo-det-3-\" + n + \"\", \"ID_TIPO_COMBUSTIBLE\", \"DESCRIPCION\");\n}", "function llenaTabla(){\n\t\n $(\".fila_usuario\").remove();\n \n\t\n $.ajax({\n data:{},\n url:\"GET_USUARIO\",\n type:\"POST\",\n success: function (response) {\n \t\n\n var ESTADO=\"\";\n $.each( response, function( key, value ) {\n \t \n \t if(value.ESTADO===true){\n \t\t \n \t\t ESTADO=\"ACTIVO\";\n \t\t \n \t }else{\n \t\t ESTADO=\"INACTIVO\";\n \t\t \n \t }\n \t \n \t \n $(\"#tb_usuario\").append('<tr id='+value.OID_USUARIO+' class=fila_usuario><td>'+value.OID_USUARIO+'</td><td>'+value.USUARIO+'</td><td><a onclick=changeState('+value.OID_USUARIO+','+value.ESTADO+')>'+ESTADO+'</a></td><td><a onclick=update('+value.OID_USUARIO+',\"'+value.USUARIO+'\")>ACTUALIZAR</a></td></tr>');\n\n \t\t});\n \n \t/*PAGINACION DE LA TABLA*/\n table= $('#table_usuario').DataTable();\n\n \n }, error: function (err) {\n alert(\"Error en el AJAX LLena tabla\" + err.statusText);\n }\n });\n \n\t\n\t\n\t\n}", "static data_table_ajax( array_col, id_tabla, directorio_secundario, method_ = null ) { \n\n\t\t\t$.fn.dataTable.ext.errMode = 0\n\n\t\t var tabla_dat = $(id_tabla).DataTable( {\n\n\t\t\t\tajax: {\n\t\t\t\t\tmethod: this.tipo_metodo( method_ ),\n\t\t\t\t\tcache: false,\n\t\t\t url: 'assets/server/'+directorio_secundario+'/index.php',\n\t\t\t },\n\n\t\t\t responsive: true,\n\n\t\t\t columns: array_col \n\n\t\t } );\n\n\t\t\treturn tabla_dat;\n\n\t\t}", "function analisaTablero () {\n rac = analisisColumnas()\n raf = analisisFilas()\n if (rac == true || raf == true) {\n eliminarDulces()\n } else {\n mueveDulces()\n }\n }", "function MostrarRegistro(){\n //declaramos una variable para guardar los datos\n var listaproductos=Mostrar();\n //selecciono el tbody de la tabla donde voy a guardar\n tbody = document.querySelector(\"#tbRegistro tbody\");\n tbody.innerHTML=\"\";\n //Agregamos las columnas que se registren\n for(var i=0; i<listaproductos.length;i++){\n //Declaramos una variable para la fila\n var fila=tbody.insertRow(i);\n //declaramos variables para los titulos\n var titulonombre = fila.insertCell(0);\n var tituloprecio = fila.insertCell(1);\n var titulocategoria = fila.insertCell(2);\n var titulocantidad = fila.insertCell(3);\n //agregamos valores\n titulonombre.innerHTML = listaproductos[i].nombre;\n tituloprecio.innerHTML = listaproductos[i].precio;\n titulocategoria.innerHTML = listaproductos[i].categoria;\n titulocantidad.innerHTML = listaproductos[i].cantidad;\n tbody.appendChild(fila);\n }\n}", "function cargarTablaTalleresTerminados(fechaInicial, fechaFinal){\n$('.tablaTalleresT').DataTable({\n\t\"ajax\": \"ajax/produccion/tabla-talleresTerminado.ajax.php?perfil=\" + $(\"#perfilOculto\").val()+\"&fechaInicial=\" + fechaInicial + \"&fechaFinal=\" + fechaFinal,\n\t\"deferRender\": true,\n\t\"retrieve\": true,\n\t\"processing\": true,\n\t\"order\": [[0, \"desc\"]],\n\t\"pageLength\": 20,\n\t\"lengthMenu\": [[20, 40, 60, -1], [20, 40, 60, 'Todos']],\n\t\"language\": {\n\n\t\t\"sProcessing\": \"Procesando...\",\n\t\t\"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\t\t\"sZeroRecords\": \"No se encontraron resultados\",\n\t\t\"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\t\t\"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_\",\n\t\t\"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0\",\n\t\t\"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\t\t\"sInfoPostFix\": \"\",\n\t\t\"sSearch\": \"Buscar:\",\n\t\t\"sUrl\": \"\",\n\t\t\"sInfoThousands\": \",\",\n\t\t\"sLoadingRecords\": \"Cargando...\",\n\t\t\"oPaginate\": {\n\t\t\t\"sFirst\": \"Primero\",\n\t\t\t\"sLast\": \"Último\",\n\t\t\t\"sNext\": \"Siguiente\",\n\t\t\t\"sPrevious\": \"Anterior\"\n\t\t},\n\t\t\"oAria\": {\n\t\t\t\"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\t\t\t\"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\t\t}\n\n\t}\n\n});\n}", "function quitaTabla() {\n\tvar tabla = $$$('lista');\n\t\n\tif ((tabla != null) && (tabla != undefined))\n\t\ttabla.style.visibility = 'hidden';\n\t\n\ttabla = $$$('listaMan');\n\t\n\tif ((tabla != null) && (tabla != undefined))\n\t\ttabla.style.visibility = 'hidden';\n}", "function dataTable() {\r\n table = $('#table-usuario').DataTable({\r\n destroy: true,\r\n ajax: {\r\n url: '../app/controllers/UsuarioController.php',\r\n method: 'POST',\r\n data: {\r\n tabla: \"usuario\"\r\n },\r\n dataSrc: 'data'\r\n },\r\n columns: [{\r\n data: 'codi_usua',\r\n \"visible\": false\r\n }, {\r\n data: 'nomb_usua'\r\n }, {\r\n data: 'apel_usua'\r\n }, {\r\n data: 'corre_usua'\r\n }, {\r\n data: 'codi_tipo_usua',\r\n \"visible\": false\r\n }, {\r\n data: 'nomb_tipo_usua'\r\n }, {\r\n defaultContent:\"<a href='#deleUsuario' class='delete btn-small red darken-1 waves-effect waves-ligth modal-trigger'>Eliminar</a>\"\r\n }],\r\n language: {\r\n \"sProcessing\": \"Procesando...\",\r\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\r\n \"sZeroRecords\": \"No se encontraron resultados\",\r\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\r\n \"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros\",\r\n \"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0 registros\",\r\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\r\n \"sInfoPostFix\": \"\",\r\n \"sSearch\": \"Buscar:\",\r\n \"sUrl\": \"\",\r\n \"sInfoThousands\": \",\",\r\n \"sLoadingRecords\": \"Cargando...\",\r\n \"oPaginate\": {\r\n \"sFirst\": \"Primero\",\r\n \"sLast\": \"Último\",\r\n \"sNext\": \"Siguiente\",\r\n \"sPrevious\": \"Anterior\"\r\n },\r\n \"oAria\": {\r\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\r\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\r\n }\r\n },\r\n iDisplayLength: 5\r\n });\r\n $('select').select2();\r\n // Llamamos al metodo para obtener los datos, para actualizar\r\n getDataToUpdate(\"#table-usuario tbody\", table);\r\n // Llamamos al metodo para obtener el id del registro, para eliminar\r\n getIdToDelete(\"#table-usuario tbody\", table);\r\n}", "function init_log_table(){\n\t\t\n\t\tvar columns = [\n\t\t\t\t\t\t{ \"title\": \"FECHA\", \"data\": \"date\", \"class\": \"center\", \"width\": \"15%\" },\n\t\t\t\t\t\t{ \"title\": \"HORA\", \"data\": \"date\", \"class\": \"center\", \"width\": \"15%\" },\n\t\t\t\t\t\t{ \"title\": \"USUARIO\", \"data\": \"user\", \"class\": \"center\", \"width\": \"20%\" },\n\t\t\t\t\t\t{ \"title\": \"ACCIÓN\", \"data\": \"action\", \"class\": \"left\", \"width\": \"25%\" },\n\t\t\t\t\t\t{ \"title\": \"DETALLE\", \"data\": \"details\", \"class\": \"left\", \"width\": \"25%\" }\n\t\t\t\t\t ];\n\t\tvar columnDefs = [{\t\t\"targets\": 0,\n\t\t\t\t\t\t\t\t\"render\": function( data, type, row ){\n\t\t\t\t\t\t\t\t\treturn data.substr(0,10);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t },\n\t\t\t\t\t\t {\t\t\"targets\": 1,\n\t\t\t\t\t\t\t \t\"render\": function( data, type, row){\n\t\t\t\t\t\t\t \t\treturn data.substr(11,12);\n\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t }];\n\n\t\tdt = $('table#log-data').dataTable({\n\t\t\t\t\n\t\t\t\"data\": [],\n\t\t\t\"lengthMenu\": [ 5, 10, 20, 30 ],\n\t\t\t\"pageLength\": 10,\n\t\t\t\"pagingType\": \"full_numbers\",\n\t\t\t\"order\": [[ 0, \"desc\" ],[ 1, \"desc\"]],\n\t\t\t\"dom\": '<\"l-cant\">lrtTip',\n\t\t\t\"tableTools\": {\n\t\t\t\t\"aButtons\": [],\n\t\t\t\tfnRowSelected: function(){},\n\t\t\t\tfnRowDeselected: function(){}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t},\n\t\t\t\"columns\": columns,\n\t\t\t\"columnDefs\": columnDefs,\n\t\t\t\"language\": {\n\t \"lengthMenu\": \"Mostrar _MENU_ datos por página\",\n\t \"zeroRecords\": \"Sin datos para mostrar\",\n\t \"info\": \"Mostrando página _PAGE_ de _PAGES_\",\n\t \"infoEmpty\": \"Sin datos para mostrar\",\n\t \"infoFiltered\": \"(filtrados de un total de _MAX_ datos)\",\n\t\t\t \"emptyTable\": \"Sin datos para mostrar\",\n\t\t\t \"infoPostFix\": \"\",\n\t\t\t \"thousands\": \".\",\n\t\t\t \"loadingRecords\": \"Cargando...\",\n\t\t\t \"processing\": \"Procesando...\",\n\t\t\t \"search\": \"Buscar:\",\n\t\t\t \"paginate\": {\n\t\t\t \"first\": \"Primera\",\n\t\t\t \"last\": \"Última\",\n\t\t\t \"next\": \"Siguiente\",\n\t\t\t \"previous\": \"Anterior\"\n\t\t\t },\n\t\t\t \"aria\": {\n\t\t\t \"sortAscending\": \": Click para ordenar ascendentemente\",\n\t\t\t \"sortDescending\": \": Click para ordenar descendentemente\"\n\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\t$('div.l-cant').html('Resultado: <b>0</b> datos');\n\t}", "function tekliflistesi(id) {\n var table = $(\"#tekliflistesi\").DataTable();\n table\n .clear()\n .draw();\n $.post(\"/Customer/gettekliflistesi\", { musteriid: id }, function (gelenveri) {\n \n if (gelenveri.length > 0)\n {\n if (document.getElementById(\"divteklifler\").style.display = \"none\") {\n document.getElementById(\"divteklifler\").style.display = \"\";\n }\n var items = \"\";\n $.each(gelenveri, function (k, v) {\n\n if (v.durum == 0) {\n table.row.add([\n v.firmaadi,\n v.tarih,\n v.acıklama,\n 'Onay Bekleniyor',\n '<a href=\"../Customer/teklifduzenle/' + v.teklifid + '\" class=\"btn btn-success\">' + 'Düzenle' + '</a>' +' ' +'<a href=\"../Customer/pdfgoruntule/' + v.teklifid + '\" class=\"btn btn-primary\">'+'Görüntüle' + '</a>',\n \n ]).draw();\n }\n else {\n table.row.add([\n v.firmaadi,\n v.tarih,\n v.acıklama,\n 'Teklif Onaylandı',\n '<a href=\"../Customer/teklifduzenle/' + v.teklifid + '\" class=\"btn btn-success\">' + 'Düzenle' + '</a>' + ' ' + '<a href=\"../Customer/pdfgoruntule/' + v.teklifid + '\" class=\"btn btn-primary\">' + 'Görüntüle' + '</a>',\n ]).draw();\n }\n\n\n\n \n\n\n })\n \n }\n\n })\n}", "function crearTablaResultados(resultado) {\n var contenido = JSON.parse(resultado);\n $('#tblResultados tbody').html(\"\");\n $.each(contenido, function (key, item) {\n var $tr = $('<tr>');\n $.each(item, function (index, data) {\n $tr.append($('<td>').text(data));\n });\n $tr.append($('<td style=\"text-align:center\">').html('<a role=\"button\" class=\"btn btn-default btnModalEditarResultado\" data-toggle=\"modal\"><span class=\"glyphicon glyphicon-pencil\" aria-hidden=\"true\"></span></a>'));\n $tr.appendTo('#tblResultados tbody');\n });\n\n $(\"#tblResultados\").DataTable({\n \"language\": {\n \"url\": \"//cdn.datatables.net/plug-ins/1.10.15/i18n/Spanish.json\"\n },\n \"responsive\": true,\n \"columnDefs\": [\n { \"visible\": false, \"targets\": 0 }\n ]\n });\n\n clickEditarResultado();\n}", "function cargarCuerpoElectrico(data, fila, enfoque, bandera) {\n var tr = '<tr id=\"detalles-tr-' + fila + '\" data-value=\"' + fila + '0\" >';\n tr = tr + ' <th class=\"text-center\" data-encabezado=\"Número\" scope=\"row\" id=\"row-' + fila + '\">' + fila + '</th>';\n tr = tr + ' <td data-encabezado=\"Columna 01\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <select class=\"form-control form-control-sm text-right\" id=\"cbo-det-1-' + fila + '\" onchange=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' <option value=\"2018\">2018</option>';\n tr = tr + cargarAnio();\n tr = tr + ' </select>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 04\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"date\" placeholder=\"\" id=\"dat-det-1-' + fila + '\" onBlur=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 02\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <select class=\"form-control form-control-sm text-right\" id=\"cbo-det-2-' + fila + '\" onchange=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' <option value=\"0\">Seleccione</option>';\n tr = tr + ' </select>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 03\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <select class=\"form-control form-control-sm text-right\" id=\"cbo-det-3-' + fila + '\" onchange=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' <option value=\"0\">Seleccione</option>';\n tr = tr + ' </select>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 04\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-1-' + fila + '\" onBlur=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 05\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-2-' + fila + '\" onBlur=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 06\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-3-' + fila + '\" onBlur=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 04\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-4-' + fila + '\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 07\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-5-' + fila + '\" disabled>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 07\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-6-' + fila + '\" disabled>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Subtotal\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" id=\"txt-det-7-' + fila + '\" disabled>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td class=\"text-center text-xs-right\" data-encabezado=\"Acciones\">';\n tr = tr + ' <div class=\"btn-group\">';\n tr = tr + ' <div class=\"acciones fase-01 dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\"><i class=\"fas fa-ellipsis-h\"></i></div>';\n tr = tr + ' <div class=\"dropdown-menu dropdown-menu-right\">';\n tr = tr + ' <a class=\"dropdown-item agregarFila\" href=\"#\">';\n tr = tr + ' <i class=\"fas fa-plus-circle\"></i>&nbsp;Agregar';\n tr = tr + ' </a><a class=\"dropdown-item quitarCampos\" href=\"#\" onclick=\"fn_restarTotal(7, 8);\">';\n tr = tr + ' <i class=\"fas fa-minus-circle\"></i>&nbsp;Eliminar';\n tr = tr + ' </a>';\n tr = tr + ' </div>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n\n tr = tr + ' <td class=\"text-hide\" data-encabezado=\"ID_INDICADOR\" style=\"display:none;\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" id=\"txt-det-8-' + fila + '\" disabled>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n\n tr = tr + '</tr>';\n $(\"#cuerpoTablaIndicador\").append(tr);\n if (bandera == 1) {\n fn_CargarListaTipoVehiculo(data, (fila - 1), enfoque);\n }\n //return tr;\n}", "function criarItensTabala(dados) {\n\n const linha = tabela.insertRow();\n\n const colunaId = linha.insertCell(0)\n const colunaNome = linha.insertCell(1)\n const colunaValor = linha.insertCell(2)\n const colunaAcoes = linha.insertCell(3)\n\n const itemId = document.createTextNode(dados.id)\n const itemNome = document.createTextNode(dados.nome)\n const itemValor = document.createTextNode(dados.valor)\n\n colunaId.appendChild(itemId)\n colunaNome.appendChild(itemNome)\n colunaValor.appendChild(itemValor)\n\n criarBotoesTabela(colunaAcoes, dados)\n ordemCrescente()\n}" ]
[ "0.7689245", "0.7638684", "0.74350077", "0.74239796", "0.7374482", "0.73509043", "0.7339714", "0.7328672", "0.7315904", "0.73038", "0.725183", "0.724247", "0.72397435", "0.7211342", "0.72055614", "0.71819067", "0.7158415", "0.7117878", "0.7089697", "0.7088204", "0.7026082", "0.7016127", "0.701424", "0.7011812", "0.6978519", "0.69767934", "0.6963068", "0.69614494", "0.69604445", "0.69471556", "0.69333607", "0.6925073", "0.6922174", "0.6911851", "0.69097155", "0.69054085", "0.6897137", "0.68925154", "0.6830195", "0.6830147", "0.68107814", "0.68101984", "0.6807819", "0.6797069", "0.6795345", "0.6793457", "0.67891866", "0.6786059", "0.67789185", "0.6778792", "0.6767962", "0.67643535", "0.6752", "0.6746725", "0.6745653", "0.6743911", "0.67340904", "0.67271346", "0.67233074", "0.6693979", "0.6687483", "0.6684711", "0.6670689", "0.6669201", "0.6665985", "0.66541135", "0.66524947", "0.6648797", "0.6645129", "0.6641907", "0.66269296", "0.66235805", "0.66196245", "0.66196245", "0.66193074", "0.66175693", "0.66068494", "0.66050035", "0.6585698", "0.6581858", "0.6573253", "0.6569136", "0.65654975", "0.65551573", "0.65510637", "0.65504634", "0.65479726", "0.6520534", "0.6509723", "0.6507655", "0.6505398", "0.650044", "0.6500129", "0.6480494", "0.64729655", "0.6471517", "0.64630157", "0.64582473", "0.6457185", "0.64558464", "0.6447473" ]
0.0
-1
Esta funcion se usa para ver la Memo en el proceso de Memos
function verMemo(nroMemo, nameArchivo) { var URL = getUrlApp() + "/DownloadServlet?tipo=VER_MEMO&nroMemo=" + nroMemo + "&nameArchivo=" + nameArchivo + TAB_ID_REQUEST; /* window.status = URL; var w = window.open(URL,"Memo","width=" + ancho + ",height=" + alto + ",top=" + posX + ",left=" + posY + ",scrollbars=YES,resizable=YES"); w.focus(); */ var anchorDownloader = new Element('a', { href: URL, download: 'true' }).setStyle('visibility', 'hidden').inject(document.body); anchorDownloader.click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readMemCache(ref) {\n if (!memCache[ref]) return;\n var age = Date.now() - memCache[ref].timestamp;\n if (age < ttl) return memCache[ref].hash;\n return;\n }", "function isInMemory(newState){\n\t var flag= false;\n\t for(mem in memory){\n\t\t if(memory[mem].stateEquals(newState)){\n\t\t\t flag = true;\n\t\t\t break;\n\t\t }\n\t }\n\t return flag;\n}", "_updateMemo(validTeam) {\n for (let pairIdx = 0; pairIdx < validTeam.length; ++pairIdx) {\n let p1Idx = this.players.indexOf(validTeam[pairIdx].value[0]);\n let p2Idx = this.players.indexOf(validTeam[pairIdx].value[1]);\n this.memo[p1Idx][p2Idx] = 1;\n this.memo[p2Idx][p1Idx] = 1;\n }\n }", "function memory() {\n return this._memory = this._memory || {};\n}", "async function calcMem(saveflag = false){\n\n blxDataMem = {total:0, incnew:0, max:-1, mode:-1}\n\n let v_data_idx = findFileInDir('data.edt') // might set blxErrMsg\n let v_data_old_idx = findFileInDir('data.edt.old') // might set blxErrMsg\n await blStore.get(blxIDs.deviceMAC + '_data.edt.old')\n let KeyVal_data_old = blStore.result() // undefined opt.\n await blStore.get(blxIDs.deviceMAC + '_data.edt')\n let KeyVal_data = blStore.result() // undefined opt.\n\n if(blxIDs.iparam !== undefined){ // Par. [12] iparam.flags 0: Record OFF, Bit 1:Measure, Bit 2: Ring\n blxDataMem.mode = parseInt(blxIDs.iparam[12]) // flags is at [12]\n if(blxDataMem.mode&2){ // Ring Mode\n if(blxIDs.sys_param!=undefined){\n blxDataMem.max = parseInt(blxIDs.sys_param[17])*2 // maxmem is at [17]\n }\n }else{ // Linear Mode\n blxDataMem.max = blxIDs.disk.diskSize - 102400 // 25 Sect. for System\n }\n }\n \n // Wenn v.data.edt.old == DB.data.edt dann shiften\n if(v_data_old_idx >= 0){ // Auf Device gibt es data.edt.old\n if (KeyVal_data != undefined ){ // und im Store data.edt\n if(blxIDs.disk.files[v_data_old_idx].date.getTime() === KeyVal_data.v.ctime.getTime()){\n // Zeiten sind gleich, also shiften, mgl. fehlt ein Teil von old, neu in jedem Fall dann ganz\n KeyVal_data_old = KeyVal_data\n KeyVal_data_old.k = blxIDs.deviceMAC + '_data.edt.old'\n KeyVal_data = undefined\n console.log(\"Shift 'data.edt'->'data.edt.old'\")\n if(saveflag === true){ // Merken der geshifteten Werte in DB\n try{\n await blStore.remove(blxIDs.deviceMAC + '_data.edt')\n await blStore.set(KeyVal_data_old.k, KeyVal_data_old.v)\n } catch (err) {\n blxErrMsg = 'ERROR(Store): ' + err\n return\n }\n }\n }\n }\n }\n\n // Es gibt eine OLD im DB, aber keine oder keine passende OLD im V\n if( (KeyVal_data_old != undefined) && ((v_data_old_idx < 0) || (blxIDs.disk.files[v_data_old_idx].date.getTime() !== KeyVal_data_old.v.ctime.getTime()))){\n v_data_old_idx = -1\n KeyVal_data_old = undefined\n if(saveflag === true){\n try{\n await blStore.remove(blxIDs.deviceMAC + '_data.edt.old')\n } catch (err) {\n blxErrMsg = 'ERROR(Store): ' + err\n return\n }\n }\n }\n // Dto fuer neu\n if( (KeyVal_data != undefined) && ((v_data_idx < 0) || (blxIDs.disk.files[v_data_idx].date.getTime() !== KeyVal_data.v.ctime.getTime()))){\n KeyVal_data = undefined\n if(saveflag === true){\n try{\n await blStore.remove(blxIDs.deviceMAC + '_data.edt')\n } catch (err) {\n blxErrMsg = 'ERROR(Store): ' + err\n return\n }\n }\n }\n\n if(v_data_idx>=0){\n blxDataMem.total += blxIDs.disk.files[v_data_idx].len\n }\n if(v_data_old_idx >=0){\n blxDataMem.total += blxIDs.disk.files[v_data_old_idx].len\n }\n blxDataMem.incnew = blxDataMem.total\n // Nun noch testen was vorhanden ist\n if(KeyVal_data != undefined){\n blxDataMem.incnew -= KeyVal_data.v.akt_len\n }\n if(KeyVal_data_old != undefined){\n blxDataMem.incnew -= KeyVal_data_old.v.akt_len\n }\n\n blxErrMsg = 0\n }", "function getMemInfo(gopher) {\n const reminderCount = gopher.webhook.getTaskData(\"mem.reminder_num\", 1);\n const frequencyPref = gopher.webhook.getTaskData(\n \"mem.frequency_pref\",\n memConfig.defaultFrequencyPref\n );\n return { reminderCount, frequencyPref };\n }", "function Memory(){\n this.data = {};\n }", "function Memory(){\n this.data = {};\n }", "function MemCache() {\n this.__wrapped__ = {};\n }", "mem() {\n\t\tlet ref = this.$mem++;\n\t\twhile (this.memRefs.has(ref)) {\n\t\t\tref = this.$mem++;\n\t\t}\n\t\treturn ref;\n\t}", "cachedCheck(document) {\n const cacheResult = this.cache.get(document);\n if (cacheResult) {\n return cacheResult;\n }\n const result = this.check(document);\n this.cache.set(document, result);\n return result;\n }", "function cacheToMemory(){\n // need to implement\n}", "_updateMemoryPerms() {\n\t\tlet self=this;\n\t\tlet perms=[];\n\t\tlet date = new Date();\n\t\tdate.setTime(date.getTime() + (7 * 24 * 60 * 60 * 1000));\n\t\tlet expires = \"; expires=\" + date.toUTCString();\n\t\tfor(let i in window.memory) {\n\t\t\tif(window.memory[i].mode===self.DEFINE.MEMORY_PERMANENT) {\n\t\t\t\tself.setCookie('OT_'+i,window.btoa(JSON.stringify(window.memory[i])));\n\t\t\t\tperms.push(i);\n\t\t\t}\n\t\t}\n\t\tself.setCookie('OT_INDEX',JSON.stringify(perms));\n\t}", "memory(pid,value) {\n\t\tlet self=this;\n\t\tlet command=this.findQueueByPid(pid);\n\t\tif(command) {\n\t\t\tlet origin = command.options.memoryName || command.queueable + '.' + command.command;\n\t\t\tlet mode = self.DEFINE.MEMORY_GARBAGE;\n\t\t\tif (command.options.memoryMode)\n\t\t\t\tmode = command.options.memoryMode;\n\t\t\tlet memoryDetails = {\n\t\t\t\tpid: pid,\n\t\t\t\tmode: mode,\n\t\t\t\torigin: origin,\n\t\t\t\tvalue: value\n\t\t\t};\n\t\t\twindow.memory[origin] = memoryDetails;\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.reportError(\"Could not set memory\",\"The memory set for pid [\"+pid+\"] could not be found\");\n\t\t\treturn false;\n\t\t}\n\t}", "async function waitMempool(rpc) {\n\n while (true) {\n sleep.sleep(1)\n let mempoolInfo = await rpc.rawCall('getmempoolinfo')\n console.log('transaction number left in mempool: ' + mempoolInfo.size)\n if (mempoolInfo.size == 0) {\n break\n }\n }\n}", "isOnline(fbId){\n return new Promise((resolve, reject) => {\n redis.getHash(fbId)\n .then(hash => {\n resolve(hash.isOnline);\n })\n .catch(error => reject(error))\n });\n }", "function memoGuard(fn) {\n return function(a, b, memos) {\n if (!memos) return fn(a, b, [])\n var i = memos.length,\n memo;\n while ((memo = memos[--i])) {\n if (memo[0] === a && memo[1] === b) return true\n }\n return fn(a, b, memos)\n }\n}", "function checkMem() {\n // see: https://github.com/WebAssembly/design/issues/1210\n if (buffer !== memory.buffer) {\n buffer = memory.buffer;\n I8 = new Int8Array(buffer);\n U8 = new Uint8Array(buffer);\n I16 = new Int16Array(buffer);\n U16 = new Uint16Array(buffer);\n I32 = new Int32Array(buffer);\n U32 = new Uint32Array(buffer);\n if (hasBigInt64) {\n I64 = new BigInt64Array(buffer);\n U64 = new BigUint64Array(buffer);\n }\n F32 = new Float32Array(buffer);\n F64 = new Float64Array(buffer);\n }\n }", "function MemoryCache() {\n this._entries = [];\n}", "function sc_memv(o, l) {\n while (l !== null) {\n\tif (l.car === o)\n\t return l;\n\tl = l.cdr;\n }\n return false;\n}", "async function checkCache(name){\n\ttry {\n\n\t const value = await AsyncStorage.getItem('@cache:' + name);\n\t return value !== null;\n\n\t} catch (error) {\n\t console.log(error);\n\t}\n}", "function _gcBlocksCache() {\n 'use strict';\n\n logger.info('cache info: ', JSON.stringify(_activeBlocksCache));\n for (var no = 0; no < _activeBlocksCache.length; no++){\n if (_activeBlocksCache[no] && (_activeBlocksCache[no].online === true)){\n if (_activeBlocksCache[no].flag === false) {\n _activeBlocksCache[no].offlinecount++;\n if (_activeBlocksCache[no].offlinecount >= OFFLINECOUNT){\n _activeBlocksCache[no].online = false;\n event.emit(events.BLOCKLIST,getActiveBlocks());\n var name = _activeBlocksCache[no].name;\n var idx = getBlockIdx(name,no);\n var state = 'disconnected';\n var count = getSameTypeBlockCount(name);\n event.emit(events.BLOCKCONNECTION,{name: name, idx: idx, state: state});\n event.emit(events.BLOCKCONUT,{type: name, count: count});\n }\n } else {\n _activeBlocksCache[no].flag = false;\n }\n }\n }\n}", "function _saveMemory () {\n memory = total;\n }", "function printMem() {\n console.log('printing mem');\n chrome.storage.local.get(null, function(res) {\n console.log(res);\n });\n}", "empty() {\n var rd = Atomics.load(this.read_ptr, 0);\n var wr = Atomics.load(this.write_ptr, 0);\n return wr == rd;\n }", "function checkDirtyObj() {\n const odd = []\n for (const key in dirtyPileObj) {\n if(dirtyPileObj[key] > 0 ) {\n odd.push(key)\n }\n }\n\n return odd.length > 0\n }", "function t(n){return!!n.constructor&&typeof n.constructor.isBuffer==\"function\"&&n.constructor.isBuffer(n)}", "function t(n){return!!n.constructor&&typeof n.constructor.isBuffer==\"function\"&&n.constructor.isBuffer(n)}", "function t(n){return!!n.constructor&&typeof n.constructor.isBuffer==\"function\"&&n.constructor.isBuffer(n)}", "toMemoKey() {\n if (!this._memoKey) {\n Object.defineProperty(this, '_memoKey', {value: this.toString()});\n }\n return this._memoKey;\n }", "function hashClear(){\nthis.__data__=nativeCreate?nativeCreate(null):{};\nthis.size=0;\n}", "static init() {\n this.memoryStore = {}\n this.ready = false\n\n return new Promise((resolve, reject) => {\n localforage.iterate((value, key) => {\n this.memoryStore[key] = value\n }).then(() => {\n this.ready = true\n\n resolve()\n })\n .catch((err) => {\n reject(err)\n })\n })\n }", "function instateMemory(bitView) {\n\tmem = window.mem;\n\tmem.currBitView = bitView;\n\tvar d = document.getElementById(\"data\");\t//d has first and only child tbody\n\n\td.children[0].remove();\n\td.appendChild(document.createElement(\"tbody\"));\n\td = d.children[0];\t\t\t\t\t\t\t\t\t//d is tbody\n\n\td.appendChild(createMemoryComponent());\n\n\tvar w = 0;\n\tvar oflow = d.children[0];\t//first tr\n\toflow = oflow.children[1];\t//second column\n\toflow = oflow.children[0];\t//the div of memory data\n\toflow.style.width = oflow.clientWidth;\n\toflow.innerHTML = \"\";\n\n\tswitch(bitView) {\t\t\t\t//select widest character to check overflow\n\t\tcase 1:\n\t\t\tchecker = \"00000000\";\n\t\t\tbreak;\n\n\t\tcase 8:\n\t\t\tchecker = \"WWWWWWWW\";\n\t\t\tbreak;\n\t}\n\t\n\twhile(oflow.offsetWidth >= oflow.scrollWidth && oflow.clientHeight >= oflow.scrollHeight) {\t//detect overflow\n\t\tconsole.log(oflow.offsetWidth + \" \" + oflow.scrollWidth + \" \" + oflow.clientHeight + \" \" + oflow.scrollHeight)\n\t\toflow.innerHTML += checker + \"<pre> </pre>\";\n\t\tw += 10;\n\t\tconsole.log(w)\n\t}\n\t\n\tmem.width = w - 12;\n\tconsole.log(mem.width)\n\td.children[0].remove();\t\t//remove the first tr\n\n\t//start filling memory tables with known width\n\tvar r = 0;\n\tfor(var i = 0 ; i < mem.size ; i++) {\n\t\td.appendChild(createMemoryComponent());\n\t\td.children[r].children[0].innerHTML = i + \"\";\t\t\t//set byte address\n\t\td.children[r].children[0].id = \"a\" + i;\n\t\td.children[r].children[1].id = \"b\" + i;\n\t\tvar memdiv = d.children[r++].children[1].children[0];\t//the div for the data\n\t\tmemdiv.style.width = memdiv.clientWidth;\n\t\tvar s = \"\";\n\n\t\tfor(var j = 1 ; j <= mem.width && i < mem.size; j++) {\n\t\t\tvar num = \"\";\n\t\t\tvar ch = false;\n\t\t\tfor(var k = 0 ; k < bitView && i < mem.size ; k++) {\t\t\t//grab 'bitView' no of bits\n\t\t\t\tnum += Number(Boolean(mem[i++]));\n\t\t\t\tch = ch || Boolean(mem.changed[i-1]);\n\t\t\t}\n\n\t\t\tswitch(bitView) {\t\t//character-ify the data\n\t\t\t\tcase 8:\n\t\t\t\t\tnum = parseInt(num, 2);\n\t\t\t\t\tnum = String.fromCharCode(num);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif(ch)\n\t\t\t\ts += \"<span class='changed'>\" + num + \"</span>\";\n\t\t\telse\n\t\t\t\ts += num;\n\n\t\t\tif(j % 10 == 8) {\n\t\t\t\ts += \"<pre> </pre>\";\n\t\t\t\tj += 2;\n\t\t\t}\n\t\t}\n\n\t\tmemdiv.innerHTML = s;\n\t\ti--;\n\t}\n}", "function checkAndStore(obj){\n chrome.storage.local.get(function(msg){\n var oldestVisitTime = obj.lastVisitTime, oldestHistory;\n var historyNum = 0;\n var foundHistory = 0;\n var entry = {};\n entry[obj.id] = obj;\n \n for(var i in msg){\n historyNum++;\n if(msg[i].lastVisitTime < oldestVisitTime)\n oldestHistory = i;\n if(obj.id.localeCompare(msg[i].id) == 0){\n chrome.storage.local.set(entry, function(){});\n return;\n }\n }\n \n if(historyNum >= 500){\n chrome.storage.local.remove(i, function(){\n chrome.storage.local.set(entry, function(){});\n });\n }\n else{\n chrome.storage.local.set(entry, function(){});\n }\n });\n}", "function tempMemStat(mem){\n\t\tvar stats = \"\";\n\t\tif (mem==\"data\"){\n\t\t\tif (temp_data && temp_data.length > 0){\n\t\t\t\tfor(var i=0; i<=7; i++){\n\t\t\t\t\tstats = temp_data[i]+\" \"+stats;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{ stats = \"Not Set\"; }\t\n\t\t}\n\t\telse if (mem==\"addr\"){\n\t\t\tif (temp_addr && temp_addr.length > 0){\n\t\t\t\tfor(var i=0; i<=15; i++){\n\t\t\t\t\tstats = temp_addr[i]+\" \"+stats;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{ stats = \"Not Set\"; }\n\t\t}\n\t\treturn stats;\n\t}", "function setBaseMemory(){\n Memory.learn = {\n 'name':'',\n 'moveList': [],\n 'loop': 'inf',\n 'invader': '0'\n };\n return \"Memory has been set\";\n}", "function mem(callback) {\n\tif (_windows) {\n\t\tcallback(NOT_SUPPORTED);\n\t}\n\n\tvar result = {\n\t\ttotal : os.totalmem(),\n\t\tfree : os.freemem(),\n\t\tused : os.totalmem() - os.freemem(),\n\n\t\tactive : os.totalmem() - os.freemem(),\n\t\tbuffcache : 0,\n\n\t\tswaptotal : 0,\n\t\tswapused : 0,\n\t\tswapfree : 0\n\t};\n\n\tif (_linux) {\n\t\texec(\"free -b\", function(error, stdout) {\n\t\t\tif (!error) {\n\t\t\t\tvar lines = stdout.toString().split('\\n');\n\n\t\t\t\tvar mem = lines[1].replace(/ +/g, \" \").split(' ');\n\t\t\t\tresult.total = parseInt(mem[1]);\n\t\t\t\tresult.free = parseInt(mem[3]);\n\t\t\t\tresult.buffcache = parseInt(mem[5]) + parseInt(mem[6]);\n\t\t\t\tresult.active = result.total - result.free - result.buffcache;\n\n\t\t\t\tmem = lines[3].replace(/ +/g, \" \").split(' ');\n\t\t\t\tresult.swaptotal = parseInt(mem[1]);\n\t\t\t\tresult.swapfree = parseInt(mem[3]);\n\t\t\t\tresult.swapused = parseInt(mem[2]);\n\n\t\t\t}\n\t\t\tcallback(result);\n\t\t});\n\t}\n\tif (_darwin) {\n\t\texec(\"vm_stat | grep 'Pages active'\", function(error, stdout) {\n\t\t\tif (!error) {\n\t\t\t\tvar lines = stdout.toString().split('\\n');\n\n\t\t\t\tresult.active = parseInt(lines[0].split(':')[1]) * 4096;\n\t\t\t\tresult.buffcache = result.used - result.active;\n\t\t\t}\n\t\t\texec(\"sysctl -n vm.swapusage\", function(error, stdout) {\n\t\t\t\tif (!error) {\n\t\t\t\t\tvar lines = stdout.toString().split('\\n');\n\t\t\t\t\tif (lines.length > 0) {\n\t\t\t\t\t\tvar line = lines[0].replace(/,/g, \".\").replace(/M/g, \"\");\n\t\t\t\t\t\tline = line.trim().split(' ');\n\t\t\t\t\t\tfor (var i = 0; i < line.length; i++) {\n\t\t\t\t\t\t\tif(line[i].toLowerCase().indexOf('total') != -1) result.swaptotal = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024;\n\t\t\t\t\t\t\tif(line[i].toLowerCase().indexOf('used') != -1) result.swapused = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024;\n\t\t\t\t\t\t\tif(line[i].toLowerCase().indexOf('free') != -1) result.swapfree = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcallback(result);\n\t\t\t});\n\t\t});\n\t}\n}", "cleanMemory(pid) {\n\t\tlet self=this;\n\t\tfor(let i in window.memory) {\n\t\t\tif(window.memory[i].pid===pid&&window.memory[i].mode===self.DEFINE.MEMORY_GARBAGE) {\n\t\t\t\twindow.memory[i]={};\n\t\t\t\tdelete window.memory[i];\n\t\t\t}\n\t\t}\n\n\t}", "function LockStore(){\n this.cache = {};\n}", "flush(cb) {\n const it = this._cache.begin;\n let next = true;\n asyncLib.whilst(() => next, (done) => {\n if (it.value && it.value.modified) {\n it.value.modified = false;\n it.value.val = it.value.val.serialize();\n this._trie.put(Buffer.from(it.key, 'hex'), it.value.val, (err) => {\n if (err)\n return done(err);\n next = it.hasNext;\n it.next();\n done();\n });\n }\n else if (it.value && it.value.deleted) {\n it.value.modified = false;\n it.value.deleted = false;\n it.value.val = new ethereumjs_account_1.default().serialize();\n this._trie.del(Buffer.from(it.key, 'hex'), (err) => {\n if (err)\n return done(err);\n next = it.hasNext;\n it.next();\n done();\n });\n }\n else {\n next = it.hasNext;\n it.next();\n asyncLib.nextTick(done);\n }\n }, cb);\n }", "function Mem() {\n console.info('[Mem#constructor] Allocating memory...');\n _super.call(this);\n\n this.__storage__ = {};\n this.__length__ = 0;\n }", "snoopInvalidate(tag) {\r\n //console.log('DEBUG ' + this.name + '.snoopInvalidate(tag=' + tag + ')')\r\n let lineNum = this.lineInCache(tag)\r\n if(lineNum == null) {\r\n //console.log('DEBUG ' + this.name + ': not in this cache')\r\n } else {\r\n //console.log('DEBUG ' + this.name + ': found in this cache')\r\n //let line = this.cacheLines[lineNum]\r\n\t \r\n if(this.getState(lineNum) == States.MODIFIED) {\r\n //console.log('DEBUG ' + this.name + ': and is modified, so write back to memory')\r\n\t\tlet values = this.getValues(lineNum)\r\n this.bus.placeWriteBack(tag, this.numberOfAddressBits, values)\r\n }\r\n this.setState(lineNum, States.INVALID)\r\n }\r\n }", "__freeCachedOrders()\n{\n let arr = [];\n // remove all closed orders\n _.forEach(this.__cachedOrders.orders, function (entry, orderNumber) {\n if ('open' != entry.state)\n {\n arr.push(orderNumber);\n }\n });\n _.forEach(arr, function (orderNumber) {\n delete this.__cachedOrders[orderNumber];\n });\n this.__cachedOrders.size = Object.keys(this.__cachedOrders.orders).length;\n}", "async getMemoryInfo(){\r\n return this.call('getmemoryinfo',...(Array.from(arguments)));\r\n }", "function MemDataProvider() {\n\tthis._init();\n}", "function dump_memory(userID, channelID, message, parameter_set){\n bot.sendMessage({ to: channelID, \n message: \"Current state of `CORE_MEMORY`:\\n```\" + Memory.print_core_memory() + \"```\" \n })\n}", "function _clearMemory () {\n memory = 0;\n }", "function clearMemory() {\n Ti.API.info(\"Inside Clear Memory\");\n\n\n}", "function memoGaurd(fn){\n return function(a, b, memos){\n if (!memos) return fn(a, b, [])\n var i = memos.length, memo\n while (memo = memos[--i]) {\n if (memo[0] === a && memo[1] === b) return true\n }\n return fn(a, b, memos)\n }\n}", "function memoGaurd(fn){\n return function(a, b, memos){\n if (!memos) return fn(a, b, [])\n var i = memos.length, memo\n while (memo = memos[--i]) {\n if (memo[0] === a && memo[1] === b) return true\n }\n return fn(a, b, memos)\n }\n}", "function memoGaurd(fn){\n return function(a, b, memos){\n if (!memos) return fn(a, b, [])\n var i = memos.length, memo\n while (memo = memos[--i]) {\n if (memo[0] === a && memo[1] === b) return true\n }\n return fn(a, b, memos)\n }\n}", "function trEnCurso() {\n return clienteCache.nombre == undefined\n}", "full() {\n var rd = Atomics.load(this.read_ptr, 0);\n var wr = Atomics.load(this.write_ptr, 0);\n\n return (wr + 1) % this.capacity != rd;\n }", "_startMemoryMonitoring() {\n setTimeout(() => this._checkMemory(), this.config.memoryCheckInterval);\n }", "async cacheWhoami(){\n if(!this._whoamiCache){\n this._whoamiCache = (await this.keychain.whoami())[0]\n }\n }", "_loadMemoryPerms() {\n\t\tlet self=this;\n\t\tlet index=self.getCookie(\"OT_INDEX\");\n\t\tif(index!==null) {\n\t\t\tindex=JSON.parse(index);\n\t\t\tfor(let i in index) {\n\t\t\t\tlet perm=JSON.parse(window.atob(self.getCookie(\"OT_\"+index[i])));\n\t\t\t\twindow.memory[index[i]]=perm;\n\t\t\t}\n\t\t}\n\n\t}", "function MemoryStorage() {\nvar _store = {};\n\nthis.setMany = function(map, onSuccess, onError)\n{\nsetTimeout(function() {\ntry {\nfor ( var key in map )\n_store[key] = map[key];\nif (onSuccess) \nonSuccess();\n} catch (ex) {\n(onError || defaultErrorHandler)(ex);\n}\n}, 0);\n};\n\nthis.getMany = function(keys, onSuccess, onError)\n{\nsetTimeout(function() {\ntry {\nvar out = [];\nfor (var i = 0, l = keys.length; i < l; i++)\nout.push( _store[keys[i]] );\nif (onSuccess) \nonSuccess( out );\n} catch (ex) {\n(onError || defaultErrorHandler)(ex);\n}\n}, 0);\n};\n\nthis.unsetMany = function(keys, onSuccess, onError)\n{\nsetTimeout(function() {\ntry {\nfor (var i = 0, l = keys.length; i < l; i++)\nif (_store.hasOwnProperty(keys[i])) \ndelete _store[keys[i]];\nif (onSuccess) \nonSuccess();\n} catch (ex) {\n(onError || defaultErrorHandler)(ex);\n}\n}, 0);\n};\n\nthis.set = function(key, value, onSuccess, onError) \n{\nsetTimeout(function() {\ntry {\n_store[key] = val;\nif (onSuccess) \nonSuccess();\n} catch (ex) {\n(onError || defaultErrorHandler)(ex);\n}\n}, 0);\n};\n\nthis.get = function(key, onSuccess, onError) \n{\nsetTimeout(function() {\ntry {\nif (onSuccess) \nonSuccess( _store[key] );\n} catch (ex) {\n(onError || defaultErrorHandler)(ex);\n}\n}, 0);\n};\n\nthis.unset = function(key, onSuccess, onError) \n{\nsetTimeout(function() {\ntry {\nif (_store.hasOwnProperty(key)) \ndelete _store[key];\nif (onSuccess) \nonSuccess();\n} catch (ex) {\n(onError || defaultErrorHandler)(ex);\n}\n}, 0);\n};\n}", "function checkSendBufferCache()\n{\n var keys = GM_listValues();\n if (keys == null) return;\n\n var key = keys[0];\n for (var i=0; key != null; key=keys[i++] ) {\n\n if(key.match(/^sendBuffer:(.*?):/)) {\n var route = key.match(/^sendBuffer:(.*?):(.*?):/)[1];\n var cbString = key.match(/^sendBuffer:(.*?):(.*?):/)[2];\n console.log('sendbuffer post route:' + route);\n var postData = GM_getValue(key);\n var data = JSON.parse(postData);\n GM_deleteValue(key);\n ctxSendToServer({data:data, route:route, ondispatch:cbString});\n }\n /*\n if (key.match(/^setting:/)) {\n GM_deleteValue(key);\n }\n if (key.match(/^starMap:/)) {\n GM_deleteValue(key);\n }\n if (key.match(/^sendQ:/)) {\n GM_deleteValue(key);\n }\n */\n }\n}", "snoopInvalidate(tag) {\r\n //console.log('DEBUG ' + this.name + '.snoopInvalidate(tag=' + tag + ')')\r\n let lineNum = this.lineInCache(tag)\r\n if(lineNum == null) {\r\n //console.log('DEBUG ' + this.name + ': not in this cache')\r\n } else {\r\n //console.log('DEBUG ' + this.name + ': found in this cache')\r\n if(this.getState(lineNum) == States.MODIFIED) {\r\n\t\tlet values = this.getValues(lineNum)\r\n //console.log('DEBUG ' + this.name + ': and is modified, so write back to memory')\r\n this.bus.placeWriteBack(tag, this.numberOfAddressBits, values)\r\n }\r\n\t this.setState(lineNum, States.INVALID)\r\n }\r\n }", "snoopInvalidate(tag) {\r\n //console.log('DEBUG ' + this.name + '.snoopInvalidate(tag=' + tag + ')')\r\n let lineNum = this.lineInCache(tag)\r\n if(lineNum == null) {\r\n //console.log('DEBUG ' + this.name + ': not in this cache')\r\n } else {\r\n //console.log('DEBUG ' + this.name + ': found in this cache')\r\n if(this.getState(lineNum) == States.MODIFIED) {\r\n\t\tlet values = this.getValues(lineNum)\r\n //console.log('DEBUG ' + this.name + ': and is modified, so write back to memory')\r\n this.bus.placeWriteBack(tag, this.numberOfAddressBits, values)\r\n }\r\n\t this.setState(lineNum, States.INVALID)\r\n }\r\n }", "function messageIsCached(state, a) {\n if (!a) return false\n for (var i=0; i < state.feed.getLength(); i++) {\n var b = state.feed.get(i)\n if (util.toHexString(a.signature) == util.toHexString(b.signature)) {\n return true\n }\n }\n return false\n}", "function messageIsCached(state, a) {\n if (!a) return false\n for (var i=0; i < state.feed.getLength(); i++) {\n var b = state.feed.get(i)\n if (util.toHexString(a.signature) == util.toHexString(b.signature)) {\n return true\n }\n }\n return false\n}", "hasChanged() {\n return this.cacheHasChanged;\n }", "lastUsed() { }", "function flashSwitchStatesToTempMemory(){\n\t\tif (compMode()==\"data\"){\n\t\t\ttemp_data=[];\n\t\t\tfor(var i=0; i<=7; i++){\n\t\t\t\tif (isOn($('.switch-a'+i))){ temp_data.push(1); }\n\t\t\t\telse{ temp_data.push(0); }\n\t\t\t}\n\t\t}\n\t\telse if (compMode()==\"addr\"){\n\t\t\ttemp_addr=[];\n\t\t\tfor(var i=0; i<=15; i++){\n\t\t\t\tif (isOn($('.switch-a'+i))){ temp_addr.push(1); }\n\t\t\t\telse{ temp_addr.push(0); }\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"> temporary memory updated\");\n\t\tconsole.log(\"current computer mode : \"+compMode());\n\t\tconsole.log(\"temp memory for data : \"+tempMemStat(\"data\"));\n\t\tconsole.log(\"temp memory for addr : \"+tempMemStat(\"addr\"));\n\t\tconsole.log(\"\");\n\t}", "function Memo(el, options) {\n\tthis.ctx = jQuery(el);\n\tthis.id = this.ctx.attr(\"id\");\n\tthis.options = options;\n\tif (!(this.options && this.options.SARAImgRootPathToUse)) {\n\t\tif (!this.options) {\n\t\t\tthis.options = {};\n\t\t}\n\t\tthis.options.SARAImgRootPathToUse = SARAImgRootPath;\n\t}\n\tthis.change = false;\n\tvar self = this;\n\tthis.initialize();\n\tjQuery(window).on(\"resize\", function(e) {\n\t\tself.move();\n\t\tif (self.div) {\n\t\t\tself.div.resizable(\"option\", {\n\t\t\t\t\"maxHeight\" : jQuery(window).height() - 10,\n\t\t\t\t\"maxWidth\" : jQuery(window).width() - 10\n\t\t\t});\n\t\t}\n\t});\n\tthis.opened = false;\n\treturn this;\n}", "function checkCaches(){\n\n return getKeys(CACHE).length || getKeys(SOLVED).length;\n}", "get typeReflection() { return exists && has(WA.Memory.type); }", "function mapCacheClear(){\nthis.size=0;\nthis.__data__={\n'hash':new Hash(),\n'map':new(Map||ListCache)(),\n'string':new Hash()};\n\n}", "constructor() {\n Logger.info({\n component: 'Memcache',\n cacheHost: CACHING_MEMCACHE_HOST,\n cachePort: CACHING_MEMCACHE_PORT,\n });\n // caching in not enabled, so no memcche connection\n if (CACHING_ENABLED === 'false') {\n Logger.info({ component: 'Memcache', info: 'Cache is not enabled' });\n return;\n }\n this.memcached = new Memcached(`${CACHING_MEMCACHE_HOST}:${CACHING_MEMCACHE_PORT}`,\n { timeout: 10, reconnect: 5, minTimeout: 3, maxTimeout: 7 });\n this.cachekeys = new Set();\n // some error handling on memcache connection\n this.memcached.on('issue', (details) => {\n Logger.error('Caching failed.', {\n component: 'Memcache',\n error: `Server ${details.server} went down due to ${details.message}`,\n });\n });\n }", "function memoizedAddTo80(n){\n // in is a way to check if property exists in a object\n if (n in cache){\n return cache[n]; // It will return if the value is cached\n } else {\n console.log('long time memo')\n cache[n] = n + 80; //If the value was not cached yet it will cahce it\n return cache[n]\n }\n}", "freemem() {\n let mem;\n while ((mem = this.allocatedmem.pop())) { _free(mem); }\n return null;\n }", "function memoryCleanUp(){\n /*to be implemented*/\n}", "isDirty() {\r\n\r\n // resume\r\n return false;\r\n }", "memoFromSubtransactions() {\n\t\tthis.transaction.memo = this.transaction.subtransactions.reduce((memo, subtransaction) => `${memo}${(subtransaction.memo ? `${\"\" === memo ? \"\" : \"; \"}${subtransaction.memo}` : \"\")}`, \"\");\n\t}", "static costMatrixInMemory() {\n return this.inMemory(null, (costMatrix) => {\n return costMatrix.serialize();\n }, (costMatrix) => {\n return PathFinder.CostMatrix.deserialize(costMatrix);\n });\n }", "snoopInvalidate(tag) {\r\n //console.log('DEBUG ' + this.name + '.snoopInvalidate(tag=' + tag + ')')\r\n let lineNum = this.lineInCache(tag)\r\n if(lineNum == null) {\r\n //console.log('DEBUG ' + this.name + ': not in this cache')\r\n } else {\r\n //console.log('DEBUG ' + this.name + ': found in this cache')\r\n if(this.getState(lineNum) == States.MODIFIED) {\r\n\t\t//console.log('DEBUG ' + this.name + ': and is modified, so write back to memory')\r\n\t\tlet values = this.getValues(lineNum)\r\n this.bus.placeWriteBack(tag, this.numberOfAddressBits, values)\r\n }\r\n\t this.setState(lineNum, States.INVALID)\r\n }\r\n }", "function leak() {\n var hd = new memwatch.HeapDiff();\n /*\n bus.invoke({\n type: dbus.messageType.methodCall,\n path:'/org/freedesktop/UPower/devices/battery_BAT0',\n destination: 'org.freedesktop.UPower',\n interface: 'org.freedesktop.DBus.Introspectable',\n member: 'Introspect',\n }, function invokeCallback(err,res){\n if(err) {\n console.log(\"Error invoking:\" + err);\n }\n });\n */\n bus.listNames(function() {\n leak(); \n var diff = hd.end();\n console.log(diff);\n debugger;\n });\n}", "snoopInvalidate(tag) {\r\n //console.log('DEBUG ' + this.name + '.snoopInvalidate(tag=' + tag + ')')\r\n let lineNum = this.lineInCache(tag)\r\n if(lineNum == null) {\r\n //console.log('DEBUG ' + this.name + ': not in this cache')\r\n } else {\r\n //console.log('DEBUG ' + this.name + ': found in this cache')\r\n this.setState(lineNum, States.INVALID)\r\n }\r\n }", "function fibMemoi(num) {\n var cache = {\n 0: 0,\n 1: 1\n };\n function recurse(cacheKey) { // Don't for get to return your recursive funciton\n if(cache[cacheKey] === undefined) {\n cache[cacheKey] = recurse(cacheKey - 1) + recurse(cacheKey - 2)\n }\n return cache[cacheKey];\n }\n return recurse(num);\n}", "function test_bottleneck_datastore() {}", "mobLookup(mob) {\r\n if (this.mobsInfo.filter(mobInfo => mobInfo.name == mob).length > 0) {\r\n return true;\r\n };\r\n }", "function ms() {\n other_memory = current_input;\n console.log(other_memory);\n}", "function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{};}", "function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{};}", "function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{};}", "function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{};}", "function ms() {\n this.otherMemory = this.currentInput;\n console.log(this.otherMemory);\n}", "function getLocalCache() {\n chrome.storage.local.get(null, function(data) {\n if(data.schemaVersion != undefined) { // Check that local cache exists.\n whiteLister.whitelist = data.whitelist;\n sessionCache = data.session;\n console.log(data);\n if (data.paused === true) {\n sessionCache.global_status = \"paused\";\n chrome.storage.local.set({session: sessionCache}, function(){});\n } else {\n authTwingl.check();\n }\n } else {\n console.log(\"Nothing in local storage! Terminating extension.\")\n }\n })\n}", "validate() {\n let self = this;\n return new Promise((resolve, reject) => {\n let hash = self.hash;\n self.hash = null;\n let newHash = SHA256(JSON.stringify(self)).toString();\n self.hash = newHash;\n if (newHash === hash){\n resolve(true)\n }\n resolve(false);\n\n });\n }", "function memoization() {\n const cache = {};\n return function (n) {\n if (n in cache) {\n return cache[n];\n } else {\n console.log(\"not cached\");\n cache[n] = n * n;\n return cache[n];\n }\n };\n}", "checkpoint() {\n this._checkpoints.push(this._cache);\n }", "function hasSavedData(){\n return localStorage.hasOwnProperty(getKey());\n}", "checkAvailability() {\n var self = this;\n this.attachTimeout(new Promise((resolve) => {\n this.cache.randomkey((error) => {\n if (_.isNull(error) === false) {\n throw error;\n }\n self._isReachable = true;\n resolve(true);\n });\n }));\n }", "function checkss(){\n if (memory.length>1){\n if(/\\+|\\-/.test(memory.join())){\n sumres();\n checkss();\n }\n }\n }", "empty() { return this.m == 0; }", "function resetMemory(){\n\tRawMemory.set('{}');\n\tMemory.creeps = {};\n\tMemory.rooms = {};\n\tMemory.flags = {};\n\tMemory.spawns = {};\n}", "isEmpty() {\n return !this.heapContainer.length;\n }", "function n(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "function n(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "function vacia(){\n\n\t\treturn this.dataStore.length==0;\n\n\t}" ]
[ "0.5699145", "0.5545837", "0.5447439", "0.5341812", "0.5335568", "0.5317372", "0.52469426", "0.52469426", "0.52372336", "0.5208976", "0.5191871", "0.51397777", "0.5087608", "0.50810736", "0.50424266", "0.4998561", "0.49763298", "0.49688148", "0.49621877", "0.4949243", "0.4936097", "0.4901696", "0.49012485", "0.48808283", "0.48791516", "0.48621315", "0.48531517", "0.48531517", "0.48531517", "0.48499882", "0.48412043", "0.48374653", "0.48298934", "0.4822547", "0.48131976", "0.48125517", "0.4798326", "0.47911558", "0.47910354", "0.47848493", "0.47760075", "0.47746485", "0.47717488", "0.4766147", "0.47614604", "0.47612008", "0.4760936", "0.47568092", "0.47565356", "0.47565356", "0.47565356", "0.4753559", "0.4747486", "0.47462592", "0.47449833", "0.47420236", "0.4718851", "0.47090387", "0.47086442", "0.47086442", "0.4705918", "0.4705918", "0.47038323", "0.4700545", "0.46901825", "0.46875703", "0.46805397", "0.4674349", "0.4672746", "0.4667914", "0.46673802", "0.4664945", "0.46630585", "0.46618673", "0.46516162", "0.46443623", "0.46413022", "0.46381825", "0.46378946", "0.46175817", "0.46140027", "0.45954692", "0.4595214", "0.45933518", "0.45933518", "0.45933518", "0.45933518", "0.45927122", "0.45915705", "0.45850512", "0.45756117", "0.45731962", "0.4572358", "0.4568536", "0.45650226", "0.4564711", "0.4559852", "0.45508265", "0.4546673", "0.4546673", "0.4545106" ]
0.0
-1
Esta funcion se usa para ver la Memo en la consulta de memos
function verMemo2(nroMemo, nameArchivo) { var URL = getUrlApp() + "/DownloadServlet?tipo=VER_MEMO_2&nroMemo=" + nroMemo + "&nameArchivo=" + nameArchivo + TAB_ID_REQUEST; /* window.status = URL; var w = window.open(URL,"Memo","width=" + ancho + ",height=" + alto + ",top=" + posX + ",left=" + posY + ",scrollbars=YES,resizable=YES"); w.focus(); */ var anchorDownloader = new Element('a', { href: URL, download: 'true' }).setStyle('visibility', 'hidden').inject(document.body); anchorDownloader.click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isInMemory(newState){\n\t var flag= false;\n\t for(mem in memory){\n\t\t if(memory[mem].stateEquals(newState)){\n\t\t\t flag = true;\n\t\t\t break;\n\t\t }\n\t }\n\t return flag;\n}", "mobLookup(mob) {\r\n if (this.mobsInfo.filter(mobInfo => mobInfo.name == mob).length > 0) {\r\n return true;\r\n };\r\n }", "cachedCheck(document) {\n const cacheResult = this.cache.get(document);\n if (cacheResult) {\n return cacheResult;\n }\n const result = this.check(document);\n this.cache.set(document, result);\n return result;\n }", "function getMembresias(req, res){\n\tMembresia.find({}, (err, Membresias) => {\n \tif (err) return res.status(500).send({message: `Error al realizar la petición: ${err}`})\n \tif (!Membresias) return res.status(404).send({message: 'No existen Membresias'})\n\n \tres.send(200, { Membresias })\n\t})\n}", "function sc_memv(o, l) {\n while (l !== null) {\n\tif (l.car === o)\n\t return l;\n\tl = l.cdr;\n }\n return false;\n}", "function readMemCache(ref) {\n if (!memCache[ref]) return;\n var age = Date.now() - memCache[ref].timestamp;\n if (age < ttl) return memCache[ref].hash;\n return;\n }", "_updateMemo(validTeam) {\n for (let pairIdx = 0; pairIdx < validTeam.length; ++pairIdx) {\n let p1Idx = this.players.indexOf(validTeam[pairIdx].value[0]);\n let p2Idx = this.players.indexOf(validTeam[pairIdx].value[1]);\n this.memo[p1Idx][p2Idx] = 1;\n this.memo[p2Idx][p1Idx] = 1;\n }\n }", "function verifyData(){\n getDatas();\n}", "function instateMemory(bitView) {\n\tmem = window.mem;\n\tmem.currBitView = bitView;\n\tvar d = document.getElementById(\"data\");\t//d has first and only child tbody\n\n\td.children[0].remove();\n\td.appendChild(document.createElement(\"tbody\"));\n\td = d.children[0];\t\t\t\t\t\t\t\t\t//d is tbody\n\n\td.appendChild(createMemoryComponent());\n\n\tvar w = 0;\n\tvar oflow = d.children[0];\t//first tr\n\toflow = oflow.children[1];\t//second column\n\toflow = oflow.children[0];\t//the div of memory data\n\toflow.style.width = oflow.clientWidth;\n\toflow.innerHTML = \"\";\n\n\tswitch(bitView) {\t\t\t\t//select widest character to check overflow\n\t\tcase 1:\n\t\t\tchecker = \"00000000\";\n\t\t\tbreak;\n\n\t\tcase 8:\n\t\t\tchecker = \"WWWWWWWW\";\n\t\t\tbreak;\n\t}\n\t\n\twhile(oflow.offsetWidth >= oflow.scrollWidth && oflow.clientHeight >= oflow.scrollHeight) {\t//detect overflow\n\t\tconsole.log(oflow.offsetWidth + \" \" + oflow.scrollWidth + \" \" + oflow.clientHeight + \" \" + oflow.scrollHeight)\n\t\toflow.innerHTML += checker + \"<pre> </pre>\";\n\t\tw += 10;\n\t\tconsole.log(w)\n\t}\n\t\n\tmem.width = w - 12;\n\tconsole.log(mem.width)\n\td.children[0].remove();\t\t//remove the first tr\n\n\t//start filling memory tables with known width\n\tvar r = 0;\n\tfor(var i = 0 ; i < mem.size ; i++) {\n\t\td.appendChild(createMemoryComponent());\n\t\td.children[r].children[0].innerHTML = i + \"\";\t\t\t//set byte address\n\t\td.children[r].children[0].id = \"a\" + i;\n\t\td.children[r].children[1].id = \"b\" + i;\n\t\tvar memdiv = d.children[r++].children[1].children[0];\t//the div for the data\n\t\tmemdiv.style.width = memdiv.clientWidth;\n\t\tvar s = \"\";\n\n\t\tfor(var j = 1 ; j <= mem.width && i < mem.size; j++) {\n\t\t\tvar num = \"\";\n\t\t\tvar ch = false;\n\t\t\tfor(var k = 0 ; k < bitView && i < mem.size ; k++) {\t\t\t//grab 'bitView' no of bits\n\t\t\t\tnum += Number(Boolean(mem[i++]));\n\t\t\t\tch = ch || Boolean(mem.changed[i-1]);\n\t\t\t}\n\n\t\t\tswitch(bitView) {\t\t//character-ify the data\n\t\t\t\tcase 8:\n\t\t\t\t\tnum = parseInt(num, 2);\n\t\t\t\t\tnum = String.fromCharCode(num);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif(ch)\n\t\t\t\ts += \"<span class='changed'>\" + num + \"</span>\";\n\t\t\telse\n\t\t\t\ts += num;\n\n\t\t\tif(j % 10 == 8) {\n\t\t\t\ts += \"<pre> </pre>\";\n\t\t\t\tj += 2;\n\t\t\t}\n\t\t}\n\n\t\tmemdiv.innerHTML = s;\n\t\ti--;\n\t}\n}", "function getMembresia(req, res){\n\tlet MembresiaId = req.params.MembresiaId\n\n\tMembresia.findById(MembresiaId, (err, Membresia) => {\n \t\tif (err) return res.status(500).send({message: `Error al realizar la petición: ${err}`})\n \tif (!Membresia) return res.status(404).send({message: `El Membresia no existe`})\n\n \tres.status(200).send({ Membresia })\n\t})\n}", "function comprobarExistenciaTablaPuertasItemsMecanicos(){\n var numeroFilas = 0;\n db.transaction(function (tx) {\n var query = \"SELECT COUNT(*) AS c FROM puertas_items_mecanicos\";\n tx.executeSql(query, [], function (tx, resultSet) {\n console.log('Numero de filas tabla puertas_items_mecanicos -> '+resultSet.rows.item(0).c);\n numeroFilas = resultSet.rows.item(0).c;\n if (numeroFilas > 0) {\n //alert(\"Ya existe la tabla puertas_items_mecanicos!\");\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n /* Funciones que se ejecutan sino existe la tabla */\n llenarTablaPuertasItemsMecanicos();\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function tempMemStat(mem){\n\t\tvar stats = \"\";\n\t\tif (mem==\"data\"){\n\t\t\tif (temp_data && temp_data.length > 0){\n\t\t\t\tfor(var i=0; i<=7; i++){\n\t\t\t\t\tstats = temp_data[i]+\" \"+stats;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{ stats = \"Not Set\"; }\t\n\t\t}\n\t\telse if (mem==\"addr\"){\n\t\t\tif (temp_addr && temp_addr.length > 0){\n\t\t\t\tfor(var i=0; i<=15; i++){\n\t\t\t\t\tstats = temp_addr[i]+\" \"+stats;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{ stats = \"Not Set\"; }\n\t\t}\n\t\treturn stats;\n\t}", "async function calcMem(saveflag = false){\n\n blxDataMem = {total:0, incnew:0, max:-1, mode:-1}\n\n let v_data_idx = findFileInDir('data.edt') // might set blxErrMsg\n let v_data_old_idx = findFileInDir('data.edt.old') // might set blxErrMsg\n await blStore.get(blxIDs.deviceMAC + '_data.edt.old')\n let KeyVal_data_old = blStore.result() // undefined opt.\n await blStore.get(blxIDs.deviceMAC + '_data.edt')\n let KeyVal_data = blStore.result() // undefined opt.\n\n if(blxIDs.iparam !== undefined){ // Par. [12] iparam.flags 0: Record OFF, Bit 1:Measure, Bit 2: Ring\n blxDataMem.mode = parseInt(blxIDs.iparam[12]) // flags is at [12]\n if(blxDataMem.mode&2){ // Ring Mode\n if(blxIDs.sys_param!=undefined){\n blxDataMem.max = parseInt(blxIDs.sys_param[17])*2 // maxmem is at [17]\n }\n }else{ // Linear Mode\n blxDataMem.max = blxIDs.disk.diskSize - 102400 // 25 Sect. for System\n }\n }\n \n // Wenn v.data.edt.old == DB.data.edt dann shiften\n if(v_data_old_idx >= 0){ // Auf Device gibt es data.edt.old\n if (KeyVal_data != undefined ){ // und im Store data.edt\n if(blxIDs.disk.files[v_data_old_idx].date.getTime() === KeyVal_data.v.ctime.getTime()){\n // Zeiten sind gleich, also shiften, mgl. fehlt ein Teil von old, neu in jedem Fall dann ganz\n KeyVal_data_old = KeyVal_data\n KeyVal_data_old.k = blxIDs.deviceMAC + '_data.edt.old'\n KeyVal_data = undefined\n console.log(\"Shift 'data.edt'->'data.edt.old'\")\n if(saveflag === true){ // Merken der geshifteten Werte in DB\n try{\n await blStore.remove(blxIDs.deviceMAC + '_data.edt')\n await blStore.set(KeyVal_data_old.k, KeyVal_data_old.v)\n } catch (err) {\n blxErrMsg = 'ERROR(Store): ' + err\n return\n }\n }\n }\n }\n }\n\n // Es gibt eine OLD im DB, aber keine oder keine passende OLD im V\n if( (KeyVal_data_old != undefined) && ((v_data_old_idx < 0) || (blxIDs.disk.files[v_data_old_idx].date.getTime() !== KeyVal_data_old.v.ctime.getTime()))){\n v_data_old_idx = -1\n KeyVal_data_old = undefined\n if(saveflag === true){\n try{\n await blStore.remove(blxIDs.deviceMAC + '_data.edt.old')\n } catch (err) {\n blxErrMsg = 'ERROR(Store): ' + err\n return\n }\n }\n }\n // Dto fuer neu\n if( (KeyVal_data != undefined) && ((v_data_idx < 0) || (blxIDs.disk.files[v_data_idx].date.getTime() !== KeyVal_data.v.ctime.getTime()))){\n KeyVal_data = undefined\n if(saveflag === true){\n try{\n await blStore.remove(blxIDs.deviceMAC + '_data.edt')\n } catch (err) {\n blxErrMsg = 'ERROR(Store): ' + err\n return\n }\n }\n }\n\n if(v_data_idx>=0){\n blxDataMem.total += blxIDs.disk.files[v_data_idx].len\n }\n if(v_data_old_idx >=0){\n blxDataMem.total += blxIDs.disk.files[v_data_old_idx].len\n }\n blxDataMem.incnew = blxDataMem.total\n // Nun noch testen was vorhanden ist\n if(KeyVal_data != undefined){\n blxDataMem.incnew -= KeyVal_data.v.akt_len\n }\n if(KeyVal_data_old != undefined){\n blxDataMem.incnew -= KeyVal_data_old.v.akt_len\n }\n\n blxErrMsg = 0\n }", "function checkss(){\n if (memory.length>1){\n if(/\\+|\\-/.test(memory.join())){\n sumres();\n checkss();\n }\n }\n }", "managerExists(company, mng_id){\n let flag = false;\n let allEmployees = companydata.getAllEmployee(company);\n allEmployees.forEach(employee => {\n if (mng_id == employee.emp_id) {\n flag = true;\n }\n });\n return flag;\n }", "function check(){\n\tvar database=sessionStorage.getItem(\"database\");\n\tvar open=window.indexedDB.open(database);\n\topen.onsuccess=function()\n\t{\n\t\tvar result=this.result;\n\t\tvar per=result.transaction(\"admission\",\"readwrite\");\n\t\tvar access=per.objectStore(\"admission\");\n\t\tvar key=access.getAllKeys();\n\t\tkey.onsuccess=function()\n\t\t{\n\t\t\tvar obj=this.result;\n\t\t\tvar i,x,y=0;\n\t\t\tfor(i=0;i<obj.length;i++)\n\t\t\t{\n\t\t\t\tx=Number(obj[i]);\n\t\t\t\tif(x>y)\n\t\t\t\t{\n\t\t\t\t\ty=x;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$(\".account\").html(\"Account-No:\"+(y+1));\n\t\t\tsessionStorage.setItem(\"account\",y);\n\t\t}\n\t}\n}", "function trEnCurso() {\n return clienteCache.nombre == undefined\n}", "function vacia(){\n\n\t\treturn this.dataStore.length==0;\n\n\t}", "function comprobarExistenciaTablaPuertasItemsMotorizacion(){\n var numeroFilas = 0;\n db.transaction(function (tx) {\n var query = \"SELECT COUNT(*) AS c FROM puertas_items_motorizacion\";\n tx.executeSql(query, [], function (tx, resultSet) {\n console.log('Numero de filas tabla puertas_items_motorizacion -> '+resultSet.rows.item(0).c);\n numeroFilas = resultSet.rows.item(0).c;\n if (numeroFilas > 0) {\n //alert(\"Ya existe la tabla puertas_items_motorizacion!\");\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n /* Funciones que se ejecutan sino existe la tabla */\n llenarTablaPuertasItemsMotorizacion();\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "isUnique(emailOrmobile) {\n return new Promise((resolve, reject) => {\n let sql = sqlObj.otp.isExist;\n let sqlQuery = format(sql, emailOrmobile);\n\n db.doRead(sqlQuery).then(result => {\n resolve(result);\n })\n .catch(err => {\n reject(new Error(err));\n })\n })\n }", "function test_bottleneck_datastore() {}", "async validar(){\n var exist=false;\n await this.state.casa.forEach((c)=>{\n if(c.numero===this.numero && c.index===this.index){\n exist=true;\n }\n });\n await this.state.pichon.forEach((c)=>{\n if(c.numero===this.numero && c.index===this.index){\n exist=true;\n }\n });\n return exist;\n }", "function MemDataProvider() {\n\tthis._init();\n}", "function checkDatabase() {\n // Open the \"pending\" transactions\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n // Set the store\n const store = transaction.objectStore(\"pending\");\n // get all records from store and set to getAllOffline\n const getAllOffline = store.getAll();\n\n getAllOffline.onsuccess = function () {\n // If statment to make sure there is something in the list\n if (getAllOffline.result.length > 0) {\n // Fetch POST request to send the data to the bulk fetch request\n fetch(\"/api/transaction/bulk\", {\n method: \"POST\",\n body: JSON.stringify(getAllOffline.result),\n headers: {\n Accept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\"\n }\n })\n // Json the response\n .then(response => response.json())\n .then(() => {\n // if successful, open the \"pending\" transactions\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n // Set the store\n const store = transaction.objectStore(\"pending\");\n // Clear out the store\n store.clear();\n });\n }\n };\n}", "async function querySummary(obj) {\n return await modelInfoSummary.\n findAll({\n where: {\n ssn: obj.ssn,\n recordDt: obj.date\n }\n }).then(async res => {\n if (res.length == 1) {//exist in table\n }\n if (res.length == 0) {//not exist in table\n let data = mapToArraySummary(obj.ssn, obj.date, '', 'auto_insert');//map to array obj\n await createSummaryCheck(data)\n }\n // return data;\n })\n}", "async function validateCounter () {\n\n const count = await Counter.find();\n \n //Si no existe, no es un arreglo o esta vacio\n if ( !Array.isArray(count) || !count.length){\n //appDebuger(\"El contador esta Vacio \" + count);\n let createCount = new Counter({\n count: 1\n });\n createCount = createCount.save(); \n return false;\n }\n else{\n return true;\n }\n \n}", "function checkMem() {\n // see: https://github.com/WebAssembly/design/issues/1210\n if (buffer !== memory.buffer) {\n buffer = memory.buffer;\n I8 = new Int8Array(buffer);\n U8 = new Uint8Array(buffer);\n I16 = new Int16Array(buffer);\n U16 = new Uint16Array(buffer);\n I32 = new Int32Array(buffer);\n U32 = new Uint32Array(buffer);\n if (hasBigInt64) {\n I64 = new BigInt64Array(buffer);\n U64 = new BigUint64Array(buffer);\n }\n F32 = new Float32Array(buffer);\n F64 = new Float64Array(buffer);\n }\n }", "function comprobarExistenciaTablaPuertasItemsManiobras(){\n var numeroFilas = 0;\n db.transaction(function (tx) {\n var query = \"SELECT COUNT(*) AS c FROM puertas_items_maniobras\";\n tx.executeSql(query, [], function (tx, resultSet) {\n console.log('Numero de filas tabla puertas_items_maniobras -> '+resultSet.rows.item(0).c);\n numeroFilas = resultSet.rows.item(0).c;\n if (numeroFilas > 0) {\n //alert(\"Ya existe la tabla puertas_items_maniobras!\");\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n /* Funciones que se ejecutan sino existe la tabla */\n llenarTablaPuertasItemsManiobras();\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function comprobarExistenciaTablaAscensorItemsMaquinas(){\n var numeroFilas = 0;\n db.transaction(function (tx) {\n var query = \"SELECT COUNT(*) AS c FROM ascensor_items_maquinas\";\n tx.executeSql(query, [], function (tx, resultSet) {\n console.log('Numero de filas tabla ascensor_items_maquinas -> '+resultSet.rows.item(0).c);\n numeroFilas = resultSet.rows.item(0).c;\n if (numeroFilas > 0) {\n //alert(\"Ya existe la tabla ascensor_items_maquinas!\");\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n /* Funciones que se ejecutan sino existe la tabla */\n llenarTablaAscensorItemsMaquinas();\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function hasMutation(matriz) { // este debe de ir porque es un requerimiento, viene n las instrucciones\n // bandera que validara si detecta mutacion\n let flag = true;\n // Recorremos el arreglo de manera horizontal\n matriz.forEach(adn => {\n // aqui validamos la cadena y guardamos el resultado en el modelo \n flag = this.validateADN(adn); // si en algun momento regresa una cadena incorrecta regresara false\n console.log(adn);\n console.log(flag);\n });\n\n let vertical = this.getVert(matriz);\n vertical.forEach(adn => {\n // aqui validamos la cadena y guardamos el resultado en el modelo \n flag = this.validateADN(adn); // si en algun momento regresa una cadena incorrecta regresara false\n console.log(adn);\n console.log(flag);\n });\n return flag;\n}", "async getMemoryInfo(){\r\n return this.call('getmemoryinfo',...(Array.from(arguments)));\r\n }", "function getMemInfo(gopher) {\n const reminderCount = gopher.webhook.getTaskData(\"mem.reminder_num\", 1);\n const frequencyPref = gopher.webhook.getTaskData(\n \"mem.frequency_pref\",\n memConfig.defaultFrequencyPref\n );\n return { reminderCount, frequencyPref };\n }", "function comprobarExistenciaTablaAscensorItemsCabina(){\n var numeroFilas = 0;\n db.transaction(function (tx) {\n var query = \"SELECT COUNT(*) AS c FROM ascensor_items_cabina\";\n tx.executeSql(query, [], function (tx, resultSet) {\n console.log('Numero de filas tabla ascensor_items_cabina -> '+resultSet.rows.item(0).c);\n numeroFilas = resultSet.rows.item(0).c;\n if (numeroFilas > 0) {\n //alert(\"Ya existe la tabla ascensor_items_cabina!\");\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n /* Funciones que se ejecutan sino existe la tabla // Aparece la ventana de carga */\n probar_conexion_red();\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function checkCaches(){\n\n return getKeys(CACHE).length || getKeys(SOLVED).length;\n}", "'reset'() {\n this.freemem();\n return (sqlite3_clear_bindings(this.stmt) === SQLite.OK) &&\n (sqlite3_reset(this.stmt) === SQLite.OK);\n }", "function comprobarExistenciaTablaAscensorItemsPozo(){\n var numeroFilas = 0;\n db.transaction(function (tx) {\n var query = \"SELECT COUNT(*) AS c FROM ascensor_items_pozo\";\n tx.executeSql(query, [], function (tx, resultSet) {\n console.log('Numero de filas tabla ascensor_items_pozo -> '+resultSet.rows.item(0).c);\n numeroFilas = resultSet.rows.item(0).c;\n if (numeroFilas > 0) {\n //alert(\"Ya existe la tabla ascensor_items_pozo!\");\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n /* Funciones que se ejecutan sino existe la tabla */\n llenarTablaAscensorItemsPozo();\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function checkObjetivo () {\n\t\n\tif (fases[nDaFase].produtosC.length != 0) {\n\t\t//produto determinado\n\t\t/*for (var i = 0; i < fases[nDaFase].produtosC.length; i++) {\n\t\t\tfor (var j = 0; j < carArray.length; j++) {\n\t\t\t\tif(fases[nDaFase].produtosC[i].nome == carArray[j].nome && fases[nDaFase].produtosC[i].qtdP == carArray[j].qtd){\n\t\t\t\t\tfalhouObj = false;*/\n\t\t\t\t\t/*$(\"#cate4\").fadeIn();\n\n\t\t\t\t\tif (!fezUmaVez) {\n\t\t\t\t\t\tfezUmaVez = true;\n\t\t\t\t\t\tvar tempPontos = localStorage.getItem('pontos');\n\t\t\t\t\t\ttempPontos = 200+Number(tempPontos);\n\t\t\t\t\t\tlocalStorage.setItem(\"pontos\", tempPontos);\n\n\t\t\t\t\t\tchamaBoxA(200);\n\t\t\t\t\t}*/\n\n\t\t\t\t/*}else{\n\t\t\t\t\tfalhouObj = true;\n\t\t\t\t\t//$(\"#cate4\").fadeOut();\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\t\tvar contCriterio = 0;\n\t\tfor (var i = 0; i < fases[nDaFase].produtosC.length; i++) {\n\t\t\tfor (var j = 0; j < carArray.length; j++) {\n\t\t\t\tif(fases[nDaFase].produtosC[i].nome == carArray[j].nome && fases[nDaFase].produtosC[i].qtdP == carArray[j].qtd){\n\t\t\t\t\tcontCriterio++;\n\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/*var tempCarNome = new Array();\n\t\tvar tempCarQtd = new Array();\n\n\t\tfor (var j = 0; j < carArray.length; j++) {\n\t\t\ttempCarNome += carArray[j].nome;\n\t\t\ttempCarQtd += carArray[j].qtd;\n\t\t}\n\n\t\tvar contCriterio = 0;\n\t\tfor (var i = 0; i < fases[nDaFase].produtosC.length; i++) {\n\t\t\t\n\t\t\tif(tempCarNome.indexOf(fases[nDaFase].produtosC[i].nome)>=0 && tempCarQtd.indexOf(fases[nDaFase].produtosC[i].qtdP)>=0){\n\t\t\t\t\n\t\t\t\tcontCriterio++;\n\t\t\t}else{\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}*/\n\n\t\tif (contCriterio == fases[nDaFase].produtosC.length) {\n\t\t\tfalhouObj = false;\n\t\t\t/*$(\"#cate4\").fadeIn();\n\n\t\t\tif (!fezUmaVez) {\n\t\t\t\tfezUmaVez = true;\n\t\t\t\tvar tempPontos = localStorage.getItem('pontos');\n\t\t\t\ttempPontos = 200+Number(tempPontos);\n\t\t\t\tlocalStorage.setItem(\"pontos\", tempPontos);\n\n\t\t\t\tchamaBoxA(200);\n\t\t\t}*/\n\n\t\t}else{\n\t\t\tfalhouObj = true;\n\t\t}\n\n\t}else{\n\t\t//por categoria\t\t\n\t\t\n\t\tfor (var i = 0; i < fases[nDaFase].qualSessao.length; i++) {\n\t\t\tfor (var j = 0; j < carArray.length; j++) {\n\n\t\t\t\tif (carArray[j].sessao.indexOf(fases[nDaFase].qualSessao[i])<0){\n\t\t\t\t\tfalhouObj = true;\n\t\t\t\t\t//$(\"#cate4\").fadeOut();\n\t\t\t\t}else{\n\t\t\t\t\tfalhouObj = false;\n\t\t\t\t\t/*$(\"#cate4\").fadeIn();\n\n\t\t\t\t\tif (!fezUmaVez) {\n\t\t\t\t\t\tfezUmaVez = true;\n\t\t\t\t\t\tvar tempPontos = localStorage.getItem('pontos');\n\t\t\t\t\t\ttempPontos = 200+Number(tempPontos);\n\t\t\t\t\t\tlocalStorage.setItem(\"pontos\", tempPontos);\n\n\t\t\t\t\t\tchamaBoxA(200);\n\t\t\t\t\t}*/\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\t\n\t}\n\n\tif (carArray.length <= 0) {\n\t\tfalhouObj = true;\n\t\t$(\"#cate4\").fadeOut();\n\t}\n\n\tif (falhouObj) {\n\t\t$(\"#cate4\").fadeOut();\n\t}else{\n\t\t$(\"#cate4\").fadeIn();\n\n\t\tif (!fezUmaVez) {\n\t\t\tfezUmaVez = true;\n\t\t\ttempPontos = localStorage.getItem('pontos');\n\t\t\ttempPontos = 200+Number(tempPontos);\n\t\t\t//localStorage.setItem(\"pontos\", tempPontos);\n\n\t\t\tchamaBoxA(200);\n\t\t}\n\n\t\t$(\"#BoxMsgCaixa\").fadeIn(function(){\n\t\t\tsetTimeout(function(){\n\t\t\t\t$(\"#BoxMsgCaixa\").fadeOut();\n\t\t\t},4000);\n\t\t});\n\t}\t\n\n\tconsole.log(\"Falhou o bjetivo? \"+falhouObj);\n}", "function cacheToMemory(){\n // need to implement\n}", "function Memory(){\n this.data = {};\n }", "function Memory(){\n this.data = {};\n }", "function filtrarMarca( auto){\n const {marca } = datosBusqueda;\n if ( marca ){\n console.log('marca:',marca)\n return auto.marca === marca;\n\n }else {\n return auto;\n }\n\n\n\n}", "function checkDirtyObj() {\n const odd = []\n for (const key in dirtyPileObj) {\n if(dirtyPileObj[key] > 0 ) {\n odd.push(key)\n }\n }\n\n return odd.length > 0\n }", "empty() { return this.m == 0; }", "function check(){\n transID = genarateTransactionId();\n conn.query('SELECT transaction_id FROM transaction WHERE transaction_id = '+ transID,function(err,result){\n if(result.length != 0){\n check();\n }\n });\n}", "verifyRequest(address) {\n if (address in this.mempoolValid) {\n let isValid = this.mempoolValid[address].registerStar;\n return isValid;\n } else if (address in this.mempool) {\n // Thow rather than return\n throw 'Request not validated';\n } else {\n // Thow rather than return\n throw 'Request does not exist';\n }\n }", "contains(obj)\r\n {\r\n var list, k = size;\r\n for (var i = 0; i < k; i++)\r\n {\r\n list = this.#table[i];\r\n var l = list.length; \r\n \r\n for (var j = 0; j < l; j++)\r\n if (list[j].data === obj) return true;\r\n }\r\n return false;\r\n }", "updateData() {\n let qs = this.getQuerySet(this.view, this.qs_url);\n let new_qs = this.getQuerySet(this.view, this.qs_url).clone();\n\n return new_qs.get().then(instance => {\n if(qs.cache.getPkValue() == instance.getPkValue()) {\n for(let key in instance.data) {\n if(!deepEqual(instance.data[key], qs.cache.data[key])) {\n qs.cache.data[key] = instance.data[key];\n }\n }\n qs.cache.data = { ...qs.cache.data };\n\n }\n\n return true;\n }).catch(error => {\n debugger;\n });\n }", "function test_existanceMemoire_technique (item,suppression)\n { \n if (suppression!=1)\n {\n var mem = vm.allmemoire_technique.filter(function(obj)\n {\n return obj.id == currentItemMemoire_technique.id;\n });\n if(mem[0])\n {\n if((mem[0].description != currentItemMemoire_technique.description )\n //||(mem[0].fichier != currentItemMemoire_technique.fichier )\n ||(mem[0].date_livraison != currentItemMemoire_technique.date_livraison )\n ||(mem[0].date_approbation != currentItemMemoire_technique.date_approbation )\n ||(mem[0].observation != currentItemMemoire_technique.observation )) \n { \n insert_in_baseMemoire_technique(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseMemoire_technique(item,suppression);\n }", "function test_existanceMemoire_technique (item,suppression)\n { \n if (suppression!=1)\n {\n var mem = vm.allmemoire_technique.filter(function(obj)\n {\n return obj.id == currentItemMemoire_technique.id;\n });\n if(mem[0])\n {\n if((mem[0].description != currentItemMemoire_technique.description )\n //||(mem[0].fichier != currentItemMemoire_technique.fichier )\n ||(mem[0].date_livraison != currentItemMemoire_technique.date_livraison )\n ||(mem[0].date_approbation != currentItemMemoire_technique.date_approbation )\n ||(mem[0].observation != currentItemMemoire_technique.observation )) \n { \n insert_in_baseMemoire_technique(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseMemoire_technique(item,suppression);\n }", "getMeterData(telegram) {\n let buffer = this.getAddressField(telegram);\n if (!buffer)\n return false;\n\n let meterAddress = buffer.toString('hex');\n\n return this._meterData.has(meterAddress) ?\n this._meterData.get(meterAddress) : false;\n }", "async cacheCheck(matchingResults, params, callback) {\n var qType = params.query.type;\n \n // matchingResults is an array\n if (matchingResults.length > 0) {\n var timeDiff = Date.now() - matchingResults[0].timestamp\n console.log(`${qType} data cache in DB is about ${Math.trunc(timeDiff / 1000 / 60)} minutes old (cache timestamp=${matchingResults[0].timestamp}).`)\n\n if (timeDiff < this.cacheLifetimeInMs) {\n // The data is recent. Use it\n\n console.log(`Cached ${qType} data will be returned`)\n callback(matchingResults[0].data)\n return\n }\n }\n\n // The data is not recent or doesn't even exist\n var newData = await this.scrape(params)\n var ts = Date.now()\n if (matchingResults.length > 0) {\n // Data already exists for params.query.type, so send an update\n this.db.updateTable('cache', {queryType: {$eq: `${qType}`}}, {queryType: `${qType}`, timestamp: ts, data: newData}, r => console.log(`Updated new ${qType} data at time=${ts}`))\n }\n else {\n // Data doesn't exist for params.query.type, so send an insert\n this.db.saveToTable('cache', [{queryType: `${qType}`, timestamp: ts, data: newData}], r => console.log(`Inserted new ${qType} data at time=${ts}`))\n }\n console.log(`New ${qType} data will be returned`)\n callback(newData)\n }", "function getDataFromMemory( gm_ck_name, key, clearOldData ) {\n\ttry {\n\t\t//flag ( \"getDataFromMemory():: Started! gm_ck_name: \" + gm_ck_name + \", key: \" + key );\n\n\t\tif ( key == \"\" || key == null || key == undefined )\n\t\t\tthrowLogicError ( \"getDataFromMemory():: Improper key for \" + gm_ck_name + \" !!\" );\n\n\t\tif ( clearOldData == \"\" || clearOldData == null || clearOldData == undefined )\n\t\t\tclearOldData = false;\n\n\t\t// get the cookie data\n\t\tvar gmMemory = GM_getValue ( currentServer() + \"_\" + gm_ck_name, \"\" );\n\t\tif ( gmMemory == \"\" )\n\t\t\treturn false;\n\t\ttry {\n\t\t\tgmMemory = JSON.parse(gmMemory);\n\t\t} \n\t\tcatch ( e ) {\n\t\t\tgmMemory = eval( \"(\" + gmMemory + \")\" );\n\t\t}\n\n\t\t// remove all old data.\n\t\tif ( clearOldData ) {\n\t\t\tfor ( var ikey in gmMemory ) {\n\t\t\t\tvar mydata = gmMemory [ ikey ];\n\t\t\t\tif ( !mydata.time || mydata.time < ( new Date().getTime() - dataStoreDuration ) ) { // if data is old\n\t\t\t\t\tdelete gmMemory [ ikey ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// find relevant data\n\t\tvar returnValue = false;\n\t\tvar mydata = gmMemory [ key ];\n\t\tif ( mydata && mydata.key && mydata.key == key ) {\n\t\t\treturnValue = mydata.text;\n\t\t\t//flag ( \"getDataFromMemory():: Data found in memory!\" );\n\t\t}\n\t\telse {\n\t\t\t//flag ( \"getDataFromMemory():: Data not found in memory!\" );\n\t\t}\n\n\t\t// store back the cookie data\n\t\ttry {\n\t\t\tGM_setValue ( currentServer() + \"_\" + gm_ck_name, JSON.stringify(gmMemory) );\n\t\t}\n\t\tcatch (e){\n\t\t\tGM_setValue ( currentServer() + \"_\" + gm_ck_name, uneval(gmMemory) );\n\t\t}\n\n\t\treturn returnValue;\n\t}\n\tcatch ( err ) {\n\t\tprintStackTrace();\n\t\tvar msg = \"getDataFromMemory():: Something went wrong, error: \" + err.name + \", Error Message: \" + err.message;\n\t\tplaySound ( msg );\n\t\tprintErrorMSG(msg);\n\t\tthrow err;\n\t}\n}", "function existsData() {\n\tvar pin = \"\";\n\tvar query = \"SELECT * FROM \" + TABLE_URL+\" WHERE \"+KEY_USE+\"='1'\";\n\ttry {\n\t\tlocalDB.transaction(function (transaction) {\n\t\t\ttransaction.executeSql(query, [], function (transaction, results) {\n\t\t\t\tif(results.rows.length==1){\n\t\t\t\t\tpin= results.rows.item(0).pin;\n\t\t\t\t\tif (pin==\"\") {\n\t\t\t\t\t\twindow.location.href= \"login.html\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\twindow.location.href= \"menu.html\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}, function (transaction, error) {\n\t\t\t\tconsole.log(\"Error: \" + error.code + \"<br>Mensage: \" + error.message);\n\t\t\t});\n\t\t});\n\t} catch (e) {\n\t\tconsole.log(\"Error existsData \" + e + \".\");\n\t}\n}", "function checkToken(token)\n{\n //We check if the token is in the database\n db.all(\"SELECT id_utilisateur FROM Utilisateur WHERE token='\"+token+\"'\",function(err,rows){\n console.log(rows);\n if(rows === undefined || rows.length === 0)\n {\n //The token is not in the database\n console.log(\"1\");\n return false;\n }\n else {\n //The token is in the database\n console.log(\"2\");\n return rows[0].id_utilisateur;\n }\n });\n}", "async function consultarHistorial(NumPart,horas){//Consulta si existe registros de NoPartes para determinar el tiempo de cada pieza\n cnSQL.cnn.query(\"SELECT Horas from historial WHERE EXISTS (SELECT NoParte FROM historial WHERE NoParte = '\"+ NumPart +\"' LIMIT 1) AND NoParte = '\"+ NumPart +\"'\", [], (err, consulta) => {//CONSULTA DE OT REFERENTE A LA ID [A]\n if(err){\n console.log(\"Consulta Error: \" + err);\n }\n /*==================================================== CALCULAR HORAS =======================================================================================*/\n else if(Object.keys(consulta).length > 0){//si la consulta obtiene horas de algun registro en el historial \n horas = Object.values(consulta[0]);\n console.log(\"Horas de consulta en if: \" + horas);\n\n }else if(Object.keys(consulta).length <= 0){//si no hay registro en el historial, crea registro nuevo en tabla historial\n var TablaCP = {\n NoParte : NumPart,\n Horas : horas\n }\n cnSQL.cnn.query('INSERT INTO historial set ? ',[TablaCP], (err, ot) =>{\n if(err){\n console.log(err);\n }\n });\n }\n });\n console.log(\"Return: \" + horas);\n return horas;\n}", "async function testeUserExiste(mail){\n try{ \n let rows1 = await knex.raw(\"SELECT users.mail FROM users WHERE users.mail= ? \", [mail]);\n if (rows1.length === 1) { \n return true;\n } \n return false;\n }\n catch(err){\n console.error('Erreur dans la fonction testeUserExiste'); \n console.error(err);\n }\n}", "async function checkCache(name){\n\ttry {\n\n\t const value = await AsyncStorage.getItem('@cache:' + name);\n\t return value !== null;\n\n\t} catch (error) {\n\t console.log(error);\n\t}\n}", "function memoGuard(fn) {\n return function(a, b, memos) {\n if (!memos) return fn(a, b, [])\n var i = memos.length,\n memo;\n while ((memo = memos[--i])) {\n if (memo[0] === a && memo[1] === b) return true\n }\n return fn(a, b, memos)\n }\n}", "function comprobarExistenciaTablaAscensorItemsProteccion(){\n var numeroFilas = 0;\n db.transaction(function (tx) {\n var query = \"SELECT COUNT(*) AS c FROM ascensor_items_proteccion\";\n tx.executeSql(query, [], function (tx, resultSet) {\n console.log('Numero de filas tabla ascensor_items_proteccion -> '+resultSet.rows.item(0).c);\n numeroFilas = resultSet.rows.item(0).c;\n if (numeroFilas > 0) {\n //alert(\"Ya existe la tabla puertas_items_mecanicos!\");\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n /* Funciones que se ejecutan sino existe la tabla */\n llenarTablaAscensorItemsProteccion();\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function OfflineHeadCheck(){\n\t\tvar measureId = localStorage.getItem(\"mesurementTransaction_id\");\n\t\tvar db = window.openDatabase(\"Spine\", \"1.0\", \"Spine Demo\", 100 * 1024 * 1024);\n\t\tdb.transaction(Live_Measure_Head, errorCB);\n\t\tfunction Live_Measure_Head(tx) {\n\t\t\ttx.executeSql('SELECT * FROM Live_Measure_Head where MH_REF_SYS_ID=? ', [measureId], function (tx, results) {\n\t\t\t\tvar Headlength = results.rows.length;\n\t\t\t\talert(\"Headlength-->\"+Headlength);\n\t\t\t\tif(Headlength=='0'){\n\t\t\t\t\tvar HeadSysId = localStorage.getItem(\"mesurementTransaction_id\");\n\t\t\t\t\tvar linesys = parseInt(HeadSysId);\n\t\t\t\t\tvar LineSysId = linesys + 1 ;\n\t\t\t\t\talert(\"Head\"+HeadSysId);\n\t\t\t\t\talert(\"Line\"+LineSysId);\n\t\t\t\t\tlocalStorage.setItem(\"SYS_ID\", HeadSysId);\n\t\t\t\t\tlocalStorage.setItem(\"LineId\", LineSysId);\n\t\t\t\t\tlocalStorageHead();\n\t\t\t\t}else{\n\t\t\t\t\talert(\"Status\"+results.rows.item(0).MH_STATUS);\n\t\t\t\t\tvar id = results.rows.item(0).MH_SYS_ID;\n\t\t\t\t\talert(\"id->\"+id);\n\t\t\t\t\tvar LineSysId = id + 1;\n\t\t\t\t\talert(LineSysId);\n\t\t\t\t\tlocalStorage.setItem(\"LineId\", LineSysId);\n\t\t\t\t\tlocalStorage.setItem(\"SYS_ID\", results.rows.item(0).MH_SYS_ID);\n\t\t\t\t\tlocalStorage.setItem(\"Status\", results.rows.item(0).MH_STATUS);\n\t\t\t\t\talert(\"All Ready Exit\");\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\tfunction errorCB(tx, err) {\n\t\t \t//alert(\"Error\");\n\t\t \t//alert(\"Error processing SQL: \"+err);\n\t\t} \n\t}", "forArrrSearchItemToAddProperty(type){ //0 - mua xong sp chua consume, 1-consume sp xong\n //KIEM TRA XEM SAN PHAM NAY DA MUA CHUA NEU DA MUA THI DA CONSUME CHUA\n for(let i=0; i<arr_products.length; i++){\n if(arr_products[i].id === this.state.productId){\n if(type === 0){\n arr_products[i].isConsume = false;\n }else {\n arr_products[i].isConsume = true;\n }\n break\n }\n }\n //luu lai REALm DATABASE\n realm.write(() => {\n obj_data_cake[0].data_products = JSON.stringify(arr_products);\n })\n }", "function checaExiste(bloco, operador){\r\n\tvar condicao = operador + valorDeN();\r\n\tfor (var i = operador ; i < condicao; i++){\r\n\t\tif(arrayGlobal[i] == bloco){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "resMem(bitmask) {\n var i = MMU.rb(regHL[0]);\n i &= ~bitmask;\n MMU.wb(regHL[0], i);\n return 16;\n }", "function hasSavedData(){\n return localStorage.hasOwnProperty(getKey());\n}", "static async isRegisteredMail(mail) {\n let res = await db.query('SELECT * FROM users WHERE mail = $1', [mail])\n return res.rowCount > 0;\n }", "memoizeRestaurantRetrieval(func, callback) {\n let cache = {};\n\n return function(collection) {\n if (cache[collection.id]) {\n callback(cache[collection.id], collection);\n } else {\n func(collection.id, (results) => {\n cache[collection.id] = results;\n callback(cache[collection.id], collection);\n });\n }\n };\n }", "get isFull(){return members.length >= numObjects;}", "function memoGaurd(fn){\n return function(a, b, memos){\n if (!memos) return fn(a, b, [])\n var i = memos.length, memo\n while (memo = memos[--i]) {\n if (memo[0] === a && memo[1] === b) return true\n }\n return fn(a, b, memos)\n }\n}", "function memoGaurd(fn){\n return function(a, b, memos){\n if (!memos) return fn(a, b, [])\n var i = memos.length, memo\n while (memo = memos[--i]) {\n if (memo[0] === a && memo[1] === b) return true\n }\n return fn(a, b, memos)\n }\n}", "function memoGaurd(fn){\n return function(a, b, memos){\n if (!memos) return fn(a, b, [])\n var i = memos.length, memo\n while (memo = memos[--i]) {\n if (memo[0] === a && memo[1] === b) return true\n }\n return fn(a, b, memos)\n }\n}", "checkCharonKey(query, variables) {\n // need to handle if the query string doesnt exist\n // if it doesnt exist then find its charon key and iterate through cache\n // returns a boolean\n const charonKey = generateCharonKeyFromQuery(query, variables);\n // grabs fields from the query\n const queryFields = parseQueryForFields(query);\n console.log('queryFields', queryFields);\n\n // check if charonKey exists in the cache\n if (this.cache[charonKey]) {\n const rawFromCache = this.cache[charonKey];\n console.log('rawFromCache', rawFromCache);\n }\n\n // denormalize rawFromCache\n // parse through and match queryFields to denormalized data\n\n // normalize query\n // parse through and match queryFields to normalized data\n // return denormalized stripped data\n }", "function comprobarExistenciaTablaAscensorItemsPreliminar(){\n var numeroFilas = 0;\n db.transaction(function (tx) {\n var query = \"SELECT COUNT(*) AS c FROM ascensor_items_preliminar\";\n tx.executeSql(query, [], function (tx, resultSet) {\n console.log('Numero de filas tabla ascensor_items_preliminar -> '+resultSet.rows.item(0).c);\n numeroFilas = resultSet.rows.item(0).c;\n if (numeroFilas > 0) {\n //alert(\"Ya existe la tabla ascensor_items_preliminar!\");\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n /* Funciones que se ejecutan sino existe la tabla */\n llenarTablaAscensorItemsPreliminar();\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "bitMem(bitmask) {\n regF[0] &= 0x1F;\n regF[0] |= 0x20;\n regF[0] = (MMU.rb(regHL[0]) & bitmask) ? 0 : 0x80;\n return 12;\n }", "empty() {\n var rd = Atomics.load(this.read_ptr, 0);\n var wr = Atomics.load(this.write_ptr, 0);\n return wr == rd;\n }", "function initMem(){\n var memTest = JSON.parse(localStorage.getItem(\"pCityList\"));\n \n if(memTest === null){\n localStorage.setItem(\"pCityList\",JSON.stringify(initCity));\n cityList = [];\n } else if (memTest.length !== 0){\n cityList=JSON.parse(localStorage.getItem(\"pCityList\"));\n clrCity();\n rendHist();\n \n }\n}", "function MemoryCache() {\n this._entries = [];\n}", "function CheckUnitTransDetail(connection,data,callback) {\n\n var records;\n var sql = 'select count(*) from db_unitTransDetail where transNumber = @transnumber and unitId = @unitid and itemId = @itemid and itemDenom = @denom ' +\n 'and propid = @propid';\n\n var request = new Request(sql,function(err,rowCount) {\n if(err) {\n errMsg = 'CheckUnitTransDetail error: ' + err;\n sql = null;\n request = null;\n return callback(errMsg,null);\n\n } else {\n sql = null;\n request = null;\n return callback(null,records);\n }\n\n }); \n\n request.addParameter('transnumber', TYPES.Int,data.transnumber);\n request.addParameter('unitid', TYPES.Int,data.unit);\n request.addParameter('itemid', TYPES.NVarChar,data.item);\n request.addParameter('denom', TYPES.Int,data.denom);\n request.addParameter('propid', TYPES.Int,data.propid);\n \n request.on('row', function(columns) {\n columns.forEach(function(column) {\n if (column.value === null) {\n console.log('NULL');\n } else {\n records = column.value;\n\n }\n });\n });\n\n\n connection.execSql(request);\n\n}", "function objCacheHas( modelName, _id ) {\n //Y.log( 'objCache query: ' + modelName + '::' + _id + ' ' + (objCache.hasOwnProperty( modelName + '::' + _id) ? 'HIT' : 'MISS' ), 'debug', NAME );\n if( !useCache ) {\n return false;\n }\n return objCache.hasOwnProperty( modelName + '::' + _id );\n }", "function consultarTuplasExistentesPaginacion(nombrePHPCons, isBorrar, arrayCamposCons) {\n\tisBorrar = isBorrar == null ? false : isBorrar;\n\tnombrePHPConsultar = nombrePHPCons;\n\tisBorrarTuplas = isBorrar;\n\tarrayCamposConsulta = arrayCamposCons == null ? {} : arrayCamposCons;\n\t\n\tconsultarTuplasExistentesPaginacion_pagina(0);\n}", "function consultarTuplasExistentesPaginacion(nombrePHPCons, isBorrar, arrayCamposCons) {\n\tisBorrar = isBorrar == null ? false : isBorrar;\n\tnombrePHPConsultar = nombrePHPCons;\n\tisBorrarTuplas = isBorrar;\n\tarrayCamposConsulta = arrayCamposCons == null ? {} : arrayCamposCons;\n\t\n\tconsultarTuplasExistentesPaginacion_pagina(0);\n}", "buscarNodo(dato){\n if (this.tamanio == 0){\n console.log(\"No hay elementos en la lista.\")\n } else{\n let isEncontrado = false\n let aux = this.primero\n while(aux != null){\n if (aux.dato == dato){\n isEncontrado = true\n return aux.id \n }\n aux = aux.siguiente\n }\n\n if (isEncontrado == false){\n console.log(\"El elemento no se encuentra\")\n alert(\"El dato no se encuentra en la lista.\")\n }\n }\n }", "function comprobarExistenciaTablaPuertasItemsProteccion(){\n var numeroFilas = 0;\n db.transaction(function (tx) {\n var query = \"SELECT COUNT(*) AS c FROM puertas_items_proteccion\";\n tx.executeSql(query, [], function (tx, resultSet) {\n console.log('Numero de filas tabla puertas_items_proteccion -> '+resultSet.rows.item(0).c);\n numeroFilas = resultSet.rows.item(0).c;\n if (numeroFilas > 0) {\n //alert(\"Ya existe la tabla puertas_items_mecanicos!\");\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n /* Funciones que se ejecutan sino existe la tabla */\n llenarTablaPuertasItemsProteccion();\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function obtenerValoresMecanicos(cod_usuario,cod_inspeccion){\n db.transaction(function (tx) {\n var query = \"SELECT k_coditem,v_calificacion,o_observacion FROM puertas_valores_mecanicos WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [cod_usuario,cod_inspeccion], function (tx, resultSet) {\n for(var x = 0, i = 1; x < resultSet.rows.length; x++,i++) {\n $(\"input[name=sele_mecanicos\"+i+\"][value='\"+resultSet.rows.item(x).v_calificacion+\"']\").prop(\"checked\",true);\n $('#text_lv_valor_observacion_'+i).val(resultSet.rows.item(x).o_observacion);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function MemCache() {\n this.__wrapped__ = {};\n }", "function comprobarExistenciaTablaEscalerasItemsProteccion(){\n var numeroFilas = 0;\n db.transaction(function (tx) {\n var query = \"SELECT COUNT(*) AS c FROM escaleras_items_proteccion\";\n tx.executeSql(query, [], function (tx, resultSet) {\n console.log('Numero de filas tabla escaleras_items_proteccion -> '+resultSet.rows.item(0).c);\n numeroFilas = resultSet.rows.item(0).c;\n if (numeroFilas > 0) {\n //alert(\"Ya existe la tabla escaleras_items_mecanicos!\");\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n /* Funciones que se ejecutan sino existe la tabla */\n llenarTablaEscalerasItemsProteccion();\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function getSetMem(node, sTable) {\n if (/^[0-9]$/.test(node.name)) {\n //Load single digit into Acc, then store\n let addr = memManager.allocateStatic();\n byteCode.push(\"A9\", \"0\" + node.name, \"8D\", addr[0], addr[1]);\n return addr;\n }\n else if (node.name === \"ADD\") {\n //Calculate addition, return the location of result\n return parseAdd(node, sTable);\n }\n else if (node.name === \"true\") {\n //Load true (01) into Acc, then store\n return memManager.getTrueVal();\n }\n else if (node.name === \"false\") {\n //Location of default \"00\" (false)\n return memManager.getFalseVal();\n }\n else if (/^[a-z]$/.test(node.name)) {\n //Return location of variable value\n return sTable.getLocation(node.name);\n }\n else if (node.name === \"CHARLIST\") {\n //Allocate string in heap, store pointer, return location of pointer\n let pointer = parseCharList(node);\n let addr = memManager.allocateStatic();\n byteCode.push(\"A9\", pointer, \"8D\", addr[0], addr[1]);\n return addr;\n }\n }", "empty(){\r\n return this.size == 0;\r\n }", "isDocumentExisted(documentName) {\n var checkExistedProcess = this.dbConnect.then((connection) => {\n return new Promise ((resolve, reject) => {\n connection.query('SELECT id FROM ' + dbDocumentInfo + ' WHERE documentName = ?', documentName, (err, results, fields) => {\n if (!err) {\n var docName = results\n var quantity = docName.length\n if(quantity === 1) {\n //connection.release()\n resolve(true)\n } else if (quantity === 0){\n // console.log('Inside dbDoc : ' + docName[0].id)\n //connection.release()\n resolve(false)\n } else {\n //connection.release()\n reject({err: {msg: 'There are two of them in Database - System ERR'}})\n }\n } else {\n reject(err)\n }\n })\n })\n }).catch((err) =>{\n return Promise.reject(err)\n })\n return checkExistedProcess\n }", "function find(){\r\nCustomer.find({dni:\"32111114-D\"}, (err, ret) => {\r\n\t\r\n\tif(err) {\r\n\t\tconsole.error(err);\r\n\t\t\r\n\t} else {\r\n\t\tconsole.log(\"Los dueños que coinciden con el criterio de busqueda son: \", ret);\r\n\t\tconsole.log(\"Todo correcto!!\");\r\n\t\t\r\n\t}\r\n\r\n});\r\n\r\n}", "function verificaQuery() {\n query = \"SELECT id, data, sumario FROM sumario\";\n console.log(query);\n connectDataBase();\n connection.query(query, function (err, result) {\n if (err) {\n console.log(err);\n } else {\n var x = result.length;\n console.log(x);\n sessionStorage.setItem(\"resultado\", x);\n }\n });\n closeConnectionDataBase();\n}", "function checkDatabase() {\nconst transaction = db.transaction([\"budgetStore\"], \"readwrite\");\nconst save = transaction.objectStore(\"budgetStore\");\nconst getAll = save.getAll();\n getAll.onsuccess = function () {\n if (getAll.result.length > 0) {\n //checks to see if data exists, if so will update via POST route in \n //api.js\n fetch(\"/api/transaction/bulk\", {\n method: \"POST\",\n body: JSON.stringify(getAll.result),\n headers: {\n Accept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => {\n return response.json();\n })\n .then(() => {\n const saveInfo = db.transaction(\"budgetStore\", \"readwrite\");\n const store = saveInfo.objectStore(\"budgetStore\");\n store.clear();\n });\n }\n };\n}", "async init() {\n const { rows } = await this.client.db.query(`SELECT * FROM \"${this.table}\"`);\n for(const row of rows) this.cache.set(row.id, row);\n }", "function comprobarExistenciaTablaPuertasItemsOtras(){\n var numeroFilas = 0;\n db.transaction(function (tx) {\n var query = \"SELECT COUNT(*) AS c FROM puertas_items_otras\";\n tx.executeSql(query, [], function (tx, resultSet) {\n console.log('Numero de filas tabla puertas_items_otras -> '+resultSet.rows.item(0).c);\n numeroFilas = resultSet.rows.item(0).c;\n if (numeroFilas > 0) {\n //alert(\"Ya existe la tabla puertas_items_otras!\");\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n /* Funciones que se ejecutan sino existe la tabla */\n llenarTablaPuertasItemsOtras();\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "function memory() {\n return this._memory = this._memory || {};\n}", "function comprobarExistenciaTablaPuertasItemsPreliminar(){\n var numeroFilas = 0;\n db.transaction(function (tx) {\n var query = \"SELECT COUNT(*) AS c FROM puertas_items_preliminar\";\n tx.executeSql(query, [], function (tx, resultSet) {\n console.log('Numero de filas tabla puertas_items_preliminar -> '+resultSet.rows.item(0).c);\n numeroFilas = resultSet.rows.item(0).c;\n if (numeroFilas > 0) {\n //alert(\"Ya existe la tabla puertas_items_preliminar!\");\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n /* Funciones que se ejecutan sino existe la tabla */\n llenarTablaPuertasItemsPreliminar();\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n}", "returnValidationRequest(address){\n let flag = false;\n let req;\n //loop through mempool to find request for the addess\n this.mempool.forEach(element => {\n if(element[0] === address){\n flag = true;\n req = element;\n }\n });\n if( !flag ){\n return([]); \n }else{\n return(req);\n }\n }", "mem() {\n\t\tlet ref = this.$mem++;\n\t\twhile (this.memRefs.has(ref)) {\n\t\t\tref = this.$mem++;\n\t\t}\n\t\treturn ref;\n\t}", "function searchData(){\n\tvar one = document.getElementById(\"one\").value; \n\tfor(var x = 0; x<localStorage.length; x++){\n\t\tvar a = localStorage.key(x);\n\t\tvar b = localStorage.getItem(a);\n\n\t\tif(one == a && b){\n\t\t\talert(\"Record exists in the session storage!!\");\n\t\t\tdocument.getElementById(\"one\").value = \"\";\n\t\t\tdocument.getElementById(\"two\").value = \"\";\n\t\t\treturn one;\n\t\t}\n\t}\n\n\tif(one != a && b){\n\t\talert(\"Record not found!!\");\n\t\tdocument.getElementById(\"one\").value = \"\";\n\t\tdocument.getElementById(\"two\").value = \"\";\n\t\treturn one;\n\t}\n\n\tif(document.getElementById(\"one\").value == \"\"){\n\t\talert(\"Enter something to search in the storage!!\");\n\t}\n}", "function checkResetLink(password_nodejs_reset, callback) {\n\nvar sql =\n `SELECT COUNT(*) AS has_reset FROM mailinglist_om \n WHERE \n password_nodejs_reset = :password_nodejs_reset`;\n\n var params = { password_nodejs_reset: password_nodejs_reset };\n\n photoeye\n .query(sql, { replacements: params })\n .spread(function(results, metadata) {\n callback(results[0].has_reset);\n });\n}", "validateData(){\n this.hasSavedValues = false\n\n this.publicoAlvoSim > 0 ? this.hasSavedValues = true : null\n this.publicoAlvoALVA > 0 ? this.hasSavedValues = true : null\n this.publicoAlvoALVA > 0 ? this.hasSavedValues = true : null\n\n this.XER > 0 ? this.hasSavedValues = true : null\n this.COP > 0 ? this.hasSavedValues = true : null\n\n this.listaPrefixos.length > 0 ? this.hasSavedValues = true : null\n\n this.operacaoNaoVinculada > 0 ? this.hasSavedValues = true : null\n this.operacaoVinculada > 0 ? this.hasSavedValues = true : null\n this.operacaoVinculadaEmOutroNPJ > 0 ? this.hasSavedValues = true : null\n\n this.acordoRegPortalSim > 0 ? this.hasSavedValues = true : null\n this.acordoRegPortalNao > 0 ? this.hasSavedValues = true : null\n //this.acordoRegPortalDuplicados > 0 ? this.hasSavedValues = true : null\n\n this.estoqueNumber > 0 ? this.hasSavedValues = true : null\n this.fluxoNumber > 0 ? this.hasSavedValues = true : null\n \n this.duplicadoSimNao > 0 ? this.hasSavedValues = true : null\n this.analisadoSimNao > 0 ? this.hasSavedValues = true : null\n }", "function listCacheClear(){\nthis.__data__=[];\nthis.size=0;\n}" ]
[ "0.54363006", "0.53921723", "0.5376621", "0.5367639", "0.5279848", "0.52349174", "0.51900053", "0.51821333", "0.51652825", "0.5148266", "0.51415527", "0.5074767", "0.5028829", "0.50194067", "0.50068545", "0.49502096", "0.49188247", "0.49022853", "0.4902154", "0.4887947", "0.48812488", "0.4880622", "0.48775548", "0.48764515", "0.4866698", "0.4857185", "0.48423433", "0.48336944", "0.48257047", "0.48253807", "0.48248765", "0.48191983", "0.47931764", "0.47889233", "0.4778352", "0.47690332", "0.47387642", "0.47352278", "0.47322175", "0.47322175", "0.4727897", "0.47214025", "0.47206333", "0.47202206", "0.4719779", "0.4712092", "0.47101915", "0.47083515", "0.47083515", "0.4708254", "0.4707716", "0.47012708", "0.46978453", "0.46972442", "0.4680887", "0.4676642", "0.46702218", "0.4664422", "0.46635637", "0.46574178", "0.46516562", "0.46444467", "0.4639715", "0.46384332", "0.46352854", "0.46332693", "0.46320558", "0.46194515", "0.46194515", "0.46194515", "0.4610546", "0.4610388", "0.46102357", "0.46091974", "0.46053365", "0.4593302", "0.4592932", "0.4592919", "0.45882967", "0.45882967", "0.45855534", "0.45788857", "0.45744497", "0.45728427", "0.4567141", "0.45607674", "0.45564023", "0.45556593", "0.45544326", "0.455431", "0.45519838", "0.45510617", "0.45481956", "0.45432693", "0.45390671", "0.45352378", "0.45296007", "0.4527457", "0.45262584", "0.45249972", "0.45246005" ]
0.0
-1
Esta funcion se usa para ver la nota enviada en la tarea de firma
function verNotaEnviada(nroNotaEnv, nameArchivo) { var URL = getUrlApp() + "/DownloadServlet?tipo=VER_NE&nroNotaEnv=" + nroNotaEnv + "&nameArchivo=" + nameArchivo + TAB_ID_REQUEST; /* window.status = URL; var w = window.open(URL,"Memo","width=" + ancho + ",height=" + alto + ",top=" + posX + ",left=" + posY + ",scrollbars=YES,resizable=YES"); w.focus(); */ var anchorDownloader = new Element('a', { href: URL, download: 'true' }).setStyle('visibility', 'hidden').inject(document.body); anchorDownloader.click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verifForm2(f){\n\n var telOk = verifTel(f.tel) ; \n var mailOk = verifMail(f.mail) ; \n var siteOk = verifLink(f.site) ;\n \n \n\n if (telOk || mailOk || siteOk ) {\n alert(\"Votre annonce a bien été envoyée, elle sera confirmée par nos équipes\");\n return true;\n } \n \n else{ \n \n alert(\"Veuillez remplir correctement tous les champs\");\n return false;\n }\n \n }", "verificaDados(){\n this.verificaEndereco();\n if(!this.verificaVazio()) this.criaMensagem('Campo vazio detectado', true);\n if(!this.verificaIdade()) this.criaMensagem('Proibido cadastro de menores de idade', true);\n if(!this.verificaCpf()) this.criaMensagem('Cpf deve ser válido', true);\n if(!this.verificaUsuario()) this.criaMensagem('Nome de usuario deve respeitar regras acima', true);\n if(!this.verificaSenhas()) this.criaMensagem('Senha deve ter os critérios acima', true)\n else{\n this.criaMensagem();\n // this.formulario.submit();\n }\n }", "function responder_confirmarCita() {\n \n if (objAjax.readyState == 4){\n if (objAjax.status == 200) {\n\n if (objAjax.responseText == \"false\") {\n\n mensaje(\"Error al guardar la cita\");\n\n } else {\n\n mensaje_boton_nombre(\"Cita guardada correctamente, se enviará un email.\", \"imprimir()\", \"Imprimir PDF\"); \n }\n }\n }\n}", "function mdpActuelVerif(){\n var verification;\n var mdp=$('#mdpActuel');\n ajaxRequest('GET','php/request.php/verifMotDePasse',function(ajaxResponse){\n json= JSON.parse(ajaxResponse);\n if(!json['verification']){\n surligne(mdpActuel, false);\n verification=false;\n }else{\n surligne(mdpActuel, true);\n verification=true;\n }\n },\"mdp=\"+mdp.value+\"&pseudo=\"+Cookies.get('pseudo'),function(){},false);\n return verification;\n}", "function enviar (){\n\n return true;\n}", "function verifica_form(form) {\r\n\tvar passed = false;\r\n\tvar ok = false\r\n\tvar campo\r\n\tfor (var i = 0; i < form.length; i++) {\r\n\t\tcampo = form[i].getAttribute(\"name\");\r\n\t\tif (form[i].getAttribute(\"df_verificar\") == \"sim\") {\r\n\t\t\tif (form[i].getAttribute(\"type\") == \"text\" | form[i].getAttribute(\"type\") == \"textarea\" | form[i].type == \"password\") {\r\n\t\t\t\tif (form[i].value == \"\" | form[i].value == \"http://\") {\r\n\t\t\t\t\tform[campo].focus();\r\n\t\t\t\t\t$.jGrowl('Preencha todos os campos requeridos corretamente');\r\n\t\t\t\t\treturn passed;\r\n\t\t\t\t\tstop;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar msg = \"\"\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"cpf\") msg = checa_cpf(form[campo].value);\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"senha\") msg = valida_senha(form[campo].value);\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"letras\") msg = chega_letras(form[campo].value);\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"mac\") msg = valida_mac(form[campo].value);\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"cnpj\") msg = checa_cnpj(form[campo].value);\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"cpf_cnpj\") {\r\n\t\t\t\tmsg = checa_cpf(form[campo].value);\r\n\t\t\t\tif (msg != \"\") msg = checa_cnpj(form[campo].value);\r\n\t\t\t}\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"email\") msg = checa_email(form[campo].value);\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"numerico\") msg = checa_numerico(form[campo].value);\r\n\t\t\tif (msg != \"\") {\r\n\t\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"cpf_cnpj\") msg = \"informe corretamente o numero do CPF ou CNPJ\";\r\n\t\t\t\tform[campo].focus();\r\n\t\t\t\tform[campo].select();\r\n\t\t\t\t$.jGrowl(msg);\r\n\t\t\t\treturn passed;\r\n\t\t\t\tstop;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tpassed = true;\r\n\treturn passed;\r\n}", "function isPixieTva() {\n if($(\"#user_pixie_billing_address_country\").val() === \"FR\" && $(\"#user_pixie_billing_status\").val() === \"company\")\n {\n return true;\n }\n else if($(\"#user_pixie_billing_address_country\").val() === \"FR\" && $(\"#user_pixie_billing_status\").val() == \"microentrepreneurtva\")\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function confirmStampe() {\n\tvar message = \"Al termine dell'operazione verra' inviata un'email di riepilogo a [email protected].\\nConfermi?\";\n\treturn confirm(message);\n}", "function checkValidMailUpTodos(\n newemailUpTodos,\n pass2UpTodos,\n nombreup2Todos,\n checkUpTodos,\n id\n) {\n // var url_base = $(\"#url_base\").val();\n fetch(\"https://sistemas.mininterior.gob.ar/desagenesis/api/perfiles/updateUsuario\", {\n method: \"PUT\",\n headers: new Headers({\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n }),\n body:\n \"email=\" +\n newemailUpTodos +\n \"&nombre=\" +\n nombreup2Todos +\n \"&owner=\" +\n checkUpTodos +\n \"&pass=\" +\n pass2UpTodos +\n \"&id=\" +\n id,\n })\n .then((resp) => resp.json())\n .then((respObj) => {\n //Espera la respuesta de la API y consulta siempre por 0 (cero), si es correcto.\n if (respObj.status == 0) {\n swal({\n title: \"Excelente!\",\n text: respObj.messege,\n icon: \"success\",\n }).then(function () {\n location.reload();\n });\n } else {\n swal({\n title: \"Algo Salió Mal!\",\n text: respObj.messege,\n type: \"danger\",\n }).then(function () {\n location.reload();\n });\n }\n })\n .catch((error) => {\n alert(error);\n });\n}", "function checkAceptaCondiciones(field){\r\n\tvar acepta = $(\"input[name='acepto_aviso_legal']:checked\").val();\r\n\tif ( acepta === undefined) {\r\n\t\treturn \"Lea y acepta los términos y condiciones de uso.\";\r\n\t}\t\t\t\r\n}", "async checkHasFortnite() {\n try {\n \n if(!this.launcher.account.entitlements.find(entitlement => entitlement.namespace == 'fn')) {\n this.launcher.debugger.error('Launcher', 'Purchase fortnite to use fortnitenode.');\n }\n\n const data = await this.launcher.informEULA('fn'); \n if(data) {\n if(!await this.launcher.receiveEULA(data)) this.launcher.debugger.error('Launcher', `Cannot post fortnite's eula.`);\n }\n return true;\n }\n catch(error) {\n this.launcher.debugger.error('Launcher', error.code);\n }\n }", "function mostraNotas(){}", "function verificarValidadeSerial() {\r\n let dataFim = new Date(localStorage.getItem(\"dataFim\"));\r\n let dataEmMemoria = new Date(localStorage.getItem(\"dataAtual\"));\r\n let date = new Date();\r\n let dataAtual = new Date(date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate());\r\n let codicao = false;\r\n\r\n if (localStorage.getItem(\"dataFim\") == \"\") {\r\n codicao = true;\r\n } else {\r\n if (dataEmMemoria <= dataAtual) {\r\n localStorage.removeItem(\"dataAtual\");\r\n localStorage.setItem(\"dataAtual\", date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate());\r\n\r\n if (dataFim > dataAtual) {\r\n codicao = true;\r\n } else {\r\n mensagemDeErro(\"Licença vencida!\");\r\n }\r\n\r\n } else {\r\n mensagemDeErro(\"Atenção relógio atrasado!\");\r\n }\r\n }\r\n\r\n return codicao;\r\n}", "function correcTexto() {\r\n var resp = formElement.elements[0].value;\r\n if (resp == respTexto) {\r\n darRespuesta(\"Perfecto.\");\r\n nota += 1;\r\n } else {\r\n darRespuesta(\"Te has equivocado.\");\r\n }\r\n}", "function ispisCene(){\n \n let ispisCena=racunajCenu(findDestPrice(dest),brOsoba);\n document.querySelector(\"#cena\").innerHTML = `${ispisCena}&euro;`;\n }", "function checkMail() {\n if (getMail().length > 0) {\n if (isSignExist() && isSignSame() && isCharbefSign() && isDotExist() && isDotSame() && isCharbefDotAfSign() && isAfterDot()) {\n return true;\n }\n else {\n return false;\n }\n }\n //nothing put in mail box\n else {\n document.eMail.uMail.style.borderColor = \"grey\";\n document.getElementById(\"errMail\").style.display = \"none\";\n return false;\n }\n}", "function verificarTipoNomina(form, accion) {\r\n\tvar codigo=document.getElementById(\"codigo\").value; codigo=codigo.trim();\r\n\tvar descripcion=document.getElementById(\"descripcion\").value; descripcion=descripcion.trim();\r\n\tvar titulo=document.getElementById(\"titulo\").value; titulo=titulo.trim();\r\n\tvar perfil=document.getElementById(\"perfil\").value;\r\n\tif (document.getElementById(\"activo\").checked) var status=\"A\"; else var status=\"I\";\r\n\tif (document.getElementById(\"flag\").checked) var flag=\"S\"; else var flag=\"N\";\r\n\tif (descripcion==\"\") msjError(1010);\r\n\telse {\r\n\t\t//\tCREO UN OBJETO AJAX PARA VERIFICAR QUE EL NUEVO REGISTRO NO EXISTA EN LA BASE DE DATOS\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"fphp_ajax_nomina.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"modulo=TIPOSNOMINA&accion=\"+accion+\"&codigo=\"+codigo+\"&descripcion=\"+descripcion+\"&status=\"+status+\"&titulo=\"+titulo+\"&flag=\"+flag+\"&perfil=\"+perfil);\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tvar resp=ajax.responseText;\r\n\t\t\t\tdatos=resp.split(\":\");\r\n\t\t\t\tif (datos[0]!=0) alert (\"¡\"+resp+\"!\");\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (accion==\"GUARDAR\") location.href=\"tiposnomina_editar.php?filtro=\"+form.filtro.value+\"&registro=\"+datos[1];\r\n\t\t\t\t\telse location.href=\"tiposnomina.php?filtro=\"+form.filtro.value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function verificarAccionForm(formulario){\r\n\tagregarValidacionTextInputs(formulario);\r\n\tlocalStorage.getItem('Accion') == 'cargarServidor' ? cargarServidor(formulario) : console.log('No hay Acción');\r\n}", "checkTerritoryIsMine (terName) {\n var i = 0\n var res = false\n /* getting local map */\n var checkMap = THIS.getLocalMap()\n /* looping on local map */\n Object.keys(checkMap).forEach(key => {\n var continentName = checkMap[key]\n for (var countries in continentName) {\n if (countries === terName) {\n if (continentName[countries].player == localStorage.myId) {\n // console.log('free')\n res = true\n } else {\n GameWindow.displayMessage('This territory is not yours !!')\n res = false\n }\n }\n i++\n }\n })\n return res\n }", "function conrolEmail (){\n const Email = formValues.Email;\n \n if(regexEmail(Email)){\n \n document.querySelector(\"#email_manque\").textContent = \"\";\n return true;\n }else{\n document.querySelector(\"#email_manque\").textContent = \"E-mail n'ai pas valide\";\n alert(\"E-mail n'ai pas valide\");\n return false;\n }\n\n}", "function sendPuntosRuta2 () {\n var puntos = extractPuntosRuta2(); \n var ruta = document.getElementById(\"sruta\").value;\n var msg = document.getElementById(\"msg\"); \n \n if (ruta == \"\") {\n msg.innerHTML = \"* Especifique una ruta.\";\n msg.setAttribute(\"class\", \"form-msg alert alert-info\");\n return;\n }\n \n if (puntos != false) {\n document.getElementById(\"ruta\").value = ruta;\n document.getElementById(\"puntos\").value = puntos;\n document.getElementById(\"form-nueva-ruta\").submit();\n } else { \n msg.innerHTML = \"* Especificaci&oacute;n de puntos es incorrecta. Verifique la existencia y orden de las bases.\";\n msg.setAttribute(\"class\", \"form-msg alert alert-info\");\n }\n}", "function cargarDisponiblesProcesar(form) {\r\n\tvar frm = document.getElementById(\"frmentrada\");\r\n\tvar forganismo = document.getElementById(\"forganismo\").value;\r\n\tvar ftiponom = document.getElementById(\"ftiponom\").value;\r\n\tvar fperiodo = document.getElementById(\"fperiodo\").value;\r\n\tvar ftproceso = document.getElementById(\"ftproceso\").value;\r\n\t\r\n\tif (ftiponom==\"\" || fperiodo==\"\") { alert(\"¡DEBE SELECCIONAR EL TIPO DE NOMINA Y PERIODO!\"); return false; }\r\n\telse if (ftproceso==\"\") { alert(\"¡DEBE SELECCIONAR EL TIPO DE PROCESO!\"); return false; }\r\n\telse return true;\r\n}", "function verificarAutenticacion(peticion, respuesta, next){\n\tif(peticion.session.correo){\n return next();\n }\n\t\t\n\telse{\n\t\trespuesta.send({est: 1, msj: \"restringida\"});\n }\n}", "function checkReturnEndCorrespondente() {\n\t\tvar form = document.frmCadCliente;\n\t\tif (form.hiddenTypeColeta.value == 0) {\n\t\t\tdocument.getElementById(\"tableCadClienteContato\").style.display = 'none';\n\t\t\tdocument.getElementById(\"tableCadClienteEndereco\").style.display = 'block';\n\t\t} else {\n\t\t\tdocument.getElementById(\"tableCadClienteContato\").style.display = 'none';\n\t\t\tdocument.getElementById(\"tableCadClienteEnderecoColeta\").style.display = 'block';\n\t\t} \n\t}", "function verificacaoSenha(){\n\tvar senha = document.getElementById('senha').value;\t\t\n\tvar confirmaSenha = document.getElementById('confirmaSenha').value;\t\t\t\n\n\tif (senha != confirmaSenha) {\n\t\twindow.alert('Senhas diferentes');\n\t\t//senha.focus();\n\t\tdocument.getElementById('senha').focus();\t\t\t\n\t\tdocument.getElementById('confirmaSenha').value =\"\";\t\t\n\t\tdocument.getElementById('senha').value =\"\";\t\t\t\n\t\treturn false;\n\t\t\n\t}\n}", "function vacio(){\n\t var c_na = /^([a-z]|[A-Z]|├í|├ę|├*|├│|├║|├▒|├╝|\\s)+$/\n if(!c_na.test(solicitar.nombre.value)){\n alert('Escriba su nombre y apellido respetando may˙sculas, min˙sculas y acentos.');\n\t\t solicitar.nombre.focus();\n return false;\n }\n return true;\n }", "function enviarNotificaionLike(tokenDestinatario, idUsuarioEmisor) {\n\tvar mensaje = \"El usuario \" + idUsuarioEmisor + \" ha dado like a una de tus fotos\";\n\tvar serverKey = 'AIzaSyBvLYFSkLLwFTZLJbvEAe2qxDV5EsAUeRg';\n\tvar notificacionProcesada = false;\n\tvar fcm = new FCM(serverKey);\n\n\tvar message = {\n\t to: tokenDestinatario, // required\n\t collapse_key: '', \n\t data: {},\n\t notification: {\n\t title: 'Notificacion desde Servidor',\n\t body: mensaje,\n\t icon: \"notificacion\",\n\t sound: \"default\",\n\t color: \"#00BCD4\"\n\t }\n\t};\n\n\tfcm.send(message, function(err, response){\n\t if (err) {\n\t console.log(\"Ocurrió un error el envio de la notificación\");\n\t notificacionProcesada = false;\n\t } else {\n\t console.log(\"Se envió la notificación exitosamente: \", response);\n\t notificacionProcesada = true;\n\t }\n\t});\n\n\treturn notificacionProcesada;\n}", "function karinaFaarNotifikation() {\n\n\n\n}", "checkTerritoryFreedom (terName) {\n var i = 0\n var res = false\n /* getting local map */\n var checkMap = THIS.getLocalMap()\n /* looping on local map */\n Object.keys(checkMap).forEach(key => {\n var continentName = checkMap[key]\n for (var countries in continentName) {\n if (countries === terName) {\n if (continentName[countries].player == -1) {\n // console.log('free')\n res = true\n } else {\n GameWindow.displayMessage('This territory is occupied !')\n res = false\n }\n }\n i++\n }\n })\n return res\n }", "function canSubmitForm()\n{\n return !isOriginDecodePending && !isDestinationDecodePending && !isDirectionsPending;\n}", "function habilitaConfirmacaoJustificativa() {\r\n\t\r\n\tvar obs = document.getElementById(\"form-dados-justificativa:inputObsMotivoAlteracao\");\r\n\tvar btnConfirmar = document.getElementById(\"form-dados-justificativa:btn-confirmar\");\r\n\tvar oidMotivo = document.getElementById(\"form-dados-justificativa:selectOidMotivoAlteracao\");\r\n\t\r\n\t// oid do motivo selecionado, conforme carregado pela tabela\r\n\t// mtv_alt_status_limite\r\n\t// oid = 5 (Outros) obrigatorio obs maior do que 2 carecters\r\n\t// oid = 4 (Ocorrencia de Restritivos) obrigatorio obs maior do que 2\r\n\t// carecters\r\n\tif (oidMotivo != null) {\r\n\t\t\r\n\t\tif (oidMotivo.value == \"\" || oidMotivo.value == null) {\r\n\t\t\tbtnConfirmar.disabled = \"disabled\";\r\n\t\t} else if ((oidMotivo.value == \"5\" && obs != null && obs.value.length > 2) \r\n\t\t\t\t|| (oidMotivo.value == \"4\" && obs != null && obs.value.length > 2)) {\r\n\t\t\tbtnConfirmar.disabled = \"\";\r\n\t\t} else if ((oidMotivo.value == \"5\" && obs != null && obs.value.length < 3) \r\n\t\t\t ||(oidMotivo.value == \"4\" && obs != null && obs.value.length < 3)) {\r\n\t\t\tbtnConfirmar.disabled = \"disabled\";\r\n\t\t} else {\r\n\t\t\tbtnConfirmar.disabled = \"\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n}", "function check_number(telefoonnummer) {\n fetch('https://desolate-thicket-70111.herokuapp.com/v1/webapi/signup/check_number', {\n method: 'POST', // or 'PUT'\n headers: {\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin' : '*'\n },\n body: JSON.stringify({\n telefoonnummer: telefoonnummer\n }),\n })\n .then(response => response.json())\n .then(data => {\n console.log(data);\n if(data.message == \"number available\") {\n setnumberAvailabe(true)\n } else {\n setnumberAvailabe(false)\n }\n })\n .catch((error) => {\n console.error('Error:', error);\n });\n }", "function pisarTerreno(nuevo){\n // Recorrer cada terreno del jugador\n for(var a = 0; a < jugando.terrenos.length; a++){\n // Si el ID coincide con el nuevo terreno\n if(nuevo.id == jugando.terrenos[a][0]){\n // Si tiene un peso, entonces aplica\n if(jugando.terrenos[a][1] != \"\"){\n return true;\n }\n else{\n return false;\n }\n }\n }\n}", "function trEnCurso() {\n return clienteCache.nombre == undefined\n}", "function verifForm(f)\r\n{\r\n var nameOk = verifName(f.name);\r\n var mailOk = verifMail(f.mail);\r\n var subjectOk = verifSubject(f.subject);\r\n var messageOk = verifMessage(f.message);\r\n\r\n if(nameOk && mailOk && subjectOk && messageOk)\r\n return true;\r\n else\r\n {\r\n alert(\"Please fill the fields correctly.\");\r\n return false;\r\n }\r\n}", "function validaPesquisaFaixaLote(){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tretorno = true;\r\n\t\r\n\tif(form.quadraOrigemID.value != form.quadraDestinoID.value){\r\n\t\tif(form.loteOrigem.value != form.loteDestino.value){\r\n\t\t\talert(\"Para realizar a pesquisa por faixa de Lotes as Localidade, os Setores Comerciais e as Quadras iniciais e finais devem ser iguais.\");\r\n\t\t\tform.loteDestino.focus();\r\n\t\t\tretorno = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif((form.loteOrigem.value != \"\" )\r\n\t\t&& (form.loteOrigem.value > form.loteDestino.value)){\r\n\t\talert(\"O n?mero do Lote Final deve ser maior ou igual ao Inicial.\");\r\n\t\t\tform.loteDestino.focus();\r\n\t\t\tretorno = false;\r\n\t}\r\n\t\r\n\treturn retorno;\r\n}", "function checkUrl() {\n const address = window.location.href;\n\n if (address.indexOf('?message=') !== -1) {\n if (address.indexOf('not-verified') !== -1) {\n setModalContent('Tài khoản của bạn chưa được kích hoạt');\n }\n else if (address.indexOf('invalid-verified') !== -1) {\n setModalContent('Mã kích hoạt tài khoản không hợp lệ');\n }\n else if (address.indexOf('?message=verified') !== -1) {\n setModalContent('Kích hoạt tài khoản thành công');\n }\n else if (address.indexOf('?message=invalid-forgot-pass') !== -1) {\n setModalContent('Đường dẫn phục hồi tài khoản không hợp lệ');\n }\n setShow(true);\n }\n else if (address.indexOf('?token=') !== -1) {\n var token = address.substr(address.indexOf('?token=') + '?token='.length);\n if (token.indexOf('#nghiatq') !== -1) {\n token = token.substr(0, token.indexOf('#nghiatq'));\n }\n localStorage.setItem('token', token);\n window.location.href = '/';\n }\n }", "function controlCodePostal () {\nconst codepostal = formValues.codepostal;\n \n if(regexcodePostal(codepostal)){\n document.querySelector(\"#Codepostal_manque\").textContent = \"\";\n \n return true;\n }else{\n document.querySelector(\"#Codepostal_manque\").textContent = \"codePostal: doit étre composé de 5 chiffres\";\n alert(\"codePostal: doit étre composé de 5 chiffres\");\n return false;\n }\n \n }", "function isItMyFloor(){\n if(current_floor_owner == user_email)return true;\n return false;\n /*\n //alert(\"Current Floor Owner: \" + current_floor_owner);\n //alert(\"My Email: \" + user_email);\n $.ajax({\n type: \"POST\",\n cache: false,\n url: \"/locking_turn_get_current_floor_owner/\",\n success: function (option) {\n current_floor_owner = option['current_floor_owner_srv'];\n //console.log(\"From Srv , Current Owner: \" + current_floor_owner);\n\n //if(current_floor_owner == user_email)return true;\n //return false;\n },\n error: function (xhr, status, error) {\n alert(\"Some Error Occured while Releasing Floor.\");\n },\n async:false\n\n });*/\n\n\n\n }", "function isOkEmail() {\n\n //The program looks there is the right format.\n let indexOfAt = emailUser.value.indexOf('@');\n let textBeforeAt = emailUser.value.slice(0, indexOfAt);\n let textAfterAt = emailUser.value.slice(indexOfAt+1, emailUser.value.length);\n let indexOfDot = textAfterAt.indexOf('.');\n let textBeforeDot = textAfterAt.slice(0, indexOfDot);\n let textAfterDot = textAfterAt.slice(indexOfDot+1, emailUser.value.length);\n\n //fThe program that there are all the elements and later the right format\n if (emailUser.value === \"\") {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_mailEmpty_EM');\n okEmail = false;\n } else if (!emailUser.value.includes('@')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_At_EM');\n return false;\n } else if(textAfterAt.length == 0 || (textAfterAt.length == 1 && indexOfDot == 0)) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_domain_EM');\n return false;\n } else if (!emailUser.value.includes('.')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_dot_EM');\n return false;\n } else if (emailUser.value.includes(' ')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_blank_Space_EM');\n return false;\n } else if (textBeforeAt.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else if (textBeforeDot.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else if (textAfterDot.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else {\n clearAllEmailErrors();\n return true;\n }\n }", "function helpvailida_correo(correo){\n\t emailRegex = /^[-\\w.%+]{1,64}@(?:[A-Z0-9-]{1,63}\\.){1,125}[A-Z]{2,63}$/i;\n\t if (emailRegex.test(correo)) {\n\t return true;\n\t }else{\n\t return false;\n\t }\n\t}", "function checkTypeContinue() {\n\t\tif (document.frmCadCliente.txtNumero.value == \"\") {\n\t\t\talert(\"Preencha o número da Localização da Empresa\");\n\t\t\tdocument.frmCadCliente.txtNumero.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (document.frmCadCliente.txtCep.value == \"\") {\n\t\t\talert(\"Preencha o campo Cep para Busca do Endereço de Coleta!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (isNaN(document.frmCadCliente.txtCep.value)) {\n\t\t\talert(\"Preencha o Cep somente com números!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (document.frmCadCliente.txtCep.value.length < 8) {\n\t\t\talert(\"Preencha corretamente o Campo Cep!\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\tdocument.getElementById(\"tableCadClienteEndereco\").style.display = 'none';\n\t\t\tif (!checkTypeColeta()) {\n\t\t\t\tdocument.getElementById(\"tableCadClienteContato\").style.display = 'block';\n\t\t\t} else {\n\t\t\t\tdocument.getElementById(\"tableCadClienteEnderecoColeta\").style.display = 'block';\n\t\t\t}\n\t\t}\n\t}", "function verificarEmpleadoConceptos(form) {\r\n\tvar secuencia=document.getElementById(\"secuencia\").value;\r\n\tvar registro=document.getElementById(\"registro\").value;\r\n\tvar accion=document.getElementById(\"accion\").value;\r\n\tvar codconcepto=document.getElementById(\"codconcepto\").value; codconcepto=codconcepto.trim();\r\n\tvar pdesde=document.getElementById(\"pdesde\").value; pdesde=pdesde.trim(); var esPdesde=esPContable(pdesde);\r\n\tvar phasta=document.getElementById(\"phasta\").value; phasta=phasta.trim(); var esPhasta=esPContable(phasta);\r\n\tvar codproceso=document.getElementById(\"codproceso\").value; codproceso=codproceso.trim();\r\n\tvar monto=document.getElementById(\"monto\").value; monto=monto.trim(); monto=monto.replace(\",\", \".\");\r\n\tvar cantidad=document.getElementById(\"cantidad\").value; cantidad=cantidad.trim(); cantidad=cantidad.replace(\",\", \".\");\r\n\tvar status=document.getElementById(\"status\").value; status=status.trim();\r\n\tif (document.getElementById(\"flagproceso\").checked) var flagproceso=\"S\"; else var flagproceso=\"N\";\r\n\t\r\n\tif (codconcepto==\"\" || status==\"\" || codproceso==\"\" || pdesde==\"\") msjError(1010);\r\n\telse if (isNaN(monto)) alert(\"¡MONTO INCORRECTO!\");\r\n\telse if (isNaN(cantidad)) alert(\"¡CANTIDAD INCORRECTA!\");\r\n\telse if (pdesde!=\"\" && !esPdesde) alert(\"¡PERIODO INCORRECTO!\");\r\n\telse if (phasta!=\"\" && !esPhasta) alert(\"¡PERIODO INCORRECTO!\");\r\n\telse if (pdesde!=\"\" && phasta!=\"\" && (!esPdesde || !esPhasta || (pdesde>phasta))) alert(\"¡PERIODO INCORRECTO!\");\r\n\t//else if (monto == 0) alert(\"¡NO SE PUEDE ASIGNAR UN CONCEPTO CON MONTO EN CERO!\");\r\n\telse {\r\n\t\t//\tCREO UN OBJETO AJAX PARA VERIFICAR QUE EL NUEVO REGISTRO NO EXISTA EN LA BASE DE DATOS\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"fphp_ajax_nomina.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"modulo=EMPLEADOS-CONCEPTOS&accion=\"+accion+\"&codpersona=\"+registro+\"&secuencia=\"+secuencia+\"&codconcepto=\"+codconcepto+\"&pdesde=\"+pdesde+\"&phasta=\"+phasta+\"&codproceso=\"+codproceso+\"&monto=\"+monto+\"&cantidad=\"+cantidad+\"&status=\"+status+\"&flagproceso=\"+flagproceso);\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tvar resp=ajax.responseText;\r\n\t\t\t\tif (resp!=0) alert (\"¡\"+resp+\"!\");\r\n\t\t\t\telse cargarPagina(form, \"empleados_conceptos.php\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function correoLanding() {\n var email = new RegExp(/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/);\n var correo=document.getElementById(\"entCorreo\").value;\n var resultado=email.test(correo);\n if (document.getElementById(\"entCorreo\").value !== \"\") {\n if(resultado){\n alert(\"Registro completado\");\n }else{\n alert(\"El correo ingresado es incorreto\");\n }\n } else {\n alert(\"No hay ingresado información\");\n }\n}", "function cadastrar(){\n\n\n if(emailU!=emailConfU){\n alert(\"O email não confere com o digitado no primeiro campo\");\n }\n else if(senhaU!=senhaConfU){\n alert(\"A senha não confere com a digitada no campo acima\");\n }\n else if(emailU==emailConfU && senhaU==senhaConfU){\n \n }\n}", "function valorTriangulo(){\n if(trianguloAparienciaInteraccion == true && trianguloAparienciaTono == true && trianguloAparienciaMirada == true && trianguloAparienciaLlanto == true){\n trianguloApariencia = true;\n }else{\n trianguloApariencia = false;\n }\n}", "function emailCheck(){\n return false;\n }", "function comprobar_envio(mensaje) {\n\tif (confirm(mensaje))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function es_mail(campo_nombre, cadena) {\n if ($('#' + campo_nombre).val().match(/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}$/)) {\n $('#VC_' + campo_nombre).hide('slow');\n $('#VC_' + campo_nombre).html('');\n return true;\n } else {\n $('#VC_' + campo_nombre).html(cadena);\n $('#VC_' + campo_nombre).addClass('VC_campo_requerido');\n $('#VC_' + campo_nombre).show('slow');\n return false;\n }\n}", "function controleNom(){\nconst nom = formValues.Nom;\n\nif(regexNomPrenom(nom)){\n document.querySelector(\"#nom_manque\").textContent = \"\";\n\n return true;\n}else{\n document.querySelector(\"#nom_manque\").textContent = \"Veuillez correctement replir ce champ\";\n alert(textAlert(nom));\n return false;\n }\n \n}", "function enIeCheck(tin) {\n var checksum = algorithms.reverseMultiplyAndSum(tin.split('').slice(0, 7).map(function(a) {\n return parseInt(a, 10);\n }), 8);\n if (tin.length === 9 && tin[8] !== 'W') checksum += (tin[8].charCodeAt(0) - 64) * 9;\n checksum %= 23;\n if (checksum === 0) return tin[7].toUpperCase() === 'W';\n return tin[7].toUpperCase() === String.fromCharCode(64 + checksum);\n} // Valid US IRS campus prefixes", "function verificarServicio(objeto){\n\t\tvalorBS=$(objeto).val();\n\t\t/**OBTENENEMOS CANTIDAD SI EXISTE GUIAS DE REMISION RELACIONADAS**/\n\t\tvar total=$('input[id^=\"accionAsociacionGuiarem\"][value!=\"0\"]').length;\n\t\tif(total>0){\n\t\t\t/**si es servicio***/\n\t\t\tif(valorBS=='S'){\n\t\t\t\tdocument.getElementById(\"buscar_producto\").readOnly = false;\n\t\t\t\t$(\"#idDivAgregarProducto\").show(200);\n\t\t\t}\n\t\t\t/**si es Bien**/\n\t\t\tif(valorBS=='B'){\n\t\t\t\tdocument.getElementById(\"buscar_producto\").readOnly = true;\n\t\t\t\t$(\"#idDivAgregarProducto\").hide(200);\n\t\t\t}\n\t\t}\n\t}", "function responder_registro() {\n\n if (objAjax.readyState == 4){\n if (objAjax.status == 200) {\n\n if (objAjax.responseText == \"false\") {\n\n alert(\"Datos introducidos incorrectos\");\n\n } else {\n\n mensaje_boton(\"Usuario añadido correctamente\", \"resumen_cita()\"); \n }\n }\n }\n}", "function valida_sesion_iniciada()\n{\n //validar si esta en alguna sesion\n id_plan = buscarlocal('id_plan');\n id_sesion = buscarlocal('id_sesion');\n\n\n if(id_plan === null && id_sesion === null)\n {\n console.log(\"no existe ninguno en local\");\n estadoPlan = false;\n estadoSesion = false;\n\n }else if(id_plan =! null && id_sesion === null)\n {\n console.log(\"solo existe el plan, mas no la sesion\");\n console.log(id_plan);\n estadoPlan = true;\n estadoSesion = false;\n\n }else\n {\n console.log(\"existen las dos en el local\");\n console.log(id_plan);\n console.log(id_sesion);\n estadoPlan = true;\n estadoSesion = true;\n }\n}", "function DatosCompletos()\r\n{\r\n var resp = true;\r\n // if (document.getElementById('cboSubEspecialidades').value == \"0\")\r\n\t// {\r\n\t\t//resp= false;\t\t\r\n\t //}\r\n if (document.getElementById('txtfechainicio').value == \"\")\r\n\t {\r\n\t\tresp= false;\t\t\r\n\t }\r\n if (document.getElementById('txtfechafin').value == \"\")\r\n\t {\r\n\t\tresp= false;\t\t\r\n\t }\r\n return resp;\r\n}", "function gps_enLocalizacionActual() {\n var sfecha = document.getElementById(\"sfecha\").value; \n return sfecha == 2;\n}", "function enIeCheck(tin) {\n var checksum = algorithms.reverseMultiplyAndSum(tin.split('').slice(0, 7).map(function (a) {\n return parseInt(a, 10);\n }), 8);\n\n if (tin.length === 9 && tin[8] !== 'W') {\n checksum += (tin[8].charCodeAt(0) - 64) * 9;\n }\n\n checksum %= 23;\n\n if (checksum === 0) {\n return tin[7].toUpperCase() === 'W';\n }\n\n return tin[7].toUpperCase() === String.fromCharCode(64 + checksum);\n} // Valid US IRS campus prefixes", "function checkForm(){\n\n\tif ((verifyElementWithId(\"name\"))\n\t\t&& (verifyElementWithId(\"name1\"))\n\t\t&& (verifyElementWithId(\"name2\"))\n\n\t\t&& (verifyElementWithId(\"way\"))\n\t\t&& (verifyElementWithId(\"textaddress\"))\n\t\t&& (verifyElementWithId(\"textaddressnumber\"))\n\t\t&& (verifyElementWithId(\"textpostalcode\"))\n\t\t&& (verifyElementWithId(\"city\"))\n\n\t\t&& (verifyElementWithId(\"emailbox\"))\n\t\t&& (verifyElementWithId(\"passwordbox\"))\n\t\t&& (verifyElementWithId(\"passwordrepeatbox\"))\n\n\t\t&& (verifyCheckBoxWithId(\"acceptconditions\"))\n\t\t&& (document.getElementById(\"passwordbox\").value == document.getElementById(\"passwordrepeatbox\").value)) {\n\n\t\talert(\"Su registro se ha enviado con éxito.\");\n\t\treturn true;\n\n\t} else {\n\n\t\treturn false;\n\t}\n\n}", "validarInformacion(){\n /** valida la informacion de los txt */\n if(this.generaValidacionControles() === 0){\n /** Se valida si se realizara un guardado o una actualizacion */\n if(this.state.objetoCliente.id === 0){\n /** Se realizara un guardado */\n return true;\n }else{\n /** Se llama el metodo que se encargara de indicar si se modifico algo o no */\n if(validaStateVsPropObj(this.state.objetoCliente,this.props.objCliente,'clientes')){\n return true;\n }else{\n /** Se asignan los valores del mensaje */\n this.mostrarControlMensaje(\"Se debe modificar al menos un campo para poder actualizar.\", 'danger', 'showMensaje');\n /** Se regresa el valor de que no cumplio la condicion */\n return false;\n }\n }\n }else{\n this.mostrarControlMensaje(\"Debe proporcionar toda la información.\", 'danger', 'showMensaje');\n /** Se regresa el valor de que no cumplio la condicion */\n return false;\n }\n }", "function thridPartyDisallowance() {\n var frm = document.frmDisallow;\n if (frm.disallowTPAddress.value.length < 41) {\n $(\"#statusFormDisallow\").css(\"background-color\", \"Salmon\");\n $(\"#statusFormDisallow\").html(\"You must inform appropriate information\");\n return\n }\n $(\"#statusFormDisallow\").css(\"background-color\", \"lightblue\");\n $(\"#statusFormDisallow\").html(\"Waiting for you to confirm the transaction in MetaMask or another Ethereum wallet software\");\n console.log(\"Sending... \" + frm.disallowTPAddress.value);\n contract.removeIssuers(frm.disallowTPAddress.value, {from: web3.eth.accounts[0], gas: 3000000, value: 0}, function (err, result) {\n if (!err) {\n $(\"#statusFormDisallow\").css(\"background-color\", \"yellow\");\n $(\"#statusFormDisallow\").text(\"Transaction sent. Wait until it is mined. Transaction hash: \" + result);\n waitForTxToBeMined(result, \"#statusFormDisallow\");\n } else {\n console.error(err);\n $(\"#statusFormDisallow\").css(\"background-color\", \"Salmon\");\n $(\"#statusFormDisallow\").html(\"Error \" + JSON.stringify(err));\n }\n });\n $(\"#btnStartOverDisallowance\").show();\n $(\"#btn3TPDisallowance\").hide();\n}", "function checkOk(data){\n if (data[0] != OK) {\n console.log(\"{\\\"error\\\": \\\"cannot establish comms with Testalator\\\"}\")\n return false;\n }\n return true;\n}", "function confirmarPedido() {\n valorTotal = valorPrato + valorBebida + valorSobremesa;\n const botao = document.querySelector(\".botao-confirmar\");\n if(botao.classList.contains(\"liberar-confirmacao\")) {\n nomeUsuario = prompt(\"Qual é o seu nome?\");\n enderecoUsuario = prompt(\"Qual é o seu endereço?\");\n mensagem = encodeURIComponent( `Olá, gostaria de fazer o pedido:\n - Prato: ${nomePrato}\n - Bebida: ${nomeBebida}\n - Sobremesa: ${nomeSobremesa}\n Total: R$ ${valorTotal.toFixed(2)}\n \n Nome: ${nomeUsuario}\n Endereço: ${enderecoUsuario}`);\n janelaConfirmacao();\n }\n}", "function entrar() {\n var senha = pass.value;\n\n // SE A SENHA FOR VALIDA\n if (dig == 1 && senha == 'recife' || dig == 2 && senha == 'manaus' || dig == 3 && senha == 'fortaleza') {\n telaSenha.style = 'display: none';\n cadeira.style = 'display: block';\n }\n // SE A SENHA FOR INVALIDA\n else {\n res.innerHTML += \"<p>Senha invalida!</p>\";\n contador++;\n }\n\n // SE AS TENTATIVAS FOREM EXCEDIDAS\n if (contador >= 4) {\n contador = 0;\n alert(\"Você excedeu o número de tentativas, sua conta está bloqueada, PROCURE O SUPORTE\");\n telaSenha.style = 'display: none';\n content.style = 'display: block';\n }\n}", "function checkValidMailUp(newemailUp, pass2Up, nombreup2, checkUp, id) {\n var url_base = $(\"#url_base\").val();\n console.log(\"esta es la base que trae\" + url_base);\n //gabi\n fetch(url_base + \"api/perfiles/updateUsuario\", {\n method: \"PUT\",\n headers: new Headers({\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n }),\n body:\n \"email=\" +\n newemailUp +\n \"&nombre=\" +\n nombreup2 +\n \"&owner=\" +\n checkUp +\n \"&pass=\" +\n pass2Up +\n \"&id=\" +\n id,\n })\n .then((resp) => resp.json())\n .then((respObj) => {\n //Espera la respuesta de la API y consulta siempre por 0 (cero), si es correcto.\n if (respObj.status == 0) {\n swal({\n title: \"Excelente!\",\n text: respObj.messege,\n icon: \"success\",\n }).then(function () {\n location.reload();\n });\n } else {\n swal({\n title: \"Algo Salió Mal!\",\n text: respObj.messege,\n type: \"danger\",\n }).then(function () {\n location.reload();\n });\n }\n })\n .catch((error) => {\n alert(error);\n });\n}", "function ajaxCheckAccountExchangePendingAffair(userId,userName){\n\ttry {\n\t\tvar requestCaller = new XMLHttpRequestCaller(this, \"ajaxEdocExchangeManager\", \"checkEdocExchangeHasPendingAffair\", false);\n\t\trequestCaller.addParameter(1, \"Long\", userId);\n\t\tvar rs = requestCaller.serviceRequest();\n\t\tif(rs!=\"0\"){\n\t\t\t\n\t\t\tif(userName!=''){\n\t\t\t\t//{0}\\u5c1a\\u6709\\u5f85\\u53d1\\u9001\\u6216\\u5f85\\u7b7e\\u6536\\u516c\\u6587\\u672a\\u5904\\u7406\\uff0c\\u8bf7\\u5148\\u5904\\u7406.\n\t\t\t\talert(v3x.getMessage(\"MainLang.edoc_alert_hasExchangePendingAffair\", userName));\n\t\t\t}else{\n\t\t\t\t//\\u6709\\u5f85\\u53d1\\u9001\\u6216\\u5f85\\u7b7e\\u6536\\u516c\\u6587\\u672a\\u5904\\u7406\\uff0c\\u4e0d\\u80fd\\u53d6\\u6d88\\u6240\\u6709\\u7684\\u516c\\u6587\\u6536\\u53d1\\u5458\\uff0c\\u8bf7\\u5148\\u5904\\u7406.\n\t\t\t\talert(v3x.getMessage(\"MainLang.edoc_alert_notdelteAllExchanger\"));\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tcatch (ex1) {\n\t\talert(\"Exception : \" + ex1);\n\t\treturn false;\n\t}\t\n}", "function validaPreenchimentoCamposFaixa(){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tretorno = true;\r\n\t\r\n\tif(form.localidadeOrigemID.value != \"\" && form.localidadeDestinoID.value == \"\"){\r\n\t\talert(\"Informe Localidade Final.\");\r\n\t\tform.localidadeDestinoID.focus();\r\n\t\tretorno = false;\r\n\t}else if(form.localidadeDestinoID.value != \"\" && form.localidadeOrigemID.value == \"\"){\r\n\t\talert(\"Informe Localidade Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\tif(form.setorComercialOrigemCD.value != \"\" && form.setorComercialDestinoCD.value == \"\"){\r\n\t\talert(\"Informe Setor Comercial Final.\");\r\n\t\tretorno = false;\r\n\t}else if(form.setorComercialDestinoCD.value != \"\" && form.setorComercialOrigemCD.value == \"\"){\r\n\t\talert(\"Informe Setor Comercial Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\tif(form.quadraOrigemID.value != \"\" && form.quadraDestinoID.value == \"\"){\r\n\t\talert(\"Informe Quadra Final.\");\r\n\t\tretorno = false;\r\n\t}else if(form.quadraDestinoID.value != \"\" && form.quadraOrigemID.value == \"\"){\r\n\t\talert(\"Informa Quadra Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\tif(form.loteOrigem.value != \"\" && form.loteDestino.value == \"\"){\r\n\t\talert(\"Informe Lote Final.\");\r\n\t\tretorno = false;\r\n\t}else if(form.loteDestino.value != \"\" && form.loteOrigem.value == \"\"){\r\n\t\talert(\"Informe Lote Inicial.\");\r\n\t\tretorno = false;\r\n\t}\r\n\t\r\n\treturn retorno;\r\n}", "function verifEmailBDD(ajaxResponse){\nvar json=JSON.parse(ajaxResponse);\nif(json[0]!=null){\n surligne(email, true);\n verifBDDEmail=true;\n}else{\n surligne(email, false);\n verifBDDEmail=false;\n }\n}", "verifyEditCedula() {\n if (this.cedulaWarning === true) {\n let Message = 'Advertnecia, Modificar la cedula podria ocacionar fallos en el sistema, ';\n Message = Message + 'se recomienda hacerlo solo en casos excepcionales. ';\n Message = Message + 'Queda bajo su responsabilidad los daños ocacionados por esta accion';\n const response = confirm(Message);\n if (response === true) {\n this.cedulaWarning = false;\n }\n else {\n this.cedulaWarning = true;\n }\n }\n }", "function validar_regla_descarga(){\n verifi_time_dowload = true;\n}", "function GuardarFirma(){\n\t\tvar mensaje=\"Procesando la información<br>Espere por favor\";\n\t\tjsShowWindowLoad(mensaje);\n\t\tvar tercero = $(\"#txtTercero\").val();\n var archivos = document.getElementById(\"txtexaminararchivosFirma\");\n var archivo = archivos.files;\n if (typeof archivo[0] !== \"undefined\") {\n if (archivo[0].type == \"image/png\") {\n $.post(\"../../controlador/fachada.php\", {\n\t\t\t\tclase: 'clsCertificados',\n\t\t\t\toper: 'guardarFirma',\n\t\t\t\tpIdTercero: tercero\n\t\t\t\t}, function(data) {\n\t\t\t\t\tif (data !== 0) {\n\t\t\t\t\t\tif (data !== -1) {\n\t\t\t\t\t\t\tGuardarArchivoFirma(data[0].pNombreFirma);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tjsRemoveWindowLoad();\n\t\t\t\t\t\t\tmostrarPopUpConfirmacion(\"No fue posible adicionar la firma digital\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}else {\n\t\t\t\t\t\tjsRemoveWindowLoad();\n\t\t\t\t\t\tmostrarPopUpError(\"Existe un error, consulte con el administrador\");\n\t\t\t\t\t}\n\t\t\t\t}, \"json\");\n } else {\n \tjsRemoveWindowLoad();\n mostrarPopUpConfirmacion('El formato de la imagen es incorrecto, debe ser PNG');\n }\n }else{\n \tjsRemoveWindowLoad();\n mostrarPopUpConfirmacion('Debe seleccionar un archivo para subir');\n }\n\t}", "function generalChecks(){\n checkSumGenerated = dataConv.generateCheckSum(data.slice(1,-2)); //No tiene en cuenta el caracter inicial ni los 2 finales (estos son el checksum)\n checkSumIncoming = data.substr(data.length - 2); //Toma solo los 2 ultimos caracteres de la respuesta\n if (checkSumGenerated !== checkSumIncoming){\n console.log(\"Checksum validation error, the response is not valid\");\n return false; \n }else{\n return true;\n }\n}", "formValidHandler (nom, prenom, naissance, adresse, email, telephone, classe){\r\n let result = {\r\n status : true,\r\n message : null,\r\n }\r\n if(!(nom && prenom && naissance && adresse && email && telephone && classe)){\r\n result.status = false;\r\n result.message = \"Veuillez bien renseigner tous les paramètres\";\r\n if(nom === false && prenom === true && adresse === true && email === true && telephone === true && classe === true){\r\n result.status = false;\r\n result.message = \"Veuillez bien renseigner la valeur du paramètre NOM.\";\r\n }else if(nom === true && prenom === false && adresse === true && email === true && telephone === true && classe === true){\r\n result.status = false;\r\n result.message = \"Veuillez bien renseigner la valeur du paramètre PRENOM.\";\r\n }else if(nom === true && prenom === true && adresse === false && email === true && telephone === true && classe === true){\r\n result.status = false;\r\n result.message = \"Veuillez bien renseigner la valeur du paramètre ADRESSE.\";\r\n }else if(nom === true && prenom === true && adresse === true && email === false && telephone === true && classe === true){\r\n result.status = false;\r\n result.message = \"La valeur du paramètre EMAIL.\";\r\n }else if(nom === true && prenom === true && adresse === true && email === true && telephone === false && classe === true){\r\n result.status = false;\r\n result.message = \"La valeur du TELEPHONE. Il est \\n\"+\r\n \" doit contenir 9 chiffre \";\r\n }else if(nom === true && prenom === true && adresse === true && email === true && telephone === true && classe === false){\r\n result.status = false;\r\n result.message = \"Veuillez choisir la classe \";\r\n }\r\n return result;\r\n }\r\n return result;\r\n }", "function modifierCode(){\n var numCompte = getNumCompteCourant()\n var codeActuel = prompt(\"Tapez votre code secret actuel\")\n var nouveauCode1 = prompt(\"Tapez le nouveau code secret\")\n var nouveauCode2 = prompt(\"Confirmer le nouveau code secret\")\n if (nouveauCode1 == nouveauCode2){\n var donnees = \"operation=modifierCode\" + \"&numCompte=\" + numCompte + \"&codeActuel=\" + codeActuel + \"&nouveauCode=\" + nouveauCode1\n buildRequest(donnees, notifierCode)\n }\n else{\n alert(\"Les mots de passe ne correspondent pas.\")\n options()\n }\n}", "function validarprovmat(){\n\n var rfc =document.getElementById('rfc').value;\n var oculto =document.getElementById('oculto').value;\n var route = \"http://localhost:8000/validarprovedormat/\"+rfc;\n\n $.get(route,function(res){\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idProvedor = res[0].id;\n document.getElementById(\"idProvedor\").value= idProvedor;\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].rfc != oculto ) {\n\n document.getElementById(\"errorRFC\").innerHTML = \"El Provedor que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n document.getElementById(\"errorRFC\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n});\n\n}", "function Deplacement_ennemiLimitrophe(Territoire){\r\n\tif (Territoire.army < 2) {return false}\r\n for (var i=0 ; i < Territoire.voisins.length ; i++){\r\n if (Territoire.proprietaire != Territoire.voisins[i].proprietaire ){\r\n return true\r\n }\r\n }\r\n return false\r\n}", "function chequearDatosEnvio(){\n // chequeo de calle, nropuerta, esquina\n let calle = document.getElementById(\"calle\").value;\n let nropuerta = document.getElementById(\"numeropuerta\").value;\n let esquina = document.getElementById(\"esquina\").value;\n let pais = document.getElementById(\"pais\").value;\n let envio = document.getElementById(\"metodoEnvio\").value;\n\n if(calle == \"\"){\n alert(\"Agregue una calle para el envío.\");\n return false;\n } else if(nropuerta == \"\"){\n alert(\"Agregue un número de puerta para el envío.\");\n return false;\n } else if(esquina == \"\"){\n alert(\"Agregue una esquina para el envío.\");\n return false\n } else if(pais == \"\"){\n alert(\"Agregue un país para el envío.\");\n return false;\n } else if(envio == 0){\n alert(\"Seleccione método de envío.\");\n return false;\n }\n\n return true;\n}", "function isAllValidationsOk() {\n\n if (jQuery.isEmptyObject(dataOrder.order.products)) {\n showNotification('info', 'Aviso', 'No puede cerrar ventas vacías.');\n return false;\n }\n\n if (isCreditClient && $('#input-pi-tag').val().trim() === '') {\n showNotification('info', 'Aviso', 'El campo TAG es obligatorio para los clientes a crédito.');\n return false;\n }\n\n if ($('#switch-pi-prod').prop('checked') || $('#switch-pi-late-prod').prop('checked')) {\n if ($('#pi-fecha').val() === '') {\n showNotification('info', 'Aviso', 'Debe especificar una fecha de entrega.');\n return false;\n }\n\n if ($('#pi-hora').val() === '0') {\n showNotification('info', 'Aviso', 'Debe especificar una hora de entrega.');\n return false;\n }\n\n if ($('#pi-sucursal-prod').val() === '0') {\n showNotification('info', 'Aviso', 'Debe especificar la sucursal de producción.');\n return false;\n }\n\n if ($('#pi-sucursal-deliv').val() === '0') {\n showNotification('info', 'Aviso', 'Debe especificar la sucursal de entrega.');\n return false;\n }\n }\n\n if (Math.abs($('#pi-input-transfer').val()) > 0 && $('#pi-pt-comprobante').val() === '') {\n showNotification('info', 'Aviso', 'Debe proporcionar el comprobante para el pago por transferencia.');\n return false;\n }\n\n if (dataOrder.order.clientId === ID_NACIONAL && $('#pi-input-soli-nacional').val().trim() === '') {\n showNotification('info', 'Aviso', 'Debe especificar el nombre de la persona que solicita el trabajo para NACIONAL.');\n $('#div-soli-nacional').show();\n return false;\n }\n\n if (isCreditClient && tipo_venta !== 'CRÉDITO' && asked_for_credit === false) {\n Swal.fire({\n title: 'Sugerencia',\n text: 'El tipo de venta sugerido para este cliente es CRÉDITO, ¿desea procesarlo como tal?',\n type: 'question',\n showCancelButton: true,\n confirmButtonText: 'Procesar como CRÉDITO',\n cancelButtonText: 'No, gracias',\n allowOutsideClick: false\n }).then((result) => {\n if (result.value) {\n setTipoPago('credito');\n } else {\n asked_for_credit = true;\n cerrarVenta();\n }\n });\n return false;\n }\n\n if ($('#switch-pi-prod').prop('checked') || $('#switch-pi-late-prod').prop('checked')) {\n if (entregaAntesDeHoy()) {\n showNotification('info', 'Aviso', 'No puede agendar ordenes de trabajos para días pasados.');\n return false;\n }\n\n let produce_otra_sucursal = parseInt($('#pi-sucursal-prod').val()) !== Poster.settings.spotId;\n\n if (getHoraActual() >= 12 && produce_otra_sucursal && entregaEsHoy()) {\n showNotification('info', 'Aviso', 'A partir del medio día, las ordenes de trabajo producidas en otra sucursal no pueden ser agendadas para el día de hoy.');\n return false;\n }\n\n if (entregaEsHoy() && produce_otra_sucursal && parseInt($('#pi-hora').val()) < 18) { // 18 hrs = 6 pm\n showNotification('info', 'Aviso', 'No puede agendar para antes de las 6 p.m. una orden que será procesada en otra sucursal.');\n return false;\n }\n }\n\n return true;\n}", "function ejercicio01(email){\n console.log(email);\n emails = 0;\n if(email == \"[email protected]\" || email == \"[email protected]\" || email == \"[email protected]\")\n {\n return true\n }\n else\n {\n return false;\n }\n}", "function checkCorreo(valor) {\n\t// if (valor == \"\") return false;\n\treturn regex.correo.test(valor);\n}", "function verificarTipoProceso(form, accion) {\r\n\tvar codigo=document.getElementById(\"codigo\").value; codigo=codigo.trim();\r\n\tvar descripcion=document.getElementById(\"descripcion\").value; descripcion=descripcion.trim();\r\n\tif (document.getElementById(\"activo\").checked) var status=\"A\"; else var status=\"I\";\r\n\tif (document.getElementById(\"flag\").checked) var flag=\"S\"; else var flag=\"N\";\r\n\tif (codigo==\"\" || descripcion==\"\") msjError(1010);\r\n\telse {\r\n\t\t//\tCREO UN OBJETO AJAX PARA VERIFICAR QUE EL NUEVO REGISTRO NO EXISTA EN LA BASE DE DATOS\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"fphp_ajax_nomina.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"modulo=TIPOPROCESO&accion=\"+accion+\"&codigo=\"+codigo+\"&descripcion=\"+descripcion+\"&status=\"+status+\"&flag=\"+flag);\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tvar resp=ajax.responseText;\r\n\t\t\t\tif (resp!=0) alert (\"¡\"+resp+\"!\");\r\n\t\t\t\telse location.href=\"tiposproceso.php?filtro=\"+form.filtro.value;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function is_it_salty_in_here(home) {\n // create request to create a new session\n fetch(\"https://fiber.salt.ch/en\", {\n method: 'GET'\n });\n\n return fetch(\"https://fiber.salt.ch/fiber-ui-service/public/eligibility/fiber/address/check\", {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': '(Comparis-Fiber-Checker github/b401)'\n },\n body: JSON.stringify(home)\n })\n .then(response => response.json())\n .catch(error => {\n console.log(error);\n });\n}", "function enviar_informe(){\r\n\t//alert(\"generando informe odontograma ...\");\r\n\tvar motivo_consulta = recopilarinfotextbox(\"odont_motivo_consulta\");\r\n\tswe = verificar_checkbox_examen();\r\n\tswd = verificar_checkbox_antecedentes();\r\n\tif(motivo_consulta.length >0){\r\n\t\tif(swd==true){\r\n\t\t\tif(swe==true){\r\n\t\tdesactivarelementoFormulario(\"envio\");\t\r\n\t\tdesactivarelementoFormulario(\"anular\");\t\r\n\t\t//informe general\r\n\t\tvar\tinforme_general_DATA = \"\";\r\n\t\tinforme_general_DATA+=motivo_consulta+\"&\";\r\n\t\tinforme_general_DATA+=recopilarinfotextbox(\"odont_antecendentes_medicos\")+\"&\";\r\n\t\tinforme_general_DATA+=recopilarinfotextbox(\"odont_examen_clinico\")+\"&\";\r\n\t\tinforme_general_DATA+=recopilarinfotextbox(\"odont_evolucion\")+\"&\";\r\n\t\tinforme_general_DATA+=recopilarinfotextbox(\"odont_actividades_prevencion\")+\"&\";\r\n\t\tinforme_general_DATA+=recopilarinfotextbox(\"odont_actividades_limitacion\")+\"&\";\r\n\t\t\r\n\t\t\r\n\t\t//promocion y prevencion\r\n\t\tvar\tinforme_prom_prev_DATA = \"\";\r\n\t\tinforme_prom_prev_DATA+=recopilarinfotextbox(\"vecesCepilla\")+\"&\";\r\n\t\tinforme_prom_prev_DATA+=recopilarinfoRadios(\"cepillo\")+\"&\";\r\n\t\tinforme_prom_prev_DATA+=recopilarinfoRadios(\"seda\")+\"&\";\r\n\t\tinforme_prom_prev_DATA+=recopilarinfoRadios(\"enjuague\")+\"&\";\r\n\t\tinforme_prom_prev_DATA+=recopilarinfotextbox(\"cop\")+\"&\";\r\n\t\tinforme_prom_prev_DATA+=recopilarinfotextbox(\"ceo\")+\"&\";\r\n\t\tinforme_prom_prev_DATA+=recopilarinfoRadios(\"EstHig\")+\"&\";\r\n\t\t\r\n\t\t//educacion salud oral\r\n\t\tvar\tinforme_edu_oral_DATA = \"\";\r\n\t\tinforme_edu_oral_DATA+=recopilarinfoRadios(\"edu1\")+\"&\";\r\n\t\tinforme_edu_oral_DATA+=recopilarinfoRadios(\"edu2\")+\"&\";\r\n\t\tinforme_edu_oral_DATA+=recopilarinfoRadios(\"edu3\")+\"&\";\r\n\t\tinforme_edu_oral_DATA+=recopilarinfoRadios(\"edu4\")+\"&\";\r\n\t\tinforme_edu_oral_DATA+=recopilarinfoRadios(\"edu5\")+\"&\";\r\n\t\tinforme_edu_oral_DATA+=recopilarinfoRadios(\"edu6\")+\"&\";\r\n\t\tinforme_edu_oral_DATA+=recopilarinfoRadios(\"edu7\")+\"&\";\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//antecedentes medicos y odontologicos\r\n\t\t//alergia\r\n\t\tvar\talergia_DATA = \"\";\r\n\t\talergia_DATA+=\"1\"+\"&\";\r\n\t\talergia_DATA+=recopilarinfoRadios(\"odont_alergia\")+\"&\";\r\n\t\talergia_DATA+=recopilarinfotextbox(\"txt_alergias\")+\"&\";\r\n\t\t//hemorragias\r\n\t\tvar\themorragias_DATA = \"\";\r\n\t\themorragias_DATA+=\"2\"+\"&\";\r\n\t\themorragias_DATA+=recopilarinfoRadios(\"odont_hemorragia\")+\"&\";\r\n\t\themorragias_DATA+=recopilarinfotextbox(\"txt_hemorragia\")+\"&\";\r\n\t\t//enfermedades respiratorias\r\n\t\tvar\tenf_respiratorias_DATA = \"\";\r\n\t\tenf_respiratorias_DATA+=\"3\"+\"&\";\r\n\t\tenf_respiratorias_DATA+=recopilarinfoRadios(\"odont_enf_respiratorias\")+\"&\";\r\n\t\tenf_respiratorias_DATA+=recopilarinfotextbox(\"txt_enf_respiratorias\")+\"&\";\r\n\t\t//cardiopatias\r\n\t\tvar\tcardiopatias_DATA = \"\";\r\n\t\tcardiopatias_DATA+=\"4\"+\"&\";\r\n\t\tcardiopatias_DATA+=recopilarinfoRadios(\"odont_cardiopatias\")+\"&\";\r\n\t\tcardiopatias_DATA+=recopilarinfotextbox(\"txt_cardiopatias\")+\"&\";\r\n\t\t//fiebre reumatica\r\n\t\tvar\tfiebre_reumatica_DATA = \"\";\r\n\t\tfiebre_reumatica_DATA+=\"5\"+\"&\";\r\n\t\tfiebre_reumatica_DATA+=recopilarinfoRadios(\"odont_fiebre_reumatica\")+\"&\";\r\n\t\tfiebre_reumatica_DATA+=recopilarinfotextbox(\"txt_fiebre_reumatica\")+\"&\";\r\n\t\t//enfermedades renales\r\n\t\tvar\tenf_renales_DATA = \"\";\r\n\t\tenf_renales_DATA+=\"6\"+\"&\";\r\n\t\tenf_renales_DATA+=recopilarinfoRadios(\"odont_enf_renales\")+\"&\";\r\n\t\tenf_renales_DATA+=recopilarinfotextbox(\"txt_enf_renales\")+\"&\";\r\n\t\t//hepatitis\r\n\t\tvar\thepatitis_DATA = \"\";\r\n\t\thepatitis_DATA+=\"7\"+\"&\";\r\n\t\thepatitis_DATA+=recopilarinfoRadios(\"odont_hepatitis\")+\"&\";\r\n\t\thepatitis_DATA+=recopilarinfotextbox(\"txt_hepatitis\")+\"&\";\r\n\t\t//transtornos gastricos\r\n\t\tvar\ttrans_gastricos_DATA = \"\";\r\n\t\ttrans_gastricos_DATA+=\"8\"+\"&\";\r\n\t\ttrans_gastricos_DATA+=recopilarinfoRadios(\"odont_trans_gastricos\")+\"&\";\r\n\t\ttrans_gastricos_DATA+=recopilarinfotextbox(\"txt_trans_gastricos\")+\"&\";\r\n\t\t//tension arterial\r\n\t\tvar\ttension_arterial_DATA = \"\";\r\n\t\ttension_arterial_DATA+=\"9\"+\"&\";\r\n\t\ttension_arterial_DATA+=recopilarinfoRadios(\"odont_tension_arterial\")+\"&\";\r\n\t\ttension_arterial_DATA+=recopilarinfotextbox(\"txt_tension_arterial\")+\"&\";\r\n\t\t//diabetes\r\n\t\tvar\tdiabetes_DATA = \"\";\r\n\t\tdiabetes_DATA+=\"10\"+\"&\";\r\n\t\tdiabetes_DATA+=recopilarinfoRadios(\"odont_diabetes\")+\"&\";\r\n\t\tdiabetes_DATA+=recopilarinfotextbox(\"txt_diabetes\")+\"&\";\r\n\t\t//ingesta medicamentos\r\n\t\tvar\tmedicamentos_DATA = \"\";\r\n\t\tmedicamentos_DATA+=\"11\"+\"&\";\r\n\t\tmedicamentos_DATA+=recopilarinfoRadios(\"odont_medicamentos\")+\"&\";\r\n\t\tmedicamentos_DATA+=recopilarinfotextbox(\"txt_medicamentos\")+\"&\";\r\n\t\t//cirugias(incluso orales)\r\n\t\tvar\tcirugias_DATA = \"\";\r\n\t\tcirugias_DATA+=\"12\"+\"&\";\r\n\t\tcirugias_DATA+=recopilarinfoRadios(\"odont_cirugias\")+\"&\";\r\n\t\tcirugias_DATA+=recopilarinfotextbox(\"txt_cirugias\")+\"&\";\r\n\t\t//uso de protesis dental o aparatologia oral\r\n\t\tvar\tprotesis_DATA = \"\";\r\n\t\tprotesis_DATA+=\"13\"+\"&\";\r\n\t\tprotesis_DATA+=recopilarinfoRadios(\"odont_protesis\")+\"&\";\r\n\t\tprotesis_DATA+=recopilarinfotextbox(\"txt_protesis\")+\"&\";\r\n\t\t//HIV\r\n\t\tvar\thiv_DATA = \"\";\r\n\t\thiv_DATA+=\"14\"+\"&\";\r\n\t\thiv_DATA+=recopilarinfoRadios(\"odont_hiv\")+\"&\";\r\n\t\thiv_DATA+=recopilarinfotextbox(\"txt_hiv\")+\"&\";\r\n\t\t//extracciones dentales\r\n\t\tvar\textracciones_DATA = \"\";\r\n\t\textracciones_DATA+=\"15\"+\"&\";\r\n\t\textracciones_DATA+=recopilarinfoRadios(\"odont_extraciones\")+\"&\";\r\n\t\textracciones_DATA+=recopilarinfotextbox(\"txt_extracciones\")+\"&\";\r\n\t\t//enfermedades orales\r\n\t\tvar\tenf_orales_DATA = \"\";\r\n\t\tenf_orales_DATA+=\"16\"+\"&\";\r\n\t\tenf_orales_DATA+=recopilarinfoRadios(\"odont_enf_orales\")+\"&\";\r\n\t\tenf_orales_DATA+=recopilarinfotextbox(\"txt_enf_orales\")+\"&\";\r\n\t\t//antecedentes medicos otros\r\n\t\tvar\tant_familiares_DATA = \"\";\r\n\t\tant_familiares_DATA+=\"17\"+\"&\";\r\n\t\tant_familiares_DATA+=recopilarinfoRadios(\"odont_ant_familiares\")+\"&\";\r\n\t\tant_familiares_DATA+=recopilarinfotextbox(\"txt_ant_familiares\")+\"&\";\r\n\t\t//antecedentes familiares\r\n\t\tvar\tant_med_otros_DATA = \"\";\r\n\t\tant_med_otros_DATA+=\"18\"+\"&\";\r\n\t\tant_med_otros_DATA+=recopilarinfoRadios(\"odont_ant_med_otros\")+\"&\";\r\n\t\tant_med_otros_DATA+=recopilarinfotextbox(\"txt_ant_medicos_otros\")+\"&\";\r\n\t\t\r\n\t\t\r\n\t\t//examen clinico\r\n\t\t//lengua\r\n\t\tvar\tlengua_DATA = \"\";\r\n\t\tlengua_DATA+=\"1\"+\"&\";\r\n\t\tlengua_DATA+=recopilarinfoRadios(\"odont_lengua\")+\"&\";\r\n\t\tlengua_DATA+=recopilarinfotextbox(\"txt_lengua\")+\"&\";\r\n\t\t//carrillos\r\n\t\tvar\tcarrillos_DATA = \"\";\r\n\t\tcarrillos_DATA+=\"2\"+\"&\";\r\n\t\tcarrillos_DATA+=recopilarinfoRadios(\"odont_carrillos\")+\"&\";\r\n\t\tcarrillos_DATA+=recopilarinfotextbox(\"txt_carillos\")+\"&\";\r\n\t\t//abrasion\r\n\t\tvar\tabrasion_DATA = \"\";\r\n\t\tabrasion_DATA+=\"3\"+\"&\";\r\n\t\tabrasion_DATA+=recopilarinfoRadios(\"odont_abrasion\")+\"&\";\r\n\t\tabrasion_DATA+=recopilarinfotextbox(\"txt_abrasion\")+\"&\";\r\n\t\t//atricion\r\n\t\tvar\tatricion_DATA = \"\";\r\n\t\tatricion_DATA+=\"4\"+\"&\";\r\n\t\tatricion_DATA+=recopilarinfoRadios(\"odont_atricion\")+\"&\";\r\n\t\tatricion_DATA+=recopilarinfotextbox(\"txt_atricion\")+\"&\";\r\n\t\t//hipoplasias\r\n\t\tvar\thipoplasias_DATA = \"\";\r\n\t\thipoplasias_DATA+=\"5\"+\"&\";\r\n\t\thipoplasias_DATA+=recopilarinfoRadios(\"odont_hipoplasias\")+\"&\";\r\n\t\thipoplasias_DATA+=recopilarinfotextbox(\"txt_hipoplasias\")+\"&\";\r\n\t\t//gingivitis marginal\r\n\t\tvar\tgin_marginal_DATA = \"\";\r\n\t\tgin_marginal_DATA+=\"6\"+\"&\";\r\n\t\tgin_marginal_DATA+=recopilarinfoRadios(\"odont_gin_marginal\")+\"&\";\r\n\t\tgin_marginal_DATA+=recopilarinfotextbox(\"txt_gin_marginal\")+\"&\";\r\n\t\t//gingivitis difusa\r\n\t\tvar\tgin_difusa_DATA = \"\";\r\n\t\tgin_difusa_DATA+=\"7\"+\"&\";\r\n\t\tgin_difusa_DATA+=recopilarinfoRadios(\"odont_gin_difusa\")+\"&\";\r\n\t\tgin_difusa_DATA+=recopilarinfotextbox(\"txt_gin_difusa\")+\"&\";\r\n\t\t//micrognasia\r\n\t\tvar\tmicrognasia_DATA = \"\";\r\n\t\tmicrognasia_DATA+=\"8\"+\"&\";\r\n\t\tmicrognasia_DATA+=recopilarinfoRadios(\"odont_micrognasia\")+\"&\";\r\n\t\tmicrognasia_DATA+=recopilarinfotextbox(\"txt_micrognasia\")+\"&\";\r\n\t\t//macrognasia\r\n\t\tvar\tmacrognasia_DATA = \"\";\r\n\t\tmacrognasia_DATA+=\"9\"+\"&\";\r\n\t\tmacrognasia_DATA+=recopilarinfoRadios(\"odont_macrognasia\")+\"&\";\r\n\t\tmacrognasia_DATA+=recopilarinfotextbox(\"txt_macrognasia\")+\"&\";\r\n\t\t//desviacion linea media\r\n\t\tvar\tdesviacionlm_DATA = \"\";\r\n\t\tdesviacionlm_DATA+=\"10\"+\"&\";\r\n\t\tdesviacionlm_DATA+=recopilarinfoRadios(\"odont_desviacionlm\")+\"&\";\r\n\t\tdesviacionlm_DATA+=recopilarinfotextbox(\"txt_desviacionlm\")+\"&\";\r\n\t\t//malposicion\r\n\t\tvar\tmalposicion_DATA = \"\";\r\n\t\tmalposicion_DATA+=\"11\"+\"&\";\r\n\t\tmalposicion_DATA+=recopilarinfoRadios(\"odont_malposicion\")+\"&\";\r\n\t\tmalposicion_DATA+=recopilarinfotextbox(\"txt_malposicion\")+\"&\";\r\n\t\t//atm\r\n\t\tvar\tatm_DATA = \"\";\r\n\t\tatm_DATA+=\"12\"+\"&\";\r\n\t\tatm_DATA+=recopilarinfoRadios(\"odont_atm\")+\"&\";\r\n\t\tatm_DATA+=recopilarinfotextbox(\"txt_atm\")+\"&\";\r\n\t\t//habitos orales\r\n\t\tvar\thab_orales_DATA = \"\";\r\n\t\thab_orales_DATA+=\"13\"+\"&\";\r\n\t\thab_orales_DATA+=recopilarinfoRadios(\"odont_hab_orales\")+\"&\";\r\n\t\thab_orales_DATA+=recopilarinfotextbox(\"txt_hab_orales\")+\"&\";\r\n\t\t//paladar blando\r\n\t\tvar\tpaladar_blando_DATA = \"\";\r\n\t\tpaladar_blando_DATA+=\"14\"+\"&\";\r\n\t\tpaladar_blando_DATA+=recopilarinfoRadios(\"odont_paladar_blando\")+\"&\";\r\n\t\tpaladar_blando_DATA+=recopilarinfotextbox(\"txt_paladar_blando\")+\"&\";\r\n\t\t//piso de boca\r\n\t\tvar\tpiso_boca_DATA = \"\";\r\n\t\tpiso_boca_DATA+=\"15\"+\"&\";\r\n\t\tpiso_boca_DATA+=recopilarinfoRadios(\"odont_piso_boca\")+\"&\";\r\n\t\tpiso_boca_DATA+=recopilarinfotextbox(\"txt_piso_boca\")+\"&\";\r\n\t\t//supernumerarios\r\n\t\tvar\tsupernumerarios_DATA = \"\";\r\n\t\tsupernumerarios_DATA+=\"16\"+\"&\";\r\n\t\tsupernumerarios_DATA+=recopilarinfoRadios(\"odont_supernumerarios\")+\"&\";\r\n\t\tsupernumerarios_DATA+=recopilarinfotextbox(\"txt_supernumerarios\")+\"&\";\r\n\t\t//hipodoncia\r\n\t\tvar\thipodoncia_DATA = \"\";\r\n\t\thipodoncia_DATA+=\"17\"+\"&\";\r\n\t\thipodoncia_DATA+=recopilarinfoRadios(\"odont_hipodoncia\")+\"&\";\r\n\t\thipodoncia_DATA+=recopilarinfotextbox(\"txt_hipodoncia\")+\"&\";\r\n\t\t//fracturas\r\n\t\tvar\tfracturas_DATA = \"\";\r\n\t\tfracturas_DATA+=\"18\"+\"&\";\r\n\t\tfracturas_DATA+=recopilarinfoRadios(\"odont_fracturas\")+\"&\";\r\n\t\tfracturas_DATA+=recopilarinfotextbox(\"txt_fracturas\")+\"&\";\r\n\t\t//periodontitis\r\n\t\tvar\tperiodontitis_DATA = \"\";\r\n\t\tperiodontitis_DATA+=\"19\"+\"&\";\r\n\t\tperiodontitis_DATA+=recopilarinfoRadios(\"odont_periodontitis\")+\"&\";\r\n\t\tperiodontitis_DATA+=recopilarinfotextbox(\"txt_periodontitis\")+\"&\";\r\n\t\t//retracciones\r\n\t\tvar\tretracciones_DATA = \"\";\r\n\t\tretracciones_DATA+=\"20\"+\"&\";\r\n\t\tretracciones_DATA+=recopilarinfoRadios(\"odont_retracciones\")+\"&\";\r\n\t\tretracciones_DATA+=recopilarinfotextbox(\"txt_retracciones\")+\"&\";\r\n\t\t//torus\r\n\t\tvar\ttorus_DATA = \"\";\r\n\t\ttorus_DATA+=\"21\"+\"&\";\r\n\t\ttorus_DATA+=recopilarinfoRadios(\"odont_torus\")+\"&\";\r\n\t\ttorus_DATA+=recopilarinfotextbox(\"txt_torus\")+\"&\";\r\n\t\t//sobremordida vertical\r\n\t\tvar\tsob_vertical_DATA = \"\";\r\n\t\tsob_vertical_DATA+=\"22\"+\"&\";\r\n\t\tsob_vertical_DATA+=recopilarinfoRadios(\"odont_sob_vertical\")+\"&\";\r\n\t\tsob_vertical_DATA+=recopilarinfotextbox(\"txt_sob_vertical\")+\"&\";\r\n\t\t//sobremordida horizontal\r\n\t\tvar\tsob_horizontal_DATA = \"\";\r\n\t\tsob_horizontal_DATA+=\"23\"+\"&\";\r\n\t\tsob_horizontal_DATA+=recopilarinfoRadios(\"odont_sob_horizontal\")+\"&\";\r\n\t\tsob_horizontal_DATA+=recopilarinfotextbox(\"txt_sob_horizontal\")+\"&\";\r\n\t\t//otros\r\n\t\tvar\tex_otros_DATA = \"\";\r\n\t\tex_otros_DATA+=\"24\"+\"&\";\r\n\t\tex_otros_DATA+=recopilarinfoRadios(\"odont_ex_clinico_otros\")+\"&\";\r\n\t\tex_otros_DATA+=recopilarinfotextbox(\"txt_ex_clinico_otros\")+\"&\";\r\n\t\t\r\n\t\t\r\n\t\timagenOdontograma_DATA = ObtenerCanvasDecodificado64(\"canvas_odontograma\")+\"&\";\r\n\t\tajax = getXMLObject();\r\n\t\tajax.open(\"POST\",\"Odont_datos\", true);\r\n\t\tajax.onreadystatechange = function() {\r\n\t\t\tif (ajax.readyState == 4) {\r\n\t\t\t\tvar resultado = ajax.responseText.split(';');\r\n\t\t\t\t\r\n\t\t\t\talert(resultado[1]);\r\n\t\t\t\t\r\n\t\t\t\tif (resultado[0]==\"1\"){\r\n\t\t\t\t\talert(\"puedes visualizar tu informe aca\");\r\n\t\t\t\t\tmostrarInformeOdontograma(resultado[2]);\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\talert(\"ERROR AL GENERAR INFORME\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\twindow.location =\"agm_AtencionPaciente.jsp?CodHorarioMedico=\"+codhormed+\"&CodPac=\"+codpac+\"&DocPaciente=\"+numPac+\"&CodAdm=\"+codadm;\r\n\t\t\t}\t\t//window.location.reload();\t\t\t\t\r\n\t\t};\r\n\t ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded;charset=utf-8');\r\n\t\t\tajax.send(\r\n\t\t// Datos generales Informe\r\n\t\t\"codpaciente=\" + codpacientediagnostico\r\n\t\t+ \"&codusuario=\" + recopilarinfotextbox(\"txtUsuario\")\r\n\t\t+\"&admpaciente=\" +codadm\r\n\t\t+ \"&informe_general=\"+encodeURIComponent(informe_general_DATA)\r\n\t\t+ \"&imagen_odontograma=\"+encodeURIComponent(imagenOdontograma_DATA)\r\n\t\t//antecedentes medicos y odontologicos\r\n\t\t+ \"&alergias=\"+encodeURIComponent(alergia_DATA)\r\n\t\t+ \"&hemorragias=\"+encodeURIComponent(hemorragias_DATA)\r\n\t\t+ \"&enf_respiratorias=\"+encodeURIComponent(enf_respiratorias_DATA)\r\n\t\t+ \"&cardiopatias=\"+encodeURIComponent(cardiopatias_DATA)\r\n\t\t+ \"&fiebre_reumatica=\"+encodeURIComponent(fiebre_reumatica_DATA)\r\n\t\t+ \"&enf_renales=\"+encodeURIComponent(enf_renales_DATA)\r\n\t\t+ \"&hepatitis=\"+encodeURIComponent(hepatitis_DATA)\r\n\t\t+ \"&trans_gastricos=\"+encodeURIComponent(trans_gastricos_DATA)\r\n\t\t+ \"&tension_arterial=\"+encodeURIComponent(tension_arterial_DATA)\r\n\t\t+ \"&diabetes=\"+encodeURIComponent(diabetes_DATA)\r\n\t\t+ \"&medicamentos=\"+encodeURIComponent(medicamentos_DATA)\r\n\t\t+ \"&cirugias=\"+encodeURIComponent(cirugias_DATA)\r\n\t\t+ \"&protesis=\"+encodeURIComponent(protesis_DATA)\r\n\t\t+ \"&hiv=\"+encodeURIComponent(hiv_DATA)\r\n\t\t+ \"&extracciones=\"+encodeURIComponent(extracciones_DATA)\r\n\t\t+ \"&enf_orales=\"+encodeURIComponent(enf_orales_DATA)\r\n\t\t+ \"&ant_familiares=\"+encodeURIComponent(ant_familiares_DATA)\r\n\t\t+ \"&ant_med_otros=\"+encodeURIComponent(ant_med_otros_DATA)\r\n\t\t//examen clinico\r\n\t\t+ \"&lengua=\"+encodeURIComponent(lengua_DATA)\r\n\t\t+ \"&carrillos=\"+encodeURIComponent(carrillos_DATA)\r\n\t\t+ \"&abrasion=\"+encodeURIComponent(abrasion_DATA)\r\n\t\t+ \"&atricion=\"+encodeURIComponent(atricion_DATA)\r\n\t\t+ \"&hipoplasias=\"+encodeURIComponent(hipoplasias_DATA)\r\n\t\t+ \"&gin_marginal=\"+encodeURIComponent(gin_marginal_DATA)\r\n\t\t+ \"&gin_difusa=\"+encodeURIComponent(gin_difusa_DATA)\r\n\t\t+ \"&micrognasia=\"+encodeURIComponent(micrognasia_DATA)\r\n\t\t+ \"&macrognasia=\"+encodeURIComponent(macrognasia_DATA)\r\n\t\t+ \"&desviacionlm=\"+encodeURIComponent(desviacionlm_DATA)\r\n\t\t+ \"&malposicion=\"+encodeURIComponent(malposicion_DATA)\r\n\t\t+ \"&atm=\"+encodeURIComponent(atm_DATA)\r\n\t\t+ \"&hab_orales=\"+encodeURIComponent(hab_orales_DATA)\r\n\t\t+ \"&paladar_blando=\"+encodeURIComponent(paladar_blando_DATA)\r\n\t\t+ \"&piso_boca=\"+encodeURIComponent(piso_boca_DATA)\r\n\t\t+ \"&supernumerarios=\"+encodeURIComponent(supernumerarios_DATA)\r\n\t\t+ \"&hipodoncia=\"+encodeURIComponent(hipodoncia_DATA)\r\n\t\t+ \"&fracturas=\"+encodeURIComponent(fracturas_DATA)\r\n\t\t+ \"&periodontitis=\"+encodeURIComponent(periodontitis_DATA)\r\n\t\t+ \"&retracciones=\"+encodeURIComponent(retracciones_DATA)\r\n\t\t+ \"&torus=\"+encodeURIComponent(torus_DATA)\r\n\t\t+ \"&sob_vertical=\"+encodeURIComponent(sob_vertical_DATA)\r\n\t\t+ \"&sob_horizontal=\"+encodeURIComponent(sob_horizontal_DATA)\r\n\t\t+ \"&ex_otros=\"+encodeURIComponent(ex_otros_DATA)\r\n\t\t//promocion y prevencion\r\n\t\t+ \"&prom_prev=\"+encodeURIComponent(informe_prom_prev_DATA)\r\n\t\t\r\n\t\t//educacion oral\r\n\t\t+ \"&edu_oral=\"+encodeURIComponent(informe_edu_oral_DATA)\r\n\t\t\r\n\t\t// Dato opcion envio\r\n\t\t+ \"&opcion=1\"\r\n\t );\r\n\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\talert(cad_alert_ex);\r\n\t\t\t\t}\r\n\t\t}else{\r\n\t\t\talert(cad_alert_ant);\r\n\t\t}\r\n\t}else{//fin si\r\n\t\talert(\"Realice el motivo de consulta del Informe\");\r\n\t\r\n\t}\r\n\t\r\n}", "function confirmarCambiosAuditoria()\n{\n\n // CERRAMOS MODAL CONFIRMAR CAMBIOS AUDITORIA...\n $('#modalConfirmarCambiosAuditoria').modal('hide');\n showLoading()\n\n unidadNegocio = document.getElementById('sel_unidad_organizativa').value;\n unidadNegocioText = $(\"#sel_unidad_organizativa option:selected\").text()\n sede = document.getElementById('sel_sede').value;\n sedeText = $(\"#sel_sede option:selected\").text()\n tipoAuditoria = document.getElementById('sel_tipo_auditoria').value;\n tipoAuditoriaText = $(\"#sel_tipo_auditoria option:selected\").text()\n fechaInicio = document.getElementById('tx_date_start_auditoria').value;\n fechaFin = document.getElementById('tx_date_end_auditoria').value;\n var ver = document.getElementById(\"btnVerAuditoria_\"+id_auditoria);\n Code = ver.getAttribute(\"Code\")\n Description = ver.getAttribute(\"Description\")\n StatusEvaluacionId = ver.getAttribute(\"StatusEvaluacionId\")\n Created_by = ver.getAttribute(\"Created_by\")\n\n normasText = ver.getAttribute(\"Code_Normas\")\n console.log(\"normasText\",normasText)\n console.log(\"Code\",Code)\n\n //si es 1 (observada)\n if(EstatusEvaluacionId==1)\n EstatusEvaluacionId = 2 // lapasamos a correguida\n\n console.log(\"!*!*!*! EstatusEvaluacionId \",EstatusEvaluacionId)\n StatusId = ver.getAttribute(\"StatusId\")\n DescriptionStatus = ver.getAttribute(\"DescriptionStatus\")\n //alert(\"StatusEvaluacionId \" +StatusEvaluacionId)\n\n // console.log(\"fechaInicio1 \",fechaInicio)\n // console.log(\"fechaFin2 \",fechaFin)\n // console.log(ver.getAttribute(\"Inicio2\"))\n // console.log(ver.getAttribute(\"Fin2\"))\n // console.log(\"fechaInicio \",fechaInicio)\n // console.log(\"fechaFin \",fechaFin)\n //return false;\n\n if( (fechaInicio!=ver.getAttribute(\"Inicio2\") || fechaFin != ver.getAttribute(\"Fin2\")) && (StatusEvaluacionId==3) )\n {\n //alert(\"Cambiar estatus a reprogramada \"+StatusEvaluacionId)\n\n DescriptionStatus = \"Reprogramada\";\n StatusId = 3;\n }\n\n fechaInicio = formatearFechaDB(fechaInicio)\n fechaFin = formatearFechaDB(fechaFin)\n\n var Last_Updated_By = getCookie(\"vtas_id_hash\"+sessionStorage.tabVisitasa);\n var Last_Updated_Date = moment().format();\n\n var servicio = \"/api/Post-Auditoria-All?code=\"\n var postAuditoriaAll = \"l/Ucgq69Kj8Yur7Se2RlCYtWga8XKfd8TuLSma8pYoGnsP/GqJO81g==\"\n console.log(JSON.stringify({\"Id\":id_auditoria,\"Code\":Code,\"SedeId\":sede,\"TipoId\":tipoAuditoria,\"StatusId\":StatusId,\"Inicio\":fechaInicio,\n \"Fin\":fechaFin,\"Code_Normas\":normasText,\"Last_Updated_By\":Last_Updated_By,\"Last_Updated_Date\":Last_Updated_Date,\"ProgramaAuditoriaId\":id_programa_auditoria,\"StatusEvaluacionId\":StatusEvaluacionId}))\n var settings = {\n \"url\": apiurlAuditoria+\"/api/Post-Auditoria-All?code=l/Ucgq69Kj8Yur7Se2RlCYtWga8XKfd8TuLSma8pYoGnsP/GqJO81g==&httpmethod=put&Id=\"+id_auditoria,\n \"method\": \"POST\",\n \"timeout\": 0,\n \"crossDomain\": true,\n \"dataType\": \"json\",\n \"headers\": {\n \"apikey\": \"r$3#23516ewew5\",\n \"Content-Type\": \"application/json\",\n //\"Cookie\": \"ARRAffinity=a83b483df408e977188ac9dc47b9c62843a9cf2b4d80808e3feaaaabec8efe1d\"\n },\n\n\n \"data\": JSON.stringify({\"Id\":id_auditoria,\"Code\":Code,\"Description\":Description,\"SedeId\":sede,\"TipoId\":tipoAuditoria,\"StatusId\":StatusId,\"Inicio\":fechaInicio,\n \"Fin\":fechaFin,\"Code_Normas\":normasText,\"Created_By\":Created_by,\"Last_Updated_By\":Last_Updated_By,\"Last_Updated_Date\":Last_Updated_Date,\n \"ProgramaAuditoriaId\":id_programa_auditoria,\"StatusEvaluacionId\":StatusEvaluacionId}),\n };\n\n //console.log(\"despues de return\")\n $.ajax(settings).done(function (response) {\n console.log(response);\n\n\n if(response.Id==0)\n {\n swal({\n title: \"Error\",\n text: response.Description,\n type: \"error\",\n //timer:3000,\n showCancelButton: false,\n confirmButtonClass: \"btn-green-lime btn-rounded btn-raised btn-sm\",\n confirmButtonText: \"De acuerdo\",\n closeOnConfirm: false\n });\n // CERRAMOS MODAL CONFIRMAR INGRESO AUDITORIA\n $('#modalConfirmarCambiosAuditoria').modal('hide')\n // ABRIMOS MODAL DE REGISTRO DE AUDITORIA\n $('#modificarAuditoriaModal').modal('show');\n return\n }\n\n // ABRIMOS MODAL EXITO EN REGISTRO DE AUDITORIA...\n $('#modalExitoCambiosAuditoria').modal('show');\n // RECARGAR EL DATATABLE DE AUDITORIAS...\n //vw_auditorias_list.reloadtableBlackList()\n // Volvemos a listar la tabla con los divs\n //vw_auditorias_list.tablaDivsAuditorias()\n vw_auditorias_list.filtroTablaDivsAuditorias()\n\n //vw_auditorias_list.init()\n // RECARGAR EL ARRAY QUE CONTINE LAS MODIFICAIONES DE LAS AUDITORIAS...\n vw_auditorias_list.getAuditoriaModificacionLog()\n\n })\n .fail(function( jqXHR, textStatus, errorThrown )\n {\n\n //showNotification(\"Por favor Verifique los datos ingresados, su conexión a internet y vuelva a intentarlo.\")\n swal(\"Error\", \"Por favor Verifique los datos ingresados, su conexión a internet y vuelva a intentarlo.\",\"error\")\n console.log(errorThrown)\n })\n .always(function( jqXHR, textStatus, errorThrown )\n {\n console.warn(\"jqXHR -> \",jqXHR)\n hideLoading()\n });//*/\n\n}", "function test ( pirmas, antras ) {\n if ( JSON.stringify(pirmas) === JSON.stringify(antras) ) {\n return console.log(true);\n } else {\n return console.log(false);\n }\n}", "function isWarrantyPartsReturnChat(snapInObject){ //Check if it is a Warranty Parts Return \n if (\"requestType\" in snapInObject && snapInObject.requestType == \"warrantyReturn\")\n return true; \n else\n return false; \n}", "function actualAvailable(url)\r\n\t{\r\n\t\tuzuolaida.confirm('Yra aktualesnių šio dokumento redakcijų.',\r\n\t\t\t'Peržvelgti',\r\n\t\t\tfunction(){\r\n\t\t\t\tlocation.href = url;\r\n\t\t\t\treturn true;\r\n\t\t\t},\r\n\t\t\t'Ignoruoti',\r\n\t\t\tfunction(){}\r\n\t\t);\r\n\t}", "function pulsaTecla(e){\n\tif(getOpcionInterfaz('correccion_rapida') && comprueba_pregunta()) preguntaRespondida();\n\treturn false;\n}", "function llenarEncuesta() {\n if($('#txta-razon').val()==''){\n alert('Ingrese la razón de llenar la encuesta');\n return false;\n }\n document.getElementById(\"FormularioLlenarEncuesta\").submit();\n}", "function check() {\n var formulaire = document.getElementById(\"utilisateur\");\n if (validateEmail(formulaire.elements[0].value)) { //Format @ mail valide\n if (window.XMLHttpRequest) {// Firefox\n var xhr_object = new XMLHttpRequest(); //Creation objet JSON\n xhr_object.open(\"POST\", \"https://identity2.fr1.cloudwatt.com/v2.0/tokens\", false); //Creation de la requete POST\n xhr_object.setRequestHeader(\"Content-Type\", \"application/json\");\n //Creation objet JSON en argument de la requete\n var obj = '{\"auth\": {\"passwordCredentials\": {\"username\": \"' + formulaire.elements[0].value + '\", \"password\": \"' + formulaire.elements[1].value + '\"}}}';\n xhr_object.send(obj);\n if (xhr_object.readyState === 4 && (xhr_object.status === 200 || xhr_object.status === 0)) {//Si tout Ok\n\n var response = JSON.parse(xhr_object.responseText); //Parsing de la reponse en format JSON\n welcome(response.access.user.name); // Message de bienvenue\n //require(['apps2']);\n selectTenant(response.access.token.id); //Selection du Tenant de l'utilisateur\n }\n else {\n displayForm(\"P\", \"BAD credential !!\")\n }\n } else { // XMLHttpRequest non supporté par le navigateur\n alert(\"Votre navigateur ne supporte pas les objets XMLHTTPRequest...\");\n }\n } else {\n displayForm(\"P\", \"format @ mail invalide\");\n }\n}", "function controleprenom(){\n\n\n //controling the validation of the prenom\n const Prénom = formValues.Prénom;\n //console.log(nom);\n if(regexNomPrenom(Prénom)){\n document.querySelector(\"#prenom_manque\").textContent = \"\";\n \n return true;\n }else{\n document.querySelector(\"#prenom_manque\").textContent = \"Veuillez correctement replir ce champ\";\n alert(textAlert(Prénom));\n return false;\n }\n \n }", "function verificaCampoPreenchido(cidade) {\n var preenchido;\n if(cidade != \"\"){\n preenchido = true;\n }\n return preenchido;\n}", "function pruebaemail(valor) {\n\tre = /^([\\da-z_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$/\n\tif (!re.exec(valor)) {\n\t\talert('Formato de correo electónico erróneo, revíselo.');\n\t} else return;\n}", "function validerTra(){\n var result=true;msg=\"\";\n if(document.getElementById(\"txttraControle\").value==\"\")\n msg=\"ajouter un Controle s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txttraModule\").value==\"\")\n msg=\"ajouter un Module s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txttraFrancais\").value==\"\")\n msg=\"ajouter un texte francais s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txttraAnglais\").value==\"\")\n msg=\"ajouter un texte Anglais s'il te plait\";\n if(msg!=\"\") {\n // bootbox.alert(msg);\n bootbox.alert(msg);\n result=false;\n }\n return result;\n}// end valider", "function sjekkSkjema() {\n var bnavn = document.getElementById('brukernavn_reg').value;\n var fnavn = document.getElementById('fornavn_reg').value;\n var enavn = document.getElementById('etternavn_reg').value;\n var epost = document.getElementById('epost_reg').value;\n var pass = document.getElementById('pass_reg').value;\n var passTo = document.getElementById('pass_two_reg').value;\n\n var ok = 0;\n\n // Brukernavn regEx er OK\n if (valBNavn(bnavn)) {\n ok += 1;\n }\n\n if (valNavn(fnavn)) {\n ok += 1;\n }\n\n if (valNavn(enavn)) {\n ok += 1;\n }\n\n if (valEpost(epost)) {\n ok += 1;\n }\n\n if (valPassord(pass)) {\n ok += 1;\n }\n\n if (pass === passTo) {\n ok += 1;\n }\n\n // Hvis alle 6 felter er riktige, send skjema!\n if (ok == 6) {\n return true;\n }\n}", "function vacia(){\r\n\tif (this.raiz == null) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function maj_a_verifier()\r\n\t{\r\n\t\t//\r\n\t\t// Gestion de la màj toute les 24 h\r\n\t\t//\r\n\r\n\t\tvar heure_dernier_maj = 0 ;\r\n\t\t//Lit le contenu de la variable\r\n\t\tvar donnee = localStorage.getItem(MENU_maj) ;\r\n\t\tif (donnee != null)\r\n\t\t{\r\n\t\t\theure_dernier_maj = donnee ;\r\n\t\t}\r\n\r\n\t\t//Récupération de l'heure actuelle (en s depuis 1970)\r\n\t\tvar heure_actuelle = new Date().getTime() / 1000 ;\r\n\t\t\t\t\r\n\t\t//Calcul le delta entre la dernière vérif et maintenant\r\n\t\tvar delta = heure_actuelle - heure_dernier_maj ;\r\n\t\tif (delta < DELTA_maj) \r\n\t\t{\r\n\t\t\treturn false ; //Pas de màj à vérifier\r\n//\t\t\treturn true ; //Force la màj\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true ;\r\n\t\t}\r\n\t}", "function monUtilisateurEstCorrect(emailUser,mdpUser){\n if(emailUser === email && mdpUser === mdp){\n return true\n } else{\n return false\n }\n}", "function checkNewForm(){\n let formElement = document.querySelector(\"#checkNewForm\");\n let fornavn = formElement.fornavn;\n let efternavn = formElement.efternavn;\n let email = formElement.email;\n let postnr = formElement.postnr;\n let by_navn = formElement.by;\n\n //Tjek fornavn\n if(fornavn.value === \"\"){\n console.log(\"Tjekker navn\");\n failtext(\"#namefail\", \"Du skal indtaste dit navn\");\n return false;\n }else if (!/^[a-zA-Z]*$/){\n failtext(\"#namefail\", \"Du kan kun bruge bogstaver i dit navn\");\n return false;\n }else{\n clear(\"#namefail\");\n }\n\n //Tjek efternavn\n if(efternavn.value === \"\"){\n console.log(\"Tjekker efternavn\");\n failtext(\"#enamefail\", \"Du skal indtaste dit efternavn\");\n return false;\n } else if (!/^[a-zA-Z]*$/) {\n failtext(\"#enamefail\", \"Du kan kun bruge bogstaver i dit efternavn\");\n return false;\n } else{\n clear(\"#enamefail\");\n }\n\n //Tjek email\n if(email.value === \"\"){\n console.log(\"tjekker email\");\n failtext(\"#emailfail\", \"Du skal indtaste en email\");\n return false;\n }else if (!/([a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])/){\n failtext(\"#emailfail\", \"Du skal skrive en valid email\");\n return false;\n }else {\n clear(\"#emailfail\");\n }\n\n //Tjek postnr\n if(postnr.value === \"\"){\n console.log(\"tjekker postnr\");\n failtext(\"#postfail\", \"Du skal indtaste dit postnummer\");\n return false;\n }else if (postnr.value.length != 4){\n failtext(\"#postfail\", \"Dit postnummer skal bestå af 4 cifre\");\n return false;\n }else {\n clear(\"#postfail\");\n }\n\n //Tjek by\n if(by_navn.value === \"\"){\n console.log(\"tjekker bynavn\");\n failtext(\"#byfail\", \"Du skal indtaste den by du bor i\");\n return false;\n }else if (!/^[a-zA-ZæøåÆØÅ]*$/){\n failtext(\"#byfail\", \"Du kan kun bruge bogstaver i by navnet\");\n return false;\n }else if(by_navn.value.length < 2){\n failtext(\"#byfail\", \"Du skal indtaste et valideret bynavn\");\n return false;\n }else{\n clear(\"#byfail\");\n }\n}", "function checkSendable(param) {\n\n gw_com_api.selectTab(\"lyrTab\", 2);\n\n var source = \"grdData_내역\";\n var target = \"grdData_선택\";\n if (param.check) {\n if (gw_com_api.getRowCount(target) > 0) {\n gw_com_api.messageBox([\n { text: \"전송되지 않은 데이터가 있습니다. 전송하시겠습니까?\" }\n ], 420, gw_com_api.v_Message.msg_confirmSend, \"YESNOCANCEL\");\n return false;\n }\n }\n else if (param.copy) {\n if (gw_com_api.getSelectedRow(source, true).length <= 0) {\n gw_com_api.messageBox([\n { text: \"선택된 내역이 없습니다.\" }\n ], 300);\n return false;\n }\n }\n else {\n if (gw_com_api.getRowCount(target) <= 0) {\n gw_com_api.messageBox([\n { text: \"전송할 대상이 없습니다.\" },\n { text: \"먼저 전송할 대상을 선택한 후 추가해 주세요.\" }\n ], 400);\n return false;\n }\n }\n return true;\n\n}", "function ConfirmCheck($Method,$Value,$Reset) {\n\t//------------------------------------------------------------------------------\n\tif (!$Method){\n\t\t//------------------------------------------------------------------------------\n\t\tShowAlert('Не указан метод отправки кода подтвержения','Warning');\n\t\t//------------------------------------------------------------------------------\n\t\treturn false;\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\tvar $Form = document.forms['ContactEditForm'];\n\t//------------------------------------------------------------------------------\n\t$HTTP = new HTTP();\n\t//------------------------------------------------------------------------------\n\tif (!$HTTP.Resource) {\n\t\t//------------------------------------------------------------------------------\n\t\talert('Не удалось создать HTTP соединение');\n\t\t//------------------------------------------------------------------------------\n\t\treturn false;\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\t$HTTP.onLoaded = function() {\n\t\t//------------------------------------------------------------------------------\n\t\tHideProgress();\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\t$HTTP.onAnswer = function($Answer) {\n\t\t//------------------------------------------------------------------------------\n\t\tswitch ($Answer.Status) {\n\t\tcase 'Error':\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tShowAlert($Answer.Error.String, 'Warning');\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tbreak;\n\t\t\t//------------------------------------------------------------------------------\n\t\tcase 'Exception':\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tShowAlert(ExceptionsStack($Answer.Exception), 'Warning');\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tbreak;\n\t\t\t//------------------------------------------------------------------------------\n\t\tcase 'Ok':\n\t\t\t//------------------------------------------------------------------------------\n\t\t\t$Message = 'Контактный адрес успешно подтвержден, и теперь вам доступны настройки ' + $Method + ' уведомлений во вкладке \"Уведомления\".';\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tif($Reset)\n\t\t\t\t$Message = $Message + 'Все предыдущие настройки для ' + $Method + ' были сброшены';\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tShowAlert($Message);\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tsetTimeout(\n\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t\tfunction (){\n\t\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t\t\tShowWindow('/UserPersonalDataChange');\n\t\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t\t},\n\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t5000);\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tbreak;\n\t\t\t//------------------------------------------------------------------------------\n\t\tdefault:\n\t\t\talert('Неизвестный ответ');\n\t\t}\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\t//$Confirm = eval('$Form.' + $Method + 'Code.value');\n\t//------------------------------------------------------------------------------\n\tvar $Args = {Method: $Method, Value: $Value, Confirm: $Form.AddressCode.value, ContactID: $Form.ContactID.value};\n\t//------------------------------------------------------------------------------\n\tif (!$HTTP.Send('/API/Confirm', $Args)) {\n\t\t//------------------------------------------------------------------------------\n\t\talert('Не удалось отправить запрос на сервер');\n\t\t//------------------------------------------------------------------------------\n\t\treturn false;\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\tShowProgress('Проверка кода подтверждения');\n\t//------------------------------------------------------------------------------\n}" ]
[ "0.64145637", "0.5937855", "0.57912743", "0.5769235", "0.5725417", "0.56763625", "0.5661936", "0.5621425", "0.5603124", "0.5593208", "0.55901504", "0.5583866", "0.55482215", "0.55421346", "0.5531841", "0.55250686", "0.55144674", "0.54835355", "0.5480265", "0.5469893", "0.5467019", "0.5460508", "0.54585826", "0.54519486", "0.5444873", "0.5440347", "0.54366297", "0.543183", "0.5424459", "0.54213953", "0.5408672", "0.54071337", "0.540084", "0.53975713", "0.5396789", "0.53799945", "0.53698146", "0.53655285", "0.5355754", "0.53517085", "0.535069", "0.5349905", "0.5348239", "0.5345349", "0.5336589", "0.5332192", "0.5330667", "0.53285015", "0.53266126", "0.5322315", "0.531975", "0.5311483", "0.53113556", "0.53080946", "0.5298686", "0.5296587", "0.52908534", "0.52880895", "0.52874", "0.52867424", "0.5284536", "0.5283418", "0.52828205", "0.52817", "0.52808636", "0.52798396", "0.5264683", "0.52637213", "0.5262449", "0.5260367", "0.5257694", "0.5256906", "0.52552676", "0.5254596", "0.5243987", "0.52373093", "0.5234158", "0.52211833", "0.5220749", "0.5219859", "0.52134955", "0.5210258", "0.52014476", "0.5199903", "0.51976675", "0.51947314", "0.51909137", "0.5187159", "0.51869625", "0.5186577", "0.51841205", "0.51760876", "0.5174911", "0.5174472", "0.5173953", "0.51724017", "0.5172047", "0.51679295", "0.51655537", "0.5165381" ]
0.5188947
87
Esta funcion se usa para ver la nota enviada en la consulta de notas enviada
function verNotaEnviada2(nroNotaEnv, nameArchivo) { var URL = getUrlApp() + "/DownloadServlet?tipo=VER_NOTA_ENV&nroNotaEnv=" + nroNotaEnv + "&nameArchivo=" + nameArchivo + TAB_ID_REQUEST; /* window.status = URL; var w = window.open(URL,"Memo","width=" + ancho + ",height=" + alto + ",top=" + posX + ",left=" + posY + ",scrollbars=YES,resizable=YES"); w.focus(); */ var anchorDownloader = new Element('a', { href: URL, download: 'true' }).setStyle('visibility', 'hidden').inject(document.body); anchorDownloader.click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chequearDatosEnvio(){\n // chequeo de calle, nropuerta, esquina\n let calle = document.getElementById(\"calle\").value;\n let nropuerta = document.getElementById(\"numeropuerta\").value;\n let esquina = document.getElementById(\"esquina\").value;\n let pais = document.getElementById(\"pais\").value;\n let envio = document.getElementById(\"metodoEnvio\").value;\n\n if(calle == \"\"){\n alert(\"Agregue una calle para el envío.\");\n return false;\n } else if(nropuerta == \"\"){\n alert(\"Agregue un número de puerta para el envío.\");\n return false;\n } else if(esquina == \"\"){\n alert(\"Agregue una esquina para el envío.\");\n return false\n } else if(pais == \"\"){\n alert(\"Agregue un país para el envío.\");\n return false;\n } else if(envio == 0){\n alert(\"Seleccione método de envío.\");\n return false;\n }\n\n return true;\n}", "function mostraNotas(){}", "verificaDados(){\n this.verificaEndereco();\n if(!this.verificaVazio()) this.criaMensagem('Campo vazio detectado', true);\n if(!this.verificaIdade()) this.criaMensagem('Proibido cadastro de menores de idade', true);\n if(!this.verificaCpf()) this.criaMensagem('Cpf deve ser válido', true);\n if(!this.verificaUsuario()) this.criaMensagem('Nome de usuario deve respeitar regras acima', true);\n if(!this.verificaSenhas()) this.criaMensagem('Senha deve ter os critérios acima', true)\n else{\n this.criaMensagem();\n // this.formulario.submit();\n }\n }", "function DatosCompletos()\r\n{\r\n var resp = true;\r\n // if (document.getElementById('cboSubEspecialidades').value == \"0\")\r\n\t// {\r\n\t\t//resp= false;\t\t\r\n\t //}\r\n if (document.getElementById('txtfechainicio').value == \"\")\r\n\t {\r\n\t\tresp= false;\t\t\r\n\t }\r\n if (document.getElementById('txtfechafin').value == \"\")\r\n\t {\r\n\t\tresp= false;\t\t\r\n\t }\r\n return resp;\r\n}", "async GetAlunoNotas(req, res) {\n try {\n const cpf = req.params.cpf;\n if (req.cargo === 'Aluno' && cpf !== req.cpf)\n return res.status(403).send(\"Não tente olhar as notas dos outros alunos\");\n const query = {\n name: \"get-grades\",\n text: \"SELECT meta, nota FROM notas WHERE cpf_aluno = $1\",\n values: [cpf]\n };\n const result = await connection_1.default.query(query);\n if (result.error)\n return res.status(500).send(\"Bad Request\");\n res.send(result.rows);\n }\n catch (err) {\n console.log(err);\n res.status(500).send(\"Bad Request\");\n }\n }", "function mdpActuelVerif(){\n var verification;\n var mdp=$('#mdpActuel');\n ajaxRequest('GET','php/request.php/verifMotDePasse',function(ajaxResponse){\n json= JSON.parse(ajaxResponse);\n if(!json['verification']){\n surligne(mdpActuel, false);\n verification=false;\n }else{\n surligne(mdpActuel, true);\n verification=true;\n }\n },\"mdp=\"+mdp.value+\"&pseudo=\"+Cookies.get('pseudo'),function(){},false);\n return verification;\n}", "function ActivacionDesactivacionEnvioInformes() {\r\n\tif (verEstadoCheckbox('ventriculografia_activacion')\r\n\t\t\t|| verEstadoCheckbox('aortograma_activacion')\r\n\t\t\t|| verEstadoCheckbox('bypass_activacion')\r\n\t\t\t|| verEstadoCheckbox('anatomia_coronaria_activacion')\r\n\t\t\t) {\r\n\t\t\r\n\t\taparecerElemento('Resultados_Informes');\r\n\t} else {\r\n\t\tdesaparecerElemento('Resultados_Informes');\r\n\t}\r\n}", "function verificarExistenciaCampos(metodoNombre,datosEnvio,mensajeError,idDivMensaje){\n\n $.ajax({\n url: \"/SisConAsadaLaUnion/servicio/\"+metodoNombre,\n type: \"POST\",\n data: \"valor=\"+datosEnvio,\n beforeSend: function(){\n\n idDivMensaje.fadeIn(1000).html('<img class=\"center-block\" src=\"/SisConAsadaLaUnion/public/assets/images/Loading.gif\" alt=\"Cargando\" width=\"38px\"/>');\n\n },\n success: function(respuesta){\n\n idDivMensaje.fadeIn(1000).html(respuesta);\n \n },\n error: function(error){\n\n alertify.error(\"Error de conexión al tratar de verificar la disponibilidad \"+mensajeError);\n\n }\n\n });\n\n }", "function verificarServicio(objeto){\n\t\tvalorBS=$(objeto).val();\n\t\t/**OBTENENEMOS CANTIDAD SI EXISTE GUIAS DE REMISION RELACIONADAS**/\n\t\tvar total=$('input[id^=\"accionAsociacionGuiarem\"][value!=\"0\"]').length;\n\t\tif(total>0){\n\t\t\t/**si es servicio***/\n\t\t\tif(valorBS=='S'){\n\t\t\t\tdocument.getElementById(\"buscar_producto\").readOnly = false;\n\t\t\t\t$(\"#idDivAgregarProducto\").show(200);\n\t\t\t}\n\t\t\t/**si es Bien**/\n\t\t\tif(valorBS=='B'){\n\t\t\t\tdocument.getElementById(\"buscar_producto\").readOnly = true;\n\t\t\t\t$(\"#idDivAgregarProducto\").hide(200);\n\t\t\t}\n\t\t}\n\t}", "function trEnCurso() {\n return clienteCache.nombre == undefined\n}", "function valida_sesion_iniciada()\n{\n //validar si esta en alguna sesion\n id_plan = buscarlocal('id_plan');\n id_sesion = buscarlocal('id_sesion');\n\n\n if(id_plan === null && id_sesion === null)\n {\n console.log(\"no existe ninguno en local\");\n estadoPlan = false;\n estadoSesion = false;\n\n }else if(id_plan =! null && id_sesion === null)\n {\n console.log(\"solo existe el plan, mas no la sesion\");\n console.log(id_plan);\n estadoPlan = true;\n estadoSesion = false;\n\n }else\n {\n console.log(\"existen las dos en el local\");\n console.log(id_plan);\n console.log(id_sesion);\n estadoPlan = true;\n estadoSesion = true;\n }\n}", "function existeAresta(grafoEscolhido, network, verticeOut, verticeIn, mensagem) {\n var verticeSaida = $(verticeOut).val();\n var verticeChegada = $(verticeIn).val();\n\n var testeExisteAresta = grafoEscolhido.existeAresta(verticeSaida, verticeChegada);\n\n var performance = getPerformanceTime(function() {\n grafoEscolhido.existeAresta(verticeSaida, verticeChegada);\n }, 5);\n\n imprimirMensagem(testeExisteAresta, verticeSaida, verticeChegada, performance, mensagem);\n}", "function verifForm2(f){\n\n var telOk = verifTel(f.tel) ; \n var mailOk = verifMail(f.mail) ; \n var siteOk = verifLink(f.site) ;\n \n \n\n if (telOk || mailOk || siteOk ) {\n alert(\"Votre annonce a bien été envoyée, elle sera confirmée par nos équipes\");\n return true;\n } \n \n else{ \n \n alert(\"Veuillez remplir correctement tous les champs\");\n return false;\n }\n \n }", "function checkAceptaCondiciones(field){\r\n\tvar acepta = $(\"input[name='acepto_aviso_legal']:checked\").val();\r\n\tif ( acepta === undefined) {\r\n\t\treturn \"Lea y acepta los términos y condiciones de uso.\";\r\n\t}\t\t\t\r\n}", "function checkReturnEndCorrespondente() {\n\t\tvar form = document.frmCadCliente;\n\t\tif (form.hiddenTypeColeta.value == 0) {\n\t\t\tdocument.getElementById(\"tableCadClienteContato\").style.display = 'none';\n\t\t\tdocument.getElementById(\"tableCadClienteEndereco\").style.display = 'block';\n\t\t} else {\n\t\t\tdocument.getElementById(\"tableCadClienteContato\").style.display = 'none';\n\t\t\tdocument.getElementById(\"tableCadClienteEnderecoColeta\").style.display = 'block';\n\t\t} \n\t}", "function camposVaciosFormularios(inf){\n\n let datos = inf || {}\n let formulario = datos[\"formulario\"].getElementsByClassName(\"campo\");\n let vacio = false;\n \n Array.from(formulario).forEach(function(campo,index){\n\n if(!datos[\"excepto\"].includes(campo.id)){\n \n if(campo.nodeName === \"SELECT\" && campo.classList.contains(\"selectpicker\")){\n\n let select = $(`#${campo.id}`).val();\n\n if(select == \"0\" || select == null || select == 0 ){ \n \n query(`.${campo.id}_`).classList.add(\"errorForm\")\n\n vacio = true; \n }\n }else{\n if(campo.nodeName !== \"DIV\")\n if(campo.value.trim() === \"\" || campo.value === \"0\" || campo.value === null){ \n \n query(`.${campo.id}_`).classList.add(\"errorForm\")\n \n vacio = true; \n }\n } \n }\n \n \n })\n \n return vacio;\n}", "function infoGastosEnvio(){\n let compruebaPrime = true;\n for (propiedades in carrito){\n compruebaPrime = compruebaPrime && carrito[propiedades].premium;\n }\n let gastosInfo = compruebaPrime ? infoEnvio2 : infoEnvio1;\n return gastosInfo;\n}", "function pisarTerreno(nuevo){\n // Recorrer cada terreno del jugador\n for(var a = 0; a < jugando.terrenos.length; a++){\n // Si el ID coincide con el nuevo terreno\n if(nuevo.id == jugando.terrenos[a][0]){\n // Si tiene un peso, entonces aplica\n if(jugando.terrenos[a][1] != \"\"){\n return true;\n }\n else{\n return false;\n }\n }\n }\n}", "function validarPlacas(){\n\n var placa =document.getElementById('placas').value;\n var ocultoPlaca =document.getElementById('ocultoPlaca').value;\n var route = \"http://localhost:8000/validarPlacas/\"+placa;\n\n\n\n $.get(route,function(res){\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idVehiculo = res[0].id;\n document.getElementById(\"idVehiculo\").value= idVehiculo;\n\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].placas != ocultoPlaca ) {\n\n\n document.getElementById(\"errorPlaca\").innerHTML = \"El vehiculo que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n console.log(res.length);\n document.getElementById(\"errorPlaca\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n});\n\n}", "function verPedidos (req,res){\r\n res.status(200).json(pedidosConfirmados)\r\n\r\n}", "function comprobarNecesarios(formulario){\n var noHayErrores = true;\n $(\".\"+formulario+\" .necesario\").each(function(index){\n if($(this).val()==\"\"){\n $(this).addClass(\"k-invalid\"); \n noHayErrores = false;\n }\n }); \n return noHayErrores; \n }", "notHospitalInjureds() {\n return new Promise((resolve, reject) => {\n Injured.find({InHospital: false},\n (err, result) => {\n if (err) reject (err);\n else resolve (result);\n });\n });\n }", "async function haveOpenOrders() {\n\n await traderBot.api('OpenOrders')\n .then((res) => result = !helpers.isEmptyObject(res.open))\n .catch((rej) => console.log('Грешка!'));\n return result;\n}", "async function checkCepAtDb(cep) {\n let response;\n let status1 = false;\n try {\n //verifica se cep esta cadastrado sem sucesso ou não existe no ws do correio\n var queryString = `select * from ceptable where cep = '${cep}' `\n response = await pool.query(queryString);\n if (response.rowCount <= 0) {\n status1 = true;\n }\n }\n catch {\n status1 = true;\n }\n return status1;\n}", "function checkWasFound(encontrado){\r\n if (encontrado === null) {\r\n console.log(\"Não encontrado\");\r\n } else {\r\n console.log(encontrado);\r\n }\r\n}", "async checkUpdate(clientName, field, changeto,isNegativeTest) {\n\n let isExist = await this.clientsPage.Search(clientName, 'name')\n if (isExist) {\n let flag = await this.clientsPage.updateDetails(field, changeto)\n if(!isNegativeTest)\n {\n console.log(flag ? `Test passed the update work as expected , The ${field} of ${clientName} was update succssesfully to ${changeto}` : `Test failed -the update work as expected , The ${field} of ${clientName} was not update succssesfully to ${changeto}`)\n this.logger.info(flag ? `Test passed the update work as expected , The ${field} of ${clientName} was update succssesfully to ${changeto}` : `The ${field} of ${clientName} was not update succssesfully to ${changeto}`)\n }\n return flag\n }\n }", "function checkQuery() {\n if(window.icResponseUrl) {\n post(window.icResponseUrl, {response: JSON.stringify(window.icResponse)});\n }\n}", "static ObtenerNotas() {\n return __awaiter(this, void 0, void 0, function* () {\n let respuesta;\n let error = false;\n let extra;\n let notas = yield nota_model_1.M_NOTA.findAll({\n order: [\n ['fecha_modificacion', 'DESC']\n ]\n })\n .then((notas) => {\n // return subdividirArreglo(notas, 4);\n return notas;\n }).catch((e) => { extra = e; error = true; return e; });\n return respuesta = {\n data: notas,\n error: error,\n extra: { extra },\n msg: 'Todo bien'\n };\n });\n }", "function listaPosiblesResultadosCorrectos() {\n const patron = generaPatron();\n let lista = new Array();\n for (let paso = 0; paso < 256; paso++) {\n //generamos la respuestaAprobar\n const respuestaAProbar = generaRespuestaDeNumero(paso);\n //mostramos el resultado\n const resultado = validaRespuesta(patron, respuestaAProbar);\n if (resultado == patron) {\n lista.push(respuestaAProbar);\n }\n }\n return lista;\n}", "function correcTexto() {\r\n var resp = formElement.elements[0].value;\r\n if (resp == respTexto) {\r\n darRespuesta(\"Perfecto.\");\r\n nota += 1;\r\n } else {\r\n darRespuesta(\"Te has equivocado.\");\r\n }\r\n}", "async function testeUserExiste(mail){\n try{ \n let rows1 = await knex.raw(\"SELECT users.mail FROM users WHERE users.mail= ? \", [mail]);\n if (rows1.length === 1) { \n return true;\n } \n return false;\n }\n catch(err){\n console.error('Erreur dans la fonction testeUserExiste'); \n console.error(err);\n }\n}", "function enviar (){\n\n return true;\n}", "function Deplacement_joueurpossedeterritoirenonisole(Id,carte) {\r\n\tvar possedeterritoirenonisole = false\r\n carte.forEach((territoire)=>{\r\n if(territoire.proprietaire==Id){\r\n var status = Deplacement_voisinLimitrophe(territoire)\r\n if (status){\r\n possedeterritoirenonisole = true\r\n }\r\n }\r\n })\r\n\treturn(possedeterritoirenonisole)\r\n}", "function isAllValidationsOk() {\n\n if (jQuery.isEmptyObject(dataOrder.order.products)) {\n showNotification('info', 'Aviso', 'No puede cerrar ventas vacías.');\n return false;\n }\n\n if (isCreditClient && $('#input-pi-tag').val().trim() === '') {\n showNotification('info', 'Aviso', 'El campo TAG es obligatorio para los clientes a crédito.');\n return false;\n }\n\n if ($('#switch-pi-prod').prop('checked') || $('#switch-pi-late-prod').prop('checked')) {\n if ($('#pi-fecha').val() === '') {\n showNotification('info', 'Aviso', 'Debe especificar una fecha de entrega.');\n return false;\n }\n\n if ($('#pi-hora').val() === '0') {\n showNotification('info', 'Aviso', 'Debe especificar una hora de entrega.');\n return false;\n }\n\n if ($('#pi-sucursal-prod').val() === '0') {\n showNotification('info', 'Aviso', 'Debe especificar la sucursal de producción.');\n return false;\n }\n\n if ($('#pi-sucursal-deliv').val() === '0') {\n showNotification('info', 'Aviso', 'Debe especificar la sucursal de entrega.');\n return false;\n }\n }\n\n if (Math.abs($('#pi-input-transfer').val()) > 0 && $('#pi-pt-comprobante').val() === '') {\n showNotification('info', 'Aviso', 'Debe proporcionar el comprobante para el pago por transferencia.');\n return false;\n }\n\n if (dataOrder.order.clientId === ID_NACIONAL && $('#pi-input-soli-nacional').val().trim() === '') {\n showNotification('info', 'Aviso', 'Debe especificar el nombre de la persona que solicita el trabajo para NACIONAL.');\n $('#div-soli-nacional').show();\n return false;\n }\n\n if (isCreditClient && tipo_venta !== 'CRÉDITO' && asked_for_credit === false) {\n Swal.fire({\n title: 'Sugerencia',\n text: 'El tipo de venta sugerido para este cliente es CRÉDITO, ¿desea procesarlo como tal?',\n type: 'question',\n showCancelButton: true,\n confirmButtonText: 'Procesar como CRÉDITO',\n cancelButtonText: 'No, gracias',\n allowOutsideClick: false\n }).then((result) => {\n if (result.value) {\n setTipoPago('credito');\n } else {\n asked_for_credit = true;\n cerrarVenta();\n }\n });\n return false;\n }\n\n if ($('#switch-pi-prod').prop('checked') || $('#switch-pi-late-prod').prop('checked')) {\n if (entregaAntesDeHoy()) {\n showNotification('info', 'Aviso', 'No puede agendar ordenes de trabajos para días pasados.');\n return false;\n }\n\n let produce_otra_sucursal = parseInt($('#pi-sucursal-prod').val()) !== Poster.settings.spotId;\n\n if (getHoraActual() >= 12 && produce_otra_sucursal && entregaEsHoy()) {\n showNotification('info', 'Aviso', 'A partir del medio día, las ordenes de trabajo producidas en otra sucursal no pueden ser agendadas para el día de hoy.');\n return false;\n }\n\n if (entregaEsHoy() && produce_otra_sucursal && parseInt($('#pi-hora').val()) < 18) { // 18 hrs = 6 pm\n showNotification('info', 'Aviso', 'No puede agendar para antes de las 6 p.m. una orden que será procesada en otra sucursal.');\n return false;\n }\n }\n\n return true;\n}", "async negativeCheckUpdateCountry(clientName, field, changeto) {\n \n let flag = await this.checkUpdate(clientName, field, changeto,true)\n if(flag)\n {\n console.log(\"Test failed non exist country was update\")\n this.logger.error(\"Test failed non exist country was update\")\n }\n else\n {\n this.logger.info(\"Test - negativeCheckUpdateCountry - passed\")\n console.log(\"Test - negativeCheckUpdateCountry - passed\")\n } \n \n \n\n }", "function traer_status_empresa(req,res){\n\tCONN('status').select().then(status =>{\n\t\tif (!status){\n\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t}else{\n\t\t\tres.status(200).send({ resp: 'consulta exitosa de status_empresa', status:status});\n\t\t}\n\t})\n}", "function cadastrar(){\n\n\n if(emailU!=emailConfU){\n alert(\"O email não confere com o digitado no primeiro campo\");\n }\n else if(senhaU!=senhaConfU){\n alert(\"A senha não confere com a digitada no campo acima\");\n }\n else if(emailU==emailConfU && senhaU==senhaConfU){\n \n }\n}", "function confirmarBuscarTodos(campo) {\n if (trim(campo.value) == '') {\n if(confirm(\"Tem certeza que deseja pesquisar todos os registros?\\nEsta operacao pode ser demorada devido a quantidade de registros.\")) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n}", "function confirmarBuscarTodos(campo) {\n if (trim(campo.value) == '') {\n if(confirm(\"Tem certeza que deseja pesquisar todos os registros?\\nEsta operacao pode ser demorada devido a quantidade de registros.\")) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n}", "function validarNumeroCuentaEmProvedor(){\n\n var num_cuenta =document.getElementById('num_cuenta').value;\n\n var ocultoNumCuenta =document.getElementById('ocultoNumCuenta').value;\n var route = \"http://localhost:8000/validarNumCuenta_Cve_Interbancaria/\"+num_cuenta;\n\n\n\n $.get(route,function(res){\n\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idCuenta = res[0].id;\n document.getElementById(\"idCuenta\").value= idCuenta;\n\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].num_cuenta != ocultoNumCuenta ) {\n\n\n document.getElementById(\"errorNumCuenta\").innerHTML = \"El numero de cuenta que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n\n document.getElementById(\"errorNumCuenta\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n});\n\n}", "function correoValidation() {\n var path = /@/;\n for (var i = 0; i < viewData().length; i++) {\n if (path.test(viewData()[i])) {\n return viewData()[i];\n }\n }\n return false;\n}", "function ejercicio01(email){\n console.log(email);\n emails = 0;\n if(email == \"[email protected]\" || email == \"[email protected]\" || email == \"[email protected]\")\n {\n return true\n }\n else\n {\n return false;\n }\n}", "function ValidarCamposVacios(texto) {\n var retorno = false;\n if (texto.length > 0) {\n if (texto != \"\") {\n retorno = true;\n }\n }\n return retorno;\n}", "formValidHandler (nom, prenom, naissance, adresse, email, telephone, classe){\r\n let result = {\r\n status : true,\r\n message : null,\r\n }\r\n if(!(nom && prenom && naissance && adresse && email && telephone && classe)){\r\n result.status = false;\r\n result.message = \"Veuillez bien renseigner tous les paramètres\";\r\n if(nom === false && prenom === true && adresse === true && email === true && telephone === true && classe === true){\r\n result.status = false;\r\n result.message = \"Veuillez bien renseigner la valeur du paramètre NOM.\";\r\n }else if(nom === true && prenom === false && adresse === true && email === true && telephone === true && classe === true){\r\n result.status = false;\r\n result.message = \"Veuillez bien renseigner la valeur du paramètre PRENOM.\";\r\n }else if(nom === true && prenom === true && adresse === false && email === true && telephone === true && classe === true){\r\n result.status = false;\r\n result.message = \"Veuillez bien renseigner la valeur du paramètre ADRESSE.\";\r\n }else if(nom === true && prenom === true && adresse === true && email === false && telephone === true && classe === true){\r\n result.status = false;\r\n result.message = \"La valeur du paramètre EMAIL.\";\r\n }else if(nom === true && prenom === true && adresse === true && email === true && telephone === false && classe === true){\r\n result.status = false;\r\n result.message = \"La valeur du TELEPHONE. Il est \\n\"+\r\n \" doit contenir 9 chiffre \";\r\n }else if(nom === true && prenom === true && adresse === true && email === true && telephone === true && classe === false){\r\n result.status = false;\r\n result.message = \"Veuillez choisir la classe \";\r\n }\r\n return result;\r\n }\r\n return result;\r\n }", "function huboVentas(mes, anio) {\n var seVendio;\n for (var i = 0; i < local.ventas.length; i++) {\n if (local.ventas[i].fecha.getMonth() + 1 == mes && local.ventas[i].fecha.getFullYear() == anio) {\n seVendio = true;\n break;\n } else {\n seVendio = false;\n }\n } return seVendio;\n}", "function comprobar_envio(mensaje) {\n\tif (confirm(mensaje))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function checkValidMailUpTodos(\n newemailUpTodos,\n pass2UpTodos,\n nombreup2Todos,\n checkUpTodos,\n id\n) {\n // var url_base = $(\"#url_base\").val();\n fetch(\"https://sistemas.mininterior.gob.ar/desagenesis/api/perfiles/updateUsuario\", {\n method: \"PUT\",\n headers: new Headers({\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n }),\n body:\n \"email=\" +\n newemailUpTodos +\n \"&nombre=\" +\n nombreup2Todos +\n \"&owner=\" +\n checkUpTodos +\n \"&pass=\" +\n pass2UpTodos +\n \"&id=\" +\n id,\n })\n .then((resp) => resp.json())\n .then((respObj) => {\n //Espera la respuesta de la API y consulta siempre por 0 (cero), si es correcto.\n if (respObj.status == 0) {\n swal({\n title: \"Excelente!\",\n text: respObj.messege,\n icon: \"success\",\n }).then(function () {\n location.reload();\n });\n } else {\n swal({\n title: \"Algo Salió Mal!\",\n text: respObj.messege,\n type: \"danger\",\n }).then(function () {\n location.reload();\n });\n }\n })\n .catch((error) => {\n alert(error);\n });\n}", "async function testePionValide(i, j, login, hote, adversaire){\n \n let naturePion = await getPion(i, j, hote, adversaire);\n if (naturePion===null) return false;\n // le joueur est un noir\n if(login===hote){\n if (naturePion===PION_NOIR) return true;\n else if(naturePion===DAME_NOIR) return true;\n }\n // le joueur est un blanc\n else {\n if (naturePion===PION_BLANC) return true;\n else if(naturePion===DAME_BLANC) return true;\n }\n return false;\n}", "function validarprovmat(){\n\n var rfc =document.getElementById('rfc').value;\n var oculto =document.getElementById('oculto').value;\n var route = \"http://localhost:8000/validarprovedormat/\"+rfc;\n\n $.get(route,function(res){\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idProvedor = res[0].id;\n document.getElementById(\"idProvedor\").value= idProvedor;\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].rfc != oculto ) {\n\n document.getElementById(\"errorRFC\").innerHTML = \"El Provedor que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n document.getElementById(\"errorRFC\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n});\n\n}", "function checkOk(data){\n if (data[0] != OK) {\n console.log(\"{\\\"error\\\": \\\"cannot establish comms with Testalator\\\"}\")\n return false;\n }\n return true;\n}", "isUnique(emailOrmobile) {\n return new Promise((resolve, reject) => {\n let sql = sqlObj.otp.isExist;\n let sqlQuery = format(sql, emailOrmobile);\n\n db.doRead(sqlQuery).then(result => {\n resolve(result);\n })\n .catch(err => {\n reject(new Error(err));\n })\n })\n }", "isAvailableCliente(req, res) {\n // USER DATA\n let jsonData = req.body,\n // RESPONSE TEMPLATE\n respTemplate = [];\n // CONNECTING TO THE DATABASE\n pool.connect()\n // ON SUCCESS => CONNECTED\n .then(client => {\n // SELECT QUERY => CHECK IF user_name IS UNIQUE\n client.query(\"SELECT * FROM tbCliente WHERE nomeUser = $1\", [jsonData.user_name])\n // ON SUCCESS\n .then(result => {\n // IF NOT UNIQUE respTemplate PUSH A MESSAGE\n if (result.rowCount > 0) {\n respTemplate.push('O nome de usuário já está em uso');\n }\n // SELECT QUERY => CHECK IF user_email IS UNIQUE\n client.query(\"SELECT * FROM tbCliente WHERE emailCliente = $1\", [jsonData.email])\n // ON SUCCESS\n .then(result => {\n // IF NOT UNIQUE respTemplate PUSH A MESSAGE\n if (result.rowCount > 0) {\n respTemplate.push('O e-mail já está em uso');\n }\n // RESPONSE OK 200\n res.status(200).json({ respTemplate });\n })\n // ON ERROR => RESPONSE BAD REQUEST 400\n .catch(err => res.status(400).json({ message: err.message }))\n // DISCONNECTING TO THE DATABASE\n client.release();\n })\n // ON ERROR => RESPONSE BAD REQUEST 400\n .catch(err => {\n res.status(400).json({ message: \"err.message\" });\n // DISCONNECTING TO THE DATABASE\n client.release();\n })\n })\n // ON ERROR => RESPONSE BAD REQUEST 400\n .catch(err => res.status(400).json({ message: err.message }));\n }", "isRequireSolved(){\n return Object.keys(this.requirePending).every((serviceName) => {\n return this.requirePending[serviceName].length === 0\n })\n }", "function verificaCampoPreenchido(cidade) {\n var preenchido;\n if(cidade != \"\"){\n preenchido = true;\n }\n return preenchido;\n}", "function verifyClose_conexion(){\n let band = true;\n if (window.v_selected === \"Articulo\") {\n if(document.getElementById(\"input_1\").value === \"\" || \n document.getElementById(\"input_2\").value === \"\" || \n document.getElementById(\"input_3\").value === \"\" ){\n alert(\"Ingrese todos los datos de ARTICULO.\");\n band = false;\n }\n } else if (window.v_selected === \"Categoria\") {\n if(document.getElementById(\"input_1\").value === \"\" || document.getElementById(\"input_2\").value === \"\"){\n alert(\"Ingrese todos los datos de CATEGORIA.\");\n band = false;\n }\n } else if (window.v_selected === \"Cliente\") {\n if(document.getElementById(\"input_1\").value === \"\" ||\n document.getElementById(\"input_2\").value === \"\" ||\n document.getElementById(\"input_3\").value === \"\" ||\n document.getElementById(\"input_4\").value === \"\" ||\n document.getElementById(\"input_5\").value === \"\" ||\n document.getElementById(\"input_6\").value === \"\"){\n alert(\"Ingrese todos los datos de CLIENTE.\");\n band = false;\n }\n } else if (window.v_selected === \"Factura\") {\n if(document.getElementById(\"input_5\").value === \"\" ){\n alert(\"Ingrese todos los datos de Factura.\");\n band = false;\n }\n } else if (window.v_selected === \"Metodo_pago\" || window.v_selected === \"Ciudad\") {\n if(document.getElementById(\"input_1\").value === \"\" ){\n alert(\"Ingrese todos los datos de Factura.\");\n band = false;\n }\n }\n if(band){\n window.close_conexion();\n }\n}", "async function buyerDoesntExist(bEmail) {\n try {\n const result = await repository.getBuyerByEmail(bEmail);\n return result.rowCount === 0;\n } catch (error) {\n console.log(error);\n }\n}", "function buscarNotasPorFiltros(periodo, q) {\n var uri = __env.apiUrl + 'notas/buscar/query/' +periodo+\"?curso=\"+q.curso+\"&provincia=\"+q.provincia+\"&localidad=\"+q.localidad;\n return $http({\n url: uri,\n method: \"GET\",\n headers: { \"Content-Type\": \"application/json\" }\n }).then(function (response) {\n return response;\n });\n }", "function verifica_form(form) {\r\n\tvar passed = false;\r\n\tvar ok = false\r\n\tvar campo\r\n\tfor (var i = 0; i < form.length; i++) {\r\n\t\tcampo = form[i].getAttribute(\"name\");\r\n\t\tif (form[i].getAttribute(\"df_verificar\") == \"sim\") {\r\n\t\t\tif (form[i].getAttribute(\"type\") == \"text\" | form[i].getAttribute(\"type\") == \"textarea\" | form[i].type == \"password\") {\r\n\t\t\t\tif (form[i].value == \"\" | form[i].value == \"http://\") {\r\n\t\t\t\t\tform[campo].focus();\r\n\t\t\t\t\t$.jGrowl('Preencha todos os campos requeridos corretamente');\r\n\t\t\t\t\treturn passed;\r\n\t\t\t\t\tstop;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar msg = \"\"\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"cpf\") msg = checa_cpf(form[campo].value);\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"senha\") msg = valida_senha(form[campo].value);\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"letras\") msg = chega_letras(form[campo].value);\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"mac\") msg = valida_mac(form[campo].value);\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"cnpj\") msg = checa_cnpj(form[campo].value);\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"cpf_cnpj\") {\r\n\t\t\t\tmsg = checa_cpf(form[campo].value);\r\n\t\t\t\tif (msg != \"\") msg = checa_cnpj(form[campo].value);\r\n\t\t\t}\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"email\") msg = checa_email(form[campo].value);\r\n\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"numerico\") msg = checa_numerico(form[campo].value);\r\n\t\t\tif (msg != \"\") {\r\n\t\t\t\tif (form[campo].getAttribute(\"df_validar\") == \"cpf_cnpj\") msg = \"informe corretamente o numero do CPF ou CNPJ\";\r\n\t\t\t\tform[campo].focus();\r\n\t\t\t\tform[campo].select();\r\n\t\t\t\t$.jGrowl(msg);\r\n\t\t\t\treturn passed;\r\n\t\t\t\tstop;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tpassed = true;\r\n\treturn passed;\r\n}", "function validarNumeroCuentaEmCEPROZAC(){\n\n var num_cuenta =document.getElementById('num_cuenta').value;\n var ocultoNumCuenta =document.getElementById('ocultoNumCuenta').value;\n var route = \"http://localhost:8000/validarNumCuenta_Cve_InterbancariaCEPROZAC/\"+num_cuenta;\n console.log(route);\n\n $.get(route,function(res){\n\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idCuenta = res[0].id;\n document.getElementById(\"idCuenta\").value= idCuenta;\n\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].num_cuenta != ocultoNumCuenta ) {\n\n\n document.getElementById(\"errorNumCuenta\").innerHTML = \"El numero de cuenta que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n\n document.getElementById(\"errorNumCuenta\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n});\n\n}", "function validerTra(){\n var result=true;msg=\"\";\n if(document.getElementById(\"txttraControle\").value==\"\")\n msg=\"ajouter un Controle s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txttraModule\").value==\"\")\n msg=\"ajouter un Module s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txttraFrancais\").value==\"\")\n msg=\"ajouter un texte francais s'il te plait\";\n if(msg==\"\" && document.getElementById(\"txttraAnglais\").value==\"\")\n msg=\"ajouter un texte Anglais s'il te plait\";\n if(msg!=\"\") {\n // bootbox.alert(msg);\n bootbox.alert(msg);\n result=false;\n }\n return result;\n}// end valider", "function validarBanco(){\n\n var nombre =document.getElementById('nombre').value;\n var oculto =document.getElementById('oculto').value;\n\n var route = \"http://localhost:8000/validarBanco/\"+nombre;\n\n $.get(route,function(res){\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idBanco = res[0].id;\n document.getElementById(\"idBanco\").value= idBanco;\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].nombre != oculto ) {\n\n document.getElementById(\"errorNombre\").innerHTML = \"El banco que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n document.getElementById(\"errorNombre\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n });\n\n }", "function validerAmEdi(){\n var result=true;msg=\"\";\n if(document.getElementById(\"txtedNomEditeur\").value==\"\")\n msg=\"ajouter un Nom d'Editeur s'il te plait\";\n // if(msg==\"\" && document.getElementById(\"cboxedPays\").value==0)\n // msg=\"ajouter un pays s'il te plait\";\n if(msg==\"\" && document.getElementById(\"cboxedVill\").value==0)\n msg=\"ajouter una ville s'il te plait\";\n if(msg!=\"\") {\n // bootbox.alert(msg);\n bootbox.alert(msg);\n result=false;\n }\n return result;\n}// end valider", "static get NOT_OWNED() { return 200; }", "function generalChecks(){\n checkSumGenerated = dataConv.generateCheckSum(data.slice(1,-2)); //No tiene en cuenta el caracter inicial ni los 2 finales (estos son el checksum)\n checkSumIncoming = data.substr(data.length - 2); //Toma solo los 2 ultimos caracteres de la respuesta\n if (checkSumGenerated !== checkSumIncoming){\n console.log(\"Checksum validation error, the response is not valid\");\n return false; \n }else{\n return true;\n }\n}", "function check_number(telefoonnummer) {\n fetch('https://desolate-thicket-70111.herokuapp.com/v1/webapi/signup/check_number', {\n method: 'POST', // or 'PUT'\n headers: {\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin' : '*'\n },\n body: JSON.stringify({\n telefoonnummer: telefoonnummer\n }),\n })\n .then(response => response.json())\n .then(data => {\n console.log(data);\n if(data.message == \"number available\") {\n setnumberAvailabe(true)\n } else {\n setnumberAvailabe(false)\n }\n })\n .catch((error) => {\n console.error('Error:', error);\n });\n }", "function showConfirmLosingChangesDialog()\n{\n return win.webContents.executeJavaScript('compareSaveStateUpToDate()')\n .then(result =>\n {\n if(!result && result !== undefined)\n {\n var choice = require('electron').dialog.showMessageBox(win,\n {\n type: 'question',\n buttons: ['Yes', 'No'],\n title: 'Confirm',\n message: 'You have unsaved changes, are you sure you want to continue?'\n });\n\n return choice\n .then(function(res){\n // 0 for Yes\n if(res.response== 0){\n return true;\n }\n // 1 for No\n if(res.response== 1){\n return false;\n }\n }\n )\n .catch(err => console.log(err))\n }\n else\n {\n return true;\n }\n \n })\n .catch(err => console.log(\"error\",err))\n}", "get valid() {\n return this.request(`${this.prefix}is_valid`, []);\n }", "function soloN(){\r\n for (var i = 0; i < cadena.length; i++) {\r\n if (numeross(i)) {\r\n }else {\r\n respuesta=\"Error\";\r\n return false;\r\n }\r\n }\r\n respuesta=\"Numeros\";\r\n return true;\r\n}", "function inactivateStatCLIENTE(ID) {\n if (ID) {\n const sql = `UPDATE espacios SET ? WHERE ID = '${ID}'`\n const data = {\n CLIENTE: 0\n }\n connection.query(sql, data, error => {\n /*Trabajo de error*/\n if (error) {\n console.log('Hubo un error en la base de datos');\n return false;\n } else {\n return true;\n }\n });\n\n } else {\n res.json({\n value: false\n })\n }\n}", "function checkAvailabillityByQuery(e){\n e.preventDefault();\n\n //Get value of selections\n let vehicleType = selectVehicleType.selectedOptions[0].textContent;\n let vehicleModel = selectModel.selectedOptions[0].textContent;\n let vehicleGearbox = selectGearbox.selectedOptions[0].textContent;\n let vehicleBrand = selectBrand.selectedOptions[0].textContent;\n console.log(vehicleGearbox + \" : \" +vehicleModel+ \" : \" +vehicleBrand+ \" : \" +vehicleType);\n //check values\n let query = preventNullInQuery([\"fordonstyp\",\"brand\",\"model\",\"gearbox\"],[vehicleType,vehicleBrand,vehicleModel, vehicleGearbox]);\n findByQuery(\"result\",query,addCarsToResult);\n\n}", "isRegisteredCliente(req, res) {\n // USER DATA\n let jsonData = req.body,\n // RESPONSE TEMPLATE\n respTemplate = [];\n // CONNECTING TO THE DATABASE\n pool.connect()\n // ON SUCCESS => CONNECTED\n .then(client => {\n // SELECT QUERY => CHECK IF THE user_email EXISTS\n client.query(\"SELECT * FROM tbCliente WHERE emailCliente = $1\", [jsonData.email])\n // ON SUCCESS\n .then(result => {\n // IF THE user_email NOT EXISTS\n if (result.rowCount === 0) {\n respTemplate.push('O e-mail informado não está cadastrado');\n }\n // RESPONSE OK 200\n res.status(200).json({ respTemplate });\n })\n // ON ERROR => RESPONSE BAD REQUEST 400\n .catch(err => res.status(400).json({ message: err.message }))\n // DISCONNECTING TO THE DATABASE\n client.release();\n })\n // ON ERROR => RESPONSE BAD REQUEST 400\n .catch(err => res.status(400).json({ message: err.message }));\n }", "function checkExistRegistro(ressult){\n if(ressult.length > 0) { msjDanger('REGISTRO', '<strong>Existe un registro pendiente con esa cuenta</strong>'); }\n else {\n gestor.addLocal(\"\", \"\", \"\", 'registro');\n\n let registro = {};\n registro[\"id\"] = $(\"#usuario\").val();\n registro[\"pass\"] = gestor.stringBase64($(\"#pass\").val());\n registro[\"nombre\"] = $(\"#nombre\").val();\n registro[\"departamento\"] = $(\"#departamento\").val();\n registro[\"nivel\"] = $(\"#nivel\").val();\n\n registroManager.addRegistro(registro, 'changePageIndex');\n }\n}", "function confirmarCambiosAuditoria()\n{\n\n // CERRAMOS MODAL CONFIRMAR CAMBIOS AUDITORIA...\n $('#modalConfirmarCambiosAuditoria').modal('hide');\n showLoading()\n\n unidadNegocio = document.getElementById('sel_unidad_organizativa').value;\n unidadNegocioText = $(\"#sel_unidad_organizativa option:selected\").text()\n sede = document.getElementById('sel_sede').value;\n sedeText = $(\"#sel_sede option:selected\").text()\n tipoAuditoria = document.getElementById('sel_tipo_auditoria').value;\n tipoAuditoriaText = $(\"#sel_tipo_auditoria option:selected\").text()\n fechaInicio = document.getElementById('tx_date_start_auditoria').value;\n fechaFin = document.getElementById('tx_date_end_auditoria').value;\n var ver = document.getElementById(\"btnVerAuditoria_\"+id_auditoria);\n Code = ver.getAttribute(\"Code\")\n Description = ver.getAttribute(\"Description\")\n StatusEvaluacionId = ver.getAttribute(\"StatusEvaluacionId\")\n Created_by = ver.getAttribute(\"Created_by\")\n\n normasText = ver.getAttribute(\"Code_Normas\")\n console.log(\"normasText\",normasText)\n console.log(\"Code\",Code)\n\n //si es 1 (observada)\n if(EstatusEvaluacionId==1)\n EstatusEvaluacionId = 2 // lapasamos a correguida\n\n console.log(\"!*!*!*! EstatusEvaluacionId \",EstatusEvaluacionId)\n StatusId = ver.getAttribute(\"StatusId\")\n DescriptionStatus = ver.getAttribute(\"DescriptionStatus\")\n //alert(\"StatusEvaluacionId \" +StatusEvaluacionId)\n\n // console.log(\"fechaInicio1 \",fechaInicio)\n // console.log(\"fechaFin2 \",fechaFin)\n // console.log(ver.getAttribute(\"Inicio2\"))\n // console.log(ver.getAttribute(\"Fin2\"))\n // console.log(\"fechaInicio \",fechaInicio)\n // console.log(\"fechaFin \",fechaFin)\n //return false;\n\n if( (fechaInicio!=ver.getAttribute(\"Inicio2\") || fechaFin != ver.getAttribute(\"Fin2\")) && (StatusEvaluacionId==3) )\n {\n //alert(\"Cambiar estatus a reprogramada \"+StatusEvaluacionId)\n\n DescriptionStatus = \"Reprogramada\";\n StatusId = 3;\n }\n\n fechaInicio = formatearFechaDB(fechaInicio)\n fechaFin = formatearFechaDB(fechaFin)\n\n var Last_Updated_By = getCookie(\"vtas_id_hash\"+sessionStorage.tabVisitasa);\n var Last_Updated_Date = moment().format();\n\n var servicio = \"/api/Post-Auditoria-All?code=\"\n var postAuditoriaAll = \"l/Ucgq69Kj8Yur7Se2RlCYtWga8XKfd8TuLSma8pYoGnsP/GqJO81g==\"\n console.log(JSON.stringify({\"Id\":id_auditoria,\"Code\":Code,\"SedeId\":sede,\"TipoId\":tipoAuditoria,\"StatusId\":StatusId,\"Inicio\":fechaInicio,\n \"Fin\":fechaFin,\"Code_Normas\":normasText,\"Last_Updated_By\":Last_Updated_By,\"Last_Updated_Date\":Last_Updated_Date,\"ProgramaAuditoriaId\":id_programa_auditoria,\"StatusEvaluacionId\":StatusEvaluacionId}))\n var settings = {\n \"url\": apiurlAuditoria+\"/api/Post-Auditoria-All?code=l/Ucgq69Kj8Yur7Se2RlCYtWga8XKfd8TuLSma8pYoGnsP/GqJO81g==&httpmethod=put&Id=\"+id_auditoria,\n \"method\": \"POST\",\n \"timeout\": 0,\n \"crossDomain\": true,\n \"dataType\": \"json\",\n \"headers\": {\n \"apikey\": \"r$3#23516ewew5\",\n \"Content-Type\": \"application/json\",\n //\"Cookie\": \"ARRAffinity=a83b483df408e977188ac9dc47b9c62843a9cf2b4d80808e3feaaaabec8efe1d\"\n },\n\n\n \"data\": JSON.stringify({\"Id\":id_auditoria,\"Code\":Code,\"Description\":Description,\"SedeId\":sede,\"TipoId\":tipoAuditoria,\"StatusId\":StatusId,\"Inicio\":fechaInicio,\n \"Fin\":fechaFin,\"Code_Normas\":normasText,\"Created_By\":Created_by,\"Last_Updated_By\":Last_Updated_By,\"Last_Updated_Date\":Last_Updated_Date,\n \"ProgramaAuditoriaId\":id_programa_auditoria,\"StatusEvaluacionId\":StatusEvaluacionId}),\n };\n\n //console.log(\"despues de return\")\n $.ajax(settings).done(function (response) {\n console.log(response);\n\n\n if(response.Id==0)\n {\n swal({\n title: \"Error\",\n text: response.Description,\n type: \"error\",\n //timer:3000,\n showCancelButton: false,\n confirmButtonClass: \"btn-green-lime btn-rounded btn-raised btn-sm\",\n confirmButtonText: \"De acuerdo\",\n closeOnConfirm: false\n });\n // CERRAMOS MODAL CONFIRMAR INGRESO AUDITORIA\n $('#modalConfirmarCambiosAuditoria').modal('hide')\n // ABRIMOS MODAL DE REGISTRO DE AUDITORIA\n $('#modificarAuditoriaModal').modal('show');\n return\n }\n\n // ABRIMOS MODAL EXITO EN REGISTRO DE AUDITORIA...\n $('#modalExitoCambiosAuditoria').modal('show');\n // RECARGAR EL DATATABLE DE AUDITORIAS...\n //vw_auditorias_list.reloadtableBlackList()\n // Volvemos a listar la tabla con los divs\n //vw_auditorias_list.tablaDivsAuditorias()\n vw_auditorias_list.filtroTablaDivsAuditorias()\n\n //vw_auditorias_list.init()\n // RECARGAR EL ARRAY QUE CONTINE LAS MODIFICAIONES DE LAS AUDITORIAS...\n vw_auditorias_list.getAuditoriaModificacionLog()\n\n })\n .fail(function( jqXHR, textStatus, errorThrown )\n {\n\n //showNotification(\"Por favor Verifique los datos ingresados, su conexión a internet y vuelva a intentarlo.\")\n swal(\"Error\", \"Por favor Verifique los datos ingresados, su conexión a internet y vuelva a intentarlo.\",\"error\")\n console.log(errorThrown)\n })\n .always(function( jqXHR, textStatus, errorThrown )\n {\n console.warn(\"jqXHR -> \",jqXHR)\n hideLoading()\n });//*/\n\n}", "function funcVerifTableau(tableauResultats) {\r\n for (let i = 0; i < 5; i++) {\r\n if (tableauResultats[i] === reponses[i]) {\r\n verifTableau.push(true);\r\n } else {\r\n verifTableau.push(false);\r\n }\r\n }\r\n console.log(verifTableau);\r\n afficherResultats(verifTableau);\r\n verifTableau = [];\r\n}", "function esValido(prodNuevo){\n let salida = true;\n const campos = Object.values(prodNuevo);\n campos.forEach(campo => {\n if (campo === \"\") {\n salida = false;\n }\n });\n return salida;\n}", "function notAvailableResponse(model, package){\n model = model_available ? model : false;\n package = package_available ? package : false;\n res.status(200).send({make,model,package,customer_id,order_id:null});\n }", "async function testExist_ANX(element) {\n let cartaFrete = element.CARTAFRETE\n let filial = element.FILIAL_APP\n let operacao = element.OPERACAO\n let tipo = element.TIPOVEICULO\n let usuario = element.USUARIO \n let anx\n\n await searchExist_ANX(cartaFrete,filial,operacao,tipo).then( async (ret)=>{\n if(ret.success==false){\n anx = await insert_ANX(cartaFrete,filial,operacao,usuario,tipo)\n }\n })\n baixaAPI_sucesso(element.ID)\n}", "async function getDpaProvincias(req, res) {\n let busqueda = req.params.id;\n\n try {\n let provinciasObtenidas = await DPA.findAll({where: {TIPO: req.params.id}, order: [['NOMBRE', 'ASC']]});\n\n if (provinciasObtenidas.length > 0) {\n res.status(200).send({\n data: provinciasObtenidas,\n message: \"DPA cargado correctamente\"\n });\n } else {\n res.status(402).send({\n message: 'No existe DPA registrada en la base de datos'\n });\n\n\n }\n } catch (err) {\n res.status(500).send({\n message: 'error:' + err\n });\n }\n}", "function disponibilidad(ruta){\n var cantidad=ruta.length;\n\n \n var campos=0;\n for (var y=0; y <cantidad ; y++) { \n // invoca la funcion si url_exist para verificar existencia con un llamado al servidor\n var existe= isURL( ruta[y] );\n // alert(\"existe ruta \"+ existe);\n // si es verdadero entrega la existencia del objeto\n if (existe) {\n \n campos++;\n //echo \" -El objeto almacenado en la ruta \".ruta[y].\", si existe.<br> \";\n } else{// \n // si no existe el objeto\n //echo \" -El objeto almacenado en la ruta \".ruta[y].\", no fue encontrado.<br>\";\n }\n\n \n }\n var m_disponibilidad=campos/cantidad;\n // valida que calidad de la completitud del objeto \n if (m_disponibilidad<0.25) {\n evaluacion=\"Regular\";\n }else if (m_disponibilidad>=0.25 && m_disponibilidad<0.5) {\n evaluacion=\"Buena\";\n }else if (m_disponibilidad>=0.5 && m_disponibilidad<0.75) {\n $evaluacion=\"Muy buena\";\n }else if (m_disponibilidad>=0.75 ) {\n evaluacion=\"Exelente\";\n }\n //echo \" -Disponibilidad: \".evaluacion.\"<br>\";\n \n\n }", "function ispisCene(){\n \n let ispisCena=racunajCenu(findDestPrice(dest),brOsoba);\n document.querySelector(\"#cena\").innerHTML = `${ispisCena}&euro;`;\n }", "async function testOccupeUser(login){\n if (login === null) return \"INVALID\";\n try{\n var value = await knex.raw(\"SELECT users.etat FROM users WHERE users.login= ?\", [login]);\n if (value.length == 1) {\n if (value[0].etat === \"OCCUPE\") return \"TRUE\";\n } else {\n console.error('Erreur dans le test de connexion-occupe d\\'un utilisateur dans la table users'); \n }\n return \"FALSE\";\n }\n catch(err){\n console.error('Erreur dans la connection-occupe d\\'un utilisateur dans la table users (testOccupeUser)'); \n console.error(err);\n }\n}", "function check(){\n transID = genarateTransactionId();\n conn.query('SELECT transaction_id FROM transaction WHERE transaction_id = '+ transID,function(err,result){\n if(result.length != 0){\n check();\n }\n });\n}", "function confirmarPedido() {\n valorTotal = valorPrato + valorBebida + valorSobremesa;\n const botao = document.querySelector(\".botao-confirmar\");\n if(botao.classList.contains(\"liberar-confirmacao\")) {\n nomeUsuario = prompt(\"Qual é o seu nome?\");\n enderecoUsuario = prompt(\"Qual é o seu endereço?\");\n mensagem = encodeURIComponent( `Olá, gostaria de fazer o pedido:\n - Prato: ${nomePrato}\n - Bebida: ${nomeBebida}\n - Sobremesa: ${nomeSobremesa}\n Total: R$ ${valorTotal.toFixed(2)}\n \n Nome: ${nomeUsuario}\n Endereço: ${enderecoUsuario}`);\n janelaConfirmacao();\n }\n}", "existCorreo(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n const { correo } = req.params;\n const usuarios = yield pool.query('SELECT * FROM proyecto_ionic.usuario where correo=?', [correo]);\n if (usuarios.length > 0) {\n return res.json(usuarios[0]);\n }\n else {\n res.status(404).json({ text: 'No existen conversaciones' });\n }\n });\n }", "function cargarDisponiblesProcesar(form) {\r\n\tvar frm = document.getElementById(\"frmentrada\");\r\n\tvar forganismo = document.getElementById(\"forganismo\").value;\r\n\tvar ftiponom = document.getElementById(\"ftiponom\").value;\r\n\tvar fperiodo = document.getElementById(\"fperiodo\").value;\r\n\tvar ftproceso = document.getElementById(\"ftproceso\").value;\r\n\t\r\n\tif (ftiponom==\"\" || fperiodo==\"\") { alert(\"¡DEBE SELECCIONAR EL TIPO DE NOMINA Y PERIODO!\"); return false; }\r\n\telse if (ftproceso==\"\") { alert(\"¡DEBE SELECCIONAR EL TIPO DE PROCESO!\"); return false; }\r\n\telse return true;\r\n}", "async function getOfertasValidadas() {\n\n const opcionesFetch = {\n method: \"GET\",\n headers: HEADERS\n };\n\n const response = await fetch(API + \"/GetOfertasValidadas\", opcionesFetch);\n if (response.ok) {\n const resp = await response.json();\n return resp;\n } else {\n return [];\n }\n}", "verificarConexion() {\n if (espinoClients.length != 0) {\n espinoClients.forEach((host) => {\n ping.sys.probe(host, (isAlive) => {\n if (!isAlive) { //Si algun cliente espino esta desconectado, se manda notificacion\n var i;\n for (i = 0; i < hostAvisados.length; i++) {\n if (hostAvisados[i] === host) {\n return;\n }\n }\n alert = 'host ' + host + ' no esta conectado';\n console.log(alert);\n serverClient.publish('web/messages', alert);\n serverClient.publish('bot/messages', alert);\n email.sendMail(alert);\n hostAvisados.push(host);\n } else {\n var i;\n for (i = 0; i < hostAvisados.length; i++) {\n if (hostAvisados[i] === host) {\n hostAvisados[i] = '';\n }\n }\n }\n });\n });\n }\n }", "function ValidarDatosObligatorios() {\n\tvar respuesta = true;\n\n\t$(\"#validacionComentario\").hide();\n\n\tif ($(\"#txtComentarioNuevo\").val().trim() == \"\") {\n\t\t$(\"#validacionComentario\").show();\n\t\trespuesta = false;\n\t}\n\n\tif ($(\"#txtSolicitudId\").val() == \"\" ) {\n\t\trepuesta = false;\n\t}\n\n\treturn respuesta;\n}", "function funcVerifTableau(tableauResultats) {\n for (let i = 0; i < 5; i++) {\n if (tableauResultats[i] === reponses[i]) {\n verifTableau.push(true);\n } else {\n verifTableau.push(false);\n }\n }\n console.log(verifTableau);\n afficherResultats(verifTableau);\n couleursFunction(verifTableau);\n verifTableau = [];\n}", "function gps_permitirConsulta() {\n if (!consultando) {\n gps_pausarAutoConsultaAuto();\n gps_bloquearComponente(\"btn_consulta\", false);\n } else {\n gps_bloquearComponente(\"btn_consulta\", true);\n }\n}", "function notie() {\n\t\tif ( - [1, ]) {\n\t\t\talert('这货不是ie')\n\t\t}\n\t}", "function validarEmpresa(){\n\n var rfc =document.getElementById('RFC').value;\n var oculto =document.getElementById('oculto').value;\n\n var route = \"http://localhost:8000/validarEmpresa/\"+rfc;\n\n $.get(route,function(res){\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idEmpresa = res[0].id;\n document.getElementById(\"idEmpresa\").value= idEmpresa;\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].rfc != oculto ) {\n\n document.getElementById(\"errorRFC\").innerHTML = \"La empresa que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n}\nelse {\n document.getElementById(\"errorRFC\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n}\n});\n\n}", "function doNot() {\r\n // send a NOT command to the server with the first number\r\n let num1 = $(\"#num1\").val();\r\n let num2 = $(\"#num2\").val();\r\n if (checkInput(\"NOT\", num1, num2))\r\n send(\"NOT\", num1);\r\n}", "function isWarrantyPartsReturnChat(snapInObject){ //Check if it is a Warranty Parts Return \n if (\"requestType\" in snapInObject && snapInObject.requestType == \"warrantyReturn\")\n return true; \n else\n return false; \n}", "function ContieneEspaciosVacios(cadena) {\n\n let contiene;\n const listaFinal = [];\n const listaCaracteresCadena = cadena.split('');\n \n listaCaracteresCadena.forEach(element => {\n if(element !== ' '){\n listaFinal.push(element);\n }\n \n });\n \n if(listaFinal.length !== listaCaracteresCadena.length ){\n contiene = true;\n }else{\n contiene = false;\n }\n \n return contiene;\n }", "function valideIdentifiant() {\n\n let élément = document.getElementById(\"identifiant\");\n\n // vérification de la conformité de l'identifiant\n let ok = vérifieIdentifant(élément);\n\n // Cache ou affiche le message d'erreur\n let errorLabel = document.getElementById('identifiantError');\n if (ok === true) {\n errorLabel.style.display = 'none'; // on cache le messsage d'erreur\n } else {\n errorLabel.style.display = 'block'; // on le révèle\n }\n return ok;\n}", "function checkPersonaExiste(){\n var request = $.ajax({\n url: \"ajax.php?funcion=buscar\",\n method: \"POST\",\n data: { key: $(\"#id_cedula_persona_receptora_buscada\").val() },\n dataType: \"json\"\n });\n\n request.done(function (response) {\n if(response.error == 0){ // errores controlados tales como error en la \"BD en la consulta\"\n if (response.found == 1) {\n $(\"#id_cedula_persona_receptora\").val($(\"#id_cedula_persona_receptora_buscada\").val());\n $(\"#poblacion\").val(response.poblacion).prop( \"disabled\", true );\n $(\"#poblacion_originaria\").prop( \"checked\", response.poblacion_originaria ).prop( \"disabled\", true );\n }\n else {\n $(\"#id_cedula_persona_receptora\").val('');\n $(\"#poblacion_originaria\").prop( \"disabled\", false );\n $(\"#poblacion\").prop( \"disabled\", false );\n }\n }\n else {\n alert(response.errorMessage);\n }\n });\n\n request.fail(function (jqXHR, textStatus) {\n alert(\"Ocurrió un error: \" + textStatus); // para reflejar los errores que no son controlados en el script, como errores de conexion\n });\n }", "async function verificarCancha(cancha) {\n let existe = false;\n let c = await getCancha(cancha.numero)\n\n if (c != null) {\n existe = true;\n }\n\n if (existe) {\n existe = parseInt(cancha.numero);\n }\n return existe;\n}", "function showNetworkStatus(){\n // Me muestra en el HTML si tengo conexion a internet o no \n const statusDOM = document.getElementById('NET_STATUS');\n statusDOM.textContent = navigator.onLine ? 'SI' : 'NO';\n}", "function checkSendedValue() {\n return (req.body.email != undefined && String(req.body.email).match(/^(([^<>()\\[\\]\\\\.,;:\\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,}))$/) == null) ||\n (req.body.password != undefined && req.body.password == \"\") ||\n (req.body.password2 != undefined && req.body.password2 == \"\") ||\n (req.body.token != undefined && req.body.token == \"\") ||\n (req.body.itineraryName != undefined && req.body.itineraryName == \"\") ||\n (req.body.emailUser != undefined && req.body.emailUser == \"\") ||\n (req.body.coordinate != undefined && req.body.coordinate == \"\");\n }", "function presentarNota(){darRespuestaHtml(\"<b>Nota: \"+nota+\"</b> punto/s sobre 10\");}" ]
[ "0.5746764", "0.57259446", "0.5611013", "0.5588444", "0.5563374", "0.54291016", "0.54149574", "0.53687453", "0.53646326", "0.5351106", "0.5350809", "0.53065395", "0.53056693", "0.5301784", "0.52873105", "0.5281144", "0.52522814", "0.5242141", "0.5235769", "0.52216303", "0.5219401", "0.5218201", "0.52174294", "0.5209505", "0.5198472", "0.51828367", "0.51824445", "0.5180722", "0.5159932", "0.5157073", "0.5153183", "0.5136965", "0.51329887", "0.5120664", "0.51161003", "0.51136774", "0.5113488", "0.5111488", "0.5111488", "0.5105611", "0.50957996", "0.5093321", "0.50923806", "0.5088119", "0.5081837", "0.50800407", "0.50785875", "0.5076888", "0.507317", "0.5060997", "0.5058782", "0.50547725", "0.50466394", "0.5044973", "0.50447094", "0.5038111", "0.503129", "0.5028115", "0.50272834", "0.50223726", "0.5011752", "0.5011718", "0.50074536", "0.50074035", "0.5007134", "0.5002234", "0.5002078", "0.50016207", "0.50002646", "0.49996987", "0.4994603", "0.49907514", "0.49895185", "0.49872896", "0.4983831", "0.49810058", "0.4978158", "0.49732202", "0.49732023", "0.4969119", "0.49666265", "0.4964731", "0.4964474", "0.49635038", "0.49607563", "0.49593434", "0.4956558", "0.49468422", "0.494377", "0.494317", "0.49421987", "0.49416766", "0.494129", "0.49317166", "0.49310836", "0.4930938", "0.49298418", "0.49284628", "0.49244612", "0.49220797", "0.492042" ]
0.0
-1
Esta funcion se usa para ver la nota recibida en la consulta de notas recibida
function verNotaRecibida(nroNotaRec, nameArchivo) { var URL = getUrlApp() + "/DownloadServlet?tipo=VER_NOTA_REC&nroNotaRec=" + nroNotaRec + "&nameArchivo=" + nameArchivo + TAB_ID_REQUEST; /* window.status = URL; var w = window.open(URL,"Memo","width=" + ancho + ",height=" + alto + ",top=" + posX + ",left=" + posY + ",scrollbars=YES,resizable=YES"); w.focus(); */ var anchorDownloader = new Element('a', { href: URL, download: 'true' }).setStyle('visibility', 'hidden').inject(document.body); anchorDownloader.click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mostraNotas(){}", "function verificarDT(atrib, mens, id){\n var bandera = true;\n if(atrib.value.length > 0){\n if(mens=='mtelefono' && atrib.value.length<9){\n error(atrib, mens, '<br>El numero de telefono no tiene los digitos necesarios')\n bandera = false;\n vgeneral[id]=bandera;\n }else{\n arreglo(atrib, mens);\n bandera = true;\n vgeneral[id]=bandera;\n }\n \n }else{\n error(atrib, mens, '<br>El campo esta vacio')\n bandera = false;\n vgeneral[id]=bandera;\n }\n return bandera;\n}", "function checkReturnEndCorrespondente() {\n\t\tvar form = document.frmCadCliente;\n\t\tif (form.hiddenTypeColeta.value == 0) {\n\t\t\tdocument.getElementById(\"tableCadClienteContato\").style.display = 'none';\n\t\t\tdocument.getElementById(\"tableCadClienteEndereco\").style.display = 'block';\n\t\t} else {\n\t\t\tdocument.getElementById(\"tableCadClienteContato\").style.display = 'none';\n\t\t\tdocument.getElementById(\"tableCadClienteEnderecoColeta\").style.display = 'block';\n\t\t} \n\t}", "function pisarTerreno(nuevo){\n // Recorrer cada terreno del jugador\n for(var a = 0; a < jugando.terrenos.length; a++){\n // Si el ID coincide con el nuevo terreno\n if(nuevo.id == jugando.terrenos[a][0]){\n // Si tiene un peso, entonces aplica\n if(jugando.terrenos[a][1] != \"\"){\n return true;\n }\n else{\n return false;\n }\n }\n }\n}", "static ObtenerNotas() {\n return __awaiter(this, void 0, void 0, function* () {\n let respuesta;\n let error = false;\n let extra;\n let notas = yield nota_model_1.M_NOTA.findAll({\n order: [\n ['fecha_modificacion', 'DESC']\n ]\n })\n .then((notas) => {\n // return subdividirArreglo(notas, 4);\n return notas;\n }).catch((e) => { extra = e; error = true; return e; });\n return respuesta = {\n data: notas,\n error: error,\n extra: { extra },\n msg: 'Todo bien'\n };\n });\n }", "function DatosCompletos()\r\n{\r\n var resp = true;\r\n // if (document.getElementById('cboSubEspecialidades').value == \"0\")\r\n\t// {\r\n\t\t//resp= false;\t\t\r\n\t //}\r\n if (document.getElementById('txtfechainicio').value == \"\")\r\n\t {\r\n\t\tresp= false;\t\t\r\n\t }\r\n if (document.getElementById('txtfechafin').value == \"\")\r\n\t {\r\n\t\tresp= false;\t\t\r\n\t }\r\n return resp;\r\n}", "function validarNA(atri, men, id){\n var bandera = true;\n if(atri.value!==''){\n var partes = atri.value.split(\" \");\n if(partes.length !== 2 || partes[0]=='' || partes[1]==''){\n error(atri, men, '<br>Los datos ingresados no son aceptados')\n bandera = false;\n vgeneral[id]=bandera;\n }else{\n arreglo(atri, men);\n bandera = true;\n vgeneral[id]=bandera;\n }\n }else{\n error(atri, men, '<br>Debe ingresar mas informacion')\n bandera = false;\n vgeneral[id]=bandera;\n }\n return bandera;\n}", "function correcTexto() {\r\n var resp = formElement.elements[0].value;\r\n if (resp == respTexto) {\r\n darRespuesta(\"Perfecto.\");\r\n nota += 1;\r\n } else {\r\n darRespuesta(\"Te has equivocado.\");\r\n }\r\n}", "function ValidarDatosObligatorios() {\n\tvar respuesta = true;\n\n\t$(\"#validacionComentario\").hide();\n\n\tif ($(\"#txtComentarioNuevo\").val().trim() == \"\") {\n\t\t$(\"#validacionComentario\").show();\n\t\trespuesta = false;\n\t}\n\n\tif ($(\"#txtSolicitudId\").val() == \"\" ) {\n\t\trepuesta = false;\n\t}\n\n\treturn respuesta;\n}", "function isWarrantyPartsReturnChat(snapInObject){ //Check if it is a Warranty Parts Return \n if (\"requestType\" in snapInObject && snapInObject.requestType == \"warrantyReturn\")\n return true; \n else\n return false; \n}", "function user_rental(res, parameters, callback) {\n Rental.findAndCountAll({\n where: {\n book_id: parameters['book_id'],\n account_id: parameters['account_id'],\n hardcopy_id: {\n $ne: null\n }\n }\n })\n .then(function (result) {\n if (result.count != 0) {\n response.send_error(res, \"You have already rent this book\");\n callback(true);\n }\n else {\n callback(false);\n }\n })\n .catch(function () {\n response.send_error(res, \"Query failed\");\n callback(true);\n });\n}", "function ValidarRegistro()\n{\n\n var porId = document.getElementById(\"nombre\").value;\n var porId2 = document.getElementById(\"estatus\").value;\n \n $(\".requisito\").each(function(index,value){\n \n id= $(value).children(\".id_requisito\").text();\n nombre_requisitoViejo= $(value).children(\".nombre_requisito\").text();\n estatusViejo= $(value).children(\".estatus\").text();\n\n });\n var id_requisitotabla = $(\".id_requisito\").val();\n if((id_requisitotabla==porId )&&(estatusViejo==porId2))\n { \n MensajeModificarNone();\n return false;\n }else if($(\"#nombre\").val()=='')\n {\n MensajeDatosNone();\n $(\"#nombre\").focus();\n return false;\n }\n else if($(\"#nombre\").val().length<3)\n {\n MensajeminimoCaracter();\n $(\"#nombre\").focus();\n return false;\n }else if($(\"#estatus\").val()=='')\n {\n MensajeEstatusSelecct();\n $(\"#estatus\").focus();\n return false;\n }\n {\n return true;\n }\n\n}", "checkCommunications(doc, display) {\n const staleDate = moment(moment().format('YYYY-MM-DD'), 'YYYY-MM-DD').subtract(30, 'days');\n doc.communications.forEach((communication) => {\n const type1 = communication.communication_type;\n const type2 = communication.comment_type;\n if (type1 == 'Communication' || type2 != 'Updated') {\n const newDate = moment(communication.communication_date, 'YYYY-MM-DD');\n if (staleDate.isBefore(newDate)) {\n return false;\n }\n }\n });\n return true;\n }", "function checkParticipants(){\n\t\tlet participants=document.querySelectorAll('[data-requested-participant-id],[data-participant-id]')\n\t\t//to-do might want to look at [role=\"presentation\"] && [data-sender-name] too\n\t\tif(!participants) return\n\t\t\n\t\t// look for a change in the number of participants\n\t\tlet np=participants.length\n\t\tif (old_np===np) {\n\t\t\t//console.log('checkParticipants - no change')\n\t\t\treturn\n\t\t}\n\t\told_np=np\n\t\t\n\t\t//console.log('checkParticipants', np)\n\t\tvar tta = $(\"#Invited-List\")[0];\n\t\tlet tal=tta.value\n\t\tlet tallc=tal.toLowerCase()\n\t\tlet changed=false\n\t\tfor (let aa of participants){\n\t\t\tlet pn=aa.innerHTML.replace(/<[^>]*?>/ig,'\\n').replace(/\\n\\n*/gm,'\\n')\n\t\t\t.replace(re_replace,'')\n\t\t\t.replace(/\\(.*\\)/ig,'')\n\t\t\t.replace(duplicatedLines, \"$1\")\n\t\t\t.trim() \n\t\t\t//let pn=aa.innerHTML.replace(/<[^>]*?>/ig,'\\n').replace(/\\n\\n*/gm,'\\n')\n\t\t\t//.replace(re_you,'')\n\t\t\t//.replace(re_joined,'')\n\t\t\t//.replace(re_more,'')\n\t\t\t//.replace(/\\(.*\\)/ig,'')\n\t\t\t//.replace(duplicatedLines, \"$1\")\n\t\t\t//.trim()\n\t\t\t\n\t\t\tif(pn==='')\tcontinue\n\t\t\tlet lc=pn.toLowerCase()\n\t\t\tif( lc.indexOf(strings.presenting)>=0 || lc.indexOf(strings.presentation)>=0) continue\n\t\t\t\n\t\t\t\t\t\n\t\t\tif(tallc.indexOf(lc)==-1){\n\t\t\t\tconsole.log(pn + ' joined (unexpectedly)')\n\t\t\t\ttal+='\\n? '+pn\n\t\t\t\tchanged=true\n\t\t\t}\n\t\t\telse if(tallc.indexOf('? '+ lc)>=0){\n\t\t\t\tcontinue // already uninvited\n\t\t\t}\n\t\t\telse if(tallc.indexOf('✔ '+ lc)>=0){\n\t\t\t\tcontinue // already marked present\n\t\t\t}\n\t\t\t else if(tallc.indexOf('✔ '+ lc)==-1){\n\t\t\t\tconst pattern=new RegExp(pn, 'i')\n\t\t\t\tconsole.log(pn + ' joined (as expected)')\n\t\t\t\ttal=tal.replace(pattern,'✔ '+pn)\n\t\t\t\tchanged=true\n\t\t\t}\n\t\t\telse{\n\t\t\t\tconsole.log('WTF - ' + pn)\n\t\t\t}\n\t\t}\n\t\t//if the list changed, a littlehousekeeping and save the changes\n\t\tif (changed) {\n\t\t\ttta.value=tal.trim().replace('✔ ✔ ','✔ ').replace(duplicatedLines, \"$1\")\n\t\t\tlistChanged()\n\t\t}\n\t}", "verificaDados(){\n this.verificaEndereco();\n if(!this.verificaVazio()) this.criaMensagem('Campo vazio detectado', true);\n if(!this.verificaIdade()) this.criaMensagem('Proibido cadastro de menores de idade', true);\n if(!this.verificaCpf()) this.criaMensagem('Cpf deve ser válido', true);\n if(!this.verificaUsuario()) this.criaMensagem('Nome de usuario deve respeitar regras acima', true);\n if(!this.verificaSenhas()) this.criaMensagem('Senha deve ter os critérios acima', true)\n else{\n this.criaMensagem();\n // this.formulario.submit();\n }\n }", "function mdpActuelVerif(){\n var verification;\n var mdp=$('#mdpActuel');\n ajaxRequest('GET','php/request.php/verifMotDePasse',function(ajaxResponse){\n json= JSON.parse(ajaxResponse);\n if(!json['verification']){\n surligne(mdpActuel, false);\n verification=false;\n }else{\n surligne(mdpActuel, true);\n verification=true;\n }\n },\"mdp=\"+mdp.value+\"&pseudo=\"+Cookies.get('pseudo'),function(){},false);\n return verification;\n}", "function ValidarRegistro()\n{\n\n var porId = document.getElementById(\"nombre\").value;\n var porId2 = document.getElementById(\"estatus\").value;\n\n $(\".requisito\").each(function(index,value){\n\n id = $(value).children(\".id_requisito\").text();\n nombre_requisitoViejo = $(value).children(\".nombre_requisito\").text();\n estatusViejo = $(value).children(\".estatus\").text();\n\n });\n var id_requisitotabla = $(\".id_requisito\").val();\n if((id_requisitotabla==porId )&&(estatusViejo==porId2))\n {\n MensajeModificarNone();\n return false;\n }else if($(\"#nombre\").val()=='')\n {\n MensajeDatosNone();\n $(\"#nombre\").focus();\n return false;\n }\n else if($(\"#nombre\").val().length<3)\n {\n MensajeminimoCaracter();\n $(\"#nombre\").focus();\n return false;\n }else if($(\"#estatus\").val()=='')\n {\n MensajeEstatusSelecct();\n $(\"#estatus\").focus();\n return false;\n }\n {\n return true;\n }\n\n}", "function checkedGestionControlbyMail(){\n\tif(checkedN == \"checked\")\n\t\t{\n\t\t\tconsole.log('toto1');\n\t\t\tpreInscriptionNoGood();\n\t\t}\n\t\telse if (checkedP == \"checked\")\n\t\t{\n\t\t\tconsole.log('toto2');\n\t\t\tcliendNoGood();\n\t\t}\n\t\telse if (checkedI == \"checked\")\n\t\t{\n\t\t\telementManquant1=\"\";\t\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\tconsole.log('toto3');\t\n\t\t\tinscriptionNoGood();\n\t\t}\n}", "function Deplacement_joueurpossedeterritoirenonisole(Id,carte) {\r\n\tvar possedeterritoirenonisole = false\r\n carte.forEach((territoire)=>{\r\n if(territoire.proprietaire==Id){\r\n var status = Deplacement_voisinLimitrophe(territoire)\r\n if (status){\r\n possedeterritoirenonisole = true\r\n }\r\n }\r\n })\r\n\treturn(possedeterritoirenonisole)\r\n}", "function CrearNota() {\n var id = document.getElementById(\"idArticulo\").value; //Obtiene el valor de Clave\n var FechaRecibo = document.getElementById(\"FechaRecibo\").value; //Obtiene el valor de Clave\n var Recibe = document.getElementById(\"Recibe\").value; //Obtiene el valor de Clave\n var ProductoSalida = document.getElementById(\"ProductoSalida\").value; //Obtiene el valor de Clave\n var Cantidad = document.getElementById(\"Cantidad\").value; //Obtiene el valor de Clave\n var Ubicacion = document.getElementById(\"Ubicacion\").value; //Obtiene el valor de Clave\n\n var OCCOmpras = document.getElementById(\"OCCOmpras\").value; //Obtiene el valor de Clave\n var OT = document.getElementById(\"OT\").value; //Obtiene el valor de Clave\n var POCliente = document.getElementById(\"POCliente\").value; //Obtiene el valor de Clave\n var ENS = document.getElementById(\"ENS\").value; //Obtiene el valor de Clave\n\n var Arreglo = [id, OCCOmpras, OT, ProductoSalida, POCliente, ENS, Cantidad, Ubicacion, FechaRecibo, Recibe];\n\n var Condicion = true; //para campos vacios\n for (var a in Arreglo) { //recorrer arreglo en busca de campos vacios\n if (Arreglo[a].length == 0) {\n Condicion = false; //si algun campo esta vacio cambia a falso\n alert(\"Faltan campos por llenar\")\n }\n }\n\n if (Condicion == true) { //si todos los campos estan llenos avanza\n var TablaAlmacen = document.getElementById('TablaSalidas').getElementsByTagName('tbody')[0];\n // inserta una fila al final de la tabla\n var newRow = TablaAlmacen.insertRow(TablaAlmacen.rows.length);\n let indice = (TablaAlmacen.rows.length + 1);\n newRow.setAttribute(\"id\", \"fila\" + indice); //se asigna id al incrementar cada fila +1 para contar el encabezado\n for (var x = 0; x < Arreglo.length; x++) {\n\n // inserta una celda en el indice 0\n var newCell = newRow.insertCell(x);\n // adjuntar el texto al nodo\n var newText = document.createTextNode(Arreglo[x]);\n newCell.appendChild(newText);\n if (x == 7) { //Si termina de registrar datos crear el boton\n var newCell = newRow.insertCell(8); //CREAR CELDA onclick=\"CrearNota()\"\n newCell.innerHTML = '<button id=\"' + x + '\" class=\"btn btn-danger\" name=\"btn\" onclick=\"EliminarFila(' + indice + ')\"> <i class=\"far fa-minus-square\"></i> </button>';\n }\n }\n //document.getElementById(\"RegistroSalida\").reset();\n document.getElementById(\"ProductoSalida\").value = \"\";\n document.getElementById(\"Cantidad\").value = \"\";\n }\n}", "async remind() {\n let res = await this.ctx.service.mrquery.getSearchTaskUnread()\n this.ctx.body = new Rep({ data: res.recordset })\n }", "function Fnc_BuscarInformacionHogar(s, e) {\n\n if (txtIdentidad.GetText() != \"\" || txtHogar.GetText() != \"\") {\n var NumHogar = (txtHogar.GetText() == \"\") ? 0 : txtHogar.GetText()\n if (txtIdentidad.GetText() != \"\") {\n if (txtIdentidad.GetText().length != 13) {\n $(\".warning\").hide()\n $(\"body\").waitMe(\"hide\")\n $(\"#Error_text\").text(\"error dede de ingresar un numero de identidad valido\")\n $(\".error\").show()\n return 0;\n }\n }\n Fnc_PeticionInformacionHogarSuspender(NumHogar, txtIdentidad.GetText())\n\n } else {\n $(\".warning\").hide()\n $(\"body\").waitMe(\"hide\")\n $(\"#Error_text\").text(\"error no debe de haber campos vacios\")\n $(\".error\").show()\n }\n\n}", "function verifReglement() {\n\n\tvar choix = document.getElementById('frmDifference').hdnChoix.value;\n\tvar du = parseFloat (document.getElementById('frmDifference').txtDu.value);\n\tvar encaisse = parseFloat (document.getElementById('frmDifference').txtEncaisse.value);\n\n\tif ( du > 0 ) {\n\n\t\tif ( choix == 'ESP' ) {\n\n\t\t\tif ( encaisse != 0 && encaisse >= du ) {\n\n\t\t\t\treturn true;\n\n\t\t\t} else {\n\n\t\t\t\tdocument.getElementById('frmDifference').txtEncaisse.select();\n\t\t\t\tdocument.getElementById('frmDifference').txtEncaisse.focus();\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t} else if ( choix == 'DIF' ) {\n\n\t\t\tif ( document.getElementById('frmDifference').txtDatePaiement.value ) {\n\n\t\t\t\treturn true;\n\n\t\t\t} else {\n\n\t\t\t\tdocument.getElementById('frmDifference').txtDatePaiement.select();\n\t\t\t\tdocument.getElementById('frmDifference').txtDatePaiement.focus();\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t} else {\n\n\t\treturn false;\n\n\t}\n}", "function comprobarNecesarios(formulario){\n var noHayErrores = true;\n $(\".\"+formulario+\" .necesario\").each(function(index){\n if($(this).val()==\"\"){\n $(this).addClass(\"k-invalid\"); \n noHayErrores = false;\n }\n }); \n return noHayErrores; \n }", "function verRepeticion(cadena) {\n cargarCadenaMovimientos(cadena);\n // Muestro el primer movimiento de la partida\n crearEventosMovRepeticion();\n cargarTablero(1);\n estilosMovActualRep(0);\n}", "function NumRecButtons_checkNumberOfRecords() \r\n{\r\n var retVal = \"\";\r\n var numRecs = this.numRecs;\r\n var isNumber = (numRecs == parseInt(numRecs));\r\n \r\n if (!numRecs)\r\n retVal = MM.MSG_NeedNumberOfRecords; // All values must be complete\r\n else if (!isNumber || numRecs < 1)\r\n retVal = MM.MSG_NeedValidNumberOfRecords;\r\n \r\n return retVal;\r\n}", "function verificarServicio(objeto){\n\t\tvalorBS=$(objeto).val();\n\t\t/**OBTENENEMOS CANTIDAD SI EXISTE GUIAS DE REMISION RELACIONADAS**/\n\t\tvar total=$('input[id^=\"accionAsociacionGuiarem\"][value!=\"0\"]').length;\n\t\tif(total>0){\n\t\t\t/**si es servicio***/\n\t\t\tif(valorBS=='S'){\n\t\t\t\tdocument.getElementById(\"buscar_producto\").readOnly = false;\n\t\t\t\t$(\"#idDivAgregarProducto\").show(200);\n\t\t\t}\n\t\t\t/**si es Bien**/\n\t\t\tif(valorBS=='B'){\n\t\t\t\tdocument.getElementById(\"buscar_producto\").readOnly = true;\n\t\t\t\t$(\"#idDivAgregarProducto\").hide(200);\n\t\t\t}\n\t\t}\n\t}", "function checkTimeBlocks() {\n if (reminders === null) {\n console.log(\"No Data\");\n }\n else if (reminders !== null){\n console.log(\"Data exists\")\n }\n}", "valideer () {\n /** Haal de input van de form op. */\n var input = document.forms[this.form][this.id]\n var str = input.value\n var len = str.length\n var result = true\n\n if (this.patronen.length === 0) {\n throw new Error('Error: geen patronen!!!')\n }\n\n result = this.valideerLengte(len)\n\n for (var i = 0; i < this.patronen.length; i++) {\n if (!this.valideerConditie(str, i)) {\n result = false\n }\n }\n\n if (len === 0) {\n if (this.required) {\n result = false\n } else {\n result = true\n }\n }\n\n this.status = result\n return result\n }", "function successRetrieval() {\n console.log(\"Recupero delle notizie completato!\");\n}", "function buscaProductoDetalleOrdenVenta(){\n\t\t//var codigoProducto = $.trim($('#txtCodigoProducto').val());\n\t\tvar codigoProducto = $('#txtCodigoProducto').val();\n\t\tvar existe = $(\"#tblDetalleOrdenVenta .codigo:contains('\"+codigoProducto+\"')\").length;\n\t\tif(existe > 0){\n\t\t\t$.msgbox(msgboxTitle,'El producto <strong>' + codigoProducto + '</strong> ya esta agregado en el<br>detalle de la guia de pedido.');\n\t\t\t$('#msgbox-ok, #msgbox-cancel, #msgbox-close').click(function(){\n\t\t\t\t$('#txtCantidadProducto').val('');\n\t\t\t\t$('#txtDescuento').val('');\n\t\t\t\t$('#txtCodigoProducto').val('').focus();\n\t\t\t});\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "function verifForm2(f){\n\n var telOk = verifTel(f.tel) ; \n var mailOk = verifMail(f.mail) ; \n var siteOk = verifLink(f.site) ;\n \n \n\n if (telOk || mailOk || siteOk ) {\n alert(\"Votre annonce a bien été envoyée, elle sera confirmée par nos équipes\");\n return true;\n } \n \n else{ \n \n alert(\"Veuillez remplir correctement tous les champs\");\n return false;\n }\n \n }", "validateInscription() {\n \n }", "function checkTypeContinue() {\n\t\tif (document.frmCadCliente.txtNumero.value == \"\") {\n\t\t\talert(\"Preencha o número da Localização da Empresa\");\n\t\t\tdocument.frmCadCliente.txtNumero.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (document.frmCadCliente.txtCep.value == \"\") {\n\t\t\talert(\"Preencha o campo Cep para Busca do Endereço de Coleta!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (isNaN(document.frmCadCliente.txtCep.value)) {\n\t\t\talert(\"Preencha o Cep somente com números!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (document.frmCadCliente.txtCep.value.length < 8) {\n\t\t\talert(\"Preencha corretamente o Campo Cep!\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\tdocument.getElementById(\"tableCadClienteEndereco\").style.display = 'none';\n\t\t\tif (!checkTypeColeta()) {\n\t\t\t\tdocument.getElementById(\"tableCadClienteContato\").style.display = 'block';\n\t\t\t} else {\n\t\t\t\tdocument.getElementById(\"tableCadClienteEnderecoColeta\").style.display = 'block';\n\t\t\t}\n\t\t}\n\t}", "async GetAlunoNotas(req, res) {\n try {\n const cpf = req.params.cpf;\n if (req.cargo === 'Aluno' && cpf !== req.cpf)\n return res.status(403).send(\"Não tente olhar as notas dos outros alunos\");\n const query = {\n name: \"get-grades\",\n text: \"SELECT meta, nota FROM notas WHERE cpf_aluno = $1\",\n values: [cpf]\n };\n const result = await connection_1.default.query(query);\n if (result.error)\n return res.status(500).send(\"Bad Request\");\n res.send(result.rows);\n }\n catch (err) {\n console.log(err);\n res.status(500).send(\"Bad Request\");\n }\n }", "function checkRecForm(){\n var u = JSON.parse(localStorage.utenti);\n var l = u.length;\n var user = document.submitRecForm.name.value;\n if(checkUsername() && checkRecensione()){\n for (i=0;i<l;i++){\n if(u[i].nickname == user) {\n var s= { nickname: u[i].nickname,\n email: u[i].email,\n password: u[i].password,\n recensioni: 1 };\n\n u[i]=s;\n localStorage.utenti=JSON.stringify(u);\n return true; \n }\n }\n }\n return false;\n}", "function chosenGoingTo(){\n let localContacts;\n //llamando a la referencia de data base\n database.ref('localContacts').once('value')\n .then((local) => {\n local.forEach((localContact) => { \n const string = JSON.stringify(localContact);\n const evaluar = string.includes('Laboratoria');\n console.log(evaluar);\n //console.log(JSON.stringify(local.nombre));\n //console.log(localContacts);\n });\n });\n}", "function recordatorioValido(recordatoriosExistentes){\n\tif(recordatoriosExistentes == null || recordatoriosExistentes == \"\" || typeof recordatoriosExistentes == \"undefined\" || recordatoriosExistentes == \"undefined\"){\n\t\treturn false;\n\t}else {\n\t\treturn true;\n\t}\n\n}", "function aclaracion(i) { //Saca un mensaje de aclaraci?n de la respuesta\n\tif ((pulsado!=0) & (acla[i]!=\"\")) {alert(acla[i]);}\n}", "function doNot() {\r\n // send a NOT command to the server with the first number\r\n let num1 = $(\"#num1\").val();\r\n let num2 = $(\"#num2\").val();\r\n if (checkInput(\"NOT\", num1, num2))\r\n send(\"NOT\", num1);\r\n}", "function valideIdentifiant() {\n\n let élément = document.getElementById(\"identifiant\");\n\n // vérification de la conformité de l'identifiant\n let ok = vérifieIdentifant(élément);\n\n // Cache ou affiche le message d'erreur\n let errorLabel = document.getElementById('identifiantError');\n if (ok === true) {\n errorLabel.style.display = 'none'; // on cache le messsage d'erreur\n } else {\n errorLabel.style.display = 'block'; // on le révèle\n }\n return ok;\n}", "buscarNodo(dato){\n if (this.tamanio == 0){\n console.log(\"No hay elementos en la lista.\")\n } else{\n let isEncontrado = false\n let aux = this.primero\n while(aux != null){\n if (aux.dato == dato){\n isEncontrado = true\n return aux.id \n }\n aux = aux.siguiente\n }\n\n if (isEncontrado == false){\n console.log(\"El elemento no se encuentra\")\n alert(\"El dato no se encuentra en la lista.\")\n }\n }\n }", "function inLeka(res) {\n if (res.customers.length === 0) {\n return false;\n } else {\n for (i = 0; i < res.customers.length; i++) {\n if (typeof res.customers[i].id !== 'undefined') {\n return true;\n } \n }\n }\n return false;\n }", "function marcarComoReprovado(aluno) {\n aluno.reprovado = false;\n if(aluno.nota < 5){\n aluno.reprovado = true;\n }\n}", "function newResponse(recipientId, text) {\n text = text || \"\";\n var testimonios = text.match(/testimonios/gi);\n\n if(testimonios != null) {\n var query = \"\";\n\n //sendMessage(recipientId, message);\n if(testimonios != null) {\n query = \"Historias\";\n } \n sendButtonMessage(recipientId, query);\n return true\n }\n return false;\n}", "_readNoti(notification) {\n const model = Platform.OS !== 'android' ? notification.data.model : JSON.parse(notification.model);\n const NotiId = model.NotiId;\n\n if (NotiId > 0) {\n // api: 1 là đã dọc tất cả, 0 là đã đọc 1 tin\n api.readNotiLog({ IdNoti: NotiId, IsReadAll: 0 }, (success, result, msg) => { \n \n if (success) { \n // set number read vao redux store\n this._setNotiNum();\n // set number read vao ICON APP (only IOS)\n this._setNotiNumIOS();\n }}\n );\n }\n }", "function tienenSaldoDisponible (callback){\n \n var arg = {}\n arg['falseId'] = {}\n arg['falseId']['$gt'] = rangos[0] \n arg['falseId']['$lt'] = rangos[1]\n \n obtenerParametros.conFiltros(arg,function(error,parametros){\n \n if (error){throw error}\n else {\n \n console.log('Tienen saldo ', parametros)\n var result = [] // Id's de los usuarios\n \n for (var a=0;a<parametros.length;a++){\n \n if (parametros[a]['totalDisponible'] >= parametros[a]['totalXInvs']){\n \n result.push(parametros[a]['_id']) // Id del usuario\n \n }\n }\n\n if (result.length > 0){\n\n return callback(result)\n\n }else {\n\n acabarPreInversion()\n\n }\n }\n })\n}", "function addListNotas(){\n new Ajax.Request(Utils.getKumbiaURL(\"desktop/addListNotas\"), {\n parameters: {\n numero: nota_selec,\n nota: $F('nota')\n },\n onSuccess: function(transport){\n response = transport.responseText.evalJSON();\n if(response['flag']==false)alert(response['msg']);\n else nota_selec = response['data'];\n showListNotas(false);\n },\n onFailure: function(transport){\n alert(transport.responseText);\n }\n });\n}", "async function hasNewMessages(req, res) {\n try {\n const requesterId = req.session.requesterId;\n\n if(requesterId === undefined) { res.send('false'); }\n const conversations = await getAllConversationsGeneric(requesterId);\n for (const conv of conversations) {\n if (conv.hasUnreadMessages && conv.messages[0].sender !== requesterId) {\n return res.send('true');\n }\n }\n res.send('false');\n }catch(error) {\n console.log(error);\n res.status(400).end();\n }\n}", "validarInformacion(){\n /** valida la informacion de los txt */\n if(this.generaValidacionControles() === 0){\n /** Se valida si se realizara un guardado o una actualizacion */\n if(this.state.objetoCliente.id === 0){\n /** Se realizara un guardado */\n return true;\n }else{\n /** Se llama el metodo que se encargara de indicar si se modifico algo o no */\n if(validaStateVsPropObj(this.state.objetoCliente,this.props.objCliente,'clientes')){\n return true;\n }else{\n /** Se asignan los valores del mensaje */\n this.mostrarControlMensaje(\"Se debe modificar al menos un campo para poder actualizar.\", 'danger', 'showMensaje');\n /** Se regresa el valor de que no cumplio la condicion */\n return false;\n }\n }\n }else{\n this.mostrarControlMensaje(\"Debe proporcionar toda la información.\", 'danger', 'showMensaje');\n /** Se regresa el valor de que no cumplio la condicion */\n return false;\n }\n }", "function addListNotas(){\n new Ajax.Request(Utils.getKumbiaURL(\"desktop/addListNotas\"), {\n parameters: {\n numero: nota_selec,\n nota: $F('nota_nota')\n },\n onSuccess: function(transport){\n response = transport.responseText.evalJSON();\n if(response['flag']==false)alert(response['msg']);\n else nota_selec = response['data'];\n showListNotas(false);\n },\n onFailure: function(transport){\n alert(transport.responseText);\n }\n });\n}", "function validarCuilCliente(){\r\n var elem = document.getElementById('agcuil').value;\r\n var rtdo = false;\r\n var msg = \"\";\r\n \r\n var datos = {\r\n cuil: elem\r\n }\r\n\r\n $.ajax({\r\n url:'buscarCuilCliente.php',\r\n type: 'POST',\r\n async: false,\r\n data: datos,\r\n success:function(datosRecibidos) {\r\n json = JSON.parse(datosRecibidos);\r\n rtdo =json;\r\n if(json){\r\n \r\n }else{\r\n msg = \"Ese cuil ya se encuentra registrado para otro cliente\"; \r\n \r\n }\r\n }\r\n })\r\n\r\n setValitationMesage('msjValidacionCuilCliente', rtdo, msg);\r\n return rtdo;\r\n \r\n}", "function verifier_doublant(idPere,nom,id){\n get_object_by_id(idPere);\n for(var key in found.fils)\n if (found.fils[key].nom == nom && found.fils[key].id != id)\n {\n alert($(\"#msg_js #msg_js_cet_elem_existe_deja_dans_rep\").html());\n found={};\n return true;\n }\n found={};\n}", "function clickRespostaFeeds(sentido) {\n\t\t\t\tlimparRadio();\n\t\t\t\tfor (var index = 1; index <= $('[id*=questao]').length ; index++) {\n\t\t\t\t\t\n\t\t\t\t\t//se errar\n\t\t\t\t\t$(\"[id^=radio_\" + index + \"e]\").click(function () {\n\t\t\t\t\t\t$('[id*=respE]').show(300);\n\t\t\t\t\t\t$('[id*=respC]').hide(300);\n\t\t\t\t\t\tlimparRadio();\n\t\t\t\t\t});\n\t\t\t\t\t//se acertar\n\t\t\t\t\t$(\"[id^=radio_\" + index + \"c]\").click(function () {\n\t\t\t\t\t\t$('[id*=respC]').show(300);\n\t\t\t\t\t\t$('[id*=respE]').hide(300);\n\t\t\t\t\t\t\n\t\t\t\t\t\tsetTimeout(function(){//intervalo para limpar o objeto e habilitar o movimento, o intervalo é usado para só habilitar depois de clicar no evt\n\t\t\t\t\t\t\t$('[id*=questao]').click(function(){\n\t\t\t\t\t\t\t\t$(this).hide();\n\t\t\t\t\t\t\t\tlimparRadio();\n\t\t\t\t\t\t\t\thabilitarMovimento(sentido);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},50)\n\t\t\t\t\t\t$(this).siblings().remove();//apaga o radio errado\n\t\t\t\t\t});\n\t\t\t\t}\n }", "function buscarCorreoDisponible(itemCorreo1,itemCorreo2,itemSubmit) {\n\t// Almacenamos en el control al funcion que se invocara cuando la peticion cambie de estado\n\tajax = new XMLHttpRequest();\n\tajax.onreadystatechange = validaCorreoDisponible;\n\titem[0] = itemCorreo1;\n\titem[1] = itemCorreo2;\n\titem[2] = itemSubmit;\n\tvar correo = id(itemCorreo1).value;\n\tvar variables = \"&correo=\" + correo;\n\tvariables += \"&esAjax=\" + true;\n\t\n\tajax.open(\"POST\", \"BuscarInformacionFormularios?metodoDeBusqueda=2\" + variables, true);\n\tajax.send(\"\");\n}", "async cancelarSolicitudesParaInmueble(infoSolicitud){\n let idInmueble = infoSolicitud.idInmueble\n let idSolicitudAprobada = infoSolicitud.idFirebase\n let fecha1 = infoSolicitud.fechaInicio\n let fecha2 = infoSolicitud.fechaFin\n let respuesta = await ManejadorBD.realizarConsulta(\"Solicitudes\", [\"idInmueble\"], [\"==\"], [idInmueble])\n for(let i in respuesta){\n if ( respuesta[i].idFirebase !== idSolicitudAprobada ){\n let objRervaAux = new SolicitudReserva( respuesta[i] )\n if ( objRervaAux.estaAbierta() && objRervaAux.fechasSeCruzan(fecha1, fecha2) ){\n this.cambiarEstadoSolicitudBaseDatos(respuesta[i].idFirebase, \"O\" )\n }\n }\n }\n }", "function notificacionMasiva(titulo, cuerpo) {\n Usuario.find({}).then((usuarios) => {\n var allSubscriptions = [];\n usuarios.forEach((usuario) => {\n allSubscriptions = allSubscriptions.concat(usuario.suscripciones);\n });\n notificar(allSubscriptions, titulo, cuerpo);\n });\n}", "function realizarBusqueda(){\r\n let criterioDeBusq = document.querySelector(\"#buscadorDeEjercicios\").value;\r\n let mensaje = \"\";\r\n if (validarCampoLleno(criterioDeBusq)&& criterioDeBusq.length!==1){\r\n mensaje = buscarSegunCriterio(criterioDeBusq);\r\n document.querySelector(\"#divEjElegido\").innerHTML = mensaje;\r\n addEventsEntrega();\r\n }else{\r\n document.querySelector(\"#errorBuscadorDeEjercicios\").innerHTML = \"Debe llenar el campo con al menos dos caracteres\"; \r\n }\r\n}", "function validarCuilClienteEditar(){\r\n var elem = document.getElementById('editarCuil').value;\r\n var id = document.getElementById('editarId').value ;\r\n var rtdo = false;\r\n var msg = \"\";\r\n \r\n var datos = {\r\n cuil: elem,\r\n id : id\r\n }\r\n\r\n $.ajax({\r\n url:'buscarCuilCliente.php',\r\n type: 'POST',\r\n async: false,\r\n data: datos,\r\n success:function(datosRecibidos) {\r\n json = JSON.parse(datosRecibidos);\r\n rtdo =json;\r\n if(json){\r\n \r\n }else{\r\n msg = \"Ese cuil ya se encuentra registrado para otro cliente\"; \r\n \r\n }\r\n }\r\n })\r\n\r\n setValitationMesage('msjValidacionCuilClienteEditar', rtdo, msg);\r\n return rtdo;\r\n \r\n}", "function add_reqcheck(array, indi){\r\n for (var i = 0; i < array.length; i++) {\r\n if (indi === 0) { array[i].disabled = true }\r\n if (indi === 1) {\r\n array[i].disabled = false\r\n array[i].checked = false\r\n array[i].plid_rta = 'non'\r\n }\r\n if (indi === 2) {\r\n // array[i].plid_rtr = array.plid_rta\r\n\r\n array[i].disabled = false\r\n if(array[i].estatus == 1 || array[i].estatus === '1'){ array[i].checked = true }\r\n else{ array[i].checked = false }\r\n\r\n var prepare_data = {}\r\n prepare_data.user = array[i].nombre\r\n prepare_data.uid = array[i].public_id\r\n if (angular.equals(array[i].editar,1) || angular.equals(array[i].editar,'1'))\r\n prepare_data.update = true\r\n else\r\n prepare_data.update = false\r\n if (angular.equals(array[i].eliminar,1) || angular.equals(array[i].eliminar,'1'))\r\n prepare_data.delete = true\r\n else\r\n prepare_data.delete = false\r\n\r\n $scope.detalles.push(prepare_data)\r\n // console.log(array);\r\n }\r\n }\r\n }", "function vider_ins() {\n\n // si le formulaire d'identification est en cours de remplissage\n if(document.getElementsByTagName(\"email_cnx\").value != \"\" || document.getElementsByTagName(\"pass_cnx\").value != \"\"){\n\n // alors, on vide le formulaire d'inscription\n document.forms[\"form_inscription\"].reset();\n }\n\t\n return true;\n}", "function FILTRO_realtime_colas_filtrado(realtime_colas, colas_involucradas){\n\n let resultado = realtime_colas;\n\n // inicio\n\n\n // console.log('audit sin filtrar....', audit);\n\n if(realtime_colas) {\n\n\n let colas_filtradas = realtime_colas\n .filter(function(x) {\n\n let val = false;\n\n if (colas_involucradas.length > 0) {\n\n for( let i = 0; i < colas_involucradas.length; i++) {\n\n\n if ( x.numero_colas === colas_involucradas[i].numero_colas ) {\n\n return true;\n }\n\n //console.log(x.numero_agentes, agentes[i].numero_agentes, val);\n\n }\n\n } else {\n return true;\n }\n\n\n });\n\n\n //console.log('VERDADERAS COLAS FILTRADAS.....', colas_filtradas);\n\n resultado = colas_filtradas;\n }\n\n\n // fin\n\n\treturn resultado;\n}", "estavacio()\r\n{\r\n //regresa verdadero si la cola esta vacia\r\n return this.items.length == 0;\r\n}", "function afficherNbreTournoi() {\n if (isValidNbreTournoi(nbreTournoi.value)) {\n b_nbreTournoi = true;\n return (\"nbre de tournoi : \" + nbreTournoi.value);\n } else {\n b_nbreTournoi = false;\n }\n}", "function hwreplacereq2(req, res, next){\n var db = require('../../lib/database')();\n db.query(`SELECT COUNT(*) AS CNT FROM tblfinalrequest WHERE strRequestType='Replace Client' AND (datRequestDate BETWEEN '${req.body.datefrom}' AND '${req.body.dateto}') AND strRequestStatus NOT IN('Draft', 'Cancelled', 'Deleted')`, function (err, results) {\n if (err) return res.send(err);\n req.hwreplacereq = results;\n return next();\n });\n}", "function correoLanding() {\n var email = new RegExp(/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/);\n var correo=document.getElementById(\"entCorreo\").value;\n var resultado=email.test(correo);\n if (document.getElementById(\"entCorreo\").value !== \"\") {\n if(resultado){\n alert(\"Registro completado\");\n }else{\n alert(\"El correo ingresado es incorreto\");\n }\n } else {\n alert(\"No hay ingresado información\");\n }\n}", "function validarprovmat(){\n\n var rfc =document.getElementById('rfc').value;\n var oculto =document.getElementById('oculto').value;\n var route = \"http://localhost:8000/validarprovedormat/\"+rfc;\n\n $.get(route,function(res){\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idProvedor = res[0].id;\n document.getElementById(\"idProvedor\").value= idProvedor;\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].rfc != oculto ) {\n\n document.getElementById(\"errorRFC\").innerHTML = \"El Provedor que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n document.getElementById(\"errorRFC\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n});\n\n}", "validarDatos() {\n let errores = '';\n\n if (!moment($('#devolucion_venta-fecha').value).isValid()) {\n errores += '<br>Fecha inválida';\n }\n\n\n\n if (!$('#devolucion_venta-cliente').value) {\n errores += '<br>Falta seleccionar cliente';\n }\n\n if (!$('#devolucion_venta-venta').value) {\n errores += '<br>Falta seleccionar una venta';\n }\n\n if(this.tablaDevoluciones){\n let lineasDeVenta = this.tablaDevoluciones.getData();\n if (lineasDeVenta.length == 0) {\n errores += '<br>No se hallaron detalles de venta.';\n } else {\n let lineaIncompleta = false;\n lineasDeVenta.forEach((lineaVenta) => {\n if (!util.esNumero(lineaVenta.subtotal)) {\n lineaIncompleta = true;\n }\n });\n\n if (lineaIncompleta) {\n errores += '<br>Se encontró al menos un detalle de compra incompleto.';\n }\n }\n\n }\n \n\n return errores;\n }", "function checknotes(){\r\n\r\n}", "function user_hardcopy_rented(res, parameters, callback) {\n Rental.findAll({\n where: {\n book_id: parameters['book_id'],\n account_id: parameters['account_id'],\n hardcopy_id: {\n $ne: null\n }\n }\n })\n .then(function (rentals) {\n if (rentals.length == 0) {\n response.send_error(res, \"No rental for this user/hardcopy\");\n callback(null);\n }\n else {\n callback(rentals);\n }\n })\n .catch(function () {\n response.send_error(res, \"Query failed\");\n callback(null);\n });\n}", "function funcVerifTableau(tableauResultats) {\r\n for (let i = 0; i < 5; i++) {\r\n if (tableauResultats[i] === reponses[i]) {\r\n verifTableau.push(true);\r\n } else {\r\n verifTableau.push(false);\r\n }\r\n }\r\n console.log(verifTableau);\r\n afficherResultats(verifTableau);\r\n verifTableau = [];\r\n}", "async function checkReferee(refereeID){\n const referee = await DButils.execQuery(\n `SELECT * from Referees WHERE refereeID = ${refereeID} and status = 1`\n );\n return referee[0];\n}", "function verificaDadesLlibreAlumne(llibres){\n\tvar dadesCorrectes = false;\n\tfor (var i = 0; i < llibres.length; i++) {\n\t\tconsole.log(\"Dades per a l'ID: \"+llibres[i].id);\n\t\tif(llibres[i].checked){\n\t\t\tllibreTriat = true;\n\t\t\t//1 - Obtenir el llistat de les assignatures dels llibres que ja ha entregat l'alumne al passar per aquí\n\t\t\t//a) Si la llista torna buida, passem a inserir tots els llibres directament.\n\t\t\t//b) Si torna amb llibres es comparen si els ID de la llista coincideixen amb els que duu l'usuari marcats.\n\t\t\t//Obtenim l'ID de l'alumne que hi ha triat.\n\t\t\tvar idAlumne = getIDStudent();\n\t\t\tcheckDatabase(1, idAlumne, \"null\");\t//Operació 1: obtenir llista assignatures donades de l'alumne | ID ALUMNE | NULL\n\t\t\t\n\t\t\tif(procedimentCorrecte === true){\n\t\t\t\tprocedimentCorrecte = false;\n\t\t\t\tconsole.log(\"Ha anat bé\");\n\t\t\t\tvar cll = comprovaLlistaLlibres(1,llibres);\n\t\t\t\t\n\t\t\t\tif(cll == true){\n\t\t\t\t\tconsole.log(\"Verificació de repetició de llibres: CORRECTA\");\n\t\t\t\t}else{\n\t\t\t\t\tvar sufix = cll.split(\"_\");\n\t\t\t\t\tconsole.log(\"Sufix pos 0: \"+sufix[0]+\" - Sufix pos 1: \"+sufix[1]);\n\t\t\t\t\tvar textLlibre = document.getElementById(\"bookName_\"+sufix[1]+\"\").textContent;\n\t\t\t\t\tif(sufix[0] == 151 || sufix[0] == 251 || sufix[0] == 351 || sufix[0] == 451 || sufix[0] == 452 || sufix[0] == 551 || sufix[0] == 651){\n\t\t\t\t\t\tconsole.log(\"Control de la QUOTA: \"+sufix[2]);\t\t\t\t\t\t\n\t\t\t\t\t\tif(sufix[2] == \"QE\"){\n\t\t\t\t\t\t\tconsole.log(\"S'ha de desmarcar la quota\");\n\t\t\t\t\t\t\talert(\"L'Alumne ja ha pagat la \"+textLlibre+\" i per tant se li ha de DESMARCAR!\");\n\t\t\t\t\t\t}else if(sufix[2] == \"QM\"){\n\t\t\t\t\t\t\tconsole.log(\"S'ha de marcar la quota\");\n\t\t\t\t\t\t\talert(\"L'Alumne NO ha pagat la \"+textLlibre+\" i per tant se li ha de MARCAR!\");\n\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\tconsole.log(\"Verificació de repetició de llibres: INCORRECTA\");\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//var textLlibre = document.getElementById(\"bookName_\"+sufix[1]+\"\").textContent;\n\t\t\t\t\t\talert(errorTextDuplicateBookCollect +\": \"+textLlibre);\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\talert(\"Hi ha hagut un error amb les dades del servidor!\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Crida a funció de resolució.\n\t\t}else{\n\t\t\tconsole.log(\"No triat!\");\n\t\t}\n\t}\n\t\n\tif(cll == true){\n\t\tdadesCorrectes = true;\n\t}else{\n\t\tdadesCorrectes = false;\n\t}\n\t\n\treturn dadesCorrectes;\n\t\n}", "function confirmarBuscarTodos(campo, op) {\n if ((trim(campo.value) == '') || (campo.value == null)) {\n if(confirm(\"Tem certeza que deseja pesquisar todos os registros?\\nEsta operacao pode ser demorada devido a quantidade de registros.\")) {\n submeter(op);\n return true;\n }\n else {\n return false;\n }\n }\n else {\n submeter(op);\n return true;\n }\n}", "function confirmarBuscarTodos(campo, op) {\n if ((trim(campo.value) == '') || (campo.value == null)) {\n if(confirm(\"Tem certeza que deseja pesquisar todos os registros?\\nEsta operacao pode ser demorada devido a quantidade de registros.\")) {\n submeter(op);\n return true;\n }\n else {\n return false;\n }\n }\n else {\n submeter(op);\n return true;\n }\n}", "function checkChangePontoColeta() {\n\t\tvar bErr = false;\n\t\tvar bSelected = false;\n\t\tfor (var i=0;i <= parseInt(document.frmCadCliente.hiddenIntPontoColeta.value);i++) {\n\t\t\tif (!document.getElementById(\"radioCheckPonto\"+i).checked) {\n\t\t\t\tbErr = true;\n\t\t\t} else {\n\t\t\t\tbSelected = true;\n\t\t\t\tdocument.frmCadCliente.hiddenIntChangePontoColeta.value = document.getElementById(\"radioCheckPonto\"+i).value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (bErr && !bSelected) {\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn true;\t\n\t\t}\n \t}", "function validarNumeroCuentaEmProvedor(){\n\n var num_cuenta =document.getElementById('num_cuenta').value;\n\n var ocultoNumCuenta =document.getElementById('ocultoNumCuenta').value;\n var route = \"http://localhost:8000/validarNumCuenta_Cve_Interbancaria/\"+num_cuenta;\n\n\n\n $.get(route,function(res){\n\n if(res.length > 0 && res[0].estado ==\"Inactivo\"){\n document.getElementById('submit').disabled=true;\n var idCuenta = res[0].id;\n document.getElementById(\"idCuenta\").value= idCuenta;\n\n $(\"#modal-reactivar\").modal();\n\n } \n else if (res.length > 0 && res[0].estado ==\"Activo\" && res[0].num_cuenta != ocultoNumCuenta ) {\n\n\n document.getElementById(\"errorNumCuenta\").innerHTML = \"El numero de cuenta que intenta registrar ya existe en el sistema\";\n document.getElementById('submit').disabled=true;\n\n }\n else {\n\n document.getElementById(\"errorNumCuenta\").innerHTML = \"\";\n document.getElementById('submit').disabled=false;\n\n }\n});\n\n}", "function test_existanceAppel_offre (item,suppression)\n { \n if (suppression!=1)\n {\n var mem = vm.allappel_offre.filter(function(obj)\n {\n return obj.id == currentItemAppel_offre.id;\n });\n if(mem[0])\n {\n if((mem[0].description != currentItemAppel_offre.description )\n //||(mem[0].fichier != currentItemAppel_offre.fichier )\n ||(mem[0].date_livraison != currentItemAppel_offre.date_livraison )\n ||(mem[0].date_approbation != currentItemAppel_offre.date_approbation )\n ||(mem[0].observation != currentItemAppel_offre.observation )) \n { \n insert_in_baseAppel_offre(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseAppel_offre(item,suppression);\n }", "function test_existanceAppel_offre (item,suppression)\n { \n if (suppression!=1)\n {\n var mem = vm.allappel_offre.filter(function(obj)\n {\n return obj.id == currentItemAppel_offre.id;\n });\n if(mem[0])\n {\n if((mem[0].description != currentItemAppel_offre.description )\n //||(mem[0].fichier != currentItemAppel_offre.fichier )\n ||(mem[0].date_livraison != currentItemAppel_offre.date_livraison )\n ||(mem[0].date_approbation != currentItemAppel_offre.date_approbation )\n ||(mem[0].observation != currentItemAppel_offre.observation )) \n { \n insert_in_baseAppel_offre(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseAppel_offre(item,suppression);\n }", "function cargarDisponiblesProcesar(form) {\r\n\tvar frm = document.getElementById(\"frmentrada\");\r\n\tvar forganismo = document.getElementById(\"forganismo\").value;\r\n\tvar ftiponom = document.getElementById(\"ftiponom\").value;\r\n\tvar fperiodo = document.getElementById(\"fperiodo\").value;\r\n\tvar ftproceso = document.getElementById(\"ftproceso\").value;\r\n\t\r\n\tif (ftiponom==\"\" || fperiodo==\"\") { alert(\"¡DEBE SELECCIONAR EL TIPO DE NOMINA Y PERIODO!\"); return false; }\r\n\telse if (ftproceso==\"\") { alert(\"¡DEBE SELECCIONAR EL TIPO DE PROCESO!\"); return false; }\r\n\telse return true;\r\n}", "function Recipeint_Recheck(data_mail,name1,name2){\n var Request_recheck = [0,0];\n var namerequest =[name1,name2]\n\n \n for(var i=0; i<2;i++){\n\n data_mail.forEach(function(mail){\n \n if( namerequest[i] == mail[0])\n {\n \n Request_recheck[i] = mail[0]\n } \n }); \n }\n return Request_recheck;\n}", "function checkAceptaCondiciones(field){\r\n\tvar acepta = $(\"input[name='acepto_aviso_legal']:checked\").val();\r\n\tif ( acepta === undefined) {\r\n\t\treturn \"Lea y acepta los términos y condiciones de uso.\";\r\n\t}\t\t\t\r\n}", "function evaluarAjusteInv(){\nif (!detalles>0){\n count=0;\n $(\"#btnGuardarAjusteInv\").hide();\n $(\"#rowAjusteInv\").hide();\n }\n}", "function verAcuerdoEspecialBonificaciones(id)\n{\nif(document.getElementById(\"divDatosAcuerdoEspecialBonificaciones\"+id).style.display==\"block\")\n {\n document.getElementById(\"divDatosAcuerdoEspecialBonificaciones\"+id).style.display=\"none\";\n document.getElementById(\"buttonVerDatosAcuerdoEspecialBonificaciones\"+id).innerHTML=\"Ver\";\n }\nelse\n {\n var requerimiento = new RequerimientoGet();\n requerimiento.setURL(\"acuerdobonificaciones/seleccionaracuerdo/ajax/datosAcuerdoBonificaciones.php\");\n requerimiento.addParametro(\"id\",id);\n requerimiento.addListener(respuestaVerDatosAcuerdoEspecialBonificaciones);\n requerimiento.ejecutar();\n }\n\n}", "function retrievetest(){\r\n let nego = 0;\r\n let upcome = 0;\r\n let done = 0;\r\n dbAppointmentsRef.once('value', snap => {\r\n snap.forEach(appointment => {\r\n if(appointment.child(\"status\").val() == \"negotiating\"){\r\n nego = nego + 1;\r\n }else if(appointment.child(\"status\").val() == \"upcoming\"){\r\n upcome = upcome + 1;\r\n }else{\r\n done = done + 1;\r\n }\r\n });\r\n });\r\n if(nego == 2 && upcome == 1 && done == 1){\r\n console.log(\"retrieve data correct\");\r\n }else{\r\n console.log(\"retrieve data incorrect\");\r\n }\r\n}", "function es_mail(campo_nombre, cadena) {\n if ($('#' + campo_nombre).val().match(/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}$/)) {\n $('#VC_' + campo_nombre).hide('slow');\n $('#VC_' + campo_nombre).html('');\n return true;\n } else {\n $('#VC_' + campo_nombre).html(cadena);\n $('#VC_' + campo_nombre).addClass('VC_campo_requerido');\n $('#VC_' + campo_nombre).show('slow');\n return false;\n }\n}", "function presentarNota(){darRespuestaHtml(\"<b>Nota: \"+nota+\"</b> punto/s sobre 10\");}", "function FindRelation(identificador) {\n\n //Referencia a un proyecto especifico\n var ref = firebase.database().ref(\"projects/\" + identificador + \"/miembros\");\n\n $scope.valor = false;\n\n //Información del Usuario Actual\n $scope.usuario;\n\n //Obtener información del Usuario Actual\n $scope.usuario = userActual.get();\n\n //All the Users -> Firebase Array\n $scope.usuarioss=users;\n\n //Get the Record in FirebaseArray througth userUpdate Factory\n $scope.usuario1= $scope.usuarioss.$getRecord(auth.$getAuth().uid);\n\n ref.orderByChild('uid').equalTo($scope.usuario.uid).on(\"child_added\", function (snapshot) {\n\n $scope.valor = true;\n\n });\n\n return $scope.valor;\n }", "function funcVerifTableau(tableauResultats) {\n for (let i = 0; i < 5; i++) {\n if (tableauResultats[i] === reponses[i]) {\n verifTableau.push(true);\n } else {\n verifTableau.push(false);\n }\n }\n console.log(verifTableau);\n afficherResultats(verifTableau);\n couleursFunction(verifTableau);\n verifTableau = [];\n}", "validarInfo() {\n if (this.erros.length > 0) {\n this.validador.style.display = \"table-row\";\n this.imprimirErros(this.erros);\n } else if ((this.validarRepetido(this.nome, this.peso, this.altura)) == false) {\n this.calculaIMC();\n this.adicionarElementos();\n this.validador.style.display = \"none\";\n this.form.reset();\n }\n }", "function chequearRequeridos() {\n\n oPublicar=document.forms[0];\n for (i=0; i < oPublicar.elements.length; i++) {\n \n if (oPublicar.elements[i].getAttribute(\"Requerido\")!= null){\n if (oPublicar.elements[i].getAttribute(\"Requerido\") == \"Si\"){\n //if (!oPublicar.elements[i].readOnly && !oPublicar.elements[i].disabled) {\n if (!oPublicar.elements[i].disabled) {\n if (oPublicar.elements[i].value.length==0) {\n alert(\"Debe ingresar el dato '\" + oPublicar.elements[i].getAttribute(\"Dato\")+ \"'\");\n oPublicar.elements[i].focus();\n if (oPublicar.elements[i].tagName!=\"SELECT\"){\n oPublicar.elements[i].select(); \n }\n return false;\n }\n }\n }\n }\n\n if (oPublicar.elements[i].value.length>0) {\n if (oPublicar.elements[i].getAttribute(\"Tipo\") != null) {\n if (oPublicar.elements[i].getAttribute(\"Tipo\") == \"Fecha\"){\n if (!checkdate(oPublicar.elements[i].value)) {\n alert('Fecha inv�lida, vualva a ingresarla');\n oPublicar.elements[i].focus();\n oPublicar.elements[i].select();\n return false;\n } // end if\n } else if (oPublicar.elements[i].getAttribute(\"Tipo\") == \"Integer\") {\n if (!valNumericInt(oPublicar.elements[i].value)) {\n var strErrorMsg = display_name(oPublicar.elements[i]) + \" no debe poseer letras, puntos o decimales.\";\n alert(strErrorMsg);\n oPublicar.elements[i].focus();\n oPublicar.elements[i].select();\n return false;\n } // end if\n } else if (oPublicar.elements[i].getAttribute(\"Tipo\") == \"Decimal\") {\n if (!valNumeric(oPublicar.elements[i].value)) {\n var strErrorMsg = display_name(oPublicar.elements[i]) + \" no debe poseer letras, puntos.\";\n alert(strErrorMsg);\n oPublicar.elements[i].focus();\n oPublicar.elements[i].select();\n return false;\n } // end if\n } else if (oPublicar.elements[i].getAttribute(\"Tipo\") == \"email\") {\n if (!validEmail(oPublicar.elements[i])) {\n oPublicar.elements[i].focus();\n oPublicar.elements[i].select();\n return false;\n } // end if\n } else if (oPublicar.elements[i].getAttribute(\"Tipo\") == \"clave\") {\n oClave = oPublicar.elements[i];\n if (oClave.value.length<6) {\n alert(\"La contrase�a debe tener entre 6 y 10 digitos\");\n return false;\n }\n } else if (oPublicar.elements[i].getAttribute(\"Tipo\") == \"clave2\") {\n if (oClave.value!=oPublicar.elements[i].value) {\n alert(\"Las contrase�as no coinciden.\\nIngrese ambas nuevamente.\");\n oClave.value=\"\";\n oPublicar.elements[i].value=\"\";\n oClave.focus()\n return false;\n }\n //}\n \n //control de tipo dni y nro para form preinsc. - juan\n } else if (oPublicar.elements[i].getAttribute(\"Tipo\") == \"dnitipo\") {\n oTipo = oPublicar.elements[i];\n } else if (oPublicar.elements[i].getAttribute(\"Tipo\") == \"dnitipo2\") {\n if (oTipo.value!=oPublicar.elements[i].value) {\n alert(\"Los Tipos de Documento no coinciden.\\n Verifique su selecci�n.\");\n oPublicar.elements[i].value=\"\";\n //oPublicar.elements[i].focus();\n //lo vuelvo al boton corregir para que se vea lo que ingres� en rojo\n window.document.forms[0].corregir.focus();\n return false;\n }\n } else if (oPublicar.elements[i].getAttribute(\"Tipo\") == \"dninro\") {\n oNro = oPublicar.elements[i];\n } else if (oPublicar.elements[i].getAttribute(\"Tipo\") == \"dninro2\") {\n if (oNro.value!=oPublicar.elements[i].value) {\n alert(\"Los N�meros de Documento no coinciden.\\n Verif�quelo y vuelva a ingresarlo.\");\n oPublicar.elements[i].value=\"\";\n //oPublicar.elements[i].focus();\n //lo vuelvo al boton corregir para que se vea lo que ingres� en rojo\n window.document.forms[0].corregir.focus();\n return false;\n }\n }\n //hasta aca es lo que agregue para el form_preinsc - juan\n \n }// End If Publicar.elements[i].Tipo != null)\n }\n } // Fin For\n return true;\n}//End Function", "function loadNotas(ra,curso,turma,periodo,disciplina,mostra){\n\n\texecutaProcedure( [ra,curso,turma,periodo,disciplina], 'mysqlAdapter', 'retornaNotas', loadNotasSuccess, loadFailure);\n}", "async function remindCheck() {\n var currDateTime = Date.now();\n let sql = /*sql*/ `SELECT DateTime,\n UserId,\n Reminder,\n _rowid_ id\n FROM Reminders\n ORDER BY DateTime`;\n\n db.all(sql, [], (err, rows) => {\n if (err) {\n throw err;\n } else\n if (rows.length !== 0) {\n rows.forEach((row) => {\n if (currDateTime >= row.DateTime) {\n guild.channels.resolve(config.defaultchannel).send(\"<@\" + row.UserId + \">, **you asked me to remind you:** \" + row.Reminder, { disableEveryone: true });\n db.run(/*sql*/`DELETE FROM Reminders WHERE rowid=?`, row.id, function (err) {\n if (err) {\n return console.error(err.message);\n }\n });\n }\n });\n }\n });\n}", "function checkResponse() {\n respondRef.on(\"value\", snapshot => {\n return snapshot.val();\n });\n}", "function comprobarRecursividad(cadenaNt,cadenaNnT){\r\n var banderaRecursividad=false;\r\n //verifico si exte recusividad por la izquierda si exite devuelve true\r\n var resultado = (cadenaNt.substr(0,cadenaNt.length)==cadenaNnT.substr(0,cadenaNt.length))?banderaRecursividad=true:banderaRecursividad=false;\r\n return banderaRecursividad;\r\n}", "function ohodnot(frm)\r\n{\r\n\t// \r\n\t// nazov class pomocou ktorej sa hladaju input elementy\r\n\tvar MOZNOST_CLASS_NAME = 'odpoved';\r\n\r\n\t//\r\n\t// nazov triedy, ktorou bude oznaceny rodicovsky element spravnej odpovede\r\n\tvar SPRAVNA_CLASS_NAME = 'spravna';\r\n\t\r\n\t//\r\n\t// nazov triedy, ktorou bude oznaceny rodicovsky element spravnej odpovede\r\n\tvar NESPRAVNA_CLASS_NAME = 'nespravna';\t\r\n\r\n\r\n\t// \r\n\t// najdi vsetky odpovede\r\n\tvar odpovede = document.getElementsByClassName( MOZNOST_CLASS_NAME, frm);\r\n\t\r\n\t//\r\n\t// ziskaj z nich unique zoznam \"name\"\r\n\tvar nazvy = Array();\r\n\todpovede.each(function (item) { \r\n\t\tnazvy.push(item.name); \r\n\t});\r\n\tnazvy = nazvy.uniq();\r\n\t\r\n\t// \r\n\t// over ci su vsetky zaskrtnute\r\n\tfor (var i=0; i<nazvy.length; i++) {\r\n\t\tvar nazov = nazvy[i];\r\n\t\t\r\n\t\t\t\t\r\n\t\t// zoznam item v nich\r\n\t\tvar moznosti = frm.getInputs('radio', nazov);\r\n\t\t\r\n\t\t// prelistuj ich a zisti ci je aspon 1 zaskrtnuty (viac nemoze byt, lebo maju rovnake meno)\r\n\t\tvar zaskrtnute = false;\r\n\t\tvar spravne_moznosti = 0;\r\n\t\tmoznosti.each(function (moznost) {\r\n\t\t\tif (moznost.checked) {\r\n\t\t\t\tzaskrtnute = true;\r\n\t\t\t}\r\n\t\t\tif (moznost.value == 1) {\t\r\n\t\t\t\tspravne_moznosti++;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t// ak nie je zakrtnuty, tak zrus validaciu\r\n\t\tif (!zaskrtnute) {\r\n\t\t\talert('Musíte zodpovedať všetky otázky!');\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t\tdocument.getElementById(nazov).style.visibility = 'visible';\r\n\t\t//\r\n\t\t// ak otazka nema ani jednu spravnu odpoved v kode, alebo ma viac moznosti\r\n\t\t// upozorni autora\r\n\t\tif (spravne_moznosti != 1) {\r\n\t\t\tif (spravne_moznosti > 1) {\r\n\t\t\t\talert('Otazka s parametrom name: '+ nazov + ' musi mat len 1 spravnu odpoved!');\r\n\t\t\t} else {\r\n\t\t\t\talert('Otazka s parametrom name: '+ nazov + ' musi mat 1 spravnu odpoved !');\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t};\r\n\t\r\n\t//\r\n\t// statistiky vyhodnocovania\r\n\tvar pocet_otazok = nazvy.length;\r\n\tvar pocet_nespravnych = 0;\r\n\tvar pocet_spravnych = 0;\r\n\t\r\n\t// \r\n\t// vyhodnot jednotlive moznosti\r\n\tnazvy.each(function (nazov) {\r\n\t\t\r\n\t\t// zoznam item v nich\r\n\t\tvar moznosti = frm.getInputs('radio', nazov);\r\n\t\t\r\n\t\t// prelistuj a ohodnot\r\n\t\tmoznosti.each(function (moznost) {\r\n\t\t\tif (moznost.checked) {\r\n\t\t\t\tif (moznost.value == 1) {\r\n\t\t\t\t\tpocet_spravnych++;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpocet_nespravnych++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\r\n\t// \r\n\t// zvyrazni spravne a nespravne vysledky\r\n\tnazvy.each(function (nazov) {\r\n\t\t\r\n\t\t// zoznam item v nich\r\n\t\tvar moznosti = frm.getInputs('radio', nazov);\r\n\t\t\r\n\t\t// prelistuj a ohodnot\r\n\t\tmoznosti.each(function (moznost) {\r\n\t\t\r\n\t\t\t// odstran predchadzajuce\r\n\t\t\tmoznost.parentNode.removeClassName(SPRAVNA_CLASS_NAME);\t\t\t\r\n\t\t\tmoznost.parentNode.removeClassName(NESPRAVNA_CLASS_NAME);\r\n\t\t\t\r\n\t\t\tif (moznost.checked) {\r\n\t\t\t\tif (moznost.value == 1) {\r\n\t\t\t\t\t// spravna odpoved + celkovo spravna\r\n\t\t\t\t\tmoznost.parentNode.addClassName(SPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName(NESPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName('otazka');\r\n\t\t\t\t\tmoznost.parentNode.parentNode.addClassName('otazka'+SPRAVNA_CLASS_NAME);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// nespravna odpoved + celkovo nespravna\r\n\t\t\t\t\tmoznost.parentNode.addClassName(NESPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName(SPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName('otazka');\r\n\t\t\t\t\tmoznost.parentNode.parentNode.addClassName('otazka'+NESPRAVNA_CLASS_NAME);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (moznost.value == 1) {\r\n\t\t\t\t\t// spravna odpoved\r\n\t\t\t\t\tmoznost.parentNode.addClassName(SPRAVNA_CLASS_NAME);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\r\n\t//\r\n\t// zobraz vysledok za pomoci alert\r\n\tif (pocet_otazok == pocet_spravnych) {\r\n\t\talert('Gratulujem !!!, zodpovedali ste všetky otázky správne!');\r\n\t} else {\r\n\t\talert('Zodpovedali ste správne ' + pocet_spravnych + ' otázok z ' + pocet_otazok + ' možných.');\r\n\t}\r\n\t\r\n\t// \r\n\t// allways return false - do not redirect\r\n\treturn false;\r\n}", "function check(){\n transID = genarateTransactionId();\n conn.query('SELECT transaction_id FROM transaction WHERE transaction_id = '+ transID,function(err,result){\n if(result.length != 0){\n check();\n }\n });\n}", "function validar_regla_descarga(){\n verifi_time_dowload = true;\n}", "function CrearNota() {\n\n\n if (document.querySelector(\"#createNote\")) {\n var accion = document.querySelector(\"#accion\").value;\n\n if (accion == \"create\") {\n let formRegister = document.querySelector(\"#createNote\");\n formRegister.onsubmit = function(e) {\n e.preventDefault();\n\n //obtener los valores del formulario\n let strtitle = document.querySelector(\"#title\").value;\n let strcontent = document.querySelector(\"#content\").value;\n\n\n //validacion del formulario de nueva nota\n if (strtitle == \"\" || strcontent == \"\") {\n //regresar un aviso de campos faltantes, aun estoy por hacerlo\n\n return false;\n } else {\n var request = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');\n var ajaxUrl = base_url + '/notas/createNotes';\n var formData = new FormData();\n formData.append(\"title\", strtitle);\n formData.append(\"content\", strcontent);\n request.open(\"POST\", ajaxUrl, true);\n request.send(formData);\n\n request.onreadystatechange = function() {\n\n if (request.readyState == 4 && request.status == 200) {\n console.log(request);\n var requesData = JSON.parse(request.responseText);\n console.log(request);\n console.log(requesData.status);\n\n\n if (requesData.status) {\n strtitle.value = \"\";\n strcontent.value = \"\";\n console.log(\"registro exitosooo\");\n\n window.location = base_url + 'notas';\n\n } else {\n console.log(\"a ocurrido un error\");\n }\n }\n }\n\n }\n\n }\n }\n }\n}", "function check_number(telefoonnummer) {\n fetch('https://desolate-thicket-70111.herokuapp.com/v1/webapi/signup/check_number', {\n method: 'POST', // or 'PUT'\n headers: {\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin' : '*'\n },\n body: JSON.stringify({\n telefoonnummer: telefoonnummer\n }),\n })\n .then(response => response.json())\n .then(data => {\n console.log(data);\n if(data.message == \"number available\") {\n setnumberAvailabe(true)\n } else {\n setnumberAvailabe(false)\n }\n })\n .catch((error) => {\n console.error('Error:', error);\n });\n }", "async function misLigas(req, res) {\n await Liga.find({ creador: req.user.sub }).populate('creador', 'nombre email').exec((err, misLigas) => {\n if (err) {\n return res.status(500).send({ mensaje: \"Error en la petición\" })\n } else if (!misLigas) {\n return res.status(500).send({ mensaje: \"No se han podido obtener las ligas\" })\n } else {\n return res.status(200).send({ misLigas })\n }\n })\n}" ]
[ "0.6212676", "0.58354574", "0.5805491", "0.57471216", "0.5608144", "0.5606923", "0.54609597", "0.54362684", "0.54166603", "0.5403096", "0.53999573", "0.5393371", "0.5390136", "0.5383401", "0.53723955", "0.53562325", "0.53534365", "0.531439", "0.53131807", "0.52895516", "0.527131", "0.52501357", "0.5231143", "0.5218922", "0.52188236", "0.52156335", "0.5213965", "0.5208992", "0.52077305", "0.52075696", "0.5206493", "0.52044183", "0.5177655", "0.5170205", "0.5168695", "0.516505", "0.51630175", "0.5158556", "0.51557446", "0.5148442", "0.5147045", "0.5122967", "0.51212263", "0.5118808", "0.51081514", "0.5105931", "0.51004076", "0.5099657", "0.5091349", "0.50912905", "0.50859547", "0.507982", "0.50716764", "0.5066485", "0.50638086", "0.5054229", "0.5052588", "0.5051799", "0.5051561", "0.5050365", "0.50499606", "0.5043318", "0.50428325", "0.5038639", "0.5036921", "0.50343823", "0.5024432", "0.5022251", "0.50221944", "0.5018391", "0.50099766", "0.50091976", "0.50083804", "0.500527", "0.500527", "0.4999081", "0.4996821", "0.49963376", "0.49963376", "0.49950236", "0.4989541", "0.49878538", "0.49861914", "0.4980076", "0.49798512", "0.49758247", "0.497423", "0.49723884", "0.49710798", "0.49710378", "0.4970033", "0.49685356", "0.4968215", "0.4968017", "0.49664265", "0.49660683", "0.4962935", "0.4962212", "0.49614772", "0.49611834", "0.49546617" ]
0.0
-1
Initializes the tablecheckbox wrapper.
_init() { this.$element.find('thead tr').each(function(index, el) { $(el).prepend('<th class="check table-checkbox-cell"><input type="checkbox" /></th>'); }); this.$element.find('tbody tr').each(function(index, el) { $(el).prepend('<td class="check table-checkbox-cell"><input type="checkbox" /></td>'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function styleCheckbox(table) {\n\n }", "function styleCheckbox(table) {\r\n\r\n\t}", "build() {\n // this.element = this.ce('div', {\n // class: 'table-responsive'\n // });\n // this.createLabel(this.element);\n\n // var tableClass = 'table ';\n // ['striped', 'bordered', 'hover', 'condensed'].forEach(function(prop) {\n // if (this.component[prop]) {\n // tableClass += `table-${prop} `;\n // }\n // }.bind(this));\n\n // var table = this.ce('table', {\n // class: tableClass\n // });\n\n // Build the body.\n // var tbody = this.ce('tbody');\n // this.inputs = [];\n\n // for (let i = 0; i < this.component.numRows; i++) {\n // var tr = this.ce('tr');\n // this.checks.push([]);\n // for (let j = 0; j < this.component.numCols; j++) {\n // var td = this.ce('td');\n // this.checks[i][j] = this.ce('input', {\n // type: 'checkbox'\n // });\n // this.addInput(this.checks[i][j], td);\n // tr.appendChild(td);\n // }\n // tbody.appendChild(tr);\n // }\n // table.appendChild(tbody);\n // this.element.appendChild(table);\n }", "function styleCheckbox(table) {\n\t /**\n\t $(table).find('input:checkbox').addClass('ace')\n\t .wrap('<label />')\n\t .after('<span class=\"lbl align-top\" />')\n\n\n\t $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t .find('input.cbox[type=checkbox]').addClass('ace')\n\t .wrap('<label />').after('<span class=\"lbl align-top\" />');\n\t */\n\t }", "function CheckboxWidget(initVal) {\n\tInputWidget.apply(this,[INPUT({type:'checkbox','checked':(initVal ? true : false)})]);\n}", "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n \n \n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n }", "function styleCheckbox(table) {\r\n /**\r\n $(table).find('input:checkbox').addClass('ace')\r\n .wrap('<label />')\r\n .after('<span class=\"lbl align-top\" />')\r\n\r\n\r\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n .find('input.cbox[type=checkbox]').addClass('ace')\r\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\r\n */\r\n }", "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n }", "function styleCheckbox(table) {\r\n\t/**\r\n\t\t$(table).find('input:checkbox').addClass('ace')\r\n\t\t.wrap('<label />')\r\n\t\t.after('<span class=\"lbl align-top\" />')\r\n\r\n\r\n\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n\t\t.find('input.cbox[type=checkbox]').addClass('ace')\r\n\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\r\n\t*/\r\n\t}", "function styleCheckbox(table) {\n //\n // $(table).find('input:checkbox').addClass('ace')\n // .wrap('<label />')\n // .after('<span class=\"lbl align-top\" />')\n //\n //\n // $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n // .find('input.cbox[type=checkbox]').addClass('ace')\n // .wrap('<label />').after('<span class=\"lbl align-top\" />');\n }", "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n \n \n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n}", "function addCheckboxes(view) {\n // Add the checkbox to to the header to select/unselect all\n $(\"#\" + view.key + \".kn-table thead tr\").prepend(\n '<th class=\"table-checkboxes-parent\"><input class=\"table-checkboxes\" type=\"checkbox\"></th>'\n );\n\n $(\"#\" + view.key + \".kn-table thead input\").change(function () {\n $(\".\" + view.key + \".kn-table tbody tr input\").each(function () {\n $(this).attr(\n \"checked\",\n $(\"#\" + view.key + \".kn-table thead input\").attr(\"checked\") !==\n undefined\n );\n });\n });\n\n // Add a checkbox to each row in the table body\n $(\"#\" + view.key + \".kn-table tbody tr\").each(function () {\n $(this).prepend(\n '<td class=\"table-checkboxes-parent\"><input class=\"table-checkboxes\" type=\"checkbox\"></td>'\n );\n });\n\n function toggleCheckbox($checkbox) {\n $checkbox.is(\":checked\")\n ? $checkbox.prop(\"checked\", false)\n : $checkbox.prop(\"checked\", true);\n }\n\n // Add click event handler to checkbox parent to check/uncheck child box\n $(\"#\" + view.key + \" .table-checkboxes-parent\").click(function (event) {\n // If table header, check/uncheck all checkboxes\n if ($(this).is(\"th\")) {\n var $headerCheckbox = $($(this).children()[0]);\n toggleCheckbox($headerCheckbox);\n $(\n \"#\" + view.key + \" td.table-checkboxes-parent input.table-checkboxes\"\n ).each(function () {\n $headerCheckbox.is(\":checked\")\n ? $(this).prop(\"checked\", true)\n : $(this).prop(\"checked\", false);\n });\n } else {\n var $checkbox = $($(this).children()[0]);\n toggleCheckbox($checkbox);\n }\n });\n\n // Restore default checkbox toggle\n $(\"#\" + view.key + \" .table-checkboxes\").click(function (event) {\n var $checkbox = $(this);\n toggleCheckbox($checkbox);\n });\n\n // Fix offset in totals row created by checkboxes\n elementLoaded(\"#\" + view.key + \" .kn-table-totals\", function (el) {\n el.prepend(\n '<td style=\"background-color: #eee; border-top: 1px solid #dadada;\">&nbsp;</td>'\n );\n });\n}", "function checkboxColumn ()\r\n\t{\r\n\t\tthis.identifier = \"checkboxColumn\";\r\n\t\tthis.SetHeaderParams( \"\", \"browseListHeaderCheck\" );\r\n\t\tthis.SetCellParams( \"browseItemCheck\" );\r\n\t\tthis.SetCellWidth( \"1%\" );\r\n\t\tthis.SetIsEnabled( !class_noMultiSelectButtons );\r\n\t\tthis.AddCellHeader = function( rowStruct, contents, cellCount )\r\n\t\t{\r\n\t\t\tvar\t\tcell;\r\n\r\n\t\t\tvar\t\tisChecked = \"\";\r\n\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tif ( true === this.isEnabled )\r\n\t\t\t\t{\r\n\t\t\t\t\t// Add the cell for the type column\r\n\t\t\t\t\tcell = rowStruct.insertCell( cellCount++ );\r\n\t\t\t\t\tcell.className = this.headerClassName;\r\n\t\t\t\t\tcell.width = this.cellWidth;\r\n\t\t\t\t\tif ( this.headerSpan > 1 )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcell.colSpan = this.headerSpan;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcell.scope = this.headerScope;\r\n\r\n\t\t\t\t\tisChecked = '';\r\n\t\t\t\t\tif ( allChecked )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tisChecked = \"checked\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcell.innerHTML = \"<input type='checkbox' name='top_checkbox' value='checkbox' title='\" + LocString('SelectDeselectAll') + \"' onClick='ToggleAll( this, \\\"nodeID\\\" );' isChecked >\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(e)\r\n\t\t\t{\r\n\t\t\t\texceptionAlert( e, \"Issue occured in classbrowse.js/BrowseViewColumn.AddCellHeader.\" );\r\n\t\t\t}\r\n\t\t\treturn cellCount;\r\n\t\t};\r\n\r\n\t\tthis.getCellValue = function( dataRow, rowNo )\r\n\t\t{\r\n\t\t\tvar\t\tinnerHTMLStr;\r\n\t\t\tvar\t\tisChecked = '';\r\n\r\n\t\t\tif ( dataRow.checked )\r\n\t\t\t{\r\n\t\t\t\tisChecked = \"checked\";\r\n\t\t\t}\r\n\r\n\t\t\tinnerHTMLStr = \"<INPUT ID='\" + dataRow.name + \"_checkbox' TYPE='checkbox' NAME='nodeID' VALUE='\" + dataRow.dataId +\"' TITLE='\";\r\n\t\t\tinnerHTMLStr += LocString( \"SelectDeselect\" );\r\n\t\t\tinnerHTMLStr += \"' ONCLICK='javascript:Toggle( \\\"top_checkbox\\\", this, \\\"nodeID\\\" );' \" + isChecked + \" >\";\r\n\r\n\t\t\treturn innerHTMLStr;\r\n\t\t};\r\n\t}", "function booleanInit() {\n var that = this;\n this.$input = $(\n '<input type=\"checkbox\" value=\"true\" class=\"editor-checkbox\" hideFocus>',\n );\n this.$input.appendTo(this.args.container);\n this.$input.focus();\n this.$input.change(function () {\n that.args.commitChanges('next');\n });\n }", "function styleCheckbox(table) {\r\n/**\r\n\t$(table).find('input:checkbox').addClass('ace')\r\n\t.wrap('<label />')\r\n\t.after('<span class=\"lbl align-top\" />')\r\n\r\n\r\n\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n\t.find('input.cbox[type=checkbox]').addClass('ace')\r\n\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\r\n*/\r\n}", "function CheckboxField(json_init, update_init) {\n\tGridField.call(this, json_init, update_init);\n\t/* Set all checkbox attributes. */\n\tthis.field_type = \"checkbox\";\n\tthis.grid_class = 'cb_div';\n\n\tthis.data_uri = \"checkboxes\";\n\tthis.cf_advanced = {flip_training_data : false};\n\tthis.cf_map = {empty : false};\n\t\n\tif (json_init) {\n\t\tthis.type = json_init.type;\n\t\tthis.grid_values = json_init.grid_values;\n\t} else {\n\t\t// set the class of the grid elements\n\t\tthis.ele_class = 'c_box';\n\t\t\n\t\t// set type\n\t\tthis.type = $(\"#cb_type\").val();\n\t\t\n\t\t// checkbox size\n\t\tthis.element_width = ($(\"#cb_size\").val() == 'small') ? CHECKBOX_SMALL : \n\t\t\t\t\t\t\t($(\"#cb_size\").val() == 'medium') ? CHECKBOX_MEDIUM : CHECKBOX_LARGE;\n\t\tthis.element_height = ($(\"#cb_size\").val() == 'small') ? CHECKBOX_SMALL : \n\t\t\t\t\t\t\t($(\"#cb_size\").val() == 'medium') ? CHECKBOX_MEDIUM : CHECKBOX_LARGE;\t\t\n\n\t\t// set checkbox values\n\t\tgrid_values = [];\n\t\t$(\".grid_value\").each(function() {\n\t\t\tgrid_values.push($(this).val());\n\t\t});\n\t\tthis.grid_values = grid_values;\n\t\t// checking whether there is a duplicate value or not\n\t\tis_value_valid(this.grid_values);\n\t}\n}", "function styleCheckbox(table) {\n\t/**\n\t\t$(table).find('input:checkbox').addClass('ace')\n\t\t.wrap('<label />')\n\t\t.after('<span class=\"lbl align-top\" />')\n\n\n\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t\t.find('input.cbox[type=checkbox]').addClass('ace')\n\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\n\t*/\n\t}", "function styleCheckbox(table) {\n\t/**\n\t\t$(table).find('input:checkbox').addClass('ace')\n\t\t.wrap('<label />')\n\t\t.after('<span class=\"lbl align-top\" />')\n\n\n\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t\t.find('input.cbox[type=checkbox]').addClass('ace')\n\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\n\t*/\n\t}", "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n}", "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n}", "initCustomCheckbox() {\n\t\tconst status = this.getCustomState();\n\t\tconst supplementaryLabel = this.container.querySelector( 'span.supplementary-label' );\n\t\tconst customCheckbox = document.createElement( 'div' );\n\t\tcustomCheckbox.classList.add( 'checkbox' );\n\t\tcustomCheckbox.setAttribute( 'role', 'checkbox' );\n\t\tcustomCheckbox.setAttribute( 'aria-checked', status );\n\t\tcustomCheckbox.setAttribute( 'tabindex', 0 );\n\t\tcustomCheckbox.textContent = this.label.innerText;\n\t\tif ( supplementaryLabel ) {\n\t\t\tsupplementaryLabel.parentNode.removeChild( supplementaryLabel );\n\t\t\tcustomCheckbox.appendChild( supplementaryLabel );\n\t\t\tsupplementaryLabel.classList.add( 'screen-reader-text' );\n\t\t\tsupplementaryLabel.hidden = false;\n\t\t}\n\t\tthis.label.parentNode.insertBefore( customCheckbox, this.label );\n\t\tthis.input.classList.add( 'screen-reader-text' );\n\t\tthis.input.setAttribute( 'aria-hidden', 'true' );\n\t\tthis.label.hidden = true;\n\t\tthis.customCheckbox = customCheckbox;\n\t}", "function checkboxRenderer(instance, td, row, col, prop, value, cellProperties) {\n td.style['text-align'] = 'center';\n Handsontable.renderers.CheckboxRenderer.apply(this, arguments);\n }", "function initDataTable(){\n $('table#configurations').DataTable({\n paging: false,\n info: false,\n filter: false,\n searching: false,\n ordering: true,\n rowId: 'uid',\n \"order\": [[ 2, \"desc\" ]],\n columns: [\n {data: 'name'},\n {data: 'config_type'},\n {\n data: 'created',\n render: function(data, type, row){\n return moment(data).format('YYYY-MM-DD');\n }\n },\n {data: 'owner'},\n {data: 'filename'},\n {\n data: 'uid',\n render: function(data, type, row){\n var html = '<div class=\"checkbox\">' +\n '<label>' +\n '<input id=\"' + row.uid + '\" type=\"checkbox\" ' +\n 'data-type=\"' + row.config_type + '\" ' +\n 'data-filename=\"' + row.filename + '\" ' +\n 'data-published=\"' + row.published + '\" ' +\n 'name=\"config\"/>' +\n '</label>' +\n '</div>';\n return html\n }\n }\n ]\n });\n // clear the empty results message on initial draw..\n $('td.dataTables_empty').html('');\n }", "_initWidget() {\n for (const id of this.compareList.keys()) {\n this._checkCheckbox(id);\n\n this._populateWidget(id);\n\n this._updateWidgetState();\n }\n }", "_initializeTable(){\n\t\tvar element = this.element,\n\t\toptions = this.options;\n\t\t\n\t\tthis.interactionMonitor.initialize();\n\t\t\n\t\tthis.columnManager.initialize();\n\t\tthis.rowManager.initialize();\n\t\t\n\t\tthis._detectBrowser();\n\t\t\n\t\t//initialize core modules\n\t\tthis.modulesCore.forEach((mod) => {\n\t\t\tmod.initialize();\n\t\t});\n\t\t\n\t\t//build table elements\n\t\telement.appendChild(this.columnManager.getElement());\n\t\telement.appendChild(this.rowManager.getElement());\n\t\t\n\t\tif(options.footerElement){\n\t\t\tthis.footerManager.activate();\n\t\t}\n\t\t\n\t\tif(options.autoColumns && options.data){\n\t\t\t\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\n\t\t}\n\t\t\n\t\t//initialize regular modules\n\t\tthis.modulesRegular.forEach((mod) => {\n\t\t\tmod.initialize();\n\t\t});\n\t\t\n\t\tthis.columnManager.setColumns(options.columns);\n\t\t\n\t\tthis.eventBus.dispatch(\"table-built\");\n\t}", "function init(){\n $('.js-dit-toggle-field').each(function(){\n var $checkbox = $(this);\n var $checkboxes = $('[name=\"' + $checkbox.attr('name') + '\"]');\n\n // Set event listener\n $checkboxes.on('change', function(){\n toggle($checkbox);\n });\n\n });\n }", "function createCheckboxTr(label,cbId,name,flag,act){\n\tvar retStr = \"<tr><td>\";\n\tretStr += \"<input id='\"+cbId+\"' type='checkbox' \";\n\tif(act!=undefined){retStr += \"onClick='\"+act+\"' \";}\t\n\tif(flag){retStr += \"checked='true' \";}\n\tretStr += \"name='\"+name+\"'/></td>\";\n\tretStr += \"<td style='margin-left:5px'>\"+label+\"</td>\";\n\treturn retStr;\n}", "function TableInitial(table_id, col_count, max_row_count) {\n if (max_row_count == undefined)\n {\n max_row_count = TABLE_ROW_COUNT;\n }\n\n if (col_count == undefined)\n {\n col_count = 14;\n }\n var table = document.getElementById(table_id);\n\n var row_count = table.tBodies[0].rows.length;\n\n\n while (row_count < max_row_count) {\n var new_row = table.tBodies[0].insertRow(row_count);\n\n for (var cell_index = 0; cell_index < col_count; cell_index++) {\n var cell = new_row.insertCell(-1);\n }\n //new_row.style.height = TABLE_ROW_HEIGHT;\n row_count = table.tBodies[0].rows.length;\n }\n\n // set row height\n\n for (var row_index = 0; row_index < row_count; row_index++) {\n var rows = table.tBodies[0].rows;\n rows[row_index].style.height = TABLE_ROW_HEIGHT;\n }\n\n // bind checkbox function\n TableCheckBoxInit(table_id);\n // TODO: highlight row by row\n}", "function initSortCheckboxes() {\n var checkboxesSort = $(\"#sortByDropdown label input\");\n var checkboxesType = $(\"#sortTypeDropdown label input\");\n\n checkboxesSort.click(function (event) {\n $('#sortByDropdown label.btn.tag-btn.btn-lg').each(function () {\n this.setAttribute(\"style\", \"\");\n });\n\n $(\"#sortByText\").text(event.target.value);\n getSortVariables(event);\n });\n\n checkboxesType.click(function (event) {\n $('#sortTypeDropdown label.btn.tag-btn.btn-lg').each(function () {\n this.setAttribute(\"style\", \"\");\n });\n\n $(\"#sortTypeText\").text(event.target.value);\n getSortVariables(event);\n });\n}", "function init() {\n\t\tvar $sortableTables = $('.nifty-table').filter('.nifty-table-sortable');\n\t\tvar $sortableColumnHeadings = $sortableTables.find('th');\n\n\t\t// Create sorting links\n\t\tif ($sortableTables.length) {\n\t\t\tvar $headingChildren = $sortableColumnHeadings.children();\n\t\t\tif ($headingChildren.length) {\n\t\t\t\t$sortableColumnHeadings.children().wrapInner('<a href=\"javascript:;\" class=\"btn-sort\" role=\"button\"></a>');\n\t\t\t} else {\n\t\t\t\t$sortableColumnHeadings.wrapInner('<a href=\"javascript:;\" class=\"btn-sort\" role=\"button\"></a>');\n\t\t\t}\n\n\t\t\t$sortableColumnHeadings.find('.btn-sort').on('click', tableSort);\n\t\t}\n\t}", "function setCheckBoxInTable(el_stutus, el_class){\n jQuery('.'+el_class).attr('checked', el_stutus);\n\n if ( el_stutus ) {\n jQuery('.'+el_class).parent().parent().addClass('row_selected_color');\n } else {\n jQuery('.'+el_class).parent().parent().removeClass('row_selected_color');\n }\n}", "constructor() {\n super();\n this._specs = Env.api.specs;\n this.type = '';\n this.fields = '';\n this.sortableFields = '';\n /**\n * Column meta information\n * used to render all the column stuff\n * @type {Array}\n */\n this.cols = [];\n this._selectedIndex = -1;\n this.hideHeader = false;\n this._checkedRows = [];\n this._collection = [];\n\n this._FBPAddWireHook(\"--rowCheckChanged\", (r) => {\n if (r.composedPath()[0].nodeName === 'INPUT') {\n if (r.composedPath()[0].checked) {\n this._checkedRows.push(this._collection.rawEntity.entities[this._selectedIndex]);\n } else {\n this._checkedRows.pop(this._collection.rawEntity.entities[this._selectedIndex]);\n }\n }\n this.dispatchEvent(new CustomEvent('checkstate-changed', {\n detail: this._checkedRows, bubbles: true, composed: true\n }));\n });\n\n }", "function CheckboxBase(props, context) {\n var _this = _super.call(this, props, context) || this;\n _this._checkBox = React.createRef();\n _this._renderContent = function (checked, indeterminate, keytipAttributes) {\n if (keytipAttributes === void 0) {\n keytipAttributes = {};\n }\n var _a = _this.props,\n disabled = _a.disabled,\n inputProps = _a.inputProps,\n name = _a.name,\n ariaLabel = _a.ariaLabel,\n ariaLabelledBy = _a.ariaLabelledBy,\n ariaDescribedBy = _a.ariaDescribedBy,\n _b = _a.onRenderLabel,\n onRenderLabel = _b === void 0 ? _this._onRenderLabel : _b,\n checkmarkIconProps = _a.checkmarkIconProps,\n ariaPositionInSet = _a.ariaPositionInSet,\n ariaSetSize = _a.ariaSetSize,\n title = _a.title,\n label = _a.label;\n return React.createElement(\n \"div\",\n { className: _this._classNames.root, title: title },\n React.createElement(FocusRects, null),\n React.createElement(\n \"input\",\n __assign({ type: \"checkbox\" }, inputProps, {\n \"data-ktp-execute-target\":\n keytipAttributes[\"data-ktp-execute-target\"],\n checked: checked,\n disabled: disabled,\n className: _this._classNames.input,\n ref: _this._checkBox,\n name: name,\n id: _this._id,\n title: title,\n onChange: _this._onChange,\n onFocus: _this._onFocus,\n onBlur: _this._onBlur,\n \"aria-disabled\": disabled,\n \"aria-label\": ariaLabel || label,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": mergeAriaAttributeValues(\n ariaDescribedBy,\n keytipAttributes[\"aria-describedby\"]\n ),\n \"aria-posinset\": ariaPositionInSet,\n \"aria-setsize\": ariaSetSize,\n \"aria-checked\": indeterminate\n ? \"mixed\"\n : checked\n ? \"true\"\n : \"false\",\n })\n ),\n React.createElement(\n \"label\",\n { className: _this._classNames.label, htmlFor: _this._id },\n React.createElement(\n \"div\",\n {\n className: _this._classNames.checkbox,\n \"data-ktp-target\": keytipAttributes[\"data-ktp-target\"],\n },\n React.createElement(\n Icon,\n __assign({ iconName: \"CheckMark\" }, checkmarkIconProps, {\n className: _this._classNames.checkmark,\n })\n )\n ),\n onRenderLabel(_this.props, _this._onRenderLabel)\n )\n );\n };\n _this._onFocus = function (ev) {\n var inputProps = _this.props.inputProps;\n if (inputProps && inputProps.onFocus) {\n inputProps.onFocus(ev);\n }\n };\n _this._onBlur = function (ev) {\n var inputProps = _this.props.inputProps;\n if (inputProps && inputProps.onBlur) {\n inputProps.onBlur(ev);\n }\n };\n _this._onChange = function (ev) {\n var onChange = _this.props.onChange;\n var _a = _this.state,\n isChecked = _a.isChecked,\n isIndeterminate = _a.isIndeterminate;\n if (!isIndeterminate) {\n if (onChange) {\n onChange(ev, !isChecked);\n }\n if (_this.props.checked === undefined) {\n _this.setState({ isChecked: !isChecked });\n }\n } else {\n // If indeterminate, clicking the checkbox *only* removes the indeterminate state (or if\n // controlled, lets the consumer know to change it by calling onChange). It doesn't\n // change the checked state.\n if (onChange) {\n onChange(ev, isChecked);\n }\n if (_this.props.indeterminate === undefined) {\n _this.setState({ isIndeterminate: false });\n }\n }\n };\n _this._onRenderLabel = function (props) {\n var label = props.label,\n title = props.title,\n iconLabel = props.icon;\n return label\n ? React.createElement(\"div\", null, [\n iconLabel &&\n React.createElement(\n Icon,\n __assign({ iconName: \"icon-label\" }, iconLabel, {\n className: \"ms-icon-label\",\n })\n ),\n React.createElement(\n \"span\",\n {\n \"aria-hidden\": \"true\",\n className: _this._classNames.text,\n title: title,\n },\n label\n ),\n ])\n : null;\n };\n // _this._onRenderLabel = function (props) {\n // var label = props.label,\n // title = props.title;\n // return label\n // ? React.createElement(\n // \"span\",\n // {\n // \"aria-hidden\": \"true\",\n // className: _this._classNames.text,\n // title: title,\n // },\n // label\n // )\n // : null;\n // };\n initializeComponentRef(_this);\n if (process.env.NODE_ENV !== \"production\") {\n warnMutuallyExclusive(\"Checkbox\", props, {\n checked: \"defaultChecked\",\n indeterminate: \"defaultIndeterminate\",\n });\n }\n _this._id = _this.props.id || getId(\"checkbox-\");\n _this.state = {\n isChecked: !!(props.checked !== undefined\n ? props.checked\n : props.defaultChecked),\n isIndeterminate: !!(props.indeterminate !== undefined\n ? props.indeterminate\n : props.defaultIndeterminate),\n };\n return _this;\n }", "function setupCheckboxes() {\n\t$('input[type=checkbox]').each(function() {\n\t\t$(this).after('<i></i>');\n\t\tif($(this).is(':checked') )\n\t\t\t$(this).next().removeClass().addClass('fas fa-check-square');\n\t\telse\n\t\t\t$(this).next().removeClass().addClass('far fa-square');\n\t});\n\t$('input[type=checkbox]').change(function() {\n\t\t$(this).next().toggleClass('fas').toggleClass('far').toggleClass('fa-check-square').toggleClass('fa-square');\n\t});\n\t$('input[type=checkbox]').focus(function() {\n\t\t$(this).next().css('background-color','hsl(160, 50%, 80%)');\n\t});\n\t$('input[type=checkbox]').focusout(function() {\n\t\t$(this).next().css('background-color','');\n\t});\n\t$('input[type=checkbox]').css('cursor', 'pointer');\n\t$('label input[type=checkbox]').css('cursor', 'pointer');\n\t$('input[type=checkbox]').css('opacity', '0');\n\t$('input[type=checkbox]').css('margin-top', '5px');\n\t$('input[type=checkbox]').css('position', 'absolute');\n\n\t// update display if they change the checkbox value programmatically\n\t// even if they use code like:\n\t// $('#myCheckbox').prop('checked', true);\n\t// instead of\n\t// $('#myCheckbox').change();\n\t$.propHooks.checked = {\n\t\tset: function (el, value) {\n\t\t\tif (el.checked !== value) {\n\t\t\t\tel.checked = value;\n\t\t\t\t$(el).trigger('change');\n\t\t\t}\n\t\t}\n\t};\n}", "function CheckboxBase(props, context) {\n var _this = _super.call(this, props, context) || this;\n _this._checkBox = Object(__WEBPACK_IMPORTED_MODULE_2__Utilities__[\"B\" /* createRef */])();\n _this._onFocus = function (ev) {\n var inputProps = _this.props.inputProps;\n if (inputProps && inputProps.onFocus) {\n inputProps.onFocus(ev);\n }\n };\n _this._onBlur = function (ev) {\n var inputProps = _this.props.inputProps;\n if (inputProps && inputProps.onBlur) {\n inputProps.onBlur(ev);\n }\n };\n _this._onClick = function (ev) {\n var _a = _this.props, disabled = _a.disabled, onChange = _a.onChange;\n var isChecked = _this.state.isChecked;\n ev.preventDefault();\n ev.stopPropagation();\n if (!disabled) {\n if (onChange) {\n onChange(ev, !isChecked);\n }\n if (_this.props.checked === undefined) {\n _this.setState({ isChecked: !isChecked });\n }\n }\n };\n _this._onRenderLabel = function (props) {\n var label = props.label;\n return label ? __WEBPACK_IMPORTED_MODULE_1_react__[\"createElement\"](\"span\", { className: _this._classNames.text }, label) : null;\n };\n _this._warnMutuallyExclusive({\n checked: 'defaultChecked'\n });\n _this._id = Object(__WEBPACK_IMPORTED_MODULE_2__Utilities__[\"Z\" /* getId */])('checkbox-');\n _this.state = {\n isChecked: !!(props.checked !== undefined ? props.checked : props.defaultChecked)\n };\n return _this;\n }", "function initTable() {\n var table = document.getElementById('my_table');\n utils.removeAllChildren(table); // in case one of the catalogs got updated\n\n //table.appendChild( initColGroup());\n table.appendChild( initTHead());\n table.appendChild( initTBody());\n}", "function insFldCheckBox(parent,label,value){\r\n\tvar newObj ;\r\n\tnewObj = insFld(parent, gFld(label, \"\"));\r\n\tnewObj.prependHTML = \"<td valign=middle><input type=checkbox name=\" + value + \" value =\"+value+\"></td>\"\r\n\treturn newObj ;\r\n}", "function createCheckBox() {\n return $('<input />', {\n type: 'checkbox'\n }).addClass(\"dd-check-boxes\");\n }", "makeUserTable() {\n let infoSelected = this.checkSelected.map(checkBoxValue => this.checkData.find(checkBox => checkBox.value === checkBoxValue).text); //Get the text key of the checkbox selected to used on titles of the table\n this.tableTitlesMod = [\"Name\", ...infoSelected];\n this.tableKeysMod = [\"first_name\" , ...this.checkSelected];\n }", "function CheckboxBase(props, context) {\n var _this = _super.call(this, props, context) || this;\n _this._checkBox = React.createRef();\n _this._onFocus = function (ev) {\n var inputProps = _this.props.inputProps;\n if (inputProps && inputProps.onFocus) {\n inputProps.onFocus(ev);\n }\n };\n _this._onBlur = function (ev) {\n var inputProps = _this.props.inputProps;\n if (inputProps && inputProps.onBlur) {\n inputProps.onBlur(ev);\n }\n };\n _this._onChange = function (ev) {\n var _a = _this.props, disabled = _a.disabled, onChange = _a.onChange;\n var _b = _this.state, isChecked = _b.isChecked, isIndeterminate = _b.isIndeterminate;\n if (!disabled) {\n if (!isIndeterminate) {\n if (onChange) {\n onChange(ev, !isChecked);\n }\n if (_this.props.checked === undefined) {\n _this.setState({ isChecked: !isChecked });\n }\n }\n else {\n if (onChange) {\n onChange(ev, isChecked);\n }\n if (_this.props.indeterminate === undefined) {\n _this.setState({ isIndeterminate: false });\n }\n }\n }\n };\n _this._onRenderLabel = function (props) {\n var label = props.label;\n return label ? (React.createElement(\"span\", { \"aria-hidden\": \"true\", className: _this._classNames.text }, label)) : null;\n };\n Utilities_1.initializeComponentRef(_this);\n if (process.env.NODE_ENV !== 'production') {\n Utilities_1.warnMutuallyExclusive('Checkbox', props, {\n checked: 'defaultChecked',\n indeterminate: 'defaultIndeterminate'\n });\n }\n _this._id = _this.props.id || Utilities_1.getId('checkbox-');\n _this.state = {\n isChecked: !!(props.checked !== undefined ? props.checked : props.defaultChecked),\n isIndeterminate: !!(props.indeterminate !== undefined ? props.indeterminate : props.defaultIndeterminate)\n };\n Utilities_1.initializeFocusRects();\n return _this;\n }", "function setCheckHeading(tblName, checkedTF)\n\t{\n\t\tif (getTableSize(tblName) == 0) \n\t\t{\n\t\t\ttblName.rows(0).cells(0).firstChild.checked = false;\n\t\t\treturn;\n\t\t} \n\n\t\ttblName.rows(0).cells(0).firstChild.checked = checkedTF;\n\t}", "function setTable() {\n var elemT = $(\"#in_tableh\");\n if (elemT.html() == \"true\") {\n elemT.html(\"false\");\n if ($(\"#is_ownerh\").html() == \"true\")\n sittedTable = new Table($(\"#table_idh\").html(),true);\n else\n sittedTable = new Table($(\"#table_idh\").html(),false);\n }\n}", "function VCheckBox(columnName, mandatory, isReadOnly, isUpdateable, text, description) {\n var $ctrl = $('<input>', { type: 'checkbox', name: columnName, value: text });\n var $lbl = $('<label class=\"vis-ec-col-lblchkbox\" />').html(text).prepend($ctrl);\n IControl.call(this, $lbl, VIS.DisplayType.YesNo, isReadOnly, columnName, mandatory);\n\n this.cBox = $ctrl;\n var self = this;\n\n this.setReadOnly = function (isReadOnly) {\n this.isReadOnly = isReadOnly;\n $ctrl.prop('disabled', isReadOnly);\n $lbl.css('opacity', isReadOnly ? .7 : 1);\n }\n\n if (isReadOnly || !isUpdateable) {\n this.setReadOnly(true);\n //this.Enabled = false;\n }\n else {\n this.setReadOnly(false);\n }\n\n $ctrl.on(\"change\", function (e) {\n e.stopPropagation();\n var newVal = $ctrl.prop('checked');\n if (newVal !== self.oldValue) {\n self.oldValue = newVal;\n var evt = { newValue: newVal, propertyName: self.getName() };\n self.fireValueChanged(evt);\n evt = null;\n }\n });\n this.disposeComponent = function () {\n $ctrl.off(\"change\");\n $ctrl = null;\n self = null;\n this.cBox = null;\n }\n }", "function buildCheckbox(){\n\n\t// Build checkbox for display columns\n\tlet cboxs = \"<div style='position:relative;left:35%'>\"+\n\t\t\t\t\t\"<button id='dispar' class='w3-button w3-blue w3-hover-dark-gray w3-ripple w3-round w3-padding-small'>\"+\n\t\t\t\t\t\t\"Hide/Show columns <i class='fa fa-toggle-on' aria-hidden='true'></i>\"+\n\t\t\t\t\t\"</button>\"+\n\t\t\t\t\"</div>\"+\n\t\t\t\t\"<div id='cboxs' style='position:absolute;z-index:1'>\";\n\n\tcboxs += \t\"<div class='w3-col l12 m12 w3-row w3-padding'>\"+\n\t\t\t\t\t\"<button class='w3-light-gray w3-margin-bottom w3-col l6 m6 w3-padding-small w3-round' id='selall'>\"+\n\t\t\t\t\t\t\"Select all\"+\n\t\t\t\t\t\"</button>\"+\n\t\t\t\t\t\"<button class='w3-light-gray w3-margin-bottom w3-col l6 m6 w3-padding-small w3-round' id='dselall'>\"+\n\t\t\t\t\t\t\"Unselect all\"+\n\t\t\t\t\t\"</button>\"+\n\t\t\t\t\t\n\t\t\t\t\"</div>\"\n\n\tfor (i = 0; i < NAME_LIST.length; i++) {\n\n\t\tcboxs += \t'<div class=\"w3-col l2 m3 s6\">'+\n\t\t\t\t\t\t'<input type=\"checkbox\" id=\"chk' + NAME_LIST[i] + '\"> ' + NAME_LIST[i] + \"\t\"+\n\t\t\t\t\t'</div>';\n\t};\n\n\tcboxs +=\t\"<div class='w3-col l12 m12 w3-padding'>\"+\n\t\t\t\t\t\"<button id='hideCol'>Apply</button>\"+\n\t\t\t\t\"</div>\"+\n\t\t\t\t\"</div>\"\n\t\n\t// Inject checkboxs into HTML\n\t//$(\"#detable_wrapper\").prepend(cboxs);\n\t$(cboxs).insertAfter(\"#detable_length\");\n\n\t// Set the checkboxsfield hidden by default\n\t$(\"#cboxs\").hide()\n\n\t// CSS setting\n\t$(\"#cboxs\").addClass('w3-padding w3-row w3-white w3-card-4 w3-round-large');\n\t$(\"#dispar\").addClass('w3-button w3-border w3-padding-small')\n\t$(\"#cboxs div\").addClass(\"w3-col l2 m3 s6\");\n\t$(\"#cboxs input\").addClass(\"w3-check\");\n\t$(\"#cboxs button\").addClass('w3-button w3-block');\n\t$(\"#hideCol\").addClass('w3-blue w3-round');\n\n\t// Toggle the display parameters field\n\t$(\"#dispar\").click(function(){\n\t\t\n\t\t$(\"#cboxs\").toggle();\n\t\t\n\t\t// Select the boxs correspoding to visible columns\n\t\tfor (i = 0; i < NAME_LIST.length; i++) {\n\n\t\t\tdocument.getElementById(\"chk\"+NAME_LIST[i]).checked = table.column(i).visible();\n\t\t};\n\t});\n\t\n\t$(\"#selall\").click(function(){\n\n\t\tfor (i = 0; i < NAME_LIST.length; i++) {\n\n\t\t\tdocument.getElementById(\"chk\"+NAME_LIST[i]).checked = true;\n\t\t};\n\t});\n\n\t$(\"#dselall\").click(function(){\n\n\t\tfor (i = 0; i < NAME_LIST.length; i++) {\n\n\t\t\tdocument.getElementById(\"chk\"+NAME_LIST[i]).checked = false;\n\t\t};\n\t});\n\n\t// Hide selected columns\n\t$(\"#hideCol\").click(function(){\n\n\t\tfor (i = 0; i < NAME_LIST.length; i++) {\n\n\t\t\ttable.column( i ).visible( $(\"#chk\"+NAME_LIST[i]).prop(\"checked\") );\n\t\t};\n\t\t$(\"#cboxs\").hide();\n\t});\n}", "function _fnInitalise ( )\n\t\t{\n\t\t\t/* Ensure that the table data is fully initialised */\n\t\t\tif ( _bInitialised == false )\n\t\t\t{\n\t\t\t\tsetTimeout( function(){ _fnInitalise() }, 2000 );\n\t\t\t}\n\t\t\t\n\t\t\t/* Show the display HTML options */\n\t\t\t_fnAddOptionsHtml( _nTable );\n\t\t\t\n\t\t\t/* Draw the headers for the table */\n\t\t\t_fnDrawHead( _nTable, _iDefaultSortIndex );\n\t\t\t\n\t\t\t/* If there is default sorting required - let's do it. The sort function\n\t\t\t * will do the drawing for us. Otherwise we draw the table\n\t\t\t */\n\t\t\tif ( _oFeatures.bSort )\n\t\t\t{\n\t\t\t\t_fnSort( _nTable, _iDefaultSortIndex );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_fnDraw( _nTable );\n\t\t\t}\n\t\t}", "function makeCheckBox(columnName, parentDivId) {\n\tvar checkbox = document.createElement('input');\n\tcheckbox.type = \"checkbox\";\n\tcheckbox.name = columnName;\n\tcheckbox.value = \"0\"; \n\tcheckbox.id = columnName;\n\t\n\t// Styles for Checkbox\n\tmakeCheckBoxStyles(checkbox);\n\t\n\tvar label = document.createElement('label')\n\tlabel.htmlFor = \"id\";\n\tlabel.appendChild(document.createTextNode(columnName));\n\t\n\tvar divContainer = document.getElementById(parentDivId);\n\tif(divContainer){\n\t\tdivContainer.appendChild(label);\n\t\tdivContainer.appendChild(checkbox);\n\t}\t\n}", "function tableInit() {\n let body = document.body;\n let table = document.createElement('table');\n table.id = 'BookList';\n body.appendChild(table);\n\n let tbody = document.createElement('tbody');\n tbody.id = 'TableBody';\n table.appendChild(tbody);\n\n let caption = document.createElement('caption');\n caption.appendChild(document.createTextNode('My Book List'));\n table.appendChild(caption);\n\n let thead = document.createElement('thead');\n table.appendChild(thead);\n\n let tr = document.createElement('tr');\n thead.appendChild(tr);\n\n let thArray = ['No.', 'Title', 'Author', 'Page Count', 'Read On'];\n thArray.forEach((text) => {\n let th = document.createElement('th');\n th.appendChild(document.createTextNode(text));\n tr.appendChild(th);\n });\n\n createTable();\n}", "function createCheckboxes() {\n let rows = document.querySelectorAll(\"tr\");\n\n //head checkBox for multiple selection\n let checkbox = document.createElement('input');\n checkbox.setAttribute('type', \"checkbox\");\n checkbox.id = \"selectAll\";\n checkbox.value = \"selectAll\";\n checkbox.addEventListener( 'change', function() {\n let checkBoxes = document.querySelectorAll('input[type=\"checkbox\"]');\n if(this.checked) {\n for (let index = 1; index < checkBoxes.length; index++){\n checkBoxes[index].checked = true;\n }\n } else {\n for (let index = 1; index < checkBoxes.length; index++){\n checkBoxes[index].checked = false;\n }\n }\n });\n\n rows[0].appendChild(checkbox);\n\n for (let index = 1; index < rows.length; index++){\n let checkbox = document.createElement('input');\n checkbox.setAttribute('type', \"checkbox\");\n checkbox.id = data[index - 1].id;\n rows[index].appendChild(checkbox);\n }\n}", "function returnTableCheckbox(data) {\n return '<div class=\"checkbox\"><label><input type=\"checkbox\" value=\"' + $('<div/>').text(data).html() + '\"><span class=\"checkbox-material\"><span class=\"check\"></span></span></label></div>';\n }", "ready() {\n const that = this;\n\n super.ready();\n\n that._htmlBindOnInitialization();\n\n if (that.indeterminate) {\n that._valueCashe = that.checked;\n that.checked = null;\n }\n\n that._handleTemplate(true);\n that._handleTemplate(false);\n that._handleTemplate();\n\n that._updateHidenInputNameAndValue();\n }", "function init() {\n let tBody = d3.select(\"#tableBody\");\n let allData = tdata.filter(x => x.datetime);\n buildTable(allData);\n\n createMenu(availableDate(), 'selectDate');\n createMenu(availableCities(), 'selectCity');\n createMenu(availableState(), 'selectState');\n createMenu(availableCountry(), 'selectCountry');\n createMenu(availableShape(), 'selectShape');\n}", "_displayTable(users) {\n var html = \"\";\n for(var i = 1; i < users.get().length; i++) { // rows of users\n html += \"<tr class='row_id_\" + users.get()[i][\"id\"] + \"'><th>\" + users.get()[i][\"name\"] + \"</th>\";\n var row = this.eaters_table[i];\n \n var x = 0;\n for(var d = 0; d < 7; d++) { // days of the week\n if(row[x] && this.start_date.next_day(d).to_database_format() === row[x]['date']) {\n if (this.start_date.next_day(d + DEFAULTS.disabled_after) <= new Date()) {\n html += \"<td><input id='check_\" + i + \"_\" + d + \"' class='option-input checkbox' type='checkbox' checked disabled></td>\";\n } else {\n html += \"<td><input id='check_\" + i + \"_\" + d + \"' class='option-input checkbox' type='checkbox' checked></td>\";\n }\n x++;\n } else {\n if (this.start_date.next_day(d + DEFAULTS.disabled_after) <= new Date()) {\n html += \"<td><input id='check_\" + i + \"_\" + d + \"' class=\\\"option-input checkbox\\\" type=\\\"checkbox\\\" disabled></td>\";\n } else {\n html += \"<td><input id='check_\" + i + \"_\" + d + \"' class=\\\"option-input checkbox\\\" type=\\\"checkbox\\\"></td>\";\n }\n }\n }\n \n }\n html += \"</tr>\"\n var table = document.getElementById(\"sign_in\");\n table.innerHTML = table.innerHTML + html;\n }", "get checkbox(){ return this.__checkbox; }", "function loadCheckboxColumn(cellValue, rowObject, width, nIndex, event) {\n \"use strict\";\n var iCurrentIndex = parseInt(parseInt(oListViewObject.itemsPerPage, 10) * parseInt(oListViewObject.pageNumber, 10), 10) + parseInt(nIndex, 10);\n var sCheckBoxChunk = \"<div class=\\\"checkBoxImage checkboxHoverImageContainer hide\\\" ></div><div class=\\\"gridCell ms-ChoiceField checkBox\\\"><input class=\\\"ms-ChoiceField-input\\\" id=\\\"demo-checkbox-unselected\" + iCurrentIndex + \"\\\" type=\\\"checkbox\\\"/><label class=\\\"ms-ChoiceField-field\\\" for=\\\"demo-checkbox-unselected\" + iCurrentIndex + \"\\\"></label></div>\";\n return sCheckBoxChunk;\n}", "function __initFormTable($dom) {\r\n}", "function CheckBox(name, hC) {\n this.name = name;\n this.id = '#' + name;\n this.value = (localStorage[name] == 'true');\n this.init(hC);\n}", "constructor(el) {\n this.el = el;\n this.emptyCheckbox = this.el.parentElement.querySelector('.checkbox-empty');\n this.tickCheckbox = this.el.parentElement.querySelector('.checkbox-tick');\n\n this.init();\n }", "function setupTable() {\n window.actionEvents = {\n \"click .edit\": function (e, value, row, index) {\n showEditDialog(row);\n },\n \"click .remove\": function (e, value, row, index) {\n showRemoveDialog(row);\n }\n };\n }", "function setupTable() {\n window.actionEvents = {\n \"click .edit\": function (e, value, row, index) {\n showEditDialog(row);\n },\n \"click .remove\": function (e, value, row, index) {\n showRemoveDialog(row);\n }\n };\n }", "function CheckBoxFilterBase(parent, filterSettings) {\n this.existingPredicate = {};\n this.foreignKeyQuery = new Query();\n this.filterState = true;\n this.values = {};\n this.renderEmpty = false;\n this.parent = parent;\n this.id = this.parent.element.id;\n this.filterSettings = filterSettings;\n this.valueFormatter = new ValueFormatter(this.parent.locale);\n this.cBoxTrue = createCheckBox(this.parent.createElement, false, { checked: true, label: ' ' });\n this.cBoxFalse = createCheckBox(this.parent.createElement, false, { checked: false, label: ' ' });\n this.cBoxTrue.insertBefore(this.parent.createElement('input', {\n className: 'e-chk-hidden', attrs: { type: 'checkbox' }\n }), this.cBoxTrue.firstChild);\n this.cBoxFalse.insertBefore(this.parent.createElement('input', {\n className: 'e-chk-hidden', attrs: { 'type': 'checkbox' }\n }), this.cBoxFalse.firstChild);\n this.cBoxFalse.querySelector('.e-frame').classList.add('e-uncheck');\n if (this.parent.enableRtl) {\n addClass([this.cBoxTrue, this.cBoxFalse], ['e-rtl']);\n }\n }", "init(config, parent) {\n this.name = \"technical\";\n\n this.components = [{\n component: simplecheckbox,\n placeholder: \".vzb-advancedshowandselect-switch\",\n model: [\"ui.dialogs.dialog.find\", \"locale\"],\n checkbox: \"enableSelectShowSwitch\"\n }];\n\n this._super(config, parent);\n }", "isThisCheckboxLabeless() {\n return this.type==='checkbox' && typeof this.label===\"undefined\";\n }", "function tripTableInteractionInit(){\n $('#active-trains-table tbody').on('click', 'tr', function () {\n var data = global.tripDatatable.row( this ).data();\n onClickTripRow(data);\n \n // Update class: selected for row display\n if ( $(this).hasClass('selected') ) {\n $(this).removeClass('selected');\n }\n else {\n global.tripDatatable.$('tr.selected').removeClass('selected');\n $(this).addClass('selected');\n }\n } );\n }", "function prepareInitialCheckboxes() {\n\tfor (var i = 1; i <= $v(\"totalLines\");) {\n\t\tif (cellValue(i, \"application\") == 'All') {\n\t\t\tvar topRowId = i;\n\t\t\tvar preCompanyId = cellValue(topRowId, \"companyId\");\n\t\t\tvar preFacilityId = cellValue(topRowId, \"facilityId\");\n\t\t\tfor (i++; i <= $v(\"totalLines\"); i++) {\n\t\t\t\tif (preCompanyId == cellValue(i, \"companyId\") && preFacilityId == cellValue(i, \"facilityId\")) { //check if the row is still within scope\n\t\t\t\t\tfor (var j = 0; j <= $v(\"headerCount\"); j++) {\n\t\t\t\t\t\tvar colName = config[5 + 2 * j].columnId;\n\t\t\t\t\t\t//Note: 5 being the no. of columns before the Permission columns (starting from 0)\n\t\t\t\t\t\t// 2 * j is the index of the columns contain check boxes (skipping preceding hidden columns)\n\t\t\t\t\t\tif (cell(topRowId, colName).isChecked()) {\n\t\t\t\t\t\t\tif (cell(i, colName).isChecked())\n\t\t\t\t\t\t\t\tcell(i, colName).setChecked(false);\n\t\t\t\t\t\t\tcell(i, colName).setDisabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\tpreCompanyId = cellValue(i, \"companyId\");\n\t\t\t\t\tpreFacilityId = cellValue(i, \"facilityId\");\n\t\t\t\t} else\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else\n\t\t\ti++;\n\t}\n}", "function setAllRowChecks(tblName, checkedTF)\n\t{\n\t\tfor (var i=1; i<tblName.rows.length; i++)\n\t\t{\n\t\t\ttblName.rows(i).cells(0).firstChild.checked = checkedTF;\n\t\t}\n\t}", "ready() {\n const that = this;\n\n super.ready();\n\n let animationType = that.animation;\n\n if (that.hasAnimation) {\n that.animation = 'none';\n }\n\n that._supportCSSVariables = JQX.Utilities.Core.CSSVariablesSupport() && Boolean(window.getComputedStyle(that.$.container).getPropertyValue('--jqx-switch-button-default-width'));\n that._htmlBindOnInitialization();\n that._resizeHandler();\n that._initializePrivateVariables();\n that._getContainersSizeAndBreakPoint();\n\n if (that.indeterminate) {\n that._valueCache = that.checked;\n that.checked = null;\n }\n\n that._handleTemplate(true); //Set the True Content\n that._handleTemplate(false); //Set the False Content\n that._handleTemplate(); // Set the Indeterminate Content\n\n that._updateHidenInputNameAndValue();\n that._updateThumbPosition();\n\n that.animation = animationType;\n }", "_createTable(){\n let chooseFields = this._componentRoot.querySelector(\"#chooseFields\");\n\n this._updateData();\n\n window.customTbl = new TableCustom({}, this._userDataStyle, this._correctData);\n\n if (chooseFields.parentNode) {\n chooseFields.parentNode.removeChild(chooseFields);\n }\n\n this._createMessage();\n\n this.options.tableRender = true;\n }", "function createRowforwatherInfoTable(tableBodyId,name,Description) {\n\n var row = tableBodyId.insertRow();\n var cell1 = row.insertCell(0);\n var cell2 = row.insertCell(1);\n var cell3 = row.insertCell(2);\n cell2.innerHTML = name;\n cell3.innerHTML = Description;\n createCheckBox(cell1);\n}", "function init() {\n $(document).on('click', '.pnl-Checkable-input', enableChildren);\n}", "constructor(props) {\n super(props);\n this.headerDOMElement = null;\n this.tableDOMNode = null;\n this.tableRowsDom = null; // scrolling rows container\n\n this.state = {\n windowHeight: window.innerHeight,\n scrolledHorizontal: 0,\n rowContextMenu: null,\n showScrollToLeftButton: false\n };\n }", "didInsertElement() {\n this._super(...arguments);\n\n // Initialize Semantic UI checkbox.\n this.$().checkbox({\n onChecked: () => {\n this.set('value', true);\n if (!isEmpty(this.get('onChange'))) {\n this.get('onChange')({\n checked: true\n });\n }\n },\n onUnchecked: () => {\n this.set('value', false);\n if (!isEmpty(this.get('onChange'))) {\n this.get('onChange')({\n checked: false\n });\n }\n }\n });\n\n if (this.get('isNullable') && isNone(this.get('value'))) {\n this.$().checkbox('set indeterminate');\n return;\n }\n\n if (this.get('value')) {\n this.$().checkbox('set checked');\n }\n }", "function initStatusCheckboxes() {\n $('div.layer-control').on('change', '#status-layers input', function() {\n var status = $(this).val();\n // 1) update the markers on the map\n var markers = CONFIG.status_markers[status].markers;\n CONFIG.clusters.FilterMarkers(markers, !$(this).prop('checked')); // false to filter on, true to filter off :)\n CONFIG.clusters.ProcessView();\n\n // 2) update the rows shown on the table\n let statuses = [];\n $('div.layer-control div#status-layers input:checked').each(function(l) { \n statuses.push(this.value);\n });\n // filter the current set of filtered data, or all data if there is no current filter applied\n let data_to_filter = DATA.filtered || DATA.tracker_data;\n var filtered = data_to_filter.filter(function(d) {\n return statuses.indexOf(d.status) > -1\n })\n drawTable(filtered, 'Status filtered');\n\n // 3) update the \"results\" panel\n updateResultsPanel(filtered, 'Status filtered');\n });\n}", "function createCheckboxes() {\n\t\tvar block_headers = document.querySelectorAll('.accordion-header');\n\t\t[].forEach.call(block_headers, function (el) {\n\t\t\tvar checkbox = document.createElement('input');\n\t\t\tcheckbox.type = 'checkbox';\n\t\t\tcheckbox.value = '1';\n\t\t\tcheckbox.style.float = 'right';\n\t\t\tcheckbox.style.display = 'none';\n\t\t\tcheckbox.checked = 'true';\n\t\t\tcheckbox.addEventListener('click', hideBlocks);\n\t\t\tel.appendChild(checkbox);\n\t\t});\n\t}", "function initialiserCheckboxReseau()\n { \n for (let i = 0; i < checkboxElementArray.length; i++)\n {\n reseauDivContent.querySelector(\"#allCheckboxsDiv\").appendChild(checkboxElementArray[i]); \n }\n }", "function Row(coffeeOrder) { //In charge of creating all the DOM elements necessary to represent a single coffee order, including the checkbox and text description\n var $div = $('<div></div>', { //jQuery's $ function creates elements, thus creating <div>; 2 arguments are passed describing the DOM element I want it to create; 1st argument: HTML tag of the DOM element\n 'data-coffee-order': 'checkbox', //2nd argument: object that specifies the attributes that jQuery should add to the <div>\n 'class': 'checkbox'\n });\n\n var $label = $('<label></label>');\n\n var $checkbox = $('<input></input>', {\n type: 'checkbox',\n value: coffeeOrder.emailAddress //By setting the value to the customer's email address, you are associating the checkbox with the customer's coffee order\n });\n\n var description = coffeeOrder.size + ' ';\n if (coffeeOrder.flavor) {\n description += coffeeOrder.flavor + ' ';\n }\n\n description += coffeeOrder.coffee + ', ';\n description += ' (' + coffeeOrder.emailAddress + ')';\n description += ' [' + coffeeOrder.strength + 'x]';\n\n $label.append($checkbox); //append method connects the elements together\n $label.append(description); //This method accepts either a DOM element or a jQuery-wrapped collection and adds it as a child element \n $div.append($label);\n\n this.$element = $div; //Makes the subtree available as a property of the instance by assigning it to this.$element\n }", "function CheckBoxGroupInitialize(checkbox_group) {\n if (checkbox_group.length >= 2) {\n checkbox_group.forEach(\n function (item) {\n var control_checkbox = document.getElementById(item);\n if (control_checkbox != null)\n {\n control_checkbox.onclick = CheckboxSelect.bind(this, item, checkbox_group);\n }\n else\n {\n return;\n }\n }\n );\n }\n}", "function HandleCheckBox(tx) {\n\n CellData.ComponentType = \"checkbox\";\n CellData.ComponentSaveMode = \"bool\"; // puo salvare true/false o 1/0 bit\n CellData.ComboSelectedValue = '';\n CellData.ComboSelectedText = '';\n\n //if(SelectedCell.hasClass('checkbox-save-bit') \n // CellData.ComponentSaveMode = \"bit\";\n\n EECLog('HandleCheckBox firex');\n \n EECLog($(tx).attr('class'));\n\n $(tx).on('click',function (e) {\n\n alert('clicked');\n //var nval = $(this).attr('checked') == 'checked';\n //e.preventDefault();\n //var data = nval;\n //CellValue = data;\n //CellData.newvalue = CellValue;\n //ApplyLocalChanges(CellData); //<-- function locale specifica della tabella se deve fare dei calcoli (es calcolare l'importo se cambia prezzo o qta) \n //LiveUpdate(CellData); // <-- qui invia le modifiche al server db\n //ClickRaised = false;\n });\n\n $(tx).on('focus', function () {\n $(this).select();\n });\n\n\n //$(tx).on('blur', function () {\n // EECLog('blur on checkbox');\n // SelectedCell.text(CellValue);\n // // $(this).remove(); // destroy itself\n \n //})\n return tx;\n\n}", "function initComponents() {\n\n //calls the drop down menu option\n dropDownComponents();\n\n // builds the initial table.\n getThatTable(ufoData);\n}", "function init_table(initialRows, initialColumns, editableRow) {\n if (!initialRows) initialRows = 5;\n if (!initialColumns) initialColumns = 1;\n if (!editableRow) editableRow = true;\n let table = $('<table id=\"table_filters\" class=\"table table-bordered table-zina\"></table>');\n\n // {# built table header #}\n let table_header = $(\"<thead></thead>\");\n let column_content = \"<th><span class='column_name'></span><button class='filters'><span class='caret'></span></button></th>\";\n let header_tr = $(\"<tr></tr>\").append(column_content.repeat(initialColumns));\n table_header.append(header_tr);\n\n // {# built table body #}\n let table_body = $(\"<tbody></tbody>\");\n let row_content = ((editableRow) ? \"<td contenteditable='true'></td>\" : \"<td></td>\");\n let row = \"<tr>\".concat(row_content.repeat(initialColumns), \"</tr>\");\n table_body.append(row.repeat(initialRows));\n\n table.append(table_header);\n table.append(table_body);\n\n return table;\n }", "function buildTable(){\n\n}", "function showCheckBox(data) {\n \t// update checkboxes\n \tdojo.forEach(data, function(item){\n \t\t\t\t\titem.chkBoxUpdate = '<input type=\"checkbox\" align=\"center\" id=\"'+item.expdIdentifier+'\" onClick=\"getCheckedRows(this)\" />';\n \t\t\t\t\titem.chkBoxUpdate.id = item.expdIdentifier;\n \t\t\t\t});\n \t\n \t// Standard checkboxes\n \tdojo.forEach(data, function(item){\n \t\tif (item.includesStd == \"Y\"){\n \t\t\titem.chkBoxStd = '<input type=\"checkbox\" disabled align=\"center\" id=\"'+item.expdIdentifier+'cb'+'\" checked=\"checked\"/>';\n\t\t\t\t\t} else{\n\t\t\t\t\titem.chkBoxStd = '<input type=\"checkbox\" disabled align=\"center\" id=\"'+item.expdIdentifier+'cb'+'\"/>';\n\t\t\t\t\t}\n\t\t\t\t\titem.chkBoxStd.id = item.expdIdentifier + 'cb';\n\t\t\t\t});\n }", "function setDefaultCheckboxes() {\n log('Setting default state of checkboxes.');\n $(\"#xedx-loggingEnabled-opt\")[0].checked = GM_getValue(\"opt_loggingEnabled\", opt_loggingEnabled);\n $(\"#xedx-devmode-opt\")[0].checked = GM_getValue(\"opt_devmode\", opt_devmode);\n $(\"#xedx-hidefedded-opt\")[0].checked = GM_getValue(\"opt_hidefedded\", opt_hidefedded);\n $(\"#xedx-hidefallen-opt\")[0].checked = GM_getValue(\"opt_hidefallen\", opt_hidefallen);\n $(\"#xedx-hidetravel-opt\")[0].checked = GM_getValue(\"opt_hidetravel\", opt_hidetravel);\n $(\"#xedx-showcaymans-opt\")[0].checked = GM_getValue(\"opt_showcaymans\", opt_showcaymans);\n $(\"#xedx-hidehosp-opt\")[0].checked = GM_getValue(\"opt_hidehosp\", opt_hidehosp);\n $(\"#xedx-disabled-opt\")[0].checked = GM_getValue(\"opt_disabled\", opt_disabled);\n }", "initSettings() {\n this.ignoredColumnById('rowStatus');\n this.setInlineActionableMode();\n this.sortColumn = { sortField: null, sortAsc: true };\n this.gridCount = $('.datagrid').length + 1;\n this.lastSelectedRow = 0; // Remember index to use shift key\n\n this.contextualToolbar = this.element.prev('.contextual-toolbar');\n this.contextualToolbar.addClass('datagrid-contextual-toolbar');\n }", "constructor(x, y, labels, index = 0) {\n if (labels === undefined || labels.length == 0) {\n throw new Error('Labels must not be empty');\n }\n super();\n this.root.setAttribute(\"transform\", `translate(${x},${y})`);\n this.index = index;\n let counter = 0;\n this.list = [];\n let rc = this;\n labels.forEach((element, i) => {\n let checkbox = new CheckBox(0, counter, element, false);\n if (i == index) {\n checkbox.value = true;\n }\n checkbox.box.root.setAttribute('rx', '8px');\n checkbox.box.root.onmousedown = function () {\n rc.handleMouseDown(i);\n checkbox.value = true;\n rc.index = i;\n rc.onchange();\n };\n this.root.appendChild(checkbox.root);\n this.list.push(checkbox);\n counter += 24;\n });\n }", "_configureCheckboxColumn (columns) {\n var configureCheckbox = {\n id: \"checkbox\",\n header: \"\",\n width: 40,\n template: \"{common.checkbox()}\",\n cssFormat: this._configureColumnClassCss\n };\n\n var isCalcTotalGroup = false;\n for (var index in columns) {\n if (columns[index].showTotals) {\n isCalcTotalGroup = true;\n break;\n }\n }\n if (isCalcTotalGroup){\n configureCheckbox['footer'] = {text: '<div class=\"footerTitle\"\">TOTAL</div>'};\n }\n return configureCheckbox;\n }", "function init(options) {\n return initTable();\n }", "function _buildTable() {\n // _displayLoading(true);\n _addGradeRange();\n _renderSelects();\n var table = _setupDataTable(renderTable());\n renderFeatures();\n}", "function EditorInitTableMenu() {\n try {\n InitJoinCellMenuitem(\"menu_JoinTableCells\");\n } catch (ex) {}\n\n // Set enable states for all table commands\n goUpdateTableMenuItems(document.getElementById(\"composerTableMenuItems\"));\n}", "function modernCheckBox(this_, fnct){\n var cb = this_.find(\"input[type=checkbox]\");\n var b = this_.find(\"b\");\n\n if(fnct==\"onload\"){\n if(cb.is(':checked')){\n b.addClass(\"checked\")\n } else {\n b.removeClass(\"checked\")\n }\n ftBeneficiaryCtrl(cb)\n return;\n }\n\n if(!cb.is(':checked')){\n cb.prop(\"checked\", true)\n b.addClass(\"checked\")\n } else {\n cb.prop(\"checked\", false)\n b.removeClass(\"checked\")\n }\n}", "function bindTableFunctions() {\n $(\"input\").click(function (args) {\n var trID = $(args.target).parents(\"tr\")[0].id;\n if (toDelete[trID] == null || toDelete[trID][0] == false) {\n toDelete[trID] = [true, trID];\n\n }\n else{\n if (args.currentTarget.checked) {\n return;\n }\n toDelete[trID] = null;\n }\n });\n}", "function config_checkBox(label, id, dflt) {\n\t\n\tthis.label = label;\n\tthis.id = id;\n\tthis.value = GM_getValue(id, dflt);\n\tthis.defaultVal = dflt;\n\tthis.cbox;\n\t\n\tthis.draw = function (parentNode) {\n\t\tvar lbl = $create(\"label\", {\n\t\t\ttextContent : this.label + \": \",\n\t\t\t\"for\" : this.id\n\t\t});\n\t\tthis.cbox = $create(\"input\",{\n\t\t\ttype : \"checkbox\",\n\t\t\tname : this.id,\n\t\t\tid : this.id\n\t\t});\n\t\tif (this.value) {\n\t\t\tthis.cbox.checked = true;\n\t\t}\n\t\tthis.cbox.addEventListener(\"change\", function(event) {\n\t\t\tGM_setValue(event.target.id, event.target.checked); \n\t\t}, true);\n\t\t\n\t\tvar hldr = $create('div', {\n\t\t\tclassName : 'config_option'\n\t\t});\n\t\t\n\t\thldr.appendChild(lbl);\n\t\thldr.appendChild(this.cbox);\n\t\tparentNode.appendChild(hldr);\n\t};\n\t\n\tthis.setDefault = function () {\n\t\tif (this.cbox) {\n\t\t\tthis.cbox.checked = this.defaultVal;\n\t\t\tGM_setValue(this.id, this.defaultVal);\n\t\t}\n\t};\n}", "constructor(p) {\n InputCheck.configDefaults(p, {\n inputType: 'checkbox',\n inputElValue: '',\n });\n\n InputCheck.mergeConfig(p, {\n baseCls: 'form-check-input',\n renderWrapper: false,\n disableHelperText: true,\n });\n\n super(p);\n }", "init() {\n /** The holder for the AltHolder's elements and its children's elements as well */\n this.holder = document.createElement(\"div\")\n this.holder.id = \"altcolholder\"\n this.createAltRowBtn.onclick = this.addRow.bind(this)\n this.holder.append(this.createAltRowBtn)\n this.ctrlDiv.append(this.holder)\n /** the id passed to the altfilter row. Used to uniquely identify each row for export and removal operations */\n this.idCount = 0\n // attach the altfilters to the paneOb for export\n /** testing \n * @alias altFiltersState\n * @memberof Pane\n * @instance\n */\n this.paneOb.altFiltersState = {}\n\n }", "function initCheckboxType() {\n var group = $('.scenario_block_origin .checkbox_group').clone();\n group.insertBefore($('.message_bot_area .fixedsidebar-content .text_button_next'));\n // $('.message_bot_area .fixedsidebar-content').append(group);\n addCheckboxBox();\n}", "didInsertElement() {\n this._super(...arguments);\n\n // Initialize Semantic UI checkbox.\n this.$().checkbox();\n }", "function checkboxMarked(table){\n\tvar obj = document.getElementById(table);\n\tvar type = table;\n\tinitDb(type, obj.checked); //if checkbox is TRUE/checked -> begin marker loading of those markes specified from checkbox\n}", "function all_select(checkbox,tableid,tablecalss){\n\t$checkbox = $(checkbox);\n\tif(tablecalss=='table'){\n\t\tvar index = $checkbox.parent().parent().index();\n\t}else{\n\t\tvar index = $checkbox.parent().index();\n\t}\n\tvar status = $checkbox.attr('checked');\n\tvar ftrue = false;\n if(status == 'checked'){\n \tftrue = true;\n }\n if(tablecalss=='table'){\n \tvar $dot = $checkbox.parents(\".grid\");\n \t$dot.find(\".gridScroller .gridTbody tr\").each(function(i){\n \t\t$(this).children().eq(index).children().children().attr('checked',ftrue);\n \t});\n }else{\n \t$('#'+tableid+' tr').each(function(i){\n\t\t\t$(this).children().eq(index).children().attr('checked',ftrue);\n \t});\n }\n}", "initScreen() {\n\t\tthis.wrapper = Ti.UI.createTableView({\n\t\t\tdata: this._tableData\n\t\t});\n\n\t\tthis.window.add(this.wrapper);\n\t}", "function addcheckBox(){\n\t\n\t\tcomponentObject.child = new Array();\n\t\tFTState.push(componentObject);\n\t var htmlelement=\"\";\t \n\t var checkboxId=idcount+\"00\";\n\t idcount++;\n\t var elementId=1;\n\t componentId=checkboxId;\n\t htmlelement+='<div class=\"pageSection\" id='+checkboxId+'><div class=\"pageInnerSection\">';\n\t componentObject.id = checkboxId;\n\t htmlelement+='<div class=\"pageSectionHeader\" ><p><h6 onclick=populateId('+checkboxId+') class=\"pull-right font10\">ID #'+checkboxId+'0</h6></p></div>';\n \t htmlelement+='<div class=\"pageSectionBody\">';\n \t/*Question element*/\n\t htmlelement+='<div class=\"rowPagesection firstRowPageSection\" id='+(checkboxId+elementId)+'><div class=\"colPageSection\"><div class=\"eachCol\"><a href=\"#\"><img src=\"img/getPicture.png\"></a></div></div>';\n\t htmlelement+='<div class=\"colPageSection\"><div><div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+'</h6></div><div class=\"inputDummy\" onkeydown=\"checkmaxlength()\" id=quetxt_'+(checkboxId+elementId)+' data-maxlength=\"\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\" ></div>';\n\t htmlelement+='</div></div></div>';\n\t \n\t var questionElement = new Object();\n\t questionElement.id = (checkboxId+elementId);\n\t// questionElement.maxLength = $(\"#quetxt_\"+(checkboxId+elementId)).attr(\"data-maxlength\");\n\t componentObject.child.push(questionElement);\n\t elementId++;\n\n\t \n\t /*First element*/\n\t \n\t htmlelement+='<div class=\"rowPagesection tickCheck\" id='+(checkboxId+elementId)+'><div class=\"colPageSection\"><div class=\"eachCol\"><div class=\"btn-group pull-left indt-mrgn\">';\n\t htmlelement+='<label data-toggle=\"buttons\" class=\"btn btn-grey btn-xs btn-bullet btn-bullet1 btnTick\">';\n\t htmlelement+='<input type=\"checkbox\"><img src=\"img/tick.png\">';\n\t htmlelement+='</label>';\n\t htmlelement+='<label data-toggle=\"buttons\" style=\"padding-bottom:0px;padding-top:0px;\" class=\"btn btn-grey btn-xs btn-bullet btn-bullet2 btnTickWrong\">';\n\t htmlelement+='<input type=\"checkbox\"><img src=\"img/tickwrong.png\">';\n\t htmlelement+='</label>';\t\n\t htmlelement+='</div>';\n\t htmlelement+='</div>';\t\t\n\t htmlelement+='</div>';\n\t \n\t var firstElement = new Object();\n\t \t firstElement.id = (checkboxId+elementId);\n\t \t componentObject.child.push(firstElement);\n\t htmlelement+='<div class=\"colPageSection secondColPic\" id=\"author'+(checkboxId+elementId)+'\">';\n\t htmlelement+='<div>';\n\t htmlelement+='<div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+' <a id=\"editfb'+(checkboxId+elementId)+'\" onclick=\"showFeedback('+(checkboxId+elementId)+')\">| edit feedback</a></h6></div>';\n\t htmlelement+='<div class=\"inputDummy\" id=txt_'+(checkboxId+elementId)+' data-maxlength=\"\" onkeydown=\"checkmaxlength()\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div></div>';\n\t \n\t htmlelement+='</div>'; \n\t htmlelement+='<div class=\"colPageSection secondColPic\" id=\"stud'+(checkboxId+elementId)+'\" style=\"display:none\">';\n\n\t htmlelement+='<div>';\n htmlelement+='<div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+'<a id=\"editfb'+(checkboxId+elementId)+'\" onclick=\"showFeedback('+(checkboxId+elementId)+')\">| edit feedback</a></h6></div>';\n htmlelement+='<div class=\"innerinputDummy\">';\n htmlelement+='<div class=\"inputDummyFirst\" id=authortxt_'+(checkboxId+elementId)+' data-maxlength=\"\" onkeydown=\"checkmaxlength()\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div>';\n htmlelement+='<div class=\"inputDummySecond\" contentEditable=true data-placeholder=\"Enter text\"></div>';\n htmlelement+='</div></div></div>';\n\t htmlelement+='<div class=\"colPageSection\">';\n\t htmlelement+='<div class=\"eachCol\"><div class=\"plusBtn '+(checkboxId+elementId)+'\" ><a><img src=\"img/plus.png\" onclick=addElement('+componentId+')></a></div><div class=\"minusBtn\"><a href=\"#\"><img src=\"img/minus.png\" id=minus_'+(checkboxId+elementId)+' onclick=deleteElement('+componentId+',this)></a></div></div>';\t\n\t htmlelement+='</div>';\n\n\t htmlelement+='<div id=\"feedback'+(checkboxId+elementId)+'\" class=\"rowPagesection closeFeedback\">';\n\t elementId++;\n\t htmlelement+='<div class=\"colPageSection\"><div class=\"eachCol firstColPic\"></div></div>';\n\t htmlelement+='<div class=\"colPageSection secondColPic\">';\n\t htmlelement+='<div><div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+' | <a onclick=\"hideFeedback('+(checkboxId+elementId)+')\">close feedback</a></h6></div>';\n\t htmlelement+='<div class=\"inputDummy\" id=fb_'+(checkboxId+elementId)+' data-maxlength=\"\" onkeydown=\"checkmaxlength()\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div></div></div>';\n\t\n\t htmlelement+='<div class=\"colPageSection thirdColPic\"><div class=\"eachCol\">';\n\t htmlelement+='<a href=\"#\"><img src=\"img/getPicture.png\"></a>'; \n\t htmlelement+='</div><div></div></div></div>';\n\t elementId++;\n\t \n\t htmlelement+='</div>'; \t \n\t /*Third element*/\n\t htmlelement+='<div class=\"rowPagesection tickCheck\" id='+(checkboxId+elementId)+'><div class=\"colPageSection\"><div class=\"eachCol\"><div class=\"btn-group pull-left indt-mrgn\">';\n\t htmlelement+='<label data-toggle=\"buttons\" class=\"btn btn-grey btn-xs btn-bullet btn-bullet1 btnTick\">';\n\t htmlelement+='<input type=\"checkbox\"><img src=\"img/tick.png\">';\n\t htmlelement+='</label>';\n\t htmlelement+='<label data-toggle=\"buttons\" style=\"padding-bottom:0px;padding-top:0px;\" class=\"btn btn-grey btn-xs btn-bullet btn-bullet2 btnTickWrong\">';\n\t htmlelement+='<input type=\"checkbox\"><img src=\"img/tickwrong.png\">';\n\t htmlelement+='</label>';\t\n\t htmlelement+='</div>';\n\t htmlelement+='</div>';\t\t\n\t htmlelement+='</div>';\n\t \n\t var secondElement = new Object();\n\t \t secondElement.id = (checkboxId+elementId);\n \t componentObject.child.push(secondElement);\n\t \n\t htmlelement+='<div class=\"colPageSection secondColPic\" id=\"author'+(checkboxId+elementId)+'\">';\n\t htmlelement+='<div>';\n\t htmlelement+='<div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+' <a id=\"editfb'+(checkboxId+elementId)+'\" onclick=\"showFeedback('+(checkboxId+elementId)+')\">| edit feedback</a></h6></div>';\n\t htmlelement+='<div class=\"inputDummy\" onkeydown=\"checkmaxlength()\" data-maxlength=\"\" id=txt_'+(checkboxId+elementId)+' onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div></div>';\n\t \n\t htmlelement+='</div>'; \n\t htmlelement+='<div class=\"colPageSection secondColPic\" id=\"stud'+(checkboxId+elementId)+'\" style=\"display:none\">';\n\t \n\t htmlelement+='<div>';\n htmlelement+='<div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+'<a id=\"editfb'+(checkboxId+elementId)+'\" onclick=\"showFeedback('+(checkboxId+elementId)+')\">| edit feedback</a></h6></div>';\n htmlelement+='<div class=\"innerinputDummy\">';\n htmlelement+='<div class=\"inputDummyFirst\" id=authortxt_'+(checkboxId+elementId)+' onkeydown=\"checkmaxlength()\" data-maxlength=\"\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div>';\n htmlelement+='<div class=\"inputDummySecond\" contentEditable=true data-placeholder=\"Enter text\"></div>';\n htmlelement+='</div></div></div>';\n\t htmlelement+='<div class=\"colPageSection\">';\n\t htmlelement+='<div class=\"eachCol\"><div class=\"plusBtn '+(checkboxId+elementId)+'\" ><a><img src=\"img/plus.png\" onclick=addElement('+componentId+')></a></div><div class=\"minusBtn\"><a href=\"#\"><img src=\"img/minus.png\" id=minus_'+(checkboxId+elementId)+' onclick=deleteElement('+componentId+',this)></a></div></div>';\t\n\t htmlelement+='</div>';\n\n\t htmlelement+='<div id=\"feedback'+(checkboxId+elementId)+'\" class=\"rowPagesection closeFeedback\">';\n\t elementId++;\n\t htmlelement+='<div class=\"colPageSection\"><div class=\"eachCol firstColPic\"></div></div>';\n\t htmlelement+='<div class=\"colPageSection secondColPic\">';\n\t htmlelement+='<div><div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+' | <a onclick=\"hideFeedback('+(checkboxId+elementId)+')\">close feedback</a></h6></div>';\n\t htmlelement+='<div class=\"inputDummy\" id=fb_'+(checkboxId+elementId)+' onkeydown=\"checkmaxlength()\" data-maxlength=\"\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div></div></div>';\n\t \n\t htmlelement+='<div class=\"colPageSection thirdColPic\"><div class=\"eachCol\">';\n\t htmlelement+='<a href=\"#\"><img src=\"img/getPicture.png\"></a>'; \n\t htmlelement+='</div><div></div></div></div>';\n\t elementId++;\n\t \n\t htmlelement+='</div>'; \n\t \n\t /*Fourth element*/\n\t htmlelement+='<div class=\"rowPagesection tickCheck\" id='+(checkboxId+elementId)+'><div class=\"colPageSection\"><div class=\"eachCol\"><div class=\"btn-group pull-left indt-mrgn\">';\n\t htmlelement+='<label data-toggle=\"buttons\" class=\"btn btn-grey btn-xs btn-bullet btn-bullet1 btnTick\">';\n\t htmlelement+='<input type=\"checkbox\"><img src=\"img/tick.png\">';\n\t htmlelement+='</label>';\n\t htmlelement+='<label data-toggle=\"buttons\" style=\"padding-bottom:0px;padding-top:0px;\" class=\"btn btn-grey btn-xs btn-bullet btn-bullet2 btnTickWrong\">';\n\t htmlelement+='<input type=\"checkbox\"><img src=\"img/tickwrong.png\">';\n\t htmlelement+='</label>';\t\n\t htmlelement+='</div>';\n\t htmlelement+='</div>';\t\t\n\t htmlelement+='</div>';\n\t \n\t var thirdElement = new Object();\n\t thirdElement.id = (checkboxId+elementId);\n\t componentObject.child.push(thirdElement);\n\t \n\t htmlelement+='<div class=\"colPageSection secondColPic\" id=\"author'+(checkboxId+elementId)+'\">';\n\t htmlelement+='<div>';\n\t htmlelement+='<div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+' <a id=\"editfb'+(checkboxId+elementId)+'\" onclick=\"showFeedback('+(checkboxId+elementId)+')\">| edit feedback</a></h6></div>';\n\t htmlelement+='<div class=\"inputDummy\" id=txt_'+(checkboxId+elementId)+' onkeydown=\"checkmaxlength()\" data-maxlength=\"\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div></div>';\n\t \n\t htmlelement+='</div>'; \n\t htmlelement+='<div class=\"colPageSection secondColPic\" id=\"stud'+(checkboxId+elementId)+'\" style=\"display:none\">';\n \n\t htmlelement+='<div>';\n htmlelement+='<div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+'<a id=\"editfb'+(checkboxId+elementId)+'\" onclick=\"showFeedback('+(checkboxId+elementId)+')\">| edit feedback</a></h6></div>';\n htmlelement+='<div class=\"innerinputDummy\">';\n htmlelement+='<div class=\"inputDummyFirst\" id=authortxt_'+(checkboxId+elementId)+' onkeydown=\"checkmaxlength()\" data-maxlength=\"\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div>';\n htmlelement+='<div class=\"inputDummySecond\" contentEditable=true data-placeholder=\"Enter text\"></div>';\n htmlelement+='</div></div></div>';\n\t htmlelement+='<div class=\"colPageSection\">';\n\t htmlelement+='<div class=\"eachCol\"><div class=\"plusBtn '+(checkboxId+elementId)+'\" ><a><img src=\"img/plus.png\" onclick=addElement('+componentId+')></a></div><div class=\"minusBtn\"><a href=\"#\"><img src=\"img/minus.png\" id=minus_'+(checkboxId+elementId)+' onclick=deleteElement('+componentId+',this)></a></div></div>';\t\n\t htmlelement+='</div>';\n\n\t htmlelement+='<div id=\"feedback'+(checkboxId+elementId)+'\" class=\"rowPagesection closeFeedback\">';\n\t elementId++;\n\t htmlelement+='<div class=\"colPageSection\"><div class=\"eachCol firstColPic\"></div></div>';\n\t htmlelement+='<div class=\"colPageSection secondColPic\">';\n\t htmlelement+='<div><div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+' | <a onclick=\"hideFeedback('+(checkboxId+elementId)+')\">close feedback</a></h6></div>';\n\t htmlelement+='<div class=\"inputDummy\" id=fb_'+(checkboxId+elementId)+' onkeydown=\"checkmaxlength()\" data-maxlength=\"\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div></div></div>';\n\t \n\t htmlelement+='<div class=\"colPageSection thirdColPic\"><div class=\"eachCol\">';\n\t htmlelement+='<a href=\"#\"><img src=\"img/getPicture.png\"></a>'; \n\t htmlelement+='</div><div></div></div></div>';\n\t elementId++;\n\t \n\t htmlelement+='</div>'; \n\t \n\t /*Fifth element*/\n\t htmlelement+='<div class=\"rowPagesection tickCheck\" id='+(checkboxId+elementId)+'><div class=\"colPageSection\"><div class=\"eachCol\"><div class=\"btn-group pull-left indt-mrgn\">';\n\t htmlelement+='<label data-toggle=\"buttons\" class=\"btn btn-grey btn-xs btn-bullet btn-bullet1 btnTick\">';\n\t htmlelement+='<input type=\"checkbox\"><img src=\"img/tick.png\">';\n\t htmlelement+='</label>';\n\t htmlelement+='<label data-toggle=\"buttons\" style=\"padding-bottom:0px;padding-top:0px;\" class=\"btn btn-grey btn-xs btn-bullet btn-bullet2 btnTickWrong\">';\n\t htmlelement+='<input type=\"checkbox\"><img src=\"img/tickwrong.png\">';\n\t htmlelement+='</label>';\t\n\t htmlelement+='</div>';\n\t htmlelement+='</div>';\t\t\n\t htmlelement+='</div>';\n\t \n\t var fourthElement = new Object();\n\t \tfourthElement.id = (checkboxId+elementId);\n\t componentObject.child.push(fourthElement);\n\t \n\t htmlelement+='<div class=\"colPageSection secondColPic\" id=\"author'+(checkboxId+elementId)+'\">';\n\t htmlelement+='<div>';\n\t htmlelement+='<div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+' <a id=\"editfb'+(checkboxId+elementId)+'\" onclick=\"showFeedback('+(checkboxId+elementId)+')\">| edit feedback</a></h6></div>';\n\t htmlelement+='<div class=\"inputDummy\" id=txt_'+(checkboxId+elementId)+' onkeydown=\"checkmaxlength()\" data-maxlength=\"\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div></div>';\n \n\t htmlelement+='</div>'; \n\t htmlelement+='<div class=\"colPageSection secondColPic\" id=\"stud'+(checkboxId+elementId)+'\" style=\"display:none\">';\n\t\n\t htmlelement+='<div>';\n htmlelement+='<div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+'<a id=\"editfb'+(checkboxId+elementId)+'\" onclick=\"showFeedback('+(checkboxId+elementId)+')\">| edit feedback</a></h6></div>';\n htmlelement+='<div class=\"innerinputDummy\">';\n htmlelement+='<div class=\"inputDummyFirst\" id=authortxt_'+(checkboxId+elementId)+' onclick=\"populateProperties(this)\" data-maxlength=\"\" onkeydown=\"checkmaxlength()\" contentEditable=true data-placeholder=\"Enter text\"></div>';\n htmlelement+='<div class=\"inputDummySecond\" contentEditable=true data-placeholder=\"Enter text\"></div>';\n htmlelement+='</div></div></div>';\n\t htmlelement+='<div class=\"colPageSection\">';\n\t htmlelement+='<div class=\"eachCol\"><div class=\"plusBtn '+(checkboxId+elementId)+'\" style=\"display:block\"><a><img src=\"img/plus.png\" onclick=addElement('+componentId+')></a></div><div class=\"minusBtn\"><a href=\"#\"><img src=\"img/minus.png\" id=minus_'+(checkboxId+elementId)+' onclick=deleteElement('+componentId+',this)></a></div></div>';\t\n\t htmlelement+='</div>';\n\n\t htmlelement+='<div id=\"feedback'+(checkboxId+elementId)+'\" class=\"rowPagesection closeFeedback\">';\n\t elementId++;\n\t htmlelement+='<div class=\"colPageSection\"><div class=\"eachCol firstColPic\"></div></div>';\n\t htmlelement+='<div class=\"colPageSection secondColPic\">';\n\t htmlelement+='<div><div class=\"editableDivTitle\"><h6 class=\"pull-right font10\">ID# '+(checkboxId+elementId)+' | <a onclick=\"hideFeedback('+(checkboxId+elementId)+')\">close feedback</a></h6></div>';\n\t htmlelement+='<div class=\"inputDummy\" id=fb_'+(checkboxId+elementId)+' onkeydown=\"checkmaxlength()\" data-maxlength=\"\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div></div></div>';\n \n\t// htmlelement+='</div>';\n\t htmlelement+='<div class=\"colPageSection thirdColPic\"><div class=\"eachCol\">';\n\t htmlelement+='<a href=\"#\"><img src=\"img/getPicture.png\"></a>'; \n\t htmlelement+='</div><div></div></div></div>';\n\t elementId++;\n\t \n\t htmlelement+='</div>'; \n\t \n\t htmlelement+='<div class =\"clear\"></div>';\n\t elementId++;\n\t \n\t /*checkbox footer*/\n\t htmlelement+='<div class=\"pageSectionFooter\">';\n\t htmlelement+='<div class=\"clear\"></div><div class=\"editGenFeed\"><a id=\"editgeneralFb'+checkboxId+'\" onclick=\"showGeneralFeedback('+checkboxId+')\">edit general feedback</a></div>';\n\t\t \n\t /*General feedback*/\n\t htmlelement+='<div id=\"genFb'+checkboxId+'\" class=\"generalFeedback\">';\n\t htmlelement+='<div class=\"rowPagesection\"><div class=\"colPageSection secondColPic\">';\n\t// debugger;\n\t htmlelement+='<div><div class=\"editableDivTitle\"><h6 class=\"pull-left font10\">General feedback:</h6> <h6 class=\"pull-right font10\">ID# '+(checkboxId.substring(0,2)+elementId)+'</h6></div>';\n\t htmlelement+='<div class=\"inputDummy\" id=txtgenFb_'+(checkboxId.substring(0,2)+elementId)+' onkeydown=\"checkmaxlength()\" data-maxlength=\"\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div></div></div>';\n\t elementId++;\n\t htmlelement+='<div class=\"colPageSection thirdColPic\"><div class=\"eachCol\"><a href=\"#\"><img src=\"img/getPicture.png\"></a></div><div></div></div></div>';\n\t htmlelement+='<div class=\"rowPagesection\"><div class=\"colPageSection secondColPic\"><div>';\n\t htmlelement+='<div class=\"editableDivTitle\"><h6 class=\"pull-left font10\">Overall feedback:</h6> <h6 class=\"pull-right font10\">ID# '+(checkboxId.substring(0,2)+elementId)+'</h6></div>';\n\t htmlelement+='<input type=\"hidden\" id=\"hdnCounter'+checkboxId+'\" name=\"counter\" value=\"'+(checkboxId.substring(0,2)+elementId)+'\"><div class=\"inputDummy\" id=txtallFb_'+(checkboxId.substring(0,2)+elementId)+' data-maxlength=\"\" onkeydown=\"checkmaxlength()\" onclick=\"populateProperties(this)\" contentEditable=true data-placeholder=\"Enter text\"></div>';\n\t htmlelement+='</div></div>';\n\t htmlelement+='<div class=\"colPageSection thirdColPic\"><div class=\"eachCol\">';\n\t htmlelement+='<a href=\"#\"><img src=\"img/getPicture.png\"></a></div><div></div></div></div></div>';\n\t \n\t /*Checkbox add/delete button*/\n\t htmlelement+='<div class=\"clear\"></div><div class=\"eachCol pull-right\">';\n\t htmlelement+='<div class=\"plusBtn '+(checkboxId+elementId)+'\" style=\"display:block\"><img src=\"img/plus.png\" onclick=addcheckBox() ></div>';\n\t htmlelement+='<div class=\"minusBtn\"><img src=\"img/minus.png\" onclick=deleteCheckbox('+componentId+')></div>';\n\t htmlelement+='<div class=\"clear\"></div></div></div>';\t\n\t htmlelement+='<div class=\"clear\">'; \n\t htmlelement+='</div></div></div>';\n\t \n\t htmlelement+='<input type=\"hidden\" id=\"grd_'+checkboxId+'\" value=\"0\" />';\n\t htmlelement+='<input type=\"hidden\" id=\"chkAll_'+checkboxId+'\" value=\"0\" />';\n\t htmlelement+='<input type=\"hidden\" id=\"actAny_'+checkboxId+'\" value=\"1\" />';\n\t \n\t $(\"#formToolCanvasId\").append(htmlelement);\n\t $(\"#checkboxID\").html(\"ID# \"+checkboxId+\"0\");\t\t \n\t $(\"#genFb\"+checkboxId).hide();\n\t $(\"#elementProperties\").hide();\n\t $(\"#properties\").show();\n\t \n\t $(\"#acptAnyAnsBtnId\").prop(\"checked\",true);\n\t\t clickAcceptAnyAnswer();\n\t\t addRadioButtonFunctinality();\t \n//\t toggleCheckAllApplyButton();\t \n\t checkboxId++;\n\t $(\"#checkAllThatApplyBtnId\").prop(\"checked\",false);\n\t $(\"#gradadedObjectBtnId\").prop(\"checked\",false);\n\t\n\t componentObject.html = $(htmlelement).wrap('<div></div>').parent().html();\n\t $(\".grid>input[type='checkbox']\").attr(\"disabled\",false);\n}", "function toggleTickAllRows(e){\n e.preventDefault();\n var status = this.checked;\n console.log(status);\n\n $(\".checkbox input\").each(function(){\n this.checked = status;\n });\n }" ]
[ "0.6688414", "0.64977086", "0.6467641", "0.6416971", "0.6380863", "0.63686115", "0.63614565", "0.63245076", "0.6323659", "0.631772", "0.6316012", "0.6300938", "0.6299302", "0.6292558", "0.62875015", "0.6280745", "0.6267908", "0.6267908", "0.6239484", "0.6239484", "0.6155657", "0.61387706", "0.61040306", "0.6085502", "0.60479885", "0.6015492", "0.5929003", "0.58470947", "0.5834069", "0.58027166", "0.57833743", "0.5773189", "0.57643294", "0.5729083", "0.56826746", "0.5660627", "0.56573683", "0.5652495", "0.5651654", "0.56381905", "0.563125", "0.5626243", "0.56203747", "0.55725133", "0.5555097", "0.5552537", "0.5551214", "0.5537293", "0.55322886", "0.5532146", "0.5527373", "0.55272233", "0.55200243", "0.5518626", "0.5487349", "0.54861736", "0.5480982", "0.54807717", "0.54807717", "0.5446763", "0.5442397", "0.5437412", "0.5428655", "0.5423856", "0.5382091", "0.5366078", "0.53621525", "0.536123", "0.53595304", "0.53578717", "0.5351783", "0.53433585", "0.534185", "0.5333504", "0.53223", "0.53170705", "0.5315099", "0.53147405", "0.53072786", "0.53021437", "0.5301775", "0.5297707", "0.52880996", "0.5287936", "0.5286219", "0.52778476", "0.52737236", "0.52664095", "0.525734", "0.52483135", "0.5247438", "0.52442217", "0.524283", "0.5237034", "0.5235756", "0.52352333", "0.5230013", "0.5221286", "0.52188635", "0.5216459" ]
0.78201777
0
Adds event handlers to the tablecheckbox.
_events() { this.$element.find('.table-checkbox-cell input').off('change').on({ 'change': this._triggerEvents.bind(this) }); this.$element.find('td.table-checkbox-cell input').off('click').on({ 'click': this._handleClick.bind(this) }); this.$element.find('th.table-checkbox-cell input').off('.zf.trigger').on({ 'check.zf.trigger': this.checkAll.bind(this), 'uncheck.zf.trigger': this.uncheckAll.bind(this), 'toggle.zf.trigger': this.toggleAll.bind(this) }); this.$element.find('td.table-checkbox-cell input').off('.zf.trigger').on({ 'check.zf.trigger': this.check.bind(this), 'uncheck.zf.trigger': this.uncheck.bind(this), 'toggle.zf.trigger': this.toggle.bind(this) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadCheckboxInputEventListeners(dataCtrl,uiCtrl){\n const className = uiCtrl.returnIds().classNames.checkboxesSelector\n for(const input of document.getElementsByClassName(className)){\n input.addEventListener('click',(e)=>{\n dataCtrl.updateRegChecked(e.target.id)\n dataCtrl.addSelectedRow(parseInt(e.target.id),e.target.checked)\n uiCtrl.updateButtonTextValue(dataCtrl.returnData('selectedRow').length)\n })\n }\n }", "function bindTableFunctions() {\n $(\"input\").click(function (args) {\n var trID = $(args.target).parents(\"tr\")[0].id;\n if (toDelete[trID] == null || toDelete[trID][0] == false) {\n toDelete[trID] = [true, trID];\n\n }\n else{\n if (args.currentTarget.checked) {\n return;\n }\n toDelete[trID] = null;\n }\n });\n}", "function HandleCheckBox(tx) {\n\n CellData.ComponentType = \"checkbox\";\n CellData.ComponentSaveMode = \"bool\"; // puo salvare true/false o 1/0 bit\n CellData.ComboSelectedValue = '';\n CellData.ComboSelectedText = '';\n\n //if(SelectedCell.hasClass('checkbox-save-bit') \n // CellData.ComponentSaveMode = \"bit\";\n\n EECLog('HandleCheckBox firex');\n \n EECLog($(tx).attr('class'));\n\n $(tx).on('click',function (e) {\n\n alert('clicked');\n //var nval = $(this).attr('checked') == 'checked';\n //e.preventDefault();\n //var data = nval;\n //CellValue = data;\n //CellData.newvalue = CellValue;\n //ApplyLocalChanges(CellData); //<-- function locale specifica della tabella se deve fare dei calcoli (es calcolare l'importo se cambia prezzo o qta) \n //LiveUpdate(CellData); // <-- qui invia le modifiche al server db\n //ClickRaised = false;\n });\n\n $(tx).on('focus', function () {\n $(this).select();\n });\n\n\n //$(tx).on('blur', function () {\n // EECLog('blur on checkbox');\n // SelectedCell.text(CellValue);\n // // $(this).remove(); // destroy itself\n \n //})\n return tx;\n\n}", "function bindEulaModalEvents(){\n\n\t$('#acceptAndDownloadCheckBox').click(function(event){\n\t\thandleEulaModalCheckBoxEvent();\n\t});\n\n\thandleEulaModalCheckBoxEvent();\t\n}", "function addCheckboxEventListeners(checkboxes) {\n for (let i = 0; i < checkboxes.length; i++) {\n checkboxes[i].addEventListener('change', checkboxEventListenerCallback);\n }\n}", "function addCheckboxes(view) {\n // Add the checkbox to to the header to select/unselect all\n $(\"#\" + view.key + \".kn-table thead tr\").prepend(\n '<th class=\"table-checkboxes-parent\"><input class=\"table-checkboxes\" type=\"checkbox\"></th>'\n );\n\n $(\"#\" + view.key + \".kn-table thead input\").change(function () {\n $(\".\" + view.key + \".kn-table tbody tr input\").each(function () {\n $(this).attr(\n \"checked\",\n $(\"#\" + view.key + \".kn-table thead input\").attr(\"checked\") !==\n undefined\n );\n });\n });\n\n // Add a checkbox to each row in the table body\n $(\"#\" + view.key + \".kn-table tbody tr\").each(function () {\n $(this).prepend(\n '<td class=\"table-checkboxes-parent\"><input class=\"table-checkboxes\" type=\"checkbox\"></td>'\n );\n });\n\n function toggleCheckbox($checkbox) {\n $checkbox.is(\":checked\")\n ? $checkbox.prop(\"checked\", false)\n : $checkbox.prop(\"checked\", true);\n }\n\n // Add click event handler to checkbox parent to check/uncheck child box\n $(\"#\" + view.key + \" .table-checkboxes-parent\").click(function (event) {\n // If table header, check/uncheck all checkboxes\n if ($(this).is(\"th\")) {\n var $headerCheckbox = $($(this).children()[0]);\n toggleCheckbox($headerCheckbox);\n $(\n \"#\" + view.key + \" td.table-checkboxes-parent input.table-checkboxes\"\n ).each(function () {\n $headerCheckbox.is(\":checked\")\n ? $(this).prop(\"checked\", true)\n : $(this).prop(\"checked\", false);\n });\n } else {\n var $checkbox = $($(this).children()[0]);\n toggleCheckbox($checkbox);\n }\n });\n\n // Restore default checkbox toggle\n $(\"#\" + view.key + \" .table-checkboxes\").click(function (event) {\n var $checkbox = $(this);\n toggleCheckbox($checkbox);\n });\n\n // Fix offset in totals row created by checkboxes\n elementLoaded(\"#\" + view.key + \" .kn-table-totals\", function (el) {\n el.prepend(\n '<td style=\"background-color: #eee; border-top: 1px solid #dadada;\">&nbsp;</td>'\n );\n });\n}", "function checkboxEventListenerCallback(event) {\n addOrRemoveFromCheckedList(event.target);\n changeDeleteButtonVisibility();\n}", "function registerTableEventHandlers() {\n // note these ordinals are into the data array, not the table output\n document.getElementById('thClient').addEventListener('click', function () {\n setSortColumn(this.id, 0); // hostname\n });\n document.getElementById('thDownload').addEventListener('click', function () {\n setSortColumn(this.id, 3); // dl speed\n });\n document.getElementById('thUpload').addEventListener('click', function () {\n setSortColumn(this.id, 4); // ul speed\n });\n document.getElementById('thTotalDown').addEventListener('click', function () {\n setSortColumn(this.id, 5); // total down\n });\n document.getElementById('thTotalUp').addEventListener('click', function () {\n setSortColumn(this.id, 6); // total up\n });\n document.getElementById('thTotal').addEventListener('click', function () {\n setSortColumn(this.id, 7); // total\n });\n }", "_bindEvents() {\n this.$scope.on('change', this.checkbox, (event) => {\n this._toggleItem(event.target);\n });\n\n $('body').on('click', `[${this.compareRemove}]`, (event) => {\n const id = parseInt($(event.target).attr(this.compareRemove), 10);\n this._removeItem(id);\n\n return false;\n });\n }", "function addEventHandlers() {\n // Select the cells, then iterate through adding click handler\n var cells = document.getElementsByTagName(\"td\");\n \n for (let i = 0; i < cells.length; i++) {\n (function(cellToUpdate){\n cellToUpdate.addEventListener(\"click\", function() {\n checkCell(cellToUpdate);\n });\n }(cells[i]));\n }\n}", "function connectRowSubmitsToRowCheckboxes() {\n\t$(\"studentForm\").on (\"change\", \"input[type=checkbox]\", setSubmitsFromCheckboxes);\t\t\n\tsetSubmitsFromCheckboxes();\n}", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\n\t\t\t\tif($(this).hasClass(\"stab\")){\n\t\t\t\t\tself.generateExploreResults(false);\n\t\t\t\t}\n\t\t\t}", "onCheckboxChanged(){\n this.onCheckboxChange({\n row: this.row\n });\n }", "function iCheckChange(filtersTableArea, filtersTableObject, dataTableObject) {\n $('tbody', filtersTableArea).on('ifChanged', 'input[name=\"enables[]\"]', function(event) {\n\n event.stopPropagation();\n\n var row = $(this).closest('tr');\n\n var data = filtersTableObject.row(row).data();\n\n if ($(this).is(':checked')) {\n $(this).attr('checked', 1);\n data.enable = true;\n } else {\n $(this).attr('checked', 0);\n data.enable = false;\n }\n filtersTableObject.row(row).data(data);\n\n iCheckInit(row);\n });\n}", "function addCheckButtonEvents () {\r\n\t\tdocument.querySelectorAll(\".fa-check\").forEach(function(checking) {\r\n\t\t\tchecking.addEventListener('click', function () {\r\n\t\t\t\tthis.classList.add('checked');\r\n\t\t\t\tupdateCompleteStatus(this.parentElement.dataset.listIndex) // update status function\r\n\t\t\t\tloadLists(); // reloads tasks list\r\n\t\t\t});\r\n\t\t});\r\n\t}", "function tableClickEvents(){\n\t//clickable rows for access tables\n\t$(\"#access-table tr td:nth-child(n+2)\").click(function(){\n\t\t$(this).parent().find(\"input[type=checkbox]\").click();\n\t})\n\n\t//unclick All checkbox on row click\n\t$(\"#access-table tr td input[type=checkbox]\").click(function(){\n\t\tif($(\"#accessesAll\").prop(\"checked\")) $(\"#accessesAll\").prop(\"checked\",false);\n\t})\n\n\t//click All event\n\t$(\"#accessesAll\").click(function(){\n\t\tif($(this).prop(\"checked\")) {\n //check only visible rows\n\t\t\t$(\"#access-table td input[type=checkbox]:visible\").prop(\"checked\",true);\n //show delete only if at least 1 row has been checked\n if($('#access-table tr td input[type=checkbox]:checked').length > 0) $(\"#access-del\").prop(\"disabled\",false);\n //$(\"#access-del\").prop(\"disabled\",false); \n\t\t\tif($('#access-table tr td input[type=checkbox]:checked').length == 1) $(\"#access-edit\").prop(\"disabled\",false);\n\t\t} else {\n\t\t\t$(\"#access-table td input[type=checkbox]\").prop(\"checked\",false);\n\t\t\t//no rows selected > disable both\n\t\t\t$(\"#access-edit,#access-del\").prop(\"disabled\",true);\n\t\t}\n\t})\n\t\n\t//edit / delete button toggle\n\t$('#access-table tr td input:checkbox').change(function(){\n\t\tif($('#access-table tr td input[type=checkbox]:checked').length > 0) {\n\t\t\t//if at least 1 row selected > enable delete\n\t\t\t$(\"#access-del\").prop(\"disabled\",false);\n\t\t\t//enable edit only if 1 row is selected\n\t\t\tif($('#access-table tr td input[type=checkbox]:checked').length > 1) $(\"#access-edit\").prop(\"disabled\",true);\n\t\t\telse $(\"#access-edit\").prop(\"disabled\",false);\n\t\t} else {\n\t\t\t//no rows selected > disable both\n\t\t\t$(\"#access-edit,#access-del\").prop(\"disabled\",true);\n\t\t}\n\t});\n}", "function styleCheckbox(table) {\n\n }", "function addCheckboxListeners() {\n $('.gridCheckbox').change(function (event) {\n if (!this.checked) {\n $('[data-type=\\'' + this.value + '\\']').addClass('hidden');\n } else {\n $('[data-type=\\'' + this.value + '\\']').removeClass('hidden');\n }\n });\n}", "addEventsListers() {\r\n document.addEventListener('click', (evt) => {\r\n const priceListRow = hasSomeParentOfClass(evt.target, 'price-table__row');\r\n\r\n if (priceListRow) {\r\n this.switchPriceListRow(priceListRow);\r\n }\r\n });\r\n }", "setUpListeners() {\n Array.prototype.forEach.call(\n this.element.querySelectorAll('input[type=checkbox]'),\n (el) => {\n el.addEventListener(\n 'change',\n () => this.toggle(el),\n );\n },\n );\n }", "function init_event_listener() {\n //console.log($('.songlist__checkbox'));\n $('.songlist__edit').click(function() {\n //console.log($(this).attr('tagName'));\n // all checkbox\n //console.log($('li.songlist__edit'));\n if ($(this).is('li')) {\n if ($(this).hasClass('songlist__edit--check')) {\n $('.songlist__edit').removeClass('songlist__edit--check');\n }else {\n $('.songlist__edit').addClass('songlist__edit--check');\n }\n }else{\n if ($(this).hasClass('songlist__edit--check')) {\n $(this).removeClass('songlist__edit--check');\n if ($('li.songlist__edit').hasClass('songlist__edit--check')) {\n $('li.songlist__edit').removeClass('songlist__edit--check');\n };\n }else {\n $(this).addClass('songlist__edit--check');\n }\n }\n\n\n });\n }", "function addCheckboxListeners() {\n document.querySelectorAll('div[class^=\"gymContent\"] input[type=\"checkbox\"]').forEach(checkbox => {\n checkbox.addEventListener('change', () => {\n let trainBox = document.querySelector(`li[class^=\"${checkbox.name}\"] div[class^=\"inputWrapper\"]`).parentElement;\n if (checkbox.checked) {\n trainBox.style['pointer-events'] = 'none';\n trainBox.style.opacity = '0.5';\n }\n else {\n trainBox.style['pointer-events'] = 'auto';\n trainBox.style.opacity = '1';\n }\n\n updateStoredSettings();\n });\n });\n}", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\t\t\t\t$(this).trigger(\"change\");\n\t\t\t}", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\t\t\t\t$(this).trigger(\"change\");\n\t\t\t}", "function CS_addClickListener(tableEl, handler) {\n function maybeClick(event) {\n const target = getTargetFromEvent(event);\n\n const inLink = target.tagName == 'A' || target.parentNode.tagName == 'A';\n\n if (inLink && !target.classList.contains('computehref')) {\n // The <a> elements already have the correct hrefs.\n return;\n }\n if (event.button == 2) {\n // User is trying to open a context menu, not trying to navigate.\n return;\n }\n\n let td = target;\n while (td && td.tagName != 'TD' && td.tagName != 'TH') {\n td = td.parentNode;\n }\n if (td.classList.contains('rowwidgets')) {\n // User clicked on a checkbox.\n return;\n }\n // User clicked on an issue ID link or text or cell.\n event.preventDefault();\n handler(event);\n }\n tableEl.addEventListener('click', maybeClick);\n tableEl.addEventListener('auxclick', maybeClick);\n}", "function addingListener() {\r\n for (let i=0; i< table.length; i++){\r\n table[i].addEventListener(\"click\",adding );\r\n }\r\n}", "function _saveAsPanelHandler(){\n\n $('#sm-editing-table--checkbox').on(\"click\", function() {\n // traverse the DOM up to the table and find all input checkboxes, mark as checked\n $(this).closest('table').find('td input:checkbox').prop('checked', this.checked);\n });\n\n $(\".showHistoryTable\").on(\"click\", function() {\n $('.sm-editing-table--history').toggle();\n });\n\n }", "function update_row_click_events() {\n\t$(\".clickable_row\").each(function(){\n\t\t$(this).click(function(){\n\t\t\t$(this).find(\"input\").prop(\"checked\", $(this).find(\"input\").prop(\"checked\") ? false : true);\n\t\t});\n\t});\n}", "function addListenerCheckbox(){\n\tlet checkbox = document.querySelectorAll('.input-checkbox');\n\tfor (var i = 0; i < checkbox.length; i++) {\n\t\tcheckbox[i].addEventListener('click', function() {\n\t\t\tthis.parentElement.nextElementSibling.classList.toggle('linethrough')\n\t\t})\n\t}\n}", "function setAddListener() {\n\t$('.add-btn').off().click(function(e) {\n\t\te.preventDefault();\n\t\tvar table = $(this).parents('table');\n\t\tif (table.is('#shelf-form')){\n\t\t\ttable.find('tbody').append(\n\t\t\t\t'<tr>'\n\t\t\t + '<td class=\"delete\"><a href=\"#\"><i class=\"fa fa-trash-o\"/></a></td>'\n\t\t\t + '<td>'\n\t\t\t + '<input type=\"text\" class=\"row-field\" placeholder=\"Title\">'\n\t\t\t +\t '</td>'\n\t\t\t + '<td>'\n\t\t\t + '<input type=\"text\" class=\"capacity-field\" placeholder=\"Capacity\">'\n\t\t\t +\t '</td>'\n\t\t\t + '<td>'\n\t\t\t + '<input type=\"text\" class=\"visibility-field\" placeholder=\"Visibility\">'\n\t\t\t +\t '</td>'\n\t\t\t + '</tr>'\n\t\t\t);\n\t\t}\n\t\telse if (table.is('#product-form')) {\n\t\t\ttable.find('tbody').append(\n\t\t\t\t'<tr>'\n\t\t\t + '<td class=\"delete\"><a href=\"#\"><i class=\"fa fa-trash-o\"/></a></td>'\n\t\t\t + '<td>'\n\t\t\t + '<input type=\"text\" class=\"title-field\" placeholder=\"Title\">'\n\t\t\t +\t '</td>'\n\t\t\t + '<td>'\n\t\t\t + '<input type=\"text\" class=\"size-field\" placeholder=\"Size\">'\n\t\t\t +\t '</td>'\n\t\t\t + '<td>'\n\t\t\t + '<input type=\"text\" class=\"value-field\" placeholder=\"Value\">'\n\t\t\t +\t '</td>'\n\t\t\t + '<td>'\n\t\t\t + '<input type=\"text\" class=\"quantity-field\" placeholder=\"Quantity\">'\n\t\t\t +\t '</td>'\n\t\t\t + '</tr>'\n\t\t\t);\n\t\t}\n\n\t\tsetDeleteListener();\n\t});\n}", "function addClickHandlers(){\n $('#submit').on('click', handleSubmit);\n $('#employeeTable').on('click', '.deleteButton', deleteEmployee);\n}", "function handle_checkboxes(){\n\t\t$.each($(\".anthrohack_checkbox\"), function(i, _box){\n\t\t\tvar id = \"#\" + $(_box).attr(\"id\") + \"_hidden\";\n\t\t\t$(_box).change(function(){\n\t\t\t\tif($(_box).prop(\"checked\")){\n\t\t\t\t\t$(id).val(\"on\").trigger('change');\n\t\t\t\t}else{\n\t\t\t\t\t$(id).val(\"off\").trigger('change');\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function setListeners() {\n\t\t// select all in table\n\t\t$(\"#selectAllPrograms\").click(function () {\n\t\t\t$(\"#programsTable input:checkbox\").prop( \"checked\", true );\n\t\t});\n\t\t$(\"#selectAllUsers\").click(function () {\n\t\t\t$(\"#usersTable input:checkbox\").prop( \"checked\", true );\n\t\t});\n\t\t$(\"#selectAllLocations\").click(function () {\n\t\t\t$(\"#locationsTable input:checkbox\").prop( \"checked\", true );\n\t\t});\n\t\t// select none in table\n\t\t$(\"#selectNonePrograms\").click(function () {\n\t\t\t$(\"#programsTable input:checkbox\").prop( \"checked\", false );\n\t\t});\n\t\t$(\"#selectNoneUsers\").click(function () {\n\t\t\t$(\"#usersTable input:checkbox\").prop( \"checked\", false );\n\t\t});\n\t\t$(\"#selectNoneLocations\").click(function () {\n\t\t\t$(\"#locationsTable input:checkbox\").prop( \"checked\", false );\n\t\t});\n\n\n\t\t// check if more than one checkbox is checked for editing\n\t\t$(\"#editPrograms\").click(function (event) {\n\t\t\tif ($(\"#programsTable input:checkbox:checked\").length == 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Please select a program to edit. Thanks!\");\n\t\t\t} else if ($(\"#programsTable input:checkbox:checked\").length > 1) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"You can only edit one program at a time. Please select only one program to edit. Thanks!\");\n\t\t\t} else {\n\t\t\t\tvar siteid = $(\"#programsTable input:checkbox:checked\").val();\n\t\t\t\twindow.location = \"/editPrograms?siteid=\" + siteid;\n\t\t\t}\n\t\t});\n\n\t\t$(\"#editUsers\").click(function (event) {\n\t\t\tif ($(\"#usersTable input:checkbox:checked\").length == 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Please select a user to edit. Thanks!\");\n\t\t\t} else if ($(\"#usersTable input:checkbox:checked\").length > 1) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"You can only edit one user at a time. Please select only one user to edit. Thanks!\");\n\t\t\t} else {\n\t\t\t\tvar userid = $(\"#usersTable input:checkbox:checked\").val();\n\t\t\t\twindow.location = \"/editUsers?userid=\" + userid;\t\t\t\t\n\t\t\t}\n\t\t});\n\n\t\t$(\"#editLocations\").click(function (event) {\n\t\t\tif ($(\"#locationsTable input:checkbox:checked\").length == 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Please select a location to edit. Thanks!\");\n\t\t\t} else if ($(\"#locationsTable input:checkbox:checked\").length > 1) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"You can only edit one location at a time. Please select only one location to edit. Thanks!\");\n\t\t\t} else {\n\t\t\t\tvar locationid = $(\"#locationsTable input:checkbox:checked\").val();\n\t\t\t\twindow.location = \"/editLocations?locationid=\" + locationid;\t\n\t\t\t}\n\t\t});\n\n\t\t// check if more than one checkbox is checked for editing\n\t\t$(\"#removePrograms\").click(function (event) {\n\t\t\tif ($(\"#programsTable input:checkbox:checked\").length == 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Please select a program to remove. Thanks!\");\n\t\t\t} else if ($(\"#programsTable input:checkbox:checked\").length > 1) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"You can only remove one program at a time. Please select only one program to remove. Thanks!\");\n\t\t\t} else {\n\t\t\t\tvar siteid = $(\"#programsTable input:checkbox:checked\").val();\n\t\t\t\twindow.location = \"/removePrograms?siteid=\" + siteid;\n\t\t\t}\n\t\t});\n\n\t\t$(\"#removeUsers\").click(function (event) {\n\t\t\tif ($(\"#usersTable input:checkbox:checked\").length == 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Please select a user to remove. Thanks!\");\n\t\t\t} else if ($(\"#usersTable input:checkbox:checked\").length > 1) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"You can only remove one user at a time. Please select only one user to remove. Thanks!\");\n\t\t\t} else {\n\t\t\t\tvar userid = $(\"#usersTable input:checkbox:checked\").val();\n\t\t\t\twindow.location = \"/removeUsers?userid=\" + userid;\t\t\t\t\n\t\t\t}\n\t\t});\n\n\t\t$(\"#removeLocations\").click(function (event) {\n\t\t\tif ($(\"#locationsTable input:checkbox:checked\").length > 1) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Please select a location to remove. Thanks!\");\n\t\t\t} else if ($(\"#locationsTable input:checkbox:checked\").length > 1) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"You can only remove one location at a time. Please select only one location to remove. Thanks!\");\n\t\t\t} else {\n\t\t\t\tvar locationid = $(\"#locationsTable input:checkbox:checked\").val();\n\t\t\t\twindow.location = \"/removeLocations?locationid=\" + locationid;\t\n\t\t\t}\n\t\t});\n\n\t\t$(\"#comparePrograms\").click(function (event) {\n\t\t\tif ($(\"#programsTable input:checkbox:checked\").length == 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Please select a few programs to compare. Thanks!\");\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tvar IDs = $(\"#programsTable input:checkbox:checked\").map(function(){\n\t \t\t\treturn $(this).val();\n\t \t\t}).get();\n\t\t\t\tvar numIDs = [];\n\t \t\t$.each(IDs, function(key, value) {\n\t \t\t\tvalue = parseInt(value);\n\t \t\t\tnumIDs.push(value);\n\t \t\t});\n\t \t\tvar json = JSON.stringify(numIDs);\n\t \t\twindow.location = \"/comparePrograms?siteids=\" + json;\t\t\t\t\n\t\t\t}\n\n\t\t});\n\n\t\t$(\"#compareUsers\").click(function (event) {\n\t\t\tif ($(\"#usersTable input:checkbox:checked\").length == 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Please select a few users to compare. Thanks!\");\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tvar IDs = $(\"#usersTable input:checkbox:checked\").map(function(){\n\t \t\t\treturn $(this).val();\n\t \t\t}).get();\n\t\t\t\tvar numIDs = [];\n\t \t\t$.each(IDs, function(key, value) {\n\t \t\t\tvalue = parseInt(value);\n\t \t\t\tnumIDs.push(value);\n\t \t\t});\n\t \t\tvar json = JSON.stringify(numIDs);\n\t \t\twindow.location = \"/compareUsers?userids=\" + json;\t\t\t\t\n\t\t\t}\n\n\n\t\t});\n\n\t\t$(\"#compareLocations\").click(function (event) {\n\t\t\tif ($(\"#locationsTable input:checkbox:checked\").length == 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Please select a few locations to compare. Thanks!\");\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tvar IDs = $(\"#locationsTable input:checkbox:checked\").map(function(){\n\t \t\t\treturn $(this).val();\n\t \t\t}).get();\n\t\t\t\tvar numIDs = [];\n\t \t\t$.each(IDs, function(key, value) {\n\t \t\t\tvalue = parseInt(value);\n\t \t\t\tnumIDs.push(value);\n\t \t\t});\n\t \t\tvar json = JSON.stringify(numIDs);\n\t \t\twindow.location = \"/compareLocations?locationids=\" + json;\n\t \t}\t\n\n\t\t});\n\n\n\t\t$(\"#emailUsers\").click(function (event) {\n\t\t\tif ($(\"#usersTable input:checkbox:checked\").length == 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Please select a few users to email. Thanks!\");\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t \t\tvar num = $(\"#usersTable input:checkbox:checked\").length;\n\t \t\tif (num == 1) {\n\t \t\t\tvar numRec = num + ' Recipient';\n\t \t\t} else {\n\t\t\t\t\tvar numRec = num + ' Recipients';\n\t \t\t}\n\t \t\t$('#numRecipients').html('<p><strong>To:</strong> ' + numRec + '</p>');\n\t\t\t\t$('#emailUsersModal').modal('show');\n\t\t\t}\n\t\t});\n\n\t\t$(\"#manageUsersData\").click(function (event) {\n\t\t\tif ($(\"#usersTable input:checkbox:checked\").length == 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Please select a user to manage their programs. Thanks!\");\n\t\t\t} else if ($(\"#usersTable input:checkbox:checked\").length > 1) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"You can only manage program data for one user at a time. Please select only one user. Thanks!\");\n\t\t\t} else {\n\t\t\t\tvar userid = $(\"#usersTable input:checkbox:checked\").val();\n\t\t\t\twindow.location = \"/manageUsersData?userid=\" + userid;\t\t\t\t\n\t\t\t}\n\t\t});\n\n\t\t$(\"#reassignPrograms\").click(function (event) {\n\t\t\tif ($(\"#programsTable input:checkbox:checked\").length == 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\talert(\"Please select a few programs to reassign. Thanks!\");\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tvar IDs = $(\"#programsTable input:checkbox:checked\").map(function(){\n\t \t\t\treturn $(this).val();\n\t \t\t}).get();\n\t\t\t\tvar numIDs = [];\n\t \t\t$.each(IDs, function(key, value) {\n\t \t\t\tvalue = parseInt(value);\n\t \t\t\tnumIDs.push(value);\n\t \t\t});\n\t \t\tvar json = JSON.stringify(numIDs);\n\t \t\twindow.location = \"/reassignProgramsList?siteids=\" + json;\t\t\t\t\n\t\t\t}\n\n\t\t});\n\n\t}", "function styleCheckbox(table) {\r\n\r\n\t}", "function addEventHandlers() {\n $(\"th\").click(function () {\n $('body').animate({ \"background-color\": randomcolor() }, 200);\n $(`#${this.id}`).toggleClass(\"marked\")\n });\n}", "function checkBox(checkbox){\r\n\t\tcheckbox.checked=true;\r\n\t\ttriggerEvent(checkbox);\r\n}", "_init() {\n this.$element.find('thead tr').each(function(index, el) {\n $(el).prepend('<th class=\"check table-checkbox-cell\"><input type=\"checkbox\" /></th>');\n });\n\n this.$element.find('tbody tr').each(function(index, el) {\n $(el).prepend('<td class=\"check table-checkbox-cell\"><input type=\"checkbox\" /></td>');\n });\n }", "function SetClickCheckBox(event, controlePai) {\n\n var tr = $(controlePai).closest('tr');\n\n if (event.target.type != 'checkbox') {\n event.stopPropagation();\n tr.find('input:checkbox').attr('checked', !tr.find('input:checkbox').attr('checked'));\n }\n\n if (tr.find('input:checkbox').is(':checked')) {\n tr.addClass('linhaSelecionada');\n }\n else {\n tr.removeClass('linhaSelecionada');\n }\n}", "function bindMyDownloadsTableRowClickEvents(){\n\t$('#content-container tr.clickable').click(function(event) {\n\t\t$this = $(this);\n\t\t$this.parent().find('tr.clickable.selected').removeClass('selected');\n\t\t$this.parent().find('tr.alt-clickable.selected').removeClass('selected');\n\t\tif(!$this.hasClass('selected')){\n\t\t\t$this.addClass('selected');\n\t\t}\n\t\tvar downloadGroupId = $(this).attr('id');\n\t\tgetSelectedProductDetails(downloadGroupId);\n\t});\n\t/* if it is product info page dont bind*/\n\t\n\t$('#content-container tr.alt-clickable').click(function(event) {\n\t\t\t$this = $(this);\n\t\t\t$this.parents('table.expanded').find('tr.clickable.selected').removeClass('selected');\n\t\t\t$this.parent().find('tr.alt-clickable.selected').removeClass('selected');\n\t\t\tif(!$this.hasClass('selected')){\n\t\t\t\t\t$this.addClass('selected');\n\t\t\t}\n\t\t\tvar downloadGroupId = $(this).attr('id');\n\t\t\tgetSelectedProductDetails(downloadGroupId);\n\t});\n\t\n}", "function handleAdd(e) {\n e.preventDefault();\n var row = table.insertRow();\n\n var cell1 = row.insertCell();\n var cell2 = row.insertCell();\n var cell3 = row.insertCell();\n cell1.innerHTML = value1 == true ? 1 : 0;\n cell2.innerHTML = b.checked == true ? 1: 0;\n cell3.innerHTML = c.checked == true ? 1: 0;\n}", "function eventRowChecked() {\r\n\t$(\".row-check\").on(\"change\", function() {\r\n\t\tvar isChecked = $(this).prop(\"checked\");\r\n\t\tif (isChecked) {\r\n\t\t\t$(this).closest(\"tr\").find(\"td\").each(function() {\r\n\t\t\t\t$(this).addClass(\"row-checked\");\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\t$(this).closest(\"tr\").find(\"td\").each(function() {\r\n\t\t\t\t$(this).removeClass(\"row-checked\");\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}", "function setupTable() {\n window.actionEvents = {\n \"click .edit\": function (e, value, row, index) {\n showEditDialog(row);\n },\n \"click .remove\": function (e, value, row, index) {\n showRemoveDialog(row);\n }\n };\n }", "function setupTable() {\n window.actionEvents = {\n \"click .edit\": function (e, value, row, index) {\n showEditDialog(row);\n },\n \"click .remove\": function (e, value, row, index) {\n showRemoveDialog(row);\n }\n };\n }", "function setEventsToTable() {\n\n\n //Event for click at button\n $(\"button.add-col-button\").click(function () {\n \n ShowCreateMarkFieldWind();\n });\n\n //Event for click at cell with presence\n $(\".presence-cell.editable\").click(function () {\n var studentId = $(this).parent().children().first().next().attr(\"data-id\");\n var classId = $(this).attr(\"data-id\");\n\n if ($(this).css(\"background-color\") == \"rgb(194, 255, 10)\") { //if student is absent\n $(this).css(\"background\", \"rgb(255, 218, 6)\");\n $(this).html(\"н\");\n $.ajax({\n url: \"NoteStudentAbsence?\" +\n \"&classId=\" + classId +\n \"&studentId=\" + studentId\n });\n } else { //if - precent\n $(this).css(\"background\", \"rgb(194, 255, 10)\");\n $(this).html(\"\");\n $.ajax({\n url: \"NoteStudentPresence?\" +\n \"&classId=\" + classId +\n \"&studentId=\" + studentId\n });\n }\n });\n\n //event for edit conent of cell with marks\n $(\".mark-cell.editable\").click(function (e) {\n //alert(this.className);\n\n e = e || window.event;\n var t = e.target || e.srcElement;\n var elm_name = t.tagName.toLowerCase();\n if (elm_name == 'input') {\n return false;\n }\n // alert(elm_name);\n\n var val = $(this).html();\n var code = '<input type=\"text\" class=\"edit\" value=\"' + val + '\"/>';\n $(this).html(code);\n $(\".edit\").focus();\n\n $(\".edit\").blur(function () {\n var val = $(\".edit\").val();\n var parent = $(\".edit\").parent();\n var data_id = parent.attr(\"data-id\");\n var data_type = parent.attr(\"data-type\");\n //////Нужна другая проверка в!!!!!\n if (isNaN(val))\n val=\"\";\n parent.html(val);\n $.ajax({\n url: \"SaveMarkServlet?id=\" + data_id +\n \"&type=\" + data_type +\n \"&value=\" + val\n });\n });\n });\n ////event function for click at cell whith student name\n $(\"td.cell-ui.stud-name.data-cell\").click(function () {\n clickAtCellWithStudName(event);\n });\n $(\"#stud-inf-wind\").mouseleave(function () {\n HideStudentInformationWind();\n });\n\n ////////////Редактируй. Нерабочий кусок кода. Для склика поя чейке таблице редактирования\n $(\".cell-ui.info-cell-editable\").click(function (event) {\n showPopupFormEditStudent(event);\n });\n}", "function addCheckBoxListener(){\n\n $(\"input:checkbox\").on('click', function() {\n\n var $box = $(this);\n if ($box.is(\":checked\") ) {\n\n var group = \"input:checkbox[name='\" + $box.attr(\"name\") + \"']\";\n\n if($box.attr(\"name\") != 'topping'){\n $(group).prop(\"checked\", false);\n }\n $box.prop(\"checked\", true);\n \n } else {\n $box.prop(\"checked\", false);\n }\n updatePrice();\n });\n\n}", "function addListenersToCheckboxes() {\n\n let cb = document.querySelectorAll(\"input[type='checkbox']\"); \n cb.forEach(element => {\n element.addEventListener('click', event => {\n markAsCompleteIncomplete(event);\n });\n });\n}", "function addListener() {\n document.getElementById('table').addEventListener('click', eventResponses);\n}", "function addCheckboxEvent() {\n $(\"input[type=checkbox]\").on(\"click\", function (event) {\n display.innerText =\"\";\n if (event.target.checked) {\n checkedSet.add(event.target.value);\n printChecked();\n } else {\n checkedSet.delete(event.target.value);\n printChecked();\n }\n });\n}", "addEventHandlers() {\n\n\t\tthis.elementConfig.addButton.on(\"click\",this.handleAdd);\n\t\tthis.elementConfig.cancelButton.on(\"click\",this.handleCancel);\n\t\tthis.elementConfig.retrieveButton.on(\"click\",this.retrieveData);\n\n\n\t}", "function newCheckBoxChange(evt) {\n if(sessionClicked) {\n myLoadHandler();\n } else {\n var event = new Event('change');\n // Dispatch the change event\n document.getElementById('files').dispatchEvent(event);\n }\n }", "function attachEventhandlers()\r\n{\r\nmainTABLEElement=document.getElementById(\"mainTable\");\r\nTABLECol=mainTABLEElement.getElementsByTagName(\"TABLE\");\r\n\r\n\tif (TABLECol!=null){\r\n\t\tfor (l=0; l<TABLECol.length; l++)\r\n\t\t{\r\n\t\t\tTHCol=TABLECol.item(l).getElementsByTagName(\"TH\");\r\n\t\t\tif (THCol.item(0)!=null || THCol.length>0){\r\n\t\t\t\t\r\n\t\t\t\tif (THCol.item(0)!=null){THCol.item(0).setAttribute('id',l);}\r\n\t\t\t//\tif(handlerTYPE=='mouseover')\r\n\t\t\t//\t\t{THCol.item(0).onmouseover=eHandler;\r\n\t\t\t//\t\t document.getElementsByTagName(\"BODY\").item(0).onclick=eHandler;}\r\n\t\t\t//\telse if(handlerTYPE=='click')\r\n\t\t\t//\t\t{document.getElementsByTagName(\"BODY\").item(0).onclick=eHandler;}\r\n\t\t\t\tif(handlerTYPE=='mouseover'){\r\n\t\t\t\t\r\n\t\t\t\t\tTHCol.item(0).onmouseover=eHandler;\r\n\t\t\t\t\t// document.getElementsByTagName(\"BODY\").item(0).onclick=eHandler;\r\n\t\t\t\t} else if(handlerTYPE=='click'){\r\n\t\t\t\t\tTHCol.item(0).onclick=eHandler;\r\n\t\t\t\t//\tdocument.getElementsByTagName(\"BODY\").item(0).onclick=eHandler;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function addVersionRowEventListener(){\n $(\".rowAction\").on(\"click\" ,\n function() {\n //Remove all previous listeners\n $('.rowAction').unbind('click');\n\n //Remove rowAction class and add row delete class\n $('.rowAction').addClass('rowRemoveAction').removeClass('rowAction')\n addTemplate(divVersionTemplate)\n adJustNames('model,version');\n\n });\n // addFormValidation();\n\n\n}", "[_initTableEvents] () {\n const prefix = this.selector.get('className', 'table');\n const btns = document.getElementsByClassName(`${prefix}-button`);\n\n Object.values(btns).forEach(btn => {\n btn.onclick = this[_changeHotkey];\n });\n }", "function statesCheckboxesRequiredEventHandler() {\n var $element = $(this).closest('.js-webform-type-checkboxes, .js-webform-type-webform-checkboxes-other');\n checkboxesRequired($element);\n }", "function addRowClick(tr) {\n tr.click(function (event) {\n const input = $(this).find('input[type=checkbox]');\n if (event.target != input[0]) { // abort if checkbox was clicked\n //console.log('row clicked');\n input.prop('checked', function(_, b) { return !b; });\n } else {\n //console.log('checkbox clicked');\n }\n });\n }", "function addCellEvents() {\n cells.forEach(function (cell) {\n cell.addEventListener(\"click\", cellEventListener);\n });\n}", "addCellClickListener(callback) {\n this.cellClickListeners.push(callback);\n }", "function addClick() {\n let tableHeaders = document.getElementsByClassName('tableHeader');\n\n for (i = 0; i < tableHeaders.length; i++) {\n\n tableHeaders[i].addEventListener('click', sortTable);\n }\n}", "attachReceiptSearchTableHandlers(){\n $(\".receipt-details\").unbind('click');\n $(\".delete-receipt\").unbind('click');\n $(\"#delete-receipt\").unbind('click');\n\n $(\".receipt-details\").on('click', {context : this} , this.showInvoiceDetails);\n $(\".delete-receipt\").on('click', {context : this} , this.confirmReceiptDelete);\n $(\"#delete-receipt\").on('click', {context : this} , this.deleteReceipt);\n }", "onCheckboxChange(){\n this.onCheckboxChanged();\n }", "function trigger_event_listeners() {\n\n // Handles/Triggers the Function for\n // changes in the Motions' Radio\n on_change_motions();\n\n // Handles/Triggers the Function for\n // changes in the Camera View's Radio\n on_change_camera_view();\n\n // Handles/Triggers the Function for\n // changes in the XZ Grid's Checkbox\n on_check_xz_grid();\n\n // Handles/Triggers the Function for\n // changes in the Atomic Orbit's Checkbox\n on_check_atomic_orbits();\n \n \n // Handles/Triggers the Function for\n // changes in the Atom's Particle's State #1 Checkbox\n on_check_atom_particle_state_1();\n \n // Handles/Triggers the Function for\n // changes in the Atom's Particle's State #2 Checkbox\n on_check_atom_particle_state_2();\n \n // Handles/Triggers the Function for\n // changes in the Atom's Particle's State #3 Checkbox\n on_check_atom_particle_state_3();\n \n // Handles/Triggers the Function for\n // changes in the Atom's Particle's State #4 Checkbox\n on_check_atom_particle_state_4();\n \n}", "function addListeners() { \n // get all checkboxes by name and add listener\n var visControlCheckboxes = document.getElementsByName(\"visControl\");\n \n for (var i = 0; i < visControlCheckboxes.length; i++) {\n visControlCheckboxes[i].addEventListener('click', visControlChanged, false);\n }\n}", "function handleCheckBox(checkbox) {\n switch (checkbox) {\n case \"cbAdmin\":\n setCheckedTypeAdmin(!checkedTypeAdmin);\n\n break;\n case \"cbAttendance\":\n setCheckedTypeAttendance(!checkedTypeAttendance);\n break;\n\n case \"cbStatus\":\n setActive(!active);\n break;\n\n default:\n break;\n }\n }", "function styleCheckbox(table) {\n\t /**\n\t $(table).find('input:checkbox').addClass('ace')\n\t .wrap('<label />')\n\t .after('<span class=\"lbl align-top\" />')\n\n\n\t $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t .find('input.cbox[type=checkbox]').addClass('ace')\n\t .wrap('<label />').after('<span class=\"lbl align-top\" />');\n\t */\n\t }", "function addTableChangedEventListener() {\r\n\tvar grid = document.getElementById('grd');\r\n\tgrid.addEventListener('DOMNodeInserted', function(e) {\r\n\t\tif (isNotesField(e.target)) {\r\n\t\t\ttransformNotesField(e.target);\r\n\t\t}\r\n\t}, false);\r\n}", "function fnBindTablesEvents() {\n jQuery('#AdmTransitionTable .btnDelete').on('click', function(event) {\n event.preventDefault();\n var arrayRowId = this.id.split('-');\n var id = arrayRowId[1];\n showBittionAlertModal({content: '¿Está seguro de eliminar esta transición?', title: 'Eliminar'});\n jQuery('#bittionBtnYes').click(function(event) {\n fnDeleteTransition(id); //(id, object)\n event.preventDefault();\n });\n });\n jQuery('#AdmStateTable .btnDelete').on('click', function(event) {\n event.preventDefault();\n var arrayRowId = this.id.split('-');\n var id = arrayRowId[1];\n showBittionAlertModal({content: '¿Está seguro de eliminar este estado?', title: 'Eliminar'});\n jQuery('#bittionBtnYes').click(function(event) {\n fnDeleteState(id); //(id, object)\n event.preventDefault();\n });\n });\n jQuery('#AdmTransactionTable .btnDelete').on('click', function(event) {\n event.preventDefault();\n var arrayRowId = this.id.split('-');\n var id = arrayRowId[1];\n showBittionAlertModal({content: '¿Está seguro de eliminar esta transacción?', title: 'Eliminar'});\n jQuery('#bittionBtnYes').click(function(event) {\n fnDeleteTransaction(id); //(id, object)\n event.preventDefault();\n });\n });\n fnUpdateXEditableState();\n fnUpdateXEditableTransaction();\n }", "function init() {\n $(document).on('click', '.pnl-Checkable-input', enableChildren);\n}", "function setTableEvents(table, tipo) {\n table.on(\"page\", () => {\n draw = true;\n });\n table.on(\"draw\", () => {\n if (draw) {\n draw = false;\n } else {\n var tableData;\n if(tipo == 1){\n tableData = getTableData(table);\n createHighchartsXTipo(tableData);\n }\n if(tipo == 2){\n tableData = getTableData(table);\n createHighchartsXCliente(tableData);\n }\n if(tipo == 3){\n tableData = getTableData(table);\n createHighchartsXPanel(tableData);\n }\n if(tipo == 4){\n tableData = getTableData(table);\n createHighchartsXNodo(tableData);\n }\n }\n });\n}", "function init(){\n $('.js-dit-toggle-field').each(function(){\n var $checkbox = $(this);\n var $checkboxes = $('[name=\"' + $checkbox.attr('name') + '\"]');\n\n // Set event listener\n $checkboxes.on('change', function(){\n toggle($checkbox);\n });\n\n });\n }", "function EventClick(inCheckbox) {\r\n try {\r\n var uiItem = null;\r\n var eventID = 0;\r\n if (inCheckbox === cbMake) {\r\n uiItem = cbMake;\r\n eventID = eventMake;\r\n } else if (inCheckbox === cbDelete) {\r\n uiItem = cbDelete;\r\n eventID = eventDelete;\r\n } else if (inCheckbox === cbClose) {\r\n uiItem = cbClose;\r\n eventID = eventClose;\r\n } else if (inCheckbox === cbSelect) {\r\n uiItem = cbSelect;\r\n eventID = eventSelect;\r\n } else if (inCheckbox === cbSet) {\r\n uiItem = cbSet;\r\n eventID = eventSet;\r\n }\r\n if (uiItem !== null) {\r\n Register(uiItem.checked, eventID.toString());\r\n }\r\n // TODO remove or add the event into the gRegisteredEvents array\r\n }\r\n catch (e) {\r\n JSLogIt(\"EventClick catch:\" + e);\r\n }\r\n }", "function createCheckboxes() {\n let rows = document.querySelectorAll(\"tr\");\n\n //head checkBox for multiple selection\n let checkbox = document.createElement('input');\n checkbox.setAttribute('type', \"checkbox\");\n checkbox.id = \"selectAll\";\n checkbox.value = \"selectAll\";\n checkbox.addEventListener( 'change', function() {\n let checkBoxes = document.querySelectorAll('input[type=\"checkbox\"]');\n if(this.checked) {\n for (let index = 1; index < checkBoxes.length; index++){\n checkBoxes[index].checked = true;\n }\n } else {\n for (let index = 1; index < checkBoxes.length; index++){\n checkBoxes[index].checked = false;\n }\n }\n });\n\n rows[0].appendChild(checkbox);\n\n for (let index = 1; index < rows.length; index++){\n let checkbox = document.createElement('input');\n checkbox.setAttribute('type', \"checkbox\");\n checkbox.id = data[index - 1].id;\n rows[index].appendChild(checkbox);\n }\n}", "function handleCheckBox(checkbox) {\n switch (checkbox) {\n case \"cbAdmin\":\n setCheckedTypeAdmin(!checkedTypeAdmin);\n break;\n\n case \"cbAttendance\":\n setCheckedTypeAttendance(!checkedTypeAttendance);\n break;\n\n default:\n break;\n }\n }", "function addCheckboxListener(question, checkbox, questionId)\n{\n checkbox.on('change', function() {\n //console.log('Checkbox changed for question '+questionId);\n var valid = $('[answersto='+ questionId +']').prop('checked');\n setField(question, valid);\n });\n}", "bindCheckBtnHandler(checkButton) {\n checkButton.addEventListener(\"click\", (e) => {\n this.onClickCheckBtn(e);\n });\n }", "function styleCheckbox(table) {\n //\n // $(table).find('input:checkbox').addClass('ace')\n // .wrap('<label />')\n // .after('<span class=\"lbl align-top\" />')\n //\n //\n // $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n // .find('input.cbox[type=checkbox]').addClass('ace')\n // .wrap('<label />').after('<span class=\"lbl align-top\" />');\n }", "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n \n \n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n }", "setHandlers() {\n this.rowLabels.forEach(\n (rowLabel) =>\n (rowLabel.onclick = () => this.rowLabelClickHandler(rowLabel))\n );\n\n this.difficultyRadios.forEach((radio) => this.radioHandler(radio));\n\n this.playNowBtn.onclick = (e) => this.playNowBtnClickHandler(e);\n\n this.leaderboards.onclick = () => this.openOverlay();\n\n this.closeBtn.onclick = () => this.closeOverlay();\n\n this.playerID.onclick = () => this.changeNameClickHandler();\n\n this.changeName.onclick = () => this.changeNameClickHandler();\n }", "function setupDoctorSelectionEventListener() {\n $(\"#doctors-table tbody\").on('click', 'tr', function () {\n var row = $(this);\n clearDoctorDetails();\n //if selected doctor is clicked again, do not display details\n displayDoctorDetails(row);\n /*if ($('[colspan=\"4\"]').parent('tr') !== row) {\n\n }*/\n //row.after('<tr/>').next().append('<td colspan=\"5\"/>').css('background','#ffffff').children('td').append('<div/>').children().css('background','#ffffff','height','200px').html(\"yeah really\");\n });\n}", "function styleCheckbox(table) {\r\n /**\r\n $(table).find('input:checkbox').addClass('ace')\r\n .wrap('<label />')\r\n .after('<span class=\"lbl align-top\" />')\r\n\r\n\r\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n .find('input.cbox[type=checkbox]').addClass('ace')\r\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\r\n */\r\n }", "function iniEvents() {\n\n function _gather_table_thead() {\n data.fields.forEach(field => {\n let id = GatherComponent.idByGatherTeamField(gatherMakers, gatherMakers.team, field);\n elementById(id).addEventListener('change', refresh); // TODO optimize scope to table header rows\n });\n }\n\n function _partners_fields() {\n data.partners.forEach(partner => {\n data.fields.forEach(field => {\n let id = GatherComponent.idByPartnerField(partner, field);\n elementById(id).addEventListener('change', refresh); // TODO optmize scope to freeforms or tags\n });\n });\n }\n\n _gather_table_thead();\n _partners_fields();\n}", "function onCheck(row){\n var grid = Ab.view.View.getControl('', 'fields_grid');\n var sTable = $(\"selectedFields\");\n var index = row.index;\n var dataRow = grid.getDataRows()[index];\n var table_name = row['afm_flds.table_name'];\n var field_name = row['afm_flds.field_name'];\n tBody = sTable.tBodies[0];\n var selectionCheckbox = dataRow.firstChild.firstChild;\n \n // if checkbox is checked,add selected fields to summary table and to view object.\n if (selectionCheckbox.checked == true) {\n \taddSelectedFields(row);\n }\n else \n if (selectionCheckbox.checked == false) {\n \n // otherwise, get the \"Remove\" button and click it\n removeButtons = document.getElementsByName(\"removeRow\");\n for (var x = 1; x < tBody.rows.length; x++) {\n var sRow = tBody.rows[x]\n if ((field_name == sRow.cells[0].innerHTML) && (table_name == sRow.cells[5].innerHTML)) {\n removeButtons[x - 1].click();\n }\n } \n }\n \n // save\t\n getFieldValues();\n}", "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n \n \n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n}", "function updateAddTableEvents() {\n /**\n * Called when the plus sign in the Add Table is clicked.\n */\n $('.add-fact').click(function() {\n\tvar id = $(this).attr(\"data\");\n\topenFactCreationDialog(id, \"add\");\n });\n\n /**\n * Open the Fact editor with the current Fact loaded\n */\n $('.edit-fact').click(function() {\n\tvar id = $(this).attr(\"data\");\n\topenFactCreationDialog(id, \"edit\");\n });\n\n /**\n * Make Facts selectable\n */\n $('.select-fact').click(function() {\n\tvar id = $($(this).parent().siblings()[0]).text();\n\t$('#Controls_Executor_Arg1').addClass('fact-filled');\n\t$('#Controls_Executor_Arg1').text(id);\n\tcloseAddTable();\n });\n\n /* Create buttons for the AddTable */\n $('.add-fact, .edit-fact').button();\n}", "function initStepToolbarEventHandler() {\n initAddFieldSetEventHandler();\n initPreviewToggle();\n }", "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n}", "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n}", "function setChecks() {\n // Bind to age on change\n $(\"#srvy_age\").on('change', onlyNumeric);\n // Bind to zip code on change\n $(\"#srvy_zip\").on('change', onlyNumeric);\n // Bind to colonia\n $(\"#srvy_col\").on('change', onlyGoodCharacters);\n}", "function attachCheckboxListener(formId, highlightClass) {\n var form = document.getElementById(formId);\n var checkboxes = form.getElementsByTagName(\"input\");\n for (var i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].type == \"checkbox\") {\n checkboxes[i].onclick = function () { handleCheckboxClick(this, highlightClass); };\n }\n }\n}", "function styleCheckbox(table) {\r\n/**\r\n\t$(table).find('input:checkbox').addClass('ace')\r\n\t.wrap('<label />')\r\n\t.after('<span class=\"lbl align-top\" />')\r\n\r\n\r\n\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n\t.find('input.cbox[type=checkbox]').addClass('ace')\r\n\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\r\n*/\r\n}", "function clickme(){\n //alert when the table is clicked\n\t\t alert('Hey, you clicked me!');\n\t ;\n\n\t $('table').on('click', clickme);\n\n }", "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n }", "handleCheckboxes(){\n\n for(let cb of this.checkboxes){\n\n if(cb.selected){\n cb.element.classList.add(SELECTED_CLASS);\n }\n else{\n cb.element.classList.remove(SELECTED_CLASS);\n }\n\n cb.element.checked = cb.selected;\n }\n }", "function checkboxColumn ()\r\n\t{\r\n\t\tthis.identifier = \"checkboxColumn\";\r\n\t\tthis.SetHeaderParams( \"\", \"browseListHeaderCheck\" );\r\n\t\tthis.SetCellParams( \"browseItemCheck\" );\r\n\t\tthis.SetCellWidth( \"1%\" );\r\n\t\tthis.SetIsEnabled( !class_noMultiSelectButtons );\r\n\t\tthis.AddCellHeader = function( rowStruct, contents, cellCount )\r\n\t\t{\r\n\t\t\tvar\t\tcell;\r\n\r\n\t\t\tvar\t\tisChecked = \"\";\r\n\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tif ( true === this.isEnabled )\r\n\t\t\t\t{\r\n\t\t\t\t\t// Add the cell for the type column\r\n\t\t\t\t\tcell = rowStruct.insertCell( cellCount++ );\r\n\t\t\t\t\tcell.className = this.headerClassName;\r\n\t\t\t\t\tcell.width = this.cellWidth;\r\n\t\t\t\t\tif ( this.headerSpan > 1 )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcell.colSpan = this.headerSpan;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcell.scope = this.headerScope;\r\n\r\n\t\t\t\t\tisChecked = '';\r\n\t\t\t\t\tif ( allChecked )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tisChecked = \"checked\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcell.innerHTML = \"<input type='checkbox' name='top_checkbox' value='checkbox' title='\" + LocString('SelectDeselectAll') + \"' onClick='ToggleAll( this, \\\"nodeID\\\" );' isChecked >\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(e)\r\n\t\t\t{\r\n\t\t\t\texceptionAlert( e, \"Issue occured in classbrowse.js/BrowseViewColumn.AddCellHeader.\" );\r\n\t\t\t}\r\n\t\t\treturn cellCount;\r\n\t\t};\r\n\r\n\t\tthis.getCellValue = function( dataRow, rowNo )\r\n\t\t{\r\n\t\t\tvar\t\tinnerHTMLStr;\r\n\t\t\tvar\t\tisChecked = '';\r\n\r\n\t\t\tif ( dataRow.checked )\r\n\t\t\t{\r\n\t\t\t\tisChecked = \"checked\";\r\n\t\t\t}\r\n\r\n\t\t\tinnerHTMLStr = \"<INPUT ID='\" + dataRow.name + \"_checkbox' TYPE='checkbox' NAME='nodeID' VALUE='\" + dataRow.dataId +\"' TITLE='\";\r\n\t\t\tinnerHTMLStr += LocString( \"SelectDeselect\" );\r\n\t\t\tinnerHTMLStr += \"' ONCLICK='javascript:Toggle( \\\"top_checkbox\\\", this, \\\"nodeID\\\" );' \" + isChecked + \" >\";\r\n\r\n\t\t\treturn innerHTMLStr;\r\n\t\t};\r\n\t}", "function toggleTickAllRows(e){\n e.preventDefault();\n var status = this.checked;\n console.log(status);\n\n $(\".checkbox input\").each(function(){\n this.checked = status;\n });\n }", "function createEventListenersForField(key) {\n mainElement.querySelector('#include' + capitalizeFirstLetter(key.toLowerCase())).addEventListener('change', function() {\n metadataActive[key] = this.checked;\n generateResult();\n });\n\n mainElement.querySelector('#input' + capitalizeFirstLetter(key.toLowerCase())).addEventListener('input', function() {\n metadataStore[key] = this.value;\n generateResult();\n });\n }", "function caseTbl_OnRowChecked(eventObject) {\r\n\r\n var checkedRows = caseTbl.getCheckedRows();\r\n\r\n var callIdVal = callId[eventObject.rowIndex].getValue();\r\n var callIdValue = cordys.getNodeText(GetVendorAllocatedDataModel.getData(), \".//*[local-name()='callId']\", callIdVal);\r\n cordys.setNodeText(GetHoldingFlag.getMethodRequest(), \".//*[local-name()='callIdParam']\", callIdValue);\r\n GetHoldingFlag.reset();\r\n var holdingFlag = cordys.getNodeText(GetHoldingFlag.getData(), \".//*[local-name()='HOLDING_FLAG']\");\r\n //added by sushmita on 22-09-2017 to hide/show buttons based on roles\r\n var userRole = cordys.getNodeText(GetPoUserMasterCompleteObjectModel.getData(), \".//*[local-name()='USER_ROLE']\", \"\", \"\");\r\n if (holdingFlag == \"Y\" && (userRole == 'StakeHolderMaker' || userRole == 'ADMIN')) {\r\n release_btn.show();\r\n release_btn.enable();\r\n hold_btn.hide();\r\n } else if (holdingFlag != \"Y\" && (userRole == 'StakeHolderMaker' || userRole == 'ADMIN')) {\r\n hold_btn.show();\r\n hold_btn.enable();\r\n release_btn.hide();\r\n } else if (userRole == 'StakeholderChecker') {\r\n // hold_btn.hide();\r\n // release_btn.hide();\r\n // assign_btn.show();\r\n reject_btn.show();\r\n }\r\n\r\n if (checkedRows.length == 0) {\r\n release_btn.hide();\r\n hold_btn.hide();\r\n }\r\n if (checkedRows.length > 1) {\r\n for (var i = 0; i < checkedRows.length; i++) {\r\n var rowIndex2 = checkedRows[i].index;\r\n var presentRow = eventObject.rowIndex;\r\n if (rowIndex2 != presentRow) {\r\n rowIndex1 = rowIndex2;\r\n }\r\n }\r\n if (rowIndex1 > 0) {\r\n caseTbl.checkRow(rowIndex1, false);\r\n }\r\n }\r\n\r\n}", "function listenToCheckbox() {\n $('input[type=\"checkbox\"].quizMulti').on('change', (e) => {\n let type = 'mc'; // set type to 'mc' (multiple choice)\n if (!$(e.currentTarget).prop('checked')) {\n // If the .quizMulti is checked, set type to 'sa' (single answer)\n type = 'sa';\n }\n // Populate and call the change confirmation modal\n popChangeConfModal(type, e.currentTarget);\n });\n}", "function addClickListenerCarRow(){\n for(let i = 0; i<carRows.length;i++){\n carRows[i].addEventListener('click',fillEditForm);\n \n }\n}", "function setupCheckboxes() {\n\t$('input[type=checkbox]').each(function() {\n\t\t$(this).after('<i></i>');\n\t\tif($(this).is(':checked') )\n\t\t\t$(this).next().removeClass().addClass('fas fa-check-square');\n\t\telse\n\t\t\t$(this).next().removeClass().addClass('far fa-square');\n\t});\n\t$('input[type=checkbox]').change(function() {\n\t\t$(this).next().toggleClass('fas').toggleClass('far').toggleClass('fa-check-square').toggleClass('fa-square');\n\t});\n\t$('input[type=checkbox]').focus(function() {\n\t\t$(this).next().css('background-color','hsl(160, 50%, 80%)');\n\t});\n\t$('input[type=checkbox]').focusout(function() {\n\t\t$(this).next().css('background-color','');\n\t});\n\t$('input[type=checkbox]').css('cursor', 'pointer');\n\t$('label input[type=checkbox]').css('cursor', 'pointer');\n\t$('input[type=checkbox]').css('opacity', '0');\n\t$('input[type=checkbox]').css('margin-top', '5px');\n\t$('input[type=checkbox]').css('position', 'absolute');\n\n\t// update display if they change the checkbox value programmatically\n\t// even if they use code like:\n\t// $('#myCheckbox').prop('checked', true);\n\t// instead of\n\t// $('#myCheckbox').change();\n\t$.propHooks.checked = {\n\t\tset: function (el, value) {\n\t\t\tif (el.checked !== value) {\n\t\t\t\tel.checked = value;\n\t\t\t\t$(el).trigger('change');\n\t\t\t}\n\t\t}\n\t};\n}", "setEvents() {\n this.$togglers.on('click', this.toggle.bind(this));\n }" ]
[ "0.68256617", "0.6514233", "0.6447254", "0.64088225", "0.62657773", "0.62545544", "0.62428105", "0.62331194", "0.6184075", "0.61073124", "0.6107219", "0.61038136", "0.6090065", "0.6061392", "0.605559", "0.60176665", "0.601445", "0.6007979", "0.5986835", "0.59832823", "0.59793586", "0.59704083", "0.59488964", "0.59488964", "0.59256107", "0.59205294", "0.58606416", "0.5840928", "0.58295286", "0.58290553", "0.5820242", "0.5798756", "0.5795504", "0.5786473", "0.57837", "0.5767903", "0.5759531", "0.5744781", "0.57422644", "0.5737883", "0.5728188", "0.57273835", "0.57273835", "0.5697564", "0.5695417", "0.56898606", "0.5681252", "0.5640244", "0.563259", "0.5617862", "0.56139857", "0.55950737", "0.55710274", "0.556675", "0.5565761", "0.5547064", "0.55466276", "0.55423594", "0.55412906", "0.55361867", "0.55104876", "0.54981005", "0.5495495", "0.54926", "0.54876935", "0.5480534", "0.54758966", "0.5465754", "0.5464641", "0.5461673", "0.5457032", "0.54480916", "0.5443788", "0.544189", "0.54131126", "0.54037946", "0.5393011", "0.53881514", "0.5375908", "0.53651047", "0.5363211", "0.5362335", "0.53542495", "0.53515184", "0.53477573", "0.53477573", "0.53474563", "0.5345015", "0.53406185", "0.53339374", "0.53326845", "0.5327848", "0.5323637", "0.5318007", "0.53168124", "0.5313282", "0.53071916", "0.530334", "0.53019977", "0.5294182" ]
0.60099036
17
Triggers custom events on checkbox toggle.
_triggerEvents(event) { var target = $(event.target); if (target.is(':checked')) { target.trigger('check.zf.trigger'); } else { target.trigger('uncheck.zf.trigger'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\t\t\t\t$(this).trigger(\"change\");\n\t\t\t}", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\t\t\t\t$(this).trigger(\"change\");\n\t\t\t}", "[toggleChecked](event) {\n\t\tconst self = this;\n\n\t\tif (event && self[IS_CLICKABLE]) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\n\t\tif (!self[IGNORE_EVENTS]) {\n\t\t\tself.isSelected(!self.isSelected());\n\t\t\tif (self.onSelect().length !== 0) {\n\t\t\t\tself.onSelect().trigger();\n\t\t\t}\n\t\t}\n\t}", "onCheckboxChange(){\n this.onCheckboxChanged();\n }", "handleCheckToggle (e) {\n this.props.onCheck()\n }", "function handle_checkboxes(){\n\t\t$.each($(\".anthrohack_checkbox\"), function(i, _box){\n\t\t\tvar id = \"#\" + $(_box).attr(\"id\") + \"_hidden\";\n\t\t\t$(_box).change(function(){\n\t\t\t\tif($(_box).prop(\"checked\")){\n\t\t\t\t\t$(id).val(\"on\").trigger('change');\n\t\t\t\t}else{\n\t\t\t\t\t$(id).val(\"off\").trigger('change');\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "internalOnChange(event) {\n /**\n * Fired before checkbox is toggled. Returning false from a listener prevents the checkbox from being toggled.\n * @event beforeChange\n * @preventable\n * @param {Core.widget.Checkbox} source Checkbox\n * @param {Boolean} checked Checked or not\n */\n\n /**\n * Fired when checkbox is toggled\n * @event change\n * @param {Core.widget.Checkbox} source Checkbox\n * @param {Boolean} checked Checked or not\n */\n this.triggerChange(true);\n }", "internalOnChange(event) {\n /**\n * Fired before checkbox is toggled. Returning false from a listener prevents the checkbox from being toggled.\n * @event beforeChange\n * @preventable\n * @param {Common.widget.Checkbox} source Checkbox\n * @param {Boolean} checked Checked or not\n */\n\n /**\n * Fired when checkbox is toggled\n * @event change\n * @param {Common.widget.Checkbox} source Checkbox\n * @param {Boolean} checked Checked or not\n */\n\n this.triggerChange(true);\n }", "setUpListeners() {\n Array.prototype.forEach.call(\n this.element.querySelectorAll('input[type=checkbox]'),\n (el) => {\n el.addEventListener(\n 'change',\n () => this.toggle(el),\n );\n },\n );\n }", "function checkBox(checkbox){\r\n\t\tcheckbox.checked=true;\r\n\t\ttriggerEvent(checkbox);\r\n}", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\n\t\t\t\tif($(this).hasClass(\"stab\")){\n\t\t\t\t\tself.generateExploreResults(false);\n\t\t\t\t}\n\t\t\t}", "onToggle() {}", "function listenToCheckbox() {\n $('input[type=\"checkbox\"].quizMulti').on('change', (e) => {\n let type = 'mc'; // set type to 'mc' (multiple choice)\n if (!$(e.currentTarget).prop('checked')) {\n // If the .quizMulti is checked, set type to 'sa' (single answer)\n type = 'sa';\n }\n // Populate and call the change confirmation modal\n popChangeConfModal(type, e.currentTarget);\n });\n}", "handleToggle() {\n this.toggle.addEventListener(\"click\", (e) => {\n this.doToggle()\n })\n }", "setEvents() {\n this.$togglers.on('click', this.toggle.bind(this));\n }", "clickCheckbox(e) {\n if (!e.target.getAttribute('click') || e.target.getAttribute('click') === 'false') {\n e.target.setAttribute('click', true);\n e.target.checked = true;\n } else {\n e.target.setAttribute('click', false);\n e.target.checked = false;\n }\n }", "_events() {\n this.$element.find('.table-checkbox-cell input').off('change').on({\n 'change': this._triggerEvents.bind(this)\n });\n\n this.$element.find('td.table-checkbox-cell input').off('click').on({\n 'click': this._handleClick.bind(this)\n });\n\n this.$element.find('th.table-checkbox-cell input').off('.zf.trigger').on({\n 'check.zf.trigger': this.checkAll.bind(this),\n 'uncheck.zf.trigger': this.uncheckAll.bind(this),\n 'toggle.zf.trigger': this.toggleAll.bind(this)\n });\n\n this.$element.find('td.table-checkbox-cell input').off('.zf.trigger').on({\n 'check.zf.trigger': this.check.bind(this),\n 'uncheck.zf.trigger': this.uncheck.bind(this),\n 'toggle.zf.trigger': this.toggle.bind(this)\n });\n }", "function checkboxEventListenerCallback(event) {\n addOrRemoveFromCheckedList(event.target);\n changeDeleteButtonVisibility();\n}", "onToggleClick() {\n if (this.disabled) {\n return;\n }\n const newChecked = this.isSingleSelector ? true : !this._checked;\n if (newChecked !== this._checked) {\n this._checked = newChecked;\n if (this.buttonToggleGroup) {\n this.buttonToggleGroup.syncButtonToggle(this, this._checked, true);\n this.buttonToggleGroup.onTouched();\n }\n }\n // Emit a change event when it's the single selector\n this.change.emit(new McButtonToggleChange(this, this.value));\n }", "onCheckboxChanged(){\n this.onCheckboxChange({\n row: this.row\n });\n }", "handleCheckboxInput(e){\n this.setState({ switch_checked: e.target.checked });\n }", "function newCheckBoxChange(evt) {\n if(sessionClicked) {\n myLoadHandler();\n } else {\n var event = new Event('change');\n // Dispatch the change event\n document.getElementById('files').dispatchEvent(event);\n }\n }", "toggleCheckbox(event) {\n const checkListItem = event.target.closest(`.${this.CSS.item}`);\n const checkbox = checkListItem.querySelector(`.${this.CSS.checkbox}`);\n\n if (checkbox.contains(event.target)) {\n checkListItem.classList.toggle(this.CSS.itemChecked);\n }\n }", "function trigger_event_listeners() {\n\n // Handles/Triggers the Function for\n // changes in the Motions' Radio\n on_change_motions();\n\n // Handles/Triggers the Function for\n // changes in the Camera View's Radio\n on_change_camera_view();\n\n // Handles/Triggers the Function for\n // changes in the XZ Grid's Checkbox\n on_check_xz_grid();\n\n // Handles/Triggers the Function for\n // changes in the Atomic Orbit's Checkbox\n on_check_atomic_orbits();\n \n \n // Handles/Triggers the Function for\n // changes in the Atom's Particle's State #1 Checkbox\n on_check_atom_particle_state_1();\n \n // Handles/Triggers the Function for\n // changes in the Atom's Particle's State #2 Checkbox\n on_check_atom_particle_state_2();\n \n // Handles/Triggers the Function for\n // changes in the Atom's Particle's State #3 Checkbox\n on_check_atom_particle_state_3();\n \n // Handles/Triggers the Function for\n // changes in the Atom's Particle's State #4 Checkbox\n on_check_atom_particle_state_4();\n \n}", "function init(){\n $('.js-dit-toggle-field').each(function(){\n var $checkbox = $(this);\n var $checkboxes = $('[name=\"' + $checkbox.attr('name') + '\"]');\n\n // Set event listener\n $checkboxes.on('change', function(){\n toggle($checkbox);\n });\n\n });\n }", "function checkBoxesEvents(event) {\r\n\r\n\tswitch(event) {\r\n\t\r\n\t\tcase 'setupDefault':\r\n\t\t(gameSettingsFilter[0]) ? (gameSettingsFilter[0] = false) : (gameSettingsFilter[0] = true);\r\n\t\tsetSetupLabel();\r\n\t\tbreak;\r\n\t\t\r\n\t\t\r\n\t\tcase 'setupCustom':\r\n\t\t(gameSettingsFilter[1]) ? (gameSettingsFilter[1] = false) : (gameSettingsFilter[1] = true);\r\n\t\tsetSetupLabel();\r\n\t\tbreak;\t\r\n\t\t\r\n\t\t\r\n\t\tcase 'controlWheel':\r\n\t\t(gameSettingsFilter[2]) ? (gameSettingsFilter[2] = false):(gameSettingsFilter[2] = true);\r\n\t\tsetControllerLabel();\r\n\t\tbreak;\r\n\t\t\r\n\t\t\r\n\t\tcase 'controlPad':\r\n\t\t(gameSettingsFilter[3]) ? (gameSettingsFilter[3] = false):(gameSettingsFilter[3] = true);\r\n\t\tsetControllerLabel();\r\n\t\tbreak;\r\n\t\t\r\n\t\t\r\n\t\tcase 'controlKeyboard':\r\n\t\t(gameSettingsFilter[4]) ? (gameSettingsFilter[4] = false):(gameSettingsFilter[4] = true);\r\n\t\tsetControllerLabel();\r\n\t\tbreak;\t\r\n\t\t\r\n\t\t\r\n\t\tcase 'cameraInternal':\r\n\t\t(gameSettingsFilter[5]) ? (gameSettingsFilter[5] = false) : (gameSettingsFilter[5] = true);\r\n\t\tsetCameraLabel();\r\n\t\tbreak;\r\n\t\t\r\n\t\t\r\n\t\tcase 'cameraExternal':\r\n\t\t(gameSettingsFilter[6]) ? (gameSettingsFilter[6] = false) : (gameSettingsFilter[6] = true);\r\n\t\tsetCameraLabel();\r\n\t\tbreak;\r\n\t\t\r\n\t\t\r\n\t\tdefault:\r\n\t\talert('error in checkbox event switch');\r\n\t\tbreak;\r\n\t}\r\n\t\r\n\tcheckIfcurrentFilterMatchSave();\r\n}", "function EventClick(inCheckbox) {\r\n try {\r\n var uiItem = null;\r\n var eventID = 0;\r\n if (inCheckbox === cbMake) {\r\n uiItem = cbMake;\r\n eventID = eventMake;\r\n } else if (inCheckbox === cbDelete) {\r\n uiItem = cbDelete;\r\n eventID = eventDelete;\r\n } else if (inCheckbox === cbClose) {\r\n uiItem = cbClose;\r\n eventID = eventClose;\r\n } else if (inCheckbox === cbSelect) {\r\n uiItem = cbSelect;\r\n eventID = eventSelect;\r\n } else if (inCheckbox === cbSet) {\r\n uiItem = cbSet;\r\n eventID = eventSet;\r\n }\r\n if (uiItem !== null) {\r\n Register(uiItem.checked, eventID.toString());\r\n }\r\n // TODO remove or add the event into the gRegisteredEvents array\r\n }\r\n catch (e) {\r\n JSLogIt(\"EventClick catch:\" + e);\r\n }\r\n }", "function addCheckBoxListener(){\n\n $(\"input:checkbox\").on('click', function() {\n\n var $box = $(this);\n if ($box.is(\":checked\") ) {\n\n var group = \"input:checkbox[name='\" + $box.attr(\"name\") + \"']\";\n\n if($box.attr(\"name\") != 'topping'){\n $(group).prop(\"checked\", false);\n }\n $box.prop(\"checked\", true);\n \n } else {\n $box.prop(\"checked\", false);\n }\n updatePrice();\n });\n\n}", "function bindEulaModalEvents(){\n\n\t$('#acceptAndDownloadCheckBox').click(function(event){\n\t\thandleEulaModalCheckBoxEvent();\n\t});\n\n\thandleEulaModalCheckBoxEvent();\t\n}", "function handleItemCheckClicked() {\n //check for when an item has been checked-off/clicked\n //iterate through store and target item that was clicked\n //toggle checked property - change value in field\n //re-render list - to refelct updates\n $('.js-shopping-list').on('click', `.js-item-toggle`, event => {\n //console.log('`handleItemCheckClicked` ran');\n const id = getItemIdFromElement(event.currentTarget);\n //console.log(itemId);\n toggleCheckedForListItem(id);\n renderShoppingList();\n });\n }", "_bindEvents() {\n this.$scope.on('change', this.checkbox, (event) => {\n this._toggleItem(event.target);\n });\n\n $('body').on('click', `[${this.compareRemove}]`, (event) => {\n const id = parseInt($(event.target).attr(this.compareRemove), 10);\n this._removeItem(id);\n\n return false;\n });\n }", "toggleCheckbox(event) {\n const CheckListItem = event.target.closest(`.${this.CSS.checklistItem}`);\n // null means clicked label selector, just ignore it\n if (!CheckListItem) return false;\n\n const Checkbox = CheckListItem.querySelector(`.${this.CSS.checklistBox}`);\n\n const itemIndex = CheckListItem.dataset.index;\n if (Checkbox.contains(event.target)) {\n const curCheckState = this._data.items[itemIndex].checked;\n this._data.items[itemIndex].checked = !curCheckState;\n // 当切换到非 checklist 的时候保留切换状态\n Checkbox.classList.toggle(this.CSS.checklistBracketCheckSignChecked);\n CheckListItem.classList.toggle(this.CSS.checklistItemChecked);\n CheckListItem.dataset.checked = !curCheckState;\n }\n }", "triggerChange(userAction) {\n const me = this,\n {\n checked\n } = me.input; // Prevent uncheck if this checkbox is part of a toggleGroup (radio-button mode) ..also ensure the group has visible active members\n\n const prevented = !checked && userAction && me.toggleGroup && me.getToggleGroupMembers().filter(widget => widget.isVisible && !widget.disabled).length || // Since Widget has Events mixed in configured with 'callOnFunctions' this will also call onBeforeChange, onChange and onAction\n !me.callPreventable('change', {\n checked,\n value: checked,\n userAction,\n valid: true\n }, eventObject => {\n me.triggerFieldChange(eventObject, false);\n\n if (userAction) {\n me.uncheckToggleGroupMembers();\n }\n /**\n * User performed the default action (toggled the checkbox)\n * @event action\n * @param {Core.widget.Checkbox} source Checkbox\n * @param {Boolean} checked Checked or not\n */\n\n me.trigger('action', eventObject);\n return true;\n }); // If prevented need to rollback the checkbox input\n\n if (prevented) {\n // Input change is not preventable, so need to revert the changes\n // The change event does not fire on programmatic change of input, so no need to suspend\n me.input.checked = !me.input.checked;\n }\n }", "checkboxChanged() {\n this.setState({ isChecked: !this.state.isChecked });\n this.props.handleTogglePlaylistCheckbox(this.props.playlistID);\n }", "function addCheckboxListeners() {\n document.querySelectorAll('div[class^=\"gymContent\"] input[type=\"checkbox\"]').forEach(checkbox => {\n checkbox.addEventListener('change', () => {\n let trainBox = document.querySelector(`li[class^=\"${checkbox.name}\"] div[class^=\"inputWrapper\"]`).parentElement;\n if (checkbox.checked) {\n trainBox.style['pointer-events'] = 'none';\n trainBox.style.opacity = '0.5';\n }\n else {\n trainBox.style['pointer-events'] = 'auto';\n trainBox.style.opacity = '1';\n }\n\n updateStoredSettings();\n });\n });\n}", "onToggle() {\r\n this.toggle = !this.toggle;\r\n }", "attributeChangedCallback(name, oldValue, newValue) {\n // check the name and run your desired method\n if (name === 'checked') {\n this.toggleChecked();\n } else if (name === 'disabled') {\n // TODO - change style on disabled\n this.toggleDisabled();\n }\n }", "clickHandler(event) {\n\t\tconsole.log(event.target);\n\t\tthis.myBool = !this.myBool;\n\t}", "triggerChange(userAction) {\n const me = this;\n\n // Since Widget has Events mixed in configured with 'callOnFunctions' this will also call onBeforeChange, onChange and onAction\n const prevented = !me.callPreventable(\n 'change',\n {\n checked: me.input.checked,\n userAction\n },\n (eventObject) => {\n /**\n * User performed the default action (toggled the checkbox)\n * @event action\n * @param {Common.widget.Checkbox} source Checkbox\n * @param {Boolean} checked Checked or not\n */\n me.trigger('action', eventObject);\n\n return true;\n }\n );\n\n // If prevented need to rollback the checkbox input\n if (prevented) {\n // Input change is not preventable, so need to revert the changes\n // The change event does not fire on programmatic change of input, so no need to suspend\n me.input.checked = !me.input.checked;\n }\n }", "function toggleCheckStatus(e) {\n var item = e.currentTarget;\n item.classList.toggle('checked');\n}", "_changeCheckState(changeType) {\n const that = this;\n\n let oldValue = null;\n\n if (that.checked === null) {\n that.checked = true;\n }\n else {\n oldValue = that.checked;\n that.checked = !that.checked;\n }\n\n that._handleTextSelection();\n\n that.$.fireEvent('change', { 'value': that.checked, 'oldValue': oldValue, changeType: changeType });\n }", "_downHandler(event) {\n const that = this,\n target = that.enableShadowDOM ? event.originalEvent.composedPath()[0] : event.originalEvent.target;\n\n if (that.disabled || that.readonly ||\n that.checkMode === 'input' && target !== that.$.checkBoxInput ||\n that.checkMode === 'label' && target !== that.$.checkBoxLabel) {\n return;\n }\n\n that.$.setAttributeValue('active', true);\n\n if (that.hasRippleAnimation) {\n const rect = that.$.checkBoxInput.getBoundingClientRect(),\n windowScrollX = window.scrollX || window.pageXOffset,\n windowScrollY = window.scrollY || window.pageYOffset;\n\n JQX.Utilities.Animation.Ripple.animate(that.$.checkBoxInput, rect.left + rect.width / 2 + windowScrollX, rect.top + rect.height / 2 + windowScrollY);\n }\n\n that._pressed = true;\n\n if (that.clickMode === 'press' || that.clickMode === 'pressAndRelease') {\n that._changeCheckState('pointer');\n that.$.fireEvent('click');\n that.focus();\n that._updateHidenInputNameAndValue();\n }\n }", "function toggleStatus(event) {\n var checked = event.target.checked;\n\n if (checked) {\n status = \"Yes\";\n } else {\n status = \"No\";\n }\n toggleSpan.textContent = status;\n}", "function hookStateToggle(e) {\n $(this).toggleClass('active', e.type == 'in');\n }", "handleCheck() {\n this.checked = !this.checked;\n }", "function handleItemCheckClicked() {\n // Need to use event delegation Listen for when a user clicks the check button\n $('ul.shopping-list').on('click', '.shopping-item-toggle', function(event) {\n // Retrieve the item's index in STORE from ther data attr\n const index = retrieveItemIndexFromDOM($(event.target));\n // Toggle the checked property in the store\n toggleCheckedForListItem(index);\n // Re-render the shopping list\n renderShoppingList();\n });\n}", "function toggleCheckBox (evt){\r\n\tlet target = evt.target;\r\n\tlet targetSet = (value) => target.setAttribute(\"aria-checked\", value);\r\n\ttoggled = (target.getAttribute(\"aria-checked\") === \"true\") ? targetSet(false) : targetSet(true);\r\n\ttarget.parentNode.querySelector(\"p\").classList.toggle(\"done\");\r\n}", "function OnAnimationOnOffSwitchChanged(sender) {\n\tif (sender) {\n\t\tvar bChecked = isChecked($(sender));\n\t\tvar oSlider = $('#AnimationOnOffSwitch > span');\n\t\tif (bChecked) {//has checked\n\t\t\toSlider.html('ON');\n\t\t\toSlider.removeClass('w3-right-align');\n\t\t\toSlider.addClass('w3-left-align');\n\t\t}\n\t\telse {\n\t\t\toSlider.html('OFF');\n\t\t\toSlider.removeClass('w3-left-align');\n\t\t\toSlider.addClass('w3-right-align');\n\t\t}\n\t}\n}", "function addCheckboxEvent() {\n $(\"input[type=checkbox]\").on(\"click\", function (event) {\n display.innerText =\"\";\n if (event.target.checked) {\n checkedSet.add(event.target.value);\n printChecked();\n } else {\n checkedSet.delete(event.target.value);\n printChecked();\n }\n });\n}", "onClick(event) {\n if (event.button !== 0)\n return;\n\n this.dispatchEvent(new CustomEvent('toggle', {\n detail: !this.on,\n }));\n }", "function iCheckChange(filtersTableArea, filtersTableObject, dataTableObject) {\n $('tbody', filtersTableArea).on('ifChanged', 'input[name=\"enables[]\"]', function(event) {\n\n event.stopPropagation();\n\n var row = $(this).closest('tr');\n\n var data = filtersTableObject.row(row).data();\n\n if ($(this).is(':checked')) {\n $(this).attr('checked', 1);\n data.enable = true;\n } else {\n $(this).attr('checked', 0);\n data.enable = false;\n }\n filtersTableObject.row(row).data(data);\n\n iCheckInit(row);\n });\n}", "function chooseCalender(){\n $(\".list-unstyled\").on(\"click\",\"label\", function(){\n $(this).toggleClass(\"unchecked\");\n $(this).prev().prop(\"checked\", !$(this).prev().prop(\"checked\"));\n });\n}", "onToggleEvent(category) {\n console.log(category);\n this.onToggle.emit(category);\n }", "onCheckWeft(event) {\n for (var item of this.ItemsWeft) {\n item.Select = event.detail.target.checked;\n }\n }", "_events() {\n this.$element.off('toggle.zf.trigger').on('toggle.zf.trigger', this.toggle.bind(this));\n }", "checkToggle(){\n \n\n //asing checkbox value to a internal prop\n this.state.checked = document.getElementById(\"cbox\" + this.state.id).checked\n \n if (typeof this.state.callbackCheck == 'function') {\n \n //callbak\n this.state.callbackCheck(this.state.id,this.state.checked)\n\n\n } else {\n console.log(\"no set check callback\")\n }\n //redundant\n // \n // cbox.checked =this.state.checked;\n\n }", "toggleInput(event) {\n this.openValue = event.target.checked\n this.animate()\n }", "function HandleCheckBox(tx) {\n\n CellData.ComponentType = \"checkbox\";\n CellData.ComponentSaveMode = \"bool\"; // puo salvare true/false o 1/0 bit\n CellData.ComboSelectedValue = '';\n CellData.ComboSelectedText = '';\n\n //if(SelectedCell.hasClass('checkbox-save-bit') \n // CellData.ComponentSaveMode = \"bit\";\n\n EECLog('HandleCheckBox firex');\n \n EECLog($(tx).attr('class'));\n\n $(tx).on('click',function (e) {\n\n alert('clicked');\n //var nval = $(this).attr('checked') == 'checked';\n //e.preventDefault();\n //var data = nval;\n //CellValue = data;\n //CellData.newvalue = CellValue;\n //ApplyLocalChanges(CellData); //<-- function locale specifica della tabella se deve fare dei calcoli (es calcolare l'importo se cambia prezzo o qta) \n //LiveUpdate(CellData); // <-- qui invia le modifiche al server db\n //ClickRaised = false;\n });\n\n $(tx).on('focus', function () {\n $(this).select();\n });\n\n\n //$(tx).on('blur', function () {\n // EECLog('blur on checkbox');\n // SelectedCell.text(CellValue);\n // // $(this).remove(); // destroy itself\n \n //})\n return tx;\n\n}", "function setupCheckboxes() {\n\t$('input[type=checkbox]').each(function() {\n\t\t$(this).after('<i></i>');\n\t\tif($(this).is(':checked') )\n\t\t\t$(this).next().removeClass().addClass('fas fa-check-square');\n\t\telse\n\t\t\t$(this).next().removeClass().addClass('far fa-square');\n\t});\n\t$('input[type=checkbox]').change(function() {\n\t\t$(this).next().toggleClass('fas').toggleClass('far').toggleClass('fa-check-square').toggleClass('fa-square');\n\t});\n\t$('input[type=checkbox]').focus(function() {\n\t\t$(this).next().css('background-color','hsl(160, 50%, 80%)');\n\t});\n\t$('input[type=checkbox]').focusout(function() {\n\t\t$(this).next().css('background-color','');\n\t});\n\t$('input[type=checkbox]').css('cursor', 'pointer');\n\t$('label input[type=checkbox]').css('cursor', 'pointer');\n\t$('input[type=checkbox]').css('opacity', '0');\n\t$('input[type=checkbox]').css('margin-top', '5px');\n\t$('input[type=checkbox]').css('position', 'absolute');\n\n\t// update display if they change the checkbox value programmatically\n\t// even if they use code like:\n\t// $('#myCheckbox').prop('checked', true);\n\t// instead of\n\t// $('#myCheckbox').change();\n\t$.propHooks.checked = {\n\t\tset: function (el, value) {\n\t\t\tif (el.checked !== value) {\n\t\t\t\tel.checked = value;\n\t\t\t\t$(el).trigger('change');\n\t\t\t}\n\t\t}\n\t};\n}", "function addCheckboxListeners() {\n $('.gridCheckbox').change(function (event) {\n if (!this.checked) {\n $('[data-type=\\'' + this.value + '\\']').addClass('hidden');\n } else {\n $('[data-type=\\'' + this.value + '\\']').removeClass('hidden');\n }\n });\n}", "function fireCheckboxChanging(element) {\n if (typeof Event === 'function' || !document.fireEvent) {\n var event = document.createEvent('HTMLEvents');\n event.initEvent('change', true, true);\n element.dispatchEvent(event);\n } else {\n element.fireEvent('onchange');\n }\n}", "_onInputClick(event) {\n // We have to stop propagation for click events on the visual hidden input element.\n // By default, when a user clicks on a label element, a generated click event will be\n // dispatched on the associated input element. Since we are using a label element as our\n // root container, the click event on the `checkbox` will be executed twice.\n // The real click event will bubble up, and the generated click event also tries to bubble up.\n // This will lead to multiple click events.\n // Preventing bubbling for the second event will solve that issue.\n event.stopPropagation();\n // If resetIndeterminate is false, and the current state is indeterminate, do nothing on click\n if (!this.disabled && this._clickAction !== 'noop') {\n // When user manually click on the checkbox, `indeterminate` is set to false.\n if (this.indeterminate && this._clickAction !== 'check') {\n Promise.resolve().then(() => {\n this._indeterminate = false;\n this.indeterminateChange.emit(this._indeterminate);\n });\n }\n this.toggle();\n this._transitionCheckState(this._checked ? 1 /* Checked */ : 2 /* Unchecked */);\n // Emit our custom change event if the native input emitted one.\n // It is important to only emit it, if the native input triggered one, because\n // we don't want to trigger a change event, when the `checked` variable changes for example.\n this._emitChangeEvent();\n }\n else if (!this.disabled && this._clickAction === 'noop') {\n // Reset native input when clicked with noop. The native checkbox becomes checked after\n // click, reset it to be align with `checked` value of `mat-checkbox`.\n this._inputElement.nativeElement.checked = this.checked;\n this._inputElement.nativeElement.indeterminate = this.indeterminate;\n }\n }", "listenForIndividualSwitchEvents(){\n $(function(){\n //Individual toggle switch\n $(\".child-switch\").change(function() {\n const portName = $(this).parent('label').parent('.switch').parent('td').prev().prev().find('span').text();\n if($(this).is(\":checked\")) {\n presenter.openModalDialog(`Are you sure you want to unblock port ${portName} ?`);\n $('#dismiss').click(() => {\n // console.log('dismiss');\n $(this).prop('checked', false);\n $(this).siblings().removeClass('green');\n $(this).siblings().addClass('red');\n $(this).parent('label').parent('.switch').parent('td').prev().prev().find('input[type=radio]').prop('checked', false);\n });\n $('#agree').click(() => {\n // console.log(\"Is checked\");\n // console.log($(this).parent('label').parent('.switch').parent('td').prev().prev().find('span').text());\n //TODO: Add logic here for if selected individual switch is on\n presenter.onIndividualPortUnblocked(portName);\n });\n\n $(this).siblings().addClass('green');\n $(this).parent('label').parent('.switch').parent('td').prev().prev().find('input[type=radio]').prop('checked', true);\n }\n else {\n presenter.openModalDialog(`Are you sure you want to block port ${portName} ?`);\n $('#agree').click(() => {\n // console.log(\"Is Not checked\");\n //TODO: Add logic here for if selected individual switch is off\n presenter.onIndividualPortBlocked(portName);\n });\n\n $('#dismiss').click(() => {\n $(this).prop('checked', true);\n $(this).siblings().addClass('green');\n $(this).parent('label').parent('.switch').parent('td').prev().prev().find('input[type=radio]').prop('checked', true);\n })\n\n //Set the child switche state to block\n $(this).siblings().removeClass('green');\n $(this).siblings().addClass('red');\n $(this).parent('label').parent('.switch').parent('td').prev().prev().find('input[type=radio]').prop('checked', false);\n }\n });\n });\n }", "function init_event_listener() {\n //console.log($('.songlist__checkbox'));\n $('.songlist__edit').click(function() {\n //console.log($(this).attr('tagName'));\n // all checkbox\n //console.log($('li.songlist__edit'));\n if ($(this).is('li')) {\n if ($(this).hasClass('songlist__edit--check')) {\n $('.songlist__edit').removeClass('songlist__edit--check');\n }else {\n $('.songlist__edit').addClass('songlist__edit--check');\n }\n }else{\n if ($(this).hasClass('songlist__edit--check')) {\n $(this).removeClass('songlist__edit--check');\n if ($('li.songlist__edit').hasClass('songlist__edit--check')) {\n $('li.songlist__edit').removeClass('songlist__edit--check');\n };\n }else {\n $(this).addClass('songlist__edit--check');\n }\n }\n\n\n });\n }", "function onCheckboxChanged(event) {\n if (document.getElementById(\"cb1\").checked &&\n document.getElementById(\"cb2\").checked &&\n document.getElementById(\"cb3\").checked) {\n subject.notifyObservers();\n }\n}", "loadCheckboxInputEventListeners(dataCtrl,uiCtrl){\n const className = uiCtrl.returnIds().classNames.checkboxesSelector\n for(const input of document.getElementsByClassName(className)){\n input.addEventListener('click',(e)=>{\n dataCtrl.updateRegChecked(e.target.id)\n dataCtrl.addSelectedRow(parseInt(e.target.id),e.target.checked)\n uiCtrl.updateButtonTextValue(dataCtrl.returnData('selectedRow').length)\n })\n }\n }", "function nameTagSwitchClicked(checkbox) {\n EventBridge.emitWebEvent(JSON.stringify({\n app: \"userInspector\",\n method: \"nametagSwitchClicked\",\n nameTagEnabled: checkbox.checked\n }));\n}", "function toggleChecked() {\n\t\t\tvm.bind.checked = !vm.bind.checked;\n\t\t}", "setupLabelClickListeners () {\n $('#softTabsLabel').on('click', event => {\n event.preventDefault()\n let newValue = !this.props.softTabs\n this.props.onSoftTabsChange(newValue)\n })\n\n $('#wordWrapLabel').on('click', event => {\n event.preventDefault()\n let newValue = !this.props.wordWrap\n this.props.onWordWrapChange(newValue)\n })\n\n $('#showInvisiblesLabel').on('click', event => {\n event.preventDefault()\n let newValue = !this.props.showInvisibles\n this.props.onShowInvisiblesChanged(newValue)\n })\n }", "function addListenerCheckbox(){\n\tlet checkbox = document.querySelectorAll('.input-checkbox');\n\tfor (var i = 0; i < checkbox.length; i++) {\n\t\tcheckbox[i].addEventListener('click', function() {\n\t\t\tthis.parentElement.nextElementSibling.classList.toggle('linethrough')\n\t\t})\n\t}\n}", "function handleCheckBox(checkbox) {\n switch (checkbox) {\n case \"cbAdmin\":\n setCheckedTypeAdmin(!checkedTypeAdmin);\n break;\n\n case \"cbAttendance\":\n setCheckedTypeAttendance(!checkedTypeAttendance);\n break;\n\n default:\n break;\n }\n }", "function handleCheckBox(checkbox) {\n switch (checkbox) {\n case \"cbAdmin\":\n setCheckedTypeAdmin(!checkedTypeAdmin);\n\n break;\n case \"cbAttendance\":\n setCheckedTypeAttendance(!checkedTypeAttendance);\n break;\n\n case \"cbStatus\":\n setActive(!active);\n break;\n\n default:\n break;\n }\n }", "function _onToggle( event ) {\n event.preventDefault();\n !disabled && onToggle( style || action )\n }", "function addCheckboxEventListeners(checkboxes) {\n for (let i = 0; i < checkboxes.length; i++) {\n checkboxes[i].addEventListener('change', checkboxEventListenerCallback);\n }\n}", "onToggle(d) {\n const { onChangeToggle, identifier } = this.props;\n if (onChangeToggle) {\n onChangeToggle(d[identifier]);\n }\n }", "get _eventTargetProperty() {\n return 'checked';\n }", "_onChange() {\n let checked = this.execute('is checked');\n return this.attrs.onChange(checked, this);\n }", "function toggleTickAllRows(e){\n e.preventDefault();\n var status = this.checked;\n console.log(status);\n\n $(\".checkbox input\").each(function(){\n this.checked = status;\n });\n }", "function ManualCheckbox(target) {\n $('body').on('change', target, function () {\n if ($(this).is(':checked')) {\n $(this).val(true);\n\n }\n if (!$(this).is(':checked')) {\n $(this).val(false);\n }\n });\n }", "checkChanged(indx){\n //update checkbox status when checkboxes are checked... \n this.props.selectionChanged(indx);\n }", "bindEvents() {\n this.node.addEventListener('rh-toggle', this.update.bind(this));\n }", "_toggledCommandValChanged() {\n this.dispatchEvent(new CustomEvent(\"toggled-command-val-changed\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: this\n }));\n }", "covidPositiveToggle(e) {\n this.setState({\n covidPositive: e.target.checked\n });\n }", "function update_row_click_events() {\n\t$(\".clickable_row\").each(function(){\n\t\t$(this).click(function(){\n\t\t\t$(this).find(\"input\").prop(\"checked\", $(this).find(\"input\").prop(\"checked\") ? false : true);\n\t\t});\n\t});\n}", "onToggle(category) {\n category.toggle = !category.toggle;\n console.log(category);\n this.onToggleEvent.emit(category);\n }", "function change(e) {\n\tconst el = document.querySelector(`input[type=checkbox][data-filename='${e.target.dataset.filename}']`);\n\tif (el) {\n\t\tel.checked = !el.checked;\n\t}\n\tcheckStartButtonAndchkAll();\n}", "function stopListeningToCheckbox() {\n $('input[type=\"checkbox\"].quizMulti').\n off(\"change\");\n}", "trigger(options) {\n super.trigger(options);\n if (!this.disabled) {\n this.checked = !this.checked;\n }\n }", "function checkboxInputChange(e) { //cambia il valore della checkbox\n setChecked((prevChecked) => !prevChecked);\n console.log(checked);\n }", "function addCheckButtonEvents () {\r\n\t\tdocument.querySelectorAll(\".fa-check\").forEach(function(checking) {\r\n\t\t\tchecking.addEventListener('click', function () {\r\n\t\t\t\tthis.classList.add('checked');\r\n\t\t\t\tupdateCompleteStatus(this.parentElement.dataset.listIndex) // update status function\r\n\t\t\t\tloadLists(); // reloads tasks list\r\n\t\t\t});\r\n\t\t});\r\n\t}", "function onCheckboxClick( input ) {\n var assignmentTaskId = parseInt($(input).attr('data-assignment-task'));\n var studentId = parseInt($(input).attr('data-student'));\n\n var checked = false;\n if( $(input).is(':checked') )\n checked = true;\n\n socket.emit(\"studentAssignmentTaskEvent\", {\n \"studentId\": studentId,\n \"assignmentTaskId\": assignmentTaskId,\n \"eventType\": \"finishedTask\",\n \"name\": assignmentTaskId,\n \"data\": checked\n });\n\n if($(\"input[type='checkbox']:checked\").length == $(\"input[type='checkbox']\").length ) {\n $(\"#assignmentCompleteId\").removeClass('uk-hidden');\n }\n else {\n $(\"#assignmentCompleteId\").addClass('uk-hidden');\n }\n}", "function companyToggle(){\n if($('#company_name_toggle_on').is(\":checked\") || $('#company_name_toggle_off').is(\":checked\")) {\n $('#checkbox2').show(\"slide\", { direction: \"up\" }, 1000);\n $('#step_3').prop('disabled', false);\n $('#step_3').removeClass('bg-disable');\n $('#bg-legend_3').removeClass('bg-legend');\n $('#step_3').css(\"background\",\"rgb(237,203,180)\");\n $(\"#rock\").addClass('clickable');\n }\n}", "handleInputChange(event) {\n let eventDetail = {};\n let typeLowercased = this.type.toLowerCase();\n\n switch (typeLowercased) {\n case \"toggle\":\n eventDetail = {\n // event.detail.value is undefined for a toggle\n value: event.detail.checked,\n };\n break;\n\n default:\n eventDetail = {\n value: event.detail.value,\n };\n }\n\n const settingsInputChange = new CustomEvent(\"settingsinputchange\", { detail: eventDetail });\n this.dispatchEvent(settingsInputChange);\n }", "function onInit() {\n $scope.$on('action-checkbox-all_check-all', toggleCheckedAll);\n }", "toggle() {\n this.checked = !this.checked;\n this._onChange(this.checked);\n }", "function testCheckboxClick(handler) {\n $('<input type=\"checkbox\">').css({ position: 'absolute', left: '-1000px', top: '-1000px' }).appendTo('body').on('click', handler).trigger('click').remove();\n }", "otherInteractionToggle(e) {\n this.setState({\n otherInteraction: e.target.checked\n });\n }", "singleClicked() {\n const checkboxEnabled = this.singleClickEnabled;\n if (checkboxEnabled === false) {\n this.singleClickEnabled = true;\n }\n else {\n this.singleClickEnabled = false;\n }\n console.log('The single click option enabled is ' + this.singleClickEnabled);\n }", "initOpenNowAtToggleLogic() {\n // When \"open now\" checked uncheck \"open at\".\n $('#open_now').on('click', function (e) {\n // uncheck \"open at\" and disable datetime input\n $('#open-at-checkbox').prop('checked', false);\n $('#open_at').prop('disabled', true);\n });\n // When \"open at\" checked uncheck \"open now\".\n // Additionally, \"open at\" needs a datetime input enabled\n // and disabled when it is checked and unchecked.\n $('#open-at-checkbox').on('click', function (e) {\n // uncheck \"open now\"\n $('#open_now').prop('checked', false);\n // enable or disable datetime input as input is checked or unchecked\n if ($('#open-at-checkbox').prop('checked')) {\n $('#open_at').prop('disabled', false);\n } else {\n $('#open_at').prop('disabled', true);\n }\n });\n }", "function toggleCheck(event, name) {\n event.preventDefault();\n var trackNode = document.getElementsByName(name)[0];\n var checked = trackNode.checked;\n trackNode.checked = !checked;\n }" ]
[ "0.7453503", "0.7453503", "0.738352", "0.7069492", "0.69283473", "0.68284374", "0.6793226", "0.6791482", "0.6765733", "0.672069", "0.6654515", "0.66085434", "0.6432164", "0.64278", "0.64190793", "0.6413244", "0.63892907", "0.6269365", "0.6252796", "0.62228006", "0.6198602", "0.6158474", "0.6155769", "0.6119637", "0.61086804", "0.60481083", "0.6041263", "0.6040609", "0.60369885", "0.6016215", "0.6015626", "0.6010364", "0.6010176", "0.6006955", "0.6002854", "0.59954697", "0.5989679", "0.5983111", "0.59794194", "0.5978912", "0.5972606", "0.59656805", "0.5962399", "0.5931584", "0.59276265", "0.59191823", "0.5899646", "0.5896168", "0.5886358", "0.58836764", "0.5880358", "0.5877431", "0.5870895", "0.58618534", "0.5858052", "0.5853294", "0.5850327", "0.584231", "0.5823994", "0.5819167", "0.5816566", "0.5812416", "0.58030874", "0.57989055", "0.5798863", "0.57946813", "0.5775442", "0.57659954", "0.5765603", "0.5759095", "0.57559043", "0.5754204", "0.57486767", "0.5740847", "0.5738845", "0.5738593", "0.5729546", "0.572873", "0.57270455", "0.57239705", "0.57233286", "0.5717431", "0.57094216", "0.56982344", "0.5696743", "0.5682395", "0.5669657", "0.56635195", "0.5655263", "0.5639413", "0.56391543", "0.5637865", "0.5637506", "0.56334525", "0.5633045", "0.5615372", "0.5615071", "0.5611666", "0.5603926", "0.55990493" ]
0.7231672
3
Handles click events on checkbox toggle.
_handleClick(event) { var row = $(event.target).parents('tr:first'); var rows = this.$element.find('tbody tr'); if (!this.lastChecked) { this.lastChecked = row; return; } if (event.shiftKey) { this.changeMultiple = true; var start = rows.index(row); var end = rows.index(this.lastChecked); var from = Math.min(start, end); var to = Math.max(start, end) + 1; var checked = this.lastChecked.find('input').is(':checked'); var checkboxes = rows.slice(from, to).find('input'); if (checked) { checkboxes.trigger('check.zf.trigger'); } else { checkboxes.trigger('uncheck.zf.trigger'); } this.changeMultiple = false; } this.lastChecked = row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "[toggleChecked](event) {\n\t\tconst self = this;\n\n\t\tif (event && self[IS_CLICKABLE]) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\n\t\tif (!self[IGNORE_EVENTS]) {\n\t\t\tself.isSelected(!self.isSelected());\n\t\t\tif (self.onSelect().length !== 0) {\n\t\t\t\tself.onSelect().trigger();\n\t\t\t}\n\t\t}\n\t}", "clickCheckbox(e) {\n if (!e.target.getAttribute('click') || e.target.getAttribute('click') === 'false') {\n e.target.setAttribute('click', true);\n e.target.checked = true;\n } else {\n e.target.setAttribute('click', false);\n e.target.checked = false;\n }\n }", "handleCheckToggle (e) {\n this.props.onCheck()\n }", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\n\t\t\t\tif($(this).hasClass(\"stab\")){\n\t\t\t\t\tself.generateExploreResults(false);\n\t\t\t\t}\n\t\t\t}", "onToggleClick() {\n if (this.disabled) {\n return;\n }\n const newChecked = this.isSingleSelector ? true : !this._checked;\n if (newChecked !== this._checked) {\n this._checked = newChecked;\n if (this.buttonToggleGroup) {\n this.buttonToggleGroup.syncButtonToggle(this, this._checked, true);\n this.buttonToggleGroup.onTouched();\n }\n }\n // Emit a change event when it's the single selector\n this.change.emit(new McButtonToggleChange(this, this.value));\n }", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\t\t\t\t$(this).trigger(\"change\");\n\t\t\t}", "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\t\t\t\t$(this).trigger(\"change\");\n\t\t\t}", "handleToggle() {\n this.toggle.addEventListener(\"click\", (e) => {\n this.doToggle()\n })\n }", "function handleItemCheckClicked() {\n //check for when an item has been checked-off/clicked\n //iterate through store and target item that was clicked\n //toggle checked property - change value in field\n //re-render list - to refelct updates\n $('.js-shopping-list').on('click', `.js-item-toggle`, event => {\n //console.log('`handleItemCheckClicked` ran');\n const id = getItemIdFromElement(event.currentTarget);\n //console.log(itemId);\n toggleCheckedForListItem(id);\n renderShoppingList();\n });\n }", "function handleItemCheckClicked() {\n // Need to use event delegation Listen for when a user clicks the check button\n $('ul.shopping-list').on('click', '.shopping-item-toggle', function(event) {\n // Retrieve the item's index in STORE from ther data attr\n const index = retrieveItemIndexFromDOM($(event.target));\n // Toggle the checked property in the store\n toggleCheckedForListItem(index);\n // Re-render the shopping list\n renderShoppingList();\n });\n}", "toggleCheckbox(event) {\n const CheckListItem = event.target.closest(`.${this.CSS.checklistItem}`);\n // null means clicked label selector, just ignore it\n if (!CheckListItem) return false;\n\n const Checkbox = CheckListItem.querySelector(`.${this.CSS.checklistBox}`);\n\n const itemIndex = CheckListItem.dataset.index;\n if (Checkbox.contains(event.target)) {\n const curCheckState = this._data.items[itemIndex].checked;\n this._data.items[itemIndex].checked = !curCheckState;\n // 当切换到非 checklist 的时候保留切换状态\n Checkbox.classList.toggle(this.CSS.checklistBracketCheckSignChecked);\n CheckListItem.classList.toggle(this.CSS.checklistItemChecked);\n CheckListItem.dataset.checked = !curCheckState;\n }\n }", "function checkboxClicked(event) {\n // executed on Clear Selectd button onclick\n if (checkbox.checked) {\n // if the checkbox is checked\n taskManager.deleteTask(task); // deletes the task of the given index\n\n checkbox.closest(\"div.task\").remove(); // removes the closes div in the task class\n\n clearSelected.removeEventListener('click', checkboxClicked); // removes previously registered event listener\n }\n }", "click () {\n this._chkInput.click();\n }", "function toggleCheckBox (evt){\r\n\tlet target = evt.target;\r\n\tlet targetSet = (value) => target.setAttribute(\"aria-checked\", value);\r\n\ttoggled = (target.getAttribute(\"aria-checked\") === \"true\") ? targetSet(false) : targetSet(true);\r\n\ttarget.parentNode.querySelector(\"p\").classList.toggle(\"done\");\r\n}", "toggleCheckbox(event) {\n const checkListItem = event.target.closest(`.${this.CSS.item}`);\n const checkbox = checkListItem.querySelector(`.${this.CSS.checkbox}`);\n\n if (checkbox.contains(event.target)) {\n checkListItem.classList.toggle(this.CSS.itemChecked);\n }\n }", "onToggle() {}", "function checkBox(checkbox){\r\n\t\tcheckbox.checked=true;\r\n\t\ttriggerEvent(checkbox);\r\n}", "function toggleCheckStatus(e) {\n var item = e.currentTarget;\n item.classList.toggle('checked');\n}", "setUpListeners() {\n Array.prototype.forEach.call(\n this.element.querySelectorAll('input[type=checkbox]'),\n (el) => {\n el.addEventListener(\n 'change',\n () => this.toggle(el),\n );\n },\n );\n }", "function handle_checkboxes(){\n\t\t$.each($(\".anthrohack_checkbox\"), function(i, _box){\n\t\t\tvar id = \"#\" + $(_box).attr(\"id\") + \"_hidden\";\n\t\t\t$(_box).change(function(){\n\t\t\t\tif($(_box).prop(\"checked\")){\n\t\t\t\t\t$(id).val(\"on\").trigger('change');\n\t\t\t\t}else{\n\t\t\t\t\t$(id).val(\"off\").trigger('change');\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "onCheckboxChange(){\n this.onCheckboxChanged();\n }", "clickHandler(event) {\n\t\tconsole.log(event.target);\n\t\tthis.myBool = !this.myBool;\n\t}", "_downHandler(event) {\n const that = this,\n target = that.enableShadowDOM ? event.originalEvent.composedPath()[0] : event.originalEvent.target;\n\n if (that.disabled || that.readonly ||\n that.checkMode === 'input' && target !== that.$.checkBoxInput ||\n that.checkMode === 'label' && target !== that.$.checkBoxLabel) {\n return;\n }\n\n that.$.setAttributeValue('active', true);\n\n if (that.hasRippleAnimation) {\n const rect = that.$.checkBoxInput.getBoundingClientRect(),\n windowScrollX = window.scrollX || window.pageXOffset,\n windowScrollY = window.scrollY || window.pageYOffset;\n\n JQX.Utilities.Animation.Ripple.animate(that.$.checkBoxInput, rect.left + rect.width / 2 + windowScrollX, rect.top + rect.height / 2 + windowScrollY);\n }\n\n that._pressed = true;\n\n if (that.clickMode === 'press' || that.clickMode === 'pressAndRelease') {\n that._changeCheckState('pointer');\n that.$.fireEvent('click');\n that.focus();\n that._updateHidenInputNameAndValue();\n }\n }", "handleCheckboxInput(e){\n this.setState({ switch_checked: e.target.checked });\n }", "singleClicked() {\n const checkboxEnabled = this.singleClickEnabled;\n if (checkboxEnabled === false) {\n this.singleClickEnabled = true;\n }\n else {\n this.singleClickEnabled = false;\n }\n console.log('The single click option enabled is ' + this.singleClickEnabled);\n }", "function checkboxEventListenerCallback(event) {\n addOrRemoveFromCheckedList(event.target);\n changeDeleteButtonVisibility();\n}", "function EventClick(inCheckbox) {\r\n try {\r\n var uiItem = null;\r\n var eventID = 0;\r\n if (inCheckbox === cbMake) {\r\n uiItem = cbMake;\r\n eventID = eventMake;\r\n } else if (inCheckbox === cbDelete) {\r\n uiItem = cbDelete;\r\n eventID = eventDelete;\r\n } else if (inCheckbox === cbClose) {\r\n uiItem = cbClose;\r\n eventID = eventClose;\r\n } else if (inCheckbox === cbSelect) {\r\n uiItem = cbSelect;\r\n eventID = eventSelect;\r\n } else if (inCheckbox === cbSet) {\r\n uiItem = cbSet;\r\n eventID = eventSet;\r\n }\r\n if (uiItem !== null) {\r\n Register(uiItem.checked, eventID.toString());\r\n }\r\n // TODO remove or add the event into the gRegisteredEvents array\r\n }\r\n catch (e) {\r\n JSLogIt(\"EventClick catch:\" + e);\r\n }\r\n }", "handleToggleClick() {\n this.buttonClicked = !this.buttonClicked; //set to true if false, false if true.\n this.cssClass = this.buttonClicked ? 'slds-button slds-button_outline-brand' : 'slds-button slds-button_neutral';\n this.iconName = this.buttonClicked ? 'utility:check' : '';\n }", "function handleCheckBox(checkbox) {\n switch (checkbox) {\n case \"cbAdmin\":\n setCheckedTypeAdmin(!checkedTypeAdmin);\n\n break;\n case \"cbAttendance\":\n setCheckedTypeAttendance(!checkedTypeAttendance);\n break;\n\n case \"cbStatus\":\n setActive(!active);\n break;\n\n default:\n break;\n }\n }", "function handleCheckBox(checkbox) {\n switch (checkbox) {\n case \"cbAdmin\":\n setCheckedTypeAdmin(!checkedTypeAdmin);\n break;\n\n case \"cbAttendance\":\n setCheckedTypeAttendance(!checkedTypeAttendance);\n break;\n\n default:\n break;\n }\n }", "function toggleChecked() {\n\t\t\tvm.bind.checked = !vm.bind.checked;\n\t\t}", "function onCheckboxClicked(checkbox) {\n let visual = jQuery.grep(LayoutShowcaseState.layoutVisuals, function (visual) { return visual.name === checkbox.value })[0];\n visual.checked = $(checkbox).is(':checked');\n renderVisuals();\n}", "function fCheckBox(e)\n\t{\n\t\tvar id = e.target.id;\n\t\tvar checked = document.getElementById(id).checked;\n\t\tif (checked == true)\n\t\t{\n\t\t\t// item was checked. save new site assignment for this user\n\t\t\taddMarkerCluster(id);\n\t\t\t//alert(\"Checkbox #id=\"+id+\" was clicked and checked.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// item was unchecked. remove this site assignment for this user\n\t\t\tmarkerClusterArr[id].clearMarkers();\n\t\t\t//alert(\"Checkbox #id=\"+id+\" was clicked and unchecked.\");\n\t\t}\n\t}", "_toggleChecked(isChecked) {\n if (this.disabled) return\n\n this.checked = !isChecked\n this._updateTextFieldsStyle()\n }", "handleCheck() {\n this.checked = !this.checked;\n }", "function checkClicked() {\n \n}", "function checkboxClickedFun() {\n\t\tconsole.log('checkboxClicked');\n\t\tlet checkboxes = document.getElementsByClassName('getCheckBox');\n\t\tlet resetBtn = document.getElementById('resetBtnStyle');\n\n\t\tfor (let i = 0; i < checkboxes.length; i++) {\n\t\t\tif (checkboxes[i].checked) {\n\t\t\t\tresetBtn.disabled = false;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tresetBtn.disabled = true;\n\t\t\t}\n\t\t}\n\t}", "toggle() {\n this.checked = !this.checked;\n this._onChange(this.checked);\n }", "function testCheckboxClick(handler) {\n $('<input type=\"checkbox\">').css({ position: 'absolute', left: '-1000px', top: '-1000px' }).appendTo('body').on('click', handler).trigger('click').remove();\n }", "function selectButtonOnClick(ev)\n{\n\t//console.log(\"selectButtonOnClick(\", ev, \")\");\n\tstopPointTable.toggleCheckBoxVisibility();\n}", "handleClick( event ){ }", "check(e) {\n // let checkbox = e.target;\n this.createCookies();\n }", "function onCheckboxClick( input ) {\n var assignmentTaskId = parseInt($(input).attr('data-assignment-task'));\n var studentId = parseInt($(input).attr('data-student'));\n\n var checked = false;\n if( $(input).is(':checked') )\n checked = true;\n\n socket.emit(\"studentAssignmentTaskEvent\", {\n \"studentId\": studentId,\n \"assignmentTaskId\": assignmentTaskId,\n \"eventType\": \"finishedTask\",\n \"name\": assignmentTaskId,\n \"data\": checked\n });\n\n if($(\"input[type='checkbox']:checked\").length == $(\"input[type='checkbox']\").length ) {\n $(\"#assignmentCompleteId\").removeClass('uk-hidden');\n }\n else {\n $(\"#assignmentCompleteId\").addClass('uk-hidden');\n }\n}", "checkToggle(){\n \n\n //asing checkbox value to a internal prop\n this.state.checked = document.getElementById(\"cbox\" + this.state.id).checked\n \n if (typeof this.state.callbackCheck == 'function') {\n \n //callbak\n this.state.callbackCheck(this.state.id,this.state.checked)\n\n\n } else {\n console.log(\"no set check callback\")\n }\n //redundant\n // \n // cbox.checked =this.state.checked;\n\n }", "function _coordinatesCheckboxClicked(elem) {\n $('#explicitCoordinatesDiv').toggle(elem.checked);\n }", "function checkItems() {\n\n $('div').on('click', 'button.shopping-item-toggle', function (event) {\n\n console.log('clicked on a toggle button');\n\n event.stopPropagation();\n\n $(this).closest('li').children('span').toggleClass('shopping-item__checked');\n\n });\n}", "_onInputClick(event) {\n // We have to stop propagation for click events on the visual hidden input element.\n // By default, when a user clicks on a label element, a generated click event will be\n // dispatched on the associated input element. Since we are using a label element as our\n // root container, the click event on the `checkbox` will be executed twice.\n // The real click event will bubble up, and the generated click event also tries to bubble up.\n // This will lead to multiple click events.\n // Preventing bubbling for the second event will solve that issue.\n event.stopPropagation();\n // If resetIndeterminate is false, and the current state is indeterminate, do nothing on click\n if (!this.disabled && this._clickAction !== 'noop') {\n // When user manually click on the checkbox, `indeterminate` is set to false.\n if (this.indeterminate && this._clickAction !== 'check') {\n Promise.resolve().then(() => {\n this._indeterminate = false;\n this.indeterminateChange.emit(this._indeterminate);\n });\n }\n this.toggle();\n this._transitionCheckState(this._checked ? 1 /* Checked */ : 2 /* Unchecked */);\n // Emit our custom change event if the native input emitted one.\n // It is important to only emit it, if the native input triggered one, because\n // we don't want to trigger a change event, when the `checked` variable changes for example.\n this._emitChangeEvent();\n }\n else if (!this.disabled && this._clickAction === 'noop') {\n // Reset native input when clicked with noop. The native checkbox becomes checked after\n // click, reset it to be align with `checked` value of `mat-checkbox`.\n this._inputElement.nativeElement.checked = this.checked;\n this._inputElement.nativeElement.indeterminate = this.indeterminate;\n }\n }", "'click .toggle-checked'() {\n // Set the checked property to the opposite of its current value\n Meteor.call('tasks.setChecked', this._id, !this.checked);\n }", "toggle() {\n this.checked = !this.checked;\n }", "function listenToCheckbox() {\n $('input[type=\"checkbox\"].quizMulti').on('change', (e) => {\n let type = 'mc'; // set type to 'mc' (multiple choice)\n if (!$(e.currentTarget).prop('checked')) {\n // If the .quizMulti is checked, set type to 'sa' (single answer)\n type = 'sa';\n }\n // Populate and call the change confirmation modal\n popChangeConfModal(type, e.currentTarget);\n });\n}", "function toggleCheck(mail, event) {\n if (event) {\n event.stopPropagation();\n }\n\n var idx = $scope.checked.indexOf(mail);\n\n if (idx > -1) {\n $scope.checked.splice(idx, 1);\n } else {\n $scope.checked.push(mail);\n }\n }", "function onClickCheckbox(index) {\n const checked = beverages[index].Checked;\n beverages[index].Checked = !checked;\n calculateTotalPrice();\n}", "function testCheckboxClick(handler) {\n var input = document.createElement('input');\n $(input).attr('type', 'checkbox').css({ position: 'absolute', left: '-1000px', top: '-1000px' }).appendTo('body').on('click', handler).trigger('click').remove();\n }", "function testCheckboxClick(handler) {\n var input = document.createElement('input');\n $(input).attr('type', 'checkbox').css({ position: 'absolute', left: '-1000px', top: '-1000px' }).appendTo('body').on('click', handler).trigger('click').remove();\n }", "function testCheckboxClick(handler) {\n var input = document.createElement('input');\n $(input).attr('type', 'checkbox').css({ position: 'absolute', left: '-1000px', top: '-1000px' }).appendTo('body').on('click', handler).trigger('click').remove();\n }", "function update_row_click_events() {\n\t$(\".clickable_row\").each(function(){\n\t\t$(this).click(function(){\n\t\t\t$(this).find(\"input\").prop(\"checked\", $(this).find(\"input\").prop(\"checked\") ? false : true);\n\t\t});\n\t});\n}", "function HandleCheckBox(tx) {\n\n CellData.ComponentType = \"checkbox\";\n CellData.ComponentSaveMode = \"bool\"; // puo salvare true/false o 1/0 bit\n CellData.ComboSelectedValue = '';\n CellData.ComboSelectedText = '';\n\n //if(SelectedCell.hasClass('checkbox-save-bit') \n // CellData.ComponentSaveMode = \"bit\";\n\n EECLog('HandleCheckBox firex');\n \n EECLog($(tx).attr('class'));\n\n $(tx).on('click',function (e) {\n\n alert('clicked');\n //var nval = $(this).attr('checked') == 'checked';\n //e.preventDefault();\n //var data = nval;\n //CellValue = data;\n //CellData.newvalue = CellValue;\n //ApplyLocalChanges(CellData); //<-- function locale specifica della tabella se deve fare dei calcoli (es calcolare l'importo se cambia prezzo o qta) \n //LiveUpdate(CellData); // <-- qui invia le modifiche al server db\n //ClickRaised = false;\n });\n\n $(tx).on('focus', function () {\n $(this).select();\n });\n\n\n //$(tx).on('blur', function () {\n // EECLog('blur on checkbox');\n // SelectedCell.text(CellValue);\n // // $(this).remove(); // destroy itself\n \n //})\n return tx;\n\n}", "_triggerEvents(event) {\n var target = $(event.target);\n\n if (target.is(':checked')) {\n target.trigger('check.zf.trigger');\n } else {\n target.trigger('uncheck.zf.trigger');\n }\n }", "covidPositiveToggle(e) {\n this.setState({\n covidPositive: e.target.checked\n });\n }", "checkboxChanged() {\n this.setState({ isChecked: !this.state.isChecked });\n this.props.handleTogglePlaylistCheckbox(this.props.playlistID);\n }", "function newCheckBoxChange(evt) {\n if(sessionClicked) {\n myLoadHandler();\n } else {\n var event = new Event('change');\n // Dispatch the change event\n document.getElementById('files').dispatchEvent(event);\n }\n }", "function addCheckBoxListener(){\n\n $(\"input:checkbox\").on('click', function() {\n\n var $box = $(this);\n if ($box.is(\":checked\") ) {\n\n var group = \"input:checkbox[name='\" + $box.attr(\"name\") + \"']\";\n\n if($box.attr(\"name\") != 'topping'){\n $(group).prop(\"checked\", false);\n }\n $box.prop(\"checked\", true);\n \n } else {\n $box.prop(\"checked\", false);\n }\n updatePrice();\n });\n\n}", "_onInputClick(event) {\n // We have to stop propagation for click events on the visual hidden input element.\n // By default, when a user clicks on a label element, a generated click event will be\n // dispatched on the associated input element. Since we are using a label element as our\n // root container, the click event on the `slide-toggle` will be executed twice.\n // The real click event will bubble up, and the generated click event also tries to bubble up.\n // This will lead to multiple click events.\n // Preventing bubbling for the second event will solve that issue.\n event.stopPropagation();\n }", "function toggleStatus(event) {\n var checked = event.target.checked;\n\n if (checked) {\n status = \"Yes\";\n } else {\n status = \"No\";\n }\n toggleSpan.textContent = status;\n}", "function addListenerCheckbox(){\n\tlet checkbox = document.querySelectorAll('.input-checkbox');\n\tfor (var i = 0; i < checkbox.length; i++) {\n\t\tcheckbox[i].addEventListener('click', function() {\n\t\t\tthis.parentElement.nextElementSibling.classList.toggle('linethrough')\n\t\t})\n\t}\n}", "function addCheckboxEvent() {\n $(\"input[type=checkbox]\").on(\"click\", function (event) {\n display.innerText =\"\";\n if (event.target.checked) {\n checkedSet.add(event.target.value);\n printChecked();\n } else {\n checkedSet.delete(event.target.value);\n printChecked();\n }\n });\n}", "onClick(event) {\n if (event.button !== 0)\n return;\n\n this.dispatchEvent(new CustomEvent('toggle', {\n detail: !this.on,\n }));\n }", "function clickCheckBox() {\n\t\"use strict\";\n\tvar img = $(\".readme div\");\n\tvar checkBox = $(\".readme input\");\n\tif(img.hasClass(\"checked\")){\n\t\timg.removeClass(\"checked\");\n\t\tcheckBox.attr(\"checked\", false);\n\t} else {\n\t\timg.addClass(\"checked\");\n\t\tcheckBox.attr(\"checked\", true);\n\t}\n}", "setEvents() {\n this.$togglers.on('click', this.toggle.bind(this));\n }", "function handleToggleClick(e) {\n \tif ( this.checked ) {\n \tconsole.warn( \"Change input 'type' to: Text\");\n \tpassword.type = \"text\";\n \t} else {\n \tconsole.warn( \"Change input 'type' to: Password\");\n \tpassword.type = \"password\";\n \t}\n \t}", "onToggle() {\r\n this.toggle = !this.toggle;\r\n }", "function toggle() {\n setChecked((checked)=>!checked)\n }", "function clickHandler(event) {\n\tindexChangeSections(event);\n\ttabChangeSections(event);\n}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs.\n// This approach works across all browsers, whereas `change` does not fire\n// until `blur` in IE8.\nvar nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type==='radio');}", "handleClick() {}", "function toggleTickAllRows(e){\n e.preventDefault();\n var status = this.checked;\n console.log(status);\n\n $(\".checkbox input\").each(function(){\n this.checked = status;\n });\n }", "function testCheckboxClick(handler) {\n $('<input type=\"checkbox\">')\n .css({ position: 'absolute', left: '-1000px', top: '-1000px' })\n .appendTo('body')\n .on('click', handler)\n .trigger('click')\n .remove();\n}", "function checked(event) {\n\tif (event.target.tagName === \"Li\") {\n\t\t\tevent.target.classList.toggle(\"done\");\n\t}\n}", "click(e) {\n\n // type==custom a hack for version_select type\n if (this.type == 'button' || this.type == 'custom') {\n var url = '/api/parameters/' + this.props.p.id + '/event';\n var eventData = {'type': 'click'};\n fetch(url, {\n method: 'post',\n credentials: 'include',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'X-CSRFToken': csrfToken\n },\n body: JSON.stringify(eventData)\n }).then(response => {\n if (!response.ok) {\n store.dispatch(wfModuleStatusAction(this.props.wf_module_id, 'error', response.statusText))\n } \n });\n }\n\n if (this.type == 'checkbox') {\n this.paramChanged(e.target.checked)\n }\n }", "function toggleCheckboxDisplay() {\n\t\t// console.log('toggle checkboxes called');\n\t\tvar checkboxes = document.querySelectorAll('.accordion-header input[type=\"checkbox\"]');\n\t\tvar block_menu = document.querySelector('#block_menu');\n\t\tvar display;\n\t\tblock_menu.classList.toggle(\"settings\");\n\t\tif (closed) {\n\t\t\tclosed = false;\n\t\t\tdisplay = 'inline';\n\t\t\tsettingsLink.innerHTML = 'Save';\n\t\t} else {\n\t\t\t//save was clicked\n\t\t\tclosed = true;\n\t\t\tdisplay = 'none'\n\t\t\tsettingsLink.innerHTML = 'Show/Hide blocks';\n\t\t\t//save the settings\n\t\t\tsaveSettings();\n\t\t}\n\t\t[].forEach.call(checkboxes, function (el) {\n\t\t\tel.style.display = display;\n\t\t});\n\t}", "function checkBoxToggle(chkBox)\n{\n\t//kony.print(JSON.stringify(chkBox));\n\t//frmProfile.chkBoxPushSubs[\"selectedKeys\"]=subs;\n\tswitch(chkBox[\"id\"])\n\t{\n\t\tcase \"chkBoxPushSubs\":\n\t\t\tif(audiencePushSubs)\n\t\t\t\tfrmProfile.chkBoxPushSubs.selectedKeys=[\"1\"];\n\t\t\telse\n\t\t\t\tfrmProfile.chkBoxPushSubs.selectedKeys=[];\n\t\t\tbreak;\n\t\tcase \"chkBoxSmsSubs\":\n\t\t\tif(audienceSmsSubs)\n\t\t\t\tfrmProfile.chkBoxSmsSubs.selectedKeys=[\"1\"];\n\t\t\telse\n\t\t\t\tfrmProfile.chkBoxSmsSubs.selectedKeys=[];\n\t\t\tbreak;\n\t\tcase \"chkBoxEmailSubs\":\n\t\t\tif(audienceEmailSubs)\n\t\t\t\tfrmProfile.chkBoxEmailSubs.selectedKeys=[\"1\"];\n\t\t\telse\n\t\t\t\tfrmProfile.chkBoxEmailSubs.selectedKeys=[];\n\t}\n}", "function checkboxClick(element, callbackcheck){\n element.checked = true;\n setTimeout(callbackcheck, 200);\n}", "function handleCheckboxClick(e, highlightClass) {\n\n // if e is an input checkbox, then parentNode is a list element, its and parentNode is an\n // unordered list. Getting all of the tags by \"input\" will therefore return all of the related\n // inputs in this respective list\n var inputs = e.parentNode.parentNode.getElementsByTagName(\"input\");\n\n // The following block handles the checkbox lists that contain \"Any [items].\" If the user\n // selects anything other than \"Any [item]\", then \"Any...\" must be deselected. Otherwise,\n // if the user selects \"Any...\" then all other items currently checked must be deselected. In\n // each group of checkboxes, the \"Any...\" option is represented with an empty string value (\"\").\n\n if (e.value == \"\") { // If the user clicked the \"Any...\" checkbox\n for (var j = 0; j < inputs.length; j++) { // loop through all of this list's checkboxes\n if (inputs[j].value != \"\" && inputs[j].checked) { // if any item (other than \"Any...\") is checked\n inputs[j].checked = \"\"; // uncheck it and\n inputs[j].parentNode.className = \"\"; // unhighlight it\n }\n }\n } else { // Otherwise, the user clicked another checkbox\n for (var i = 0; i < inputs.length; i++) { // loop through this list's checkboxes\n if (inputs[i].value == \"\" && inputs[i].checked) { // find the \"Any...\" checkbox\n inputs[i].checked = \"\"; // uncheck it\n inputs[i].parentNode.className = \"\"; // unhighlight it\n }\n }\n }\n\n // Finally, perform simple highlighting\n if (!e.checked)\n e.parentNode.className = \"\";\n else\n e.parentNode.className = highlightClass;\n}", "_onLabelClick(e) {\n if (this.disabled) return;\n if (e.target.nodeName === \"A\") {\n // If click on link within label, navigate\n return;\n }\n\n this.model = !this.model;\n this._emit(\"model-change\", {\n value: this.model,\n });\n // prevent click checkbox within <a></a> triggering navigation\n e.preventDefault();\n }", "_handleTargetTap(e) {\n let checkbox = Polymer.dom(e.target).querySelector('input');\n if (checkbox) {\n checkbox.click();\n } else {\n // The target is the checkbox itself.\n checkbox = Polymer.dom(e).rootTarget;\n }\n\n if (checkbox.name === 'number') {\n this.showNumber = checkbox.checked;\n return;\n }\n\n this.set('displayedColumns',\n this._updateDisplayedColumns(\n this.displayedColumns, checkbox.name, checkbox.checked));\n }", "function toggleCheck(event, name) {\n event.preventDefault();\n var trackNode = document.getElementsByName(name)[0];\n var checked = trackNode.checked;\n trackNode.checked = !checked;\n }", "function toggleTaskStatus(e) {\n var target = e.target;\n target.classList.toggle(\"checked\");\n}", "function observable_link_clicked(observable_id) {\n $(\"#frm-filter\").append('<input type=\"checkbox\" name=\"observable_' + observable_id + '\" CHECKED>').submit();\n}", "bindCheckBtnHandler(checkButton) {\n checkButton.addEventListener(\"click\", (e) => {\n this.onClickCheckBtn(e);\n });\n }", "function checkItem ()\n{\n\t// Check Item.\n $(\".shopping-list\").on(\"click\", \".shopping-item-toggle\", function (e) \n {\n \tconsole.log('Check');\n e.preventDefault();\n $(this).closest('li').find(\".shopping-item\").toggleClass(\"shopping-item__checked\");\n });\n}", "handleCheckbox(elem) {\n\n this.filtering[elem.id] = elem.checked;\n\n this.dashboard.updateChart()\n }" ]
[ "0.75247204", "0.73084927", "0.6968265", "0.68382", "0.68351954", "0.67595583", "0.67595583", "0.6717607", "0.6715247", "0.66525775", "0.66276556", "0.6585133", "0.6577546", "0.6456626", "0.644153", "0.6405237", "0.6397804", "0.6395283", "0.6376296", "0.63761735", "0.63729376", "0.6362978", "0.6328853", "0.63274795", "0.63218707", "0.63171965", "0.63159007", "0.62924993", "0.62764776", "0.6275706", "0.62616897", "0.62434256", "0.62313807", "0.6221372", "0.6217294", "0.6198811", "0.61772335", "0.61574745", "0.6157111", "0.6142747", "0.6139366", "0.6135587", "0.6131316", "0.6130288", "0.6102806", "0.6087452", "0.608534", "0.6074507", "0.6072243", "0.6070939", "0.6066535", "0.6053799", "0.6053672", "0.6053672", "0.6053672", "0.6051858", "0.6044228", "0.6040402", "0.6031795", "0.60129887", "0.6012541", "0.6011913", "0.5994429", "0.59939307", "0.597028", "0.59549373", "0.59466344", "0.59267473", "0.59202564", "0.59165406", "0.5912596", "0.5909898", "0.5901232", "0.59010386", "0.59010386", "0.59010386", "0.59010386", "0.59010386", "0.59010386", "0.59010386", "0.59010386", "0.59010386", "0.59010386", "0.59010386", "0.59008086", "0.588916", "0.5881779", "0.58812237", "0.5865407", "0.5860286", "0.585316", "0.5845797", "0.5839985", "0.58330333", "0.582505", "0.5817244", "0.58124787", "0.58072335", "0.5804742", "0.5801011", "0.58007795" ]
0.0
-1
Updates active rows on changes.
_updateActiveRows() { if (!this.changeMultiple) { this.activeRows = this.$element.find('tbody tr.active'); this.$element.trigger('changed.zf.table.checkbox', [this.activeRows]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "commitChangedRows() {\n var d = new latte.DataSet();\n var old = new latte.DataSet();\n var indexes = [];\n this.endCellEdit();\n // Add dataset columns\n d.columns.addCollection(this.columns);\n old.columns.addCollection(this.columns);\n // Collect new row indexes\n this.table.find('tr.changeable-row').each(function () {\n var tr = $(this);\n // push index into array\n indexes.push(tr.data('rowIndex'));\n // Remove insertable-row class\n tr.removeClass('changeable-row').addClass('pendent pendent-update');\n });\n for (var i = 0; i < indexes.length; i++) {\n var rowIndex = indexes[i];\n d.rows.add(this.rows.item(rowIndex));\n // Form old row\n var row = new latte.DataSetRow();\n old.rows.add(row);\n for (var j = 0; j < old.columns.count; j++) {\n var columnIndex = j;\n var value = this.originalValue(columnIndex, rowIndex);\n if (latte._undef(value))\n if (this.hasValueAt(columnIndex, rowIndex))\n value = this.getValueAt(columnIndex, rowIndex);\n else\n null;\n row.setValueAt(columnIndex, value);\n }\n }\n // Notify added rows\n this.onRowsChanged(d, old);\n }", "function updateActiveState() {\n const active = tableEditor.cursorIsInTable();\n if (active) {\n editor.setOption(\"extraKeys\", keyMap);\n }\n else {\n editor.setOption(\"extraKeys\", null);\n tableEditor.resetSmartCursor();\n }\n }", "function updateActiveState() {\n const active = tableEditor.cursorIsInTable();\n if (active) {\n editor.setOption(\"extraKeys\", keyMap);\n }\n else {\n editor.setOption(\"extraKeys\", null);\n tableEditor.resetSmartCursor();\n }\n }", "update() {\n if(this.options.onUpdate && typeof this.options.onUpdate === 'function')\n this.options.onUpdate.call();\n\n this.rows = [];\n this._updateGridRows();\n this._updatePositions();\n\n if(this.options.onUpdated && typeof this.options.onUpdated === 'function')\n this.options.onUpdated.call();\n }", "AcceptChanges() {\n this.State = tp.DataRowState.Unchanged;\n }", "setPreviousRowActive() {\n this._setActiveCellByDelta(-1, 0);\n }", "_observeRows() {\r\n const that = this;\r\n\r\n that.rows = new Smart.ObservableArray(that.rows);\r\n\r\n that.rows.notify(function (changes) {\r\n if (!that.rows.canNotify ||\r\n changes.path ||\r\n !that.dataSource) {\r\n return;\r\n }\r\n\r\n that.rows.canNotify = false;\r\n\r\n const changeType = changes.action;\r\n\r\n that.dataSource.canNotify = false;\r\n\r\n switch (changeType) {\r\n case 'add':\r\n that.dataSource.add(that.rows[changes.index]);\r\n break;\r\n case 'update':\r\n that.dataSource.update(changes.index, that.rows[changes.index]);\r\n break;\r\n case 'remove':\r\n that.dataSource.removeAt(changes.index);\r\n break;\r\n }\r\n\r\n that.dataSource.canNotify = true;\r\n that.rows.canNotify = true;\r\n that._fullRefresh();\r\n });\r\n }", "AcceptChanges() {\n for (var i = 0, ln = this.Rows.length; i < ln; i++) {\n this.Rows[i].AcceptChanges();\n }\n this.Deleted.length = 0;\n }", "setNextRowActive() {\n this._activeRowIndex < 0 ? this.setFirstCellActive() : this._setActiveCellByDelta(1, 0);\n }", "applyChanges() {\n for (let i = 0; i < this.statusList.length; i++) {\n this.board.updateCell(...this.statusList[i]);\n }\n\n this.statusList = [];\n }", "function updateSelectedRows() {\n var selectedList = [];\n if (grid.api) {\n var selectedRows = component.getSelection();\n _.each(selectedRows, function (row) {\n selectedList.push(row[component.constants.ROW_IDENTIFIER]);\n });\n }\n component.onSelectRows(selectedList);\n }", "AcceptChanges() {\n for (var i = 0, ln = this.Tables.length; i < ln; i++) {\n this.Tables[i].AcceptChanges();\n }\n }", "_updateActiveFlag() {\n // Calculate active flag.\n let newActive = this.isActive();\n if (this._active !== newActive) {\n if (newActive) {\n this._setActiveFlag();\n } else {\n this._unsetActiveFlag();\n }\n\n let children = this._children.get();\n if (children) {\n let m = children.length;\n if (m > 0) {\n for (let i = 0; i < m; i++) {\n children[i]._updateActiveFlag();\n }\n }\n }\n\n // Run this after all _children because we'd like to see (de)activating a branch as an 'atomic' operation.\n if (newActive) {\n this.emit('active');\n } else {\n this.emit('inactive');\n }\n }\n }", "reloadCurrentRow() {\n loadAllRows().then((response) => this.receiveData(this.currentRowIndex, response));\n }", "commitChanges({ added, changed, deleted }) {\n\t\tconsole.log(\"commitChanges\");\n\t\tlet { rows } = this.state;\n\t\tif (added) {\n\t\t\tconst startingAddedId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 0;\n\t\t\trows = [\n\t\t\t\t...rows,\n\t\t\t\t...added.map((row, index) => ({\n\t\t\t\t\tid: startingAddedId + index,\n\t\t\t\t\t...row,\n\t\t\t\t})),\n\t\t\t];\n\t\t}\n\t\tif (changed) {\n\t\t\trows = rows.map(row => (changed[row.id] ? { ...row, ...changed[row.id] } : row));\n\t\t}\n\t\tif (deleted) {\n\t\t\tconst deletedSet = new Set(deleted);\n\t\t\trows = rows.filter(row => !deletedSet.has(row.id));\n\t\t}\n\t\tthis.setState({ rows });\n\t}", "confirmRowsChanged() {\n this.table.find('tr.pendent-update').removeClass('pendent pendent-update');\n }", "function allToActive() {\r\n\t// If selectAllItem is not empty\r\n\tif (selectAllItem.length > 0){\r\n\t\tfor (var i = 0; i < selectAllItem.length; i++) {\r\n\t\t\tvar item = findItem(listAllItem, selectAllItem[i]);\r\n\t\t\tif (typeof item != 'undefined') {\r\n\t\t\t\t//listAllItem.splice(item, 1);\r\n\t\t\t\tlistActiveItem.push(item);\r\n\t\t\t}\r\n\t\r\n\t\t}\r\n\t\tselectAllItem = [];\r\n\t\tselectActiveItem = [];\r\n\t\tdrawDatatable(tableActiveItem, listActiveItem, 1);\r\n\t\tdrawDatatable(tableAllItem, listAllItem, null);\r\n\t\tisChange = true;\r\n\t}\r\n}", "function updateCurrentActiveIndex() {\n\tchrome.tabs.query({\n\t\thighlighted: true\n\t}, function (tabs) {\n\t\tfor (var index = 0; index < tabs.length; index++) {\n\t\t\tvar tab = tabs[index];\n\t\t\tvar allTabs = user.tabsSortedByWindow[tab.windowId];\n\t\t\tvar previousActiveIndex = user.activeTabIndex[tab.windowId];\n\t\t\tvar timeStamp = getTimeStamp();\n\t\t\tconsole.log(tab)\n\t\t\tif (previousActiveIndex !== tab.index && previousActiveIndex !== null && allTabs[previousActiveIndex]) {\n\t\t\t\tif (user.loggedIn) {\n\t\t\t\t\tdeactivateTimeTab(allTabs[previousActiveIndex].databaseTabID);\n\t\t\t\t}\n\t\t\t\tallTabs[previousActiveIndex].highlighted = false;\n\t\t\t\tallTabs[previousActiveIndex].timeOfDeactivation = timeStamp;\n\t\t\t}\n\t\t\tuser.activeTabIndex[tab.windowId] = tab.index;\n\t\t\tallTabs[tab.index].highlighted = true;\n\t\t}\n\t})\n}", "function updateRows(e) {\n setRows(parseInt(e.currentTarget.value))\n }", "function rowsChanged(rows) {\n lastRows = rows;\n ctrl.rowCount = rows.length;\n\n layout();\n }", "onRowsChanged(dataset) {\n super.onRowsChanged(dataset);\n for (var i = 0; i < dataset.rows.count; i++) {\n var row = dataset.rows.item(i);\n var record = row.tag;\n this.applyValues(row, record);\n record.update(function () { latte.sprintf(\"Updated: \" + record.recordId); });\n }\n this.confirmRowsChanged();\n }", "updateActiveAddons() {\n logger.debug(\"Updating add-on states\");\n for (let [, addon] of this.addonDB) {\n let newActive = (addon.visible && !addon.disabled && !addon.pendingUninstall);\n if (newActive != addon.active) {\n addon.active = newActive;\n this.saveChanges();\n }\n }\n\n Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS, false);\n }", "onModelStateChanged() {\n if (this.isAttached) {\n this._activeIndex = 0;\n this.update();\n }\n }", "function onSelectRow() {\n // Update selected rows\n if (component.initialized) {\n updateSelectedRows();\n }\n }", "update() {\n const editable_row = BEM.getChildBEMNodes(this.node, BLOCK_DATAGRID, ELEMENT_ROW, MODIFIER_EDIT);\n const exp = Boolean(editable_row.length);\n BEM.toggleModifier(this.node, MODIFIER_EDIT, exp);\n }", "set allowChangeRows(value) {\n this._allowChangeRows = value;\n }", "function activeToAll() {\r\n\t// If selectActiveItem is not empty\r\n\tif (selectActiveItem.length > 0){\r\n\t\tfor (var i = 0; i < selectActiveItem.length; i++) {\r\n\t\t\tvar item = findItem(listActiveItem, selectActiveItem[i]);\r\n\t\t\tif (typeof item != 'undefined') {\r\n\t\t\t\t//listActiveItem.splice(item, 1);\r\n\t\t\t\tlistAllItem.push(item);\r\n\t\t\t}\r\n\t\r\n\t\t}\r\n\t\tselectAllItem = [];\r\n\t\tselectActiveItem = [];\r\n\t\tdrawDatatable(tableActiveItem, listActiveItem, 1);\r\n\t\tdrawDatatable(tableAllItem, listAllItem, null);\r\n\t\tisChange = true;\r\n\t}\r\n}", "reload() {\n this._setRowKeys();\n }", "function activate_row(row, cell) {\n if(row.className.contains(\"active\")) {\n deactivate_single_row(row);\n return;\n }\n\n // let's make it editable \n deactivate_active_rows(); // First, make other rows inactive\n activate_row_helper(row.cells, cell);\n\n cell.firstChild.focus(); // Focus the selected cell input\n row.className = row.className + \" active\"; // Adds the active component\n}", "setLastCellActive() {\n const lastRowIndex = this._rows.length - 1;\n const lastRow = this._getRowsArray()[lastRowIndex];\n this._setActiveCellByIndex(lastRowIndex, lastRow.cells.length - 1);\n }", "Update() {\n\n this.fRows = this.GetWorkingRows();\n\n var i, ln, Pos = this.Position;\n this.fPosition = -1;\n\n this.Position = 0;\n\n // inform listeners\n if (!this.BindingSuspended && !this.fPropagating) {\n this.fPropagating = true;\n try {\n for (i = 0, ln = this.fListeners.length; i < ln; i++) {\n this.fListeners[i].DataSourceUpdated();\n }\n\n this.OnUpdated();\n } finally {\n this.fPropagating = false;\n }\n }\n\n if (Pos >= 0)\n this.Position = Pos;\n }", "function updateTableView() {\n status_array = [\n \"active\",\n \"private_active\",\n \"inactive\",\n \"private_inactive\",\n \"finished\",\n \"private_finished\",\n \"archived\"\n ]\n\n for (var i = 0; i < status_array.length; i++) {\n status = status_array[i]\n\n var tableRef = $(\"#projectsTable-\"+status).DataTable();\n var rows = tableRef\n .rows()\n .remove()\n .draw();\n getProjects(status)\n }\n\n console.log('updated table view')\n}", "function setActive(table, col, row) {\n\ttable.rows[row].cells[col].className += \" activeCell\";\n}", "get allowChangeRows() {\n return this._allowChangeRows;\n }", "function addActiveAttributeToAllRows()\n {\n $('#ContractTable tr').each(function(i, row)\n {\n /** First row is our headers. */\n if(i!==0)\n {\n /** Add on click function. */\n $(row).click(function ()\n {\n /** If we click an already selected row, we can des-select it. */\n if($(row).css(\"background-color\") === \"rgb(255, 0, 0)\")\n {\n $('#editContractButton').prop('disabled', true);\n $('#editContractButton').css('background-color', '#cacaca');\n $('#deleteContractButton').prop('disabled', true);\n $('#deleteContractButton').css('background-color', '#cacaca');\n $(row).css('background-color', 'rgb(0, 0, 0)');\n /** We have to set the correct color back to the row, since colors differ every other row. */\n if(i%2!==0)\n {\n $(row).children().css({'background-color': '#dadada', 'color': '#332c28'}).find(\"a\").css({'color': 'blue'});\n }\n else\n {\n $(row).children().css({'background-color': '#cecece', 'color': '#332c28'}).find(\"a\").css({'color': 'blue'});\n }\n }\n /** The row selected wasn't already selected. */\n else\n {\n /** De-select any other rows that were selected. */\n checkForAlreadySelectedContract();\n var $tds = $(row).find(\"td\");\n $.each($tds, function()\n {\n rowData.push($(this).text());\n });\n /** Allow for edit and delete if Admin. */\n $('#editContractButton').prop('disabled', false);\n $('#editContractButton').css('background-color', '#d7451a');\n $('#deleteContractButton').prop('disabled', false);\n $('#deleteContractButton').css('background-color', '#d7451a');\n /** Populate the details/edit/detail modal values. */\n $('#editContractContract').val(rowData[0]);\n $('#editContractCustomer').val(rowData[1]);\n $('#editContractContractMgr').val(rowData[2]);\n $('#contractDetailsCm').val(rowData[2]);\n $('#contractDetailsCustomer').val(rowData[1]);\n $('#contractDetailsContract').val(rowData[0]);\n $('#contractDelete').val(rowData[0]);\n \n /** Update the associated products lists and add the function that allows linking between contracts and products. */\n var items = [];\n $('#associatedProductsEditList').empty();\n $.each(rowData[3].split(',') , function(key, val)\n {\n let length = $('#associatedProductsEditList option').length;\n $('#associatedProductsEditList').append(\"<option id='associatedProductEditOption\"+ length +\"' >\"+val+\"</option>\");\n $('#associatedProductsEditPlaceHolder').append(\"<input style='display: none;' id='associatedProductEdit' name='associatedProducts[\"+length+\"]' value='\"+ val +\"'/>\");\n items.push(\"<a href='#' id = 'associatedProduct-\" + key + \"' onclick=\\\"$(window.localStorage.setItem('tab', '0'), window.localStorage.setItem('productCpn', '\" + val + \"'), \"\n +\"window.localStorage.setItem('productEqpttype', ''), \"\n +\"window.localStorage.setItem('productPlant', ''), \"\n +\"window.localStorage.setItem('productMakeorbuy', ''), \"\n +\"window.localStorage.setItem('productBu', ''), \"\n +\"window.localStorage.setItem('productPortfolio', ''), \"\n +\"window.localStorage.setItem('productPoc', ''), \"\n +\"window.localStorage.setItem('productNewprograms', ''), \"\n +\"window.localStorage.setItem('productEop', ''), \"\n +\"window.localStorage.setItem('productEos', ''), \"\n +\"window.localStorage.setItem('productReplacement', ''), \"\n +\"window.localStorage.setItem('productPage', 1), \"\n +\"window.localStorage.setItem('productNotes', ''), window.location.reload())\\\">\" + val + \"</a>\");\n });\n $('#contractDetailsAssociatedProducts').empty();\n $('#contractDetailsAssociatedProducts').append(items.join(\"\"));\n rowData = [];\n $(row).css('background-color', 'rgb(255, 0, 0)');\n $(row).children().css({'background-color': '#332c28', 'color': 'white'}).find(\"a\").css({'color': '#8fffee'});\n }\n });\n }\n });\n }", "'getRowsModified'() { return sqlite3_changes(this.db); }", "function update() {\n $scope.items.shift();\n $scope.items.push(generateRow());\n $scope.usage1 = setUsage();\n $scope.usage2 = setUsage();\n $scope.usage3 = setUsage();\n $scope.usage4 = setUsage();\n $scope.mapObject.data = mapChanges();\n $timeout(update, updateInterval);\n }", "function adjustRowStatuses() {\n for (var i = 0; i < $scope.rows.length; i++) {\n if ($scope.rows[i].status === 'Not Started') {\n $scope.rows[i].status = 'Next';\n break;\n }\n }\n }", "async makeCurrent() {\n await Period.query()\n .where('active', 1)\n .update({ active: false });\n\n this.active = true;\n this.save();\n }", "function _getActive() { // store once last interaction\n if (DF.thisAction !== DF.lastAction) {\n DF.lastAction = DF.thisAction;\n API.update();\n }\n }", "get activeRowIndex() {\n return this._activeRowIndex;\n }", "updatePosition(){\n\t\tlet activeRowCount = 0;\n\t\tlet tableHeight = 0;\n\t\tfor(let i = 0; i < this.table.length; i++){\n\t\t\tif(this.table.children[i].visible){\n\t\t\t\tactiveRowCount += 1;\n\t\t\t\tthis.table.children[i].y = (this.config.rowHeight * activeRowCount) - this.config.rowHeight;\n\t\t\t}\n\t\t}\n\n\t\tthis.height = (activeRowCount * this.config.rowHeight) - this.config.rowHeight;\n\t}", "updateActiveLink() {\n if (!this._items) {\n return;\n }\n const items = this._items.toArray();\n for (let i = 0; i < items.length; i++) {\n if (items[i].active) {\n this.selectedIndex = i;\n this._changeDetectorRef.markForCheck();\n return;\n }\n }\n // The ink bar should hide itself if no items are active.\n this.selectedIndex = -1;\n this._inkBar.hide();\n }", "suspendChangesTracking() {\n this.crudIgnoreUpdates++;\n }", "function updateCells() {\n\t\t\tconsole.log('Updating cells')\n\t\t\tfor(i = 0; i < maxRow; i++) {\n\t\t\t\tfor(j = 0; j < maxCol; j++) {\n\t\t\t\t\tcellID = j+'_'+i;\n\t\t\t\t\tif(cells[cellID].state != cells[cellID].nextState) { // change in the cell\n\t\t\t\t\t\tconsole.log('Change in cell state detected.')\n\t\t\t\t\t\tcells[cellID].state = cells[cellID].nextState\n\t\t\t\t\t\tcells[cellID].changeCellView()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "async function update_in_active_tabs()\n {\n (await browser.tabs.query({ active: true })).forEach(update_in_tab);\n }", "setPreviousColumnActive() {\n this._setActiveCellByDelta(0, -1);\n }", "async function update_in_active_tabs()\n {\n (await browser.tabs.query({ active: true })).forEach(tab =>\n {\n update_in_tab(tab);\n });\n }", "function updateActiveTab() {\n\t\tvar tabs = document.querySelectorAll(\n\t\t\ttoClassSelector(Class.Tabs.Item) + '[' + HashAttribute + ']'\n\t\t);\n\t\tvar regex = new RegExp('(\\\\s|^)' + Class.Tabs.ItemActive + '(\\\\s|$)');\n\t\tArray.prototype.forEach.call(tabs, function(tab, index) {\n\t\t\tvar link = tab.querySelector('.' + Class.Tabs.Link);\n\t\t\tif (tab.className.match(regex)) {\n\t\t\t\ttab.className = tab.className.replace(regex, ' ');\n\t\t\t\tlink.setAttribute('aria-selected', 'false');\n\t\t\t\tlink.setAttribute('tabindex', '-1');\n\t\t\t}\n\t\t\tif (isTabSelected(tab.getAttribute(HashAttribute), index)) {\n\t\t\t\ttab.className += ' ' + Class.Tabs.ItemActive;\n\t\t\t\tlink.setAttribute('aria-selected', 'true');\n\t\t\t\tlink.setAttribute('tabindex', '0');\n\t\t\t}\n\t\t});\n\t}", "setFirstCellActive() {\n this._setActiveCellByIndex(0, 0);\n }", "setRowId (state, stat = null) {\n state.activeRowId = stat\n }", "function onWentActive() {\n currentStatus = previousStatus;\n editStatusOverlaysAndSendUpdate();\n }", "function handleEndCellEdit(evt) {\n $scope.$apply(updateStatus(evt.targetScope.row[\"entity\"]));\n }", "reloadDataTable() {\n if (this.props.isSmart)\n this.setState({\n table: this.state.table.destroy()\n });\n\n this.findAll();\n }", "suspendChangesTracking() {\n this.crudIgnoreUpdates++;\n }", "function commitCurrentEdit() {\n var item = getDataItem(activeRow);\n var column = columns[activeCell];\n\n if (currentEditor) {\n if (currentEditor.isValueChanged()) {\n var validationResults = currentEditor.validate();\n\n if (validationResults.valid) {\n if (activeRow < getDataLength()) {\n var editCommand = {\n row: activeRow,\n cell: activeCell,\n editor: currentEditor,\n serializedValue: currentEditor.serializeValue(),\n prevSerializedValue: serializedEditorValue,\n execute: function () {\n this.editor.applyValue(item, this.serializedValue);\n updateRow(this.row);\n trigger(self.onCellChange, {\n row: this.row,\n cell: this.cell,\n item: item\n });\n },\n undo: function () {\n this.editor.applyValue(item, this.prevSerializedValue);\n updateRow(this.row);\n trigger(self.onCellChange, {\n row: this.row,\n cell: this.cell,\n item: item\n });\n }\n };\n\n if (options.editCommandHandler) {\n makeActiveCellNormal();\n options.editCommandHandler(item, column, editCommand);\n } else {\n editCommand.execute();\n makeActiveCellNormal();\n }\n\n } else {\n var newItem = {};\n currentEditor.applyValue(newItem, currentEditor.serializeValue());\n makeActiveCellNormal();\n trigger(self.onAddNewRow, {item: newItem, column: column});\n }\n\n // check whether the lock has been re-acquired by event handlers\n return !getEditorLock().isActive();\n } else {\n // Re-add the CSS class to trigger transitions, if any.\n $(activeCellNode).removeClass(\"invalid\");\n $(activeCellNode).width(); // force layout\n $(activeCellNode).addClass(\"invalid\");\n\n trigger(self.onValidationError, {\n editor: currentEditor,\n cellNode: activeCellNode,\n validationResults: validationResults,\n row: activeRow,\n cell: activeCell,\n column: column\n });\n\n currentEditor.focus();\n return false;\n }\n }\n\n makeActiveCellNormal();\n }\n return true;\n }", "function deactivate_active_rows() {\n var table = document.getElementById(\"annotationTable\");\n var rows = table.rows;\n var i;\n\n for(i = 0; i < rows.length; i++) {\n if(rows[i].className.contains(\"active\"))\n deactivate_single_row(rows[i]); \n }\n}", "function updateActiveStatus () {\n\t\tvar elm = $element.find(\"a\")[0];\n\t\t$timeout(function () {\n\t\t\tvar isActive = elm.classList.contains(\"tab-link--isActive\");\n\t\t\telm.setAttribute(\"aria-selected\", isActive);\n\t\t});\n\t}", "function addRowsListeners(arr) {\n let rows = container.querySelectorAll(\".table__row\");\n rows[0].classList.add(\"table__row_selected\");\n for (let row of rows) {\n row.addEventListener(\"click\", handleRowClick);\n }\n // Row-click handler.\n function handleRowClick(event) {\n for (let row of rows) {\n row.classList.remove(\"table__row_selected\");\n }\n event.currentTarget.classList.add(\"table__row_selected\");\n checkActive(arr);\n }\n }", "update() {\n this.dataChanged = true;\n this.persons.all = undefined;\n this.jobTitles.all = undefined;\n this.updateFiltered();\n this.updateTimed();\n }", "function tableUIUpdate() {\n\n var row = currentVideo + 1;\n\n if (document.querySelector('.playing')) {\n document.querySelector('.playing').classList.remove('playing');\n }\n document.querySelector(`tr:nth-child(${row})`).classList.add('playing');\n\n\n }", "updateActiveElement() {\n if (!this.activeElement) {\n return;\n }\n this.activeElement.classList.add(A11yClassNames.ACTIVE);\n }", "OnBatchModified() { this.Trigger(\"BatchModified\", new tp.DataTableEventArgs()); }", "updateItems(op,item){var response=!1;if(\"push\"==op){this.push(\"items\",item);response=!0}else if(\"pop\"==op){response=this.pop(\"items\")}else if(\"splice\"==op){this.splice(\"items\",this.items.length,0,item);response=!0}// force active to reprocess\nconst active=this.active;this.set(\"active\",0);this.set(\"active\",active);this.notifyPath(\"active\");return response}", "__updateRowCount() {\n this.getPane()\n .getRowConfig()\n .setItemCount(this.__lookupTable.getLength());\n this.getPane().fullUpdate();\n }", "deactivateRow() {\n const idx = this.activatedRow()[0].row;\n if (idx >= 0) {\n this.toggleRowActivation(idx);\n }\n }", "function updateAppStatus() {\n record(curAlist.toNumList());\n curAlist = getAdjlist();\n updateAdjlistFrame();\n updatePropFrame();\n}", "function updateUsersTableRow() {\n\tif (activeUser) {\n\n\t\tvar usersTableRow = findUsersTableRow(activeUser.userData.userID);\n\n\t\tif (usersTableRow !== null) {\n\t\t\tusersTableRow[0].cells[0].childNodes[0].innerText = activeUser.userData.lastName;\n\t\t\tusersTableRow[0].cells[1].childNodes[0].innerText = activeUser.userData.firstName;\n\t\t\tusersTableRow[0].cells[2].childNodes[0].innerText = calculateAge(activeUser.userData.birthDate);\n\t\t\tusersTableRow[0].cells[3].childNodes[0].innerText = activeUser.userData.balanceIdx;\n\t\t\tusersTableRow[0].cells[4].childNodes[0].innerText = activeUser.userData.activityIdx;\n\t\t}\n\t}\n}", "function drawActiveGrid() {\n for (let a = 0; a < height; a++) {\n row = canvas.insertRow(a);\n // sets a click event listener and which sets color\n //from the user input\n row.addEventListener(\"click\", e => {\n //function setColor\n var clicked = e.target;\n color.addEventListener(\"change\", e =>\n //function onColorUpdate\n {\n selectedColor = e.target.value;\n }\n );\n clicked.style.backgroundColor = selectedColor;\n });\n for (let b = 0; b < width; b++) {\n cell = row.insertCell(b);\n }\n }\n }", "update() {\n this.$table = $(this._tableSelector);\n\n if (this.$table.length === 0) {\n return;\n //throw new Error(`The log table with selector \"\" does not exists.`);\n }\n\n this.$checkboxes = this.$table.find('input[name=\"ids[]\"]');\n this.$selectAllCheckbox = this.$table.find('input[name=\"select-all-logs\"]');\n this.$selectedRow = null;\n\n this._registerEvents();\n }", "get activeChanged() {\n return this._activeChanged;\n }", "setNextColumnActive() {\n this._activeRowIndex < 0 ? this.setFirstCellActive() : this._setActiveCellByDelta(0, 1);\n }", "function myFunction(param) {\n $('#btnUpdate').prop('disabled', false);\n var table = $(param).closest(\"table\").DataTable().table();\n var row = table.row($(param).parents('tr'));\n var cell = table.cell($(param).parents('td, th'));\n var columnIndex = cell.index().column;\n var inputField =getInputField(param);\n var oldValue = cell.data(); \n var newValue = inputField.val();\n cell.data(newValue);\n if (cell.data() != oldValue) {\n row.nodes().to$().addClass('highlight');\n } \n myCallbackFunction(cell, row, oldValue, newValue);\n }", "commitAddedRows() {\n var d = new latte.DataSet();\n var indexes = [];\n this.endCellEdit();\n // Add dataset columns\n //d.columns.addCollection(this.columns);\n for (var i = 0; i < this.columns.count; i++) {\n d.columns.add(this.columns.item(i));\n }\n // Collect new row indexes\n this.table.find('tr.insertable-row').each(function () {\n var tr = $(this);\n // Remove * symbol\n tr.find('th').text(tr.data('rowIndex') + 1);\n // push index into array\n indexes.push(tr.data('rowIndex'));\n // Remove insertable-row class\n tr.removeClass('insertable-row').addClass('pendent pendent-insert');\n });\n for (var i = 0; i < indexes.length; i++) {\n d.rows.add(this.rows.item(indexes[i]));\n }\n // Notify added rows\n this.onRowsAdded(d);\n }", "@action\n editRow() {\n set(this, 'isEditRow', true);\n }", "function onChanged() {\n let g = getGlobal();\n\n //When the add-in creates the table, it will generate 4 events that we must ignore.\n //We only want to respond to the change events from the user.\n if (g.tableEventCount > 0) {\n g.tableEventCount--;\n return; //count down to throw away events caused by the table creation code\n }\n\n //check if dirty flag was set (flag avoids extra unnecessary ribbon operations)\n if (!g.isTableDirty) {\n g.isTableDirty = true;\n\n //Enable the Refresh and Submit buttons\n setSyncButtonEnabled(true);\n }\n}", "onStoreCommit({\n changes\n }) {\n if (this.showDirty && changes.modified.length) {\n const rows = [];\n changes.modified.forEach(record => {\n const row = this.rowManager.getRowFor(record);\n row && rows.push(row);\n });\n this.rowManager.renderRows(rows);\n }\n }", "function rowUpdate(row, select, checkbox) {\n let originalRole = originalMemberships.find(x => x.id === getID(row.id)).role.toString();\n if (select.value.toString() === originalRole && !checkbox.checked) {\n changedIDs.delete(getID(row.id));\n } else {\n changedIDs.add(getID(row.id));\n }\n\n if (select.value.toString() !== originalRole) {\n row.classList.add(\"table-warning\");\n } else {\n row.classList.remove(\"table-warning\");\n }\n\n if (checkbox.checked) {\n row.classList.add(\"table-danger\");\n } else {\n row.classList.remove(\"table-danger\");\n }\n}", "onRowsChanged(dataset, oldDataset = null) {\n this.rowsChanged.raise(dataset, oldDataset);\n }", "_activeAppChanged(newValue, oldValue) {\n if (typeof oldValue !== typeof undefined && newValue != null) {\n this.hasActive = true;\n } else {\n this.hasActive = false;\n }\n }", "haxactiveElementChanged(el, val) {\n // flag for HAX to not trigger active on changes\n this.alignState();\n this.editMode = val;\n return false;\n }", "saveDirtyRows() {\n const s = this.settings;\n let dataset = s.treeGrid ? s.treeDepth : s.dataset;\n if (this.settings.groupable) {\n dataset = this.originalDataset || dataset;\n }\n if (s.showDirty && !this.settings.source && this.dirtyArray && this.dirtyArray.length) {\n for (let i = 0, l = dataset.length; i < l; i++) {\n if (typeof this.dirtyArray[i] !== 'undefined') {\n const node = s.treeGrid ? dataset[i].node : dataset[i];\n node.tempNodeIndex = i;\n }\n }\n }\n }", "function commitEdits(){\n\t\t\tgrid.Grid.getEditController().commitCurrentEdit();\n\t\t}", "updateRow(row) {\n const id = notifyInfo(\"Update läuft\");\n axios.put(row._links.self.href, row ,{headers: {'Content-Type': 'application/json'}})\n .then(results => {\n console.log(results);\n notifyUpdateSuccess(id, \"Update erfolgreich\");\n this.getTableData(false)\n })\n .catch(error => {\n console.log(error);\n notifyUpdateError(id, \"Update fehlgeschlagen\");\n });\n }", "onRowsRerender() {\n this.scheduleDraw(true);\n }", "changeStatus(params) {\n var index = this.list.map(i => i.id).indexOf(params.id);\n this.list[index].open = params.status;\n ls.updateItem({id : params.id}, {open : params.status});\n this.filterByStatus(this.stats);\n }", "performAction() {\n const oldValue = this.activeId;\n const oldTab = oldValue !== undefined && oldValue !== null ? this.childItems.filter(i => i.newValue === oldValue)[0] : this.items[0];\n\n if (oldTab && this.activeItem) {\n oldTab.deactivate(this.activeItem.index);\n this.activeItem.activate(oldTab.index);\n }\n }", "activeListNode(index) {\n for (let i = 0; i < this.queryItems.length; i++) {\n if (index === i) {\n this.queryItems[i].active = true;\n this.selectedDataIndex = index;\n }\n else {\n this.queryItems[i].active = false;\n }\n }\n }", "function allToInactive() {\r\n\t// If selectAllItem is not empty\r\n\tif (selectAllItem.length > 0){\r\n\t\tfor (var i = 0; i < selectAllItem.length; i++) {\r\n\t\t\tvar item = findItem(listAllItem, selectAllItem[i]);\r\n\t\t\tif (typeof item != 'undefined') {\r\n\t\t\t\t//listAllItem.splice(item, 1);\r\n\t\t\t\tlistInactiveItem.push(item);\r\n\t\t\t}\r\n\t\r\n\t\t}\r\n\t\tselectAllItem = [];\r\n\t\tselectInactiveItem = [];\r\n\t\tdrawDatatable(tableInactiveItem, listInactiveItem, 0);\r\n\t\tdrawDatatable(tableAllItem, listAllItem, null);\r\n\t\tisChange = true;\r\n\t}\r\n}", "function update_row_click_events() {\n\t$(\".clickable_row\").each(function(){\n\t\t$(this).click(function(){\n\t\t\t$(this).find(\"input\").prop(\"checked\", $(this).find(\"input\").prop(\"checked\") ? false : true);\n\t\t});\n\t});\n}", "updateRecordArrays() {\n this.store.recordArrayManager.recordDidChange(this);\n }", "function updateColumnOnlineStatus () {\n columns.forEach( col=> setColumnOnlineStatus(col.id,isColumnOnline(col)));\n}", "withUpdateRows(updateRows, refresh = true) {\n this.updateRows = updateRows;\n if (refresh && updateRows) {\n this.refreshRows();\n }\n return this;\n }", "firstUpdated(changedProps) {\n super.firstUpdated(changedProps);\n\n // queueing\n if (this._type) {\n this._checkType(this._type);\n }\n this.shadowRoot.querySelector('tbody').onclick = (e) => {\n this._selectRow(e);\n };\n this.shadowRoot.querySelector('tbody').onkeydown = (e) => {\n this._navigate(e);\n };\n this.shadowRoot.querySelector('tbody').onkeypress = (e) => {\n this.dispatchEvent(new CustomEvent('key-pressed', {\n detail: e, bubbles: false, composed: true\n }));\n };\n this.shadowRoot.querySelector('tbody').oncontextmenu = (e) => {\n e.preventDefault();\n this.dispatchEvent(new CustomEvent('contextmenu-requested', {\n detail: this._collection.rawEntity.entities[e.target.parentElement.rowIndex],\n bubbles: false,\n composed: true\n }));\n };\n\n }", "function updateJobStatusToActive(req,res,next){\n db.none(`update Jobs set status = $1 where id = $2`,\n ['active', req.params.job_id])\n .then(() => {\n console.log('Updated Job Status to Active');\n next()\n })\n .catch((err) => {\n console.error('error updating job status: ', err);\n })\n}", "onAfterInsertRow(row) {\n var needUpdate = false;\n this.updatingButtonOnSaveCell(this.id,this.id);\n this.id = row.id;\n var updateValue = ({\n defaultShipMethodId: row.defaultShipMethodId,\n shipMethodName: row.shipMethodName,\n shippingMethodServiceCode: row.shippingMethodServiceCode\n })\n\n for (var item in this.state.data){\n if (this.id === this.state.data[item].id) {\n needUpdate = true;\n updateValue = ({\n id: this.state.data[item].id,\n defaultShipMethodId: row.defaultShipMethodId,\n shipMethodName: row.shipMethodName,\n shippingMethodServiceCode: row.shippingMethodServiceCode\n })\n }\n }\n this.setState({counter:this.state.counter + 1})\n if (needUpdate) {\n return this.UpdatingData(updateValue);\n } else{\n return this.CreatingData(updateValue);\n }\n }", "handleRowHover(index) {\n this.setState({\n currentActive: index\n });\n }", "componentDidUpdate(prevProps) {\n if (this.props.isActive !== prevProps.isActive) {\n this.setState({ active: this.props.isActive });\n }\n }", "function editActiveRecord(newRecord) {\n\t\tconst newData = newRecord ? [...data] : []\n\t\t\n\t\tif(!options.primaryKey){console.error('No primary key set for this dataset.')}\n\t\t\n\t\tconst activeIndex = data.findIndex(r => r[options.primaryKey] == activeRecord[options.primaryKey])\n\t\t\n\t\t//if you call this function without passing a new record, the record is deleted\n\t\tif(newRecord && activeIndex > -1){\n\t\t\tnewData[activeIndex] = newRecord\n\t\t\tsetActiveRecord(newRecord)\n\t\t}else{\n\t\t\tdata.forEach((r, idx)=>{\n\t\t\t\tif(idx !== activeIndex){\n\t\t\t\t\tnewData.push(r)\n\t\t\t\t}\n\t\t\t})\n\t\t\tsetActiveRecord({})\n\t\t}\n\t\t\n\t\tsetData(newData)\n\t}", "_updateRowIndexContext() {\n const viewContainer = this._rowOutlet.viewContainer;\n for (let renderIndex = 0, count = viewContainer.length; renderIndex < count; renderIndex++) {\n const viewRef = viewContainer.get(renderIndex);\n const context = viewRef.context;\n context.count = count;\n context.first = renderIndex === 0;\n context.last = renderIndex === count - 1;\n context.even = renderIndex % 2 === 0;\n context.odd = !context.even;\n if (this.multiTemplateDataRows) {\n context.dataIndex = this._renderRows[renderIndex].dataIndex;\n context.renderIndex = renderIndex;\n }\n else {\n context.index = this._renderRows[renderIndex].dataIndex;\n }\n }\n }" ]
[ "0.6598424", "0.6539915", "0.6539915", "0.6319356", "0.6313995", "0.62199163", "0.6153227", "0.61383456", "0.6096986", "0.6073774", "0.60399884", "0.6036125", "0.6000784", "0.5969804", "0.5939618", "0.58777857", "0.58718956", "0.5846417", "0.58243895", "0.5819677", "0.58107495", "0.57969236", "0.5796333", "0.5768096", "0.57599705", "0.57592475", "0.57128644", "0.57040656", "0.5696806", "0.56852996", "0.5651429", "0.5647174", "0.563671", "0.5614151", "0.5606973", "0.56068325", "0.559777", "0.55962515", "0.5585068", "0.5566893", "0.55632514", "0.5515534", "0.5461837", "0.54544616", "0.5447828", "0.54394186", "0.54299366", "0.5422805", "0.5409002", "0.5397666", "0.53904873", "0.53871", "0.53744197", "0.5362377", "0.53622824", "0.53598535", "0.5355585", "0.53507894", "0.5344413", "0.53349495", "0.5333684", "0.5329648", "0.53272134", "0.5326479", "0.5325531", "0.5323774", "0.5315695", "0.53036535", "0.53030866", "0.52904254", "0.52827644", "0.52787864", "0.5271254", "0.5264963", "0.5262582", "0.5261479", "0.5256262", "0.5254745", "0.52478945", "0.5230956", "0.5227292", "0.52264524", "0.52216727", "0.5214161", "0.5211659", "0.5203319", "0.5197947", "0.5192683", "0.5190559", "0.5187517", "0.51840436", "0.51838624", "0.5183075", "0.51777387", "0.5172423", "0.5165642", "0.5158226", "0.51556927", "0.51549834", "0.51458234" ]
0.81905556
0
Destroys the tablecheckbox plugin.
_destroy() { this.$element.off('.zf.table.checkbox'); this.$element.find('th.table-checkbox-cell').remove(); this.$element.find('td.table-checkbox-cell').remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function destroy() {\n // clear up our FieldChecker controller instance\n // ... this will dynamically remove itself from our parent FormChecker\n fieldChecker.destroy();\n }", "function destroy() {\n Y.log('Destroying table element: ' + element.getDomId(), 'debug', NAME);\n }", "function cleanup() {\r\n tablet.removeButton(button);\r\n\t}", "willDestroyElement() {\n this._super(...arguments);\n\n // Destroys Semantic UI checkbox.\n this.$().checkbox('destroy');\n }", "destroy() {\n this.$element.off('.zf.toggler');\n Foundation.unregisterPlugin(this);\n }", "willDestroyElement() {\n this._super(...arguments);\n\n // Destroys Semantic UI checkbox.\n this.$().checkbox('destroy');\n }", "destroy() {\n this.rowsMapper.destroy();\n this.columnStatesManager.destroy();\n\n super.destroy();\n }", "destroy() {\n if (!this.initialized) {\n return;\n }\n\n let eachRow = this.tf.eachRow(0);\n eachRow((row, i) => this.removeRowBg(i));\n\n // Unsubscribe to events\n this.emitter.off(['row-processed', 'row-paged'],\n bound(this.processRowHandler, this));\n this.emitter.off(['column-sorted', 'rows-changed'],\n bound(this.processAll, this));\n\n this.initialized = false;\n }", "destroy() {\n //removing all qtip from DOM\n $('[id^=\"qtip\"]').remove();\n }", "function cleanUp() {\n if (grid) {\n grid.wazObservableGrid(\"destroy\");\n grid = null;\n }\n }", "function _destroy() {\n selected = null;\n }", "destroy() {\r\n this.off();\r\n }", "function destroy() {\n // Iterate over each matching element.\n $el.each(function() {\n var el = this;\n var $el = $(this);\n \n // Add code to restore the element to its original state...\n \n hook('onDestroy');\n // Remove Plugin instance from the element.\n $el.removeData('plugin_' + pluginName);\n });\n }", "destroy() {\n\t\tthis.element.remove();\n\t}", "function destroy(){\n\t\t// TODO\n\t}", "function cleanup() {\r\n tablet.removeButton(button);\r\n tablet.webEventReceived.disconnect(onWebEventReceived)\r\n }", "destroy() {\n this.modalPanel.destroy();\n this.fields = null;\n this.classes = null;\n }", "function destroy () {\n hintWrapper.remove()\n\n $(element).off('change', updateHint)\n $(element).off('input', updateHint)\n }", "function destroy() {\n // remove protected internal listeners\n removeEvent(INTERNAL_EVENT_NS.aria);\n removeEvent(INTERNAL_EVENT_NS.tooltips);\n Object.keys(options.cssClasses).forEach(function (key) {\n removeClass(scope_Target, options.cssClasses[key]);\n });\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n delete scope_Target.noUiSlider;\n }", "_destroy() {\n $(window).off(\".\" + this.options.namespace);\n this.element.off(\".\" + this.options.namespace);\n this.element.removeClass([this.options.classes.disabled, this.options.classes.root, this.options.classes.completed]);\n this.element.insertAfter(this.wrapperEl);\n this.wrapperEl.remove();\n }", "destroy() {\n for (let plugin of this.plugins)\n plugin.destroy(this);\n this.plugins = [];\n this.inputState.destroy();\n this.dom.remove();\n this.observer.destroy();\n if (this.measureScheduled > -1)\n this.win.cancelAnimationFrame(this.measureScheduled);\n this.destroyed = true;\n }", "function destroy() {\n\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "function _destroy() {\n selected = null;\n}", "function _destroy() {\n selected = null;\n}", "function _destroy() {\n selected = null;\n}", "destroy() {\n if (this.currentPlugin) this.currentPlugin.destroy();\n $(window).off('.zf.ResponsiveAccordionTabs');\n Foundation.unregisterPlugin(this);\n }", "function destroy() {\n // Iterate over each matching element.\n $el.each(function() {\n var el = this;\n var $el = $(this);\n \n // Add code to restore the element to its original state...\n $el\n .css({\n 'height': '',\n 'width': '',\n })\n .removeClass('button-spinner')\n .html($content.html());\n \n // Remove Plugin instance from the element.\n $el.removeData('plugin_' + pluginName);\n $el.removeData(pluginName);\n });\n }", "function _destroy() {\n\t\t\tselected = null;\n\t\t}", "function _destroy() {\n\t\t\tselected = null;\n\t\t}", "function _destroy() {\n\t\t\t\tselected = null;\n\t\t\t}", "destroy() {\n this.handles.off('.zf.slider');\n this.inputs.off('.zf.slider');\n this.$element.off('.zf.slider');\n\n clearTimeout(this.timeout);\n\n Foundation.unregisterPlugin(this);\n }", "destroy () {\n\t\tthis.options.element.removeEventListener('click', this.onClickToElement);\n\t\tthis.options.element.removeChild(this.options.element.querySelector('.pollsr'));\n\t}", "function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "function destroy() {\n\t\t\t// Iterate over each matching element.\n\t\t\t$el.each(function() {\n\t\t\t\tvar el = this;\n\t\t\t\tvar $el = $(this);\n\n\t\t\t\t// Destroy completely the element and remove event listeners\n\t\t\t\t$(window).off('resize.timeliny');\n\t\t\t\t$el.find('.' + options.className + '-timeblock:not(.inactive) .' + options.className + '-dot').off('click');\n\t\t\t\t$(document).off('mousemove.timeliny');\n\t\t\t\t$(document).off('mouseup.timeliny');\n\t\t\t\t$el.first().off('mousedown');\n\t\t\t\t$el.remove();\n\t\t\t\thook('onDestroy');\n\n\t\t\t\t// Remove Plugin instance from the element.\n\t\t\t\t$el.removeData('plugin_timeliny');\n\t\t\t});\n\t\t}", "destroy () {\n this.getElement().remove()\n }", "destroy() {\r\n if (!this.slickGrid) return;\r\n\r\n this.slickGrid.destroy();\r\n }", "function destroy(){\r\n }", "function destroy(){\r\n }", "destroy () {\n // unbind event handlers and clear elements created\n }", "deletePlugin() {}", "function destroy() {\n var jqMe = element.jqSelf();\n jqMe.html();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n // destroy everything related to WebGL and the slider\n this.destroyWebGL();\n this.destroySlider();\n }", "function destroy ( ) {\r\n\r\n\t\t\tfor ( var key in options.cssClasses ) {\r\n\t\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\r\n\t\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\r\n\t\t\t}\r\n\r\n\t\t\twhile (scope_Target.firstChild) {\r\n\t\t\t\tscope_Target.removeChild(scope_Target.firstChild);\r\n\t\t\t}\r\n\r\n\t\t\tdelete scope_Target.noUiSlider;\r\n\t\t}", "destroy() {\n this.teardown();\n $.removeData(this.element[0], COMPONENT_NAME);\n }", "function destroy() {\n cssClasses.forEach(function(cls) {\n if (!cls) {\n return;\n } // Ignore empty classes\n removeClass(scope_Target, cls);\n });\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n delete scope_Target.noUiSlider;\n }", "function destroy ( ) {\r\n\r\n\t\tfor ( var key in options.cssClasses ) {\r\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\r\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\r\n\t\t}\r\n\r\n\t\twhile (scope_Target.firstChild) {\r\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\r\n\t\t}\r\n\r\n\t\tdelete scope_Target.noUiSlider;\r\n\t}", "function destroy ( ) {\r\n\r\n\t\tfor ( var key in options.cssClasses ) {\r\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\r\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\r\n\t\t}\r\n\r\n\t\twhile (scope_Target.firstChild) {\r\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\r\n\t\t}\r\n\r\n\t\tdelete scope_Target.noUiSlider;\r\n\t}", "destroy() {\n\t\tif (this._buttons) {\n\t\t\tthis._buttons\n\t\t\t\t.off(EVENT_CLICK, this._onClick)\n\t\t\t\t.off(EVENT_KEYDOWN, this._onKeydown)\n\t\t\t\t.off(EVENT_FOCUS, this._onFocus);\n\n\t\t\tthis._buttons = undefined;\n\t\t\tdelete(this._buttons);\n\t\t}\n\n\t\tif (this._alternativeButtons) {\n\t\t\tthis._alternativeButtons\n\t\t\t\t.off(EVENT_CLICK, this._onAlternativeClick);\n\t\t\tthis._alternativeButtons = undefined;\n\t\t\tdelete(this._alternativeButtons);\n\t\t}\n\n\t\tsuper.destroy();\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "destroy() {\r\n super.destroy();\r\n }", "destroy () {\n this.domToType = null;\n this.typeToDom = null;\n this.type.unobserveDeep(this._typeObserver);\n this._mutationObserver.disconnect();\n const y = this.type._y;\n y.off('beforeTransaction', this._beforeTransactionHandler);\n y.off('beforeObserverCalls', this._beforeObserverCallsHandler);\n y.off('afterTransaction', this._afterTransactionHandler);\n super.destroy();\n }", "destroy() {\n if (!this.initialised) {\n return;\n }\n\n // Remove all event listeners\n this._removeEventListeners();\n this.passedElement.reveal();\n this.containerOuter.revert(this.passedElement.element);\n\n // Clear data store\n this.clearStore();\n\n // Nullify instance-specific data\n this.config.templates = null;\n\n // Uninitialise\n this.initialised = false;\n }", "function interfaceDestroy ( ) {\n\t\t\tROOT.removeEventListener('click', delegatedCellClick);\n\t\t\tROOT.innerHTML = '';\n\t\t}", "function Clean() {\n\t$('.box').remove();\n}", "function cleanup() {\n $.off();\n}", "destroy() {\n this.logger.warning('Destroying plugin');\n this.disconnect();\n this.view.removeElement();\n }", "function destroy(){}", "destroy() {\n this.heightIn = undefined;\n this.heightTypeIn = undefined;\n this.allowRowBreakAcrossPagesIn = undefined;\n this.isHeaderIn = undefined;\n this.selection = undefined;\n }", "destroy() {\n // do cleanup, remove event listener from button\n if (this.eButton) {\n // check that the button element exists as destroy() can be called before getGui()\n this.eButton.removeEventListener('click', this.eventListener);\n }\n }", "destroy() {\n var _this = this;\n this.$element\n .off('.abide')\n .find('[data-abide-error]')\n .css('display', 'none');\n\n this.$inputs\n .off('.abide')\n .each(function() {\n _this.removeErrorClasses($(this));\n });\n\n Foundation.unregisterPlugin(this);\n }", "destroy() {\n // destroy everything related to the slider\n this.destroySlider();\n }", "function destroy () {\n\t\t// TODO\n\t}", "destroy() {\n this.currentPlugin.destroy();\n $(window).off('.zf.ResponsiveMenu');\n Foundation.unregisterPlugin(this);\n }", "destroy() {\n\t\tthis.isActive = false;\n\t}", "destroy() {\n super.destroy();\n }", "destroy() {\n super.destroy();\n }", "dispose() {\n this.sharedService.grid = null;\n this.sharedService.visibleColumns = [];\n // dispose of each control/plugin & reset the list\n this._extensionList.forEach((item) => {\n if (item && item.class && item.class.dispose) {\n item.class.dispose();\n }\n });\n this._extensionList = [];\n }", "__destroy() {\n this.__removeChildren();\n this.__remove();\n }", "destroy() {\n $.removeData(this.element[0], COMPONENT_NAME);\n }", "destroy() {\n this.element.remove();\n this.subscriptions.dispose();\n this.editorSubs.dispose();\n }", "destroy() {\n // Remove event listeners connected to this instance\n this.eventDelegate.off();\n\n // Delete references to instance\n delete this.ui.element.dataset[`${this.name}Instance`];\n\n delete window[namespace].modules[this.name].instances[this.uuid];\n }", "function destroy ( ) {\n\t\n\t\t\tcssClasses.forEach(function(cls){\n\t\t\t\tif ( !cls ) { return; } // Ignore empty classes\n\t\t\t\tremoveClass(scope_Target, cls);\n\t\t\t});\n\t\n\t\t\twhile (scope_Target.firstChild) {\n\t\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t\t}\n\t\n\t\t\tdelete scope_Target.noUiSlider;\n\t\t}", "destroy(){\n\t\tthis._wrapper.innerHTML = '';\n\t\tthis._wrapper.classList.remove('mvc-wrapper', 'mvc-stylised');\n\t}", "destroy () {\n this.element.remove();\n }", "onremove() {\n // Slider and binder\n if(this.binder)\n this.binder.destroy();\n if(this.slider)\n this.slider.destroy();\n\n // Destroy classes & objects\n this.binder = this.slider = this.publication = this.series = this.ui = this.config = null;\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }" ]
[ "0.6524498", "0.6375102", "0.637256", "0.62806654", "0.616944", "0.61632246", "0.6157277", "0.6090114", "0.6052867", "0.6041596", "0.600461", "0.59902555", "0.5966329", "0.5955884", "0.5934785", "0.59227866", "0.59213597", "0.59186935", "0.59028304", "0.58918095", "0.5875409", "0.58651894", "0.58649397", "0.58649397", "0.58649397", "0.5856591", "0.5854304", "0.5852093", "0.5852093", "0.5843382", "0.58377117", "0.58373845", "0.5818133", "0.5818133", "0.5818133", "0.5818133", "0.5814794", "0.57807785", "0.57734394", "0.5760497", "0.5760497", "0.57574576", "0.57488775", "0.57323164", "0.57300264", "0.57300264", "0.57300264", "0.57300264", "0.5725614", "0.5718508", "0.57183033", "0.57170194", "0.57093745", "0.57093745", "0.57081205", "0.5707191", "0.5707191", "0.5707191", "0.5707191", "0.5707191", "0.5707191", "0.5707191", "0.5707191", "0.5707191", "0.5707191", "0.5707191", "0.5707191", "0.570261", "0.56933403", "0.56897956", "0.5689144", "0.56882644", "0.567556", "0.5674803", "0.5674515", "0.5669351", "0.5664451", "0.5652971", "0.5648953", "0.5644042", "0.5630585", "0.56286216", "0.56277215", "0.56277215", "0.56269413", "0.5621433", "0.5610768", "0.5608304", "0.56047225", "0.5598277", "0.5590187", "0.5583728", "0.5582763", "0.5565518", "0.5565518", "0.5565518", "0.5565518", "0.5565518", "0.5565518", "0.5565518" ]
0.8110313
0
form functions resolves with all forms
function getAllForms() { return new Promise((resolve, reject) => { if(!form) reject(new Error("forms is not found")); return resolve(form); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n Object.entries(formsAndHandlers).forEach(([formID, handler]) => {\n const form = document.getElementById(formID);\n form.onsubmit = (e) => {\n e.preventDefault();\n const data = {};\n (new FormData(form)).forEach((value, key) => {\n data[key] = value;\n });\n handler(data);\n return false; // don't reload page\n };\n });\n}", "function initForms () {\n selectize.initSelectize()\n forms.initDefaultForm()\n comment.initCommentForm()\n tutorial.initTutorialForm()\n}", "function runAllForms() {\n\n\t/*\n\t * BOOTSTRAP SLIDER PLUGIN\n\t * Usage:\n\t * Dependency: js/plugin/bootstrap-slider\n\t */\n\tif ($.fn.slider) {\n\t\t$('.slider').slider();\n\t}\n\n\t/*\n\t * SELECT2 PLUGIN\n\t * Usage:\n\t * Dependency: js/plugin/select2/\n\t */\n\tif ($.fn.select2) {\n\t\t$('.select2').each(function() {\n\t\t\tvar $this = $(this);\n\t\t\tvar width = $this.attr('data-select-width') || '100%';\n\t\t\t//, _showSearchInput = $this.attr('data-select-search') === 'true';\n\t\t\t$this.select2({\n\t\t\t\t//showSearchInput : _showSearchInput,\n\t\t\t\tallowClear : true,\n\t\t\t\twidth : width\n\t\t\t});\n\t\t});\n\t}\n\n\t/*\n\t * MASKING\n\t * Dependency: js/plugin/masked-input/\n\t */\n\tif ($.fn.mask) {\n\t\t$('[data-mask]').each(function() {\n\n\t\t\tvar $this = $(this);\n\t\t\tvar mask = $this.attr('data-mask') || 'error...', mask_placeholder = $this.attr('data-mask-placeholder') || 'X';\n\n\t\t\t$this.mask(mask, {\n\t\t\t\tplaceholder : mask_placeholder\n\t\t\t});\n\t\t});\n\t}\n\n\t/*\n\t * AUTOCOMPLETE\n\t * Dependency: js/jqui\n\t */\n\tif ($.fn.autocomplete) {\n\t\t$('[data-autocomplete]').each(function() {\n\n\t\t\tvar $this = $(this);\n\t\t\tvar availableTags = $this.data('autocomplete') || [\"The\", \"Quick\", \"Brown\", \"Fox\", \"Jumps\", \"Over\", \"Three\", \"Lazy\", \"Dogs\"];\n\n\t\t\t$this.autocomplete({\n\t\t\t\tsource : availableTags\n\t\t\t});\n\t\t});\n\t}\n\n\t/*\n\t * JQUERY UI DATE\n\t * Dependency: js/libs/jquery-ui-1.10.3.min.js\n\t * Usage: <input class=\"datepicker\" />\n\t */\n\tif ($.fn.datepicker) {\n\t\t$('.datepicker').each(function() {\n\n\t\t\tvar $this = $(this);\n\t\t\tvar dataDateFormat = $this.attr('data-dateformat') || 'dd.mm.yy';\n\n\t\t\t$this.datepicker({\n\t\t\t\tdateFormat : dataDateFormat,\n\t\t\t\tprevText : '<i class=\"fa fa-chevron-left\"></i>',\n\t\t\t\tnextText : '<i class=\"fa fa-chevron-right\"></i>',\n\t\t\t});\n\t\t});\n\t}\n\n\t/*\n\t * AJAX BUTTON LOADING TEXT\n\t * Usage: <button type=\"button\" data-loading-text=\"Loading...\" class=\"btn btn-xs btn-default ajax-refresh\"> .. </button>\n\t */\n\t$('button[data-loading-text]').on('click', function() {\n\t\tvar btn = $(this);\n\t\tbtn.button('loading');\n\t\tsetTimeout(function() {\n\t\t\tbtn.button('reset');\n\t\t}, 3000);\n\t});\n\n}", "function _trackForms () {\r\n [].forEach.call(document.querySelectorAll('form[id][' + objSettings.attribute + ']'), function each (element) {\r\n providers.forEach(function _trackCharge (provider) {\r\n if (typeof provider.obj.trackForm === 'function') {\r\n provider.obj.trackForm('#' + element.id, element.getAttribute(objSettings.attribute));\r\n }\r\n });\r\n });\r\n}", "function aggregateMyFunctions() {\n var validate = validateForm();\n var formValid = validate.valid;\n\n if (!formValid) {\n validateForm();\n return false;\n } else {\n //all other functions\n //update this functions af you write more functions\n //example \n calculateDayOfWk();\n get_and_Print_AkanName();\n return false;\n }\n}", "function _ojFormMakeReady() {\n if (ojFormReadyResolveFunc) {\n ojFormReadyResolveFunc();\n ojFormReadyResolveFunc = null;\n }\n }", "function formSymptom1Fields(form, id_form)\n{\n\tvar nombre = '';\n\tvar tipo = '';\n\tvar valor = '';\n\tvar error = false;\n\tvar val = '';\n\t\t\t\n\tform.each(function(){\n \n nombre = $(this).context.name;\n\n tipo = $(this).context.type;\n\n valor = $(this).context.value;\n\n $('#error_'+nombre+\"\").text('');\n\n if(tipo==='radio' && !$(\"input[name='\"+nombre+\"']:checked\", \"\"+id_form+\"\").is(\":checked\"))\n {\n \t\n \t$('#error_'+nombre+\"\").text('(*)');\n\n \terror = true;\n }\n \n //call_emergency(nombre,id_form); // Redirect to page for calling to 911 \n\t\tif(call_emergency(nombre,id_form)==1) return error = 1;\n\t});\n\treturn error;\n}", "function resolveForm(elem, event) {\n return Lang_1.ExtLang.getForm(elem.getAsElem(0).value, event);\n}", "_initForms() {\n // layouts.js initialization\n if (typeof FormLayouts !== 'undefined') {\n const formLayouts = new FormLayouts();\n }\n // validation.js initialization\n if (typeof FormValidation !== 'undefined') {\n const formValidation = new FormValidation();\n }\n // wizards.js initialization\n if (typeof FormWizards !== 'undefined') {\n const formWizards = new FormWizards();\n }\n // inputmask.js initialization\n if (typeof InputMask !== 'undefined') {\n const inputMask = new InputMask();\n }\n // controls.autocomplete.js initialization\n if (typeof GenericForms !== 'undefined') {\n const genericForms = new GenericForms();\n }\n // controls.autocomplete.js initialization\n if (typeof AutocompleteControls !== 'undefined') {\n const autocompleteControls = new AutocompleteControls();\n }\n // controls.datepicker.js initialization\n if (typeof DatePickerControls !== 'undefined') {\n const datePickerControls = new DatePickerControls();\n }\n // controls.datepicker.js initialization\n if (typeof DropzoneControls !== 'undefined') {\n const dropzoneControls = new DropzoneControls();\n }\n // controls.editor.js initialization\n if (typeof EditorControls !== 'undefined') {\n const editorControls = new EditorControls();\n }\n // controls.spinner.js initialization\n if (typeof SpinnerControls !== 'undefined') {\n const spinnerControls = new SpinnerControls();\n }\n // controls.rating.js initialization\n if (typeof RatingControls !== 'undefined') {\n const ratingControls = new RatingControls();\n }\n // controls.select2.js initialization\n if (typeof Select2Controls !== 'undefined') {\n const select2Controls = new Select2Controls();\n }\n // controls.slider.js initialization\n if (typeof SliderControls !== 'undefined') {\n const sliderControls = new SliderControls();\n }\n // controls.tag.js initialization\n if (typeof TagControls !== 'undefined') {\n const tagControls = new TagControls();\n }\n // controls.timepicker.js initialization\n if (typeof TimePickerControls !== 'undefined') {\n const timePickerControls = new TimePickerControls();\n }\n }", "function bindForm(form, bindable){\n\n\t\t;[].forEach.call(form.querySelectorAll('input'), function(field){\n\n\t\t\tbindField(field, bindable)\n\n\t\t})\n\n\t}", "function form_handler(form) {\n\n form.submit(function(e) {\n\n e.preventDefault();\n\n var email = form.find(\"input[name=email]\").val();\n var confirmation = $(form.data('on-submit-show'));\n var salesforce_source = \"website\";\n\n analytics.identify(email, _.reduce(form.find(\"input,textarea\"), function(acc, el) {\n\n acc[$(el).attr(\"name\")] = $(el).val();\n return acc;\n\n }, {\n\n \"LeadSource\": salesforce_source,\n \"path\": window.location.toString()\n\n }), {\n\n 'Salesforce': true\n\n });\n\n form.addClass(\"hide\");\n confirmation.removeClass(\"hide\");\n\n modal_resize();\n\n return false;\n\n });\n\n }", "function initForm(){\n\t\tsetActions();\n\t\tvalidateForm();\n\t}", "function makeForms()\n{\n\t\n\t// Headers\n\t$('fieldset legend').each(function(){\n\t\t$(this).parent().prepend('<h2>'+$(this).css({display:'none'}).html()+'</h2>');\n\t\t\n\t});\n\t\n\t\n\t// Inputs\n\t$('.form input').each(function(){\n\t\t\n\t\tswitch( $(this).attr('type') )\n\t\t{\n\t\t\tcase 'submit':\n\t\t\t\t$(this).addClass('btn btn-large btn-primary');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'number':\n\t\t\tcase 'text':\n\t\t\tcase 'password':\n\t\t\t\t$(this).addClass('input-block-level').attr({\n\t\t\t\t\tplaceholder: $(this).parent().find('label').css({display:'none'}).html()\n\t\t\t\t}); \n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t});\n\t\n\t// textArea\n\t$('.form textarea').each(function(){\n\t\t\n\t\t$(this).addClass('input-block-level').attr({\n\t\t\tplaceholder: $(this).parent().find('label').css({display:'none'}).html()\n\t\t}); \n\t\t\t\t\n\t\t\n\t});\n\t\n\t// Select\n\t$('.form select').each(function(){\n\t\t\n\t\t$(this).addClass('input-block-level').attr({\n\t\t\tplaceholder: $(this).parent().find('label').html()\n\t\t}); \n\t\t\t\t\n\t\t\n\t});\n}", "get forms() {\r\n return new Forms(this);\r\n }", "function bindForms() {\n $('form').each(function () {\n $(this).find('[type=file]').change(function () {\n if (this.files && this.files[0] && this.files[0].size > 25 * 1024 * 1024) {\n alert('Превышен размер файла! Максимальный допустимый размер - 25 мегабайт.');\n $(this).val(null);\n }\n });\n $(this).validate({\n submitHandler: function (form) {\n var $form = $(form);\n try {\n var data = new FormData($(form)[0]);\n var phone = '';\n if ($form.find('input[name=phone]').length > 1) {\n $form.find('input[name=phone]').each(function () {\n phone += $(this).val();\n })\n } else {\n phone = $form.find('input[name=phone]').val()\n }\n\n var request = {\n name: $form.find('input[name=name]').val(),\n email: $form.find('input[name=email]').val(),\n phone: phone,\n type: $form.find('input[name=type]').val(),\n referrer: options.referrer,\n query: location.search,\n fields: new UtmLabelsParser(location).getLabels()\n };\n\n data.append('request', $.toJSON(request));\n\n $.ajax({\n url: options.url,\n data: data,\n cache: false,\n contentType: false,\n processData: false,\n type: 'POST',\n success: function () {\n $(options.fmRequest).modal('hide');\n options.onSendRequest && options.onSendRequest();\n $form.find('input[type=text]').val('');\n },\n statusCode: {\n 413: function () {\n alert('Превышен максимальный размер файла в 25 мегабайт!');\n },\n 415: function () {\n alert('Неправильный формат файла! Разрешена отправка только изображений.');\n }\n }\n });\n } catch (e) {\n console.log(e);\n return false;\n } finally {\n try {\n var yaGoal = $form.find('[name=yagoal]').val();\n options.getYaCounter && yaGoal && options.getYaCounter().reachGoal && options.getYaCounter().reachGoal(yaGoal);\n } catch (e) {\n window.console && window.console.error('Can not send a Yandex Goal', e);\n }\n }\n return false;\n },\n ignore: \".ignore\",\n errorPlacement: function (error, element) {\n $(element).attr('title', $(error).text());\n },\n rules: {\n 'phone': 'required',\n 'email': 'email'\n },\n messages: {\n 'phone': {\n 'required': 'Пожалуйста, укажите Ваш телефонный номер'\n },\n 'email': {\n 'email': 'Пожалуйста, укажите корректный адрес электронной почты'\n }\n }\n });\n });\n }", "function bindFormEvents() {\n\n\t\t// Capture enter key in form fields to move to next\n\t\t$('input').keypress(function (e) {\n if(e.which == 13) {\n if(!$(this).hasClass(\"last\")){\n e.preventDefault();\n $(\":input:eq(\" + ($(\":input\").index(this) + 1) + \")\").focus();\n }\n }\n }); \n\n\t\t// Previous link clicks\n $(\"a#previous-slice\").click(function (e) {\n \tconsole.log(\"Previous slice link clicked\");\n \te.preventDefault();\n \tvar currentSlice = getCurrentSlice();\n \tvar slices = loadSlices();\n \tloadPreviousSlice(currentSlice, slices);\n });\n\n // All done link click\n $(\"a#all-done\").click(function (e) {\n \te.preventDefault();\n \talert(\"Thanks!\");\n });\n\n // Save-but-don't-change link click\n $(\"a#save-header-no-next\").click(function (e) {\n \te.preventDefault();\n \t// Save the header details into localStorage but not the slice\n \tlocalStorage.setItem(\"header\", JSON.stringify($(\"#transcribe_form\").values()));\n \t// Don't load the next slice, stay here and reload the form\n \tloadCurrentForm(null);\n });\n\n // This is a header button click\n $(\"#is-header-button\").click(function () {\n \tloadForm(\"#header-form\", true, headerLegend, \"#header-actions\");\n });\n\n // Tooltips on focus\n // Make new tooltips\n console.log(\"making new tooltips\");\n $('input').tooltip({\n \t\ttrigger: 'focus',\n \t\ttitle: function() {\n \t\t\treturn $(this).attr(\"placeholder\");\n \t\t},\n \t\tplacement: 'top'\n \t}\n );\n\n // Trigger the tooltip on autofocussed elements\n $('input[autofocus]').trigger('focus');\n\n // Change events on the document type select elements\n console.log(\"Binding to document type change events\");\n $('select#document-type').change(filterTemplateOptions);\n\t}", "function omniFormPath(){\n\t\tsubmitomniFormPath(event,omniFormPath);\n}", "function FindForms(){\n\t\tvar forms = document.getElementsByTagName('form');\n\t\tfor(var i=0,form; form=forms[i++];){\n\t\t\tvar dest = form.getAttribute('action'),\n\t\t\t\t\tmatches_scheme = URL_SCHEME.test(dest);\n\t\t\tif(!matches_scheme) continue;\n\t\t\tBindLoginForm(form);\n\t\t}\n\t}", "function leadActivityForms() {\n $('form').submit(function anonFormActivity() {\n var $this = $(this),\n formId = $this.find('input[name=\"form_id\"]').val(),\n data = {\n nid: $this.find('input[name=\"nid\"]').val(),\n keyword: Tabia.util.getUrlParameter('kw'),\n leadSource: $this.find('input[name=\"lead_source\"]').val(),\n leadSourceDetail: $this.find('input[name=\"lead_source_detail\"]').val(),\n campaignId: $this.find('input[name=\"campaign_id\"]').val()\n };\n\n // Admin configured forms.\n if (($.inArray(formId, Drupal.settings.tableauEloqua.queueForms) >= 0) &&\n data.leadSource !== null && data.campaignId !== null) {\n // Add submit event to a localStorage queue.\n $.jQueue.push(data, 'Drupal.behaviors.tableauEloquaQueue.eloquaPost');\n }\n });\n }", "function hookupForm(){\n\n var wholeForm = $(scope.challengeForm);\n\n // Bind up inputs to ng-models\n wholeForm.find('input, textarea, select').each(function(){\n var elem = $(this);\n var name = elem.attr('name') || elem.attr('id');\n if(name){\n elem.attr('ng-model', 'formData.' + name);\n\n // Assign any specified default value\n scope.formData[name] = elem.attr('value');\n }\n });\n\n // Stick it in the dom\n $(el).html(wholeForm);\n\n $compile(wholeForm)(scope);\n }", "function setFormFields () {\n let query = qs.parse(window.location.search.substr(1));\n\n setCheckbox(form.allow.json, query[\"allow-json\"]);\n setCheckbox(form.allow.yaml, query[\"allow-yaml\"]);\n setCheckbox(form.allow.text, query[\"allow-text\"]);\n setCheckbox(form.allow.empty, query[\"allow-empty\"]);\n setCheckbox(form.allow.unknown, query[\"allow-unknown\"]);\n setCheckbox(form.refs.external, query[\"refs-external\"]);\n setCheckbox(form.refs.circular, query[\"refs-circular\"]);\n setCheckbox(form.validate.schema, query[\"validate-schema\"]);\n setCheckbox(form.validate.spec, query[\"validate-spec\"]);\n\n // If a custom URL is specified, then show the \"Your API\" tab\n if (query.url) {\n form.url.val(query.url);\n }\n\n // If a method is specified, then change the \"Validate!\" button\n if (query.method) {\n query.method = query.method.toLowerCase();\n if ([\"parse\", \"resolve\", \"bundle\", \"dereference\", \"validate\"].indexOf(query.method) !== -1) {\n form.method.button.val(query.method);\n }\n }\n}", "function Form(opts) {\n opts = opts || {};\n this.panel = $('div.panel').filter(':first');\n this.form = opts.form ? $('#'+opts.form) : this.panel.find('form');\n this.inputfirst = this.form.find(\"input:text:visible:first\");\n this.inputfirst.focus();\n this.safe = opts.safe;\n this.onpost = opts.onpost;\n //console.log(this.form);\n // individual url for each form || <form id=\"form\" action=\"action\" || common post url\n var act = this.form[0].attributes.action;\n this.post_url = opts.action || (act ? act.value : false) || web2spa.post_url;\n this.inputs = {};\n this.inputstext = this.form.find('input[type!=checkbox][name]').data('this',this).on('input', this.change);\n this.inputscheckbox = this.form.find('input:checkbox[name]').data('this',this).on('change', this.change);\n var self = this,\n hS = opts.submit,\n hC = opts.events;\n if (typeof hS !== 'function') hS = function () { return self.post(this); }\n this.form.submit(hS);\t// register submit\n if (typeof hC === 'function') this.hI = hC;\n else if (typeof hC ==='object'){\n $.each(hC, function(k, v) {\n var e = k.splitOnce(' ');\n self.form.find(e[1]).on(e[0], v);\n });\n }\n}", "createForm(){\n this.form_ = this.create_();\n }", "function formready(formid)\n{\nformhandler('#'+formid); \n}", "function addHooksToAf() {\n _(that.pageMap).pluck('form').forEach(function(formId) {\n if (formId) {\n AutoForm.addHooks(formId, that.autoFormHooks(), true);\n }\n }\n )\n }", "function makeSubmitHandler(form) {\n return function () {\n\n // Turn off placeholders on all appropriate descendant elements\n disablePlaceholders(form);\n };\n }", "function getFormValuesAndDisplayResults() {\n}", "function getFormHandleForm(seq)\n{\nvar name = 'iiiFormHandle_' + seq;\nvar obj = getObj(name);\nreturn obj.form;\n}", "function gFuncAllOverForm(objForm)\n{\n\tvar strNameList = \"\";\n\tvar strName = \"\";\n\tvar strType = \"\";\n\tvar strValue = \"\";\n\n\tvar i, j;\n\n\tif (g_objNR.Flag)\n\t{\n\t\t//Need Naming Rule ///////////////////////\n\t\tfor (i = 0; i < objForm.elements.length; i++ )\n\t\t{\n\t\t\tif (objForm.elements(i).name.indexOf(g_objNR.RuleString) > 0)\n\t\t\t{\n\t\t\t\t////Not Support ////\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t//No Naming Rule /////////////////////////\n\n\t\tfor (i = 0; i < objForm.length; i++)\n\t\t{\n\t\t\tstrName = objForm(i).name;\n\t\t\tstrType = objForm(i).type;\n\n\t\t\tfor (j = 0; j < g_objF.ReIType.length; j++)\n\t\t\t{\n\t\t\t\t////Support These simple item ////\n\t\t\t\tif (objForm(i).type == g_objF.ReIType[j])\n\t\t\t\t{\n\t\t\t\t\tstrValue = objForm(i).value;\n\t\t\t\t\tgFuncFormItem2XML(strName, strType, strValue);\n\t\t\t\t\tstrNameList += strName + + \"&&&\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (objForm(i).type == \"select-multiple\" && (strNameList.indexOf(strName) == -1))\n\t\t\t{\n\t\t\t\t////Is Multi Select //////////////\n\t\t\t\tfor (j = 0; j < objForm(i).length; j++)\n\t\t\t\t{\n\t\t\t\t\tif (objForm(i).item(j).selected)\n\t\t\t\t\t{\n\t\t\t\t\t\tstrValue += \", \" + objForm(i).item(j).value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t////Set Item Value ///////////////\n\t\t\t\tstrValue = strValue.substr(2, strValue.length - 2);\n\t\t\t\tgFuncFormItem2XML(strName, strType, strValue);\n\t\t\t\tstrNameList += strName + \"&&&\";\n\t\t\t}\n\n\t\t\tif ((objForm(i).type == \"checkbox\") && (strNameList.indexOf(strName) == -1))\n\t\t\t{\n\t\t\t\t////Is CheckBox //////////////////\n\t\t\t\tfor (j = 0; j < objForm.length; j++)\n\t\t\t\t{\n\t\t\t\t\tif (objForm(j).checked && (objForm(j).name == strName))\n\t\t\t\t\t{\n\t\t\t\t\t\tstrValue += \", \" + objForm(j).value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstrValue = strValue.substr(2, strValue.length - 2);\n\t\t\t\tgFuncFormItem2XML(strName, strType, strValue);\n\t\t\t\tstrNameList += strName + \"&&&\";\n\t\t\t}\n\n\t\t\tif ((objForm(i).type == \"radio\") && (strNameList.indexOf(strName) == -1))\n\t\t\t{\n\t\t\t\t////Is CheckBox //////////////////\n\t\t\t\tfor (j = 0; j < objForm.length; j++)\n\t\t\t\t{\n\t\t\t\t\tif (objForm(j).checked && (objForm(j).name == strName))\n\t\t\t\t\t{\n\t\t\t\t\t\tstrValue += \", \" + objForm(j).value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstrValue = strValue.substr(2, strValue.length - 2);\n\t\t\t\tgFuncFormItem2XML(strName, strType, strValue);\n\t\t\t\tstrNameList += strName + \"&&&\";\n\t\t\t}\n\n\t\t\tstrValue = \"\";\n\t\t}\n\t}\n\n\treturn g_objER.XMLHeader + g_objER.XMLDoc.xml;\n}", "get form() {\n return this.internals_.form;\n }", "function makeSubmitHandler(form) {\n return function () {\n\n // Turn off placeholders on all appropriate descendant elements\n disablePlaceholders(form);\n };\n }", "function makeSubmitHandler(form) {\n return function () {\n\n // Turn off placeholders on all appropriate descendant elements\n disablePlaceholders(form);\n };\n }", "function makeSubmitHandler(form) {\n return function () {\n\n // Turn off placeholders on all appropriate descendant elements\n disablePlaceholders(form);\n };\n }", "function makeSubmitHandler(form) {\n return function () {\n\n // Turn off placeholders on all appropriate descendant elements\n disablePlaceholders(form);\n };\n }", "formAssociatedCallback(nullableForm) {\n console.log('Form associated.');\n }", "function hook_ticket_forms() {\n $('div.section#ticketSection form').each(function(index, item) {\n // hook in our ajax form plugin\n $(item).ajaxForm({\n success: ticket_save_success,\n error: ticket_save_error,\n });\n });\n}", "registerHandlers() {\n this.formEl.onsubmit = event => this.submitNews(event)\n this.moreBtn.onclick = () => this.loadProducts()\n }", "get form() {\n return this.internals_.form;\n }", "function formRoute ({\n action,\n requireAuthentication,\n loadGETData,\n form,\n fields,\n fieldSizeLimit = 512000,\n processBody,\n onPost,\n onSuccess\n}) {\n if (typeof form !== 'function') {\n throw new TypeError('missing form function')\n }\n\n if (typeof processBody !== 'function') {\n throw new TypeError('missing processBody function')\n }\n\n if (typeof onSuccess !== 'function') {\n throw new TypeError('missing onSuccess function')\n }\n\n const fieldNames = Object.keys(fields)\n fieldNames.forEach(fieldName => {\n const description = fields[fieldName]\n if (typeof description.validate !== 'function') {\n throw new TypeError('missing validate function for ' + fieldName)\n }\n if (!description.displayName) {\n description.displayName = fieldName\n }\n })\n\n return (request, response) => {\n const method = request.method\n const isGet = method === 'GET'\n const isPost = !isGet && method === 'POST'\n if (!isGet && !isPost) return serve405(request, response)\n proceed()\n\n function proceed () {\n if (requireAuthentication && !request.account) {\n return serve303(request, response, '/login')\n }\n if (isGet) return get(request, response)\n post(request, response)\n }\n }\n\n function get (request, response, body, error) {\n response.setHeader('Content-Type', 'text/html')\n const data = {}\n if (body) {\n fieldNames.forEach(fieldName => {\n data[fieldName] = {\n value: body[fieldName],\n error: error && error.fieldName === fieldName\n ? `<p class=error>${escapeHTML(error.message)}</p>`\n : ''\n }\n })\n } else {\n fieldNames.forEach(fieldName => {\n data[fieldName] = { value: '', error: false }\n })\n }\n if (error && !error.fieldName) {\n data.error = `<p class=error>${escapeHTML(error.message)}</p>`\n }\n data.csrf = csrf.inputs({\n action,\n sessionID: request.session.id\n })\n if (loadGETData) {\n return loadGETData(request, data, error => {\n if (error) return serve500(request, response, error)\n response.end(form(request, data))\n })\n }\n response.end(form(request, data))\n }\n\n function post (request, response) {\n if (onPost) onPost(request, response)\n\n const body = {}\n let fromProcess\n runSeries([\n parse,\n validate,\n process\n ], error => {\n if (error) {\n const statusCode = error.statusCode\n if (statusCode >= 400 && statusCode < 500) {\n response.statusCode = statusCode\n return get(request, response, body, error)\n }\n return serve500(request, response, error)\n }\n onSuccess(request, response, body, fromProcess)\n })\n\n function parse (done) {\n request.pipe(\n new Busboy({\n headers: request.headers,\n limits: {\n fieldNameSize: Math.max(\n fieldNames\n .concat('csrftoken', 'csrfnonce')\n .map(n => n.length)\n ),\n fields: fieldNames.length + 2,\n fieldSizeLimit,\n parts: 1\n }\n })\n .on('field', function (name, value, truncated, encoding, mime) {\n if (name === 'csrftoken' || name === 'csrfnonce') {\n body[name] = value\n return\n }\n const description = fields[name]\n if (!description) return\n body[name] = description.filter\n ? description.filter(value)\n : value\n })\n .once('finish', done)\n )\n }\n\n function validate (done) {\n for (let index = 0; index < fieldNames.length; index++) {\n const fieldName = fieldNames[index]\n const description = fields[fieldName]\n const valid = description.validate(body[fieldName], body)\n if (valid) continue\n const error = new Error('invalid ' + description.displayName)\n error.statusCode = 401\n return done(error)\n }\n csrf.verify({\n action,\n sessionID: request.session.id,\n token: body.csrftoken,\n nonce: body.csrfnonce\n }, done)\n }\n\n function process (done) {\n processBody(request, body, (error, result) => {\n if (error) return done(error)\n fromProcess = result\n done()\n })\n }\n }\n}", "function vehicleFormCaller() {\n veh.vehicleForm();\n}", "_rebuildForm() {\n //console.log(\"_rebuildForm\",this.value,this.schema);\n this._clearForm();\n if (this.schema) {\n let formProperties = this._getProperties(this.schema);\n formProperties.forEach(property => this._buildFormElement(property));\n }\n }", "function getForm() {\n return questionForm;\n}", "function makeSubmitHandler( form ) {\n return function () {\n\n // Turn off placeholders on all appropriate descendant elements.\n disablePlaceholders(form);\n };\n }", "function applyOnSubmitToForms()\n{\n elementsForms = document.getElementsByTagName(\"form\"); \n for (var intCounter = 0; intCounter < elementsForms.length; intCounter++) \n { \n elementsForms[intCounter].onsubmit = function ()\n {\n if (!validateForms())\n {\n return false;\n }\n }\n } \n}", "function forms (argv, cb) {\n var args = argv._;\n var url = fhreq.getFeedHenryUrl();\n if (args.length === 0) return doList(cb);\n var action = args[0];\n\n if (action === 'list') return doList(cb);\n if (action === 'create') {\n if (!args[1]) return cb(forms.usage);\n return doCreateUpdate(args[1], cb);\n }\n if (action === 'update') {\n if (!args[1]) return cb(forms.usage);\n return doCreateUpdate(args[1], cb);\n }\n if (action === 'get') {\n if (!args[1]) return cb(forms.usage);\n return doGetForm(args[1],false, cb);\n }\n if (action === 'export') {\n if (!args[1]) return cb(forms.usage);\n return doGetForm(args[1], true, cb);\n }\n if (action === 'delete') {\n if (!args[1]) return cb(forms.usage);\n return doDeleteForm(args[1], cb);\n }\n if (action === 'apps') {\n if (!args[1]) return cb(forms.usage);\n var act = args[1];\n if (act === 'list') {\n return doListAppForms(cb);\n }\n if (act === 'get') {\n var appId = args[2];\n if (!appId) return cb(forms.usage);\n return doGetAppForms(appId, cb);\n }\n if (act === 'update') {\n var appId = args[2];\n if (!appId) return cb(forms.usage);\n\n var formIds = (\"\" === args[3]) ? [] : _.rest(args, 3);\n //if (formIds.length == 0) return cb(forms.usage);\n return doAppFormsUpdate(appId, formIds, cb);\n }\n if (act === 'create') {\n var appTitle = args[2];\n if (!appTitle) return cb(forms.usage);\n var appTheme = args[3];\n if (!appTheme) return cb(forms.usage);\n var formIds = _.rest(args, 4);\n if (formIds.length === 0) return cb(forms.usage);\n return doAppFormsCreate(appTitle, appTheme, formIds, cb);\n }\n }\n if (action === 'groups') {\n var act = args[1];\n if ((act === 'list') || (!act)) {\n return doListFormsGroups(cb);\n }\n if (act === 'get') {\n var groupId = args[2];\n if (!groupId) return cb(forms.usage);\n return doGetFormsGroup(groupId, cb);\n }\n if (act === 'update') {\n if (args.length !== 8) return cb(forms.usage);\n //do get first then update the object\n var groupId = args[2]; //needed\n\n var groupName = args[3]; // needed\n var userIds = (\"\" === args[4]) ? [] : args[4].split(',') ;\n var formIds = (\"\" === args[5]) ? [] : args[5].split(',');\n var appIds = (\"\" === args[6]) ? [] : args[6].split(',') ;\n var themeIds = (\"\" === args[7]) ? [] : args[7].split(',') ;\n return doFormsGroupUpdate(groupId, groupName, userIds, formIds, appIds, themeIds, cb);\n }\n if (act === 'create') {\n if (args.length !== 7) return cb(forms.usage);\n\n var groupName = args[2];\n var userIds = (\"\" === args[3]) ? [] : args[3].split(',') ;\n var formIds = (\"\" === args[4]) ? [] : args[4].split(',');\n var appIds = (\"\" === args[5]) ? [] : args[5].split(',') ;\n var themeIds = (\"\" === args[6]) ? [] : args[6].split(',') ;\n return doFormsGroupCreate(groupName, userIds, formIds, appIds, themeIds, cb);\n }\n if (act === 'delete') {\n var groupId = args[2];\n if (!groupId) return cb(forms.usage);\n return doDeleteFormsGroup(groupId, cb);\n }\n }\n\n if (action === 'config') {\n var act = args[1];\n var app = args[2];\n if (!act || !app) return cb(forms.usage);\n\n if (act === 'get') {\n return doGetAppConfig(app, cb);\n }\n if (act === 'create') {\n var fileName = args[3];\n if (!fileName) return cb(forms.usage);\n return doCreateAppConfig(app, fileName, cb);\n }\n if (act === 'update') {\n var fileName = args[3];\n if (!fileName) return cb(forms.usage);\n return doUpdateAppConfig(app, fileName, cb);\n }\n if (act === 'delete') {\n return doDeleteAppConfig(app, cb);\n }\n }\n\n if (action === 'notifications') {\n var act = args[1],\n formId = args[2],\n email = args[3];\n\n if (args.length === 2){\n formId = act;\n act = 'list';\n }else if (args.length <2){\n return cb(forms.usage);\n }\n\n if (!formId) {\n return cb(forms.usage);\n }\n if ((act === 'list')) {\n return doListNotifications(formId, cb);\n }\n\n if (!email) {\n return cb(forms.usage);\n }\n\n if (act === 'add') {\n return doAddNotification(formId, email, cb);\n }\n if (act === 'delete') {\n return doDeleteNotification(formId, email, cb);\n }\n }\n if (action === 'formapps') {\n if (!args[1]) return cb(forms.usage);\n return doFormApps(args[1], cb);\n }\n\n\n return cb(forms.usage);\n}", "get form() {\n return this.internals.form;\n }", "get form() {\n return this.internals.form;\n }", "get form() {\n return this.internals.form;\n }", "function getForm (index) {\n\t\t\tloading = true;\n\t\t\tvar form = getbyId(index, forms);\n\t\t\tloading = false;\n\n\t\t\treturn form;\n\t\t}", "formChanged() {}", "function fHideAllForms() {\n fLog(\"fHideAllForms\");\n for (i = 0; i < vaServices.length; i++) {\n var dService = vaServices[i];\n var oForm = dService[\"form\"];\n fHide(oForm);\n }\n}", "applyScopes($event) {\n const $formInputs = $($event.target).parents('form').find(':input');\n const params = {};\n\n $formInputs.each((index, formInput) => {\n const $formInput = $(formInput);\n const inputName = $formInput.attr('name');\n const inputValue = $formInput.val();\n\n if (!inputName || !inputValue) {\n return;\n }\n\n params[inputName] = inputValue;\n });\n\n this.formParameters = params;\n\n this.loadModels(params);\n }", "function initCustomForms() {\n\t\tjcf.replaceAll();\n\t}", "function processForm(evt) {\n}", "function entityPageFunctions() {\n let formClass = '.detail-form',\n detailForm = $j(formClass);\n if (detailForm.length === 0) {\n return;\n }\n\n if ($j('#job_form' + formClass).length === 1) {\n jobDetailPageFunctions();\n }\n\n let cancelButton = $j('#cancel-button'),\n editButton = $j('#edit-button'),\n submitButton = $j('#submit-button'),\n passwordToggleButton = $j('#change-password-button'),\n deleteDryRunButton = $j('#delete-dry-run-button'),\n\n passwordField1ID = '#inputPassword',\n passwordField2ID = passwordField1ID + '-2',\n passwordField1 = $j(passwordField1ID),\n passwordField2 = $j(passwordField2ID),\n passwordFields = $j(passwordField1ID + ',' + passwordField2ID);\n\n editButton.click(function () {\n enableForm();\n });\n cancelButton.click(function () {\n disableForm();\n $j('.detail-form .alert').alert('close');\n });\n passwordToggleButton.click(function () {\n if (passwordField1.prop('disabled')) {\n enableFormPassword();\n } else {\n disableFormPassword()\n }\n });\n\n /**\n * @returns {*|jQuery.fn.init|jQuery|HTMLElement}\n */\n function getFormControls() {\n return $j('form.detail-form .form-control:not(#inputFakeID,#inputID,'\n + passwordField1ID + ','\n + passwordField2ID\n + ',.not-toggleable), input#add-furniture-button, a.remove-furniture, form.detail-form input.custom-control-input');\n }\n\n /**\n * Enable most form fields but not password fields\n */\n function enableForm() {\n getFormControls().prop('disabled', false).removeClass('disabled');\n cancelButton.prop('disabled', false).show();\n submitButton.prop('disabled', false).show();\n passwordToggleButton.prop('disabled', false);\n editButton.hide().prop('disabled', true);\n }\n\n /**\n * Disable all form fields including password fields\n */\n function disableForm() {\n getFormControls().prop('disabled', true).addClass('disabled');\n cancelButton.hide().prop('disabled', true);\n submitButton.prop('disabled', true);\n editButton.prop('disabled', false).show();\n disableFormPassword();\n passwordToggleButton.prop(\"disabled\", true);\n //location.reload(); //the loser's choice\n }\n\n /**\n *\n */\n function enableFormPassword() {\n passwordToggleButton.html('Cancel Change');\n passwordFields.prop(\"disabled\", false);\n }\n\n /**\n *\n */\n function disableFormPassword() {\n passwordToggleButton.html('Change Password')\n passwordFields.prop(\"disabled\", true).val('');\n }\n\n /**\n *\n * @returns {boolean}\n */\n function validateFormInput() {\n let timeStartedField = $j(formClass + \" input[name='time_started']\"),\n timeFinishedField = $j(formClass + \" input[name='time_finished']\"),\n dateStartedField = $j(formClass + \" input[name='date_started']\"),\n dateFinishedField = $j(formClass + \" input[name='date_finished']\");\n\n if (timeStartedField.length > 0 && timeFinishedField.length > 0) { //Validate finish/start times\n let timeStarted = timeStartedField.val(),\n timeFinished = timeFinishedField.val();\n if (timeFinished !== '') {\n if (compareTime(timeStarted, timeFinished) === 1) { //If start time set to be after finish time\n return addError('The <strong>start time</strong> must be before the <strong>finish time</strong>. Please change times.');\n }\n if (compareTime(timeStarted, timeFinished) === 0) { //If start time set to be after finish time\n return addError(\"The <strong>start time</strong> and <strong>finish time</strong> cannot be exactly the same. Please change times.\");\n }\n }\n }\n if (dateStartedField.length > 0 && dateFinishedField.length > 0) { //Validate finish/start dates\n let dateStarted = Date.parse(dateStartedField.val()),\n dateFinished = Date.parse(dateFinishedField.val());\n if ((dateFinished > 0) && (dateStarted > dateFinished)) { //If start date set to be after finish date\n return addError('The <strong>start date</strong> must be before the <strong>finish date</strong>. Please change dates.');\n }\n if ((dateFinished > 0) && dateStarted <= 0) { //If finish date set without a start date\n return addError('The <strong>finish date</strong> should not be set without a valid <strong>start date</strong>. Please set a <strong>start date</strong>.');\n }\n }\n if (passwordField1.length > 0 && !passwordField1.prop('disabled')) {\n let passwordString = passwordField1.val();\n\n if (passwordString === '') {\n return addError('Cannot save with empty <strong>password</strong>. Please enter a <strong>password</strong>.');\n }\n if (passwordString !== passwordField2.val()) {\n return addError(\"<strong>Confirm password</strong> field and <strong>password</strong> don't match. Please re-enter <strong>passwords</strong>.\");\n }\n if (passwordString.length < 8) {\n return addError('<strong>Password</strong> must be at least 8 characters long.');\n }\n }\n return true;\n }\n\n /**\n *\n */\n deleteDryRunButton.click(function () {\n doEntityAction('delete-dry-run');\n });\n\n /**\n *\n */\n detailForm.submit(function (e) { //EntityForm submitted\n console.log('submitted');\n e.preventDefault();\n const formAction = $j('input[name=\"submit_action\"]').val();\n doEntityAction(formAction);\n });\n\n\n /**\n *\n * @param formAction\n * @returns {boolean}\n */\n function doEntityAction(formAction = '') {\n $j('.detail-form .alert').alert('close');\n\n let ajaxURL = 'add_entry.php',\n ajaxData = $j('.detail-form').serialize() + getFurnitureFromInputs() + '&db_action=' + formAction,\n formEntity = $j('input[name=\"entity\"]').val(),\n defaultFailMessage = 'Failed to ' + formAction + ' ' + formEntity + '.',\n formValidated = validateFormInput();\n\n if (!formValidated) {\n return false;\n }\n\n $j.each($j('form.detail-form input[type=checkbox]')\n .filter(function (idx) { //Because un-ticked checkboxes aren't sent to the server unless we explicitly add them\n return $j(this).prop('checked') === false\n }),\n function (idx, el) { // attach matched element names to the formData with a chosen value.\n let emptyVal = '0';\n ajaxData += '&' + $j(el).attr('name') + '=' + emptyVal;\n }\n );\n\n console.log(ajaxData);\n submitButton.prop('disabled', true);\n $j.ajax({\n url: ajaxURL,\n type: 'POST',\n data: ajaxData,\n success: function (data) {\n try {\n data = JSON.parse(data);\n } catch (e) {\n let errorResponseClass = 'json-error-code-block';\n displayMessage('<h4 class=\"alert-heading\">Could not make sense of response. Here\\'s what was received:</h4><code class=\"' + errorResponseClass + '\"></code>');\n $j('.' + errorResponseClass).text(data); //escapes html string\n return false;\n }\n\n if (typeof data['message'] !== 'undefined') {\n $j('.detail-form .messages').prepend(data['message']);\n }\n if (typeof data['result'] !== 'undefined' && data['result'] === 'success') {\n console.log(\"success\");\n if (typeof data['redirect'] !== 'undefined' && data['redirect'] === true && typeof data['redirectURL'] !== 'undefined') {\n location.assign(data['redirectURL']);\n }\n disableForm();\n if (formAction === 'delete-dry-run') {\n $j('#delete-for-real').click(function () {\n doEntityAction('delete-for-real');\n });\n }\n return true;\n } else {\n console.log(\"fail\");\n if (typeof data['message'] === 'undefined') {\n displayMessage(defaultFailMessage);\n }\n submitButton.prop('disabled', false);\n\n }\n },\n error: function (xhr, desc, err) {\n console.log(xhr);\n let ajaxError = 'Details: ' + desc + '\\nError: ' + err;\n console.log(ajaxError);\n submitButton.prop('disabled', false);\n return addError(defaultFailMessage + '\\n' + ajaxError);\n }\n });\n }\n\n /**\n * Get data from job form furniture rows and return as JSON\n *\n * @returns {string}\n */\n function getFurnitureFromInputs() {\n\n let furnitureArray = [];\n $j('div.furniture-group').each(function () {\n let ID = $j(this).find('select.furniture-name').val();\n if (ID > 0) {\n let quantity = $j(this).find('input.furniture-quantity').val();\n if (quantity > 0) {\n let furniture = {};\n furniture[ID] = Number(quantity);\n furnitureArray.push(furniture);\n }\n }\n });\n if (furnitureArray.length === 0) {\n return '';\n }\n\n return '&furniture=' + JSON.stringify(furnitureArray);\n }\n\n /**\n * Function for single job page.\n */\n function jobDetailPageFunctions() {\n\n initRemoveFurnitureButton();\n\n $j(\"#job-status\").change(function () {\n this.className = 'form-control';\n $j(this).addClass($j(this).val());\n });\n\n $j(\"#add-furniture-button\").click(function () {\n let jobFurnitureLast = $j('.job-furniture-row .furniture-group').last();\n let jobFurnitureNew = jobFurnitureLast.clone();\n jobFurnitureNew.find('select').removeAttr('id').val('');\n jobFurnitureNew.find('select option').prop(\"selected\", false).removeAttr(\"selected\");\n jobFurnitureNew.find('.btn.btn-primary').addClass('d-none'); //Hide view button\n\n jobFurnitureNew.find('input.furniture-quantity').val(1); //Set Quantity to 1\n jobFurnitureNew.find('a.remove-furniture').removeClass('disabled').prop('disabled', false); //Enable remove furniture button.\n jobFurnitureNew.insertAfter(jobFurnitureLast);\n\n initRemoveFurnitureButton();\n\n });\n\n /**\n *\n */\n function initRemoveFurnitureButton() {\n $j(\".remove-furniture\").click(function () {\n $j(this).parent().remove();\n });\n }\n }\n}", "function giveFormType(){\n return 'anual';\n}", "function bindToForm(form) {\n\tform.addEventListener('change', UI.reflectParameterChange);\n\n\tvar update = OpenFisca.update.bind(form);\n\n\tupdate();\n\n\tupdate = debounce(update, 300);\n\n\tform.addEventListener('change', update);\n\tform.addEventListener('keyup', update);\n}", "function giveFormType(){\r\n return 'anual';\r\n}", "get form() {\n return this.elementInternals ? this.elementInternals.form : this.proxy.form;\n }", "onSubmit(values) {\n handleFormOnsubmit(values)\n }", "function init_inpt_formulario_cargar_recorrido() {\n // Inputs del formulario para inicializar\n}", "constructor(_formBuilder, f, apiService, _http, dialog, userdata, FBS, activeRoute, router, meta) {\n this._formBuilder = _formBuilder;\n this.f = f;\n this.apiService = apiService;\n this._http = _http;\n this.dialog = dialog;\n this.userdata = userdata;\n this.FBS = FBS;\n this.activeRoute = activeRoute;\n this.router = router;\n this.meta = meta;\n this.isLinear = false;\n this.countrylistarray = [];\n this.statelistarray = [];\n this.citylistarray = [];\n this.selectedstatearray = [];\n this.selectedcityarray = [];\n this.signup = {};\n this.err = 0;\n this.isOptional = false;\n this.submitmodal = false;\n // 2nd form \n this.instrument_list = ['Accordion', 'Bagpipes', 'Banjo', 'Bass guitar', 'Bassoon', 'Berimbau', 'Bongo', 'Cello', 'Clarinet', 'Clavichord', 'Coranglais', 'Cornet', 'Cymbal', 'Didgeridoo', 'DJ Controller', 'Double bass', 'Drum kit', 'Euphonium', 'Flute', 'French horn', 'Glass harmonica', 'Glockenspiel', 'Gong', 'Guitar', 'Hang', 'Harmonica', 'Harp', 'Harpsichord', 'Hammered dulcimer', 'Hurdy gurdy', 'Jew’s harp', 'Kalimba', 'Lute', 'Lyre', 'Mandolin', 'Marimba', 'Melodica', 'Mixing Software', 'Oboe', 'Ocarina', 'Octobass', 'Organ', 'Oud', 'Pan Pipes', 'Pennywhistle', 'Piano', 'Piccolo', 'Pungi', 'Recorder', 'Saxophone', 'Sitar', 'Synthesizer', 'Tambourine', 'Timpani', 'Triangle', 'Trombone', 'Trumpet', 'Theremin', 'Tuba', 'Ukulele', 'Viola', 'Violin', 'Whamola', 'Xylophone', 'Zither'];\n this.musicgenreList = ['Hip Hop', 'Rap', 'Trap', 'Pop', 'EDM', 'Techno', 'Trance', 'Trap', 'Dubstep', 'Country', 'Blues', 'Grunge', 'Indie Rock', 'Classic Rock', 'Punk', 'Ska', 'Heavy Metal', 'Folk', 'Jazz', 'Reggae', 'Classical', 'Latin Pop', 'Latin Rock', 'Cumbia'];\n this.dancegenrelist = ['Hip hop', 'Break Dance', 'Other Urban', 'Latin/Rhythm', 'Free and Improvised Dance', 'American Rhythm', 'Ballroom', 'EDM House', 'Disco', 'Historical', 'Bollywood Dance', 'Country Dance', 'Belly Dance', 'Ceremonial Dance', 'Ballet'];\n this.modelgenrelist = ['Fashion model', 'Editorial Fashion model', 'Fashion catalogue model', 'Runway model', 'Commercial model', 'Print model', 'Glamour model', 'Promotional model', 'Lingerie model', 'Catalog model', 'Petite model', 'Mature model', 'Freelance model', 'Fitness model', 'Parts model', 'Plus-size model', 'Art model', 'Pinup model', 'Alternative model', 'Social influencer', 'Teen/Junior model', 'Black-tape model', 'Body paint model', 'Hiphop model', 'Instagram model'];\n this.webarr = [];\n this.website = [];\n // 3rd step declaration\n this.step = 0;\n this.musicianlist = [];\n this.dancerlist = [];\n this.modellist = [];\n this.fanlist = [];\n this.isfriend = [];\n this.admsg = 0;\n this.axmsg = 0;\n this.socialmediaerror = 0;\n this.visible = true;\n this.selectable = true;\n this.removable = true;\n this.addOnBlur = true;\n this.separatorKeysCodes = [_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__[\"ENTER\"], _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_9__[\"COMMA\"]];\n this.contactarray = [];\n this.userContacts = [];\n this.checkemail = 0;\n this.emailFormControl = new _angular_forms__WEBPACK_IMPORTED_MODULE_2__[\"FormControl\"]('', [\n _angular_forms__WEBPACK_IMPORTED_MODULE_2__[\"Validators\"].required,\n _angular_forms__WEBPACK_IMPORTED_MODULE_2__[\"Validators\"].email,\n ]);\n this.matcher = new MyErrorStateMatcher();\n this.onSignIn = (data) => {\n // setTimeout(() => this.fetchmail(), 1000);\n this.handleAuthorization(data.Zi);\n console.log('onSignIn');\n console.log(data);\n console.log(data.Zi);\n };\n this.meta.setTitle('ArtistXP');\n this.meta.setTag('og:description', 'Musicians, Dancers, Models, Producers, Rappers, Affiliates and Fans can Sign up with ArtistXP to benefit from the advantages of the Social Network for Artists.');\n this.meta.setTag('og:title', 'ArtistXP.com – Signup To Get Started With The Only Social Network For Artists');\n this.meta.setTag('og:type', 'website');\n this.meta.setTag('og:url', 'https://testbed.artistxp.com/signupflow');\n this.meta.setTag('og:image', 'https://audiodeadline-serverless.s3.us-east-2.amazonaws.com/uploads/banner/ArtistXP_Social_Banner.jpg');\n this.meta.setTag('og:keywords', 'Musicians, Artists, Producers, Dancers, Models, Affiliates, Rappers, Fans');\n this.meta.setTag('twitter:description', 'Musicians, Dancers, Models, Producers, Rappers, Affiliates and Fans can Sign up with ArtistXP to benefit from the advantages of the Social Network for Artists.');\n this.meta.setTag('twitter:title', 'ArtistXP.com – Signup To Get Started With The Only Social Network For Artists');\n this.meta.setTag('twitter:card', 'summary_large_image');\n this.meta.setTag('twitter:image', 'https://audiodeadline-serverless.s3.us-east-2.amazonaws.com/uploads/banner/ArtistXP_Social_Banner.jpg');\n this.fstgen();\n this.secgen();\n this.fourthFormGenerate();\n let initParams = {\n appId: '2034821446556410',\n xfbml: true,\n version: 'v2.8'\n };\n FBS.init(initParams);\n if (this.userdata.check('blastorpass') == true && this.userdata.get('blastorpass') == 'true') {\n this.myStepper.next();\n }\n }", "function ajax_get_forms(){\t \n\tvar post_params = \"ajax_action=get_forms\";\n\tcreate_http_request();\n\tsend_http_request(handler_get_forms, \"POST\", target_url, post_params);\n}", "function formValidation() {\n $(selectors.name).on('change', nameValidate);\n $(selectors.contactNo).on('change', contactValidate);\n $(selectors.email).on('change', emailValidate);\n $(selectors.submit).on('click', validation);\n }", "function FillForm() {\r\n}", "function processForm (e) {\n\n var curMenuItem = document.querySelector('.explore-form-menu-item.active'),\n eventType = e.type;\n\n switch (e.type) {\n case 'change':\n case 'keydown':\n case 'keyup':\n case 'focus':\n case 'blur':\n case 'reset':\n if (curMenuItem.classList.contains(eventType)) {\n displayEventObject(e, false);\n }\n break;\n case 'submit':\n if (curMenuItem.classList.contains(eventType)) {\n displayEventObject(e, true);\n } else {\n e.preventDefault();\n }\n break;\n }\n}", "initForm() {\n return __awaiter(this, void 0, void 0, function* () {\n this.form = this.fb.group({\n overrideOnCreationSubscriptions: [''],\n overrideOnUpgradeSubscriptions: [''],\n appRows: this.fb.array([])\n });\n const apps = yield this.defaultSubscriptionsService.getSubscribableTenantApps();\n const appRows = this.form.controls.appRows;\n apps.forEach(app => {\n appRows.push(this.fb.group({\n app: [app],\n subscribedOnCreation: [''],\n subscribedOnUpgrade: ['']\n }));\n });\n this.form\n .get('overrideOnCreationSubscriptions')\n .valueChanges.subscribe(value => this.onOverrideOnCreationSubscriptionsChange(value));\n this.form\n .get('overrideOnUpgradeSubscriptions')\n .valueChanges.subscribe(value => this.onOverrideOnUpgradeSubscriptionsChange(value));\n });\n }", "function cbi_hijack_forms(layer, win, fail, load) {\n\tvar forms = layer.getElementsByTagName('form');\n\tfor (var i=0; i<forms.length; i++) {\n\t\t$(forms[i]).observe('submit', function(event) {\n\t\t\t// Prevent the form from also submitting the regular way\n\t\t\tevent.stop();\n\n\t\t\t// Submit via XHR\n\t\t\tevent.element().request({\n\t\t\t\tonSuccess: win,\n\t\t\t\tonFailure: fail\n\t\t\t});\n\n\t\t\tif (load) {\n\t\t\t\tload();\n\t\t\t}\n\t\t});\n\t}\n}", "function show_form(form_id) {\n transition = 'fast'\n $(\"div\").hide();\n $(\"#intro_header\").show();\n $(\"#lang_select\").show();\n $(\"#form_wrapper\").show();\n $(\"#form_common\").show();\n $(\"#form_common\").children().show();\n $(\"#agreement\").show();\n $(\"#agreement_box\").show();\n $(\"#footer\").show();\n switch (window.age_range) {\n case 1:\n case 2:\n log(\"displaying child form\");\n $(\"#header_child\").show();\n $(\"#form_child\").show();\n $(\"#form_child\").children().show();\n $(\"#agreement_child\").show();\n set_required([\"#last_name\", \"#first_name\",\n \"#home_address\", \"#home_city\", \"#home_zip\", \"#phone\",\n \"#guardian_last_name\", \"#guardian_first_name\",\n \"#agreement_box\"]);\n break;\n case 3:\n log(\"displaying teen form\");\n $(\"#header_teen\").show();\n $(\"#form_teen_adult\").show();\n $(\"#form_teen_adult\").children().show();\n $(\"#agreement_teen_adult\").show();\n set_required([\"#last_name\", \"#first_name\",\n \"#home_address\", \"#home_city\", \"#home_zip\", \"#phone\",\n \"#guardian_last_name\", \"#guardian_first_name\",\n \"#email\", \"#agreement_box\"]);\n break;\n case 4:\n log(\"displaying adult form\");\n $(\"#header_adult\").show();\n $(\"#form_teen_adult\").show();\n $(\"#form_teen_adult\").children().show();\n $(\"#agreement_teen_adult\").show();\n set_required([\"#last_name\", \"#first_name\",\n \"#home_address\", \"#home_city\", \"#home_zip\", \"#phone\",\n \"#guardian_last_name\", \"#guardian_first_name\",\n \"#email\", \"#agreement_box\"]);\n break;\n }\n $(\".required\").show(250);\n}", "function initCustomForms() {\n\tjcf.replaceAll();\n}", "function initCustomForms() {\n\tjcf.replaceAll();\n}", "function formSymptom2Fields(form)\n{\n\tvar error = false;\n\n\t$('#symptom2_error').text('');\n\t\n\terror = processFields('brokenbone', '#symptom2');\n\n\terror = processFields('sprain', '#symptom2');\n\n\terror = processFields('swelling', '#symptom2');\n\n\treturn error;\n}", "function limpiarFormularioRegistrar(form){\n\t\t$(form)[0].reset();\n\t}", "function formInit(event,ui)\n{\n switch (ui.tab.attr(\"id\")){\n case \"searchFormTax\":\n taxFormInit();\n break;\n case \"searchFormLit\":\n litFormInit();\n break;\n case \"searchFormLoc\":\n locFormInit();\n break;\n } // switch\n}", "function setSubmitEvents() {\n\n $('form.new_submit').submit(function(event){\n event.preventDefault();\n\n var values = bindData($(this));\n if (!values) {\n alert('NENHUM VALOR!');\n // ERROR - No values to submit\n }\n\n var action = $(this).attr('action');\n if (action == null || action == \"\") {\n alert('ACTION VAZIO OU NULO!');\n // ERROR - Every form needs an action\n }\n\n // Make this block better\n /**********************************************************************/\n var method = $(this).attr('method');\n if ((method == null || action == \"\")) {\n method = \"POST\"; // Default method will be 'POST'\n }\n\n method = method.toUpperCase();\n if (method != 'POST' && method != 'GET') {\n alert('METHOD NÃO É POST NEM GET!');\n // ERROR - Method should be a POST or a GET\n }\n /**********************************************************************/\n\n var goodToGo = true;\n if ($(this).hasClass(\"needs-confirmation\")) {\n var message = \"Pressione OK caso realmente queira realizar esse envio.\";\n if ($(this).attr(\"data-confirm-msg\") != \"\") message = $(this).attr(\"data-confirm-msg\");\n if (!confirm(message)) goodToGo = false;\n }\n\n if (goodToGo) genericSubmit(action, method, values);\n });\n\n $('a.post').bind('click', function(event){\n event.preventDefault();\n\n var href = $(this).attr('href');\n var id = $(this).attr('id');\n\n var values = {};\n values['id'] = id;\n\n genericSubmit(href, 'POST', values);\n });\n}", "function webforms(){\n \n // Run through HTML5's new input attributes to see if the UA understands any.\n // We're using f which is the <input> element created early on\n // Mike Taylr has created a comprehensive resource for testing these attributes\n // when applied to all input types: \n // http://miketaylr.com/code/input-type-attr.html\n // spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary\n ret[input] = (function(props) {\n for (var i = 0,len=props.length;i<len;i++) {\n attrs[ props[i] ] = !!(props[i] in f);\n }\n return attrs;\n })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));\n\n // Run through HTML5's new input types to see if the UA understands any.\n // This is put behind the tests runloop because it doesn't return a\n // true/false like all the other tests; instead, it returns an object\n // containing each input type with its corresponding true/false value \n \n // Big thx to @miketaylr for the html5 forms expertise. http://miketaylr.com/\n ret[inputtypes] = (function(props) {\n for (var i = 0,bool,len=props.length;i<len;i++) {\n f.setAttribute('type', props[i]);\n bool = f.type !== 'text';\n \n // chrome likes to falsely purport support, so we feed it a textual value\n // if that doesnt succeed then we know there's a custom UI\n if (bool){ \n\n f.value = smile;\n \n /* Safari 4 is allowing the smiley as a value, and incorrecty failing..\n the test fixes for webkit only, but breaks Opera.. \n if (/range/.test(f.type)){\n bool = test_props_all('appearance',function(prop,m){ return m_style[prop] !== 'textfield' }) \n } \n */\n \n if (/tel|search/.test(f.type)){\n // spec doesnt define any special parsing or detectable UI \n // behaviors so we pass these through as true\n \n } else if (/url|email/.test(f.type)) {\n // real url and email support comes with prebaked validation.\n bool = f.checkValidity && f.checkValidity() === false;\n \n } else {\n bool = f.value != smile;\n }\n }\n \n inputs[ props[i] ] = !!bool;\n }\n return inputs;\n })('search tel url email datetime date month week time datetime-local number range color'.split(' '));\n\n }", "registerHandless() {\n this.formEl.onsubmit = (event) => this.addRepository(event);\n }", "function changeFormMethod() {\n //values setters\n document.getElementById('checkAll').checked = true;\n // document.getElementById('searchBox').value = \"Random Word\";\n\n // document.getElementById('searchBox').setParameter('required','required');\n\n //execution\n document.getElementById('searchForm').action=\"simplesearch\";/*random result*//*lateri will change the action*/\n}", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('calGuiasFrm.accion'), \n\t\tget('calGuiasFrm.origen'));\n\n\n\tset('calGuiasFrm.id', jsCalGuiasId);\n\tset('calGuiasFrm.codGuia', jsCalGuiasCodGuia);\n\tset('calGuiasFrm.dpteOidDepa', [jsCalGuiasDpteOidDepa]);\n\tset('calGuiasFrm.valTitu', jsCalGuiasValTitu);\n\tset('calGuiasFrm.fecInicVali', jsCalGuiasFecInicVali);\n\tset('calGuiasFrm.fecFinVali', jsCalGuiasFecFinVali);\n\tset('calGuiasFrm.valDescGuia', jsCalGuiasValDescGuia);\n\tset('calGuiasFrm.paisOidPais', [jsCalGuiasPaisOidPais]);\n\t\n}", "function initializeForm() {\n editor.afform = editor.data.definition;\n if (!editor.afform) {\n alert('Error: unknown form');\n }\n if (editor.mode === 'clone') {\n delete editor.afform.name;\n delete editor.afform.server_route;\n editor.afform.is_dashlet = false;\n editor.afform.title += ' ' + ts('(copy)');\n }\n $scope.canvasTab = 'layout';\n $scope.layoutHtml = '';\n editor.layout = {'#children': []};\n $scope.entities = {};\n\n if (editor.getFormType() === 'form') {\n editor.allowEntityConfig = true;\n editor.layout['#children'] = afGui.findRecursive(editor.afform.layout, {'#tag': 'af-form'})[0]['#children'];\n $scope.entities = _.mapValues(afGui.findRecursive(editor.layout['#children'], {'#tag': 'af-entity'}, 'name'), backfillEntityDefaults);\n\n if (editor.mode === 'create') {\n editor.addEntity(editor.entity);\n editor.afform.create_submission = true;\n editor.layout['#children'].push(afGui.meta.elements.submit.element);\n }\n }\n\n else if (editor.getFormType() === 'block') {\n editor.layout['#children'] = editor.afform.layout;\n editor.blockEntity = editor.afform.join_entity || editor.afform.entity_type;\n $scope.entities[editor.blockEntity] = backfillEntityDefaults({\n type: editor.blockEntity,\n name: editor.blockEntity,\n label: afGui.getEntity(editor.blockEntity).label\n });\n }\n\n else if (editor.getFormType() === 'search') {\n editor.layout['#children'] = afGui.findRecursive(editor.afform.layout, {'af-fieldset': ''})[0]['#children'];\n editor.searchDisplay = afGui.findRecursive(editor.layout['#children'], function(item) {\n return item['#tag'] && item['#tag'].indexOf('crm-search-display-') === 0;\n })[0];\n editor.searchFilters = getSearchFilterOptions();\n }\n\n // Set changesSaved to true on initial load, false thereafter whenever changes are made to the model\n $scope.changesSaved = editor.mode === 'edit' ? 1 : false;\n $scope.$watch('editor.afform', function () {\n $scope.changesSaved = $scope.changesSaved === 1;\n }, true);\n }", "function setFormEvents() {\n\t\tvar $lightbox = $('.lightbox');\n\t\t$lightbox.find('.submit').click(submit);\n\t\t$lightbox.find('.select-field').click(selectUpdate);\n\t\t$lightbox.find('input[type=number]').keydown(checkInput);\n\t\t$lightbox.find('.more-info, em.close-form, .cover').click(closeForm);\n\t\t$lightbox.find('#req-more-info .close-form').click(function(){\n\t\t\t$lightbox.find('.more-info').click();\n\t\t});\n\n\t\t// Stop click even propogating to lightbox to prevent closing modal\n\t\t$lightbox.find('form').click(function(e) {\n\t\t\treturn false;\n\t\t});\n\n\t\t$lightbox.find('.checkbox-field label').click(function() {\n\t\t\tvar $input = $(this).find('input');\n\t\t\t$input.prop('checked', !$input.prop('checked'));\n\t\t});\n\n\t\t$lightbox.find('.more-info label').click(function() {\n\t\t\t$(this).next('input').focus();\n\t\t});\n\n\t\t$lightbox.find('.select-field').focus(function() {\n\t\t\t$(this).children('.select-list').focus();\n\t\t});\n\n\t\tvar textInputs = $lightbox.find('.more-info input[type=text], .more-info input[type=number]');\n\t\tvar inputs = $lightbox.find('.more-info input, .more-info .select-list, .more-info .checkbox-field>label');\n\t\tvar checkboxes = $lightbox.find('.more-info .checkbox-field>label');\n\t\tvar selectLists = $lightbox.find('.select-list');\n\t\tvar selectListItems = selectLists.children('div');\n\n\t\t$lightbox.find('.submit').keydown(function(e) {\n\t\t\tenterClick.call($(this).children('input'), e);\n\t\t});\n\t\tcheckboxes.keydown(enterClick);\n\t\tfunction enterClick(e) {\n\t\t\tif (e.which === 13) {\n\t\t\t\t$(this).click();\n\t\t\t}\n\t\t}\n\t\tcheckboxes.click(function() {\n\t\t\tvar checked = $lightbox.find('.checkbox-field[data-required] input:checked').closest('.checkbox-field');\n\t\t\tvar parentForm = $(this).closest('form');\n\t\t\tparentForm.children('.input-field').removeClass('input-field').children('input, .select-list').attr('tabindex', '-1'); //.each(function(){this.disabled=true;});\n\t\t\tchecked.each(function() {\n\t\t\t\tvar required = $(this).attr('data-required').split(' ');\n\t\t\t\trequired.forEach(function(reqGroup) {\n\t\t\t\t\tthis.children('.' + reqGroup).addClass('input-field').children('input, .select-list').attr('tabindex', '0'); //.each(function(){this.disabled=false;});\n\t\t\t\t}, parentForm);\n\t\t\t});\n\t\t});\n\n\t\tselectListItems.click(function() {\n\t\t\tif (!$(this).hasClass('selected')) {\n\t\t\t\t$(this).siblings('.selected').removeClass('selected');\n\t\t\t\t$(this).addClass('selected');\n\t\t\t}\n\t\t});\n\t\tselectLists.click(function(e) {\n\t\t\t$(this).parent().toggleClass('open');\n\t\t});\n\t\tselectLists.keydown(function(e) {\n\t\t\tswitch (e.which) {\n\t\t\t\tcase 13:\n\t\t\t\t\t$(this).click();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 38:\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$(this).parent().addClass('open');\n\t\t\t\t\tvar selected = $(this).children('.selected');\n\t\t\t\t\tif (selected.prev('div').length) {\n\t\t\t\t\t\tselected.removeClass('selected');\n\t\t\t\t\t\tselected.prev('div').addClass('selected');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 40:\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$(this).parent().addClass('open');\n\t\t\t\t\tvar selected = $(this).children('.selected');\n\t\t\t\t\tif (selected.next('div').length) {\n\t\t\t\t\t\tselected.removeClass('selected');\n\t\t\t\t\t\tselected.next('div').addClass('selected');\n\t\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tinputs.focus(function() {\n\t\t\t$(this).parent().closest('div').addClass('focused');\n\t\t});\n\t\tinputs.focusout(function() {\n\t\t\t$(this).parent().removeClass('focused');\n\t\t\t$(this).parent().removeClass('open');\n\t\t});\n\t\ttextInputs.change(function() {\n\t\t\tif ($(this).val() === '') $(this).parent('.text-field').removeClass('filled');\n\t\t\telse $(this).parent('.text-field').addClass('filled');\n\t\t});\n\t}", "function init (){\n mostrarform(false);\n listar();\n $(\"#formulario\").on(\"submit\",function(e)\n\t{\n\t\tguardaryeditar(e);\t\n\t})\n}", "function initCustomForms() {\n jcf.replaceAll();\n}", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cobUsuarEtapaCobraDetalFrm.accion'), \n\t\tget('cobUsuarEtapaCobraDetalFrm.origen'));\n\n\n\tset('cobUsuarEtapaCobraDetalFrm.id', jsCobUsuarEtapaCobraDetalId);\n\tset('cobUsuarEtapaCobraDetalFrm.ueccOidUsuaEtapCobr', [jsCobUsuarEtapaCobraDetalUeccOidUsuaEtapCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.edtcOidEtapDeudTipoCarg', [jsCobUsuarEtapaCobraDetalEdtcOidEtapDeudTipoCarg]);\n\tset('cobUsuarEtapaCobraDetalFrm.zsgvOidSubgVent', [jsCobUsuarEtapaCobraDetalZsgvOidSubgVent]);\n\tset('cobUsuarEtapaCobraDetalFrm.zorgOidRegi', [jsCobUsuarEtapaCobraDetalZorgOidRegi]);\n\tset('cobUsuarEtapaCobraDetalFrm.zzonOidZona', [jsCobUsuarEtapaCobraDetalZzonOidZona]);\n\tset('cobUsuarEtapaCobraDetalFrm.zsccOidSecc', [jsCobUsuarEtapaCobraDetalZsccOidSecc]);\n\tset('cobUsuarEtapaCobraDetalFrm.terrOidTerr', [jsCobUsuarEtapaCobraDetalTerrOidTerr]);\n\tset('cobUsuarEtapaCobraDetalFrm.melcOidMetoLiquCobr', [jsCobUsuarEtapaCobraDetalMelcOidMetoLiquCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.eucoOidEstaUsuaEtapCobr', [jsCobUsuarEtapaCobraDetalEucoOidEstaUsuaEtapCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.gacaOidGuioArguCabe', [jsCobUsuarEtapaCobraDetalGacaOidGuioArguCabe]);\n\tset('cobUsuarEtapaCobraDetalFrm.valObse', jsCobUsuarEtapaCobraDetalValObse);\n\t\n}", "function resetForms(){\n\tconsole.warn('****resetForms()')\n\tforms = $('form')\n\tfor (form in forms.length){\n\t\ttry{\n\t\t\tforms[form].reset();\n\t\t}catch(err){}\n\t}\n}", "function processFields(form, keep, funct) {\n\t//Process each field\n\tvar elements = form.elements;\n\tfor (var i = 0, len = elements.length; i < len; i++) {\n\t\tvar field = elements[i];\n\t\tif (!field.type || field.type == \"hidden\") {\n\t\t\tcontinue;\n\t\t}\n\t\tvar toKeep = keep.find(function(e) {\n\t\t\treturn e === field || e == field.id || e == field.name;\n\t\t});\n\t\tif (!toKeep) {\n\t\t\tfunct(field);\n\t\t}\n\t\tfield = null;\n\t};\n\t\n\t//Process the multi drop downs\n\tfor (var i = 0; i < document.multiDropDowns.length; i++) {\n\t\tvar mdd = document.multiDropDowns[i];\n\t\tif (keep.indexOf(mdd.name) < 0) {\n\t\t\tfunct(mdd);\n\t\t}\n\t};\n}", "function getFormRoute(form){\r\n var hash = getHashFromUrl(form.action);\r\n console.log(\"getFormRoute | hash: %s\", hash);\r\n var route = getRoute(hash);\r\n var params = {};\r\n for(var i=0;i<form.elements.length;i++){\r\n var e = form.elements[i];\r\n var key = e.name;\r\n var type = e.type.toLowerCase();\r\n if(!key || ((type==\"radio\" || type==\"checkbox\") && !e.checked)) continue;\r\n var value = e.value;\r\n updateParamItem(params,key,value,false);\r\n }\r\n console.log(\"params: %s\", JSON.stringify(params));\r\n $.extend(route.params,params);\r\n if(form.method.toLowerCase() == \"get\"){\r\n $.extend(route.getParams,params);\r\n }\r\n else{\r\n // create post params\r\n route.postParams = params;\r\n }\r\n console.log(\"updated route: %s\", JSON.stringify(route));\r\n return route;\r\n }", "function handler_get_forms(){\n\tif(xmlHttp.readyState == 4 && xmlHttp.status == 200){\n\t\tpopulate_list_from_xml(xmlHttp.responseText, 'form_list');\n\n\t}\n}", "function showForm(form) {\r\n // check if selected options is just the placeholder\r\n if (form === 'none') {\r\n return;\r\n }\r\n\r\n // reset open form\r\n openForm = null;\r\n\r\n // set dataType\r\n dataType = form;\r\n $(\"#form\").load('components/' + form + 'Form.html');\r\n\r\n // reset all fields\r\n resetAllFields();\r\n}", "function puliziaForm() {\n var action = $(this).data(\"href\");\n // Invio il form\n $(\"#formRichiestaEconomale\").attr(\"action\", action)\n .submit();\n }", "function puliziaForm() {\n var action = $(this).data(\"href\");\n // Invio il form\n $(\"#formRichiestaEconomale\").attr(\"action\", action)\n .submit();\n }", "function SearchForm() {\n\n}", "onFormReady(form) {\n this.form = form;\n setTimeout(() => {\n triggerFn(this.$queue.pop());\n });\n }", "function init(){\n\tmostrarform(false);\n\tlistar();\n\n\t$(\"#formulario\").on(\"submit\",function(e){\n\t\tguardaryeditar(e);\n\t});\n\n}", "function handle_form(form_name, submit_name, result_tgt) {\n var submit_action = function(e) {\n e.preventDefault();\n $.ajax({\n url: $(form_name).attr('action'),\n method: $(form_name).attr('method'),\n data: $(form_name).serialize(),\n beforeSend: spinner(result_tgt),\n }).done(function(data){$(result_tgt).empty().html(data);});\n };\n $(form_name).submit(submit_action);\n $(submit_name).click(submit_action);\n}", "function planFormCaller() {\n plan.planForm();\n}", "static buildForms() {\r\n const bld = new Immeuble()\r\n let forms = []\r\n forms.push(\r\n bld.Batiment1(),\r\n bld.Porte(),\r\n bld.Batiment2(),\r\n bld.Porte1(),\r\n bld.Batiment3(),\r\n bld.Porte2(),\r\n bld.Batiment4(),\r\n bld.Porte3(),\r\n bld.Batiment5(),\r\n bld.Porte4()\r\n )\r\n\r\n const builds = forms\r\n return builds\r\n\r\n }", "function webforms(){\n \n // Run through HTML5's new input attributes to see if the UA understands any.\n // We're using f which is the <input> element created early on\n // Mike Taylr has created a comprehensive resource for testing these attributes\n // when applied to all input types: \n // http://miketaylr.com/code/input-type-attr.html\n // spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary\n ret['input'] = (function(props) {\n for (var i = 0,len=props.length;i<len;i++) {\n attrs[ props[i] ] = !!(props[i] in f);\n }\n return attrs;\n })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));\n\n // Run through HTML5's new input types to see if the UA understands any.\n // This is put behind the tests runloop because it doesn't return a\n // true/false like all the other tests; instead, it returns an object\n // containing each input type with its corresponding true/false value \n \n // Big thanks to @miketaylr for the html5 forms expertise. http://miketaylr.com/\n ret['inputtypes'] = (function(props) {\n for (var i = 0, bool, len=props.length ; i < len ; i++) {\n \n f.setAttribute('type', props[i]);\n bool = f.type !== 'text';\n \n // Chrome likes to falsely purport support, so we feed it a textual value;\n // if that doesnt succeed then we know there's a custom UI\n if (bool){ \n\n f.value = smile;\n \n if (/^range$/.test(f.type) && f.style.WebkitAppearance !== undefined){\n \n docElement.appendChild(f);\n var defaultView = doc.defaultView;\n \n // Safari 2-4 allows the smiley as a value, despite making a slider\n bool = defaultView.getComputedStyle && \n defaultView.getComputedStyle(f, null).WebkitAppearance !== 'textfield' && \n \n // Mobile android web browser has false positive, so must\n // check the height to see if the widget is actually there.\n (f.offsetHeight !== 0);\n \n docElement.removeChild(f);\n \n } else if (/^(search|tel)$/.test(f.type)){\n // Spec doesnt define any special parsing or detectable UI \n // behaviors so we pass these through as true\n \n // Interestingly, opera fails the earlier test, so it doesn't\n // even make it here.\n \n } else if (/^(url|email)$/.test(f.type)) {\n\n // Real url and email support comes with prebaked validation.\n bool = f.checkValidity && f.checkValidity() === false;\n \n } else {\n // If the upgraded input compontent rejects the :) text, we got a winner\n bool = f.value != smile;\n }\n }\n \n inputs[ props[i] ] = !!bool;\n }\n return inputs;\n })('search tel url email datetime date month week time datetime-local number range color'.split(' '));\n\n }", "function registerFormButtons() {\n const btns = document.querySelectorAll(\".form-button\");\n\n btns.forEach((btnElem) => {\n btnElem.addEventListener(\"click\", () => {\n if (!btnElem.classList.contains(\"unqualified-button\")) nextStep();\n });\n });\n\n const answerBtns = document.querySelectorAll(\".answer-button\");\n answerBtns.forEach((btn) => {\n btn.addEventListener(\"click\", () => {\n const stepValue = btn.innerText.trim();\n const fieldName = btn.parentElement.getAttribute(\"propName\");\n setField(fieldName, stepValue);\n });\n });\n\n const unqualified = document.querySelectorAll(\".unqualified-button\");\n unqualified.forEach((btn) => {\n btn.addEventListener(\"click\", () => {\n hideAllSteps();\n submitted = true;\n // Reset navigation state\n history.go((currentStep - 1) * -1);\n updateArrowVisibility();\n const stepController = document.querySelector(\".step-controller\");\n hide(stepController);\n showUnqualified();\n });\n });\n\n // -- continues\n const continueBtns = document.querySelectorAll(\".continue-button\");\n continueBtns.forEach((btn) => {\n btn.addEventListener(\"click\", () => {\n const stepValue = document.getElementById(btn.getAttribute(\"for\")).value;\n const fieldName = btn.parentElement.getAttribute(\"propName\");\n setField(fieldName, stepValue);\n });\n });\n\n const finalBtn = document.querySelectorAll(\".final-button\");\n finalBtn.forEach((btn) =>\n btn.addEventListener(\"click\", () => {\n const fNameElem = document.getElementById(\"first-name\");\n const lNameElem = document.getElementById(\"last-name\");\n const phoneElem = document.getElementById(\"phone-number\");\n\n setField(\"firstname\", fNameElem.value);\n setField(\"lastname\", lNameElem.value);\n setField(\"phone\", phoneElem.value);\n\n submit();\n })\n );\n}", "function ajax_populate_forms(){\n\tcreate_http_request();\n\tvar post_params = \"ajax_action=get_form_list\";\n\t// call method to sent the request\n\tsend_http_request(handler_ajax_populate_forms, \"POST\", target_url, post_params);\n}" ]
[ "0.63619393", "0.62982017", "0.62664354", "0.6104025", "0.6090277", "0.6049145", "0.5967334", "0.59529597", "0.59292257", "0.5902281", "0.588008", "0.5880065", "0.5869194", "0.58580196", "0.5857524", "0.5855695", "0.5853861", "0.5847028", "0.5828548", "0.58064574", "0.5805229", "0.57881933", "0.5782048", "0.57790756", "0.57779837", "0.57532775", "0.57329994", "0.5731478", "0.57220894", "0.5697039", "0.5687097", "0.5687097", "0.5687097", "0.5687097", "0.5676418", "0.5672474", "0.56723386", "0.56549215", "0.5650639", "0.5642906", "0.5641896", "0.5641228", "0.5615343", "0.5613684", "0.5613336", "0.5610831", "0.5610831", "0.5610831", "0.5601572", "0.56012565", "0.55934346", "0.55926543", "0.55822885", "0.55778074", "0.5576608", "0.5573924", "0.55597264", "0.55509186", "0.5548778", "0.5544466", "0.55317265", "0.552892", "0.55157393", "0.5507597", "0.5479509", "0.5447189", "0.54374593", "0.5434329", "0.5420501", "0.5419493", "0.5419493", "0.54183793", "0.5410015", "0.5403368", "0.5399937", "0.53966975", "0.53939027", "0.5385591", "0.5377316", "0.53742784", "0.5370454", "0.53702605", "0.536399", "0.53614026", "0.5359786", "0.5356229", "0.5339018", "0.53386396", "0.5336892", "0.5333281", "0.5333281", "0.53327954", "0.5321939", "0.5320232", "0.5319466", "0.53182596", "0.5310136", "0.53008187", "0.5299488", "0.5279518" ]
0.6515821
0
resolves with one form and form inputs by id
function getFormById(id) { return new Promise((resolve, reject) => { if(!form) reject(new Error("forms is not found")); let formData = {}; for(let i in form) { if(form[i].formid == id) { formData.form = form[i]; break; } } let form_field_data = []; for(let j in form_field) { if(form_field[j].formid == id) form_field_data.push(form_field[j]); } formData.form_field = form_field_data; // should reject if none is found or something resolve(formData) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addInputForm (id) {\n const formId = id + 1;\n const plusButton = document.querySelector(`#addInputForm${id}`);\n const form = document.querySelector(`#inputForm${formId}`);\n plusButton.addEventListener(\"click\", () => {\n form.style.display = \"inline\";\n });\n}", "getById(id) {\r\n const i = new Form(this);\r\n i.concat(`('${id}')`);\r\n return i;\r\n }", "function updateForm(id) {\n return new Promise((resolve, reject) => {\n if(!form || id) reject(new Error(\"forms is not found\"));\n resolve(true);\n });\n}", "function form(id) {\n console.log(id);\n $('#' + id).submit()\n}", "function getFieldsForForm(id)\n\t\t{\n\t\t\tvar deferred = $q.defer();\n\t\t\t// GET the fields from the form that matches the id\n\t\t\t$http.get(\"/api/assignment/form/\" + id + \"/field\")\n\t\t\t.success(function(response) \n\t\t\t{\n\t\t\t\tdeferred.resolve(response);\n\t\t\t});\n\n\t\t\treturn deferred.promise;\n\t\t}", "getIndexForm(id) {\n return this.state.formFields.findIndex(e => e.id === id)\n }", "function handleFormExperiment() {\n // Reset value of form Add Experiment \n $('#resetAddExperiment').click(function () {\n $('#addExperimentForm')[0].reset();\n });\n\n // Reset value of form Add Experiment \n $('#resetAddExperimentText').click(function () {\n $('#addExperimentFormText')[0].reset();\n });\n\n // UPDATE EXPERIMENT\n // Reset value of form Update User \n $('#resetUpdateExperiment').click(function () {\n // i want avoid the rest of the field ID\n var tempID = $('#idExperimentFormUpdate').val();\n\n // I reset the form\n $('#updateExperimentForm')[0].reset();\n\n // I write agant the ID\n $('#idExperimentFormUpdate').val(tempID);\n\n });\n}", "function getForm(parentId, childIds, childClasses) {\n\n var form = document.getElementById(parentId);\n\n for (let id of childIds.split(' ')) {\n form[camelCase(id)] = document.getElementById(id);\n }\n\n for (let cl of childClasses.split(' ')) {\n let es = form.getElementsByClassName(cl);\n form[camelCase(cl)] = es.length === 1 ? es[0] : es;\n }\n\n return form;\n }", "function getForm(elem, event) {\n let queryElem = new mona_dish_1.DQ(elem);\n let eventTarget = (event) ? new mona_dish_1.DQ((0, RequestDataResolver_1.getEventTarget)(event)) : mona_dish_1.DomQuery.absent;\n if (queryElem.isTag(Const_1.HTML_TAG_FORM)) {\n return queryElem;\n }\n //html 5 for handling\n if (queryElem.attr(Const_1.HTML_TAG_FORM).isPresent()) {\n let formId = queryElem.attr(Const_1.HTML_TAG_FORM).value;\n let foundForm = mona_dish_1.DQ.byId(formId, true);\n if (foundForm.isPresent()) {\n return foundForm;\n }\n }\n let form = queryElem.firstParent(Const_1.HTML_TAG_FORM)\n .orElseLazy(() => queryElem.byTagName(Const_1.HTML_TAG_FORM, true))\n .orElseLazy(() => eventTarget.firstParent(Const_1.HTML_TAG_FORM))\n .orElseLazy(() => eventTarget.byTagName(Const_1.HTML_TAG_FORM))\n .first();\n assertFormExists(form);\n return form;\n }", "function resolveSourceForm(internalContext, elem) {\n let sourceFormId = internalContext.getIf(Const_1.CTX_PARAM_SRC_FRM_ID);\n let sourceForm = new mona_dish_2.DQ(sourceFormId.isPresent() ? document.forms[sourceFormId.value] : null);\n sourceForm = sourceForm.orElseLazy(() => elem.firstParent(Const_1.HTML_TAG_FORM))\n .orElseLazy(() => elem.querySelectorAll(Const_1.HTML_TAG_FORM))\n .orElseLazy(() => mona_dish_2.DQ.querySelectorAll(Const_1.HTML_TAG_FORM));\n return sourceForm;\n}", "function getInput(name){\n var $form = $(\"#\" + formID);\n return $form.find('input[name=\\\"' + name + '\\\"]');\n}", "function resolveForm(elem, event) {\n return Lang_1.ExtLang.getForm(elem.getAsElem(0).value, event);\n}", "function formready(formid)\n{\nformhandler('#'+formid); \n}", "function formSymptom1Fields(form, id_form)\n{\n\tvar nombre = '';\n\tvar tipo = '';\n\tvar valor = '';\n\tvar error = false;\n\tvar val = '';\n\t\t\t\n\tform.each(function(){\n \n nombre = $(this).context.name;\n\n tipo = $(this).context.type;\n\n valor = $(this).context.value;\n\n $('#error_'+nombre+\"\").text('');\n\n if(tipo==='radio' && !$(\"input[name='\"+nombre+\"']:checked\", \"\"+id_form+\"\").is(\":checked\"))\n {\n \t\n \t$('#error_'+nombre+\"\").text('(*)');\n\n \terror = true;\n }\n \n //call_emergency(nombre,id_form); // Redirect to page for calling to 911 \n\t\tif(call_emergency(nombre,id_form)==1) return error = 1;\n\t});\n\treturn error;\n}", "editEventForm(editId) {\n const currentUserId = document.querySelector(\".hiddenUID\");\n const hiddenId = document.querySelector(\".hiddenId\");\n const newEventName = document.querySelector(\"#eventNameInput\");\n const newEventDate = document.querySelector(\"#dateInput\");\n const newEventLocation = document.querySelector(\"#locationInput\");\n\n eventAPI.getEventEdit(editId).then(event => {\n (currentUserId.value = event.userId),\n (newEventName.value = event.eventName),\n (newEventDate.value = event.date),\n (newEventLocation.value = event.location);\n hiddenId.value = event.id;\n });\n }", "function editForm(id){\n $('#editForm').modal('show');\n console.log(id)\n _roles_list();\n document.getElementById(\"name2\").value = document.getElementById('detail_name').innerHTML;\n document.getElementById(\"email2\").value = document.getElementById('detail_email').innerHTML;\n document.getElementById(\"phone2\").value = document.getElementById('detail_phone').innerHTML;\n document.getElementById(\"role_body2\").value = document.getElementById('detail_role_id').innerHTML;\n}", "function setFormIDToCheck(form_id,el_type,action) {\n\tvar aTmp = new Array();\n\n\tif (!form_id) return ;\n\tif (el_type == 'all') el_type = false;\n\n\t// Obtenemos la instancia formulario\n\tform = document.getElementById(form_id);\n\n\tif (form) {\n\t\t// SI ya lo tenemos, salirse\n\t\tfor (i=0; i < this.aForms.length; i++) \n\t\t\tif (this.aForms[i][0] == form_id) return;\n\n\t\taTmp[0] = form_id;\n\t\taTmp[1] = false;\n\t\tif (action) aTmp[2] = action;\n\t\tthis.aForms.push(aTmp);\n\t\tfor (i=0; i < form.elements.length; i++) {\n\t\t\tif (form.elements[i].type != 'hidden') {\n\t\t\t\tif (!el_type || el_type == form.elements[i].type) {\n\t\t\t\t\tform.elements[i].onchange = onChangeFormElement;\n\t\t\t\t}\n\t\t\t\t// form.elements[i].disabled = true;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// alert('No form');\n\t}\n}", "function handleFormUser() {\n\n // ADD USER\n // Reset value of form Add User \n $('#resetAddUser').click(function () {\n $('#addUserForm')[0].reset();\n });\n\n // UPDATE USER\n // Reset value of form Update User \n $('#resetUpdateUser').click(function () {\n // i want avoid the rest of the field ID\n var tempID = $('#idUserFormUpdate').val();\n var user = $(\"usernameUserFormUpdate\").val();\n var mail = $(\"emailUserFormUpdate\").val();\n \n\n // I reset the form\n $('#updateUserForm')[0].reset();\n\n // I write agant the ID\n $('#idUserFormUpdate').val(tempID);\n $(\"usernameUserFormUpdate\").val(user);\n $(\"emailUserFormUpdate\").val(mail);\n\n });\n}", "function form2ArrayByRow(form_name, id) {\n var form_array = {};\n\n $('form :input[name^=\"' + form_name + '[\"][data-path=\"' + id +'\"]').each(function (id, object) {\n // INPUT name is in the form of \"form_name[value]\", get value only\n form_array[$(this).attr('name').substr(form_name.length + 1, $(this).attr('name').length - form_name.length - 2)] = $(this).val();\n });\n return form_array;\n}", "function divToForm(div){\n\n//var cloDiv = doc.importNode(div.cloneNode(true), true);//lo clono perche' altrimenti cambiando div cambierebbe anche la pagina corrente\nvar cloDiv = div.cloneNode(true);\n//var form = doc.importNode(document.createElement(\"form\").cloneNode(true), true);\nvar form = document.createElement(\"form\");\n//var inputs = cloDiv.getElementsByTagName(\"input\");\nvar inputs = document.evaluate('//*[name(.)=\"input\"]', cloDiv, null, XPathResult.ANY_TYPE, null);\ncompose(form, \".\", inputs);\nreturn form;\t}", "function submitForm(id)\n{\n\tform = document.getElementById(id);\n}", "getContainerForms(namingContainerId) {\n if (namingContainerId.isPresent()) {\n //naming container mode, all forms under naming container id must be processed\n return (0, mona_dish_1.DQ$)(this.getNameOrIdSelector(namingContainerId.value))\n // missing condition if the naming container is not present we have to\n // use the body as fallback\n .orElseLazy(() => mona_dish_1.DQ.byTagName(Const_1.HTML_TAG_BODY))\n .byTagName(Const_1.HTML_TAG_FORM, true);\n }\n else {\n return mona_dish_1.DQ.byTagName(Const_1.HTML_TAG_FORM);\n }\n }", "function getInputVal1(id) {\n return document.getElementById(id).value;\n}", "handleInput(e){\n this.props.updateFormConciliaciones(e.target.id, e.target.value)\n }", "function replaceForms(value, key){\n const el = document.getElementById(key);\n el.value = value;\n}", "function setFormInput(option, hiddenId, textId) {\n if ((option.id && option.id.length > 0)|| $(hiddenId).val().length > 0) {\n $(hiddenId).val(option.id);\n $(hiddenId).change();\n\n }\n if ((option.value && option.value.length > 0) || $(textId).val().length > 0) {\n $(textId).val(option.value);\n $(textId).change();\n }\n\n}", "function getFormHandleForm(seq)\n{\nvar name = 'iiiFormHandle_' + seq;\nvar obj = getObj(name);\nreturn obj.form;\n}", "static fetch_form(board_id = 0){\n\t\tlet forms = ProBoards_Post_Forms.SETTINGS.forms;\n\t\tlet form = null;\n\n\t\tfor(let f = 0, fl = forms.length; f < fl; ++ f){\n\t\t\tif(!forms[f].unique_id || !forms[f].enabled){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(forms[f].boards.find(id => parseInt(id, 10) == board_id)){\n\t\t\t\tform = forms[f];\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn form;\n\t}", "function getInputValues(id){\n return document.getElementById(id).value;\n}", "function getForm (index) {\n\t\t\tloading = true;\n\t\t\tvar form = getbyId(index, forms);\n\t\t\tloading = false;\n\n\t\t\treturn form;\n\t\t}", "function closeEditPanelWhenNecessary(id){\n \n var container = self.settings().containers.form;\n var idFieldName = self.settings().fields.id.name;\n var currentEntityId = $('#' + container + ' ' + 'input[name=\\\"' + idFieldName + '\\\"]').val();\n if(currentEntityId === id){\n $('#'+container).hide();\n }\n }", "function getInputValues(id) {\n return document.getElementById(id).value;\n}", "function verificarCamposForm(id){\n // se verifican cuantos campos tiene el formulario\n // la ultima posicion corresonde al boton de envío\n for (let i = 0; i < $(id)[0].length - 1; i++) {\n let campo = $(id)[0][i];\n let value = $(campo).val();\n let select = $(campo).attr('id');\n select = '#'+select;\n\n if(value == \"\" || value == null || $(select).hasClass('is-invalid')) {\n return false;\n }\n }\n return true;\n}", "function carregarDadosFormEditar(id_prato) {\n let prato = $.map(pratos, function (n) {\n if (n.id_prato == id_prato) {\n return n;\n }\n });\n prato = prato[0];\n $(\"#altpratoId\").val(prato.id_prato);\n $(\"#altpratoNome\").val(prato.nm_prato);\n $(\"#altpratoValor\").val(prato.vl_prato);\n $(\"#altpratoDescricao\").val(prato.ds_prato);\n }", "function contruirForm(tipo, accion, id) {\n\n var url_peticion = \"\";\n var nombre_tipo = \"\";\n var titulo;\n switch (tipo) {\n case \"FrutaCosta\":\n titulo = \"Crear Nueva Fruta Costa\";\n if (accion == \"nuevo\") url_peticion = \"/api/fruta/\";\n if (accion == \"editar\") {\n url_peticion = \"/api/fruta/\" + id + \"?_method=PUT\";\n titulo = \"Editar Fruta Costa\";\n }\n break;\n case \"FrutaSierra\":\n titulo = \"Crear Nueva Fruta Sierra\";\n if (accion == \"nuevo\") url_peticion = \"/api/fruta\";\n if (accion == \"editar\") {\n url_peticion = \"/api/fruta/\" + id + \"?_method=PUT\";\n titulo = \"Editar Fruta Sierra\";\n }\n break;\n default:\n // code block\n }\n\n $(\"#divform\").empty();\n $(\"#divform\").append(\"<h2 id='game-page-title'>\" + titulo + \"</h2>\");\n var form = $(\"<form></form>\")\n .attr(\"action\", url_peticion)\n .attr(\"enctype\", \"multipart/form-data\")\n .attr(\"method\", \"POST\");\n\n var labelCategoria = $(\"<label></label>\")\n .attr(\"for\", \"fname\")\n .text(\"Categoría:\");\n\n var labelPregunta = $(\"<label></label>\")\n .attr(\"for\", \"fname\")\n .text(\"Pregunta:\");\n\n var labelNombre = $(\"<label></label>\")\n .attr(\"for\", \"fname\")\n .text(\"Nombre:\");\n var inputNombre = $(\"<input></input>\")\n .attr(\"type\", \"text\")\n .attr(\"id\", \"fname\")\n .attr(\"name\", \"nombre\")\n .attr(\"placeholder\", \"Nombre de \" + nombre_tipo + \"...\")\n .prop('required', true);\n\n var labelValor = $(\"<label></label>\")\n .attr(\"for\", \"fname\")\n .text(\"Valor:\");\n var inputValor = $(\"<input></input>\")\n .attr(\"type\", \"text\")\n .attr(\"id\", \"fname\")\n .attr(\"name\", \"valor\")\n .attr(\"placeholder\", \"Valor de \" + nombre_tipo + \"...\")\n .prop('required', true);\n\n var labelImagen = $(\"<label></label>\")\n .attr(\"for\", \"lname\")\n .text(\"Imagen:\");\n var inputImagen = $(\"<input></input>\")\n .attr(\"type\", \"file\")\n .attr(\"id\", \"fname\")\n .attr(\"name\", \"url\")\n .attr(\"placeholder\", \"Imagen de \" + nombre_tipo + \"...\")\n .prop('required', true);\n\n var submit = $(\"<input></input>\")\n .attr(\"type\", \"submit\")\n .attr(\"value\", \"Guardar\");\n var btnCancel = $(\"<button></button>\")\n .attr(\"id\", \"btnCancel\")\n .attr(\"class\", \"btn btn-default btn-block\")\n .text(\"Cancelar\");\n\n llenarComboCategoria();\n llenarComboPregunta();\n\n form.append(labelCategoria);\n form.append(selectOpction);\n form.append(labelPregunta);\n form.append(selectQuestion);\n form.append(labelNombre);\n form.append(inputNombre);\n form.append(labelValor);\n form.append(inputValor);\n form.append(labelImagen);\n form.append(inputImagen);\n\n var br = $(\"</br>\");\n form.append(br);\n form.append(submit);\n form.append(btnCancel);\n $('#divform').append(form);\n\n //ELIMINAR\n $(\"#btnCancel\").on('click', function (e) {\n $(\"#divform\").empty();\n });\n}", "function getID(id){\r\n return document.getElementById(id).value;\r\n}", "function inputBox(id, value, sink, finish) {\n return h('form', {role: \"form\"}, h('div.form-group', h('input.form-control', {\n id: id,\n value: value,\n name: 'text',\n type: 'text',\n 'ev-event': hg.changeEvent(sink),\n 'ev-blur': hg.valueEvent(finish)\n })));\n}", "function set_data_in_form(id_form, data) {\n const form = document.getElementById(id_form);\n const form_data = new FormData(form);\n \n for (const i in data) {\n for (const j of form_data.keys()) {\n if (i === j) {\n document.getElementById(j).value = data[i];\n break;\n }\n }\n }\n}", "function initForm(){\n\tvar input = document.querySelector(\".gwt-DialogBox input.gwt-TextBox\");\n\t// If no input founded or has already a form\n\tif(!input || input.form){\n\t\treturn;\n\t}\n\n\t// Find table parent\n\tvar table = input.closest(\"table\");\n\n\t// Fail to found a table\n\tif(!table){\n\t\tconsole.error(\"Error: TABLE not found for the given input:\", input);\n\t\treturn;\n\t}\n\n\t//Wrap table with a form to allow input be autofilled\n\tvar form = document.createElement(\"form\");\n\t// Prevent form submit\n\tform.addEventListener(\"submit\", function(event){event.preventDefault();}, false);\n\ttable.parentNode.insertBefore(form, table);\n\tform.appendChild(table);\n\t// To submit the form, find first button (and suppose is the right one) and change its type to a submit button\n\tform.getElementsByTagName(\"button\")[0].setAttribute(\"type\", \"submit\");\n}", "function getInputField(prefixId, dateTimeId) {\n if (prefixId != undefined && prefixId != \"\") {\n if (timeFocus == null\n || timeFocus.id.indexOf(prefixId) < 0\n || timeFocus.id.indexOf(dateTimeId) < 0) {\n var inputs = document.getElementsByTagName('INPUT');\n for (i = 0; i < inputs.length; i++) {\n var inp = inputs[i];\n if (inp.id.indexOf(prefixId) > -1 && inp.id.indexOf(dateTimeId) > -1) {\n return inp;\n }\n }\n } else {\n return timeFocus;\n }\n }\n}", "function go(id) \n\t\t\t{\n\t\t\t\tdocument.form.fill.value=id;\t\t\t\n\t\t\t}", "function getInputVal(id) {\n //returns value of id\n return document.getElementById(id).value;\n}", "function getinput(eid) {\n\treturn document.getElementById(eid);\n}", "function getInputVal(id){\r\n return document.getElementById(id).value;\r\n }", "function getInputVal(id){\r\n return document.getElementById(id).value;\r\n }", "function getInputVal(id){\r\n return document.getElementById(id).value;\r\n }", "function update_form_data(res) {\n $(\"#id\").val(res.id);\n $(\"#product_id\").val(res.product_id);\n $(\"#recommended_product_id\").val(res.recommended_product_id);\n $(\"#recommendation_type\").val(res.recommendation_type);\n $(\"#likes\").val(res.likes);\n }", "function getInputVal(id) {\r\n return document.getElementById(id).value;\r\n }", "function move_form(id){\n try{\n build_options('dev_developer_id', JSON.parse(localStorage.getItem(\"developer\")));\n document.getElementById('dev_task_id').value = task_list.tasks[id].task_id;\n document.getElementById('task_developer_id').value = '';\n document.getElementById('moveModal').style.display = \"block\";\n return true;\n }catch(e){\n logMyErrors(e);\n }\n}", "function getInputValue(id) {\r\n return document.getElementById(id).value;\r\n}", "function getInputValue(id) {\n return document.getElementById(id).value;\n}", "function getInputValue(id) {\n return document.getElementById(id).value;\n}", "function InputFormAjx(InputId, url, placeholder_name, method, params){\n\t\n\turl = url + getNoCacheValue(url);\n\tvar status = placeholder_name + '-status';\n\t\n\tvar ajaxRequest = getXMLHttpRequest();\n\tajaxRequest.onreadystatechange = function(){\n\t\t\t\t\t\t\t\t\t\tif (ajaxRequest.readyState == 4) {\n\t\t\t\t\t\t\t\t\t\t\tif (ajaxRequest.status == 200) {\n\t\t\t\t\t\t\t\t\t\t\t\tvar code = ajaxRequest.responseText;\n\t\t\t\t\t\t\t\t\t\t\t\tvar check_script= FindScript(code);\n\t\t\t\t\t\t\t\t\t\t\t\tvar status_ok='<div class=\"placeholder-status\" id=\"' + status + '\"><i class=\"fa fa-check-circle-o status-check fade-in\"></i></div>';\n\t\t\t\t\t\t\t\t\t\t\t\tif (check_script===false) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(InputId).value = code\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(placeholder_name).innerHTML = status_ok;\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(InputId).value = check_script[1];\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(placeholder_name).innerHTML = status_ok + check_script[0];\n\t\t\t\t\t\t\t\t\t\t\t\t\tinvokeScript(placeholder_name); // incomplete : where is placed live script\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(InputId).value = ajaxRequest.responseText;\n\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(placeholder_name).innerHTML = '<div class=\"placeholder-status\" id=\"' + status + '\"><i class=\"fa fa-exclamation-triangle status-error fade-in\"></i></div>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\tMakeResponse(ajaxRequest, method, url, params);\n}", "function getInputVal(id){\r\n return document.getElementById(id).value;\r\n}", "function getInputVal(id){\r\n return document.getElementById(id).value;\r\n}", "function getInputVal(id){\r\n return document.getElementById(id).value;\r\n }", "function getInputVal(id){\n return document.getElementById(id).value;\n }", "function getInputVal(id){\n return document.getElementById(id).value;\n }", "function getInputVal(id){\n return document.getElementById(id).value;\n }", "function getInputVal(id){\n return document.getElementById(id).value;\n }", "function getInputVal(id){\n return document.getElementById(id).value;\n }", "function getInputVal(id) {\n return document.getElementById(id).value;\n }", "function getInputVal(id){\r\n return document.getElementById(id).value;\r\n}", "function insertAnswerForm(id) {\n\t$(\".ideaCloud_idea > form\").remove(); /* clean any forms - really don't know why this line is needed */\n\tvar form = $('<form method=\"post\" action=\"route.php\">');\n\tvar fieldset = $('<fieldset class=\"s_column\">');\n\tfieldset.append('<legend>answer to an idea</legend>');\n\tfieldset.append(' <div><input type=\"hidden\" id=\"idea_id\" name=\"idea_id\" value=\"'+id+'\" /></div>');\n\tfieldset.append(' <div><label for=\"answer_name\">your name</label><input type=\"text\" id=\"answer_name\" required=\"required\" class=\"box_shadow\" name=\"answer_name\" /></div>');\n\tfieldset.append('<div><label for=\"answer_mail\">your mail</label><input type=\"email\" id=\"answer_mail\" required=\"required\" class=\"box_shadow\" min=\"10\" name=\"answer_mail\"/></div>');\n\tfieldset.append('<div><label for=\"answer_text\">your text for idea owner</label><textarea class=\"box_shadow textarea\" name=\"answer_text\" id=\"answer_text\" cols=\"30\" rows=\"10\"></textarea></div>');\n\tfieldset.append('<input type=\"submit\" value=\"answer &rarr;\" />');\n\tform.append(fieldset);\n\t$(\".ideaCloud_idea\").append(form);\n}", "function obtenerId(frm) {\n for (element of frm.elements) {\n if (element.name === \"legislador\") {\n return element.value;\n }\n }\n}", "function display_weather_form(id) {\n if(id != null){\n highlight(id);\n }\n document.getElementById(\"weatherForm\").style.display = \"none\";\n\n var form = \"<div class='formularz'><form method='post' class='input'>\";\n form +=\n \"<h2>Dodaj dane pogodowe:</h2><input type='date' name='dzien'> Data<br/>\" +\n \"<input type='number' name='temp'> Temperatura [°C]<br/>\" +\n \"<input type='number' name='opad'> Opad [mm/m^2]<br/>\";\n\n if (!logged) {\n form +=\n \"<input type='button' value='Dodaj' onclick='insert_indexedDB(this.form)'></div>\";\n document.getElementById(\"content\").innerHTML = form;\n } else {\n form +=\n \"<input type='button' value='Dodaj' onclick='insert_mongoDB(this.form)'></div>\";\n document.getElementById(\"content\").innerHTML = form;\n }\n}", "function getInputVal(id){\r\n return document.getElementById(id).value;\r\n}", "function getInputVal(id){\r\n return document.getElementById(id).value;\r\n}", "function getInputVal(id){\r\n return document.getElementById(id).value;\r\n}", "function getInputVal(id){\r\n return document.getElementById(id).value;\r\n}", "function getInputVal(id){\r\n return document.getElementById(id).value;\r\n}", "function getInputVal(id){ \n return document.getElementById(id).value; \n }", "function getInputVal(id) {\n return document.getElementById(id).value;\n }", "function getInputVal(id){\n return document.getElementById(id).value;\n}", "function getInputVal(id){\n return document.getElementById(id).value;\n}", "function getInputVal(id){\n return document.getElementById(id).value;\n}", "function getInputVal(id){\n return document.getElementById(id).value;\n}", "function getInputVal(id){\n return document.getElementById(id).value;\n}", "function getInputVal(id){\n return document.getElementById(id).value;\n}", "function getInputVal(id){\n return document.getElementById(id).value;\n}", "function getInputVal(id){\n return document.getElementById(id).value;\n}", "function getInputVal(id){\n return document.getElementById(id).value;\n}", "function getInputVal(id){\n return document.getElementById(id).value;\n}", "function getInputVal(id){\n return document.getElementById(id).value;\n}", "function getInputVal(id){\n return document.getElementById(id).value;\n}", "function getInputVal(id){\n return document.getElementById(id).value;\n }", "function getInputVal(id) {\r\n return document.getElementById(id).value;\r\n}", "function getInputval(id){\r\n return document.getElementById(id).value;\r\n}", "function getInputVal(id){\r\n\treturn document.getElementById(id).value;\r\n}", "function getInputVal(id){\r\nreturn document.getElementById(id).value;\r\n}", "function getInputVal(id){\r\nreturn document.getElementById(id).value;\r\n}", "function getInput(name){\n var input = $('input[name=' + name + ']');/*seleciona os inputs*/\n if(input[0]){\n return input;/*retorna todos os inputs */\n }\n return null\n }", "function SetAllValue(ref_id, id_of_input)\n{\n\tvar ref_selected = document.getElementById(ref_id);\n\tvar inputs = document.getElementsByTagName(\"input\");\n\tfor(var i = 0; i < inputs.length; i++) {\n\t\tif(inputs[i].id.indexOf(id_of_input) == 0) {\n\t\t\t\tinputs[i].value = ref_selected.value;\n\t\t}\n\t}\n}", "function getInputVal(id) {\r\n return document.getElementById(id).value;\r\n}", "function getInputVal(id) {\r\n return document.getElementById(id).value;\r\n}", "function getValue(id) {\n return $(`#${id}`).val();\n}", "function getInputVal(id) {\nreturn document.getElementById(id).value;\n}", "function abrirGetForm( form_url, object_id ){\n\n if( ! self.getForm ){\n\n $.get( form_url )\n .success(function(form){\n\n self.getForm = $(form);\n\n showForm( 'get', object_id );\n\n })\n .fail(function(res){\n mostraErro( 'Falha ao carregar a tela de visualização: ' + form_url );\n });\n\n } else\n showForm( 'get', object_id );\n\n }", "async function formEdit(id,tabla){\n \n if(tabla === \"futbolista\"){ // Editar futbolista\n const resp = await fetch(`${ url }futbolista/${ id }`);\n const { futbolista } = await resp.json();\n formModalFutbolita(futbolista);\n }else if(tabla === \"equipo\"){ // Editar equipo\n const resp = await fetch(`${ url }equipo/${ id }`);\n const { equipo } = await resp.json();\n formModalEquipo(equipo);\n }\n \n \n}", "function getInputVal(id) {\n return document.getElementById(id).value;\n}" ]
[ "0.6067841", "0.6062424", "0.6018778", "0.59484327", "0.578025", "0.572888", "0.57229555", "0.57105595", "0.5681465", "0.567825", "0.5660196", "0.56314117", "0.5585856", "0.55528146", "0.5527853", "0.5516726", "0.55071235", "0.55000216", "0.54956573", "0.54686064", "0.54586285", "0.5455551", "0.545172", "0.5445547", "0.54433477", "0.5436005", "0.5428491", "0.54196846", "0.5412646", "0.5386724", "0.5379335", "0.5365191", "0.5347985", "0.5343891", "0.53397423", "0.53258187", "0.53156877", "0.53084", "0.53009695", "0.53004974", "0.5295889", "0.5293249", "0.5290897", "0.52859825", "0.52859825", "0.52859825", "0.5285521", "0.5283687", "0.5280544", "0.52765405", "0.5275916", "0.5275916", "0.52595943", "0.5255964", "0.5255964", "0.5255023", "0.52456695", "0.52456695", "0.52456695", "0.52456695", "0.52456695", "0.5244769", "0.52424794", "0.52416563", "0.5235295", "0.5232453", "0.52312225", "0.52312225", "0.52312225", "0.52312225", "0.52312225", "0.52299297", "0.52293116", "0.52253085", "0.52253085", "0.52253085", "0.52253085", "0.52253085", "0.52253085", "0.52253085", "0.52253085", "0.52253085", "0.52253085", "0.52253085", "0.52253085", "0.52197546", "0.5217556", "0.52142984", "0.5213205", "0.5206541", "0.5206541", "0.5204944", "0.5203209", "0.5203092", "0.5203092", "0.52022153", "0.52000093", "0.5198473", "0.5196206", "0.5193775" ]
0.6262314
0
resolves to to form that was updated (or should probably resolve to boolean to send less data)
function updateForm(id) { return new Promise((resolve, reject) => { if(!form || id) reject(new Error("forms is not found")); resolve(true); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateForm(form) {\n if (!this.state.form) {\n this.state.form = form;\n }\n }", "formChanged() {}", "updateRentalForm() {\n this.set('updateRentalForm', true);\n }", "updateForm(context, payload) {\n context.commit(\"updateForm\", payload);\n }", "function doUpdate(form, cb) {\n fhreq.POST(fhreq.getFeedHenryUrl(), URL_PREFIX_API_FORMS_FORM + \"\", form, function (err, remoteData, raw, res) {\n if (err) return cb(err);\n if (res.statusCode !== 200) return cb('Unexpected response code: ' + res.statusCode + ' - ' + raw);\n\n remoteData.status = \"ok\";\n remoteData.statusCode = 200;\n return cb(err, remoteData);\n });\n}", "function isFormUpdateEventHandler( event ){\n const form = event.target.closest(\"form\");\n const isFormUpdate = document.createElement(\"input\");\n isFormUpdate.type = \"hidden\";\n isFormUpdate.name = \"is_form_update\";\n isFormUpdate.value = 'True'\n form.appendChild(isFormUpdate);\n form.querySelectorAll('[type=submit]')[0].click();\n}", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "function update_form_data(res) {\n $(\"#product_id\").val(res.product_id);\n $(\"#rec_product_id\").val(res.rec_product_id);\n $(\"#rec_type_id\").val(res.rec_type_id);\n $(\"#weight_id\").val(res.weight);\n\n if (res.available == true) {\n $(\"#rec_available\").val(\"true\");\n } else {\n $(\"#rec_available\").val(\"false\");\n }\n }", "okForm() {\n const { id } = this.state;\n const body = { id, parameters: this.stateParametersToArray() };\n this.submitForm(body);\n }", "function _formUpdateValid(){\n \tif ($scope.updateuser.$valid){\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t\t}\n }", "onModalFieldAssistedConfirm () {\n const index = this.subPropsModalIndex\n\n // Notify the parent about the update\n this.fieldUpdated(index, { index: index, value: this.formParameters[index].value })\n\n // Reset the modal to initial (closed) state\n this.subPropsModalActive = false\n\n // Refresh root level json object AFTER setting subPropsModalActive to false\n this.refreshSingleParameterModel()\n this.subPropsModalIndex = null\n }", "update(form) {\n // subscripcion al servicio de usuario para enviar los datos a editar\n this.userService.updateCommons(this.user).subscribe(response => {\n if (response.User && response.User._id) {\n this.status = true;\n form.reset();\n this.launchAlert('success', 'Se ha Editado el Usuario!', null, null, false, 1500, null, 'top', 'row', true);\n this.onEdit = null;\n }\n else {\n console.log(response);\n this.launchAlert('error', 'No se ha podido editar el Usuario!', null, null, false, 1500, null, 'top', 'row', true);\n }\n }, error => {\n console.log(error);\n this.launchAlert('error', 'No se ha podido editar el Usuario!', error.error.Message, null, false, 1500, null, 'top', 'row', true);\n });\n }", "handleEditFormSubmission() {\n\t\tthis.getPortfolioItemData();\n\t}", "function setChanged (){\n\tformModified = true;\n}", "get form() {\n return this.internals_.form;\n }", "function update_form_data(res) {\n $(\"#inventory_id\").val(res.id);\n $(\"#inventory_id_inputted\").val(res._id);\n $(\"#inventory_name\").val(res.name);\n $(\"#inventory_category\").val(res.category);\n $(\"#inventory_condition\").val(res.condition);\n $(\"#inventory_count\").val(res.count);\n if (res.available == true) {\n $(\"#inventory_available\").val(\"true\");\n } else {\n $(\"#inventory_available\").val(\"false\");\n }\n }", "onEditSubmit () {\n const res = this.refs.editForm.submit()\n if (res !== false) { // false means errors\n let response = this.props.edit(res[this.props.idProp], res.data)\n response.then(\n success => { this.setState({ editItem: null }) },\n error => { this.setState({ error: error.message }) }\n )\n }\n }", "get showForm() {\n return !this.isLoading && !!this.sObjectName && !this.metadataError;\n }", "get form() {\n return this.internals_.form;\n }", "readAfterUpdate() {\n\t\tthis.enableSubmit();\n\t}", "readAfterUpdate() {\n\t\tthis.enableSubmit();\n\t}", "handleFormSuccess() {\n // Hide spinner\n this.isSaving = false;\n // No more changes to save\n this.hasChanged = false;\n // Show success message\n this.showToastEvent(this.saveMessageTitle, this.saveMessage, 'success');\n // Remove editable state\n this.toggleEdit();\n }", "function ajaxRemoteForm(form, up, callback){\r\n\tnew Ajax.Updater(up, form.action, {\r\n\t\t method: \"post\",\r\n\t\t asynchronous: true,\r\n evalScripts: true,\r\n onSuccess: function(transport){\r\n\t\t\t$(up).update(transport.responseText)\r\n\t\t},\r\n\t\tonLoaded: callback.before!=undefined ? callback.before: function(){},\r\n\t\tonComplete: callback.success!=undefined ? callback.success: function(){},\r\n \t\tparameters: Form.serialize(form)\r\n });\r\n \treturn false;\r\n}", "updateBookingForm(state, payload) {\n state.bookingForm = payload\n state.bookingFormShow = true\n }", "[form.mutation.SUBMITTED] (state) {\n state.submitted = true\n state.notification = null\n state.errors = []\n state.success = null\n }", "function handle_remote_update() {\n update_edit_form_display()\n //update_entity_tee(current_entity, current_id);\n}", "get form() {\n return this.elementInternals ? this.elementInternals.form : this.proxy.form;\n }", "onFormSubmit(evt) {\n evt.preventDefault();\n const updatedTrip = {\n trip_id: this.state.trip_id,\n budget: this.state.budget,\n departure_date: this.state.departure_date,\n duration: this.state.duration,\n city_id: this.state.city_id\n };\n\n fetch(`/trips/${this.state.trip_id}/edit.json`, {\n method: \"PUT\",\n body: JSON.stringify(updatedTrip),\n headers: {\n \"Content-type\": \"application/json\"\n }\n }).then(\n this.setState({\n updated: true,\n redirectToNewPage: true\n //Redirect to new page reset to true so code know the form submit has run\n })\n );\n }", "updateFormFromStorage() {\n // check for data if none return\n let data = localStorage.getItem('formData');\n if (!data) {\n this.setTransactions([]);\n // Looks like new user without data show tips modal.\n setTimeout(() => $('#tipsModal').modal(), 10000);\n return;\n }\n this.setForm(JSON.parse(data));\n // set the interface (transactions) options on the form\n this.setFormTransactions(JSON.parse(localStorage.getItem('transactions')));\n }", "get form() {\n return this.internals.form;\n }", "get form() {\n return this.internals.form;\n }", "get form() {\n return this.internals.form;\n }", "function edit_bureau_success_response_function(response)\n{\n show_notification(\"msg_holder\", \"success\", \"Success:\", \"Bureau updated successfully\");\n fade_out_loader_and_fade_in_form(\"loader\", \"edit_bureau_form\"); \n //$('#edit_bureau_form')[0].reset();\n}", "function dialogCreateContactSubmit(form){\n if(!check_form('EditView')){\n return false;\n }\n \n $('#ajaxRequest', $(form)).val(1);\n $('#from', $(form)).val('dialog');\n return true;\n}", "handleFormSubmit(message, isSuccess) {\r\n if (isSuccess) {\r\n this.setState({\r\n notify: 'success',\r\n notifyText: 'Success: ' + message,\r\n formVisible: false // close form\r\n });\r\n\r\n // HACK: Refresh the page. Once available, only refresh ReactiveTables.\r\n // window.location.reload(true);\r\n this.refreshTable();\r\n } else {\r\n this.setState({\r\n notify: 'error',\r\n notifyText: 'Error: ' + message,\r\n formVisible: false // close form\r\n });\r\n }\r\n }", "onFormSubmit(e) {\n e.preventDefault();\n let url = config.api + params_to_url(params.module_id);\n let request = config.api_put;\n request.body = JSON.stringify({\n users: [this.state.form],\n });\n\n fetch(url,request)\n .then(response => {\n if (response.ok) {\n this.setState({postSuccess: true})\n } else {\n throw new Error;\n }\n }).catch(e => {\n this.setState({postSuccess: false});\n })\n }", "cancelUpdate() {\n this.updatingType = false;\n this.type = {};\n this.form.$setUntouched();\n }", "function successUpdate() {\n updateForm.style.display = \"none\";\n updateSuccessView.style.display = \"block\";\n setTimeout(closeUpdateModal, 1500);\n }", "function updatePlaybookOwner() {\n vm.ownerForm.submitted = true;\n if (!vm.ownerForm.form.$valid) {\n return\n }\n\n updatePlaybook();\n }", "async submitForm(event) {\n // Set up\n var { formValues, history, submitWorkflow } = this.props;\n event.preventDefault();\n\n // Check if we even have to do an update (aka did the user even make any changes?)\n var madeNoChanges = this.compareForms(this.state.originalForm, this.props.formValues.values);\n if (madeNoChanges) {\n toast(\"You made no changes yet!\");\n return;\n }\n\n var successfullySubmission = await submitWorkflow(formValues.values, history);\n if (successfullySubmission) {\n toast(\"You have updated your profile!\");\n }\n }", "updateRequest(){\n\t\treturn true;\n\t}", "function formsUpdate(request) {\r\n var promise = new Promise(function(resolve, reject) {\r\n if(!request.body.viewsiteId\r\n || !request.body.viewpageId\r\n || !request.body.elementId) {\r\n // Required IDs\r\n reject('Viewsite, Viewpage, and Element IDs are all required!');\r\n } else if(!request.body.formTitle) {\r\n // Required fields\r\n reject('All fields required!');\r\n } else if(!request.session.userId) {\r\n // Make sure a User is logged in\r\n reject('You must be logged in to update a Form!');\r\n } else {\r\n // Find Viewsite whose Viewpage's Element is to be updated\r\n viewsites.findById(request.body.viewsiteId)\r\n .exec(function(error, viewsiteData) {\r\n if(error) {\r\n // Handle unknown errors\r\n console.log(error.message);\r\n reject('Something went wrong!');\r\n } else if(!viewsiteData) {\r\n // Handle non-existent query results\r\n reject('Viewsite not found!');\r\n } else if(viewsiteData.userId != request.session.userId) {\r\n // Make sure User owns Viewsite\r\n reject('You can only update Forms you own!');\r\n } else if(!viewsiteData\r\n .viewpages.id(request.body.viewpageId)\r\n .elements.id(request.body.elementId)) {\r\n // Handle non-existent sub-documents\r\n reject('Element doesn\\'t exist!');\r\n } else {\r\n // Set updated fields\r\n viewsiteData\r\n .viewpages.id(request.body.viewpageId)\r\n .elements.id(request.body.elementId)\r\n .formTitle = request.body.formTitle;\r\n // Save updated Viewsite\r\n viewsiteData.save(function(error, results) {\r\n if(error) {\r\n // Handle unknown errors\r\n console.log(error.message);\r\n reject('Something went wrong!');\r\n } else {\r\n // Clean up results and return up-to-date Viewsite\r\n var cleanResults = results.toObject();\r\n delete cleanResults.userId;\r\n delete cleanResults.__v;\r\n resolve(cleanResults);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n return promise;\r\n}", "handleFormSubmit(message, isSuccess) {\r\n if (isSuccess) {\r\n this.setState({\r\n notify: 'success',\r\n notifyText: `Success: ${message}`,\r\n showSpinner: false,\r\n formVisible: false // close form\r\n })\r\n\r\n this.refreshTable()\r\n } else {\r\n this.setState({\r\n notify: 'error',\r\n notifyText: `${message}`,\r\n showSpinner: false,\r\n formVisible: false // close form\r\n })\r\n }\r\n }", "handleFormSubmit(message, isSuccess) {\r\n if (isSuccess) {\r\n this.setState({\r\n notify: 'success',\r\n notifyText: 'Success: ' + message,\r\n formVisible: false // close form\r\n });\r\n\r\n // HACK: Refresh the page. Once available, only refresh ReactiveTables.\r\n // window.location.reload(true);\r\n this.props.refreshTable();\r\n } else {\r\n this.setState({\r\n notify: 'error',\r\n notifyText: 'Error: ' + message,\r\n formVisible: false // close form\r\n });\r\n }\r\n\r\n // Hide the spinner\r\n this.toggleSpinner();\r\n }", "function updateUserField() {\n $('#updateFeildModalForm').validator().on('submit', function (e) {\n // Prevent form submission\n if (e.isDefaultPrevented()) {\n // handle the invalid form\n\n } else {\n // Prevent form submission\n e.preventDefault();\n // Use Ajax to submit form data\n\n //check if the description is updated\n if(globalTrId == 'natureOfCompanyTr'){\n for (instance in CKEDITOR.instances) {\n CKEDITOR.instances[instance].updateElement();\n }\n }\n $.ajax({\n url: $(this).attr('action'),\n type: 'POST',\n data: $(this).serialize(),\n success: function (response) {\n if (response) {\n $('#userInfoEditModal').modal(\"hide\");\n reloadUserField($('#userTableType').val(),$('#userDetailColumn').val());\n alertMessageDisplay(true);\n } else {\n alertMessageDisplay(false);\n }\n }\n });\n }\n\n });\n}", "@computed\n get formChanged() {\n return !_.isEqual(this.initialData, this.fields.toJSON());\n }", "[form.mutation.FINISHED] (state) {\n state.submitted = false\n }", "function update_form_data(res) {\n $(\"#inventory_product_id\").val(res.product_id);\n $(\"#inventory_quantity\").val(res.quantity);\n $(\"#inventory_restock_level\").val(res.restock_level);\n if (res.available == 1) {\n $(\"#inventory_available\").val(\"true\");\n } else {\n $(\"#inventory_available\").val(\"false\");\n }\n if (res.condition == \"new\") {\n $(\"#inventory_condition\").val(\"new\");\n } else if (res.condition == \"used\") {\n $(\"#inventory_condition\").val(\"used\");\n } else {\n $(\"#inventory_condition\").val(\"open-box\");\n }\n }", "function UpdateForm() {\n\n const history = useHistory()\n const {id} = useParams()\n const [show, setShow] = useState(false)\n const [show2, setShow2] = useState(false)\n const [showDiscord, setShowDiscord] = useState(false)\n const [dm, setDm] = useState({\n userName: \"\",\n password: \"\",\n email: \"\",\n isDm: false,\n roomName: \"\",\n tagLine: \"\",\n categoryType:{\n byTheBook: false,\n campaigns: false,\n norestriction: false,\n homebrew: false,\n lvl1only: false,\n rpersonly: false,\n oneshots: false,\n displaydice: false,\n voyuerallowed: false\n },\n availability:{\n monday: false,\n tuesday: false, \n wednesday: false,\n thursday: false,\n friday: false,\n saturday: false,\n sunday: false\n },\n preferredRole: \"\",\n discordServer: \"\"\n });\n\n const [formObject, setFormObject] = useState({\n userName: \"\",\n password: \"\",\n email: \"\",\n isDm: true,\n roomName: \"\",\n tagLine: \"\",\n categoryType:{\n byTheBook: false,\n campaigns: false,\n norestriction: false,\n homebrew: false,\n lvl1only: false, \n rpersonly: false,\n oneshots: false,\n displaydice: false,\n voyuerallowed: false\n },\n availability:{\n monday: false,\n tuesday: false, \n wednesday: false,\n thursday: false,\n friday: false,\n saturday: false,\n sunday: false\n },\n preferredRole: \"\",\n discordServer: \"\",\n getSpotify: \"\",\n\n })\n\n // state for spotify modal \n const [modalSpotifyState, setmodalSpotifyState]=useState(false)\n\n\n const showModal = () => {\n setShow(true);\n };\n \n const hideModal = () => {\n setShow(false );\n };\n\n function handleDeleteAccount(event){\n hideModal()\n event.preventDefault()\n const userId = id\n window.location.replace(\"/\")\n API.deleteUser(userId)\n .then(console.log(\"Your journey has ended...\"))\n \n }\n \n function handleSpotifyChange(){\n let stringArray = []\n let newString;\n \n if(formObject.getSpotify === undefined || formObject.getSpotify === null){\n formObject.getSpotify = \"\"\n }\n else if(formObject.getSpotify.length > 22){\n stringArray = formObject.getSpotify.split(\":\");\n newString = stringArray[2];\n console.log(newString)\n formObject.getSpotify = newString\n }\n \n }\n \n function handleInputChange(event) {\n const { name, value } = event.target;\n setFormObject({...formObject, [name]: value})\n };\n\n function handleDropDownChange(e){\n console.log(e.target.value)\n let selectedRole = e.target.value\n setFormObject({...formObject, preferredRole: selectedRole})\n }\n \n // UPDATING USER\n const showModal2 = () => {\n setShow2(true);\n };\n \n const hideModal2 = () => {\n setShow2(false );\n };\n\n // Spotify tutorial\n //=================================================================\n const showModalSpotify = () => {\n setmodalSpotifyState(true)\n }\n\n const hideModalSpotify = () => {\n setmodalSpotifyState(false)\n }\n //=================================================================\n const showDiscordModal = () =>{\n setShowDiscord(true);\n }\n const hideDiscordModal = () =>{\n setShowDiscord(false)\n }\n\n function handleFormSubmit(event) {\n hideModal2();\n event.preventDefault();\n\n async function submit(){\n await handleSpotifyChange()\n \n\n \n API.updateUser(id, {\n roomName: formObject.roomName,\n tagLine: formObject.tagLine,\n preferredRole: formObject.preferredRole,\n categoryType:{\n byTheBook: formObject.categoryType.byTheBook,\n campaigns: formObject.categoryType.campaigns,\n norestriction: formObject.categoryType.norestriction,\n homebrew: formObject.categoryType.homebrew,\n lvl1only: formObject.categoryType.lvl1only,\n rpersonly: formObject.categoryType.rpersonly,\n oneshots: formObject.categoryType.oneshots,\n displaydice: formObject.categoryType.displaydice,\n voyuerallowed: formObject.categoryType.voyuerallowed\n },\n availability:{\n monday: formObject.availability.monday,\n tuesday: formObject.availability.tuesday, \n wednesday: formObject.availability.wednesday,\n thursday: formObject.availability.thursday,\n friday: formObject.availability.friday,\n saturday: formObject.availability.saturday,\n sunday: formObject.availability.sunday\n },\n preferredRole: formObject.preferredRole,\n discordServer: formObject.discordServer,\n getSpotify: formObject.getSpotify\n })\n .then((response)=>{\n })\n .catch((err)=> console.error(err))\n }\n submit()\n \n };\n \n\n\n useEffect(()=>{\n async function renderUserDetails(){\n const response = await API.getUser(id)\n setDm(response.data)\n setFormObject({\n categoryType:{\n byTheBook: response.data.categoryType.byTheBook,\n campaigns: response.data.categoryType.campaigns,\n norestriction: response.data.categoryType.norestriction,\n homebrew: response.data.categoryType.homebrew,\n lvl1only: response.data.categoryType.lvl1only,\n rpersonly: response.data.categoryType.rpersonly,\n oneshots: response.data.categoryType.oneshots,\n displaydice: response.data.categoryType.displaydice,\n voyuerallowed: response.data.categoryType.voyuerallowed\n },\n availability:{\n monday: response.data.availability.monday,\n tuesday: response.data.availability.tuesday, \n wednesday: response.data.availability.wednesday,\n thursday: response.data.availability.thursday,\n friday: response.data.availability.friday,\n saturday: response.data.availability.saturday,\n sunday: response.data.availability.sunday\n },\n preferredRole: response.data.preferredRole,\n discordServer: response.data.discordServer,\n getSpotify: response.data.getSpotify\n\n })\n }\n renderUserDetails()\n },[id])\n\n\n function handleCheckbox(event, objKey){\n event.stopPropagation()\n let current = formObject[objKey][event.target.name]\n setFormObject(prevState=>({\n ...prevState,\n [objKey]: {\n ...prevState[objKey], [event.target.name]: !current\n }\n }))\n\n }\n\n return (\n \n <>\n <div className=\"container\">\n <div className=\"row section\"></div>\n <form className=\"row section content-border\">\n <div className=\"row vertical-spacer-md\">\n <div className=\"col s12 l5 center-align\">\n <p>Avatar:</p>\n <AvatarImage preferredRole={formObject.preferredRole} />\n </div>\n <div className=\"col s12 l7\">\n\n {dm.isDm ? <>\n <p>Room Name: </p>\n <div className=\"content-border mainContent\">\n <input id=\"roomName\" className=\"validate\" type=\"text\" value={formObject.roomName} name=\"roomName\" placeholder={dm.roomName} onChange={handleInputChange}/>\n </div>\n </> : null}\n {dm.isDm ? <>\n <p>Discord Server: <div onClick={showDiscordModal} className=\"tutorialMark\"><span className=\"tutorialLink center align\">?</span></div></p>\n <div className=\"content-border mainContent\">\n <input id=\"discordServer\" className=\"validate\" type=\"text\" value={formObject.discordServer} name=\"discordServer\" placeholder={dm.discordServer} onChange={handleInputChange}/>\n </div>\n </> : null}\n {dm.isDm ? <>\n <p>Spotify: <div onClick={showModalSpotify} className=\"tutorialMark\"><span className=\"tutorialLink center align\">?</span></div></p>\n <div className=\"content-border mainContent\">\n <input id=\"getSpotify\" className=\"validate\" type=\"text\" value={formObject.getSpotify} name=\"getSpotify\" onChange={handleInputChange}/>\n </div>\n </> : null}\n <p>Tagline: </p>\n <div className=\"content-border mainContent\">\n <input id=\"Tagline\" type=\"text\" className=\"validate\" value={formObject.tagLine} name=\"tagLine\" placeholder={dm.tagLine} onChange={handleInputChange} />\n </div>\n \n \n\n {!dm.isDm ? <> <p>Preferred Role: </p>\n <div className=\"content-border\">\n <select className=\"browser-default\" onChange={handleDropDownChange}>\n <option value=\"\" disabled selected> \n Select\n </option>\n {dm.preferredRole === \"Barbarian\" ? <option selected name=\"preferredRole\" value=\"Barbarian\">Barbarian</option> : <option name=\"preferredRole\" value=\"Barbarian\">Barbarian</option>}\n {dm.preferredRole === \"Bard\" ? <option selected name=\"preferredRole\" value=\"Bard\">Bard</option> : <option name=\"preferredRole\" value=\"Bard\">Bard</option>}\n {dm.preferredRole === \"Cleric\" ? <option selected name=\"preferredRole\" value=\"Cleric\">Cleric</option> : <option name=\"preferredRole\" value=\"Cleric\">Cleric</option>}\n {dm.preferredRole === \"Druid\" ? <option selected name=\"preferredRole\" value=\"Druid\">Druid</option> : <option name=\"preferredRole\" value=\"Druid\">Druid</option>}\n {dm.preferredRole === \"Fighter\" ? <option selected name=\"preferredRole\" value=\"Fighter\">Fighter</option> : <option name=\"preferredRole\" value=\"Fighter\">Fighter</option>}\n {dm.preferredRole === \"Monk\" ? <option selected name=\"preferredRole\" value=\"Monk\">Monk</option> : <option name=\"preferredRole\" value=\"Monk\">Monk</option>}\n {dm.preferredRole === \"Paladin\" ? <option selected name=\"preferredRole\" value=\"Paladin\">Paladin</option> : <option name=\"preferredRole\" value=\"Paladin\">Paladin</option>}\n {dm.preferredRole === \"Ranger\" ? <option selected name=\"preferredRole\" value=\"Ranger\">Ranger</option> : <option name=\"preferredRole\" value=\"Ranger\">Ranger</option>}\n {dm.preferredRole === \"Rogue\" ? <option selected name=\"preferredRole\" value=\"Rogue\">Rogue</option> : <option name=\"preferredRole\" value=\"Rogue\">Rogue</option>}\n {dm.preferredRole === \"Sorcerer\" ? <option selected name=\"preferredRole\" value=\"Sorcerer\">Sorcerer</option> : <option name=\"preferredRole\" value=\"Sorcerer\">Sorcerer</option>}\n {dm.preferredRole === \"Warlock\" ? <option selected name=\"preferredRole\" value=\"Warlock\">Warlock</option> : <option name=\"preferredRole\" value=\"Warlock\">Warlock</option>}\n {dm.preferredRole === \"Wizard\" ? <option selected name=\"preferredRole\" value=\"Wizard\">Wizard</option> : <option name=\"preferredRole\" value=\"Wizard\">Wizard</option>}\n </select>\n </div> </> : null}\n </div></div>\n\n <div className=\"row\">\n <div className=\"col s12\">\n <h5 className=\"form-text\">Category:</h5>\n </div>\n\n <div className=\"row\">\n <label className=\"col s12 m6 l6 xl4\">\n <input type=\"checkbox\" checked={formObject.categoryType.campaigns} name=\"campaigns\" value={formObject.categoryType.campaigns} onChange={(e) => handleCheckbox(e, \"categoryType\")}/>\n <span>\n <p>Campaigns</p>\n </span>\n </label>\n <label className=\"col s12 m6 l6 xl4\">\n <input type=\"checkbox\" checked={formObject.categoryType.oneshots} name=\"oneshots\" value={formObject.categoryType.oneshots} onChange={(e) => handleCheckbox(e, \"categoryType\")}/>\n <span>\n <p>One Shots</p>\n </span>\n </label>\n <label className=\"col s12 m6 l6 xl4\">\n <input type=\"checkbox\" checked={formObject.categoryType.homebrew} name=\"homebrew\" value={formObject.categoryType.homebrew} onChange={(e) => handleCheckbox(e, \"categoryType\")}/>\n <span>\n <p>HomeBrew</p>\n </span>\n </label>\n <label className=\"col s12 m6 l6 xl4\">\n <input type=\"checkbox\" checked={formObject.categoryType.byTheBook} name=\"byTheBook\" value={formObject.categoryType.byTheBook} onChange={(e) => handleCheckbox(e, \"categoryType\")}/>\n <span>\n <p>By The Book</p>\n </span>\n </label>\n <label className=\"col s12 m6 l6 xl4\">\n <input type=\"checkbox\" checked={formObject.categoryType.rpersonly} name=\"rpersonly\" value={formObject.categoryType.rpersonly} onChange={(e) => handleCheckbox(e, \"categoryType\")}/>\n <span>\n <p>Role Play Only</p>\n </span>\n </label>\n <label className=\"col s12 m6 l6 xl4\">\n <input type=\"checkbox\" checked={formObject.categoryType.norestriction} name=\"norestriction\" value={formObject.categoryType.norestriction} onChange={(e) => handleCheckbox(e, \"categoryType\")}/>\n <span>\n <p>No Restriction</p>\n </span>\n </label>\n <label className=\"col s12 m6 l6 xl4\">\n <input type=\"checkbox\" checked={formObject.categoryType.displaydice} name=\"displaydice\" value={formObject.categoryType.displaydice} onChange={(e) => handleCheckbox(e, \"categoryType\")}/>\n <span>\n <p>Display Dice</p>\n </span>\n </label>\n <label className=\"col s12 m6 l6 xl4\">\n <input type=\"checkbox\" checked={formObject.categoryType.lvl1only} name=\"lvl1only\" value={formObject.categoryType.lvl1only} onChange={(e) => handleCheckbox(e, \"categoryType\")}/>\n <span>\n <p>Lvl One Only</p>\n </span>\n </label>\n <label className=\"col s12 m6 l6 xl4\">\n <input type=\"checkbox\" checked={formObject.categoryType.voyuerallowed} name=\"voyuerallowed\" value={formObject.categoryType.voyuerallowed} onChange={(e) => handleCheckbox(e, \"categoryType\")}/>\n <span>\n <p>Watchers Allowed</p>\n </span>\n </label>\n </div>\n </div>\n\n <div className=\"row\">\n <div className=\"col s12\">\n <h5 className=\"form-text\">Availability:</h5>\n <div className=\"row\">\n <label className=\"col s12 m6 l4 xl3\">\n <input type=\"checkbox\" checked={formObject.availability.monday} name=\"monday\" value={formObject.availability.monday} onChange={(e) => handleCheckbox(e, \"availability\")}/>\n <span>\n <p>Monday</p>\n </span>\n </label>\n <label className=\"col s12 m6 l4 xl3\">\n <input type=\"checkbox\" checked={formObject.availability.tuesday} name=\"tuesday\" value={formObject.availability.tuesday} onChange={(e) => handleCheckbox(e, \"availability\")}/>\n <span>\n <p>Tuesday</p>\n </span>\n </label>\n <label className=\"col s12 m6 l4 xl3\">\n <input type=\"checkbox\" checked={formObject.availability.wednesday} name=\"wednesday\" value={formObject.availability.wednesday} onChange={(e) => handleCheckbox(e, \"availability\")}/>\n <span>\n <p>Wednesday</p>\n </span>\n </label>\n <label className=\"col s12 m6 l4 xl3\">\n <input type=\"checkbox\" checked={formObject.availability.thursday} name=\"thursday\" value={formObject.availability.thursday} onChange={(e) => handleCheckbox(e, \"availability\")}/>\n <span>\n <p>Thursday</p>\n </span>\n </label>\n <label className=\"col s12 m6 l4 xl3\">\n <input type=\"checkbox\" checked={formObject.availability.friday} name=\"friday\" value={formObject.availability.friday} onChange={(e) => handleCheckbox(e, \"availability\")}/>\n <span>\n <p>Friday</p>\n </span>\n </label>\n <label className=\"col s12 m6 l4 xl3\">\n <input type=\"checkbox\" checked={formObject.availability.saturday} name=\"saturday\" value={formObject.availability.saturday} onChange={(e) => handleCheckbox(e, \"availability\")}/>\n <span>\n <p>Saturday</p>\n </span>\n </label>\n <label className=\"col s12 m6 l4 xl3\">\n <input type=\"checkbox\" checked={formObject.availability.sunday} name=\"sunday\" value={formObject.availability.sunday} onChange={(e) => handleCheckbox(e, \"availability\")}/>\n <span>\n <p>Sunday</p>\n </span>\n </label>\n </div> \n <div className=\"row vertical-spacer-sm\">\n <div className=\"col s12 m12 l4\">\n <button type= \"button\" onClick={()=>{history.push(\"/DmDirectory\")}}className=\"vertical-spacer-sm waves-effect waves-light btn col s12\">\n Cancel\n </button></div>\n <div className=\"col s12 m12 l4\">\n <button type = \"button\" onClick={showModal} className=\"vertical-spacer-sm waves-effect waves-light btn col s12\">\n Delete Your Account?\n </button></div>\n <div className=\"col s12 m12 l4\">\n <button type=\"button\" onClick={showModal2} className=\"vertical-spacer-sm waves-effect waves-light btn col s12\">\n Update Account\n </button></div>\n </div>\n </div>\n </div> \n </form>\n </div>\n <UpdateModal handleSpotifyChange = {handleSpotifyChange} show2 = {show2} handleFormSubmit = {handleFormSubmit} handleClose ={hideModal2}/>\n <DeleteModal show = {show} handleDeleteAccount = {handleDeleteAccount} handleClose ={hideModal}/>\n <SpotifyInfoModal showModalSpotify = {modalSpotifyState} hideModalSpotify={hideModalSpotify} />\n <DiscordModal showDiscord= {showDiscord} hideDiscordModal ={hideDiscordModal} />\n </>\n );\n}", "function onFormMapped(err) {\n if (err) {\n // form event with empty response prevents server zombie on error\n Y.log( 'Could not map the form from current activity: ' + err, 'warn', NAME );\n template.raise( 'mapcomplete', {} );\n return;\n }\n\n context.attachments.updateFormDoc( context, template, onFormRestored );\n }", "function update_form_data(res) {\n $(\"#id\").val(res.id);\n $(\"#product_id\").val(res.product_id);\n $(\"#recommended_product_id\").val(res.recommended_product_id);\n $(\"#recommendation_type\").val(res.recommendation_type);\n $(\"#likes\").val(res.likes);\n }", "function refreshForm() {\n loadSettings(function(settings) {\n loadForm(settings);\n });\n}", "function updatebestellung(form) {\n\n const editForm = form;\n const id = editForm.querySelector('input[name=\"id\"]').value;\n const kundenname = editForm.querySelector('input[name=\"kundenname\"]').value;\n const menge = editForm.querySelector('input[name=\"menge\"]').value;\n const kundenadresse = editForm.querySelector('input[name=\"kundenadresse\"]').value;\n\n\n fetch('http://localhost:8080/carmen/bestellungen/public/api/bestellung/update/'+id, {\n method: 'PUT', // or 'PUT'\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({id: id, kundenname:kundenname, menge:menge, kundenadresse:kundenadresse}),\n })\n .then((resp) => resp.json())\n .then((data) => {\n console.log('Success:', data);\n editForm.style.display = \"none\";\n \n getbestellungen();\n \n \n })\n .catch((error) => {\n console.log(error); \n }); \n \n return false;\n\n \n}", "update() {\n http.put(`/users/${this.user.id}/contact`, this.form)\n .then(() => {\n Bus.$emit('updateUser');\n });\n }", "updateFieldsStatus () {\n let service = dependencyService\n service.updateFieldsStatus(this.formParameters)\n }", "function submitClientForm() {\n AppointmentService.updateClientReferallForm(vm.clientReferralForm)\n .then(updateClientReferallFormSuccess, updateClientReferallFormError);\n }", "function EditShortAnsWidgetForForm() {\n let obj;\n let url = \"http://localhost:8080/form/\"+formid+\"/widget/\"+WidgetIdToBeEdited+\"/edit\";\n let widgetName = $('#edit-inputName-1').val(),title = $('#edit-inputTitle-1').val();\n let bookmark = $('#edit-bookmark').val();\n if (bookmark==null) bookmark=\"\";\n\n ClearShortAnsEditModal();\n\n fetch(url,{\n method:'POST',\n headers:{'content-type' : 'application/json'},\n body : JSON.stringify({\n 'widgetId':WidgetIdToBeEdited,\n 'widgetName': widgetName,\n 'widgetType':\"SHORT_ANSWER\",\n 'title': title,\n 'hint': bookmark\n })\n }).then(res => res.json()).\n then(data => obj=data).\n then(()=>console.log(obj)).\n then(()=>window.location.href = \"http://localhost:8080/form/\" + obj[\"formId\"]+\"/edit\");\n\n return false;\n}", "function abrirPatchForm( form_url, object_id ){\n\n if( ! self.patchForm ){\n\n $.get( form_url )\n .success(function(form){\n\n self.patchForm = $(form);\n\n showForm( 'patch', object_id );\n\n })\n .fail(function(res){\n mostraErro( 'Falha ao carregar o formulário de edição: ' + form_url);\n });\n\n } else\n showForm( 'patch', object_id );\n\n }", "showEditForm(data) {\n const newData = {\n id: data.id,\n title: data.title,\n city: data.city_id,\n oldTitle: data.title\n };\n\n this.showCreateForm(newData);\n }", "function loadUpdateForm(){\n\t\t$scope.isUpdate = true;\n\t\t$scope.currentIdVehicules = $routeParams.idVupdate;\n\n\t\t$scope.selectedVehicule = $rootScope.listeVehicules.find(function(element) {\n\t\t\t return element.id == $scope.currentIdVehicules;\n\t\t});\n\n\t\t$scope.vehicle={};\n\t\t$scope.vehicle.brand = $scope.selectedVehicule.details.brand;\n\t\t$scope.vehicle.price = $scope.selectedVehicule.details.price;\n\t\t$scope.data.selectedAgency = $scope.data.availableAgency.find(function(element) {\n\t\t\t return element.id == $scope.selectedVehicule.details.idAgency;\n\t\t});\n\n\t\t$scope.data.selectedInsurance = $scope.data.availableInsurance.find(function(element) {\n\t\t\t return element.name == $scope.selectedVehicule.details.insurance;\n\t\t});\n\n\t\t$scope.data.selectedTypeVehicule = $scope.data.availableTypes[$scope.selectedVehicule.details.type];\n\n\t\t$.each($scope.selectedVehicule.details.characteristicList, function(key , characteristic){\n\n\t\t\t$scope.data.slectedCharacteristic[characteristic.idCharacteristic.id] = characteristic.valueCharacteristic;\n\t\t});\n\n\t\tparseCharacteristics();\n\n\t}", "function EditRequestTypeSuccess() {\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#editRequestTypeDialog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Data updated successfully.\", \"dialogSuccess\");\n\n ResetRequestTypeGrid();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n }\n}", "_submitForm() {\n\t\tconst { inputName, inputBio, inputLocation, inputImage } = this.state;\n\t\tconst { updateAbout, userId, getAbout, routeId } = this.props;\n\t\tupdateAbout(userId, inputName, inputBio, inputLocation, inputImage, (success) => {\n\t\t\tif (success) {\n\t\t\t\tthis._closeEdit();\n\t\t\t\tgetAbout(routeId); // Might be redundant\n\t\t\t}\n\t\t});\n\t}", "handleSubmit(event) {\n this.showLoadingSpinner = true;\n // prevending default type sumbit of record edit form\n event.preventDefault();\n // querying the record edit form and submiting fields to form\n this.template\n .querySelector(\"lightning-record-edit-form\")\n .submit(event.detail.fields);\n this.showLoadingSpinner = false;\n \n }", "completeAndUpdate(updatedPlan) {\n axios.put(`http://localhost:3000/api/MasterPlans/`+updatedPlan.masterPlanId+`/subPlans/`+updatedPlan.id, updatedPlan)\n .then(() => {\n this.onLoad(this.state.setType);\n })\n }", "sendUpdatedField(newDisplayname, newOptional, newType, newMin, newMax){\n var optional=null;\n newOptional === true ? optional = '1' : optional = '0'\n this.setState({\n edit: false\n })\n $.ajax({url: '/php/update_signup_field.php', type: 'POST',\n dataType: 'json',\n data: {\n 'name': newDisplayname,\n 'optional': optional,\n 'type': newType,\n 'minimum': newMin,\n 'maximum': newMax,\n 'DataID': this.state.signupFields[this.state.currentIndex].DataID\n },\n success: response => {\n this.checkifLive();\n this.getFields();\n },\n error: response => {\n alert(\"An error occured, please refresh the page!\")\n }\n });\n }", "async handleFormSubmit() {\n event.preventDefault();\n var datas = {\n work_department: this.state.work_department\n };\n this.props\n .editProfile(this.props.user_id, datas)\n .then(() => {\n this.handleClose();\n this.props.setMessage({\n message: 'Votre poste est mis à jour!'\n });\n })\n .catch((err) => {\n console.log(err);\n });\n }", "handleOnSubmit(e) {\n e.preventDefault();\n\n this.updateUser();\n this.toggleModal();\n }", "handleSubmitToDMS(){\n this.msgpaSelected = true;\n this.handleSave();\n }", "beforeRouteUpdate(to, from, next) {\n this.initForm(to)\n next()\n }", "function dfUpdateField() {\n if($(this).data('loading') != '1') {\n $(this).data('loading', '1');\n var _this = $(this);\n var type = $(this).data('field-type');\n var new_value;\n if(type == 'boolean') new_value = !$(this).data('field-value');\n else if(type == 'select') new_value = $(this).val();\n else new_value = $(this).text();\n var data = {};\n data[$(this).data('field')] = new_value;\n $.ajax({\n context: _this,\n data: { data: data },\n method: 'POST',\n url: $(this).data('save-url'),\n complete: function(req, status) {\n $(this).data('loading', '0');\n },\n success: function(data, status, req) {\n if(data.status == 'error') {\n if($(this).data('show-errors')) {\n var result = '';\n var message = data.message;\n for(var key in message) {\n if(typeof(message[key]) === 'object') {\n if(result) result += ' - ';\n result += key + ': ' + message[key].join('; ');\n }\n }\n if(result) alert(result);\n }\n }\n else {\n $(this).data('field-value', new_value);\n if($(this).data('content')) {\n var old_text = $(this).text();\n var old_class = $(this).attr('class');\n var content = $($(this).data('content'));\n $(this).text(content.text());\n $(this).attr('class', content.attr('class'));\n content.text(old_text);\n content.attr('class', old_class);\n $(this).data('content', content);\n }\n }\n }\n });\n }\n}", "function change(form){\n \n if (!form) form = document.getElementById('edit_form');\n \n if (!form.song_id.value && !form.artist.value) {\n $(form).hide();\n form.line.value = null;\n return;\n }\n \n var callback = function(data, status, request) {\n $('#line_'+data.id).children('.info').html(data.song);\n $('#line_'+data.id).children('.concert').html(data.concert);\n $('#line_'+data.id).showLine();\n \n $(form).hide();\n form.song_id.value = null;\n form.line.value = null;\n }\n \n $.ajaxQueue({type: 'POST', url: 'change/', data: $(form).serialize(), success: callback, dataType: 'json'});\n \n return false;\n}", "submit() {\n if (this.state.good === 'good') {\n return {\n response: {\n key: this.props.info.name,\n value: this.state.value\n },\n ready: true\n };\n } else {\n this.state.good = 'watch';\n return {\n ready: false\n };\n }\n }", "function propagate() {\n\tlet postForm = main.request('postForm');\n\tif (postForm)\n\t\tpostForm.renderIdentity();\n\tsave();\n}", "function submit(e) {\n e.preventDefault();\n const form = props.store.formToObject(e.target)\n props.store.api('/cabinet/user/update', form)\n //.then(setUser)\n }", "onSubmit() {\n this._submit.classList.add('button--disabled');\n location.reload();\n if (this.isValid())\n this.props.submit ? this.props.submit(this.form) : null;\n }", "submit(data, formRef) {\n const { date, category, amount } = data;\n const balance = 0;\n const owner = Meteor.user().username;\n const payee = (typeof data.payee === 'string') ? data.payee : '';\n const name = (typeof data.name === 'string') ? data.name : '';\n const notes = (typeof data.notes === 'string') ? data.notes : '';\n const react = this;\n\n Transactions.collection.update(this.props.data._id,\n { $set: { name, date, payee, amount, balance, notes, owner, category } },\n (error) => {\n if (error) {\n swal('Error', error.message, 'error');\n } else {\n swal('Success', 'Transaction updated successfully', 'success').then(() => {\n react.setState({ open: false });\n formRef.reset();\n // eslint-disable-next-line no-undef\n window.location.reload();\n });\n }\n });\n }", "updateFieldInternal(payload){ // payload = {field (req), newValue (req)}\n var self = this;\n var editField, newVal;\n var val = null, displayVal = '', valObj = null;\n\n if(payload.hasOwnProperty('field') && payload.field && payload.hasOwnProperty('newValue')){\n newVal = payload.newValue;\n if(newVal == \"\") newVal = null;\n \n editField = payload.field;\n //else if(payload.hasOwnProperty('storeName') && payload.hasOwnProperty('propname')) editField = clone(self.state.form[payload.storeName][payload.propname]);\n\n editField.dbVal = newVal;\n\n if(newVal != null){\n if(editField.valType == 'number'){\n val = newVal;\n displayVal = newVal.toString();\n }\n else if(editField.valType == 'text' || editField.valType == 'textarea'){\n displayVal = newVal;\n val = newVal.toString().toUpperCase();\n }\n else if(editField.valType == 'boolean'){\n if (currVal == true || currVal == 1){\n val = true;\n }\n else{\n val = false;\n }\n displayVal = val ? 'true' : 'false';\n }\n else if (editField.valType == 'combobox'){\n var subset, valObj;\n var joinSet = editField.JoinSet;\n if(joinSet){\n if(this.state.form[joinSet].length > 0 || this.state.database[joinSet].length > 0){\n if(self.state.form[joinSet].length > 0) subset = 'form';\n else subset = 'database';\n\n if(this.state[subset][joinSet].length > 0 && this.state[subset][joinSet][0].hasOwnProperty(editField.ValProp)){\n valObj = self.state[subset][joinSet].find(function(s){\n if(typeof(s[editField.ValProp]) === \"object\") return s[editField.ValProp].val == newVal;\n else return s[editField.ValProp] == newVal;\n });\n if(valObj){\n if(typeof(valObj[editField.ValProp]) === \"object\") val = valObj[editField.ValProp].val;\n else val = valObj[editField.ValProp];\n\n if(typeof(valObj[editField.TextProp]) === \"object\") displayVal = valObj[editField.TextPron].displayVal;\n else displayVal = valObj[editField.TextProp];\n }\n else{\n if(this.errDebug) console.error('ERROR: getValObj - NOT FOUND IN STATE.' + subset + '.' + joinSet + ' - ' + newVal);\n }\n }\n }\n else if(newVal !== null){\n if(this.errDebug) console.error('ERROR: getValObj - ' + joinSet + ' NOT LOADED')\n val = newVal;\n displayVal = newVal.toString();\n }\n }\n else {\n if(self.errDebug) console.error('ERROR: getValObj - NO JOINSET SPECIFIED')\n val = currVal;\n displayVal = currVal.toString();\n }\n }\n else{\n if (this.errDebug) console.error('ERROR: updateFieldInternal: TYPE NOT HANDLED - ' + this.payloadToStr(payload));\n /* NEED TO DO SOMETHING HERE */\n }\n }\n editField.val = val;\n editField.displayVal = displayVal\n\n //this.updateObjectProp({storeName: payload.storeName, propname: payload.propname, valObj: newValObj});\n }\n else{\n if (this.errDebug) console.error('ERROR: updateFieldInternal: PAYLOAD - ' + this.payloadToStr(payload));\n }\n }", "function iisadvanceeditor_form_refresh_before_submit(form,editor){\n\tif (form)\n\tfor (var name in window.owForms){\n\t\tvar thisForm=window.owForms[name]\n\t\tif (thisForm.form && thisForm.form===form) {\n\t\t\t$(thisForm.form).unbind('submit').bind('submit',{form:thisForm},function(e){\n\t\t\t\teditor.updateElement();\n\t\t\t\treturn e.data.form.submitForm();\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function showModalAwardEventForm(fk_award, fk_event){\n\n _resetAwardFieldForm();\n\n // Update\n if(fk_award != undefined && fk_event != undefined){\n\n _formAction = 'edit';\n\n $.post('/admin/abrasce-award/award-event/list', {fk_award:fk_award, fk_event:fk_event}, function(response){\n\n if(!response.success){\n toastr.error(data.message);\n return;\n }\n\n var data = response.data;\n\n // Populate form\n $('#formAwardEvent select[name=fk_award]').val(data.fk_award);\n $('#formAwardEvent input[name=fk_event]').val(data.fk_event);\n $('#formAwardEvent input[name=title]').val(data.title);\n $('#formAwardEvent input[name=billing_days_to_due]').val(data.billing_days_to_due);\n $('#formAwardEvent input[name=registration_price]').val(data.registration_price);\n\n // Date setup\n var dateBegin = moment(data.registration_date_begin);\n var dateEnd = moment(data.registration_date_end);\n $('#formAwardEvent input[name=registration_date_begin]').val(dateBegin.format('DD/MM/YYYY HH:mm'));\n $('#formAwardEvent input[name=registration_date_end]').val(dateEnd.format('DD/MM/YYYY HH:mm'));\n\n // Logo\n if (data.logo != \"\") {\n $('#file-logo').fileinput('refresh', {\n 'allowedFileExtensions': ['jpg', 'png', 'gif'],\n 'initialPreview': [\"<img src='/uploads/award-event/\" +data.logo + \"' class='file-preview-image'>\",],\n 'overwriteInitial': true,\n 'maxFileSize': 500,\n 'initialCaption': data.logo\n });\n }\n\n // Banner\n if (data.banner != \"\") {\n $('#file-banner').fileinput('refresh', {\n 'allowedFileExtensions': ['jpg', 'png', 'gif'],\n 'initialPreview': [\"<img src='/uploads/award-event/\" +data.banner + \"' class='file-preview-image'>\",],\n 'overwriteInitial': true,\n 'maxFileSize': 500,\n 'initialCaption': data.banner\n });\n }\n\n var description = $('#description-award-event').data(\"wysihtml5\").editor;\n description.setValue(data.description);\n\n // Show\n $('#modal-award-event-form').modal('show');\n\n }).fail(function(jqXHR, textStatus){\n\n toastr.error(\"Ocorreu um erro ao executar a solicitação: \" + textStatus);\n\n });\n\n }else{ // New\n\n _formAction = 'new';\n _resetAwardFieldForm();\n\n $('input[name=fk_event]').val(_fkEvent);\n\n $('#modal-award-event-form').modal('show');\n\n }\n\n}", "componentDidMount(){ this.updateForm( ) }", "formAssociatedCallback(nullableForm) {\n console.log('Form associated.');\n }", "async handleFormSubmit(event) {\n let projectID = this.props.match.params.projectID;\n let newData = {\n \"ProjectID\": projectID,\n \"DueDate\": this.state.updatedProjectDueDate,\n \"StartDate\": this.state.updatedProjectStartDate,\n \"Technology\": this.state.updatedProjectTechnology,\n \"Status\": this.state.selectedOption[\"label\"],\n \"ProjectName\": this.state.updatedProjectName,\n \"EstMaxHours\": this.state.updatedProjectMaxHours\n };\n\n let response = await fetch('../api/updateIndividualProjectInfo', {\n method: \"PUT\",\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(newData)\n });\n\n }", "@action\n saveForm() {\n this.validateForm();\n if (this.isError) {\n return null;\n }\n let saveSnapshot = this.createSnapshot();\n\n const request = this.doApiRequest({\n data: this.getTransformedData(),\n });\n\n this.formState = FormState.SAVING;\n request\n .then((resp) => {\n // save snapshot\n if (saveSnapshot) {\n saveSnapshot();\n saveSnapshot = null;\n }\n\n if (this.options.onSubmitSuccess) {\n this.options.onSubmitSuccess(resp, this);\n }\n })\n .catch((resp, ...args) => {\n // should we revert field value to last known state?\n saveSnapshot = null;\n if (this.options.resetOnError) {\n this.setInitialData({});\n }\n this.submitError(resp);\n if (this.options.onSubmitError) {\n this.options.onSubmitError(resp, this);\n }\n });\n\n return request;\n }", "function order_update_post(req, res, next) {\n let order = createOrderFromRequest(req, true);\n\n const errors = validationResult(req);\n if (!errors.isEmpty()) {\n // There are errors. Render form again with sanitized values/errors messages.\n let obj = getObjectToShowForm('Update Order (err)', order, errors.array());\n res.render('order_form', obj);\n return;\n } else {\n // Data from form is valid.\n\n Order.findByIdAndUpdate(req.params.id, order, [], function(\n err,\n theOrder\n ) {\n if (err) {\n return next(err);\n }\n res.redirect('/order/list');\n });\n }\n}", "function showForm(reqObj, preventFillingWithReceived) {\n var data = reqObj.sentData,\n fillWithReceivedSetting = (\n vm.mainList === vm.requestList ? $scope.historySettings : $scope.collectionsSettings\n ).data.fillWithReceived;\n\n\n if (fillWithReceivedSetting && !preventFillingWithReceived) {\n data = reqObj.receivedData;\n }\n\n $scope.rootBroadcast(\n constants.YANGMAN_SET_CODEMIRROR_DATA_RECEIVED, { data: reqObj.setDataForView(reqObj.receivedData) }\n );\n $scope.rootBroadcast(\n constants.YANGMAN_SET_CODEMIRROR_DATA_SENT, { data: reqObj.setDataForView(reqObj.sentData) }\n );\n\n $scope.rootBroadcast(constants.YANGMAN_SET_ERROR_DATA,\n reqObj.receivedData && reqObj.receivedData.hasOwnProperty('errors') ? reqObj.receivedData : {});\n\n $scope.rootBroadcast(constants.YANGMAN_FILL_NODE_FROM_REQ, { requestUrl: reqObj.path, requestData: data },\n function (){\n $scope.setRightPanelSection(constants.DISPLAY_TYPE_FORM);\n $scope.rootBroadcast(constants.YANGMAN_HEADER_INIT, {\n path: reqObj.path,\n method: reqObj.method,\n statusObj: {\n status: reqObj.responseStatus,\n statusText: reqObj.responseStatusText,\n time: reqObj.responseTime,\n },\n });\n\n if ( $scope.node ) {\n // prepare data for filling form\n if ($scope.node.type === constants.NODE_RPC && $scope.historySettings.data.fillWithReceived) {\n data = YangmanService.prepareReceivedData(\n $scope.node,\n reqObj.method,\n reqObj.receivedData,\n reqObj.sentData,\n constants.DISPLAY_TYPE_FORM\n );\n }\n\n // try to fill node\n YangmanService.fillNodeFromResponse($scope.node, data);\n $scope.node.expanded = true;\n }\n\n }\n );\n\n }", "handleEditProduct(id) {\n this.setState(prevState => ({\n currentProductUpdateForm: !prevState.currentProductUpdateForm\n }));\n }", "function update_form_data(res) {\n $(\"#promo_id\").val(res.id);\n $(\"#promo_name\").val(res.name);\n $(\"#promo_type\").val(res.promo_type);\n $(\"#promo_value\").val(res.value);\n $(\"#promo_start_date\").val(res.start_date);\n $(\"#promo_end_date\").val(res.end_date);\n $(\"#promo_detail\").val(res.detail);\n }", "handleDataLoaded() {\r\n this.setState({submitted: true});\r\n }", "function update(id, updatedForm) {\n var deferred = q.defer();\n\n FormModel.findByIdAndUpdate(id, { $set: updatedForm }, { new: true },\n function(err, uForm) {\n if(err) {\n deferred.reject(err);\n } else {\n deferred.resolve(uForm);\n }\n });\n\n return deferred.promise;\n }", "function success_form(response, status, xhr, form){\n if (successForm(response, status, xhr, form)) {\n form.clearForm();\n }\n else {\n }\n}", "function fanTuriUpdate(id) {\n let form = document.forms['updateFanTuriForm'];\n let check = {}\n check.id=id;\n check.nomi = form[\"nomiUpdate\"].value;\n fanTuriService.update(JSON.stringify(check), location.reload(), console.log(\"xato\"));\n}", "function submitAndRerender() {\n if (this.value === \"\") { return };\n submit(this)\n renderCurrent();\n }", "function patchForm(form) {\n\t if (!form.__patchedByBootstrapForm) {\n\t BootstrapForm.patchFields(form)\n\t form.__patchedByBootstrapForm = true\n\t }\n\t}", "renderInformationForm(boolean) {\n if (boolean === true) {\n return (\n <InformationForm\n toggle={this.toggleInformationForm}\n props={this.props}\n get={() => this.getCandidat()}\n set={item => this.setCandidat(item)}\n type={\"candidat\"}\n />\n );\n }\n }", "function update_entity_edit() {\n var form_record = Domain.entities[current_entity];\n Forms.init(form_record);\n update_edit_form_display();\n}", "editForm() {\n this.setState((state) => {\n state.preview = false\n return state\n })\n }", "function directEditFormSubmit( fm)\r\n{\r\n directEditCloseAll();\r\n return self.btnClicked != 'Cancel' &&\r\n self.btnClicked != 'Back';\r\n}", "function ajaxFormUpdateRecomendacion(event) {\n event.preventDefault();\n\n const dataUpdate = new FormData( formRecomendacionUpdate);\n document.getElementById(\"btnUpdateRecomendacion\").value = \"Enviando...\";\n\n fetch( formRecomendacionUpdate.action, {\n method: 'POST',\n body: dataUpdate,\n mode: \"cors\",\n headers: {\n accept: \"application/json\",\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n }\n })\n .then(response => {\n if (response.ok) {\n response.text().then(success => {\n toastr.info('Success:', success);\n dtRecomendacion.draw();\n $('#formRecomendacionUpdate').trigger(\"reset\");\n $('#modalRecomendacionUpdate').modal('hide');\n document.getElementById(\"btnUpdateRecomendacion\").value = \"Enviar\";\n });\n } else {\n throw response.json().then(error => {\n for (var clave in error.errors) {\n let container = $('#' + $.escapeSelector(clave)).closest('div');\n container.find('input, select, textarea').addClass('is-invalid');\n container.addClass('is-invalid-container');\n container.append('<div class=\"invalid-feedback\">' + error.errors[clave] + '</div>');\n }\n document.getElementById(\"btnUpdateRecomendacion\").value = \"Enviar\";\n\n\n })\n }\n })\n .catch(error => {\n console.log('request failed');\n });\n}", "function form_postSourcing(type, name)\n{\n if (name == 'entity') { // Client field has changed\n hasClientAgreedToTerms();\n }\n}" ]
[ "0.6650722", "0.6561767", "0.6399934", "0.6288627", "0.61664265", "0.61469835", "0.6077053", "0.6077053", "0.60443324", "0.6023432", "0.59711677", "0.5970002", "0.59667534", "0.59583205", "0.5948626", "0.59467125", "0.5937678", "0.59367144", "0.5928914", "0.59220713", "0.59185314", "0.59185314", "0.5881857", "0.5874237", "0.5844109", "0.58434135", "0.58409125", "0.5833964", "0.5819097", "0.5792544", "0.57813746", "0.57813746", "0.57813746", "0.5775704", "0.57607514", "0.5751278", "0.57476294", "0.57172436", "0.57142824", "0.57136863", "0.56849587", "0.5684256", "0.5680511", "0.5679057", "0.56759673", "0.5659349", "0.5657176", "0.5656432", "0.5647215", "0.5645573", "0.5639897", "0.56246793", "0.56176215", "0.5616878", "0.56074625", "0.5594177", "0.5593051", "0.5590498", "0.5589183", "0.55882996", "0.5577679", "0.55747724", "0.55627495", "0.5560319", "0.55411136", "0.55366987", "0.5536528", "0.55356026", "0.55328244", "0.5532618", "0.5530812", "0.5520752", "0.55205023", "0.55134803", "0.55113816", "0.55069095", "0.54998285", "0.54965854", "0.549239", "0.548604", "0.5484944", "0.54721314", "0.54704523", "0.5468577", "0.5467567", "0.5455627", "0.5454798", "0.5454033", "0.5451428", "0.54499066", "0.5449191", "0.54470664", "0.5446449", "0.54398745", "0.5439179", "0.5438777", "0.5434337", "0.54287416", "0.54270166", "0.542344" ]
0.63624835
3
resolve to new form created (should probably resolve to form id to send less data)
function createForm(formdata) { return new Promise((resolve, reject) => { if(!form || !formdata) reject(new Error("forms is not found")); // should probably return form that was created resolve(true); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newProjectForm() {\n\t\t$.get(\"/projects/new\", function(projectForm) {\n\t\t\tdocument.getElementById('js-new-project-form').innerHTML = projectForm;\n\t\t}).done(function() {\n\t\t\tlistenerSaveProject();\n\t\t})\n}", "function createFormForUser(newForm, userid) {\n var deferred = q.defer();\n newForm.userid = userid;\n\n FormModel.create(newForm, function(err, newForm) {\n if(err) {\n deferred.reject(err);\n } else {\n // get the new list of forms owned by this userid\n findFormsByUserId(userid)\n .then(function(userForms) {\n deferred.resolve(userForms);\n });\n }\n });\n\n return deferred.promise;\n }", "function show_first_form()\n{\n $.get('forms/form_asset.html', function(data) {\n $('#insert-form').html(data);\n });\n $('#insert-form').trigger('create');\n window.location = ('form.html'); //initial refresh\n}", "function create(newForm) {\n var deferred = q.defer();\n\n FormModel.create(newForm, function(err, newForm) {\n if(err) {\n deferred.reject(err);\n } else {\n // get the new list of all forms to return\n findAll()\n .then(function(allForms) {\n deferred.resolve(allForms);\n });\n }\n });\n\n return deferred.promise;\n }", "createForm(){\n this.form_ = this.create_();\n }", "function handleNewPlantSubmit(e){\n let targetFormId = parseInt(e.target.id)\n let newPlantField = document.querySelector(`#new-plant-form-${targetFormId}`)\n let plantInput = newPlantField.querySelectorAll(\"input#plant\")\n let newPlantObj = {\n garden_id: plantInput[0].value,\n plantName: plantInput[1].value,\n plantType: plantInput[2].value,\n plantFamily: plantInput[3].value\n }\n Api.newPlant(newPlantObj)\n location.reload()\n}", "showCreateForm(data) {\n this.clearNewOrgan(data);\n this.changeFormMode(this.FORM_MODES.CREATE);\n }", "function findNewForm() {\n return $('center#new_person form'); \n}", "function NewEntryForm() {\n $(\"#addCancel\").click(this.clearForm);\n $(\"#addButton\").click(this.submitForm);\n }", "createForm() {\n const newForm = document.createElement(\"form\");\n newForm.setAttribute(\"method\", \"GET\");\n newForm.setAttribute(\"action\", \"#\");\n this.parent.appendChild(newForm);\n return newForm;\n }", "create(form) {\n this.submitted = true;\n this.homework.creator = this.getCurrentUser();\n this.homework.maxPoints = this.maxPoints;\n // TODO add class (fetch from teacher?)\n\n if (form.$valid) {\n this.homeworkService.save(this.homework, () => {\n // Refresh the page\n this.$state.go(this.$state.current, {}, {reload: true});\n });\n }\n }", "function createNewPlantForm(e){\n clearDivPlantField()\n clearDivNewPlantForm()\n let targetGardenId = parseInt(e.target.parentNode.id)\n let newPlantField = document.querySelector(`#new-plant-form-${targetGardenId}`)\n newPlantField.innerHTML = `\n <input hidden id=\"plant\" value=\"${targetGardenId}\" />\n Plant Name:\n <input id=\"plant\" type=\"text\"/>\n <br>\n Plant Type:\n <input id=\"plant\" type=\"text\"/>\n <br>\n Plant Family:\n <input id=\"plant\" type=\"text\"/>\n <br>\n <span class=\"plant-submit\" id=\"${targetGardenId}\">Submit</span>\n `\n let plantSubmit = document.querySelector(`.plant-submit`)\n plantSubmit.addEventListener(\"click\", handleNewPlantSubmit)\n}", "function createFieldForForm(id, field)\n\t\t{\n\t\t\tvar deferred = $q.defer();\t\t\n\t\t\t// POST the new field into the given form\n\t\t\t$http.post(\"/api/assignment/form/\" + id + \"/field\", field)\n\t\t\t.success(function(response)\n\t\t\t{\n\t\t\t\tdeferred.resolve(response);\n\t\t\t});\n\n\t\t\treturn deferred.promise;\n\t\t}", "function openFormCreate(elem)\n{\n\t//Clean form data\n\tdocument.getElementById('formEnreg').reset();\t\n\t//Cache table list film\n\trendreInvisible(elem);\n\t//Display form\n\t$(\"#divFormFilm\").show();\n}", "function storeForm() {\n /*jshint validthis:true */\n var form = $(this);\n var formId = form[0].id;\n if (!formId) return;\n var formJSON = app.formToJSON(form);\n if (!formJSON) return;\n app.formStoreData(formId, formJSON);\n form.trigger('store', {\n data: formJSON\n });\n }", "function formsCreate(request) {\r\n var promise = new Promise(function(resolve, reject) {\r\n if(!request.body.viewsiteId || !request.body.viewpageId) {\r\n // Required IDs\r\n reject('Viewsite and Viewpage IDs are both required!');\r\n } else if(!request.body.formTitle) {\r\n // Required fields\r\n reject('All fields required!');\r\n } else if(!request.session.userId) {\r\n // Make sure a User is logged in\r\n reject('You must be logged in to create a Form!');\r\n } else {\r\n // Find Viewsite whose Viewpage a Form Element is being created for\r\n viewsites.findById(request.body.viewsiteId)\r\n .exec(function(error, viewsiteData) {\r\n if(error) {\r\n // Handle unknown errors\r\n console.log(error.message);\r\n reject('Something went wrong!');\r\n } else if(viewsiteData.userId != request.session.userId) {\r\n // Make sure User owns Viewsite\r\n reject('You can only create Forms for Viewsites you own!');\r\n } else if(!viewsiteData) {\r\n // Handle non-existent query results\r\n reject('Viewsite not found!');\r\n } else {\r\n // Push a new Form Element onto the\r\n // Viewsite's Viewpage's Element array\r\n viewsiteData.viewpages.id(request.body.viewpageId).elements.push({\r\n 'kind': request.body.kind,\r\n 'formTitle': request.body.formTitle\r\n });\r\n // Save the new Viewsite data\r\n viewsiteData.save(function(error, results) {\r\n if(error) {\r\n // Handle unknown errors\r\n console.log(error.message);\r\n reject('Something went wrong!');\r\n } else {\r\n // Get the number of elements a Viewpage has\r\n let elementsLength = results\r\n .viewpages.id(request.body.viewpageId)\r\n .elements.length;\r\n // Get the ID of the Form Element just created\r\n request.body.elementId = results\r\n .viewpages.id(request.body.viewpageId)\r\n .elements[elementsLength - 1]._id;\r\n // Create a User Table with the same ID as the\r\n // Form Element just created\r\n userTablesDao.userTablesCreate(request)\r\n .then(function() {\r\n // Clean up results and return up-to-date Viewsite\r\n var cleanResults = results.toObject();\r\n delete cleanResults.userId;\r\n delete cleanResults.__v;\r\n resolve(cleanResults);\r\n }, function(error) {\r\n // Handle unknown errors\r\n console.log(error.message);\r\n reject('Something went wrong!');\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n return promise;\r\n}", "renderNewItemForm(e) {\n const form = e.target.parentElement.querySelector('form')\n form.style.display = 'block'\n }", "addForm() {\n // Creates a new form based on TEMPLATE\n let template = document.importNode(TEMPLATE.content, true);\n FORMSET_BODY.appendChild(template);\n let form = FORMSET_BODY.children[FORMSET_BODY.children.length -1];\n\n // Updates the id's of the form to unique values\n form.innerHTML = form.innerHTML.replace(MATCH_FORM_IDS, this.updateMatchedId.bind(this, form));\n\n let index = FORMSET_BODY.children.length;\n FORMSET.querySelector('[name=\"form-TOTAL_FORMS\"]').value = index;\n this.updateButton();\n }", "function storeForm() {\n /*jshint validthis:true */\n var form = $(this);\n var formId = form[0].id;\n if (!formId) return;\n var formJSON = app.formToData(form);\n if (!formJSON) return;\n app.formStoreData(formId, formJSON);\n form.trigger('store form:storedata', {data: formJSON});\n }", "function createForm(e){\n var newTaskForm = document.createElement(\"form\");\n newTaskForm.setAttribute(\"id\", \"newTaskForm\");\n newTaskForm.setAttribute(\"class\", \"popup\");\n\n //add a header to the new form\n newTaskForm.innerHTML += \"<h2 id='newTaskFormHeader'>Create New Task</h2>\";\n\n //add form elements\n addTaskBox(newTaskForm);\n addPriorityBox(newTaskForm);\n addDueDate(newTaskForm);\n addDescriptionBox(newTaskForm);\n addButtons(newTaskForm);\n\n //make form draggable\n drag(newTaskForm);\n\n count = 1;\n\n return newTaskForm;\n}", "navigateAdd() {\n this.channel.trigger('show:form');\n }", "function show_form()\n{\n $.get('forms/form_asset.html', function(data) {\n $('#insert-form').html(data);\n });\n $('#insert-form').trigger('create');\n}", "function storeForm() {\n\t /*jshint validthis:true */\n\t var form = $(this);\n\t var formId = form[0].id;\n\t if (!formId) return;\n\t var formJSON = app.formToData(form);\n\t if (!formJSON) return;\n\t app.formStoreData(formId, formJSON);\n\t form.trigger('store form:storedata', {data: formJSON});\n\t }", "function storeForm() {\n /*jshint validthis:true */\n var form = $(this);\n var formId = form[0].id;\n if (!formId) return;\n var formJSON = app.formToJSON(form);\n if (!formJSON) return;\n app.formStoreData(formId, formJSON);\n form.trigger('store', {data: formJSON});\n }", "function addNewForm() {\n var prototype = $collectionHolder.data('prototype')\n var index = $collectionHolder.data('index')\n var newForm = prototype\n newForm = newForm.replace(/__name__/g, index)\n $collectionHolder.data('index', index+1)\n // création panel\n var $panel = $(\n '<div class=\"panel panel-warning\"><div class=\"panel-heading\"></div></div>',\n )\n var $panelBody = $('<div class=\"panel-body\"></div>').append(newForm)\n $panel.append($panelBody)\n addRemoveButton($panel)\n $addNewItem.before($panel)\n}", "createForm() {\n cy\n .get(this.locators.createButtonContainer)\n .find(this.locators.createButton)\n .click()\n\n return this;\n }", "static newTaskForm() {\n if (didInit) return\n const newTaskSubmit = document.querySelector('#newTaskSubmit')\n newTaskSubmit.addEventListener('click', DomInput.newTaskSubmit);\n }", "function abrirPostForm( form_url ){\n\n if( ! self.postForm ){\n\n $.get( form_url, appendAjaxData)\n .success(function(form){\n\n self.postForm = $(form);\n\n showForm( 'post' );\n\n })\n .fail(function(res){\n mostraErro( 'Falha ao carregar o formulário de criação: ' + form_url);\n });\n\n } else\n showForm( 'post' );\n\n\n\n }", "function createFormField(id, newField) {\n var deferred = q.defer();\n newField.id = guid(); // keep this since Mongo won't create\n // one for subdocs\n\n FormModel.findById(id, function(err, form) {\n if(err) {\n deferred.reject(err);\n } else {\n if(!form.fields) {\n form.fields = [];\n }\n form.fields.push(newField);\n form.save(function(err, form) {\n if(err) {\n deferred.reject(err);\n } else {\n deferred.resolve(form);\n }\n });\n }\n });\n\n return deferred.promise;\n }", "function dialogCreateContactSubmit(form){\n if(!check_form('EditView')){\n return false;\n }\n \n $('#ajaxRequest', $(form)).val(1);\n $('#from', $(form)).val('dialog');\n return true;\n}", "function createRegistrationForm(){\n registrationForm = new MyForm(\n templates.tNewForm,\n [\n {\n id : 'registrate',\n class : 'btn btn-primary',\n name : 'Registrate',\n action : registrationUser\n },\n {\n id : 'cancel',\n class : 'btn btn-primary',\n name : 'Cancel',\n action : function(e){\n e.preventDefault();\n registrationForm.hide();\n }\n }\n ]\n );\n validation(registrationForm.form);\n }", "function new_content_form (id){\n\t\t// Create div and append form.\n\t\t$(BB_divID + ' .new_content').append('<div class=\"new_content_form\"></div>');\n\t\tvar new_form = '<form class=\"new_content_form\">' + \n\t\t\t'<label class=\"user\">Name:</label><input name=\"User\" type=\"text\" class=\"user\">';\n\t\tif (id == 'thread')\n\t\t\t{ new_form +='<label class=\"user\">Subject:</label><input name=\"Subject\" type=\"text\" class=\"subject\">'; } \n\t\telse\n\t\t\t{ new_form += '<input type=\"hidden\" value=\"'+ id +'\" name=\"ID\">'; }\n\t\tnew_form += '<label class=\"message\">Message:</label><textarea name=\"Message\" rows=\"4\" cols=\"30\" class=\"message\"></textarea>' +\n\t\t\t'<img class=\"captcha\" src=\"securimage/securimage_show.php\" alt=\"CAPTCHA Image\"/>' +\n\t\t\t'<a type=\"button\" href=\"new image\" class=\"new_captcha\">click here for different image</a>' +\n\t\t\t'<label class=\"captcha\">Captcha:</label><input type=\"text\" class=\"captcha_code\" name=\"captcha_code\" size=\"10\" maxlength=\"6\" />' +\n\t\t\t'<input type=\"button\" value=\"Post\" class=\"make_content\">' +\n\t\t\t'</form>';\n\t\t$(BB_divID + ' .new_content_form').append( new_form );\n\n\t\t// Activate link for new captcha image\n\t\t$(BB_divID + ' .new_captcha').click( function(e){ attach_action(e,'',function(){\n\t\t\t$(BB_divID +' .captcha').attr('src', 'securimage/securimage_show.php?' + Math.random());\n\t\t});});\n\t}", "createForm () {\n if (document.getElementById('leaderboardButton')) {\n document.getElementById('leaderboardButton').remove();\n }\n crDom.createLeaderboardButton();\n crDom.createForm();\n crDom.createCategoriesChoice(this.filter.category);\n crDom.createDifficultyChoice(this.filter.difficulty);\n crDom.createRangeSlider(this.filter.limit);\n crDom.createStartButton();\n }", "function handleSubmit(e) {\n // function to create a new contact and then close the model\n e.preventDefault();\n createContact(idRef.current.value,nameRef.current.value);\n closeModal();\n\n // create contact\n }", "NewItemForm(e) {\n if (typeof this.props.onNew === 'function') {\n var props = {\n type: \"existing\",\n item_id: this.props.menu[1].item_id,\n menu: {\n \"name\": this.props.menu[0],\n \"category\": this.props.menu[1].category,\n \"price\" : this.props.menu[1].price,\n \"calories\": this.props.menu[1].calories,\n \"in_stock\": this.props.menu[1].in_stock,\n \"description\": this.props.menu[1].description\n }\n }\n this.props.onNew(props);\n }\n }", "function loadCreationForm() {\n /* Cacher le formulaire qui est déjà affiché, s'il y a lieu */\n $(\"#updateProjetForm\").hide(\"slide\", {direction: \"right\"}, 500);\n /* Afficher creationForm*/\n $(\"#creerProjetForm\").toggle(\"slide\", {direction: \"right\"}, 500);\n $(\"#creerProjetForm\").focus();\n}", "function insert_new_contact(form_name){\t\t\n\t\t$(form_name).submit(function(e){\n\t\t\te.preventDefault();\n\t\t\tvar postData = $(this).serialize();\n\t\t\tvar url = $(this).attr('action');\n\t\t\t\t$.post(url, postData, function(php_table_data){\n\t\t\t\t\t$(form_name)[0].reset();\n\t\t\t\t\tlocation.reload();\t\t\t\t\t\n\t\t\t\t});\n\t\t});\t\n\t}", "fillForm ( data ) {\n this.title.value = data.title;\n this.body.value = data.body;\n this.id.value = data.id;\n\n // change form state\n this.changeFormState( \"edit\" )\n\n }", "function createNewAdminPhone() {\n vm.new_admin_phone.submit = true;\n if (vm.new_admin_phone_form.$valid) {\n Merchant.create('admin_phone',vm.new_admin_phone).then(function(response) {\n vm.admin_phones.push(response.data);\n\n vm.new_admin_phone_form.name.$faded = false;\n vm.new_admin_phone_form.phone_no.$faded = false;\n //Set Admin Email Form to be New Again\n vm.new_admin_phone = {};\n vm.new_admin_phone.success = true;\n\n $(\"#add-admin-phone-modal\").modal('toggle');\n\n $timeout(resetForm, 3500);\n });\n }\n }", "okForm() {\n const { id } = this.state;\n const body = { id, parameters: this.stateParametersToArray() };\n this.submitForm(body);\n }", "formAssociatedCallback(nullableForm) {\n console.log('Form associated.');\n }", "create(form) {\n return form.post('/api/organizations')\n .then(response => {\n return response;\n })\n .catch(err => {\n return err;\n })\n }", "function createForeign() {\n\n executePost(createForeignUrl, $(\"form\").serialize());\n}", "newForm(){\n this.setState({\n type: 'Add',\n id: null,\n avatar: null,\n nameValid: false,\n neighborhoodValid: false,\n formValid: false,\n counter: 0,\n neighborhood: {\n name: 'Choose Neighborhood'\n }\n })\n }", "function popupForm(id){\n\t//TODO: apply formData.activityList to activityListHtml\n}", "function get_form_new_poste(){\n\t$.get(\n base_url + 'index.php/adm/contacts_postes_load_form',\n {nohtml:'nohtml'},\n function(data){\n $(\"#modal-global-body\").html(data);\n } \n );\n $('#modal-global-label').html('<i class=\"fa fa-suitcase\"></i>&nbsp;&nbsp;Nouveau poste');\n $('#modal-global').modal('show');\n}", "function _formHandler(ev) {\r\n ev.preventDefault();\r\n var contact = new Contact(el.form.serializeObject());\r\n contact.save(_renderThanks, _renderError);\r\n }", "function loadForm() {\n var $this = $(this),\n type = $this.attr('id').split('-')[2],\n opts = options[type];\n\n $.showCustomModal(\n opts.buttonText,\n opts.form,\n {\n id: 'requestWindow',\n width: 650,\n buttons: [{\n id: 'cancel',\n message: 'Cancel',\n handler: function () {\n $('#requestWindow').closeModal();\n }\n }, {\n id: 'submit',\n defaultButton: true,\n message: 'Save',\n handler: function () {\n submitForm(opts);\n }\n }],\n callback: function() {\n // Fire hook for scripts that use the form\n mw.hook('vstf.reportsform').fire();\n }\n }\n );\n }", "function dialogCreateNotesSubmit(form, parent_type, parent_id){\n if(!check_form('EditView')){\n return false;\n }\n\n var data = $(form).serializeArray();\n data.push({name:'ajaxRequest', value:1});\n data.push({name:'from', value:'diaglog'});\n data.push({name:'parent_type', value:parent_type});\n data.push({name:'parent_id', value:parent_id});\n\n $.ajax({\n async:true,\n cache:true,\n url: $(form).attr('action'),\n type: $(form).attr('method'),\n data: data,\n dataType: 'html',\n timeout:15000,\n beforeSend:function(){\n showTip('Loading...');\n },\n success: function(data){\n showTip('Saved.');\n \n //refresh notes list\n refreshNotesList(parent_type, parent_id);\n \n $('#create_new_notes').dialog('close');\n return false;\n }\n });\n\n return false;\n}", "create() {\n this.id = 0;\n this.familyName = null;\n this.givenNames = null;\n this.dateOfBirth = null;\n\n this.validator.resetForm();\n $(\"#form-section-legend\").html(\"Create\");\n this.sectionSwitcher.swap('form-section');\n }", "static newProjectForm() {\n if (didInit) return;\n const newProjectSubmit = document.querySelector('#newProjectSubmit');\n newProjectSubmit.addEventListener('click', DomInput.newProjectSubmit);\n }", "function handleCreateUserForm(event){\n\tif (DEBUG) {\n\t\tconsole.log (\"Triggered handleCreateUserForm\")\n\t}\n\t//Call the API method to extract the template\n\t//$this is the href\n\tgetUsersForm($(this).attr(\"href\"))\n\treturn false;\n}", "function generate_new_form(){\n\t$('.form_div:first').clone().insertAfter('.form_div:last')\n}", "function getUserCreateForm(){\n showCreateDialog();\n}", "function createFieldForForm(formId, field) {\n return $http.post(\"/api/assignment/form/\"+formId+\"/field\", field);\n }", "function addNewItem() { switchToView('edit-form'); }", "function createOne() {\n var participantForm = session.forms.giftregistry.event.participant;\n\n Form.get(session.forms.giftregistry).clear();\n\n participantForm.firstName.value = customer.profile.firstName;\n participantForm.lastName.value = customer.profile.lastName;\n participantForm.email.value = customer.profile.email;\n\n app.getView().render('account/giftregistry/eventparticipant');\n}", "function watchCreationForm() {\n $('#new-client-form').submit(event => {\n event.preventDefault();\n const newDogOwner = {\n firstName: $('#firstName-new-client').val(),\n lastName: $('#lastName-new-client').val(),\n dogNames: $('#dogNames-new-client').val(),\n address: $('#address-new-client').val(),\n notes: $('#notes-new-client').val(),\n walkTimeRange: $('#walkTimeRange-new-client').val(),\n walkDays: $('#walkDays-new-client').val(),\n phoneNumber: $('#phoneNumber-new-client').val(),\n email: $('#email-new-client').val()\n };\n\n HTTP.createDogOwner({\n jwtToken: STATE.authUser.jwtToken,\n newDogOwner: newDogOwner,\n onSuccess: owner => {\n alert('New Client added successfully.');\n window.open('/user/hub.html', '_self');\n },\n onError: err => {\n $('#error-message').html(`\n <p>There was an issue processing your request. Please verify that all entries are valid.</p>\n `);\n console.error(err);\n }\n });\n });\n}", "constructor(parent) {\n this.parent = parent;\n this.form = this.createForm();\n }", "fillParentFormInParent(data, element, form = 'persistenceForm') {\n let v = bsw.cnf.v;\n let closeModal = (typeof data.closePrevModal === 'undefined') ? true : data.closePrevModal;\n let closeDrawer = (typeof data.closePrevDrawer === 'undefined') ? true : data.closePrevDrawer;\n closeModal && bsw.modalOnCancel();\n closeDrawer && bsw.drawerOnCancel();\n v.$nextTick(function () {\n if (v[form] && data.repair) {\n v[form].setFieldsValue({[data.repair]: data.ids});\n }\n });\n }", "submitForm(e) {\n e.preventDefault();\n window.M.updateTextFields();\n let data = Util.getDataElementsForm(e.target, false);\n\n MakeRequest({\n method: 'post',\n url: 'actividad/post',\n data : data\n }).then(response => {\n if (response.error) {\n return Util.getMsnDialog('danger', Util.getModelErrorMessages(response.message));\n }\n\n this.getActivitiesByCategory();\n return Util.getMsnDialog('success', 'Created');\n });\n }", "function showNewUserForm ($form) {\n\t//Remove selected users in the sidebar\n\tdeselectUser();\n\t//Be sure that mainContent is shown\n\t$(\"#mainContent\").show();\n\t//Remove data from previously created users\n\t$(\"#newUserData\").empty();\n\t//Add the new form\n\t$(\"#newUserData\").append($form);\n\t//Hide existingUserData div\n $(\"#existingUserData\").hide();\n //Show the div with the new form.\n $(\"#newUserData\").show();\n}", "navigateToAddNewFeeSchedulesForm() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.getFeeSchedulesPO().getAddNewFeeScheduleButton().click();\n });\n }", "function createUpdateForm(){\n updateForm = new MyForm(\n templates.tNewForm,\n [\n {\n id : 'update',\n class : 'btn btn-primary',\n name : 'Update',\n action : updateUser\n },\n {\n id : 'esc',\n class : 'btn btn-primary',\n name : 'Cancel',\n action : function(e){\n e.preventDefault();\n updateForm.hide();\n }\n }\n ]\n );\n validation(updateForm.form);\n }", "submitForm (event) {\n\t\tevent.preventDefault();\n\t\tconst createForm = event.target;\n\t\tconst formData = new FormData(createForm);\n\t\tthis.props.list.createItem(formData, (err, data) => {\n\t\t\tif (data) {\n\t\t\t\tif (this.props.onCreate) {\n\t\t\t\t\tthis.props.onCreate(data);\n\t\t\t\t} else {\n\t\t\t\t\t// Clear form\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tvalues: {},\n\t\t\t\t\t\talerts: {\n\t\t\t\t\t\t\tsuccess: {\n\t\t\t\t\t\t\t\tsuccess: 'Item created',\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} else {\n\t\t\t\tif (!err) {\n\t\t\t\t\terr = {\n\t\t\t\t\t\terror: 'connection error',\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t// If we get a database error, show the database error message\n\t\t\t\t// instead of only saying \"Database error\"\n\t\t\t\tif (err.error === 'database error') {\n\t\t\t\t\terr.error = err.detail.errmsg;\n\t\t\t\t}\n\t\t\t\tthis.setState({\n\t\t\t\t\talerts: {\n\t\t\t\t\t\terror: err,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "function new_alt_loc() {\n\t \n\t $.ajax({\n\t\t type: \"POST\",\n\t\t url: \"/advertiser_admin/form_actions/advert_alt_loc_frm.deal\",\n\t\t success: function(msg){\n\t\t jQuery(\"#alt_loc_form_area\").html(msg);\n\t\t }\n\t });\n\t \n }", "function createForm() {\n var formElement = $(\"[name='contactForm']\").empty();\n // Add form elements and their event listeners\n formFields.forEach(function (formField) {\n var labelElement = $(\"<label>\")\n .attr(\"for\", formField.name)\n .text(formField.des);\n formElement.append(labelElement);\n var inputElement = $(\"<input>\")\n .attr(\"type\", formField.type)\n .attr(\"name\", formField.name)\n .attr(\"value\", (anime[formField.name] || \"\"));\n if (formField.required) {\n inputElement.prop(\"required\", true).attr(\"aria-required\", \"true\");\n }\n if (formField.type == \"date\"){\n inputElement.get(0).valueAsDate = new Date(anime[formField.name]);\n }\n formElement.append(inputElement);\n inputElement.on('input', function () {\n var thisField = $(this);\n inputHandler(formField.name, thisField.val());\n });\n // clear the horizontal and vertical space next to the \n // previous element\n formElement.append('<div style=\"clear:both\"></div>');\n });\n if (editForm) {\n addUpdateAndDeleteButtons(formElement);\n } else {\n addNewButton(formElement);\n }\n\n }", "function dialogCreateTaskSubmit(form, parent_type, parent_id){\n if(!check_form('EditView')){\n return false;\n }\n\n var data = $(form).serializeArray();\n data.push({name:'ajaxRequest', value:1});\n data.push({name:'from', value:'diaglog'});\n data.push({name:'parent_type', value:parent_type});\n data.push({name:'parent_id', value:parent_id});\n\n $.ajax({\n async:true,\n cache:true,\n url: $(form).attr('action'),\n type: $(form).attr('method'),\n data: data,\n dataType: 'html',\n timeout:15000,\n beforeSend:function(){\n showTip('Loading...');\n },\n success: function(data){\n showTip('Saved.');\n \n //refresh task list\n refreshTaskList(parent_type, parent_id);\n \n $('#create_new_task').dialog('close');\n return false;\n }\n });\n\n return false;\n}", "submit() {\n this.$ngRedux.dispatch(actionTrigger(types.ADD_DATA, this.form));\n this.form = {};\n }", "function submitCreateIssueForm(elt) {\n var formElt = $j(elt).closest('form');\n var loadingElt = formElt.find('.loading');\n\n loadingElt.removeClass('hidden');\n $j.ajax({\n type: \"POST\",\n url: baseUrl + '/issue/create',\n data: formElt.serialize()}\n ).success(function (html) {\n var replaced = $j(html);\n formElt.replaceWith(replaced);\n }\n ).error(function (jqXHR, textStatus, errorThrown) {\n var errorsElt = formElt.find('.code-issue-errors');\n errorsElt.html(jqXHR.responseText);\n errorsElt.removeClass('hidden');\n }\n ).always(function () {\n loadingElt.addClass('hidden');\n });\n return false;\n}", "function initialiseForm() {\n\n // utility functions\n function rollback($form) {\n $form.find('input[type=text]').each(function () {\n var $this = $(this);\n $this.val($this.data('rollback'));\n });\n }\n function updateDetails($form, data) {\n $form.find('#fullname').val(data.displayName);\n $form.find('#email').val(data.emailAddress);\n $form.find('input[type=text]').each(function () {\n var $this = $(this);\n $this.data('rollback', $this.val());\n });\n }\n function closeEditDetails($form) {\n $form.removeClass('editing').find('#fullname, #email').attr('readonly', 'readonly');\n $('#ajax-status-message').empty();\n clearErrors();\n }\n\n // event bindings\n $('#edit-details').click(function (e) {\n $('.panel-details form.editable').addClass('editing').find('#fullname, #email').removeAttr('readonly');\n if (e.target.id !== 'email') {\n $('#fullname', '.panel-details form.editable').focus();\n }\n e.preventDefault();\n });\n $('.panel-details form.editable').keyup(function (e) {\n if (e.which === AJS.keyCode.ESCAPE) {\n $('a.cancel', this).click();\n }\n });\n $('.cancel', '.panel-details form.editable').click(function (e) {\n e.preventDefault();\n var $form = $(this).parents('form');\n rollback($form);\n closeEditDetails($form);\n return false;\n });\n $('.panel-details form.editable').submit(function (e) {\n e.preventDefault();\n clearErrors();\n var $form = $(this);\n var displayName = $form.find('#fullname').val();\n ajax.rest({\n url: $form.attr('action'),\n type: 'PUT',\n data: {\n name: $form.find('#name').val(),\n displayName: displayName,\n email: $form.find('#email').val()\n },\n statusCode: { // these errors are handled locally.\n '500': function _() {\n return false;\n },\n '404': function _() {\n return false;\n },\n '401': function _() {\n return false;\n },\n '400': function _() {\n return false;\n }\n }\n }).done(function (data) {\n updateDetails($form, data);\n closeEditDetails($form);\n notifySuccess(AJS.I18n.getText('bitbucket.web.user.update.success', displayName));\n }).fail(function (xhr, textStatus, errorThrown, data) {\n var errors = data && data.errors ? data.errors : AJS.I18n.getText('bitbucket.web.user.update.failure');\n notifyErrors(errors);\n });\n });\n }", "static createAnIngredient(e) {\n e.preventDefault()\n fetch(`${BASE_URL}/${recipe2.id}`, {\n method: 'PATCH',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(recipe2) \n })\n .then(resp => resp.json())\n .then(recipe => {\n let ingredient = recipe.ingredients[recipe.ingredients.length - 1 ]\n let i = new Ingredient(ingredient.id, ingredient.name, ingredient.measurement);\n i.renderIngredient(recipe);\n Recipe.mostIngs()\n })\n let newIngForm = document.getElementById(\"new-ing-frm\");\n newIngForm.reset(); \n }", "function puliziaForm() {\n var action = $(this).data(\"href\");\n // Invio il form\n $(\"#formInserisciPrimaNotaLibera\").attr(\"action\", action)\n .submit();\n }", "function getForm (index) {\n\t\t\tloading = true;\n\t\t\tvar form = getbyId(index, forms);\n\t\t\tloading = false;\n\n\t\t\treturn form;\n\t\t}", "function handleFormSubmit(event) {\n event.preventDefault();\n\n API.createExpense({\n title: formObject.title,\n date: formObject.date,\n category: formObject.category,\n clienttocharge: formObject.clienttocharge,\n amount: formObject.amount,\n notes: formObject.notes,\n creator: userId\n })\n .then(() =>\n setFormObject({\n title: \"\",\n date: \"\",\n category: \"\",\n clienttocharge: \"\",\n amount: \"\",\n notes: \"\"\n })\n )\n .then(() => {\n history.push(\"/allclaims\");\n })\n .catch(err => console.log(err));\n }", "function attachFleetForm() {\n $(\"body\").on('renderSuccess.ufModal', function (data) {\n var modal = $(this).ufModal('getModal');\n var form = modal.find('.js-form');\n\n /**\n * Set up modal widgets\n */\n // Set up any widgets inside the modal\n form.find(\".js-select2\").select2({\n width: '100%'\n });\n\n // Auto-generate slug\n form.find('input[name=name]').on('input change', function() {\n var manualSlug = form.find('#form-fleet-slug-override').prop('checked');\n if (!manualSlug) {\n var slug = getSlug($(this).val());\n form.find('input[name=slug]').val(slug);\n }\n });\n\n form.find('#form-fleet-slug-override').on('change', function() {\n if ($(this).prop('checked')) {\n form.find('input[name=slug]').prop('readonly', false);\n } else {\n form.find('input[name=slug]').prop('readonly', true);\n form.find('input[name=name]').trigger('change');\n }\n });\n\n // Set icon when changed\n form.find('input[name=icon]').on('input change', function() {\n $(this).prev(\".icon-preview\").find(\"i\").removeClass().addClass($(this).val());\n });\n\n // Set up the form for submission\n form.ufForm({\n validators: page.validators\n }).on(\"submitSuccess.ufForm\", function() {\n // Reload page on success\n window.location.reload();\n });\n });\n}", "function handleFormSubmit(event) {\n console.log(\"BUTTON CLICK\")\n event.preventDefault();\n const id = localStorage.getItem('id')\n API.saveGarden({\n title: formObject.gardenName,\n user_id: id,\n plant_id: formObject.plant_id,\n size: formObject.size,\n plants:formObject.plants\n }).then(res=>{\n const id = res.data._id\n history.push('/gardenview/'+id)\n })\n console.log(formObject)\n\n }", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('maeEstatProduFrm.accion'), \n\t\tget('maeEstatProduFrm.origen'));\n\n\n\tset('maeEstatProduFrm.id', jsMaeEstatProduId);\n\tset('maeEstatProduFrm.paisOidPais', [jsMaeEstatProduPaisOidPais]);\n\tset('maeEstatProduFrm.codEstaProd', jsMaeEstatProduCodEstaProd);\n\tif(mode == MMG_MODE_CREATE || mode == MMG_MODE_UPDATE_FORM){\n\t\tunbuildLocalizedString('maeEstatProduFrm', 1, jsMaeEstatProduDescripcion)\n\t\tloadLocalizationWidget('maeEstatProduFrm', 'Descripcion', 1);\n\t}else{\n\t\tset('maeEstatProduFrm.Descripcion', jsMaeEstatProduDescripcion);\t\t\n\t}\n\t\n}", "insertForm() {\n this.builder = new Builder(this.container, this.options.template, {\n style: this.options.style,\n formContainerClass: this.options.formContainerClass,\n inputGroupClass: this.options.inputGroupClass,\n inputClass: this.options.inputClass,\n labelClass: this.options.labelClass,\n btnClass: this.options.btnClass,\n errorClass: this.options.errorClass,\n successClass: this.options.successClass,\n });\n this.build();\n }", "function create_form_onChange(self, new_v, old_v)\n {\n var $form = $$(build_name(self, \"create_form\"));\n var changed = $form.isDirty();\n if(changed) {\n var btn = $$(build_name(self, \"create_record\"));\n webix.html.addCss(btn.getNode(), \"icon_color_submmit\");\n btn = $$(build_name(self, \"discard_record\"));\n webix.html.addCss(btn.getNode(), \"icon_color_cancel\");\n }\n }", "fillForm(data) {\n this.titleInput.value = data.title;\n this.bodyInput.value = data.body;\n this.idInput.value = data.id;\n\n this.changeFormState('edit');\n }", "function propagate() {\n\tlet postForm = main.request('postForm');\n\tif (postForm)\n\t\tpostForm.renderIdentity();\n\tsave();\n}", "@api\n form(isCreate, fields) {\n let augmentedFields = fields.map((field) => {\n return {\n ...field,\n options:\n field.dataType === \"Picklist\"\n ? this.wiredPicklistOptions.data[field.apiName]\n : []\n };\n });\n return `\n <form action=\"{{FORM_ACTION}}\" method=\"get\" style=${elementStyles.form}>\n ${augmentedFields.map(elementString).join(\"\")}\n ${\n isCreate\n ? `<input type=\"hidden\" value='{{RECORD_ID}}' name=\"recordId\"/>`\n : \"\"\n }\n <input type=\"hidden\" value='${this.objectApiName}' name=\"objectApiName\"/>\n <input type=\"hidden\" value='{{FORM_ID}}' name=\"formId\"/>\n <button type=\"submit\" style=\"${elementStyles.button}\">Submit</button>\n </form>\n `;\n }", "handleAddFormSubmit(e) {\n console.log('handleFormSubmit');\n e.preventDefault();\n const formData = this.getFormData(e);\n this.doSomethingWithFormData(formData);\n this.hideAddListItemPopup();\n }", "function hookupForm(){\n\n var wholeForm = $(scope.challengeForm);\n\n // Bind up inputs to ng-models\n wholeForm.find('input, textarea, select').each(function(){\n var elem = $(this);\n var name = elem.attr('name') || elem.attr('id');\n if(name){\n elem.attr('ng-model', 'formData.' + name);\n\n // Assign any specified default value\n scope.formData[name] = elem.attr('value');\n }\n });\n\n // Stick it in the dom\n $(el).html(wholeForm);\n\n $compile(wholeForm)(scope);\n }", "function newRequest() {\n\tvar selectedRequest = $( '#requestName' ).val();\n\tif (selectedRequest !== '') {\n\t\t//If the new request has a name, process it.\n\t\tvar data = {\n\t\t\trequest: selectedRequest,\n\t\t\trequest_type: 'new',\n\t\t};\n\t\t$.post('/selectrequestform', data, buildRequest, 'html');\n\t} /*else {\n\t\t//Warn that a new request needs a name XXX ADD THIS XXX\n\t}*/;\n}", "onFormSubmit(evt) {\n\t\tevt.preventDefault()\n\t\t//send an axios request to post it to the databse\n\t\taxios({method: 'post',url:`/api/posts/${this.state.fields.location}`, data:{\n\t\t\t...this.state.fields\n\t\t}})\n\t\t//then redirect them to their new post!\n\t\t.then((post)=>{\n\t\t\tif (post.data.success){\n\t\t\t\tthis.props.history.push(`/posts/${post.data.post.location}/${post.data.post._id}`)\n\t\t\t}\n\t\t\telse{\n\t\t\t\talert('Whoops! Something went wrong!')\n\t\t\t}\n\t\t})\n\t}", "_getForm(shortcode) {\n var snippet = encodeURIComponent(this.activeSnippet);\n var url = this.formUrl.replace('[name]', shortcode);\n var data = { shortcode: snippet };\n\n $.ajax({ url: url, data: data }).done(function(response) {\n if (this.activeShortcode == shortcode) {\n this.$form.html(response);\n this.$form.foundation();\n\n this.$form.find('form').on('submit', function(event) {\n event.preventDefault();\n });\n\n this.formValues = this.$form.find('form').serialize();\n this._loadPreview({ type: 'init' });\n }\n }.bind(this));\n }", "create_album() {\n this.set('item_to_edit', {});\n // Ask for the form to be opened.\n window.dispatchEvent(new CustomEvent(\"open-form\", {\n detail: {\n name: \"create_album_form\",\n album: this.item_to_edit,\n callback: \"resolve_create_album\",\n that: this,\n },\n }));\n }", "fillForm(data){\n this.titleInput.value = data.title;\n this.bodyInput.value = data.body;\n this.idInput.value = data.id;\n\n this.changeFormState('edit');\n }", "@action\n addForm(model) {\n const uuidVal = uuidv4();\n let form = new Form(uuidVal, model);\n this.forms = {...this.forms, [uuidVal]: form};\n for(let propertyName in model){\n this.validate(form.id, propertyName);\n }\n return form;\n \n }", "function insertAnswerForm(id) {\n\t$(\".ideaCloud_idea > form\").remove(); /* clean any forms - really don't know why this line is needed */\n\tvar form = $('<form method=\"post\" action=\"route.php\">');\n\tvar fieldset = $('<fieldset class=\"s_column\">');\n\tfieldset.append('<legend>answer to an idea</legend>');\n\tfieldset.append(' <div><input type=\"hidden\" id=\"idea_id\" name=\"idea_id\" value=\"'+id+'\" /></div>');\n\tfieldset.append(' <div><label for=\"answer_name\">your name</label><input type=\"text\" id=\"answer_name\" required=\"required\" class=\"box_shadow\" name=\"answer_name\" /></div>');\n\tfieldset.append('<div><label for=\"answer_mail\">your mail</label><input type=\"email\" id=\"answer_mail\" required=\"required\" class=\"box_shadow\" min=\"10\" name=\"answer_mail\"/></div>');\n\tfieldset.append('<div><label for=\"answer_text\">your text for idea owner</label><textarea class=\"box_shadow textarea\" name=\"answer_text\" id=\"answer_text\" cols=\"30\" rows=\"10\"></textarea></div>');\n\tfieldset.append('<input type=\"submit\" value=\"answer &rarr;\" />');\n\tform.append(fieldset);\n\t$(\".ideaCloud_idea\").append(form);\n}", "function dialogCreateContact(){\n $(\"#create_new_contact\").length ? $(\"#create_new_contact\") : $(\"<div id='create_new_contact'/>\").appendTo($('body'));\n \n $.ajax({\n async:true,\n cache:true,\n url: '/student/create',\n type: 'GET',\n data: {from:'dialog', ajaxRequest : 1},//this will let the form use dialogCreateContactSubmit() to submit.\n dataType: 'html',\n timeout:15000,\n beforeSend:function(){\n showTip('Loading...');\n },\n success: function(data){\n $('#create_new_contact').dialog({\n title: 'Create new contact',\n width: 650,\n modal: true,\n close: function(event, ui) { \n }\n });\n $(\"#create_new_contact\").html(data);\n hideTip();\n }\n }); \n}", "function abrirPatchForm( form_url, object_id ){\n\n if( ! self.patchForm ){\n\n $.get( form_url )\n .success(function(form){\n\n self.patchForm = $(form);\n\n showForm( 'patch', object_id );\n\n })\n .fail(function(res){\n mostraErro( 'Falha ao carregar o formulário de edição: ' + form_url);\n });\n\n } else\n showForm( 'patch', object_id );\n\n }", "function saveForm(event) {\n event.preventDefault();\n // console.log(propertyId + \" \" + form.address);\n api.saveProperty(propertyId, {address: form.address})\n .then(\n // console.log(res)\n loadForm(propertyId)\n )\n .catch(err => console.log(err));\n}", "function submitinvForm() {\n\t\t// var to reference Firebase db/PartList/~\n\t\tvar partRef = firebase.database().ref().child(\"PartList\");\n\n\t\t// Form push - Needs to pull current values and add inv submitted to them.\n\t\t\n\t}", "submit(data, formRef) {\n Meteor.call(addProjectMethod, data, (error) => {\n if (error) {\n swal('Error', error.message, 'error');\n } else {\n swal('Success', 'Project added successfully', 'success').then(() => formRef.reset());\n }\n });\n }", "function addFormPopUp(container, e) {\n\t\t\t\te.preventDefault()\n\t\t\t\tXenForo.ajax(\n\t\t\t\t\tadd_entry_html,\n\t\t\t\t\t{},\n\t\t\t\t\tfunction (ajaxData, textStatus) {\n\t\t\t\t\t\tif (ajaxData.templateHtml) {\n\t\t\t\t\t\t\tnew XenForo.ExtLoader(e, function() {\n\t\t\t\t\t\t\t\tXenForo.createOverlay('',ajaxData.templateHtml, '').load();\n\t\t\t\t\t\t\t\tconsole.log($(container));\n\t\t\t\t\t\t\t\t$('div.overlayHeading').text(\"Add Frag Entry\");\n\t\t\t\t\t\t\t\t$('[name=dbtc_thread_id]').val($(container).find('div#dbtc_thread_id').attr('value'));\n\t\t\t\t\t\t\t\t// id of donor is in the dbtc_username value field\n\t\t\t\t\t\t\t\t$('[name=dbtc_donor_id]').val($(container).find('div#dbtc_receiver_id').attr('value'));\n\t\t\t\t\t\t\t\t$('[name=dbtc_date]').val($(container).find('div#dbtc_date').text());\n\t\t\t\t\t\t\t\t$('[name=dbtc_parent_transaction_id]').val($(container).attr('data-id'));\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}", "newHandler() {\n\n // We're adding a new task, so set the editing flag and create an ID.\n wxPIM.isEditingExisting = false;\n wxPIM.editingID = new Date().getTime();\n\n // Now show the details form and clear it, then set any defaults. Don't\n // forget to disable the delete button since we obviously can't delete\n // during an add.\n $$(\"moduleTasks-details\").show();\n $$(\"moduleTasks-detailsForm\").clear();\n $$(\"moduleTasks-category\").setValue(1);\n $$(\"moduleTasks-deleteButton\").disable();\n\n }", "fillForm(data){\n this.titleInput.value = data.title\n this.bodyInput.value = data.body\n this.idInput.value = data.id\n\n this.changeFormState('edit')\n }" ]
[ "0.67756826", "0.6715408", "0.6676951", "0.66667616", "0.6656567", "0.6643752", "0.65391237", "0.64958495", "0.63840175", "0.6380023", "0.63715625", "0.63399535", "0.6316941", "0.62762165", "0.62506026", "0.6249293", "0.62392634", "0.6238345", "0.6236167", "0.623004", "0.6226443", "0.6219685", "0.62035054", "0.61970705", "0.61756337", "0.617319", "0.6161827", "0.6153932", "0.6140834", "0.61347204", "0.6106016", "0.60983855", "0.60975236", "0.60898674", "0.6089684", "0.6087704", "0.6076111", "0.60695463", "0.6069163", "0.60606986", "0.60493094", "0.6046563", "0.6039517", "0.6034225", "0.6023782", "0.6022142", "0.60189885", "0.5997854", "0.59930265", "0.59895134", "0.5983728", "0.59834313", "0.5982982", "0.5957496", "0.59561044", "0.5955191", "0.5947732", "0.59469986", "0.5944775", "0.5933145", "0.5932795", "0.592942", "0.5923617", "0.5906393", "0.59058225", "0.59052086", "0.5904913", "0.58985376", "0.5895834", "0.5888456", "0.5876225", "0.58745295", "0.5871492", "0.5865916", "0.58539927", "0.5848503", "0.5836216", "0.5833373", "0.5831861", "0.58220977", "0.58133316", "0.58129156", "0.5812767", "0.581191", "0.5791988", "0.57892823", "0.5787752", "0.57774043", "0.5775766", "0.5774646", "0.5773391", "0.5767505", "0.5761752", "0.5756918", "0.575531", "0.574357", "0.5735186", "0.5730495", "0.57245445", "0.5722644" ]
0.6764775
1
user queries resolves with all users
function getAllUsers() { return new Promise((resolve, reject) => { if(!applicant) reject(new Error('applicants cannot be found')); resolve(applicant); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "allUsers() { return queryAllUsers() }", "function getUsers(query) {\n if ($scope.data.ACL.users.length) {\n var args = {\n options: {\n classUid: 'built_io_application_user',\n query: query\n }\n }\n return builtDataService.Objects.getAll(args)\n } else\n return $q.reject({});\n }", "function getUsers() {\n User.query(function(data){\n return self.all = data.users;\n });\n }", "users(parent, args, { db }, info) {\n\n // no query: return all users\n if (!args.query) {\n return db.users;\n }\n\n // query: search for matches of query string with the user name and return filtered array\n return db.users.filter(user => user.name.toLowerCase().includes(args.query.toLowerCase()));\n\n }", "async function queryAllUsers(){\n return await user.findAll();\n}", "function user(query) {\r\n //return results a users\r\n return new Promise(async (resolve, reject) => {\r\n let results = User.getSearchResult(query);\r\n return resolve(await results);\r\n });\r\n}", "async GetAllUsers(req, res) {\n //returns all users in array\n await User.find({})\n .populate('posts.postId')\n .populate('chatList.receiverId')\n .populate('chatList.msgId')\n .populate('notifications.senderId')\n .then(result => {\n res.status(httpStatus.OK).json({ message: 'All users', result });\n })\n .catch(err => {\n res.status(httpStatus.INTERNAL_SERVER_ERROR).json({ message: 'Error occured when getting all users' });\n });\n }", "static async getAll() {\n return await user_model.find({});\n }", "allUsers() {\r\n this.log(`Getting list of users...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT emailAddress, password\r\n FROM Users\r\n `\r\n )\r\n }", "function getUsers(query) {\n return new Promise(function (resolve, reject) {\n\n if (!query || query.length < MIN_CHARS_TO_SEARCH) {\n // No query - no server results.\n return resolve([]);\n }\n\n AJS.debug('server-users-supplier: Looking in cache for ' + query);\n var cacheEntry = cache.getClosest(query);\n if (cacheEntry) {\n AJS.debug('server-users-supplier: Found cache entry with query ' + cacheEntry.query);\n if (cacheEntry.query === query) {\n // Exact match - just serve these results.\n return resolve(cacheEntry.users);\n }\n\n // Not an exact match. Might need a REST call, but we can show results based on what we have cached.\n var rankedUsers = UserRanker(cacheEntry.users, query);\n cache.add(query, rankedUsers);\n\n // TODO Always resolve with what we have from the cache - this is information that can be put in front of\n // the user immediately. We then decide whether to follow up the local results with remote ones.\n // However, we need the ability to 'resolve' multiple times - to call the render once with the cached\n // results and again (if not debounced, stale, etc, etc) with the server results.\n if (cacheEntry.isExhausted) {\n return resolve(rankedUsers);\n }\n\n // Else we might be searching for \"John\" but \"Joh\" already has >={limit} users.\n // We need to hit the server!\n // TODO - can we resolve multiple times?\n }\n\n var contextPath = Meta.get('context-path');\n var escapedQuery = LuceneQuery.escape(query);\n var queryParameters = {\n cql: 'user ~ \"' + Confluence.unescapeEntities(escapedQuery) + '\"',\n start: 0,\n limit: limit\n };\n var url = contextPath + '/rest/api/search';\n var success = function success(response) {\n var results = response.results;\n var users = results.map(function (result) {\n var user = result.user;\n user.supplier = UserSupplier.SERVER;\n user.timestamp = result.timestamp;\n AJS.debug('server-users-supplier: Adding user to cache: ' + user.username);\n return user;\n });\n cache.add(query, users);\n resolve(users);\n };\n\n // Debounce\n clearTimeout(lastTimeout);\n lastTimeout = setTimeout(function () {\n $.getJSON(url, queryParameters, success).fail(reject);\n }, DEBOUNCE_WAIT_MS);\n });\n }", "function getUsers(query) {\n return new Promise(function (resolve, reject) {\n\n if (!query || query.length < MIN_CHARS_TO_SEARCH) {\n // No query - no server results.\n return resolve([]);\n }\n\n AJS.debug('server-users-supplier: Looking in cache for ' + query);\n var cacheEntry = cache.getClosest(query);\n if (cacheEntry) {\n AJS.debug('server-users-supplier: Found cache entry with query ' + cacheEntry.query);\n if (cacheEntry.query === query) {\n // Exact match - just serve these results.\n return resolve(cacheEntry.users);\n }\n\n // Not an exact match. Might need a REST call, but we can show results based on what we have cached.\n var rankedUsers = UserRanker(cacheEntry.users, query);\n cache.add(query, rankedUsers);\n\n // TODO Always resolve with what we have from the cache - this is information that can be put in front of\n // the user immediately. We then decide whether to follow up the local results with remote ones.\n // However, we need the ability to 'resolve' multiple times - to call the render once with the cached\n // results and again (if not debounced, stale, etc, etc) with the server results.\n if (cacheEntry.isExhausted) {\n return resolve(rankedUsers);\n }\n\n // Else we might be searching for \"John\" but \"Joh\" already has >={limit} users.\n // We need to hit the server!\n // TODO - can we resolve multiple times?\n }\n\n var contextPath = Meta.get('context-path');\n var escapedQuery = LuceneQuery.escape(query);\n var queryParameters = {\n cql: 'user ~ \"' + Confluence.unescapeEntities(escapedQuery) + '\"',\n start: 0,\n limit: limit\n };\n var url = contextPath + '/rest/api/search';\n var success = function success(response) {\n var results = response.results;\n var users = results.map(function (result) {\n var user = result.user;\n user.supplier = UserSupplier.SERVER;\n user.timestamp = result.timestamp;\n AJS.debug('server-users-supplier: Adding user to cache: ' + user.username);\n return user;\n });\n cache.add(query, users);\n resolve(users);\n };\n\n // Debounce\n clearTimeout(lastTimeout);\n lastTimeout = setTimeout(function () {\n $.getJSON(url, queryParameters, success).fail(reject);\n }, DEBOUNCE_WAIT_MS);\n });\n }", "function getAll (query) {\n return service.get('/user/all', {\n params: query\n })\n}", "function getAllUsers() {\n return Users.find({});\n}", "getAllUsers() {\n return dbConnection.sync().then(() => {\n return User.findAll().then((users) => {\n //** Check for users records in db, if no usres recored return err message */\n if (users.length == 0) {\n return Promise.reject(\"No users in db yet!\")\n }\n console.log(`All users, num of users: ${users.length} => ${users}`);\n return Promise.resolve(users);\n });\n });\n }", "function get_users(){\n\tconst q = datastore.createQuery(USER);\n\treturn datastore.runQuery(q).then( (entities) => {\n\t\t\treturn entities[0].map(ds.fromDatastore);\n\t\t});\n}", "function findAllUsers() {\n userService\n .findAllUsers()\n .then(renderUsers);\n }", "static async findAllUsers() {\n const userList = await User.find({});\n return userList;\n }", "function get_users(){\n var q = datastore.createQuery(USER);\n return datastore.runQuery(q).then( (entities) => {\n return entities[0];\n });\n}", "function get_users(){\n var q = datastore.createQuery(USERS);\n\n return datastore.runQuery(q).then( (entities) => {\n return entities;\n });\n}", "function getAllUsers() {\n var getUser = partial(getValue, relationsCache);\n return map(getUser, Object.keys(relationsCache));\n}", "async function getAllUsers() {\n try {\n const { rows: userIds } = await client.query(`\n SELECT id\n FROM users;\n `);\n\n const users = Promise.all(userIds.map((user) => getUserById(user.id)));\n\n return users;\n } catch (error) {\n throw error;\n }\n}", "function getAllUsers() {\n return User.find();\n}", "async retrieveUsers(){cov_1m9telhrda.f[14]++;const _users=(cov_1m9telhrda.s[163]++,await User.find({}));const users=(cov_1m9telhrda.s[164]++,_users.map(user=>{cov_1m9telhrda.f[15]++;cov_1m9telhrda.s[165]++;return{name:user.name,id:user._id,email:user.email};}));cov_1m9telhrda.s[166]++;return users;}", "async getAllUsers() {\r\n\r\n const userCollection = await usersList();\r\n const listOfUsers = await userCollection.find().toArray();\r\n\r\n\r\n allusers = [];\r\n oneUser = {};\r\n\r\n //NM - Corrected spelling of orientation, added email and contact_info attributes\r\n for (var val of listOfUsers) {\r\n oneUser = {};\r\n oneUser._id = val._id;\r\n oneUser.user_id = val.user_id;\r\n oneUser.name = val.name;\r\n oneUser.hashedPassword = val.hashedPassword;\r\n oneUser.dob = val.dob;\r\n oneUser.gender = val.gender;\r\n oneUser.activity = val.activity;\r\n oneUser.location = val.location;\r\n oneUser.occupation = val.occupation;\r\n oneUser.email = val.email;\r\n oneUser.weight = val.weight;\r\n oneUser.activity = val.activity;\r\n allusers.push(oneUser);\r\n }\r\n\r\n return allusers;\r\n }", "async getUsers({ commit, dispatch }) {\n const client = await dispatch(\"gqlClient\", true);\n const data = await client.request(`\n query {\n users {\n id\n name\n email\n approved\n }\n }`);\n if (data.users) {\n return data.users;\n } else {\n return null;\n }\n }", "async getAllUsers() {\n return User.findAll();\n }", "function getAllUsers(){\n return UserService.getAllUsers();\n }", "function getallusers() {\n\n\t}", "async AllUsers(p, a, { app: { secret, cookieName }, req, postgres, authUtil }, i) {\n const getUsersQ = {\n text: 'SELECT * FROM schemaName.users'\n }\n\n const getUsersR = await postgres.query(getUsers)\n\n return getUsersR.rows\n }", "async find(req, res) {\n sails.log(\"get users req.query\", req.query);\n\n // notorg is the filter\n\n // filter by organization\n if (req.query.notorg) {\n const org = await Organization.findOne({ id: req.query.notorg }).populate(\n \"users\"\n );\n sails.log(\"org\", org);\n\n const orgUsers = org.users;\n orgUsersIds = [];\n org.users.forEach((element) => {\n orgUsersIds.push(element.id);\n });\n // then find all users, find the difference - complicated\n // Model.find({ where: { name: 'foo' }, limit: 10, skip: 10 });\n const allUsers = await User.find({\n where: { id: { \"!=\": orgUsersIds } },\n limit: req.query.limit,\n skip: req.query.skip,\n });\n // sails.log('allUsers', allUsers)\n\n return res.status(200).json(allUsers);\n }\n\n const query = {};\n\n // add username to the query\n if (req.query.username) {\n query.username = req.query.username;\n }\n\n if (req.query.id) {\n query.id = req.query.id;\n }\n\n // generic all - all users\n const all = await User.find(query).populate(\"organizations\");\n\n // debug - keep\n // sails.log('total user count = ', all)\n\n return res.status(200).json(all);\n }", "function findUsers(req, res) {\n var username = req.query[\"username\"];\n var password = req.query[\"password\"];\n // findUserByCredentials\n if (username && password) {\n var promise = userModel\n .findUserByCredentials(username, password);\n promise.then(function(user) {\n res.json(user);\n });\n return;\n }\n // findUserByUserName\n else if (username) {\n var promise = userModel\n .findUserByUserName(username);\n promise.then(function (user) {\n res.json(user)\n });\n return;\n }\n var promise = userModel\n .findAllUsers();\n promise.then(function(users) {\n \"use strict\";\n res.json(users)\n });\n res.json(users);\n }", "function getAllUsers (req, res, next) {\n db.any('SELECT * FROM \"user\";')\n .then((users) => {\n res.rows = users;\n next();\n })\n .catch(err => next(err));\n}", "function listUsers (req, res) {\n promiseResponse(userStore.find({}), res);\n}", "function fetchAllUsers() {\n var deferred = $q.defer();\n $http.get(REST_SERVICE_URI)\n .then(\n function (response) {\n deferred.resolve(response.data);\n },\n function(errResponse){\n console.error('Error while fetching Users');\n deferred.reject(errResponse);\n }\n );\n return deferred.promise;\n }", "getAllUsers(req, res) {\n // get all method\n User.find({})\n // leave __v out of selection\n .select(\"-__v\")\n // return all user data\n .then((dbUserData) => res.json(dbUserData))\n // catch error if exists\n .catch((err) => {\n console.log(err);\n res.status(400).json(err);\n });\n }", "static getAllUsers(req, res){\n User.find((err, users) => {\n if (err) return res.json({ success: false, error: err });\n return res.json({ success: true, data: users });\n });\n }", "async function getUsers() {\n const allUsers = await User.findAll();\n return allUsers.map((user) => user.get({ plain: true }));\n}", "function getUsers() {\n let ourQuery = 'SELECT employeeID, name FROM QAA.user_TB';\n return makeConnection.mysqlQueryExecution(ourQuery, mySqlConfig);\n}", "queryUsers(params) {\n return axios.get('/user/query', {\n params: params\n }).then(ret => {\n return ret.data;\n });\n }", "static async getAllUsers() {\n try {\n //establish connection with db server\n const [ db, client ] = await getConnection();\n\n //retrieve CURSOR OBJECT containing pointers to all users from database\n const result = await db.collection('users').find({});\n\n //get object array from cursor\n const resultArray = await result.toArray();\n\n //if no users, throw 404\n if (!resultArray.length) throw new ExpressError('There are no users in the database', 404);\n\n //close database connection\n client.close();\n\n //return array\n return resultArray;\n } catch(err) {\n //throw express error\n if (client) client.close();\n throw new ExpressError(err.message, err.status || 500);\n }\n }", "function getUsers () {\n return new Promise((resolve, reject)=> {\n db = getDb()\n db.collection(\"users\").find({}).toArray(function(err, users) {\n if (err) { \n reject (err)\n }\n console.log(\"Found the following users\");\n console.log(users)\n\n resolve(users);\n });\n })\n}", "function findAllUsers(req, res, next){\r\n connection.query('SELECT * FROM Usuarios', function (error, results){\r\n if(error) throw error;\r\n res.send(200, results);\r\n return next();\r\n });\r\n}", "function getAllUsers(res) {\n User.find()\n .select('_id email')\n .exec()\n .then(results => {\n console.log(results);\n const response = {\n count: results.length,\n users: results.map(user => {\n return {\n _id: user._id,\n email: user.email,\n request: {\n type: 'GET',\n url: 'http:localhost:3000/api/users/' + user._id\n }\n }\n })\n }\n res.status(200).json(response);\n })\n .catch(error => {\n console.log(error);\n res.status(500).json(\n {\n error: error\n }\n )\n });\n}", "static async getAllUsers() {\n try {\n logger.info('[user]: listing all users');\n const userList = await UserService.findAllUsers();\n\n return userList;\n } catch (e) {\n throw new InternalServerException();\n }\n }", "function getAllUsers() {\n return User.find({}).select({username: \"test\", email: \"[email protected]\", whitelisted: true});\n}", "async users(_, args, ctxt) {\n // This would recieve the context and log it\n // console.log(ctxt);\n return await User.find();\n }", "function getAll() {\n var deferred = Q.defer();\n \n //db.users.find({role: {$ne : \"Admin\"}}).toArray(function(err, user) {\n db.users.find({}).toArray(function(err, user) {\n if (err) deferred.reject(err);\n \n if (user) {\n // return user (without hashed password)\n deferred.resolve(_.omit(user, 'hash'));\n } else {\n // user not found\n deferred.resolve();\n }\n });\n \n return deferred.promise;\n}", "async populate (req, res) {\n const users = await User.find({}).populate('queries').populate('location')\n\n users.forEach(user => {\n const { location, queries } = user\n\n queries.forEach(query => {\n const prefs = {\n categoryId: AdsHelper.CAR_CATEGORY,\n locationId: location.publicId\n }\n const searchCriteria = {\n keywords: AdsHelper.formatQueryToKeywords(query),\n minPrice: query.minPrice,\n maxPrice: query.maxPrice\n }\n\n kijiji.query(prefs, searchCriteria, async (err, ads) => {\n if (err) {\n return res.status(400).send(err)\n }\n await ads.forEach(ad => saveNewAd(query, ad))\n res.send('Done populating!')\n })\n })\n })\n }", "function getAllUsers(callback) {\n requester.get('user', '', 'kinvey')\n .then(callback)\n}", "function getAllUsers(req, res, next) {\n db.any('select * from users')\n .then(function (data) {\n res.status(200)\n .json({\n status: 'success',\n data: data,\n message: 'Users found'\n });\n })\n .catch(function (err) {\n return next(err);\n });\n}", "async getAllUsers(){\n data = {\n URI: `${ACCOUNTS}`,\n method: 'GET'\n }\n return await this.sendRequest(data)\n }", "function getAllUsers() {\n var allUsers = User.find(function (err, users) {\n if (err) return handleError(err);\n return users\n })\n return allUsers\n}", "function findAllUsers() {\n return fetch(self.url).then(response => response.json())\n }", "getAllUser(req, callback) {\n User.find({}, {_id: 0, firstName: 1, email: 1}, (err,res) => {\n if(err)\n callback(err);\n else\n callback(null, res)\n })\n }", "static async getUsers (token) {\n const query = `*[_type == 'user'] {\n name,\n _id\n }\n `\n client.config({ token })\n return client.fetch(query)\n }", "function findAllUsers(req, res) {\n if(req.query.username) {\n findUserByUsername(req, res);\n } else {\n var users = userModel.findAllUsers().then(\n function (docs) {\n res.json(docs);\n },\n // send error if promise rejected\n function (err) {\n res.status(400).send(err);\n }\n )\n }\n }", "async getUsers(){\n let users = await db.query('SELECT id, name, email FROM users');\n\n return users;\n }", "getAllForUser(req, res) {\n let user_id = req.params.user_id \n let filters = {\n fromDate: req.query.fromDate || 0,\n toDate: req.query.toDate || new Date(32503680000000),\n minAmount: req.query.minAmount || 0,\n maxAmount: req.query.maxAmount || Infinity,\n }\n\n User.findOne({ '_id': user_id }, (err, user) => {\n if (err) throw err\n\n if (!user) {\n res.status(404).send({error: 'Invalid user.'})\n } else {\n Expense.find({ user_id: user._id })\n .where('date').gte(filters.fromDate).lte(filters.toDate)\n .where('amount').gte(filters.minAmount).lte(filters.maxAmount)\n .sort('-date')\n .exec((err, expenses) => {\n if (err) throw err\n res.send({ expenses: expenses })\n })\n }\n })\n .catch((err) => {\n res.status(500).send({error: err.message})\n })\n }", "static getAllUsers(req, res) {\n userService.getAllUsers(db, function (returnvalue) {\n res.status(200).send(returnvalue);\n })\n\n }", "static async getAll() {\n\t\tconst usersRes = await db.query(`SELECT * FROM users ORDER BY username`);\n\t\treturn usersRes.rows;\n\t}", "function searchUsers(context) {\n return new Promise(resolve => {\n let result = context.app.service('users').Model.search({\n query_string: {\n query: context.params.query.$search\n }\n }, (err, results) => {\n if (err) console.log(err);\n resolve(results);\n });\n });\n}", "function findAllUsers() {\n return fetch('https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users')\n .then(response => response.json())\n }", "getUsers() {\n const users = [];\n return new Promise((resolve, reject) => {\n // Scan for keys starting with user:\n this.rdsCli.scan(0, 'MATCH', 'user:*', 'COUNT', 100, (err, reply) => {\n if (err) {\n reject();\n }\n\n const totalUsers = reply[1].length;\n let i = 0; // Counter\n\n // Loop through and get data for each user\n _.forEach(reply[1], (user) => {\n this.rdsCli.hgetall(user, (err, reply) => {\n i++;\n users.push(reply); // Add to array\n\n // Resolve promise when finished\n if (i === totalUsers) {\n resolve(users);\n }\n });\n });\n });\n });\n }", "function getUsers() {\n\n intakeTaskAgeDatalayer.getUsersInFirm()\n .then(function (response) {\n self.allUser = response.data;\n }, function (error) {\n notificationService.error('Users not loaded');\n });\n }", "function allusers(db) {\n\t//define and set a standard set of default responses as the returned object\n\tlet response = _sqlresponse(`all users`);\n\t\n\ttry { //wrap the instruction in a try/catch to protect the process\n\t\t//this set of instructions runs a single instruction multiple times, each time using the next 'bound' dataset \n\t\tconst statement = db.prepare(\n\t\t\t`SELECT \n\t\t\t\tuserid, \n\t\t\t\tfriendlyname, \n\t\t\t\temailaddress, \n\t\t\t\tpassword, \n\t\t\t\tadmin, \n\t\t\t\tdatetime(lastlogin,'unixepoch') as lastlogin\n\t\t\tFROM\n\t\t\t\tUsers\n\t\t\tORDER BY \n\t\t\t\tuserid\n\t\t\t;`\n\t\t);\n\n\t\t// const statement = db.prepare(\n\t\t// \t`SELECT userid, friendlyname, emailaddress, password, admin, \n\t\t// \t\tdatetime(lastlogin,'unixepoch') as lastlogin\n\t\t// \tFROM Users\n\t\t// \tWHERE userid > @userid\n\t\t// \tORDER BY userid\n\t\t// \t;`\n\t\t// );\n\n\t\tconst results = statement.all(); //execute the statement\n\t\t//const results = statement.all({userid: 2000}); //execute the statement\n\t\tresponse.results = results; //add any results to the response\n\n\t\tconsole.log(\"Records found: \" + results.length);\n\t\tconsole.log(results);\n\n\t} catch (error) {\n\t\t//error detected while attempting to process the request - update the initialised sql return response\n\t\tresponse.success = false;\n\t\tresponse.code = httpcode.CONFLICT;\n\t\tresponse.message = error.code + \":\" + error.message;\n\t}\n\n\t_showsqlresponse(response); //check out the current response before returning to the calling instruction\n\treturn response;\n}", "async getUsers(filter) {\n return await User.find({}, null, filter).\n select('-password -__v').\n populate('posts')\n }", "async getAllUsers(orientation, filter, sort, tags, user_tags, user_position, reports){\n try {\n return new Promise((resolve, reject) => {\n var location = \"\";\n location = \"(6371 * ACOS(COS(RADIANS(\" + user_position[0].latitude + \")) * COS(RADIANS(`latitude`)) * COS(RADIANS(`longitude`) - RADIANS(\"+user_position[0].longitude+\")) + SIN(RADIANS(\"+user_position[0].latitude+\")) * SIN(RADIANS(`latitude`))))\";\n var block = \"\";\n for (var r=0; r < reports.length; r++){\n block = block.concat(\" AND `users`.`id` != \" + reports[r].reported_id);\n }\n\t\t\t\tvar sql;\n\t\t\t\tvar secretSauce = \"(1000 / LN(\" + location + \"+ 1.1) + COUNT(`tmp`.`id`) * 1000 + (`popularity` + 100))\";\n\t\t\t\tvar groupBy = \" GROUP BY `tmp`.`id`, `tmp`.`email`, `tmp`.`firstname`, `tmp`.`lastname`, `tmp`.`username`, `tmp`.`password`, `tmp`.`created_at`, `tmp`.`registerToken`, `tmp`.`active`, `tmp`.`resetToken`, `tmp`.`reset_at`, `tmp`.`birth`, `tmp`.`gender`, `tmp`.`orientation`, `tmp`.`description`, `tmp`.`popularity`, `tmp`.`profil`, `tmp`.`online`, `tmp`.`lastOnline`, `tmp`.`city`, `tmp`.`latitude`, `tmp`.`longitude`, `tmp`.`changed_loc` \";\n\t\t// ---------- structure de requete generique ----------\n\n\t\t\t\t\t// SELECT *, COUNT(`tmp`.`id`) FROM (\n\t\t\t\t\t// SELECT `users`.*\n\t\t\t\t\t// FROM matcha.users\n\t\t\t\t\t// WHERE registerToken = 'NULL' \n\t\t\t\t\t// AND // ORIENTATION\n\t\t\t\t\t// AND `users`.`id` != //ID USER \n\t\t\t\t\t// AND // FILTER\n\t\t\t\t\t// UNION ALL\n\t\t\t\t\t// SELECT `users`.*\n\t\t\t\t\t// FROM matcha.users\n\t\t\t\t\t// INNER JOIN matcha.tags ON `users`.`id` = `tags`.`user_id` \n\t\t\t\t\t// WHERE `tags`.`tag` = // (TAG 1 USER OR TAG 2 USER [..])\n\t\t\t\t\t// AND registerToken = 'NULL' \n\t\t\t\t\t// AND //ORIENTATION \n\t\t\t\t\t// AND `users`.`id` != //ID USER\n\t\t\t\t\t// AND //FILTER\n\t\t\t\t\t// ) AS `tmp`\n\t\t\t\t\t// GROUP BY `tmp`.`id`, `tmp`.`email`, `tmp`.`firstname`, `tmp`.`lastname`, `tmp`.`username`, `tmp`.`password`, `tmp`.`created_at`, `tmp`.`registerToken`, `tmp`.`active`, `tmp`.`resetToken`, `tmp`.`reset_at`, `tmp`.`birth`, `tmp`.`gender`, `tmp`.`orientation`, `tmp`.`description`, `tmp`.`popularity`, `tmp`.`profil`\n\t\t\t\t\t// ORDER BY COUNT(`tmp`.`id`) DESC, //SORT THEN SECRET SAUCE\n\n\t\t// -------------------------------------------------------\n\t\t\tif (!tags){\n sql = \"SELECT *, COUNT(`tmp`.`id`), \" + location + \" AS `loc`,\" + secretSauce + \" AS 'score' FROM (SELECT `users`.* FROM matcha.users WHERE registerToken = 'NULL' \";\n\t\t\t\tif (orientation){\n sql = sql.concat(orientation + block);\n\t\t\t\t\tif (filter){\n\t\t\t\t\t\tsql = sql.concat(filter);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsql = sql.concat(\" UNION ALL SELECT `users`.* FROM `matcha`.`users` INNER JOIN matcha.tags ON `users`.`id` = `tags`.`user_id` WHERE \");\n\t\t\t\tif (user_tags){\n\t\t\t\t\tfor (var i=0; i < user_tags.length; i++){\n if (user_tags.length == 1){\n\t\t\t\t\t\t\tsql = sql.concat(\"(`tags`.`tag` = \\\"\" + user_tags[i].tag + \"\\\") AND \");\n }\n\t\t\t\t\t\telse if (i == 0){\n\t\t\t\t\t\t\tsql = sql.concat(\"(`tags`.`tag` = \\\"\" + user_tags[i].tag + \"\\\"\");\n\t\t\t\t\t\t} else if (i < user_tags.length - 1){\n\t\t\t\t\t\t\tsql = sql.concat(\" OR `tags`.`tag` = \\\"\" + user_tags[i].tag + \"\\\"\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsql = sql.concat(\" OR `tags`.`tag` = \\\"\" + user_tags[i].tag + \"\\\") AND \");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (orientation){\n\t\t\t\t\tsql = sql.concat(\"registerToken = 'NULL' \" + orientation + block);\n\t\t\t\t\tif (filter){\n\t\t\t\t\t\tsql = sql.concat(filter);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t// ---------- structure de requete avec tag ----------\n\n\t\t\t\t\t// SELECT *, COUNT(`tmp`.`id`) FROM (\n\t\t\t\t\t// SELECT `users`.*\n\t\t\t\t\t// FROM matcha.users\n\t\t\t\t\t// INNER JOIN matcha.tags ON `users`.`id` = `tags`.`user_id` \n\t\t\t\t\t// WHERE `tags`.`tag` = //TAG CHERCHÉ\n\t\t\t\t\t// AND registerToken = 'NULL' \n\t\t\t\t\t// AND //ORIENTATION \n\t\t\t\t\t// AND `users`.`id` != //ID USER\n\t\t\t\t\t// AND //FILTER\n\t\t\t\t\t// ) AS `tmp`\n\t\t\t\t\t// GROUP BY `tmp`.`id`, `tmp`.`email`, `tmp`.`firstname`, `tmp`.`lastname`, `tmp`.`username`, `tmp`.`password`, `tmp`.`created_at`, `tmp`.`registerToken`, `tmp`.`active`, `tmp`.`resetToken`, `tmp`.`reset_at`, `tmp`.`birth`, `tmp`.`gender`, `tmp`.`orientation`, `tmp`.`description`, `tmp`.`popularity`, `tmp`.`profil`\n\t\t\t\t\t// ORDER BY COUNT(`tmp`.`id`) DESC, //SORT THEN SECRET SAUCE\n\n \t\t// ---------- structure de requete avec tag filtré par tags en commun ----------\n\n // SELECT *, COUNT(`tmp`.`id`) FROM (\n // SELECT `users`.* \n // FROM matcha.users \n // INNER JOIN matcha.tags ON `users`.`id` = `tags`.`user_id` \n // WHERE `tags`.`tag` = //TAG CHERCHÉ\n // AND registerToken = 'NULL'\n // AND //ORIENTATION \n // AND `users`.`id` != //ID USER \n // AND //FILTER \n // UNION ALL\n // SELECT `g`.*\n // FROM (\n // SELECT `users`.* \n // FROM matcha.users \n // INNER JOIN matcha.tags ON `users`.`id` = `tags`.`user_id` \n // WHERE `tags`.`tag` = //TAG CHERCHÉ \n // AND registerToken = 'NULL'\n // AND //ORIENTATION \n // AND `users`.`id` != //ID USER \n // AND //FILTER\n // ) AS `g`\n // INNER JOIN matcha.tags ON `g`.`id` = `tags`.`user_id` \n // WHERE `tags`.`tag` = // (TAG 1 USER OR TAG 2 USER [..])\n // ) AS `tmp` \n // GROUP BY `tmp`.`id`, `tmp`.`email`, `tmp`.`firstname`, `tmp`.`lastname`, `tmp`.`username`, `tmp`.`password`, `tmp`.`created_at`, `tmp`.`registerToken`, `tmp`.`active`, `tmp`.`resetToken`, `tmp`.`reset_at`, `tmp`.`birth`, `tmp`.`gender`, `tmp`.`orientation`, `tmp`.`description`, `tmp`.`popularity`, `tmp`.`profil` \n // ORDER BY COUNT(`tmp`.`id`) DESC, //SORT THEN SECRET SAUCE\n\n // -------------------------------------------------------\n\t\t\telse if (tags){\n\t\t\t\tsql = \"SELECT *, COUNT(`tmp`.`id`), \" + location + \" AS `loc`,\" + secretSauce + \" AS 'score' FROM (SELECT `users`.* FROM matcha.users\" + tags + \"AND registerToken = 'NULL' \";\n\t\t\t\tif (orientation){\n\t\t\t\t\tsql = sql.concat(orientation + block);\n\t\t\t\t\tif (filter){\n\t\t\t\t\t\tsql = sql.concat(filter);\n\t\t\t\t\t}\n }\n if (sort == \"tag\"){\n\t\t\t\t\tsql = sql.concat(\" UNION ALL SELECT `g`.* FROM (SELECT `users`.* FROM matcha.users\" + tags + \"AND registerToken = 'NULL' \");\n\t\t\t\t\tif (orientation){\n\t\t\t\t\t\tsql = sql.concat(orientation + block);\n\t\t\t\t\t\tif (filter){\n\t\t\t\t\t\t\tsql = sql.concat(filter);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsql = sql.concat(\") AS `g` INNER JOIN matcha.tags ON `g`.`id` = `tags`.`user_id` WHERE\");\n\t\t\t\t\tif (user_tags){\n for (var i=0; i < user_tags.length; i++){\n if (user_tags.length == 1){\n sql = sql.concat(\"(`tags`.`tag` = \\\"\" + user_tags[i].tag + \"\\\" )\");\n }\n else if (i == 0){\n sql = sql.concat(\"(`tags`.`tag` = \\\"\" + user_tags[i].tag + \"\\\"\");\n } else if (i < user_tags.length - 1) {\n sql = sql.concat(\" OR `tags`.`tag` = \\\"\" + user_tags[i].tag + \"\\\" \");\n } else {\n sql = sql.concat(\" OR `tags`.`tag` = \\\"\" + user_tags[i].tag + \"\\\") \");\n }\n }\n\t\t\t\t\t}\n }\n }\n\t\t\tsql = sql.concat(\" ) AS `tmp`\" + groupBy + \"ORDER BY \");\n\t\t\tif (sort && sort != \"tag\"){\n\t\t\t\tsql = sql.concat(sort + \", \");\n\t\t\t}\n sql = sql.concat(\" `score` DESC\");\n\n this.query(sql).then((users) => {\n if (users){\n resolve(users);\n } else {\n reject('no user found');\n }\n });\n });\n } catch (error){\n console.log(error);\n return false;\n }\n }", "getUser(userId) {\n userId = this.esc(userId); // escape userId\n return Promise.all([\n `SELECT user.userId, user.username, user.bio FROM user\n WHERE userId = '${userId}' LIMIT 1`,\n `SELECT entity_like.entityId FROM entity_like\n WHERE userId = '${userId}'`,\n `SELECT entity_comment.entityId, entity_comment.content FROM entity_comment\n WHERE userId = '${userId}'`,\n `SELECT user_subscription.targetId, user.username FROM\n user_subscription\n LEFT JOIN user ON user.userId = user_subscription.targetId\n WHERE user_subscription.userId = '${userId}'`,\n `SELECT COUNT(user_subscription.userId) AS subscribers FROM user_subscription\n WHERE user_subscription.targetId = '${userId}'`\n ].map(sql => {return db.query(sql)}))\n .then(rows => {\n // rows[0] = user data\n // rows[1] = likes\n // rows[2] = comments\n // rows[3] = subscriptions\n // rows[4] = subscribers\n\n var ret = rows[0][0]; // note, these are references here\n ret.likes = rows[1].map(like => {\n return like.entityId;\n });\n ret.comments = rows[2];\n ret.subscriptions = rows[3];\n ret.subscribers = rows[4][0].subscribers;\n return ret;\n });\n }", "getUsers(callback) {\n let getUsers = `select * from user`;\n\n this._db.all(getUsers, function(err,resolve) {\n callback(err,resolve);\n })\n }", "async findAllUsers(userCollection){\n return user.find(userCollection);\n }", "async function getAllUsers(){\n const userCollection = await users();\n const allUsers = await userCollection.find({}).toArray();\n return allUsers;\n}", "async getUsers() {\n let userResult = await this.request(\"users\");\n return userResult.users;\n }", "static getUsers() {\n return API.fetcher(\"/user\");\n }", "function fetchAllUsers() {\n return fetch(`${SERVER_URL}/users`, {\n headers: {\n Authorization: `Bearer ${userToken}`,\n },\n })\n .then(response => response.json())\n .then(data => setAllUsers(data))\n }", "findAll() {\n return new Promise((resolve, reject) => {\n this.User.find().exec().then(doc => {\n resolve(doc && doc.map(o => o.toObject()));\n }).catch(err => {\n reject(err);\n });\n });\n }", "async function getAllUsers() {\n\t const userCollection = await users();\n\t const userList = await userCollection.find({}).toArray();\n\t if(userList.length == 0){\n\t\t return userList;\n\t }else{\n\t\t for (let x of userList) {\n\t\t\tx._id = x._id.toString();\n\t\t\tfor (let y of x.likes) {\n\t\t\t\ty._id = y._id.toString();\n\t\t\t}\n\t\t\tfor (let y of x.follows) {\n\t\t\ty._id = y._id.toString();\n\t\t\t}\n\t\t\tfor (let y of x.wishlist) {\n\t\t\t\ty._id = y._id.toString();\n\t\t\t}\n\t\t\tfor (let y of x.reviews) {\n\t\t\t\ty._id = y._id.toString();\n\t\t\t\ty.gameId = y.gameId.toString();\n\t\t\t\ty.author._id = y.author._id.toString();\n\t\t\t\tfor (let z of y.replies) {\n\t\t\t\t\tz._id = z._id.toString();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let y of x.reviewLikes) {\n\t\t\t\ty.gameId = y.gameId.toString();\n\t\t\t\ty.reviewId = y.reviewId.toString();\n\t\t\t}\n\t\t\tfor (let y of x.reviewDislikes) {\n\t\t\t\ty.gameId = y.gameId.toString();\n\t\t\t\ty.reviewId = y.reviewId.toString();\n\t\t\t}\n\t\t }\n\t\t// userList.forEach((user) => {\n\t\t// \t user._id = user._id.toString();\n\t\t// })\n\t }\n\t return userList;\n }", "async getUsers (req, res) {\n try {\n const usersData = await UserDB.find();\n console.log(`All users data find: ${usersData}`);\n\n return res.json(usersData);\n } catch (error) {\n console.log(error);\n return;\n }\n }", "async getUsers () {\n\t\tlet userIds = this.posts.reduce((accum, post) => {\n\t\t\taccum = [...accum, post.get('creatorId'), ...(post.get('mentionedUserIds') || [])];\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}", "async function getAllUsers(_req, res) {\n const users = await User.find();\n if (users) {\n return res.json(users);\n }\n return res.send(\"There is no user.\");\n}", "function getAllUsers(req, res) {\n User.find({}, function(err, users) {\n if (err) throw err;\n return res.json(users);\n }); \n}", "static async getAllUsers(req, res, next) {\n try {\n const users = await this.database.getAllUsers();\n return res.send(users);\n } catch (error) {\n next(error);\n }\n }", "async function getUsers() {\n let serverResponse = await userService.getUsers();\n if (serverResponse.status === 200) {\n setUsers(serverResponse.data);\n };\n }", "static async getUsers() {\n return await this.request('users/', 'get');\n }", "function getUsers(req, res) {\n var identity_user_id = req.user.sub;\n var pages = req.params.pages;\n var page = 1;\n if (req.params.page) {\n page = req.params.page;\n }\n var itemsPerPage = 5;\n\n User.find().sort('_id').paginate(page, itemsPerPage, (err, usuariosEncontrados, totalUsuarios) => {\n if (err) return res.status(500).send({ message: \"Error en la petición\" });\n if (!usuariosEncontrados) return res.status(404).send({ message: \"No hya usuarios disponibles\" });\n followUserIds(identity_user_id).then((value) => {\n var folllosObj = {\n follows: value.following,\n followsMe: value.followed\n }\n return res.status(200).send({\n usuariosEncontrados,\n totalUsuarios,\n pages: Math.ceil(totalUsuarios / itemsPerPage),\n follows: value.following,\n followsMe: value.followed\n });\n });\n\n });\n\n}", "async function getAllUsers() {\n try {\n const params = {\n TableName: \"Users3\",\n };\n return await DocumentClient.scan(params).promise();\n } catch (e) {\n console.error(e);\n }\n}", "function getAllUsers(req, res) {\n User.find((err, users) => {\n if (err) {\n res.status(500).send(\"No se pudo traer los usuarios\");\n } else {\n res.status(200).send(users);\n }\n });\n}", "getAllUsers(req, res) {\n User.find({})\n .then(dbUserData => res.json(dbUserData))\n .catch(err => {\n console.log(err);\n res.status(400).json(err);\n });\n }", "function getAllUsers(req, res) {\n db.many('select * from ' + dbConfig.schema + '.empleados')\n .then(function (data) {\n res.status(200).send({\n data: data\n });\n })\n .catch(function (err) {\n if(err.received == 0){\n res.status(404).send({message: 'No se han encontrado usuarios'});\n console.log(err);\n }else{\n res.status(500).send({message:'Error en el servidor'});\n }\n });\n}", "listUsers(args) {\n let filters = !isEmpty(args.filters) ? JSON.parse(args.filters) : {}\n let options = !isEmpty(args.options) ? JSON.parse(args.options) : {}\n let results = {}\n\n return this.userStore.countUsers(filters)\n .then(count => {\n results.total = count\n return this.userStore.listUsers(filters, options)\n })\n .then(function(users) {\n results.records = users\n return results\n })\n }", "async getAll(body, auth) {\n // Auth\n const language = auth.current.user.language;\n const userId = auth.current.user.id;\n const authUser = await User.query().where('id', userId).with('profile').first();\n const authUserProfile = authUser.$relations && authUser.$relations.profile ? authUser.$relations.profile : null;\n\n try {\n const {\n page,\n limit,\n role,\n order_by,\n sort_by,\n keyword,\n is_verified,\n logged_in_at,\n } = body.all();\n\n let users = User.query()\n .select(['users.*'])\n .leftJoin('profiles as profiles', 'profiles.user_id', 'users.id');\n\n // Role\n if (role) users = users.where('users.roles', 'like', '%' + role + '%');\n\n // Verified\n if (is_verified) users = users.where('is_verified', is_verified);\n\n // Keyword\n if (keyword) {\n users = users.where(function () {\n this.where('users.email', 'like', '%' + keyword + '%')\n this.orWhere('users.username', 'like', '%' + keyword + '%')\n this.orWhere('profiles.name', 'like', '%' + keyword + '%')\n this.orWhere('profiles.address', 'like', '%' + keyword + '%')\n this.orWhere('profiles.city', 'like', '%' + keyword + '%')\n this.orWhere('profiles.state', 'like', '%' + keyword + '%')\n this.orWhere('profiles.country', 'like', '%' + keyword + '%')\n this.orWhere('profiles.job_title', 'like', '%' + keyword + '%')\n this.orWhere('profiles.gender', 'like', '%' + keyword + '%')\n this.orWhere('profiles.biography', 'like', '%' + keyword + '%')\n })\n }\n\n // Logged In At\n if (!isUndefined(logged_in_at)) users = users.where('users.logged_in_at', logged_in_at);\n\n // Order By or Sort By\n if (order_by && sort_by) {\n users = users.orderBy(order_by, sort_by);\n } else {\n users = users.orderBy('users.created_at', 'asc');\n }\n\n users = await users\n .with('createdBy')\n .paginate(page, limit);\n\n return new Response(users);\n } catch (e) {\n Logger.transport('file').error('UserService.getAll: ', e);\n return new Response({\n message: __('Cant get data user, please contact support', language)\n }, 422);\n }\n }", "function findAllUsers(callback) {\n \treturn fetch(this.url)\n .then(function(response) {\n return response.json();\n });\n }", "function getUsers(req, res){\n var identity_user_id = req.user.sub;\n\n // Por defecto se carga la pagina 1 sino obtener la pagina de la peticion\n var page = 1;\n if(req.params.page)\n page = req.params.page;\n\n var itemsPerPage = 5;\n\n // Obtenemos los usuarios de la BD y los ordenamos por ID una vez obtenidos se paginan con Mongoose Pagination\n User.find().sort('_id').paginate(page,itemsPerPage, (err,users,total) =>{\n\n if(err)\n return res.status(500).send({message: 'Error al Obtener los Usuarios'})\n\n if(!users)\n return res.status(404).send({message: 'No hay usuario disponibles'})\n\n followuserIds(identity_user_id).then((value) =>{\n return res.status(200).send({\n users,\n users_following : value.following,\n users_follow_me : value.followed,\n total,\n pages: Math.ceil(total/itemsPerPage)\n })\n })\n\n\n })\n}", "function findAllUsers(){//https://developers.google.com/web/ilt/pwa/working-with-the-fetch-api\n return fetch(this.url).then(function(res){\n if( !(res.ok) ){\n throw Error(res.statusText)\n }\n return res\n }).then(function(response){\n return response.json()\n }).catch(function(error){alert(\"error try refresh\")})\n }", "static getAll(){\n return db.any(`select * from users order by id`)\n .then(userArray => {\n // transform array of objects into array of User instances ?\n const instanceArray = userArray.map(userObj => {\n const u = new User(userObj.id, userObj.name);\n return u;\n });\n return instanceArray;\n })\n }", "function getUsers(req, res, next){\r\n\r\n\tUser.find()\r\n\t.where({privacy: false})\r\n\t.exec(function(err, results){\r\n\t\tif(err){\r\n\t\t\tres.status(500).send(\"Error Getting all the users that have a private set to false => \" + err);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconsole.log(\"Found \" + results.length + \" matching people on the mongoose.\");\r\n\t\tres.status(200).render(\"pages/getUsers\", {users: results , id:req.session.userId});\r\n\t\treturn;\r\n\t});\r\n\r\n}", "function getUsers() {\n\tif (ite <= 40) {\n\t\tsetTimeout(() => {\n\t\t\tite += 1;\n\t\t\tinit().then(() => {\n\t\t\t\tgetUsers();\n\t\t\t});\n\t\t}, 600000);\n\t}\n\n\tconst options = {\n\t\t'method': 'GET',\n\t\t'hostname': 'api.intra.42.fr',\n\t\t'path': '/v2/cursus/21/users/?access_token=' + accessToken.token.access_token + '&per_page=100&filter[primary_campus_id]=1&page=' + ite + '&filter[staff?]=false&sort=-pool_year&range[pool_year]=0,3000'\n\t};\n\tconst req = https.request(options, (res) => {\n\t\tlet data;\n\t\tres.on(\"data\", d => {\n\t\t\tdata += d;\n\t\t});\n\t\tres.on(\"end\", () => {\n\t\t\tconst json = JSON.parse(data.substring(9));\n\t\t\tjson.map((j) => {\n\t\t\t\tuserIds.push(j.id);\n\t\t\t});\n\t\t\tconsole.log('\\x1b[32mFetched ' + userIds.length + ' students ids\\x1b[0m');\n\t\t\tgetUsersInfo();\n\t\t});\n\t});\n\treq.end();\n}", "async function getUsers(req, res) {\n let users = await User.find({});\n res.json({\n status: \"success\",\n users: users\n });\n}", "findAll() {\n return users;\n }", "function queryUsers(uid) {\n firebase.query(result => {\n return true;\n }, \"/users\", {\n orderBy: {\n type: firebase.QueryOrderByType.CHILD,\n value: 'uid'\n },\n ranges: [\n {\n type: firebase.QueryRangeType.START_AT,\n value: uid\n },\n {\n type: firebase.QueryRangeType.END_AT,\n value: uid\n }\n ]\n });\n}", "function getUsers() {\n return db(\"users\").select(\"users.*\");\n}", "function getUsers(req, res){\n const identity_user_id = req.user.sub;\n\n let page = 1;\n if(req.params.page){\n page = req.params.page;\n }\n\n const itemsPerPage = 4;\n\n User.find().sort('_id').paginate(page, itemsPerPage, (err, users,total) =>{\n if(err) return res.status(500).send({message:\"Error en la peticion\"});\n if(!users) return res.status(404).send({message:\"No hay usuarios disponibles\"});\n\n\n followUserIds(identity_user_id).then((value)=>{\n return res.status(200).send({\n users,\n users_following: value.following,\n users_follow_me: value.followed,\n total,\n pages: Math.ceil(total/itemsPerPage)\n });\n });\n }); \n\n}" ]
[ "0.80235803", "0.75398386", "0.7262968", "0.71300673", "0.71195406", "0.71186984", "0.71141726", "0.7102634", "0.7064423", "0.7061835", "0.7061835", "0.6985737", "0.69553053", "0.6952219", "0.694823", "0.6940824", "0.6914636", "0.69008607", "0.68826485", "0.6868374", "0.685744", "0.6846481", "0.68405515", "0.6832547", "0.6826133", "0.68158233", "0.67951363", "0.677246", "0.67705667", "0.67662793", "0.67209536", "0.6713827", "0.6713402", "0.67000526", "0.66971534", "0.66932696", "0.6685601", "0.6683009", "0.6680426", "0.6679355", "0.6674301", "0.6660265", "0.66446215", "0.6642331", "0.66394776", "0.6636444", "0.6636293", "0.66280013", "0.6626201", "0.6617283", "0.6613073", "0.6611858", "0.66038585", "0.6603841", "0.6598651", "0.65983117", "0.65927887", "0.65860415", "0.65833855", "0.657853", "0.6575524", "0.65670955", "0.6559923", "0.6557166", "0.6551768", "0.65420765", "0.6539341", "0.6537175", "0.65251786", "0.65091616", "0.64884686", "0.6487737", "0.64870167", "0.648105", "0.64804846", "0.64741", "0.6455369", "0.6454177", "0.64505976", "0.643922", "0.6439188", "0.6430808", "0.64306235", "0.6427239", "0.64239615", "0.64216363", "0.6411573", "0.6410472", "0.6405659", "0.64046526", "0.63981813", "0.63950217", "0.6392333", "0.6388437", "0.6383614", "0.63784754", "0.63709915", "0.6356424", "0.63520014", "0.63517386", "0.6346657" ]
0.0
-1
resolves with all forms for one applicant by id of applicant
function getUserFormsById(id) { return new Promise((resolve, reject) => { if(!applicant) reject(new Error('applicants cannot be found')); let applicant_data = {}; for(let i in applicant) { console.log(id ,applicant[i]); if(applicant[i].applicantid == id) { applicant_data.applicant = applicant[i]; break; } } if(!applicant_data.applicant) resolve({}); let userForms = []; for(let j in applicant_form) { console.log('form', applicant_form[j]) if(applicant_form[j].applicantid == id) { userForms.push(applicant_form[j]); } } applicant_data.application_form = userForms; resolve(applicant_data); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserFormResponces(userid, formid) {\n return new Promise((resolve, reject) => {\n if(!applicant || !userid || !formid) reject(new Error('applicants cannot be found'));\n resolve([]);\n });\n}", "function getFormById(id) {\n return new Promise((resolve, reject) => {\n if(!form) reject(new Error(\"forms is not found\"));\n let formData = {};\n for(let i in form) {\n if(form[i].formid == id) {\n formData.form = form[i];\n break;\n }\n }\n let form_field_data = [];\n for(let j in form_field) {\n if(form_field[j].formid == id) form_field_data.push(form_field[j]);\n }\n formData.form_field = form_field_data;\n // should reject if none is found or something\n resolve(formData)\n });\n}", "function getAllForms() {\n return new Promise((resolve, reject) => {\n if(!form) reject(new Error(\"forms is not found\"));\n return resolve(form);\n });\n}", "function updateForm(id) {\n return new Promise((resolve, reject) => {\n if(!form || id) reject(new Error(\"forms is not found\"));\n resolve(true);\n });\n}", "function getForm (index) {\n\t\t\tloading = true;\n\t\t\tvar form = getbyId(index, forms);\n\t\t\tloading = false;\n\n\t\t\treturn form;\n\t\t}", "function getFormByFormId(formId){\n\t\treturn _formsContents.getFormByFormId(formId);\n\t}", "function findFormsByUserId(userid) {\n var deferred = q.defer();\n\n FormModel.find({ userid: userid }, function(err, userForms) {\n if(err) {\n deferred.reject(err);\n } else {\n deferred.resolve(userForms);\n }\n });\n\n return deferred.promise;\n }", "function bind_app_scope(id) {\n $(\"form\" + id).on(\"submit\", function () {\n const _orgScope =\n $(\"#org_scope\").find(\".permission_group:checked\").map(function () {\n return this.value;\n }).get().join(',');\n $('#application_org_scope').val(_orgScope);\n const _userScope =\n $(\"#user_scope\").find(\".permission_group:checked\").map(function () {\n return this.value;\n }).get().join(',');\n $('#application_user_scope').val(_userScope);\n return true;\n });\n }", "function getFormsByUserId(db, userId){\n return new Promise((resolve, reject) => {\n var collection = db.collection('Forms');\n\n // Make sure the object id string is valid\n const safeObjectId = s => ObjectId.isValid(s) ? new ObjectId(s) : null;\n var query = safeObjectId(userId);\n\n collection.find({ organization : query }).toArray(function(err, forms) {\n if (err) {\n console.log(err);\n return reject(err);\n }\n return resolve(forms);\n });\n })\n}", "function formsForCurrentUser(){\n // console.log(\"abc\");\n FormService\n .findAllFormsForUser(userId)\n .then(function (response) {\n console.log(\"abc : \");\n console.log(response.data);\n $scope.forms = response.data;\n });\n /*{\n $scope.things = formsByUserId;\n })*/\n }", "renderEditForm(){\n jobAppIndex.children[0].innerHTML = \"\";\n const apps = document.getElementById(\"Companies\");\n const matchCompany = Company.allCompanies.filter(company => company.id === this.company_id); //Matches the current application to its company object.\n const appForm = \n `<h2 id= AppHeadline>Edit Your Application for ${matchCompany[0].name}</h2>\n <form id = ApplicationUpdate> \n <label>Job Title:</label>\n <input type=\"text\" placeholder= \"${this.job_title}\" required><br>\n <label>Current application status:</label>\n <select id=\"status\" name=\"status\" size=\"1\">\n <option value=\"Application submitted\">Application submitted</option>\n <option value=\"Application received\">Application received</option>\n <option value=\"Interview(s) requested\">Interview(s) requested</option>\n <option value=\"Interview(s) scheduled\">Interview(s) scheduled</option>\n <option value=\"Interview(s) conducted\">Interview(s) conducted</option>\n <option value=\"Awaiting hiring decision\">Awaiting hiring decision</option>\n </select>\n <br>\n <label> Application Date:</label>\n <input type=\"date\" placeholder= \"${this.application_date}\" required><br>\n <label>Application Link(if any):</label>\n <input type=\"text\" placeholder= \"${this.website_link}\"><br>\n <label>Email Contact(if any):</label>\n <input type=\"text\" placeholder= \"${this.email_address}\"><br>\n <label>Notes:</label>\n <input type= \"textarea\" placeholder= \"${this.notes}\"><br>\n <input type= \"hidden\" id=${this.id}>\n <input id= ApplicationSubmit type=\"submit\" value=\"Update Application\">\n </form>`\n apps.innerHTML = appForm;\n document.getElementById(\"ApplicationUpdate\").addEventListener(\"submit\", this.editApplication.bind(this));\n }", "initForm() {\n return __awaiter(this, void 0, void 0, function* () {\n this.form = this.fb.group({\n overrideOnCreationSubscriptions: [''],\n overrideOnUpgradeSubscriptions: [''],\n appRows: this.fb.array([])\n });\n const apps = yield this.defaultSubscriptionsService.getSubscribableTenantApps();\n const appRows = this.form.controls.appRows;\n apps.forEach(app => {\n appRows.push(this.fb.group({\n app: [app],\n subscribedOnCreation: [''],\n subscribedOnUpgrade: ['']\n }));\n });\n this.form\n .get('overrideOnCreationSubscriptions')\n .valueChanges.subscribe(value => this.onOverrideOnCreationSubscriptionsChange(value));\n this.form\n .get('overrideOnUpgradeSubscriptions')\n .valueChanges.subscribe(value => this.onOverrideOnUpgradeSubscriptionsChange(value));\n });\n }", "getIndexForm(id) {\n return this.state.formFields.findIndex(e => e.id === id)\n }", "function resolveForm(elem, event) {\n return Lang_1.ExtLang.getForm(elem.getAsElem(0).value, event);\n}", "function abrirPatchForm( form_url, object_id ){\n\n if( ! self.patchForm ){\n\n $.get( form_url )\n .success(function(form){\n\n self.patchForm = $(form);\n\n showForm( 'patch', object_id );\n\n })\n .fail(function(res){\n mostraErro( 'Falha ao carregar o formulário de edição: ' + form_url);\n });\n\n } else\n showForm( 'patch', object_id );\n\n }", "function forms (argv, cb) {\n var args = argv._;\n var url = fhreq.getFeedHenryUrl();\n if (args.length === 0) return doList(cb);\n var action = args[0];\n\n if (action === 'list') return doList(cb);\n if (action === 'create') {\n if (!args[1]) return cb(forms.usage);\n return doCreateUpdate(args[1], cb);\n }\n if (action === 'update') {\n if (!args[1]) return cb(forms.usage);\n return doCreateUpdate(args[1], cb);\n }\n if (action === 'get') {\n if (!args[1]) return cb(forms.usage);\n return doGetForm(args[1],false, cb);\n }\n if (action === 'export') {\n if (!args[1]) return cb(forms.usage);\n return doGetForm(args[1], true, cb);\n }\n if (action === 'delete') {\n if (!args[1]) return cb(forms.usage);\n return doDeleteForm(args[1], cb);\n }\n if (action === 'apps') {\n if (!args[1]) return cb(forms.usage);\n var act = args[1];\n if (act === 'list') {\n return doListAppForms(cb);\n }\n if (act === 'get') {\n var appId = args[2];\n if (!appId) return cb(forms.usage);\n return doGetAppForms(appId, cb);\n }\n if (act === 'update') {\n var appId = args[2];\n if (!appId) return cb(forms.usage);\n\n var formIds = (\"\" === args[3]) ? [] : _.rest(args, 3);\n //if (formIds.length == 0) return cb(forms.usage);\n return doAppFormsUpdate(appId, formIds, cb);\n }\n if (act === 'create') {\n var appTitle = args[2];\n if (!appTitle) return cb(forms.usage);\n var appTheme = args[3];\n if (!appTheme) return cb(forms.usage);\n var formIds = _.rest(args, 4);\n if (formIds.length === 0) return cb(forms.usage);\n return doAppFormsCreate(appTitle, appTheme, formIds, cb);\n }\n }\n if (action === 'groups') {\n var act = args[1];\n if ((act === 'list') || (!act)) {\n return doListFormsGroups(cb);\n }\n if (act === 'get') {\n var groupId = args[2];\n if (!groupId) return cb(forms.usage);\n return doGetFormsGroup(groupId, cb);\n }\n if (act === 'update') {\n if (args.length !== 8) return cb(forms.usage);\n //do get first then update the object\n var groupId = args[2]; //needed\n\n var groupName = args[3]; // needed\n var userIds = (\"\" === args[4]) ? [] : args[4].split(',') ;\n var formIds = (\"\" === args[5]) ? [] : args[5].split(',');\n var appIds = (\"\" === args[6]) ? [] : args[6].split(',') ;\n var themeIds = (\"\" === args[7]) ? [] : args[7].split(',') ;\n return doFormsGroupUpdate(groupId, groupName, userIds, formIds, appIds, themeIds, cb);\n }\n if (act === 'create') {\n if (args.length !== 7) return cb(forms.usage);\n\n var groupName = args[2];\n var userIds = (\"\" === args[3]) ? [] : args[3].split(',') ;\n var formIds = (\"\" === args[4]) ? [] : args[4].split(',');\n var appIds = (\"\" === args[5]) ? [] : args[5].split(',') ;\n var themeIds = (\"\" === args[6]) ? [] : args[6].split(',') ;\n return doFormsGroupCreate(groupName, userIds, formIds, appIds, themeIds, cb);\n }\n if (act === 'delete') {\n var groupId = args[2];\n if (!groupId) return cb(forms.usage);\n return doDeleteFormsGroup(groupId, cb);\n }\n }\n\n if (action === 'config') {\n var act = args[1];\n var app = args[2];\n if (!act || !app) return cb(forms.usage);\n\n if (act === 'get') {\n return doGetAppConfig(app, cb);\n }\n if (act === 'create') {\n var fileName = args[3];\n if (!fileName) return cb(forms.usage);\n return doCreateAppConfig(app, fileName, cb);\n }\n if (act === 'update') {\n var fileName = args[3];\n if (!fileName) return cb(forms.usage);\n return doUpdateAppConfig(app, fileName, cb);\n }\n if (act === 'delete') {\n return doDeleteAppConfig(app, cb);\n }\n }\n\n if (action === 'notifications') {\n var act = args[1],\n formId = args[2],\n email = args[3];\n\n if (args.length === 2){\n formId = act;\n act = 'list';\n }else if (args.length <2){\n return cb(forms.usage);\n }\n\n if (!formId) {\n return cb(forms.usage);\n }\n if ((act === 'list')) {\n return doListNotifications(formId, cb);\n }\n\n if (!email) {\n return cb(forms.usage);\n }\n\n if (act === 'add') {\n return doAddNotification(formId, email, cb);\n }\n if (act === 'delete') {\n return doDeleteNotification(formId, email, cb);\n }\n }\n if (action === 'formapps') {\n if (!args[1]) return cb(forms.usage);\n return doFormApps(args[1], cb);\n }\n\n\n return cb(forms.usage);\n}", "function getItemEditForm(id,type){\n\n $.ajax({\n url: Routing.generate('fly_platform_package_calendar_events_edit_form',{id:id, type:type}),\n type: 'POST',\n format: 'json',\n async: true,\n data: {},\n success: function (res, textStatus, xhr) {\n if(res.asc == 'success'){\n showHideModal('#newPkgModal','show');\n $('#newPkgModalLabel').html('<i class=\"fa fa-edit\"></i> Edit Package Item');\n // alert(res.type);\n if(res.type == 'accItem'){\n $('#packageTabs a[href=\"#activites\"]').parent().hide();\n $('#packageTabs a[href=\"#accommodation\"]').parent().show();\n $('#acc-item-form').addClass('hidden');\n $('#packageTabs a[href=\"#accommodation\"]').tab('show') // Select tab by name\n\n $('#acc-item-edit-form').remove();\n $('.pkg-acc-form-block').after(res.forms.accItemFormView);\n\n $(\".acc-item-block\").removeClass('active');\n $('#acc-item-'+res.accId).addClass(\"active\");\n Accommodation.claculadeDurationEvent();\n setDatePicker(\"fly_platformbundle_accitem[checkin]\",'DD/MM/YYYY',true,false,false,false);\n }\n\n if(res.type == 'actItem'){\n $('#packageTabs a[href=\"#accommodation\"]').parent().hide();\n $('#packageTabs a[href=\"#activites\"]').parent().show();\n $('#form-new-act').addClass('hidden');\n $('#packageTabs a[href=\"#activites\"]').tab('show') // Select tab by name\n // $('#pkgType').val('activites');\n\n $('#form-edit-act').remove();\n $('#activites').append(res.forms.actFormView);\n setDatePicker(\"fly_platformbundle_act[actItem][0][checkin]\",'DD/MM/YYYY',true,true,false,false);\n setDatePicker(\"fly_platformbundle_act[actItem][0][checkout]\",'DD/MM/YYYY',true,true,false,false);\n setTimeout(function(){\n gmapInit('actedit','fly_platformbundle_act_address','fly_platformbundle_act_lat','fly_platformbundle_act_lng');\n }, 500);\n\n }\n\n }else{\n alert(res.msg);\n }\n },\n error: function(){\n alert('Cant Edit Event');\n }\n });\n\n\n}", "function findForms(id,callback,errorcall){\r\n server_forms = [];\r\n var eCount = 0;\r\n var entities = id? entities = searchEntities(id) : [];\r\n var total = entities.length +1;\r\n if(local_forms.length==0){\r\n getLocalForms(countData)\r\n }else{\r\n countData();\r\n }\r\n _.each(entities,function(ent){\r\n callEloqua(ent,function(html){\r\n var data = []\r\n if(html != null && html.hasOwnProperty('type') && html.type.toLowerCase() == 'form'){\r\n data = [html];\r\n }else if(html != null && html.hasOwnProperty('elements') && html.elements.length>0){\r\n data = html.elements;\r\n }\r\n server_forms = server_forms.concat(data);\r\n countData();\r\n },errorcall);\r\n })\r\n function countData(){\r\n eCount++;\r\n if(eCount == total){\r\n var local_ids = _.map(local_forms,function(l){\r\n return l.id? l.id : 0;\r\n })\r\n local_ids = _.unique(local_ids);\r\n \r\n server_forms = _.map(server_forms,function(f){\r\n var d = new Date(f.updatedAt * 1000);\r\n f.server = true;\r\n f.time = d.getFullYear()+'-'+d.getMonth()+'-'+d.getDate()+'00:00:00';\r\n f.date = monthNames[d.getMonth()]+' '+d.getDate()+' '+d.getFullYear()+' 00:00:00'\r\n return f;\r\n })\r\n \r\n server_forms = _.filter(server_forms,function(s){\r\n var f = _.find(local_ids,function(fnd){\r\n return fnd == s.id;\r\n })\r\n return !f;\r\n })\r\n if(callback)callback();\r\n } \r\n }\r\n}", "getById(id) {\r\n const i = new Form(this);\r\n i.concat(`('${id}')`);\r\n return i;\r\n }", "static fetch_form(board_id = 0){\n\t\tlet forms = ProBoards_Post_Forms.SETTINGS.forms;\n\t\tlet form = null;\n\n\t\tfor(let f = 0, fl = forms.length; f < fl; ++ f){\n\t\t\tif(!forms[f].unique_id || !forms[f].enabled){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(forms[f].boards.find(id => parseInt(id, 10) == board_id)){\n\t\t\t\tform = forms[f];\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn form;\n\t}", "function getFormMeta( itcb ) {\n Y.dcforms.getFormListing( '', formOptions.canonicalId, onFormMetaLoaded );\n\n function onFormMetaLoaded( err, formMeta ) {\n\n if( err ) {\n // TODO: translateme\n //node.setHTML( i18n( prefix + 'NO_FORM' ) );\n // TODO: notice asking the user to create/assign a form for this activity type\n return itcb( null );\n }\n\n formOptions.formVersionId = formMeta.latestVersionId;\n\n //Y.log( 'Adding form Appointment List form modal: ' + formOptions.canonicalId, 'debug', NAME );\n itcb( null );\n }\n }", "function displayForm(type,id,id_cible){\n\tvar urlForm = Routing.generate('pico_league_get_form', { \"Type\":type,\"Id\": id})\n\tif(id_cible != undefined){\n\t\turlForm = urlForm+'/'+id_cible;\n\t}\n\t$.get(urlForm,function(data,status){\n\t\tif(status == 'success') {\n\t\t\t//On affiche la zone\n\t\t\t$(\"#modalDynamicForm\").toggle();\n\t\t\t//On remplis par le form, et on cache le bouton de validation de base\n\t\t\t$(\".DynamicForm\").html(data);\n\t\t\t//On cache le bouton de validation\n\t\t\tgetFormSubmit(\"modalDynamicForm\").css('display','none');\n\t\t\t//Gestion particuliere, pour le form equipe on applique le multiSelect\n\t\t\tif(type=='Equipes'){\n\t\t\t\t$(\"#pico_leaguebundle_equipe_listeModo_id_client\").multiselect({\n\t\t\t\t\theader: \"Choisissez les moderateurs\",\n\t\t\t\t\tclick: function(e){\n\t\t\t\t\t\t//Recup liste membre\n\t\t\t\t\t\tvar list_id_membre = [];\n\t\t\t\t\t\t$(this).multiselect(\"widget\").find(\"input:checked\").each(function( element ) {\n\t\t\t\t\t\t\tlist_id_membre.push($(this).val());\n\t\t\t\t\t\t});\n\t\t\t\t\t\t//On modifie la valeur de listeModo :\n\t\t\t\t\t\t$('#pico_leaguebundle_equipe_listeModo').val(list_id_membre.join(','));\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\tvar list_id_membre_recup = $('#pico_leaguebundle_equipe_listeModo').val();\n\t\t\t\tvar array_list_id_membre = [];\n\t\t\t\tarray_list_id_membre = list_id_membre_recup.split(',');\n\n\t\t\t\tvar checkpoint_first = true;\n\t\t\t\t$(\"select\").multiselect(\"widget\").find(\":checkbox\").each(function(){\n\t\t\t\t\tif(jQuery.inArray($(this).val(), array_list_id_membre)!==-1) {\n\t\t\t\t\t\tif(!$(this).attr('aria-selected')){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.click();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif($(this).attr('aria-selected')){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.click();\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}\n\t});\n}", "function getTypeformForm(formId){\n let url = `https://api.typeform.com/forms/${formId}`\n return new Promise((resolve, reject) => {\n request(url, (err, res) => {\n if (err){reject(err)}\n console.log(`Typeform ${formId} loaded succesfully.`);\n resolve(JSON.parse(res.body)) //response.body = formulario\n })\n })\n}", "get forms() {\r\n return new Forms(this);\r\n }", "resolve(parent, args) {\n return _.find(applications, {id: args.id})\n }", "function searchFormular(){\n\tvar documentForms = document.getElementsByTagName(\"form\");\n\tvar formularSearchForm = documentForms[2];\n\tvar formularSelect = formularSearchForm.getElementsByTagName(\"select\")[0];\n\t\n\tvar formularID = parseInt(formularSelect.options[formularSelect.selectedIndex].value);\n\t\t\n\tvar xhttp;\n\tif (window.XMLHttpRequest) {\n\t\txhttp = new XMLHttpRequest();\n\t} \n\telse {\n\t\txhttp = new ActiveXObject('Microsoft.XMLHTTP');\n\t}\n\t\n\tvar url = \"http://localhost:8080/FormularProject/formular\";\n\tvar params = \"formularID=\"+formularID;\n\t\n\t// If the formular has been found create it\n\txhttp.onreadystatechange = function() {\n\t\tif (this.readyState == 4 && this.status == 200) {\n\t\t\tshowFormular(this.responseText);\n\t\t}\n\t};\n\t\n\txhttp.open('POST', url, true);\n\txhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\txhttp.send(params); \n}", "function getForm(elem, event) {\n let queryElem = new mona_dish_1.DQ(elem);\n let eventTarget = (event) ? new mona_dish_1.DQ((0, RequestDataResolver_1.getEventTarget)(event)) : mona_dish_1.DomQuery.absent;\n if (queryElem.isTag(Const_1.HTML_TAG_FORM)) {\n return queryElem;\n }\n //html 5 for handling\n if (queryElem.attr(Const_1.HTML_TAG_FORM).isPresent()) {\n let formId = queryElem.attr(Const_1.HTML_TAG_FORM).value;\n let foundForm = mona_dish_1.DQ.byId(formId, true);\n if (foundForm.isPresent()) {\n return foundForm;\n }\n }\n let form = queryElem.firstParent(Const_1.HTML_TAG_FORM)\n .orElseLazy(() => queryElem.byTagName(Const_1.HTML_TAG_FORM, true))\n .orElseLazy(() => eventTarget.firstParent(Const_1.HTML_TAG_FORM))\n .orElseLazy(() => eventTarget.byTagName(Const_1.HTML_TAG_FORM))\n .first();\n assertFormExists(form);\n return form;\n }", "function findById(id) {\n var deferred = q.defer();\n\n FormModel.findById(id, function(err, form) {\n if(err) {\n deferred.reject(err);\n } else {\n deferred.resolve(form);\n }\n });\n\n return deferred.promise;\n }", "function loadProjectForms() {\n\t\tAPI.getProjectForms()\n\t\t\t.then((res) => setProjectForms(res.data))\n\t\t\t.catch((err) => console.log(err));\n\t}", "function getForm( name, ids, withDelBtn ) {\n\n var deleteStr = \"Delete\";\n var idsu = ids.join(\"_\");\n\n //increment by 1 current object id\n var formbody = getFormBody( name, ids[0], ids[1], ids[2], ids[3], ids[4], ids[5], ids[6], ids[7], ids[8] );\n\n //console.log(\"getForm: \"+name+\"_\"+\", ids=\"+ids+', idsu='+idsu+\", withDelBtn=\"+withDelBtn);\n\n var addHeaderBtn = true;\n //don't show add for scan and stain sections\n if( name == \"scan\" || name == \"stain\" ) {\n addHeaderBtn = false;\n }\n //don't show add patient, except scanorder form where there is '_patient_'\n //if( name == 'patient' && ids.indexOf(\"_patient_\") === -1 ) {\n // addHeaderBtn = false;\n //}\n\n if( addHeaderBtn ) {\n var addbtn = getHeaderAddBtn( name, ids );\n var deletebtn = getHeaderDeleteBtn( name, ids, deleteStr );\n } else {\n var addbtn = \"\";\n var deletebtn = \"\";\n }\n\n if( !withDelBtn ) {\n deletebtn = \"\";\n }\n\n //get itemCount from partialId\n var itemCount = getIdByName(name,ids) + 1;\n //console.log('itemCount='+itemCount);\n\n var title = name;\n if( name == \"encounter\" || name == \"procedure\" ) {\n title = \"accession\";\n }\n\n var formhtml =\n '<div id=\"formpanel_' +name + '_' + idsu + '\" class=\"panel panel-'+name+' panel-multi-form\">' +\n '<div class=\"panel-heading panel-heading-hierarchy\">' +\n\n '<button id=\"form_body_toggle_'+ name + '_' + idsu +'\" type=\"button\"' +\n 'class=\"btn btn-default btn-xs form_body_toggle_btn glyphicon glyphicon-folder-open pull-left\"' +\n 'aria-expanded=\"true\"'+\n 'data-toggle=\"collapse\" data-target=\"#form_body_'+name+'_'+idsu+'\">'+\n '</button>'+\n\n\n '<button style=\"margin-left: 5px;\" type=\"button\"'+\n 'class=\"btn btn-default btn-xs form_body_content_toggle_btn glyphicon glyphicon-list pull-left\"'+\n 'aria-expanded=\"true\"'+\n 'data-toggle=\"collapse\" data-target=\"#'+title+'_'+idsu+'\">'+\n '</button>'+\n\n// '<button id=\"form_body_toggle_'+ name + '_' + idsu +'\" type=\"button\" class=\"btn btn-default btn-xs form_body_toggle_btn glyphicon glyphicon-folder-open black\" data-toggle=\"collapse\" data-target=\"#form_body_'+name+'_'+idsu+'\"></button>' +\n// '&nbsp;' +\n// '<div class=\"element-title\">' + capitaliseFirstLetter(title) + ' ' + itemCount + '</div>' +\n '<h4 class=\"panel-title element-title element-title-extended-width\">' +\n '<div style=\"float:left;\">' +\n capitaliseFirstLetter(title) + ' ' + itemCount +\n '</div>' +\n '<div class=\"element-title-object-name\" style=\"float:left; margin-left:10px;\">' +\n //to be inserted by JS\n '</div>' +\n '</h4>' +\n '<div class=\"form-btn-options\">' +\n addbtn +\n deletebtn +\n '</div>' +\n '<div class=\"clearfix\"></div>' +\n '</div>' + //panel-heading\n '<div id=\"form_body_' + name + '_' + idsu + '\" class=\"panel-body panel-body-multi-form collapse in\">' +\n formbody +\n '</div>' +\n '</div>';\n\n return formhtml;\n}", "getContainerForms(namingContainerId) {\n if (namingContainerId.isPresent()) {\n //naming container mode, all forms under naming container id must be processed\n return (0, mona_dish_1.DQ$)(this.getNameOrIdSelector(namingContainerId.value))\n // missing condition if the naming container is not present we have to\n // use the body as fallback\n .orElseLazy(() => mona_dish_1.DQ.byTagName(Const_1.HTML_TAG_BODY))\n .byTagName(Const_1.HTML_TAG_FORM, true);\n }\n else {\n return mona_dish_1.DQ.byTagName(Const_1.HTML_TAG_FORM);\n }\n }", "function getForm(parentId, childIds, childClasses) {\n\n var form = document.getElementById(parentId);\n\n for (let id of childIds.split(' ')) {\n form[camelCase(id)] = document.getElementById(id);\n }\n\n for (let cl of childClasses.split(' ')) {\n let es = form.getElementsByClassName(cl);\n form[camelCase(cl)] = es.length === 1 ? es[0] : es;\n }\n\n return form;\n }", "function showMFForm(pageIdToLoad) {\n\n console.log(\"show Benefit to fit your life form\");\n $(\"#myform\").css('display','block');\n $(\"#myform\").html(\"\");\n $(\"#myform\").alpaca({\n \"view\": \"bootstrap-edit\",\n \"data\": node,\n \"schema\": {\n \"title\": \"newMF\",\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"name\",\n \"readonly\":true\n }, \n \"headerTitle\": {\n \"type\": \"string\",\n \"title\": \"headerTitle\"\n },\n \"callout1\": {\n \"type\": \"string\",\n \"title\": \"callout1\"\n },\n \"callout2\": {\n \"type\": \"string\",\n \"title\": \"callout2\"\n },\n \"accordions\": {\n \"type\": \"array\",\n \"title\": \"accordions\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"accordionItem\",\n \"properties\": {\n \"accordionName\": {\n \"type\": \"string\",\n \"title\": \"Name\"\n },\n \"headerText\": {\n \"type\": \"string\",\n \"title\": \"Header Text\"\n },\n \"items\": {\n \"type\": \"array\",\n \"title\": \"Upper Accordion Items\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"Item\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"Item Name\"\n },\n \"link\": {\n \"type\": \"string\",\n \"title\": \"item Link Url\"\n },\n \"description\": {\n \"type\": \"string\",\n \"title\": \"Item Description\"\n }\n }\n }\n },\n \"subAccordions\": {\n \"type\": \"array\",\n \"title\": \"subaccordions\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"subaccordion\",\n \"properties\": {\n \"subAccordionName\": {\n \"type\": \"string\",\n \"title\": \"Sub Accordion Name\"\n },\n \"items\": {\n \"type\": \"array\",\n \"title\": \"Sub Accordion Items\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"Item\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"Item Name\"\n },\n \"link\": {\n \"type\": \"string\",\n \"title\": \"item Link Url\"\n },\n \"description\": {\n \"type\": \"string\",\n \"title\": \"Item Description\"\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n },\n \"_parent\": \"n:node\",\n \"items\": {},\n \"description\": \"custom:pagebtfy0\",\n \"$schema\": \"http://json-schema.org/draft-04/schema#\"\n },\n \"options\": {\n \"form\": {\n \"buttons\": {\n \"submit\": {\n \"click\": function () {\n clearTimer();\n console.log(\"Timer Cleared\");\n setTimer();\n console.log(\"Timer Set\");\n\n var value = this.getValue();\n //alert(JSON.stringify(value, null, \" \"));\n node.headerTitle = value.headerTitle;\n node.callout1 = value.callout1;\n node.callout2 = value.callout2;\n node.accordions = value.accordions;\n node.update().then(function () {\n alert(\"Form Submitted\");\n window.location =\"../index.html\";\n });\n }\n }\n }\n },\n \"title\": \"newPageTitle\",\n \"engineId\": \"alpaca1\",\n \"fields\": {\n \"headerTitle\": {\n \"type\": \"text\"\n },\n \"callout1\": {\n \"type\": \"ckeditor\" \n },\n \"callout2\": {\n \"type\": \"ckeditor\" \n },\n \"accordions\": {\n \"options\": {\n \"actionBarType\": \"right\"\n }\n }\n }\n }\n });\n}", "function set_edit_form_id() {\n\t\tif (!$(\"#\" + edit_form_id ).length) {\n\t\t\tedit_form_id = alt_edit_form_id;\n\t\t}\n\t}", "function getFormHandleForm(seq)\n{\nvar name = 'iiiFormHandle_' + seq;\nvar obj = getObj(name);\nreturn obj.form;\n}", "function getFieldsForForm(id)\n\t\t{\n\t\t\tvar deferred = $q.defer();\n\t\t\t// GET the fields from the form that matches the id\n\t\t\t$http.get(\"/api/assignment/form/\" + id + \"/field\")\n\t\t\t.success(function(response) \n\t\t\t{\n\t\t\t\tdeferred.resolve(response);\n\t\t\t});\n\n\t\t\treturn deferred.promise;\n\t\t}", "fillParentFormInParent(data, element, form = 'persistenceForm') {\n let v = bsw.cnf.v;\n let closeModal = (typeof data.closePrevModal === 'undefined') ? true : data.closePrevModal;\n let closeDrawer = (typeof data.closePrevDrawer === 'undefined') ? true : data.closePrevDrawer;\n closeModal && bsw.modalOnCancel();\n closeDrawer && bsw.drawerOnCancel();\n v.$nextTick(function () {\n if (v[form] && data.repair) {\n v[form].setFieldsValue({[data.repair]: data.ids});\n }\n });\n }", "function abrirGetForm( form_url, object_id ){\n\n if( ! self.getForm ){\n\n $.get( form_url )\n .success(function(form){\n\n self.getForm = $(form);\n\n showForm( 'get', object_id );\n\n })\n .fail(function(res){\n mostraErro( 'Falha ao carregar a tela de visualização: ' + form_url );\n });\n\n } else\n showForm( 'get', object_id );\n\n }", "handleEdit(id){\n this.setState({showEditForm: true, applicantIdToEdit: id});\n sessionStorage.setItem('showEditForm', 'true');\n sessionStorage.setItem('applicantIdToEdit', id);\n }", "function getFormAdjustments(formid){\r\n var formid = formid.replace(/form/g,'');\r\n var data = {id:formid, elements:[]};\r\n var frm = _.find(local_forms,function(f){\r\n return f.id == formid;\r\n });\r\n if(frm){\r\n _.each(frm.fulldata.elements,function(e,i){\r\n var p = e.localEdits;\r\n p.id = e.id;\r\n \r\n //if(p.hasOwnProperty('validations') && !p.validations.hasOwnProperty('localmessage')){delete p.validations}\r\n delete p.lockRequired\r\n if(_.keys(p).length>1){ \r\n data.elements.push(p);\r\n }\r\n });\r\n return data;\r\n }\r\n return false;\r\n}", "function formready(formid)\n{\nformhandler('#'+formid); \n}", "function showModalAwardEventForm(fk_award, fk_event){\n\n _resetAwardFieldForm();\n\n // Update\n if(fk_award != undefined && fk_event != undefined){\n\n _formAction = 'edit';\n\n $.post('/admin/abrasce-award/award-event/list', {fk_award:fk_award, fk_event:fk_event}, function(response){\n\n if(!response.success){\n toastr.error(data.message);\n return;\n }\n\n var data = response.data;\n\n // Populate form\n $('#formAwardEvent select[name=fk_award]').val(data.fk_award);\n $('#formAwardEvent input[name=fk_event]').val(data.fk_event);\n $('#formAwardEvent input[name=title]').val(data.title);\n $('#formAwardEvent input[name=billing_days_to_due]').val(data.billing_days_to_due);\n $('#formAwardEvent input[name=registration_price]').val(data.registration_price);\n\n // Date setup\n var dateBegin = moment(data.registration_date_begin);\n var dateEnd = moment(data.registration_date_end);\n $('#formAwardEvent input[name=registration_date_begin]').val(dateBegin.format('DD/MM/YYYY HH:mm'));\n $('#formAwardEvent input[name=registration_date_end]').val(dateEnd.format('DD/MM/YYYY HH:mm'));\n\n // Logo\n if (data.logo != \"\") {\n $('#file-logo').fileinput('refresh', {\n 'allowedFileExtensions': ['jpg', 'png', 'gif'],\n 'initialPreview': [\"<img src='/uploads/award-event/\" +data.logo + \"' class='file-preview-image'>\",],\n 'overwriteInitial': true,\n 'maxFileSize': 500,\n 'initialCaption': data.logo\n });\n }\n\n // Banner\n if (data.banner != \"\") {\n $('#file-banner').fileinput('refresh', {\n 'allowedFileExtensions': ['jpg', 'png', 'gif'],\n 'initialPreview': [\"<img src='/uploads/award-event/\" +data.banner + \"' class='file-preview-image'>\",],\n 'overwriteInitial': true,\n 'maxFileSize': 500,\n 'initialCaption': data.banner\n });\n }\n\n var description = $('#description-award-event').data(\"wysihtml5\").editor;\n description.setValue(data.description);\n\n // Show\n $('#modal-award-event-form').modal('show');\n\n }).fail(function(jqXHR, textStatus){\n\n toastr.error(\"Ocorreu um erro ao executar a solicitação: \" + textStatus);\n\n });\n\n }else{ // New\n\n _formAction = 'new';\n _resetAwardFieldForm();\n\n $('input[name=fk_event]').val(_fkEvent);\n\n $('#modal-award-event-form').modal('show');\n\n }\n\n}", "function showFormEditer(id)\n{\n\t//alert(id);//get id ok\n\tvar action = 'action=showForm';\n\tvar idFilm = 'idFilm='+id;\n\t\n\t$.ajax({\n\t\tmethod: \"POST\", \n\t\turl:\"../../controller/filmController.php\",\n\t\t//data: action+'&'+idFilm,\n\t\tdata: action+'&'+idFilm,\n\t}).done((jsonString)=>{\n\t\t//Va creer le template\n\t\t$.ajax({\n\t\t\tmethod: \"POST\", \n\t\t\turl:\"../film/template/formEditFilm.php\",\n\t\t\tdata: \"data=\"+jsonString\n\t\t//Recoit le template\n\t\t}).done((template)=>{\n\t\t\t$(\"#contenu\").html(template);\n\t\t})\n\t});\n}", "@action\n addForm(model) {\n const uuidVal = uuidv4();\n let form = new Form(uuidVal, model);\n this.forms = {...this.forms, [uuidVal]: form};\n for(let propertyName in model){\n this.validate(form.id, propertyName);\n }\n return form;\n \n }", "getFormOffline (formId) {\n let forms = _.values(RealmObject.objects(FormSchema.schema.name).filtered(`formId = \"${formId}\"`))[0],\n response = {};\n if (forms) {\n response.formId = forms.formId;\n response.formTitle = forms.formTitle;\n response.formDescription = forms.formDescription;\n response.formContent = forms.formContentJSON;\n response.formUpdateDate = forms.formUpdateDate;\n }\n return _.isEmpty(response) ? null : response;\n }", "function setup(app, db, idgen, FORMS) {\n function getCollection(cb) {\n return db.collection(FORMS, cb);\n }\n\n// GET http://localhost:3000/api/surveys/1/forms/2ec140e0-827f-11e1-83d8-bf682a6ee038\napp.get('/api/surveys/:surveyid/forms/:formid', function(req, response) {\n var surveyid = req.params.surveyid;\n var formid = req.params.formid;\n db.collection(FORMS, function(err, collection) {\n collection.find({'survey': surveyid, 'id': formid}, function(err, cursor) {\n if (err) {\n console.log('Error retrieving form ' + formid + ' of survey ' + surveyid + ': ' + err.message);\n response.send();\n } else {\n cursor.toArray(function(err, items) {\n if (items.length > 1) {\n console.log('!!! WARNING: There should only be one form with a given id attached to a survey.');\n console.log('!!! Found ' + items.length);\n console.log('!!! Forms: ' + JSON.stringify(items));\n }\n if (items.length > 0) {\n response.send({form: items[0]});\n } else {\n response.send(404);\n }\n });\n }\n });\n });\n});\n\n// Get all the forms for a survey.\n// Sort by creation date, newest first.\n// GET http://localhost:3000/api/surveys/{SURVEY ID}/forms\napp.get('/api/surveys/:sid/forms', function(req, response) {\n db.collection(FORMS, function(err, collection) {\n collection.find({'survey': req.params.sid},\n {'sort': [['created', 'desc']]},\n function(err, cursor) {\n if (err) {\n console.log('Error finding forms for survey ' + req.params.sid + ': ' + err);\n response.send();\n return;\n }\n var arr = [];\n cursor.each(function(err, doc) {\n if (doc === null) {\n response.send({forms: arr});\n } else {\n arr.push(doc);\n }\n });\n });\n });\n});\n\n/*\n * Add forms to a survey.\n * This is done before a survey begins, as a setup task.\n * POST http://localhost:3000/api/surveys/{SURVEY ID}/forms\n */\napp.post('/api/surveys/:sid/forms', function(req, response) {\n var forms = req.body.forms;\n var total = forms.length;\n var count = 0;\n \n db.collection(FORMS, function(err, collection) {\n var survey = req.params.sid;\n \n // Iterate over each form we received.\n forms.forEach(function(form) {\n \n // Set some standard metadata\n var id = idgen();\n form.id = id;\n form.created = new Date();\n form.survey = survey;\n \n // Add form to database.\n collection.insert(form, function() {\n // Check if we've added all of them.\n count += 1;\n if (count === total) {\n response.send({forms: forms}, 201);\n }\n });\n });\n });\n});\n\n// Modify a form\n// Replaces the form data\n// PUT http://localhost:3000/api/surveys/{SURVEY ID}/forms/{FORM ID}\napp.put('/api/surveys/:sid/forms/:id', function (req, response) {\n db.collection(FORMS, function (err, collection) {\n var survey = req.params.sid;\n var id = req.params.id;\n var form = req.body.form;\n form.id = id;\n form.survey = survey;\n form.created = new Date();\n collection.findAndModify({survey: survey, id: id}, {'_id': 1}, form, {'new': true}, function (err, item) {\n if (err) {\n response.send(500);\n return;\n }\n response.send({ form: item });\n });\n });\n});\n\n/*\n * Delete all forms from a survey.\n * This is maintainence functionality. Regular clients should not delete forms.\n * POST http://localhost:3000/api/surveys/{SURVEY ID}/forms\n */\napp.del('/api/surveys/:sid/forms', function(req, response) {\n var survey = req.params.sid;\n console.log('!!! Deleting forms for survey ' + survey + ' from the database.');\n db.collection(FORMS, function(err, collection) {\n collection.remove({survey: survey}, {safe: true}, function(error, count) {\n if (error) {\n console.log('Error removing forms for survey ' + survey + ' from the form collection: ' + err.message);\n response.send();\n } else {\n response.send({count: count});\n }\n });\n });\n});\n\n// Delete a single form from a survey\n// DELETE http://localhost:3000/api/surveys/{SURVEY_ID}/forms/{FORM_ID}\napp.del('/api/surveys/:sid/forms/:id', function(req, response) {\n var survey = req.params.sid;\n var id = req.params.id;\n\n console.log('Removing form ' + id + ' from the database.');\n getCollection(function(err, collection) {\n collection.remove({survey: survey, id: id}, {safe: true}, function(error, count) {\n if (error) {\n console.log('Error removing form ' + id + ' for survey ' + survey + ' from the form collection: ' + err.message);\n response.send();\n } else {\n if (count !== 1) {\n console.log('!!! We should have removed exactly 1 entry. Instead we removed ' + count + ' entries.');\n }\n response.send({count: count});\n }\n });\n });\n});\n\n// Get all forms that reference the specified parcel ID\n// Sort by creation date, newest first.\n// GET http://localhost:3000/api/surveys/{SURVEY ID}/parcels/{PARCEL ID}/forms\napp.get('/api/surveys/:sid/parcels/:pid/forms', function(req, response) {\n var handleError = util.makeErrorHandler(response);\n var sid = String(req.params.sid);\n var pid = String(req.params.pid);\n\n getCollection(function(err, collection) {\n if (handleError(err)) { return; }\n collection.find({survey: sid, 'parcels.parcel_id': pid},\n {'sort': [['created', 'desc']]},\n function(err, cursor) {\n if (handleError(err)) { return; }\n cursor.toArray(function(err, items) {\n if (handleError(err)) { return; }\n response.send({forms: items});\n }); // toArray\n }); // find\n }); // getCollection\n});\n\n}", "getAllFormsForCurrentUser(state, action) {\n state.currentUserAllForms = action.payload;\n }", "function findParentForm ( element ) {\n\t \twhile ( element = element.parent ) {\n\t \t\tif ( element.name === 'form' ) {\n\t \t\t\treturn element;\n\t \t\t}\n\t \t}\n\t }", "function setFormIDToCheck(form_id,el_type,action) {\n\tvar aTmp = new Array();\n\n\tif (!form_id) return ;\n\tif (el_type == 'all') el_type = false;\n\n\t// Obtenemos la instancia formulario\n\tform = document.getElementById(form_id);\n\n\tif (form) {\n\t\t// SI ya lo tenemos, salirse\n\t\tfor (i=0; i < this.aForms.length; i++) \n\t\t\tif (this.aForms[i][0] == form_id) return;\n\n\t\taTmp[0] = form_id;\n\t\taTmp[1] = false;\n\t\tif (action) aTmp[2] = action;\n\t\tthis.aForms.push(aTmp);\n\t\tfor (i=0; i < form.elements.length; i++) {\n\t\t\tif (form.elements[i].type != 'hidden') {\n\t\t\t\tif (!el_type || el_type == form.elements[i].type) {\n\t\t\t\t\tform.elements[i].onchange = onChangeFormElement;\n\t\t\t\t}\n\t\t\t\t// form.elements[i].disabled = true;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// alert('No form');\n\t}\n}", "function limpiarFormulario(frm) {\n frm.reset();\n document.getElementById(\"btnEliminar\").classList.add(\"hidden\");\n document.getElementById(\"btnSubmit\").textContent = \"Guardar Automovil\";\n document\n .getElementById(\"btnSubmit\")\n .classList.replace(\"btn-secondary\", \"btn-primary\");\n\n document.forms[0].id.value = \"\";\n}", "function popupForm(id){\n\t//TODO: apply formData.activityList to activityListHtml\n}", "function addInputForm (id) {\n const formId = id + 1;\n const plusButton = document.querySelector(`#addInputForm${id}`);\n const form = document.querySelector(`#inputForm${formId}`);\n plusButton.addEventListener(\"click\", () => {\n form.style.display = \"inline\";\n });\n}", "async function formEdit(id,tabla){\n \n if(tabla === \"futbolista\"){ // Editar futbolista\n const resp = await fetch(`${ url }futbolista/${ id }`);\n const { futbolista } = await resp.json();\n formModalFutbolita(futbolista);\n }else if(tabla === \"equipo\"){ // Editar equipo\n const resp = await fetch(`${ url }equipo/${ id }`);\n const { equipo } = await resp.json();\n formModalEquipo(equipo);\n }\n \n \n}", "function obtenerId(frm) {\n for (element of frm.elements) {\n if (element.name === \"legislador\") {\n return element.value;\n }\n }\n}", "function resolveQuestion(question_id){\n var map = getMap();\n delete map[question_id];\n storeMap(map);\n leftPane.innerHTML = templates.renderQuestions({questions: getQuestions()});\n rightPane.innerHTML = templates.renderQuestionForm(); \n }", "function displayFormEvent(type,id){\n\tvar urlEvent = Routing.generate('calendar_manager_homepage', { \"type\":type,\"id\": id})\n\t$.get(urlEvent,function(data,status){\n\t\tif(status == 'success') {\n\t\t\t//On affiche la zone\n\t\t\t$(\"#modalDynamicForm\").toggle();\n\t\t\t//On remplis par le form, et on cache le bouton de validation de base\n\t\t\t$(\".DynamicForm\").html(data);\n\t\t\tgetFormSubmit(\"modalDynamicForm\").css('display','none');\n\t\t}\n\t});\n}", "function loadFormEditar(id){\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"php/cargarForm.php\",\n\t\tdata: {'id':id},\n\t\tsuccess: function (resp) {\n\t\t\t$(\"#modalModificar\").find('#contenido-modal').html($(resp));\t\n\t\t}\n\t});\n}", "function resolveSourceForm(internalContext, elem) {\n let sourceFormId = internalContext.getIf(Const_1.CTX_PARAM_SRC_FRM_ID);\n let sourceForm = new mona_dish_2.DQ(sourceFormId.isPresent() ? document.forms[sourceFormId.value] : null);\n sourceForm = sourceForm.orElseLazy(() => elem.firstParent(Const_1.HTML_TAG_FORM))\n .orElseLazy(() => elem.querySelectorAll(Const_1.HTML_TAG_FORM))\n .orElseLazy(() => mona_dish_2.DQ.querySelectorAll(Const_1.HTML_TAG_FORM));\n return sourceForm;\n}", "function showBtfylSecondary(pageIdToLoad){\n \n pageIdToLoad = $(\"#alpaca1\").val();\n $(\"#myform\").html(\"\");\n $(\"#myform\").css('display','block');\n $(\"#myform\").alpaca({\n \"view\": \"bootstrap-edit\",\n \"data\": node,\n \"schema\": {\n \"title\": \"PageBtfylSecondary\",\n \"description\": \"A data type to support for Page Btfyl Secondary.\",\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"name\",\n \"readonly\":true\n },\n \"heading\": {\n \"type\": \"string\",\n \"title\": \"heading\"\n },\n \"mainBody\": {\n \"type\": \"string\",\n \"title\": \"mainBody\"\n },\n \"mainContent\": {\n \"type\": \"array\",\n \"title\": \"mainContent\",\n \"items\": {\n \"properties\": {\n \"contentHeading\": {\n \"type\": \"string\",\n \"title\": \"contentHeading\"\n },\n \"contentBody\": {\n \"type\": \"string\",\n \"title\": \"contentBody\"\n }\n },\n \"type\": \"object\"\n }\n },\n \"links\": {\n \"type\": \"array\",\n \"title\": \"Helpful Links\",\n \"maxItems\": 30,\n \"items\": {\n \"properties\": {\n \"linkHeader\": {\n \"type\": \"string\",\n \"title\": \"linkHeader\"\n },\n \"company\": {\n \"type\": \"string\",\n \"title\": \"company\"\n },\n \"number\": {\n \"type\": \"string\",\n \"title\": \"number\"\n },\n \"link\": {\n \"type\": \"string\",\n \"title\": \"link\"\n }\n },\n \"type\": \"object\"\n }\n }\n },\n \"_parent\": \"n:node\",\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"items\": {}\n },\n \"options\": {\n \"form\": {\n \"buttons\": {\n \"submit\": {\n \"click\": function () {\n clearTimer();\n console.log(\"Timer Cleared\");\n setTimer();\n console.log(\"Timer Set\");\n\n var value = this.getValue();\n //alert(JSON.stringify(value, null, \" \"));\n node.name = value.name;\n \n node.heading = value.heading;\n node.mainBody = value.mainBody;\n node.links = value.links;\n node.mainContent = value.mainContent;\n \n node.update().then(function () {\n alert(\"Form Submitted\");\n window.location =\"../index.html\";\n });\n }\n }\n }\n },\n \"title\": \"newPageTitle\",\n \"engineId\": \"alpaca1\",\n \"fields\": {\n \"name\": {\n \"type\": \"text\"\n },\n \"mainBody\": {\n \"type\": \"ckeditor\",\n \"ckeditor\": {\n \"toolbar\": [\n ['Bold', 'Italic', 'Underline', 'Cut', 'Copy', 'Paste'], ['NumberedList', 'BulletedList', 'Link', 'Unlink'], ['Table', 'Source']\n ]\n },\n \"height\":\"120\"\n },\n \"mainContent\": {\n \"type\": \"array\",\n \"items\": {\n \"fields\": {\n \"contentHeading\": {\n \"type\": \"text\"\n }, \n \"contentBody\": {\n \"type\": \"ckeditor\",\n \"ckeditor\": {\n \"toolbar\": [\n ['Bold', 'Italic', 'Underline', 'Cut', 'Copy', 'Paste'], ['NumberedList', 'BulletedList', 'Link', 'Unlink'], ['Table', 'Source']\n ]\n }\n }\n }\n },\n \"toolbarSticky\": true,\n \"actionbar\": {\n \"actions\": [\n {\n \"action\": \"add\",\n \"enabled\": false\n },\n {\n \"action\": \"remove\",\n \"enabled\": false\n }]\n }\n },\n \"links\": {\n \"type\": \"array\",\n \"items\": {\n \"fields\": {\n \"linkHeader\": {\n \"type\": \"text\"\n }, \n \"company\": {\n \"type\": \"text\"\n },\n \"number\": {\n \"type\": \"text\"\n },\n \"link\": {\n \"type\": \"text\"\n }\n }\n },\n \"toolbarSticky\": true,\n \"actionbar\": {\n \"actions\": [\n {\n \"action\": \"add\",\n \"enabled\": false\n },\n {\n \"action\": \"remove\",\n \"enabled\": false\n }]\n }\n } \n\n }\n }\n });\n\n}", "function applicantChoice() {\n\tvar aid = getURLParameter(\"AID\"); //\n\t// alert(\"id= \"+aid);\n\t// reset selectedID (account could have been deleted in meantime)\n\tselectedOffer = null;\n\n\tdocument.getElementById(\"annehmen_button\").disabled = \"disabled\";\n\ttoggleWarning(\"error_noAppSelected\", true, \"Kein Bewerber selektiert!\");\n\tconnect(\"/hiwi/Provider/js/applicantChoice\", \"aid=\" + aid,\n\t\t\thandleApplicantChoiceResponse);\n}", "addForm() {\n // Creates a new form based on TEMPLATE\n let template = document.importNode(TEMPLATE.content, true);\n FORMSET_BODY.appendChild(template);\n let form = FORMSET_BODY.children[FORMSET_BODY.children.length -1];\n\n // Updates the id's of the form to unique values\n form.innerHTML = form.innerHTML.replace(MATCH_FORM_IDS, this.updateMatchedId.bind(this, form));\n\n let index = FORMSET_BODY.children.length;\n FORMSET.querySelector('[name=\"form-TOTAL_FORMS\"]').value = index;\n this.updateButton();\n }", "function _trackForms () {\r\n [].forEach.call(document.querySelectorAll('form[id][' + objSettings.attribute + ']'), function each (element) {\r\n providers.forEach(function _trackCharge (provider) {\r\n if (typeof provider.obj.trackForm === 'function') {\r\n provider.obj.trackForm('#' + element.id, element.getAttribute(objSettings.attribute));\r\n }\r\n });\r\n });\r\n}", "function filtrar(idFormulario) {\r\n\tdocument.getElementById(idFormulario).submit();\r\n}", "function filtrar(idFormulario) {\r\n\tdocument.getElementById(idFormulario).submit();\r\n}", "function fHideAllForms() {\n fLog(\"fHideAllForms\");\n for (i = 0; i < vaServices.length; i++) {\n var dService = vaServices[i];\n var oForm = dService[\"form\"];\n fHide(oForm);\n }\n}", "function selectForm(e){\n setActiveForm(e.target.name)\n }", "handleEditFormSubmission() {\n\t\tthis.getPortfolioItemData();\n\t}", "function handler_get_forms(){\n\tif(xmlHttp.readyState == 4 && xmlHttp.status == 200){\n\t\tpopulate_list_from_xml(xmlHttp.responseText, 'form_list');\n\n\t}\n}", "function requestForm (formId, tries) {\n\t\t\t//var defer = $q.defer();\n\n\t\t\ttries = tries || 0;\n\n\t\t\treturn $http.get(\"/api/form/\".concat( formId ))\n\t\t\t\t.success(function (data) {\n\t\t\t\t\tforms.push(data);\n\t\t\t\t\t//defer.resolve(data);\n\t\t\t\t\treturn data;\n\t\t\t\t})\n\t\t\t\t.error(function (data, status) {\n\t\t\t\t\tif (tries >= retryLimit) {\n\t\t\t\t\t\t//return defer.reject(data);\n\t\t\t\t\t\tconsole.log(\"retries exceeded form\");\n\t\t\t\t\t\terrorHandler (data, status);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn requestForm(formId, tries += 1);\n\t\t\t\t\t}\n\n\n\t\t\t\t});\n\n\t\t\t//return defer.promise;\n\t\t}", "function getForm() {\n return questionForm;\n}", "function formSymptom1Fields(form, id_form)\n{\n\tvar nombre = '';\n\tvar tipo = '';\n\tvar valor = '';\n\tvar error = false;\n\tvar val = '';\n\t\t\t\n\tform.each(function(){\n \n nombre = $(this).context.name;\n\n tipo = $(this).context.type;\n\n valor = $(this).context.value;\n\n $('#error_'+nombre+\"\").text('');\n\n if(tipo==='radio' && !$(\"input[name='\"+nombre+\"']:checked\", \"\"+id_form+\"\").is(\":checked\"))\n {\n \t\n \t$('#error_'+nombre+\"\").text('(*)');\n\n \terror = true;\n }\n \n //call_emergency(nombre,id_form); // Redirect to page for calling to 911 \n\t\tif(call_emergency(nombre,id_form)==1) return error = 1;\n\t});\n\treturn error;\n}", "function addHooksToAf() {\n _(that.pageMap).pluck('form').forEach(function(formId) {\n if (formId) {\n AutoForm.addHooks(formId, that.autoFormHooks(), true);\n }\n }\n )\n }", "function loadForm(company) {\n var targetUrl;\n var myOrg = new Organization();\n\n // myOrg.load(loadOrganizationList);\n loadOrganizationsByCompany(company.CompanyID, populateOrganizationList, pmmodaErrorHandler)\n// loadOrganizations(loadOrganizationList, loadOrgErrorHandler);\n\n\n if (editMode == \"new\") {\n updateReady = new $.Deferred();\n // Set the org value to -1 when the form is fully loaded\n $.when(updateReady).then(function () { setFormMode(\"new\"); });\n }\n }", "function getWebForms(formIdentifier,layer,pol_id,id_name,tabName,cb){\n\t\t_self.emit(\"log\",\"form.js\",\"getWebForms(\"+formIdentifier+\",\"+layer+\",\"+pol_id+\",\"+id_name+\",\"+tabName+\")\",\"info\");\n\t\tlet dataToSend \t\t\t\t= {};\n\t\tdataToSend.layer\t\t\t= layer\n\t\tdataToSend.device\t\t\t= _device;\n\t\tdataToSend.form\t\t\t\t= formIdentifier;\n\t\tdataToSend.pol_id\t\t\t= pol_id;\n\t\tdataToSend.id_name\t\t= id_name;\n\t\tdataToSend.tabName\t\t= tabName;\n\t\tdataToSend.token\t\t\t= _token;\n\t\tdataToSend.expected_api_version = _expected_api_version;\n\t\tdataToSend.what\t\t\t\t= 'ELEMENTS';\n\t\taxios.post(_baseHref+'/ajax.sewernet.php', dataToSend).then(function (response) {\n\t\t\t_self.emit(\"log\",\"forms.js\",\"getWebForms\",\"success\",response.data.message);\n\t\t\tif(response.data.status===\"Accepted\"){\n\t\t\t\tcb(null,response.data.message);\n\t\t\t}else{\n\t\t\t\tcb(response.data.code,response.data.message);\n\t\t\t}\n\t\t})\n\t\t.catch( (error) => {\n\t\t\t_self.emit(\"log\",\"form.js\",\"getWebForms\",\"error\",error);\n\t\t});\n\t}", "function editarRecomendacion(ente_id) {\n const url = '/recomendaciones/' + ente_id + '/edit'\n console.log(url);\n const formRecomendacionUpdate = document.getElementById('formRecomendacionUpdate');\n fetch(url, {\n method: 'GET',\n mode: \"cors\",\n headers: {\n accept: \"application/json\",\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n }\n })\n .then(response => {\n if (response.ok) {\n response.json().then(success => {\n formRecomendacionUpdate.id.value = success.id;\n formRecomendacionUpdate.autoparte.value = success.autoparte;\n formRecomendacionUpdate.tipo.value = success.tipo;\n formRecomendacionUpdate.seguimiento.value = success.seguimiento;\n formRecomendacionUpdate.fuente.value = success.fuente;\n formRecomendacionUpdate.especificacion.value = success.especificacion;\n formRecomendacionUpdate.tipo_alert.value = success.tipo_alert;\n formRecomendacionUpdate.fecha_siguiente.value = success.fecha_siguiente;\n formRecomendacionUpdate.km_siguiente.value = success.km_siguiente;\n\n\n // console.log(success);\n $('#modalRecomendacionUpdate').modal('show')\n });\n }\n })\n .catch(error => {\n console.log('request failed');\n });\n}", "function getAspForm (data) {\n\t\n\taspForm(data) \n\taspLiteFormLooper++\n\t\n\tif (aspLiteFormLooper < aspLiteAjaxForms.length) {\n\t\t//you can even save the server more, by adding some (25) milliseconds of delay before the next call is launched\n\t\t//setTimeout(function(){ aspAjax('GET',aspLiteAjaxHandler,'asplEvent=' + aspLiteAjaxForms[aspLiteFormLooper],getAspForm) }, 25);\n\t\t//or if you prefer not to wait...\n\t\taspAjax('GET',aspLiteAjaxHandler,'asplEvent=' + aspLiteAjaxForms[aspLiteFormLooper],getAspForm)\n\t}\n}", "getProject (mode, id) {\n Project.get({id}, (e, response) => {\n\n if (e === null && response) {\n\n let modal, form; \n\n if (mode === 'edit') {\n\n [modal, form] = [App.getModal('editProject'), App.getForm('editProjectForm')];\n \n\n } else if (mode === 'translate') {\n\n [modal, form] = [App.getModal('translateProject'), App.getForm('translateProjectForm')];\n\n } else if (mode === 'check') {\n \n [modal, form] = [App.getModal('checkProject'), App.getForm('checkProjectForm')];\n };\n\n form.update(id, response);\n modal.open();\n };\n });\n }", "function searchRequirements(id){\n\n\n UserService.setFcomponent(id).then(\n function () {\n $window.location.href = 'http://localhost:8080/#/fcomponent';\n console.log('ID '+ id + \" è stato cliccato setFcomponent\");\n },\n function (errResponse) {\n console.error('Error setFcomponent ' + id + ', Error :' + errResponse.data);\n }\n );\n }", "function getRegistrationForm(yearId, competitionId) {\n return {\n type: ApiConstants.API_GET_REG_FORM_LOAD,\n yearId,\n competitionId,\n };\n}", "function editForm(id){\n $('#editForm').modal('show');\n console.log(id)\n _roles_list();\n document.getElementById(\"name2\").value = document.getElementById('detail_name').innerHTML;\n document.getElementById(\"email2\").value = document.getElementById('detail_email').innerHTML;\n document.getElementById(\"phone2\").value = document.getElementById('detail_phone').innerHTML;\n document.getElementById(\"role_body2\").value = document.getElementById('detail_role_id').innerHTML;\n}", "function carregarIdElementosPagina() {\n\tarrayIdsElementsPage = new Array;\n\tfor (form = 0; form <= document.forms.length; form++) {\n\t\tvar formAtual = document.forms[form];\n\t\tif (formAtual != undefined) {\n\t\t\tfor (i = 0; i < document.forms[form].elements.length; i++) {\n\t\t\t\tif (document.forms[form].elements[i].id != '') {\n\t\t\t\t\tarrayIdsElementsPage[i] = document.forms[form].elements[i].id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function ambilId(id) {\n dbprom.then((db) => {\n let tx = db.transaction('produk'); //buat obj transaksi\n let dbStore = tx.objectStore('produk'); //pilih table\n let index = dbStore.index('id'); //pilih index\n return index.get(id); //cari berdasarkan index\n }).then((data) => {\n $('#eNama').val(data.nama); //masukan hasil pencarian ke tampilan form nama\n $('#eHarga').val(data.harga); //masukan hasil pencarian ke tampilan form harga\n $('#eStok').val(data.stok);\n $('#eDeskripsi').val(data.deskripsi);\n $('#eId').val(data.id); //!! eId diset dengan suatu nilai id yang akan diubah\n $('#modForm').modal('show'); //tampilkan modal\n }).catch((err) => {\n console.log('error ' + err);\n });\n}", "function setQuickAppointmentsForm(lang_iso){\n\tvar form = 'form[name=\"quick_appointment_form\"]',\n\t\tpage = '/' + lang_iso + '/actions/appointment/';\n\t\n\t// declare vars\n\tvar $btn, $form, $category_id, $service_id, $date, $forbidden_dates, $hour, $submit_btn;\n\t\n\tfunction init(){\n\t\t// init vars\n\t\t$form = $(form);\n\t\t$category_id = $form.find('select[name=\"category_id\"]');\n\t\t$service_id = $form.find('select[name=\"service_id\"]');\n\t\t$date = $form.find('input[name=\"date\"]');\n\t\t$forbidden_dates = $form.find('input[name=\"forbidden_dates\"]');\n\t\t$hour = $form.find('select[name=\"hour\"]');\n\t\t$submit_btn = $form.find('input[type=\"submit\"]');\n\t\t\n\t\t// set toggler\n\t\tsetToggler();\n\t\t// set custom selects\n\t\t$('.appointment select').customSelect();\n\t\t// set assync form submission\n\t\tsetAssyncForms(form);\n\t\t// set assync inputs\n\t\tassyncInputs();\n\t}\n\t\n\tfunction setToggler(){\n\t\t$btn = $('.appointment_pane > a');\n\t\t\n\t\t$btn.on('click', function(){\n\t\t\t$btn.parent().toggleClass('active');\n\t\t\t$form.stop().fadeToggle();\n\t\t});\n\t}\t\t\n\t\n\tfunction assyncInputs(){\n\t\t// get services\n\t\t$category_id.on('change', function(){\n\t\t\t// disable hour and date fields, as well as the submit button\n\t\t\t$date.val(\"\").prop('disabled', true);\n\t\t\t$hour.val(\"\").prop('disabled', true).change();\n\t\t\t$submit_btn.prop('disabled', true);\n\t\t\t\n\t\t\t$.post(\n\t\t\t\tpage + \"get_services_by_category_id\",\n\t\t\t\t{selected_id: $category_id.val()},\n\t\t\t\tfunction(data){\n\t\t\t\t\t$service_id.find('option:not(:first-child)').remove();\n\t\t\t\t\t$service_id.append(data);\n\t\t\t\t\tif($service_id.find('option').length > 1){\n\t\t\t\t\t\t$service_id.prop('disabled', false);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$service_id.prop('disabled', true);\n\t\t\t\t\t}\n\t\t\t\t\t$service_id.change();\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t\t\n\t\t// set days\n\t\t$service_id.on('change', function(){\n\t\t\t// disable hour and date fields\n\t\t\t$date.val(\"\").prop('disabled', true);\n\t\t\t$hour.val(\"\").prop('disabled', true).change();\n\t\t\t$submit_btn.prop('disabled', true);\n\t\t\t\n\t\t\t$.post(\n\t\t\t\tpage + \"get_unavailable_dates\",\n\t\t\t\t{selected_id: $service_id.val()},\n\t\t\t\tfunction(data){\n\t\t\t\t\tif($service_id.val()){\n\t\t\t\t\t\t$forbidden_dates.val(data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$date.prop('disabled', false);\n\t\t\t\t\t\tsetDatePicker(form + ' #date');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t\t\n\t\t$date.on('change', function(){\n\t\t\t$.post(\n\t\t\t\tpage + \"get_available_hours_by_date\",\n\t\t\t\t{service_id: $service_id.val(), date: $date.val(), hour: $hour.val()},\n\t\t\t\tfunction(data){\n\t\t\t\t\t$hour.find('option:not(:first-child)').remove();\n\t\t\t\t\t$hour.append(data);\n\t\t\t\t\tif($hour.find('option').length > 1){\n\t\t\t\t\t\t$hour.prop('disabled', false);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$hour.prop('disabled', true);\n\t\t\t\t\t}\n\t\t\t\t\t$hour.change();\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t\t\n\t\t$hour.on('change', function(){\n\t\t\tif($hour.val().length){\n\t\t\t\t$submit_btn.prop('disabled', false);\n\t\t\t}else{\n\t\t\t\t$submit_btn.prop('disabled', true);\n\t\t\t}\n\t\t});\n\t}\n\t\n\tinit();\n}", "function activateSurvey(app) {\n\n app.getElementById('continueLabel').setVisible(true);\n app.getElementById('referenceLabel').setVisible(true);\n app.getElementById('referenceListBoxId').setVisible(true);\n app.getElementById('escolarityLabel').setVisible(true);\n app.getElementById('escolarityListBoxId').setVisible(true);\n app.getElementById('wroteDownLabel').setVisible(true);\n app.getElementById('wroteDownListBoxId').setVisible(true);\n app.getElementById('submitButton2').setVisible(true);\n\n return app;\n}", "function findEditForm($personTr) {\n return $personTr.next().find('form');\n}", "function initializeForm() {\n editor.afform = editor.data.definition;\n if (!editor.afform) {\n alert('Error: unknown form');\n }\n if (editor.mode === 'clone') {\n delete editor.afform.name;\n delete editor.afform.server_route;\n editor.afform.is_dashlet = false;\n editor.afform.title += ' ' + ts('(copy)');\n }\n $scope.canvasTab = 'layout';\n $scope.layoutHtml = '';\n editor.layout = {'#children': []};\n $scope.entities = {};\n\n if (editor.getFormType() === 'form') {\n editor.allowEntityConfig = true;\n editor.layout['#children'] = afGui.findRecursive(editor.afform.layout, {'#tag': 'af-form'})[0]['#children'];\n $scope.entities = _.mapValues(afGui.findRecursive(editor.layout['#children'], {'#tag': 'af-entity'}, 'name'), backfillEntityDefaults);\n\n if (editor.mode === 'create') {\n editor.addEntity(editor.entity);\n editor.afform.create_submission = true;\n editor.layout['#children'].push(afGui.meta.elements.submit.element);\n }\n }\n\n else if (editor.getFormType() === 'block') {\n editor.layout['#children'] = editor.afform.layout;\n editor.blockEntity = editor.afform.join_entity || editor.afform.entity_type;\n $scope.entities[editor.blockEntity] = backfillEntityDefaults({\n type: editor.blockEntity,\n name: editor.blockEntity,\n label: afGui.getEntity(editor.blockEntity).label\n });\n }\n\n else if (editor.getFormType() === 'search') {\n editor.layout['#children'] = afGui.findRecursive(editor.afform.layout, {'af-fieldset': ''})[0]['#children'];\n editor.searchDisplay = afGui.findRecursive(editor.layout['#children'], function(item) {\n return item['#tag'] && item['#tag'].indexOf('crm-search-display-') === 0;\n })[0];\n editor.searchFilters = getSearchFilterOptions();\n }\n\n // Set changesSaved to true on initial load, false thereafter whenever changes are made to the model\n $scope.changesSaved = editor.mode === 'edit' ? 1 : false;\n $scope.$watch('editor.afform', function () {\n $scope.changesSaved = $scope.changesSaved === 1;\n }, true);\n }", "function show_first_form()\n{\n $.get('forms/form_asset.html', function(data) {\n $('#insert-form').html(data);\n });\n $('#insert-form').trigger('create');\n window.location = ('form.html'); //initial refresh\n}", "function editForm(wizardId) {\n let createEditForm = document.createElement('form')\n createEditForm.id = \"edit\"\n createEditForm.className = \"form-inline\"\n\n let editDiv = document.createElement('div')\n editDiv.className = \"edit-group\"\n editDiv.id = `editform-${wizardId}`\n editDiv.style.display = \"none\"\n\n createEditForm.addEventListener('submit', editFetchCall)\n\n createEditForm.appendChild(editDiv)\n editDiv.appendChild(editNameInput(wizardId))\n editDiv.appendChild(editURLInput(wizardId))\n editDiv.appendChild(editPetInput(wizardId))\n editDiv.appendChild(editPatronusInput(wizardId))\n editDiv.appendChild(editHouseInput(wizardId))\n editDiv.appendChild(editWandInput(wizardId))\n editDiv.appendChild(editDoneBtn(wizardId))\n\n return createEditForm\n}", "function searchById(domainClass, id) {\n var ajaxHandler = new AjaxHandler({\n url: '/gneellaan/' + domainClass + '/index/',\n element: '$var',\n method: 'POST',\n after: function(response) {\n formElements = document.getElementById(domainClass + 'Form').elements;\n for (var key in response) {\n if (formElements.namedItem(key)) {\n if (key.match(/check/)) {\n formElements.namedItem(key).checked = response[key];\n } else if (key.match(/data/)) {\n if (response[key]) {\n var date = new GrailsDate(response[key]);\n date.datePickerUpdate(formElements.namedItem(key + '_day'), 'day');\n date.datePickerUpdate(formElements.namedItem(key + '_month'), 'month');\n date.datePickerUpdate(formElements.namedItem(key + '_year'), 'year'); \n } else {\n formElements.namedItem(key).value = 'date.struct';\n }\n } else if (key.match(/imagem/)) {\n formElements.namedItem(key + 'Tag').src = '/gneellaan/' + domainClass + '/gerar/' + response.id;\n } else {\n formElements.namedItem(key).value = response[key];\n }\n }\n }\n formElements.namedItem('excluir').onclick = function() {\n var controller;\n if (document.getElementById('idDesenvolvedor')) {\n controller = 'desenvolvedor';\n } else if(document.getElementById('idCliente')) {\n controller = 'cliente';\n }\n window.location.href = \n \"/gneellaan/\" + domainClass \n + \"/excluir/\" + id \n + '?tab=' + domainClass \n + '&from=' + controller;\n }\n }\n }).sendRequest('search=' + id);\n}", "find(form){\n return form.get('/api/organizations/' + form.shortname + '/find')\n .then(response => {\n return response;\n })\n .catch(err => {\n return err;\n })\n }", "function leadActivityForms() {\n $('form').submit(function anonFormActivity() {\n var $this = $(this),\n formId = $this.find('input[name=\"form_id\"]').val(),\n data = {\n nid: $this.find('input[name=\"nid\"]').val(),\n keyword: Tabia.util.getUrlParameter('kw'),\n leadSource: $this.find('input[name=\"lead_source\"]').val(),\n leadSourceDetail: $this.find('input[name=\"lead_source_detail\"]').val(),\n campaignId: $this.find('input[name=\"campaign_id\"]').val()\n };\n\n // Admin configured forms.\n if (($.inArray(formId, Drupal.settings.tableauEloqua.queueForms) >= 0) &&\n data.leadSource !== null && data.campaignId !== null) {\n // Add submit event to a localStorage queue.\n $.jQueue.push(data, 'Drupal.behaviors.tableauEloquaQueue.eloquaPost');\n }\n });\n }", "function fillForm(pageId) {\n /**\n * The data to fill the form with\n */\n var data;\n\n if (pageId == 'feedback') {\n /**\n * The id query value for the current page\n */\n var id = getQueryVariable('id');\n data = eCon.local['form-' + pageId + '-' + id];\n } else {\n data = eCon.local['form-' + pageId];\n }\n\n if (data) {\n data = JSON.parse(data);\n $.each(data, function (i, o) {\n var $el = $('[name=\"' + o.name + '\"]'),\n type = $el.attr('type');\n\n // Handles filling the value of the element and refreshing if needed\n switch (type) {\n case 'checkbox':\n $el.prop('checked', 'checked').checkboxradio('refresh');\n break;\n case 'radio':\n $el.filter('[value=\"' + o.value + '\"]').prop('checked', 'checked').checkboxradio('refresh');\n break;\n default:\n $el.val(o.value);\n }\n });\n }\n $('#form-profile').val(eCon.local.Profile);\n $('#form-section').val($('#form-section').jqmData('value'));\n}", "async function changeFormular(req, res) {\n var formulars = await pool.query(\"select * from formular where name='\" + req.body.name + \"'\");\n\n // if formular not exists insert it\n if (formulars.rows.length == 0) {\n await pool.query(\"insert into formular(name) values('\" + req.body.name + \"')\");\n }\n // if formular exists update data (delete and then insert new data)\n else {\n var radioLabels = await pool.query(\"select r.id from radioButton r inner join element e on r.elementId=e.id where e.formularId='\" + formulars.rows[0].id + \"'\");\n var formularElements = await pool.query(\"select e.id from element e where e.formularId='\" + formulars.rows[0].id + \"'\")\n\n // delete all data from radioButton table for searched formular\n for (var i = 0; i < radioLabels.rows.length; i++) {\n await pool.query(\"delete from radioButton where id='\" + radioLabels.rows[i].id + \"'\");\n }\n\n // delete all from data table for searched formular\n for (var i = 0; i < formularElements.rows.length; i++) {\n var elementId = formularElements.rows[i].id;\n await pool.query(\"delete from data d where d.elementId='\" + elementId + \"'\");\n }\n\n // delete all elements\n await pool.query(\"delete from element where formularId='\" + formulars.rows[0].id + \"'\");\n }\n // insert data for non existing and existing formular\n var id = await pool.query(\"select id from formular where name='\" + req.body.name + \"'\");\n var elements = req.body.elements;\n var radioButtonId = await pool.query(\"select id from field where name='Radio buttons'\");\n // insert all data in element table\n for (var i = 0; i < elements.length; i++) {\n await pool.query(\"insert into element(name,label,fieldId,attributeId,formularId) values('\" + elements[i].name + \"','\" + elements[i].label + \"','\" + parseInt(elements[i].field) + \"','\" + parseInt(elements[i].attribute) + \"','\" + id.rows[0].id + \"')\");\n\n // insert data into radioButton table for element\n if (elements[i].field == radioButtonId.rows[0].id) {\n var elementId = await pool.query(\"select id from element where name='\" + elements[i].name + \"' and formularId='\" + id.rows[0].id + \"'\");\n for (var j = 0; j < elements[i].radioLabels.length; j++) {\n await pool.query(\"insert into radioButton(label,elementId) values('\" + elements[i].radioLabels[j] + \"','\" + elementId.rows[0].id + \"')\");\n }\n }\n }\n res.header(\"Access-Control-Allow-Origin\", \"*\");\n return res.status(200);\n}", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cobUsuarEtapaCobraDetalFrm.accion'), \n\t\tget('cobUsuarEtapaCobraDetalFrm.origen'));\n\n\n\tset('cobUsuarEtapaCobraDetalFrm.id', jsCobUsuarEtapaCobraDetalId);\n\tset('cobUsuarEtapaCobraDetalFrm.ueccOidUsuaEtapCobr', [jsCobUsuarEtapaCobraDetalUeccOidUsuaEtapCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.edtcOidEtapDeudTipoCarg', [jsCobUsuarEtapaCobraDetalEdtcOidEtapDeudTipoCarg]);\n\tset('cobUsuarEtapaCobraDetalFrm.zsgvOidSubgVent', [jsCobUsuarEtapaCobraDetalZsgvOidSubgVent]);\n\tset('cobUsuarEtapaCobraDetalFrm.zorgOidRegi', [jsCobUsuarEtapaCobraDetalZorgOidRegi]);\n\tset('cobUsuarEtapaCobraDetalFrm.zzonOidZona', [jsCobUsuarEtapaCobraDetalZzonOidZona]);\n\tset('cobUsuarEtapaCobraDetalFrm.zsccOidSecc', [jsCobUsuarEtapaCobraDetalZsccOidSecc]);\n\tset('cobUsuarEtapaCobraDetalFrm.terrOidTerr', [jsCobUsuarEtapaCobraDetalTerrOidTerr]);\n\tset('cobUsuarEtapaCobraDetalFrm.melcOidMetoLiquCobr', [jsCobUsuarEtapaCobraDetalMelcOidMetoLiquCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.eucoOidEstaUsuaEtapCobr', [jsCobUsuarEtapaCobraDetalEucoOidEstaUsuaEtapCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.gacaOidGuioArguCabe', [jsCobUsuarEtapaCobraDetalGacaOidGuioArguCabe]);\n\tset('cobUsuarEtapaCobraDetalFrm.valObse', jsCobUsuarEtapaCobraDetalValObse);\n\t\n}", "function Forms() {\n const dispatch = useDispatch();\n const myProfile = useSelector(state => state.myProfile);\n const userForms = useSelector(state => state.fetchUserForms);\n const deleteForm = useSelector(state => state.deleteForm);\n const [formDrawerVisible, setFormDrawerVisible] = useState(false);\n const [userDrawerVisible, setUserDrawerVisible] = useState(false);\n const [currentPage, setCurrentPage] = useState(1);\n const [currentTab, setCurrentTab] = useState(1);\n const [selectedForm, setSelectedForm] = useState(null);\n\n let menu = [\n <Button\n type=\"link\"\n onClick={() => {\n showDrawer(\"formDrawerVisible\");\n }}\n icon=\"plus\"\n >\n Add Form\n </Button>\n ];\n // To fetch the user forms\n useEffect(() => {\n dispatch(ac_fetchUserForms());\n return () => {\n /* \n To clean up when component unmounts\n */\n // dispatch(reset(USER_FORMS_RESET));\n // dispatch(reset(DELETE_FORM_RESET));\n };\n }, []);\n\n const showDrawer = (drawer, formid = null) => {\n if (formid) {\n setSelectedForm(formid);\n }\n setFormDrawerVisible(true);\n };\n\n const onClose = drawer => {\n setFormDrawerVisible(false);\n };\n\n const pageChange = e => {\n dispatch(ac_fetchUserForms(e));\n setCurrentPage(e);\n };\n\n const onTabChange = e => {\n setCurrentTab(e);\n };\n\n const mapUserForm = e => {\n if (e.checked) {\n dispatch(ac_mapuserform({ form: selectedForm, user: e.value }));\n }\n };\n\n const unMapUserForm = e => {\n if (e.checked) {\n dispatch(ac_unmapuserform(e.value, selectedForm));\n }\n };\n\n const deleteFormAction = formid => {\n dispatch(ac_deleteForm(formid));\n };\n return (\n <Fragment>\n <PageHeader className=\"align-right page-header\" />\n\n <Row className=\"content-section\">\n <Col xs={24} sm={24} md={24} lg={24}>\n <Button\n type=\"primary\"\n onClick={() => {\n showDrawer(\"formDrawerVisible\");\n }}\n icon=\"plus\"\n style={{'float': 'right'}}\n >\n Add Form\n </Button>\n </Col>\n <Col xs={24} sm={24} md={24} lg={24}>\n <Tabs onChange={onTabChange} defaultActiveKey=\"1\">\n <TabPane tab=\"Forms\" key=\"1\">\n {deleteForm.isError ? (\n <Alert\n type=\"error\"\n description={deleteForm.isError}\n closable\n />\n ) : null}\n {userForms.isError ? (\n <Alert\n type=\"error\"\n description={userForms.isError}\n closable\n />\n ) : null}\n {userForms.isLoading ? (\n <Spin />\n ) : (\n <Fragment>\n <List\n itemLayout=\"horizontal\"\n dataSource={userForms.forms ? userForms.forms : []}\n renderItem={item => (\n <List.Item\n className=\"user-list\"\n actions={[\n <Link\n to={URL_FORMS + \"/\" + item.form.id.toString()}\n >\n <Icon type=\"eye\" /> View\n </Link>,\n <Link\n to={\n URL_FORMS_EDIT + \"/\" + item.form.id.toString()\n }\n >\n <Icon type=\"edit\" /> Edit\n </Link>,\n <Button\n type=\"link\"\n onClick={e => deleteFormAction(item.form.id)}\n icon=\"delete\"\n >\n Delete\n </Button>,\n <Button\n type=\"link\"\n onClick={e =>\n showDrawer(\n \"userDrawerVisible\",\n item.form.id\n )\n }\n icon=\"share-alt\"\n >\n Share\n </Button>\n ]}\n >\n <List.Item.Meta\n title={item.form.form_name}\n description={\n item.user.first_name +\n \" @\" +\n moment(item.form.last_updated_on).format(\n DATE_TIME_WORDINGS\n )\n }\n />\n </List.Item>\n )}\n />\n <Pagination\n hideOnSinglePage={true}\n current={currentPage}\n onChange={pageChange}\n defaultPageSize={DATA_PER_PAGE}\n total={userForms.count}\n />\n </Fragment>\n )}\n </TabPane>\n <TabPane tab=\"Draft\" key=\"2\">\n {/* Need to unmount and re-mount the component, \n so UserFormInputs is re-rendered every time tab is changed and user selection list is \n changed.If we arenot re-rendering on tab change , both draft and sunmit will show same data */}\n {\n currentTab == \"2\" ? (\n <UserFormInputs\n // selectedUsers={}\n status=\"draft\"\n />\n ) : null}\n </TabPane>\n <TabPane tab=\"Submit\" key=\"3\">\n {\n currentTab == \"3\" ? (\n <UserFormInputs\n // selectedUsers={}\n status=\"submit\"\n />\n ) : null}\n </TabPane>\n </Tabs>\n </Col>\n \n </Row>\n <Drawer\n width={responsiveDrawerWidth}\n title=\"Create a new Form\"\n onClose={() => onClose(\"formDrawerVisible\")}\n visible={formDrawerVisible}\n destroyOnClose={true}\n >\n <CreateFormApp />\n </Drawer>\n </Fragment>\n );\n}", "function submit() {\n saveForm(applicant)\n}", "function showDocumentForm(id,type,subType) {\r\n\tvar documentFormWin = null;\r\n\tvar urlPrefix = \"\";\r\n\t\r\n\tif(Strings.isEmpty(id) || Strings.isEmpty(type)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\turlPrefix = \"/app/\" + $F('APP_NAME') + \"/document/\" + type ;\r\n\r\n\tif(!Strings.isEmpty(subType)) {\r\n\t\turlPrefix += \"/\" + subType ;\r\n\t}\r\n\turlPrefix += \"/form/\" ;\r\n\tvar url = urlPrefix + id + \"/show\";\r\n \r\n\tvar qs = new QueryString();\r\n\tdocumentFormWin = new Launcher('documentFormWin', url);\r\n\tdocumentFormWin.arguments = qs;\r\n\tdocumentFormWin.setCord({y:30, x:50, w:1080, h:650});\r\n\tdocumentFormWin.callBack = function(){documentFormWin = null;};\r\n\tdocumentFormWin.open();\r\n}", "function formsUpdate(request) {\r\n var promise = new Promise(function(resolve, reject) {\r\n if(!request.body.viewsiteId\r\n || !request.body.viewpageId\r\n || !request.body.elementId) {\r\n // Required IDs\r\n reject('Viewsite, Viewpage, and Element IDs are all required!');\r\n } else if(!request.body.formTitle) {\r\n // Required fields\r\n reject('All fields required!');\r\n } else if(!request.session.userId) {\r\n // Make sure a User is logged in\r\n reject('You must be logged in to update a Form!');\r\n } else {\r\n // Find Viewsite whose Viewpage's Element is to be updated\r\n viewsites.findById(request.body.viewsiteId)\r\n .exec(function(error, viewsiteData) {\r\n if(error) {\r\n // Handle unknown errors\r\n console.log(error.message);\r\n reject('Something went wrong!');\r\n } else if(!viewsiteData) {\r\n // Handle non-existent query results\r\n reject('Viewsite not found!');\r\n } else if(viewsiteData.userId != request.session.userId) {\r\n // Make sure User owns Viewsite\r\n reject('You can only update Forms you own!');\r\n } else if(!viewsiteData\r\n .viewpages.id(request.body.viewpageId)\r\n .elements.id(request.body.elementId)) {\r\n // Handle non-existent sub-documents\r\n reject('Element doesn\\'t exist!');\r\n } else {\r\n // Set updated fields\r\n viewsiteData\r\n .viewpages.id(request.body.viewpageId)\r\n .elements.id(request.body.elementId)\r\n .formTitle = request.body.formTitle;\r\n // Save updated Viewsite\r\n viewsiteData.save(function(error, results) {\r\n if(error) {\r\n // Handle unknown errors\r\n console.log(error.message);\r\n reject('Something went wrong!');\r\n } else {\r\n // Clean up results and return up-to-date Viewsite\r\n var cleanResults = results.toObject();\r\n delete cleanResults.userId;\r\n delete cleanResults.__v;\r\n resolve(cleanResults);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n return promise;\r\n}", "function findAppInSelectedModel(gid, aid,fromInstance) {\n\tvar self = this;\n\tvar _group = self.findGroupByPath(gid,fromInstance);\n\tvar _app = _.find(_group.apps, function(app) {\n\t\treturn app.id == aid;\n\t});\n\treturn _app;\n}", "function remove(id) {\n var deferred = q.defer();\n\n FormModel.remove({ _id: id }, function(err, status) {\n if(err) {\n deferred.reject(err);\n } else {\n // return the new list of forms\n findAll()\n .then(function(allForms) {\n deferred.resolve(allForms);\n });\n }\n });\n\n return deferred.promise;\n }" ]
[ "0.6088951", "0.6052487", "0.59781617", "0.5920414", "0.57667005", "0.57484394", "0.5678767", "0.5611019", "0.55790794", "0.5572576", "0.5459195", "0.5406526", "0.53712595", "0.5366074", "0.5340986", "0.532006", "0.5296096", "0.5277418", "0.52678955", "0.5238447", "0.52285886", "0.5222212", "0.52109694", "0.5205321", "0.51993537", "0.519553", "0.51774037", "0.5162857", "0.51587695", "0.51465636", "0.51458496", "0.513417", "0.5126504", "0.51086503", "0.51057124", "0.5098368", "0.50949967", "0.5072041", "0.5056099", "0.5041383", "0.5028589", "0.5018181", "0.4969667", "0.49567363", "0.4956519", "0.49378076", "0.49224806", "0.49009326", "0.48899332", "0.48822448", "0.48778033", "0.48738512", "0.48716393", "0.4850464", "0.48463136", "0.48454", "0.48405924", "0.48289675", "0.4818054", "0.48158208", "0.48133168", "0.48052227", "0.48037064", "0.48037064", "0.4788988", "0.4785724", "0.47856754", "0.47851276", "0.47816634", "0.47769326", "0.47737467", "0.47726312", "0.4770184", "0.47685313", "0.47632468", "0.4755688", "0.4754378", "0.47505352", "0.47436777", "0.47429723", "0.47402492", "0.47394073", "0.47384885", "0.4738454", "0.47368", "0.47366822", "0.4734026", "0.47261053", "0.47248733", "0.4723047", "0.471608", "0.47123474", "0.4699231", "0.4698763", "0.46912047", "0.4687943", "0.46864378", "0.4679769", "0.46794128", "0.46787754" ]
0.7286602
0
resolves to user's responces (should probably also return the form data (form and form_field))
function getUserFormResponces(userid, formid) { return new Promise((resolve, reject) => { if(!applicant || !userid || !formid) reject(new Error('applicants cannot be found')); resolve([]); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function responseFn() {\n if (req.readyState === 4) {\n try {\n // Success response\n if (req.status >= 200 && req.status < 400) {\n resolve({\n data: JSON.parse(req.responseText),\n status: req.status,\n config: Object.assign({}, opts)\n });\n } else {\n reject({\n error: req.responseText,\n status: req.status,\n config: Object.assign({}, opts)\n });\n }\n } catch (e) {\n // Error response\n reject({\n error: e,\n status: req.status,\n config: Object.assign({}, opts)\n });\n } \n }\n }", "async function handle_form(response) {\n const json_response = await response.json();\n if (!json_response.errors) {\n // If there are no errors, reload the page, and the contribution will now\n // be present\n window.location.href = '/profile';\n } else {\n var title_error = document.getElementById(\"title-error\");\n var date_error = document.getElementById(\"date-error\");\n var description_error = document.getElementById(\"description-error\");\n\n title_error.innerHTML = \"\";\n date_error.innerHTML = \"\";\n description_error.innerHTML = \"\";\n\n // Handle each of the error messages received, and place them under the\n // correct input fields\n for (var i = 0; i < json_response.errors.length; i++) {\n switch (json_response.errors[i].msg) {\n case (\"title_min\"):\n title_error.innerHTML = \"Please enter a title\";\n break;\n case (\"title_max\"):\n title_error.innerHTML = \"Titles must be less than 50 characters\";\n break;\n case (\"description_min\"):\n description_error.innerHTML = \"Please enter a description\";\n break;\n case (\"description_max\"):\n description_error.innerHTML = \"Maximum 450 characters\";\n break;\n case (\"date\"):\n date_error.innerHTML = \"Please enter a date\";\n break;\n default:\n break;\n }\n }\n }\n}", "function showValidity() {\n if (httpObject.readyState == 4 && httpObject.status == 200) {\n if (httpObject.responseText != \"\") {\n var response = JSON.parse(httpObject.responseText);\n setFormResponse(setResponses(response));\n }\n }\n}", "function formHandler(resp, status, on_success, on_failed, on_error) {\n console.log(resp); //TODO remove me\n if (status === 'success') {\n if (resp.status === 'success') {\n on_success(resp, status);\n } else if (resp.status === 'failed') {\n on_failed(resp.reason)\n } else if (resp.status === 'errors') {\n on_error(resp, status);\n }\n } else {\n console.log('Failed to POST form, status: ' + status);\n }\n}", "onResponseReceived(resolve) {\n var _a, _b, _c, _d;\n this.sendEvent(Const_1.COMPLETE);\n /*\n * second on error path\n */\n if (((_b = (_a = this.xhrObject) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : 0) >= 300 || !((_c = this === null || this === void 0 ? void 0 : this.xhrObject) === null || _c === void 0 ? void 0 : _c.responseXML)) {\n // all errors from the server are resolved without interfering in the queue\n this.handleGenericError(resolve);\n return;\n }\n (0, Const_1.$faces)().ajax.response(this.xhrObject, (_d = this.responseContext.value) !== null && _d !== void 0 ? _d : {});\n }", "function processUser(registeredUser) {\n fetch('/api/users',\n {\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n method: \"POST\",\n body: JSON.stringify(registeredUser)\n })\n .then(response => {\n if (response.status === 201) {\n window.location.href = \"pick-goals.html\";\n \n }\n else {\n return response.json()\n }\n\n })\n // provides message when client doesn't enter First Name, Last Name, Username or password information according to specifications.\n .then(response => {\n $('.jSsignUP1').text(response.location + \": \" + response.message);\n })\n .catch(error => console.log('Something went wrong when trying to sign up'));\n}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('userloandetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('userloandetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('useraddressdetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('useraddressdetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('useraddressdetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('useraddressdetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('useraddressdetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function getReply(req, res) {\n\t// Get data from the JSON post.\n\tvar username = req.body.username;\n\tvar message = req.body.message;\n\tvar vars = req.body.vars;\n\t\n\n\t// Make sure username and message are included.\n\tif (typeof(username) === \"undefined\" || typeof(message) === \"undefined\") {\n\t\treturn error(res, \"username and message are required keys\");\n\t}\n\n\t// Copy any user vars from the post into RiveScript.\n\tif (typeof(vars) !== \"undefined\") {\n\t\tfor (var key in vars) {\n\t\t\tif (vars.hasOwnProperty(key)) {\n\t\t\t\tbot.setUservar(username, key, vars[key]);\n\t\t\t}\n\t\t}\n\t}\n\t// Get a reply from the bot.\n\tvar aux = accents(message)\n\n\n\n\n\tif(req.body.vars.begin){\n\n\t\tbotForm.setUservar(username,\"vars\",vars)\n\t\t//var reply = bot.replyAsync(username, aux, this);\n\n\t\tbotForm.replyAsync(username, message, this).then(function(result) {\n\t\t\t\n\t\t\tvar vars = botForm.getUservars(username,\"vars\");\n\t\t\tvar completed=false;\n\t\t\tvar msg=''\n\t\t\tvar voice=''\n\t\t\tvar formulario={}\n\t\t\tvar begin=false;\n\n\t\t\tvar log = {\n\t\t\t\tperson:username,\n\t\t\t\tmsgin:message,\n\t\t\t\tmsgout:result,\n\t\t\t\tdate: new Date()\n\t\t\t};\n\n\n\n\t\t\tdb.log.save(log);\n\n\n\t\t\ttry{\n\t\t\t\tresult\t = JSON.parse(result)\n\t\t\t\tcompleted = result.completed\n\t\t\t\tmsg = result.reply\n\t\t\t\tvoice = result.voice\n\t\t\t formulario = result.formulario\n\t\t\t begin = result.begin\n\t\t\t}catch(e){\n\t\t\t\tcompleted = vars.completed\n\t\t\t\tmsg = result\n\t\t\t\tvoice = result\n\t\t\t\tformulario = vars.formulario\n\t\t\t\tbegin = result.begin\n\t\t\t}\n\t\t\t\n\t\t\t// Get all the user's vars back out of the bot to include in the response.\n\t\t\t\n\n\t\t\t// Send the JSON response.\n\t\t\tres.json({\n\t\t\t\treply:msg,\n\t\t\t\tvoice,\n\t\t\t\tcompleted,\n\t\t\t\tformulario,\n\t\t\t\tbegin\n\t\t\t});\n\t\t});\n\t}\n\telse{\n\t\tbot.setUservar(username,\"vars\",vars)\n\t\t//var reply = bot.replyAsync(username, aux, this);\n\n\t\tbot.replyAsync(username, message, this).then(function(result) {\n\t\t\t\n\t\t\tvar vars = bot.getUservars(username,\"vars\");\n\t\t\tvar completed=false;\n\t\t\tvar msg=''\n\t\t\tvar voice=''\n\t\t\tvar formulario={}\n\t\t\tvar begin=false;\n\n\t\t\tvar log = {\n\t\t\t\tperson:username,\n\t\t\t\tmsgin:message,\n\t\t\t\tmsgout:result,\n\t\t\t\tdate: new Date()\n\t\t\t};\n\n\n\n\t\t\tdb.log.save(log);\n\n\n\t\t\ttry{\n\t\t\t\tresult\t = JSON.parse(result)\n\t\t\t\tcompleted = result.completed\n\t\t\t\tmsg = result.reply\n\t\t\t\tvoice = result.voice\n\t\t\t formulario = result.formulario\n\t\t\t begin = result.begin\n\t\t\t}catch(e){\n\t\t\t\tcompleted = vars.completed\n\t\t\t\tmsg = result\n\t\t\t\tvoice = result\n\t\t\t\tformulario = vars.formulario\n\t\t\t\tbegin = result.begin\n\t\t\t}\n\t\t\t\n\t\t\t// Get all the user's vars back out of the bot to include in the response.\n\t\t\t\n\t\t\tif(begin==undefined || begin==null)\n\t\t\t\tbegin=false\n\t\t\t// Send the JSON response.\n\t\t\tres.json({\n\t\t\t\treply:msg,\n\t\t\t\tvoice,\n\t\t\t\tcompleted,\n\t\t\t\tformulario,\n\t\t\t\tbegin\n\t\t\t});\n\t\t});\n\t}\n}", "function properResponse(input) {\n if (input.value == jNodes[1].val[0]) {\n showSuccess(input);\n thePrompt.value = jNodes[2].val\n clearUserResponse()\n } else if (input.value == jNodes[3].val[0]) {\n showSuccess(input);\n thePrompt.value = jNodes[4].val\n clearUserResponse()\n }\n else {\n showError(input, 'WRONG-O');\n }\n}", "handleEmailResponse(resp) {\n var primaryEmail;\n for (var i=0; i < resp.emails.length; i++) {\n if (resp.emails[i].type === 'account') primaryEmail = resp.emails[i].value;\n }\n document.getElementById('responseContainer').value = 'Primary email: ' +\n primaryEmail + '\\n\\nFull Response:\\n' + JSON.stringify(resp);\n }", "_resolveResponseData() {\n return ( !this._options.type || this._options.type === 'text' ) ? this._xhr.responseText : this._xhr.response;\n }", "function BOT_resolveRequest() {\r\n\tBOT_theLastAnswerShort = BOT_reqAnswerShort;\r\n\tBOT_theLastAnswerLong = BOT_reqAnswerLong;\r\n\t\r\n\tBOT_reqSuccess = true;\t\t// contains the result of request on model\r\n\tBOT_reqEmote = \"\";\t\t// contains the emote string\r\n\tBOT_reqAnswerShort = \"\";\t\t// contains the answer string -- mode short\r\n\tBOT_reqAnswerLong = \"\";\t\t// contains the answer string -- mode long\r\n\tBOT_reqFilled = false;\t// true when BOT_reqSuccess, BOT_reqEmote,BOT_reqAnswerShort/long filled\r\n\r\n\r\n\t// ASSUMPTIONS: BOT_theReqPerformative and BOT_theReqTopic exist\r\n\tswitch (BOT_theReqPerformative) { // there is always one (z)\r\n \t\tcase \"a\": BOT_onAsk(); break;\r\n \t\tcase \"b\": BOT_onBravo(); break;\r\n \t\tcase \"c\": BOT_onCriticize(); break;\r\n \t\tcase \"d\": BOT_onDislike(); break;\r\n \t\tcase \"e\": BOT_onEffect(); break;\r\n \t\tcase \"f\": BOT_onFeel(); break;\r\n \t\tcase \"g\": BOT_onGreet(); break;\r\n \t\tcase \"h\": BOT_onHow(); break;\r\n \t\tcase \"i\": BOT_onIntent(); break;\r\n \t\tcase \"j\": BOT_onJudge(); break;\r\n \t\tcase \"k\": BOT_onKnow(); break;\r\n \t\tcase \"l\": BOT_onLike(); break;\r\n \t\tcase \"m\": BOT_onMore(); break;\r\n \t\tcase \"n\": BOT_onNo(); break;\r\n \t\tcase \"o\": BOT_onObject(); break;\r\n \t\tcase \"p\": BOT_onPossible(); break;\r\n \t\tcase \"q\": BOT_onQuit(); break;\r\n \t\tcase \"r\": BOT_onReply(); break;\r\n \t\tcase \"s\": BOT_onSuggest(); break;\r\n \t\tcase \"t\": BOT_onTell(); break;\r\n \t\tcase \"u\": BOT_onUndo(); break;\r\n \t\tcase \"v\": BOT_onVerify(); break;\r\n \t\tcase \"w\": BOT_onWhy(); break;\r\n \t\tcase \"x\": BOT_onExecute(); break;\r\n \t\tcase \"y\": BOT_onYes(); break;\r\n \t\tcase \"z\": BOT_onZee(); break; // future extensions\r\n \t\tdefault : break;\r\n\t\t};\r\n\t\r\n\t// ------------------------------ EPILOG ----------------------------------- \r\n\t\r\n\t\r\n\tBOT_reqApplicationPostProcessing(); \r\n\t\r\n\tif(BOT_theReqPerformative != \"z\")\tBOT_theLastPerformative = BOT_theReqPerformative;\r\n\tif(BOT_theReqTopic) {\r\n\t\tBOT_theLastTopic = BOT_theReqTopic;\r\n\t\tBOT_theTopicId = BOT_theReqTopic // sets also the current topic id\r\n\t}\r\n\r\n\tif(BOT_theReqAttribute)\t\tBOT_theLastAttribute = BOT_theReqAttribute;\r\n\tif(BOT_theReqRelation)\t\tBOT_theLastRelation = BOT_theReqRelation;\r\n\tif(BOT_theReqValue)\t\t\tBOT_theLastValue = BOT_theReqValue;\r\n\tif(BOT_theReqStresser)\t\tBOT_theLastStresser = BOT_theReqStresser;\r\n\tif(BOT_theReqText)\t\t\tBOT_theLastText = BOT_theReqText; \r\n\r\n\tBOT_reqAnswerShort = BOT_fillMetaString(BOT_reqAnswerShort); \r\n\tBOT_reqAnswerLong = BOT_fillMetaString(BOT_reqAnswerLong); \r\n\t\r\n\tBOT_traceString += \"SUCCESS \" + BOT_reqSuccess + \"\\n\";\r\n\tBOT_traceString += \"EMOTE \" + BOT_reqEmote + \"\\n\";\r\n\tBOT_traceString += \"SHORT ANSWER \" + BOT_reqAnswerShort + \"\\n\";\r\n\tBOT_traceString += \"LONG ANSWER \" + BOT_reqAnswerLong + \"\\n\";\r\n}", "async handleResponse () {\n\t\tif (this.gotError) {\n\t\t\treturn super.handleResponse();\n\t\t}\n\n\t\t// return customized response data to New Relic\n\t\tthis.responseData = {\n\t\t\tpost: Utils.ToNewRelic(this.codeError, this.post, this.users)\n\t\t};\n\t\treturn super.handleResponse();\n\t}", "async resolveResistedAttack(message) {\n let confirmed = false;\n const success = message.getFlag(\"urbanjungle\", \"resistSuccess\");\n const successes = message.getFlag(\"urbanjungle\", \"resistSuccessCount\");\n\n let resolvedopfor = new Promise((resolve) => {\n let dlog = new Dialog({\n title: game.i18n.localize(\"urbanjungle.dialog.resistResolve.title\"),\n content: `\n <form class=\"urbanjungle\">\n <div class=\"form-group\">\n <span class=\"small-label\">${game.i18n.localize(\"urbanjungle.dialog.resistResolve.successes\")}: ${successes}</span>\n </div>\n <div class=\"form-group\">\n <span class=\"small-text\">${success ? \"\" : game.i18n.localize(\"urbanjungle.dialog.resistResolve.tiedMessage\")}</span>\n </div>\n <div class=\"form-group\">\n <label class=\"normal-label\" for=\"opfor\">${game.i18n.localize(\"urbanjungle.dialog.resistResolve.opposing\")}:</label>\n\t <input id=\"opfor\" name=\"opfor\" value=\"\" onfocus=\"this.select();\"></input>\n </div>\n </form>\n `,\n buttons: {\n one: {\n icon: '<i class=\"fas fa-check\"></i>',\n label: game.i18n.localize(\"urbanjungle.dialog.resolve\"),\n callback: () => confirmed = true\n },\n two: {\n icon: '<i class=\"fas fa-times\"></i>',\n label: game.i18n.localize(\"urbanjungle.dialog.cancel\"),\n callback: () => confirmed = false\n }\n },\n default: \"one\",\n render: html => { document.getElementById(\"opfor\").focus(); },\n close: html => {\n if (confirmed) {\n let OPFOR = html.find('[name=opfor]')[0].value;\n let opposing = 0; if (OPFOR.length > 0) opposing = parseInt(OPFOR);\n resolve(opposing);\n } else {\n resolve(null);\n }\n }\n });\n dlog.render(true);\n });\n let opposingsuccesses = await resolvedopfor;\n if (opposingsuccesses === null) return; // Return out if the user just cancels the prompt\n\n if (successes > opposingsuccesses) {\n this.successfulAttackToChat(true, successes - opposingsuccesses);\n }\n else {\n this.failedAttackToChat();\n }\n }", "function ventanaRespuesta_processResponse(res) {\n try {\n var info = eval('(' + res + ')');\n\n switch (info) {\n case -1:\n muestraVentana(mensajemenosuno);\n break;\n case 1:\n muestraVentana('Información almacenada correctamente');\n $.fancybox.close();\n listarCargos(1);\n idGlobal = \"-1\";\n break;\n case 2:\n muestraVentana('Información Actualizada correctamente');\n $.fancybox.close();\n listarCargos(1);\n idGlobal = \"-1\";\n break;\n case 3:\n muestraVentana('Información Eliminada correctamente');\n $.fancybox.close();\n listarCargos(1);\n idGlobal = \"-1\";\n break;\n case 4:\n muestraVentana('NO SE PUEDE BORRAR EL &Aacute;REA, HAY CARGOS');\n $.fancybox.close();\n listarCargos(1);\n idGlobal = \"-1\";\n break;\n\n }\n } catch (elError) {\n }\n}", "function respond() {\r\n // Now we do the cool stuff!!\r\n var request = JSON.parse(this.req.chunks[0]);\r\n var user = JSON.parse;\r\n\r\n // Hey, something happened!\r\n if (request.text) {\r\n // HELP OUT USER\r\n if (helpRegex.test(request.text)) {\r\n console.log(\"!help\");\r\n this.res.writeHead(200);\r\n postMessage(getHelpText);\r\n this.res.end();\r\n }\r\n \r\n\r\n // GET ACCOUNTS\r\n else if (accountsRegex.test(request.text) || passEmptyRegex.test(request.text)) {\r\n console.log(\"!accounts\");\r\n this.res.writeHead(200);\r\n postMessage(getAccounts);\r\n this.res.end();\r\n }\r\n // GET PASSWORD\r\n else if (passwordRegex.test(request.text)) {\r\n account = request.text.slice(10); //!password\r\n console.log(\"!password \" + account);\r\n this.res.writeHead(200);\r\n postMessage(getPassword, account);\r\n this.res.end();\r\n }\r\n // GET ACTIVES\r\n else if (activesRegex.test(request.text)) {\r\n console.log(\"!actives\");\r\n this.res.writeHead(200);\r\n postMessage(getActives);\r\n this.res.end();\r\n }\r\n \r\n // GET SPECIFIC ACTIVE\r\n else if (sigmaRegex.test(request.text) || capitalizedsigmaRegex.test(request.text)) {\r\n sigmaNumber = request.text.slice(7); //!sigma\r\n console.log(\"!sigma \" + sigmaNumber);\r\n this.res.writeHead(200);\r\n postMessage(getSigma, sigmaNumber);\r\n this.res.end();\r\n }\r\n // GET PLEDGES\r\n else if (pledgesRegex.test(request.text)) {\r\n console.log(\"!pledges\");\r\n this.res.writeHead(200);\r\n postMessage(getPledges);\r\n this.res.end();\r\n }\r\n // GET CALENDAR\r\n else if (calendarRegex.test(request.text)) {\r\n console.log(\"!calendar\");\r\n this.res.writeHead(200);\r\n postMessage(getCalendarText);\r\n this.res.end();\r\n }\r\n\r\n else if (cockRegex.test(request.text)) {\r\n console.log(\"!cock\");\r\n this.res.writeHead(200);\r\n postMessage(getCock);\r\n this.res.end();\r\n }\r\n\r\n // GET STUDY\r\n else if (studyRegex.test(request.text)) {\r\n console.log(\"!study\");\r\n this.res.writeHead(200);\r\n postMessage(getStudyImage);\r\n this.res.end();\r\n }\r\n // GET USERNAME\r\n else if (usernameRegex.test(request.text)) {\r\n console.log(\"!username\");\r\n this.res.writeHead(200);\r\n postMessage(getUsername);\r\n this.res.end();\r\n }\r\n // GET REASONABLE\r\n else if (reasonableRegex.test(request.text)) {\r\n console.log(\"!reasonable\");\r\n this.res.writeHead(200);\r\n postMessage(getReasonable);\r\n this.res.end();\r\n }\r\n \r\n // GET CLEANUP\r\n else if (cleanupRegex.test(request.text)) {\r\n console.log(\"!cleanup\");\r\n this.res.writeHead(200);\r\n postMessage(getCleanup);\r\n this.res.end();\r\n }\r\n\r\n // GET BAR\r\n else if (barRegex.test(request.text)) {\r\n console.log(\"!bar\");\r\n this.res.writeHead(200);\r\n postMessage(getBar);\r\n this.res.end();\r\n }\r\n\r\n // GET DOOR\r\n else if (doorRegex.test(request.text)) {\r\n console.log(\"!door\");\r\n this.res.writeHead(200);\r\n postMessage(getDoor);\r\n this.res.end();\r\n }\r\n \r\n //post link to the google drive\r\n else if (driveRegex.test(request.txt)) {\r\n console.log(\"!drive\");\r\n this.res.writeHead(200);\r\n postMessage(getDrive);\r\n this.res.end();\r\n }\r\n\r\n // GET STANDARDS FORM\r\n else if (standardsRegex.test(request.text)) {\r\n console.log(\"!standards\");\r\n this.res.writeHead(200);\r\n postMessage(getStandardsForm);\r\n this.res.end();\r\n }\r\n\r\n // GET FIX FORM\r\n else if (fixRegex.test(request.text)) {\r\n console.log(\"!fix\");\r\n this.res.writeHead(200);\r\n postMessage(getFixForm);\r\n this.res.end();\r\n }\r\n\r\n // GET THANKS\r\n else if (thanksRegex.test(request.text)) {\r\n console.log(\"!thanks\");\r\n this.res.writeHead(200);\r\n postMessage(getThanks);\r\n this.res.end();\r\n }\r\n\r\n // GET MOON\r\n else if (moonRegex.test(request.text)) {\r\n console.log(\"!moon\");\r\n this.res.writeHead(200);\r\n postMessage(getMoon);\r\n this.res.end();\r\n }\r\n\r\n // GET risk\r\n else if (riskRegex.test(request.text)) {\r\n console.log(\"!risk\");\r\n this.res.writeHead(200);\r\n postMessage(getRisk);\r\n this.res.end();\r\n }\r\n\r\n // GET BUDGET\r\n else if (budgetRegex.test(request.text)) {\r\n console.log(\"!budget\");\r\n this.res.writeHead(200);\r\n postMessage(getBudget);\r\n this.res.end();\r\n }\r\n\r\n //no gay shit\r\n else if (gazeRegex.test(request.text)) {\r\n console.log(\"!pd\");\r\n this.res.writeHead(200);\r\n postMessage(getPD);\r\n this.res.end();\r\n }\r\n\r\n //beat the clock\r\n else if (socialRegex.test(request.text)) {\r\n console.log(\"!social\");\r\n this.res.writeHead(200);\r\n postMessage(getBTC);\r\n this.res.end();\r\n }\r\n\r\n //ban the R word\r\n else if (retardRegex.test(request.text)) {\r\n console.log(\"retard\");\r\n this.res.writeHead(200);\r\n postMessage(getRetard);\r\n this.res.end();\r\n }\r\n \r\n\t// GET NUKE (to be used to spam group chat if it all goes hell)\r\n else if (nukeRegex.test(request.txt)){\r\n\tconsole.log(\"!nuke\");\r\n\t//this.res.writeHead(200); // uncomment this to purge\r\n\t//postMessage(getNuke);\r\n\t//this.res.writeHead(200);\r\n\t//postMessage(getNukeCountdown);\r\n\tthis.res.writeHead(200);\r\n postMessage(getDrop);\r\n\tthis.res.end();\r\n }\r\n \r\n //return the frat's positive covid dates\r\n else if (covidRegex.test(request.text)) {\r\n console.log(\"!covid\");\r\n this.res.writeHead(200);\r\n postMessage(getCovid);\r\n this.res.end();\r\n }\r\n\r\n else if (hornyRegex.test(request.text)) {\r\n console.log(\"!horny\");\r\n this.res.writeHead(200);\r\n postMEssage(getHorny);\r\n this.res.end();\r\n }\r\n \r\n //roll a six sided die\r\n else if (dieRegex.test(request.text)) {\r\n console.log(\"!die\");\r\n this.res.writeHead(200);\r\n postMessage(rollDie);\r\n this.res.end();\r\n }\r\n // NOT IMPORTANT...\r\n else {\r\n console.log(\"don't care\");\r\n this.res.writeHead(200);\r\n this.res.end();\r\n }\r\n }\r\n // Boring......\r\n else {\r\n console.log(\"don't care\");\r\n this.res.writeHead(200);\r\n this.res.end();\r\n }\r\n}", "async handleResponse () {\n\t\tif (this.gotError) {\n\t\t\treturn super.handleResponse();\n\t\t}\n\n\t\t// only return a full response if this was the user's first company\n\t\tif (this.transforms.additionalCompanyResponse) {\n\t\t\tthis.log('NOTE: sending additional company response to POST /companies request');\n\t\t\tthis.responseData = this.transforms.additionalCompanyResponse;\n\t\t\tthis.teamId = this.responseData.teamId;\n\t\t\tthis.userId = this.responseData.userId;\n\t\t} else {\n\t\t\tthis.userId = this.user.id;\n\t\t\tif (this.transforms.createdTeam) {\n\t\t\t\tthis.responseData.team = this.transforms.createdTeam.getSanitizedObject({ request: this });\n\t\t\t\tthis.responseData.team.companyMemberCount = 1;\n\t\t\t\tthis.teamId = this.transforms.createdTeam.id;\n\t\t\t}\n\t\t\tif (this.transforms.createdTeamStream) {\n\t\t\t\tthis.responseData.streams = [\n\t\t\t\t\tthis.transforms.createdTeamStream.getSanitizedObject({ request: this })\n\t\t\t\t]\n\t\t\t}\n\t\t\tif (this.transforms.newAccessToken) {\n\t\t\t\tthis.responseData.accessToken = this.transforms.newAccessToken;\n\t\t\t}\n\t\t}\n\n\t\tif (this.transforms.userUpdate) {\n\t\t\tthis.responseData.user = this.transforms.userUpdate;\n\t\t\tif (this.responseData.user.$set) {\n\t\t\t\tdelete this.responseData.user.$set.nrUserInfo;\n\t\t\t}\n\t\t}\n\n\t\tthis.log('NEWRELIC IDP TRACK: CS company was created');\n\t\treturn super.handleResponse();\n\t}", "async handleResponse () {\n\t\tif (this.gotError) {\n\t\t\treturn super.handleResponse();\n\t\t}\n\t\tthis.responseData = {\n\t\t\tuser: Object.assign({ id: this.user.id }, this.transforms.userUpdate)\n\t\t};\n\t\tawait super.handleResponse();\n\t}", "function resolver(req, res) {\n\n try {\n // if valid JSON, try to generate HTML of selection\n var listing = JSON.parse(req.query.text.trim());\n var result = generateResolveHTML(listing);\n\n if (result) {\n return res.json({body: result});\n }\n return res.sendStatus(400);\n\n } catch (e) { //If Non-JSON or invalid JSON\n return res.sendStatus(400);\n }\n}", "getResponse() {\n // return HTML for form posts, otherwise JSON\n const contentType =\n this.getContentType() === \"application/x-www-form-urlencoded\"\n ? \"text/html\"\n : \"application/json\";\n\n /**\n * set response content-type\n */\n this.response.headers[\"Content-Type\"] = contentType;\n\n /**\n * set response code\n */\n const sent = this.didSend();\n const hasErrors = this.hasErrors();\n const failedSend = sent !== true;\n const invalidFormId =\n this.hasFormId() === true && this.hasValidForm() === false;\n const missingFormId =\n this.hasFormId() === false && this.payload !== false;\n const redirect = this.getPostSubmitRedirect();\n const emptyPost = this.hasFormId() === false && this.payload === false;\n\n if (emptyPost) {\n // default redirect\n this.response.statusCode = 302;\n } else if (hasErrors || failedSend || invalidFormId || missingFormId) {\n this.response.statusCode = 400;\n } else if (redirect) {\n this.response.statusCode = 302;\n this.response.headers.Location = redirect;\n } else {\n this.response.statusCode = 200;\n }\n\n if (!redirect && this.response.statusCode !== 302) {\n // remove any redirect Location if it's not a 301/302\n delete this.response.headers.Location;\n }\n\n /**\n * set response content\n */\n\n const isSuccess =\n this.response.statusCode === 200 ||\n this.response.statusCode === 302;\n const errors = this.getErrors();\n\n let reasons = [];\n\n if (hasErrors) {\n reasons.push(`Form has errors.`);\n }\n\n if (failedSend) {\n reasons.push(`Failed to send.`);\n }\n\n if (invalidFormId) {\n reasons.push(`Invalid form ID.`);\n }\n\n if (missingFormId) {\n reasons.push(`Missing form ID.`);\n }\n\n if (contentType === \"application/json\") {\n let body = {\n success: isSuccess,\n reason: reasons,\n errors: errors\n };\n\n if (body.reason.length === 0) {\n delete body.reason;\n }\n\n if (body.errors.length === 0) {\n delete body.errors;\n }\n\n this.response.body = JSON.stringify(body);\n } else {\n let heading = `Form Submitted!`;\n let back = false;\n\n if (!isSuccess) {\n back = true;\n\n if (errors.length === 1) {\n heading = `Uh oh! There was a problem with the form.`;\n } else {\n heading = `Uh oh! There were problems with the form.`;\n }\n }\n\n this.response.body = this.getResponseHtml(heading, errors, back);\n }\n\n return this.response;\n }", "function getResponse(handleResponse, handleError) {\r\n // reset the result textarea\r\n resultTextarea.value = \"\";\r\n var matches = handleResponse.results;\r\n\r\n for (var i = 0; i < matches.length; i++) {\r\n resultTextarea.value += matches[i];\r\n }\r\n \r\n if (matches.length == 0 || matches == undefined){\r\n matchesCount.innerText = \"No Matches Found\";\r\n } else {\r\n matchesCount.innerText = `${matches.length} match${ matches.length > 1 ? 'es' : '' } found`;\r\n }\r\n // store current values in the storage so user doesn't have to type again when he comes back to popup\r\n storeCurrent();\r\n }", "function successForm(data) {\n\t\t\tvar serverAnswer = $.parseJSON(data);\n\t\t\t$('.callback-form__message').next().text(serverAnswer.result);\n\t\t\tconsole.log(serverAnswer.result);\n\t\t\tif (serverAnswer.result == \"pass\") {\n\t\t\t\t$(\".callback-form__errors\").empty();\n\t\t\t\t$('.callback-form').trigger(\"reset\");\n\t\t\t\t$('.callback-form__button').prop('disabled', false);\n\t\t\t\t$(\".callback-block\").hide(0.607);\n\t\t\t\t$('.сallback-close').hide(0.607);\n\t\t\t\t$(\".callback-status\").show(0.607);\n\t\t\t} else {\n\t\t\t\tvar showError = $('.callback-errors').attr(\"data-errors-server\");\n\t\t\t\t$('.callback-status__message').text(showError);\n\t\t\t\t$(\".callback-block\").hide(0.607);\n\t\t\t\t$(\".callback-status\").show(0.607);\n\t\t\t\tsetTimeout(reloadPage, 5000);\n\t\t\t}\n\t\t}", "function updateResponses() {\n\tvar responseForm = rightPane.querySelector('form[id=\"response-form\"]');\n\tvar name = responseForm.querySelector('input[type=\"text\"]');\n\tvar response = responseForm.querySelector('textarea[type=\"text\"]');\n\tif(name.value && response.value) {\n\t\tappendResponseToResponseList(name.value, response.value);\n\t\texpandQuestion();\n\t}\n }", "function notifyContactForm(responses, form){\n\tvar resultMessages = {\n\t\tsuccess: 'Votre message a été envoyé, merci.',\n\t\tinvalidEmail: 'Erreur&nbsp;: Veuillez entrer une adresse email valide.',\n\t\tmissingFields: 'Erreur&nbsp;: Des champs requis n\\'ont pas été remplis.',\n\t\tinvalidCharacters: 'Erreur&nbsp;: L’email contient des caractères invalides.',\n\t\tfailure: 'Erreur&nbsp;: Votre message n’a pas pu être envoyé, veuillez réessayer plus tard.'\n\t};\n\n\tvar resultBox = form.querySelector('.result-box');\n\tvar fields = form.querySelectorAll('input, textarea');\n\tfields = [].slice.call(fields, 1);\n\n\tresultBox.innerHTML = '';\n\n\tconsole.log(responses);\n\n\tresponses.forEach(function(response){\n\t\tvar newMessage = document.createElement('p');\n\t\tnewMessage.innerHTML = resultMessages[response];\n\t\taddClass(newMessage, 'result-message');\n\n\t\tif(response === 'missingFields' || response === 'invalidEmail' || response === 'invalidCharacters')\n\t\t\taddClass(newMessage, 'error');\n\t\telse\n\t\t\taddClass(newMessage, response);\n\n\t\tresultBox.appendChild(newMessage);\n\n\n\t\tif (response === 'missingFields') {\n\t\t\tforEachNl(fields, function(field){\n\t\t\t\tif (field.value === '' && !hasClass(field.parentNode, 'optionnal')) {\n\t\t\t\t\taddClass(field.parentNode, 'invalid');\n\t\t\t\t} else {\n\t\t\t\t\tremoveClass(field.parentNode, 'invalid');\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (response === 'invalidEmail' || response === 'invalidCharacters') {\n\t\t\taddClass(form.querySelector('.email'), 'invalid');\n\t\t} else {\n\t\t\tforEachNl(fields, function(field){\n\t\t\t\tremoveClass(field.parentNode, 'invalid');\n\t\t\t\tif(response === 'success') {\n\t\t\t\t\tfield.value = '';\n\t\t\t\t\tfield.focus();\n\t\t\t\t\tfield.blur();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}", "function handleEmailResponse(resp) {\n var primaryEmail=''; var displayName=''; var gender=''; var image_url='';\n\t\n\t//console.log(\"---->\"+typeof(resp.emails));\n\t\n\tif (typeof(resp.emails)!=\"undefined\")\n\t{\n\t\t for (var i=0; i < resp.emails.length; i++) {\n\t\t\tif (resp.emails[i].type === 'account') primaryEmail = resp.emails[i].value;\n\t\t }\n\t\t //document.getElementById('responseContainer').value = 'Primary email: ' +\n\t\t // primaryEmail + '\\n\\nFull Response:\\n' + JSON.stringify(resp);\n\t}\n\t\n\tif (typeof(resp.displayName)!=\"undefined\")\n\t{\n\t\tdisplayName=resp.displayName;\n\t}\n\t\n\tif (typeof(resp.gender)!=\"undefined\")\n\t{\n\t\tgender=resp.gender;\n\t}\n\t\n\tif ( typeof(resp.image)!=\"undefined\" && typeof(resp.image.url)!=\"undefined\")\n\t{\n\t\timage_url=resp.image.url;\n\t}\n\t\n\t\n\t//console.log(\"==primaryEmail==>\"+primaryEmail+\"==response==>\"+JSON.stringify(resp));\n\t//console.log(\"displayName=>\"+displayName+\"==gender=>\"+gender+\"==image_url==>\"+image_url);\n\t\n\tif (primaryEmail!='' && gploginbuttonclickedflag==1)\n\t{\n\t\tvar posturl=\"checkgooglepluslogin\";\n\t\tcallcheckemailforgooglepluslogin(primaryEmail,posturl);\n }\n\t\n\t\n }", "function handleAuthenticationResult(req, res, err, user, info) {\n\tif(err) {\n\t\tres.flash('server_error', 'Something went wrong. Please try again', req.body.email);\n\t\treturn res.redirect('/login');\n\t}\n\tif(!user) {\n\t\tres.flash('client_error', 'Invalid credentials', req.body.email);\n\t\treturn res.redirect('/login');\n\t}\n\treq.login(user, function(err) {\n\t\tif(err) {\n\t\t\tres.flash('server_error', 'Something went wrong. Please try again', req.body.email);\n\t\t\treturn res.redirect('/login');\n\t\t}\n\t\tif(res.locals && res.locals.flashMessage && res.locals.flashMessage.type && res.locals.flashMessage.type === 'return_to')\n\t\t\treturn res.redirect(res.locals.flashMessage.returnTo);\n\t\treturn res.redirect('/dashboard');\n\t});\n}", "function GetFormValProcessAndUpdate(currentQuestionNr) {\n\n /// Process challenge form.\n if (formInUse === \"#rpsForm\") {\n switch (currentQuestionNr) {\n case 1:\n $(\"#helperText\").hide();\n\n userToChallenge = CreateUserName(\"#userToChallenge\");\n\n /// Check if account exists and start challenge with users name.\n GetAccount(userToChallenge).then(function (accounts) {\n\n /// Account incorrect (not following steemit guidlines), go back.\n if (accounts.length <= 0) {\n StepBackForm(2, 1);\n }\n\n else {\n challengeString += `<a href=\"https://steemit.com/@${userToChallenge}\">@${userToChallenge}</a>, `;\n GetPosts(); /// Fecth posts from the user to challenge, have them ready for later.\n }\n\n /// Account not found, go back. \n }, function (error) {\n StepBackForm(2, 1);\n });\n\n break;\n case 2:\n reasonForChallenge = Sanitize($(\"input[name=rpsChallengeChoice]:checked\", formInUse).val());\n break;\n case 3:\n /// Create the perm_link for this challenge. Appending in last question.\n permLinkParent = Sanitize($(\"input[name=rpsCUTopic]:checked\", formInUse).val());\n permLink = \"smjnrps-\";\n permLink += permLinkParent;\n var linkDate = Date.now().toString();\n permLink += \"-\" + linkDate.substr(linkDate.length - 3);\n break;\n case 4:\n rpsChoice = Sanitize($(\"input[name=rpsChoice]:checked\", formInUse).val());\n break;\n case 5:\n userName = CreateUserName(\"#userName\");\n\n GetAccount(userName).then(function (accounts) {\n\n /// Account incorrect (not following steemit guidlines), go back.\n if (accounts.length <= 0) {\n StepBackForm(5, 5);\n }\n\n /// Verfied account\n else {\n MakeMD5(\"create\", userName, permLink, rpsChoice).then(function (result) {\n rpsChoiceMD5 = Sanitize(JSON.parse(result).md5);\n AllOKAllowSubmit();\n\n }, function (error) {\n ///TODO\n console.log(error)\n });\n }\n\n /// Account failed as no such user.\n }, function (error) {\n StepBackForm(5, 5);\n console.log(\"User name not found.\");\n });\n break;\n }\n }\n\n // Process response form\n else {\n switch (currentQuestionNr) {\n case 1:\n $(\"#helperText\").hide();\n\n rpsChoice = Sanitize($(\"input[name=rpsChoice]:checked\", formInUse).val());\n\n MakeMD5(\"verify\", userToChallenge, permLink, \"\", rpsChoiceMD5).then(function (result) {\n var rpsChoiceChallenger = Sanitize(JSON.parse(result).rpschoice);\n\n WinnerWinnerRaidPonziOrSteemitDinner(rpsChoiceChallenger, rpsChoice);\n\n challengeString += `<a href=\"https://steemit.com/@${userToChallenge}\">@${userToChallenge}</a>, I accept. Let's go! Winner Winner Raid Ponzi or Steemit Dinner! <b>${userToChallenge}</b> throws ...`;\n\n if (winner != \"draw\") actualResponse = `<a href=\"https://steemit.com/@${userToChallenge}\">@${userToChallenge}</a>, I accept. Let's go! Winner Winner Raid Ponzi or Steemit Dinner?! <b>${userToChallenge}</b> throws <b>${rpsChoiceChallenger}</b>, <b>${userName}</b> repels with <b>${rpsChoice}</b>. Winner is <b>${winner}</b>!`;\n else actualResponse = `<a href=\"https://steemit.com/@${userToChallenge}\">@${userToChallenge}</a>, I accept. Let's go! Winner Winner Raid Ponzi or Steemit Dinner?! <b>${userToChallenge}</b> throws <b>${rpsChoiceChallenger}</b>, ${userName}</b> repels with <b>${rpsChoice}</b>. It's a <b>${winner}</b>!`;\n\n permLinkParent = permLink;\n permLink = \"re-\";\n permLink += permLinkParent;\n\n AllOKAllowSubmit();\n }, function (error) {\n ///TODO\n console.log(error)\n });\n break;\n }\n }\n }", "respond2faChallenge(user_input, challenge_id) {\n var sixDigits = new RegExp(\"\\\\d{6}\");\n var self = this\n return new Promise((resolve, reject) => {\n if(sixDigits.test(user_input)){ // validate format of the sms token\n self.post(\n {\n uri: _apiUrl + \"challenge/\"+ challenge_id+ \"/respond/\",\n form: { \"response\" : parseInt(user_input) }\n },\n function (err, httpResponse, body) {\n if (err) {\n reject(err)\n throw err;\n }else{\n if (body.detail == \"Challenge response is invalid.\"){\n reject(new Error(\"The 2FA code you entered was incorrect.\"))\n }else{\n resolve(body)\n }\n }\n })\n }else{\n reject(new Error(\"Invalid User Input: \" + user_input))\n }\n });\n }", "function setUserResponse(val) {\n\t\t\tvar UserResponse = '<p class=\"userEnteredText\">'+val+'</p><div class=\"clearfix\"></div>';\n\t\t\t$(UserResponse).appendTo('#result_div');\n\t\t\t$(\"#chat-input\").val('');\n\t\t\tscrollToBottomOfResults();\n\t\t\tshowSpinner();\n\t\t}", "function validateUserResponse() {\n\n console.log('VALIADATION');\n\n // If answer was correct, animate transition to next card\n if (currentcard['french'] === $('#firstField').val()) {\n\n acceptAnswer();\n } else {\n // show solution\n animateShake();\n revealSolution();\n }\n}", "function handleResponse(res) {\n if (res.processing) {\n console.log(`${res.filename}:`, res.processing)\n\n if (res.processing > -1) {\n poll(res.filename);\n } else {\n $('#loading').hide();\n }\n }\n\n if (!res.message) {\n return;\n }\n\n console.log(`${res.filename}:`, res.message)\n\n clearDialog();\n\n const messageId = res.filename.replace(/\\./g, '_');\n\n const textarea = $('#textarea');\n const buttonarea = $('#buttonarea');\n const lists = $('#lists');\n\n if (res.message.success !== undefined) {\n if (res.message.success) {\n textarea.append(textElement('Success!'));\n } else {\n textarea.append(textElement('Failed!'));\n }\n }\n\n if (res.message.lat && res.message.lon) {\n map.panTo(new L.LatLng(res.message.lat, res.message.lon));\n\n poll();\n return;\n }\n\n const mapList = (res.message.list || []).sort((a, b) => a.split('@')[1].localeCompare(b.split('@')[1]));\n\n $('#loading').hide();\n\n if (res.message.text) {\n let text = textElement(res.message.text), form, buttons;\n\n switch (res.filename) {\n // The various actions required in response to server messages are defined here.\n\n // == add_location ==\n\n // • message id: add_location.1\n // • text: There is an already added location, and it is not allowed to add further locations. If you want to add a new location, the already existing location will automatically removed. If you want to store the already existing location, save manually (refer to the manual, please). Do you want to add a new location? If yes, click OK.\n // • expectation: A request file with yes or no text.\n // • consequence:\n // - If answer is NO, then add_location send a message and when the message is acknowledged, exit: => add_location.3\n // - If answer is YES: => add_location.4\n case 'add_location.1.message':\n buttons = [\n buttonElement('Yes').click(() => {\n reply('yes', true);\n }),\n buttonElement('No').click(() => {\n reply('no', true);\n })\n ];\n break;\n\n // • message id: add_location.2\n // • text: No valid location found. First have to add a location to the dataset. Without such location, CityApp will not work. Adding a new location may take a long time, depending on the file size. If you want to continue, click Yes.\n // • expectation: A request file with yes or no text.\n // • consequence:\n // - If answer is NO, then add_location send a message and when the message is acknowledged, exit: => add_location.3\n // - If answer is YES: => add_location.4\n\n case 'add_location.2.message':\n buttons = [\n buttonElement('Yes').click(() => {\n reply('yes', true);\n }),\n buttonElement('No').click(() => {\n reply('no', true);\n })\n ];\n break;\n\n // • message id: add_location.3\n // • text: Exit process, click OK.\n // • expectation: A request file with OK text\n // • consequence: Module exit when message is acknowledged\n case 'add_location.3.message':\n buttons = [\n buttonElement('OK').click(() => {\n reply('ok', false);\n clearDialog();\n })\n ];\n break;\n\n // • message id: add_location.4\n // • text: Select a map to add to CityApp. Map has to be in Open Street Map format -- osm is the only accepted format.\n // • expectation: Finding an uploaded osm file in data_from_browser directory. Request file is not expected, and therefore it is not neccessary to create.\n // • consequence: No specific consequences\n case 'add_location.4.message':\n form = formElement(messageId);\n form.append($(`<input id=\"${messageId}-input\" type=\"file\" name=\"file\" />`));\n buttons = [\n buttonElement('Submit').click(() => {\n $(`#${messageId}-error`).remove();\n const input = $(`#${messageId}-input`);\n if (input[0].files.length) {\n upload(form[0], handleResponse);\n } else {\n textarea.append($(`<span id=\"${messageId}-error\" class=\"validation-error\">Please choose a file for upload.</span>`));\n }\n })\n ];\n break;\n\n // • message id: add_location.5\n // • text: New location is set. To exit, click OK.\n // • expectation: A request file with OK text\n // • consequence: Module exit when message is acknowledged\n case 'add_location.5.message':\n buttons = [\n buttonElement('OK').click(() => {\n reply('ok', false);\n clearDialog();\n })\n ];\n break;\n\n // == make_selection ==\n\n // • message id: make_selection.1\n // • text: No valid location found. First have to add a location to the dataset. Without such location, CityApp will not work. To add a location, use Add Location menu. Now click OK to exit.\n // • expectation: A request file with OK text\n // • consequence: Module exit when message is acknowledged\n case 'make_selection.1.message':\n buttons = [\n buttonElement('OK').click(() => {\n reply('ok', false);\n clearDialog();\n })\n ];\n break;\n\n // • message id: make_selection.2\n // • text: Now zoom to area of your interest, then use drawing tool to define your location. Next, save your selection.\n // • expectation: Finding an uploaded goejson file in data_from_browser directory. This file is created by the browser, when the user define interactively the selection area. Request file is not expected, and therefore it is not neccessary to create.\n // • consequence: No specific consequences\n case 'make_selection.2.message':\n buttons = [\n buttonElement('Save').click(() => {\n $(`#${messageId}-error`).remove();\n const success = saveDrawing();\n if (!success) {\n textarea.append($(`<span id=\"${messageId}-error\" class=\"validation-error\">Please draw a polygon using the map’s drawing tool.</span>`));\n }\n })\n ];\n break;\n\n // • message id: make_selection.3\n // • text: Process finished, selection is saved. To process exit, click OK.\n // • expectation: A request file with OK text\n // • consequence: Module exit when message is acknowledged\n case 'make_selection.3.message':\n buttons = [\n buttonElement('OK').click(() => {\n reply('ok', false);\n clearDialog();\n })\n ];\n break;\n\n // == resolution_setting ==\n\n // • message id: resolution_setting.1\n // • text: Type the resolution in meters, you want to use. For further details see manual.\n // • expectation: A request file with a positive number.\n // • consequence: If user gives a negative number, then UNTIL number is greater than zero: => resolution_setting.2\n case 'resolution_setting.1.message':\n form = formElement(messageId);\n form.append($(`<input id=\"${messageId}-input\" type=\"number\" />`));\n buttons = [\n buttonElement('Submit').click(() => {\n $(`#${messageId}-error`).remove();\n const input = $(`#${messageId}-input`);\n if (!isNaN(parseInt(input.val()))) {\n reply(input.val(), true);\n } else {\n textarea.append($(`<span id=\"${messageId}-error\" class=\"validation-error\">Please enter a numeric value.</span>`));\n }\n })\n ];\n break;\n\n // • message id: resolution_setting.2\n // • text: Resolution has to be an integer number, greater than 0. Please, define the resolution for calculations in meters.\n // • expectation: A request file with a positive number.\n // • consequence: No specific consequences\n case 'resolution_setting.2.message':\n form = formElement(messageId);\n form.append($(`<input id=\"${messageId}-input\" type=\"number\" />`));\n buttons = [\n buttonElement('Submit').click(() => {\n $(`#${messageId}-error`).remove();\n const input = $(`#${messageId}-input`);\n if (!isNaN(parseInt(input.val()))) {\n reply(input.val(), true);\n } else {\n textarea.append($(`<span id=\"${messageId}-error\" class=\"validation-error\">Please enter a numeric value.</span>`));\n }\n })\n ];\n break;\n\n case 'resolution_setting.3.message':\n buttons = [\n buttonElement('OK').click(() => {\n reply('ok', false);\n clearDialog();\n })\n ];\n break;\n\n // == add_map ==\n\n // • message id: add_map.1\n // • text: \"Selection\" map not found. Before adding a new layer, first you have to define a location and a selection. For this end please, use Location Selector tool of CityApp. Add_Map modul now quit.\n // • expectation: A request file with text OK\n // • consequence: Since no valid selection, the module exit after the user acknowledge the message.\n case 'add_map.1.message':\n buttons = [\n buttonElement('OK').click(() => {\n reply('ok', true);\n })\n ];\n break;\n\n // • message id: add_map.2\n // • text: Select a map to add CityApp. Only gpkg (geopackage), geojson and openstreetmap vector files and geotiff (gtif or tif) raster files are accepted.\n // • expectation: An uploaded file with a supported filename extension in data_from_browser directory. Request file is not expected, the question is only to draw the user's focus to the next step (select a file). Therefore in this case the trigger for the back-end is the presence of the uploaded file (and not a request file)\n // • consequence: When the selected file is uploaded succesfully, there is a new message: => add_map.3\n case 'add_map.2.message':\n form = formElement(messageId);\n form.append($(`<input id=\"${messageId}-input\" type=\"file\" name=\"file\" />`));\n buttons = [\n buttonElement('Submit').click(() => {\n $(`#${messageId}-error`).remove();\n const input = $(`#${messageId}-input`);\n if (input[0].files.length) {\n upload(form[0], handleResponse);\n } else {\n textarea.append($(`<span id=\"${messageId}-error\" class=\"validation-error\">Please choose a file for upload.</span>`));\n }\n })\n ];\n break;\n\n // • message id: add_map.3\n // • text: Please, define an output map name. Name can contain only english characters, numbers, or underline character. Space and other specific characters are not allowed. For first character a letter only accepted.\n // • expectation: a request file with a single word as output name, defined by the user\n case 'add_map.3.message':\n form = formElement(messageId);\n form.append($(`<input id=\"${messageId}-input\" type=\"text\" />`));\n buttons = [\n buttonElement('Submit').click(() => {\n $(`#${messageId}-error`).remove();\n const input = $(`#${messageId}-input`);\n if (input.val()) {\n reply(input.val(), true);\n } else {\n textarea.append($(`<span id=\"${messageId}-error\" class=\"validation-error\">Please enter a name.</span>`));\n }\n })\n ];\n break;\n\n // • message id: add_map.4\n // • text: Selected map is now succesfully added to your mapset. Add map module now exit\n // • expectation: A request file with text OK\n // • consequence: Module exit after user acknowledge the message.\n case 'add_map.4.message':\n buttons = [\n buttonElement('OK').click(() => {\n reply('ok', false);\n clearDialog();\n })\n ];\n break;\n\n // == module_1 ==\n\n // • message id: module_1.1\n // • text: Start points are required. Do you want to draw start points on the basemap now? If yes, click Yes, then draw one or more point and click Save button. If you want to use an already existing map, select No.\n // • expectation: request file with text Yes or No\n // • consequence:\n // - If answer is \"yes\", the module is waiting for a geojson file in data_from_browser. Module only goes to the next step, when geojson file is created.\n // - If answer is \"no\", module send a new message: => module_1.2\n case 'module_1.1.message':\n buttons = [\n buttonElement('Yes').click(() => {\n reply('yes', false);\n const saveButton = buttonElement('Save').click(() => {\n saveDrawing();\n })\n buttonarea.append(saveButton);\n }),\n buttonElement('No').click(() => {\n reply('no', true);\n })\n ];\n break;\n\n // • message id: module_1.2\n // • text: Select a map (only point maps are supported). Avilable maps are:\n // • expectation: request file with the select item only.\n // Since „message.module_1.2” containes a list in json format (list items are the availabe maps), user has to select one of them. The modal type is select, therefore the answer (new request file) conatains only the selected item (in this case: a map name). It is not expected to create a separate request file containig \"yes\".\n // ----\n // • message id: module_1.4\n // • text: Select a map (only point maps are supported). Avilable maps are:\n // • expectation: request file with the select item only.\n // Since „message.module_1.4” containes a list in json format (list items are the availabe maps), user has to select one of them. The modal type is select, therefore the answer (new request file) conatains only the selected item (in this case: a map name). It is not expected to create a separate request file containig \"yes\".\n // ----\n // • message id: module_1.6\n // • text: Select a map (only point maps are supported). Avilable maps are:\n // • expectation: request file with the select item only\n // Since „message.module_1.6” containes a list in json format (list items are the availabe maps), user has to select one of them. The modal type is select, therefore the answer (new request file) conatains only the selected item (in this case: a map name). It is not expected to create a separate request file containig \"yes\".\n // ----\n // • message id: module_1.8\n // • text: Select a map (only area maps are supported). Avilable maps are:\n // • expectation: request file with the select item only\n // Since „message.module_1.8” containes a list in json format (list items are the availabe maps), user has to select one of them. The modal type is select, therefore the answer (new request file) conatains only the selected item (in this case: a map name). It is not expected to create a separate request file containig \"yes\"\n case 'module_1.2.message':\n case 'module_1.4.message':\n case 'module_1.6.message':\n case 'module_1.8.message':\n form = formElement(messageId);\n\n // TODO: add maps\n lists.append($(`<select id=\"${messageId}-input\" size=\"10\">` +\n mapList.map(map => `<option selected value=\"${map}\">${map}</option>`) +\n `</select>`));\n buttons = [\n buttonElement('Submit').click(() => {\n const input = $(`#${messageId}-input`);\n reply(input[0].value, true);\n })\n ];\n break;\n\n // • message id: module_1.3\n // • text: Via points are optional. If you want to select 'via' points from the map, click Yes. If you want to use an already existing map, select No. If you do not want to use via points, click Cancel.\n // • expectation: request file with text yes or no or cancel.\n // • consequence:\n // - If answer is \"yes\", the module is waiting for a geojson file in data_from_browser. Module only goes to the next step, when geojson file is created.\n // - If answer is \"no\", module send a new message: => module_1.4\n // - If answer is \"cancel\": => module_1.5\n // ----\n // • message id: module_1.5\n // • text: Target points are required. If you want to select target points from the map, click Yes. If you want to use an already existing map containing target points, click No. If you want to use the default target points map, click Cancel.\n // • expectation: request file with text yes or no or cancel.\n // • consequence:\n // - If answer is \"yes\", the module is waiting for a geojson file in data_from_browser. Module only goes to the next step, when geojson file is created.\n // - If answer is \"no\", module send a new message: => module_1.6\n // - If answer is \"cancel\": => module_1.7\n // ----\n // • message id: module_1.7\n // • text: Optionally you may define stricken area. If you want to draw area on the map, click Yes. If you want to select a map already containing area, click No. If you do not want to use any area, click Cancel.\n // • expectation: request file with text yes or no or cancel.\n // • consequence:\n // - If answer is \"yes\", the module is waiting for a geojson file in data_from_browser. Module only goes to the next step, when geojson file is created.\n // - If answer is \"no\", module send a new message: => module_1.8\n // - If answer is \"cancel\": => module_1.9\n case 'module_1.3.message':\n case 'module_1.5.message':\n case 'module_1.7.message':\n buttons = [\n buttonElement('Yes').click(() => {\n reply('yes', false);\n const saveButton = buttonElement('Save').click(() => {\n saveDrawing();\n })\n buttonarea.append(saveButton);\n }),\n buttonElement('No').click(() => {\n reply('no', true);\n }),\n buttonElement('Cancel').click(() => {\n reply('cancel', true);\n })\n ];\n break;\n\n // • message id: module_1.9\n // • text: Do you want to set the speed on the road network? If not, the current values will used.\n // • expectation: request file with a single yes or no.\n // • consequence: If answer is \"yes\", there is a new message: => module_1.10\n case 'module_1.9.message':\n buttons = [\n buttonElement('Yes').click(() => {\n reply('yes', true);\n }),\n buttonElement('No').click(() => {\n reply('no', true);\n })\n ];\n break;\n\n // • message id: module_1.12\n // • text: Set speed for roads of stricken area.\n // • expectation: reqest file with single a floating point numeric value\n case 'module_1.12.message':\n form = formElement(messageId);\n form.append($(`<input id=\"${messageId}-input\" type=\"number\" />`));\n buttons = [\n buttonElement('Submit').click(() => {\n const input = $(`#${messageId}-input`);\n reply(input.val(), true);\n })\n ];\n break;\n\n // • message id: module_1.14\n // • text: Calculations are ready, display output time maps.\n // • expectation: A request file with a single \"OK\" word\n // • consequence: After the user acknowledge the message, the module exit.\n case 'module_1.14.message':\n buttons = [\n buttonElement('OK').click(() => {\n reply('ok', false);\n clearDialog();\n })\n ];\n break;\n \n // == module_2b ==\n\n // • message id: module_2b.1\n // • text: If you want to use an existing map as query area, click 'Map' button, then draw the area, and click 'Save'. If you want to draw a new query area, click 'Draw' button. If you want to exit, click 'Cancel'.\n // • expectation: request file with text \"map\", \"draw\" or \"cancel\"\n // • consequence:\n // - If answer is \"draw\", the module is waiting for a geojson file in data_from_browser. Module only goes to the next step, when geojson file is created.\n // - If answer is \"map\", module send a new message: => module_2b.2\n // - If answer is cancel, module exit.\n case 'module_2b.1.message':\n buttons = [\n buttonElement('Draw').click(() => {\n reply('draw', false);\n const saveButton = buttonElement('Save').click(() => {\n saveDrawing();\n })\n buttonarea.append(saveButton);\n }),\n buttonElement('Cancel').click(() => {\n reply('cancel', true);\n })\n ];\n break;\n \n // • message id: module_2b.2\n // • text: To process exit, click OK.\n // • expectation: A request file with a single \"OK\" word\n // • consequence: After the user acknowledge the message, the module exit.\n case 'module_2b.2.message':\n buttons = [\n buttonElement('OK').click(() => {\n reply('ok', false);\n clearDialog();\n })\n ];\n break;\n\n\n }\n textarea.append(text);\n\n if (form) {\n textarea.append(form);\n }\n\n if (buttons) {\n buttons.forEach((button) => {\n buttonarea.append(button);\n });\n }\n }\n}", "function handleOk () {\n validateFields((errors) => {\n if (errors) {\n return\n }\n const data = { ...getFieldsValue() }\n onOk({\n id: help.id || '',\n ...data,\n })\n })\n }", "function processForm(req, res){\n var form = new formidable.IncomingForm();\n\n //parse form\n form.parse(req, function (err, fields){\n\n //add a dummy id to the return value\n fields.id = '123456';\n\n //add the response code\n res.writeHead(201, {\n 'content-type' : 'text/plain'\n });\n\n //Create a string containing the body in json, no spaces\n var data = JSON.stringify({\n fields: fields\n });\n\n res.end(data);\n\n console.log('posted fields :\\n');\n console.log('The data as string ', data);\n console.log('The data as Json ', util.inspect({\n fields: fields\n }));\n });\n}", "function on_return_secret(data, sender, sendResponse) {\n var fill_field_helper = function (field, value) {\n if (field === null) {\n return;\n }\n if (typeof value === \"undefined\" || value === \"\") {\n return;\n }\n\n // trigger click event\n var clickEvent = new MouseEvent(\"click\", {\n view: window,\n bubbles: true,\n cancelable: true,\n });\n field.dispatchEvent(clickEvent);\n\n // fill value\n field.value = value;\n\n // trigger 'input' event\n const inputEvent = new Event(\"input\", { bubbles: true });\n field.dispatchEvent(inputEvent);\n\n // jQuery event triggering is not working for angular apps\n if (\"createEvent\" in document) {\n var evt = document.createEvent(\"HTMLEvents\");\n evt.initEvent(\"change\", false, true);\n field.dispatchEvent(evt);\n } else {\n field.fireEvent(\"onchange\");\n }\n };\n\n for (var i = 0; i < myForms.length; i++) {\n if (\n (myForms[i].username && myForms[i].username.isEqualNode(lastRequestElement)) ||\n (myForms[i].password && myForms[i].password.isEqualNode(lastRequestElement))\n ) {\n fill_field_helper(myForms[i].username, data.website_password_username);\n fill_field_helper(myForms[i].password, data.website_password_password);\n\n for (var ii = 0; ii < dropInstances.length; ii++) {\n dropInstances[ii].close();\n }\n dropInstances = [];\n break;\n }\n }\n }", "async propagateAnswer() {\n if (!this.dlg) {\n assert(this.ep);\n this.dlg = await this.srf.createUAS(this.req, this.res, {localSdp: this.ep.local.sdp});\n this.logger.debug('answered call');\n this.dlg.on('destroy', this._callerHungup.bind(this));\n this.wrapDialog(this.dlg);\n this.dlg.callSid = this.callSid;\n this.emit('callStatusChange', {sipStatus: 200, callStatus: CallStatus.InProgress});\n\n this.dlg.on('modify', this._onReinvite.bind(this));\n\n this.logger.debug(`CallSession:propagateAnswer - answered callSid ${this.callSid}`);\n }\n }", "async function handleReturn() {\n if (\n name !== \"\" ||\n cpf_cnpj !== \"\" ||\n rg !== \"\" ||\n phone !== \"\" ||\n email !== \"\"\n ) {\n confirmationAlert(\n \"Atenção!\",\n \"Deseja realmente VOLTAR para a página de consulta de pessoas? Os dados não salvos serão perdidos.\",\n \"returnPageConsult\"\n );\n } else {\n returnPageConsult();\n }\n }", "onDialogResponse(event) {\n let dialogId = event.dialogid;\n if (!this.dialogs_.hasOwnProperty(dialogId))\n return;\n\n // Resolve the promise with the relevant data from the event.\n this.dialogs_[dialogId].resolve({\n response: event.response,\n listitem: event.listitem,\n inputtext: event.inputtext.trim()\n });\n\n delete this.playerDialogs_[event.playerid];\n delete this.dialogs_[dialogId];\n }", "function contactFormResponse(response) {\n\n if (response == '') { \n\t //alert(response);\n alert('Houve um problema no envio da mensagem. Por favor, envie-a diretamente por e-mail ([email protected]).');\n } else \t{\n alert('Obrigado pela mensagem! Em breve nós entraremos em contato.');\n\t document.location.href = \"http://www.trajettoria.com\";\n\t}\n } // contactFormResponse", "async getResponse(req) {\n\t\tif (req.query.replyType === \"valid\") {\n\t\t\treturn { response: \"test data\" };\n\t\t} else {\n\t\t\treturn { invalid: 1 };\n\t\t}\n\t}", "function processResponse(err, response) {\n if (err) {\n console.error(err); // something went wrong\n return;\n }\n\n // Display the output from dialog, if any.\n if (response.output.text.length != 0) {\n console.log(response.output.text[0]);\n }\n}", "function ajaxHandleResponses(s,jqXHR,responses){var contents=s.contents,dataTypes=s.dataTypes,responseFields=s.responseFields,ct,type,finalDataType,firstDataType; // Fill responseXXX fields\n\tfor(type in responseFields){if(type in responses){jqXHR[responseFields[type]]=responses[type];}} // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"content-type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType=dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}} // Or just use first one\n\tfinalDataType=finalDataType||firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}} // Chain conversions given the request and the original response", "function handlePrompt(err, result) {\n const timestamp = Date.now()\n const date = timeUtils.getUserDateString(timestamp, timezone)\n\n messageText = result.sugarinfoAI\n console.log('(\"exit\" to quit) > ' + messageText)\n if (messageText !== 'exit') {\n //\n // Proxy the user's input to our message text processor (that uses Wit etc.)\n //\n const userRef = firebase.database().ref(\"/global/sugarinfoai/\" + userId)\n if (messageText.toLowerCase() === 'd-start7') {\n userRef.child('profile').update({challenge: 'in progress'})\n return 'Challenge in progress.'\n }\n else if (messageText.toLowerCase() === 'd-stop7') {\n userRef.child('profile').update({challenge: 'stopped'})\n return 'Challenge stopped.'\n }\n return mtp.msgTxtProcessor(firebase, messageText, userId,\n favorites, timezone, name, timestamp, date)\n .then((result) => {\n console.log(result)\n return letsPrompt()\n })\n .catch(error => {\n console.log('msgTxtProcessor: ', error)\n return\n })\n } else {\n return\n }\n}", "function processResponse(){\n //\n }", "function handleServerDialogResponse(event) {\r\n var dialogResponse = event.response;\r\n\r\n // if dialog was a confirmation and they select false (cancel), just return\r\n var confirmationDialog = event.data.confirmation;\r\n if (confirmationDialog && (dialogResponse === 'false')) {\r\n return;\r\n }\r\n\r\n var $triggerAction = jQuery('#' + event.data.triggerActionId);\r\n if (!$triggerAction.length) {\r\n return;\r\n }\r\n\r\n var request = new KradRequest($triggerAction);\r\n\r\n request.additionalData.returnDialogId = event.dialogId;\r\n request.additionalData.returnDialogResponse = dialogResponse;\r\n request.additionalData.returnFromDialog = true;\r\n request.confirmDialogId = null;\r\n\r\n request.send();\r\n}", "function handleOk () {\n validateFields((errors) => {\n if (errors) {\n return\n }\n const data = { ...getFieldsValue() }\n if (!rcHospi.hospitalCode) {\n Modal.info({\n content: '医院不存在编号,请重新选择医院!',\n })\n return false\n }\n onOk({\n uid: rcHospi.uid || '',\n ...data,\n hospitalCode: rcHospi.hospitalCode,\n })\n })\n }", "function received_authentication(authentication_res, res, user_input, request_sent_time) {\n authentication_res.setEncoding(\"utf8\");\n let body = \"\";\n authentication_res.on(\"data\", data => {body += data;});\n authentication_res.on(\"end\", () =>{\n let authentication_res_data = JSON.parse(body);\n authentication_res_data.expiration = new Date(request_sent_time.getTime() + 3600).toLocaleTimeString('en-Us');\n create_cache(authentication_res_data);\n create_search_req(authentication_res_data,res,user_input, request_sent_time);\n });\n}", "function handleAnswerOnScreen(res, app) {\n if (res.length == 0) {\n app.ask(RESPONSE_NO_OFFER_MATCHING[lang]);\n } else if (res.length == 1) {\n showOneOffer(app, res[0], RESPONSE_THIS_OFFER_MATCHES[lang]);\n } else if (res.length > 1 && res.length <= 10) {\n answerWithCarousel(app, res);\n } else if (res.length > 10 && res.length <= 30) {\n answerWithList(app, res);\n } else if (res.length > 30) {\n app.ask(RESPONSE_TOO_MANY_OFFERS[lang]);\n }\n}", "function success(){\n var msgHost = document.getElementById('response');\n let formWrapper = document.getElementById('form-content');\n let response = JSON.parse(this.responseText);\n \n switch(response.status){\n case 200:\n msgHost.style.backgroundColor = \"green\"; \n msgHost.innerHTML = response.msg;\n break;\n case 201:\n msgHost.style.backgroundColor = \"green\";\n msgHost.innerHTML = response.msg;\n formWrapper.innerHTML = generateForm(response.content);\n validate();\n break;\n case 300:\n msgHost.innerHTML = `${response.msg}`;\n break;\n case 400:\n msgHost.innerHTML = `${response.msg}`;\n break;\n case 403:\n msgHost.style.backgroundColor = \"red\";\n msgHost.innerHTML = `Invalid Call Number`;\n formWrapper.innerHTML = generateForm(response.content);\n validate();\n break;\n case 404:\n msgHost.style.backgroundColor = \"red\";\n msgHost.innerHTML = `No record of stack with id: ${response.id}`;\n formWrapper.innerHTML = generateForm(response.content);\n validate();\n break;\n }\n \n msgHost.classList = 'response show';\n setTimeout(function(){\n msgHost.classList = \"response hide\";\n }, 3000);\n}", "function processResponse(err, response) {\n if (err) {\n console.error(err); // something went wrong\n return;\n }\n\n // var endConversation = false;\n \n // // Check for action flags.\n \n // console.log(response.output.text[0]);\n\n // // If we're not done, prompt for the next round of input.\n // if (!endConversation) {\n // var newMessageFromUser = prompt('>> ');\n // conversation.message({\n // input: { text: newMessageFromUser },\n // // Send back the context to maintain state.\n // context : response.context,\n // }, processResponse)\n // }\n}", "function submitUser() {\n var data = {}\n if (form.email.value) data.email = form.email.value\n if (form.password.value) data.password = form.password.value\n\n if (!data.email) return displayError('Must provide email')\n if (!data.password) return displayError('Must provide password')\n if (data.password !== form.confirm.value) return displayError('Passwords do not match')\n\n fetch('/register', {\n headers: {\n 'Content-Type': 'application/json',\n },\n method: 'POST',\n body: JSON.stringify(data)\n }).then(submitSuccess)\n .then(window.location = '/') //was /welcome before\n .catch(submitError)\n}", "function callback(response) {\n\n newsLetterResponseEms = response;\n\n isSuccessResponseEms = response.isSuccess;\n\n errorReponseEms = response.error;\n\n console.log(\"isSuccessResponseEms : \" + isSuccessResponseEms);\n\n if (isSuccessResponseEms) {\n\n $j('#formNewsLetterEms').removeClass().addClass('news-success');\n\n var emailInput = document.getElementById(\"emailEms\");\n\n emailInput.value = \"\";\n document.getElementById(\"news-info-ems\").innerHTML = \"\";\n document.getElementById(\"news-info-ems\").innerHTML = errorReponseEms;\n\n console.log(\"Ems errorReponseEms : \" + errorReponseEms);\n\n\n\n } else {\n\n $j('#formNewsLetterEms').removeClass().addClass('news-error');\n\n document.getElementById(\"news-info-ems\").innerHTML = \"\";\n document.getElementById(\"news-info-ems\").innerHTML = errorReponseEms;\n\n console.log(\"Ems errorReponseEms : \" + errorReponseEms);\n\n }\n\n }", "populateForm() {\n let bodyData = {'email': localStorage.getItem('useremail') };\n let fetchData = {\n method: 'POST',\n body: JSON.stringify(bodyData),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': 'Bearer ' + localStorage.getItem('token')\n }\n };\n return this.fetch(process.env.BackendUrl + '/user/', fetchData)\n .then((response) => response.json())\n .then((data) => {\n console.log('did I get a user or not?');\n console.log(data[0]);\n if (data[0] !== undefined) {\n document.getElementsByClassName('uprofFirstName')[0].value = data[0].first_name;\n document.getElementsByClassName('uprofLastName')[0].value = data[0].last_name;\n document.getElementsByClassName('uprofAff')[0].value = data[0].affiliation;\n document.getElementsByClassName('uprofOrganisms')[0].value = data[0].organisms;\n document.getElementsByClassName('uprofInterests')[0].value = data[0].interests;\n document.getElementsByClassName('uprofEmail')[0].value = data[0].email;\n this.uid = data[0]._id;\n document.getElementsByClassName('UserProfileForm')[0].style.display = 'block';\n } else {\n console.log('no user');\n document.getElementsByClassName('UserProfileForm')[0].style.display = 'none';\n window.location.href = process.env.FrontendUrl + '/';\n }\n });\n }", "function getResponse(currForm, action, response, terminator){\n\n var rd = document.createElement('div');\n\n // get header result\n rd.appendChild(getHeaderDom('Result'));\n var br = document.createElement('BR');\n rd.appendChild(br);\n\n var data = JSON.stringify(response, 0, 4);\n\n var pre = document.createElement('pre');\n pre.setAttribute('class', 'terminus-api-view terminus-scheme-pre');\n pre.innerHTML = data;\n\n var cm = stylizeCodeDisplay(terminator, pre, rd, 'javascript');\n if(!cm) rd.appendChild(pre);\n\n var br = document.createElement('BR');\n rd.appendChild(br);\n\n currForm.appendChild(rd);\n\n return currForm;\n}", "function validateUser(){\n response = function(responseText){\n if (responseText==\"1\") {\n getCurrentUser(); //call function to get currentUser\n }\n else {\n //window.location.href=\"login.html\";\n console.log(responseText);\n }\n };\n submit(\"key=validate&userType=applicant\");\n}", "function handleServerResponse(data){ \n let dictionary = getCurrentDictionary();\n console.log(\"25555\", dictionary);\n if (data.success){\n appendNewEmployee(data.employee);\n cleanInputFields();\n $(\"input[name='CIN']\").focus();\n showSuccessMessage(dictionary[\"SAVED_SUCCESS\"]);\n } else {\n let message = dictionary[\"ERROR_WHILE_PROCESSING\"];\n if (data && data.error) message = data.error.message;\n if (message.includes(\"CIN\")){\n message = dictionary[\"CIN_ALREADY_USED\"];\n $(\"input[name='CIN']\").val('');\n }\n showErrorMessage(message); \n }\n }", "function callback(response) {\n\n newsLetterResponseEms = response;\n\n isSuccessResponseEms = response.isSuccess;\n\n errorReponseEms = response.error;\n\n console.log(\"isSuccessResponseEms : \" + isSuccessResponseEms);\n\n if (isSuccessResponseEms) {\n\n $j('#formNewsLetterEms').removeClass().addClass('news-success');\n\n var emailInput = document.getElementById(\"emailEms\");\n\n emailInput.value = \"\";\n document.getElementById(\"news-info-ems\").innerHTML = errorReponseEms;\n console.log(\"Ems errorReponseEms : \" + errorReponseEms);\n\n } else {\n\n $j('#formNewsLetterEms').removeClass().addClass('news-error');\n\n document.getElementById(\"news-info-ems\").innerHTML = \"\";\n document.getElementById(\"news-info-ems\").innerHTML = errorReponseEms;\n\n console.log(\"Ems errorReponseEms : \" + errorReponseEms);\n\n }\n\n }", "function processRefreshChoice(result) {\n\tconsole.log(\"result: \" + result);\n \n\t// getting the response and the http code\n\tvar js = JSON.parse(result);\n\tconsole.log(js);\n \n\t// getting the JSON object\n \tvar status = js[\"httpCode\"];\n \tvar choice = js[\"choice\"];\n\tvar isCompleted = choice[\"isCompleted\"];\n \t\n \n\tif (status == 200) {\n\t\tif(isCompleted == false){\n\t\t\tdisplayUncompletedChoice(choice);\n\t\t}\n\t\telse{\n\t\t\tvar formMessage = document.getElementById(\"SignInMessage\");\n\t\t\tformMessage.innerHTML = \"The choice is already Complete\";\n\t\t\tdisplayCompletedChoice(choice, null);\n\t\t}\n\t}\n}", "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('otp');\n\t\t\t\t//workflow on new user or existing user need to be added here\n\t\t\t\t//api need to return is the user is new or old\n\t\t\t}else{\n\t\t\t\t//wrong otp\n\t\t\t\t//otp authentication failed\n\t\t\t}\n\t\t}", "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('otp');\n\t\t\t\t//workflow on new user or existing user need to be added here\n\t\t\t\t//api need to return is the user is new or old\n\t\t\t}else{\n\t\t\t\t//wrong otp\n\t\t\t\t//otp authentication failed\n\t\t\t}\n\t\t}", "function extractResponse() {\n // parse user login name, add it to the html\n setLoginName(validUserNameJason.login);\n // create html for repositories, pass repos url api and number of repositories\n setRepositories(validUserNameJason.repos_url, validUserNameJason.public_repos);\n // create html for followers repositories, pass followers url api and number of followers\n setFollowers(validUserNameJason.followers_url, validUserNameJason.followers);\n // show the user info html the was generated from the response\n let userSection = document.getElementById(\"userInfo\");\n showElement(userSection);\n }", "function reask() {\n cb.call(surveyResponse, null, surveyResponse, responseLength);\n }", "function chimpResponce(resp) {\r\n \t\tif (resp.result === 'success') { \t\t\t\r\n \t\t\tprocessing('loading', 'icon');\r\n\t\t\t$('#mc_submit').removeAttr('disabled', 'disabled');\r\n\t $('#submit_form #mc-email').val('');\r\n \t\t\t$('#error_msg').hide();\r\n \t\t\t$('#success_msg').show();\r\n\t }else{\t\t\r\n \t\t\tprocessing('loading', 'icon');\r\n \t\t\t$('#success_msg').hide();\r\n \t\t\t$('#error_msg').show();\r\n\t \t$('#mc_submit').removeAttr('disabled', 'disabled');\r\n\t }\r\n\t}", "function respond(currAnswer, currQuestion, res) {\r\n res.writeHead(200, { 'Content-Type': 'text/html' });\r\n res.write(`<!DOCTYPE html>\r\n <html lang=\"en\">\r\n <head>\r\n <meta charset=\"UTF-8\">\r\n <title>Eliza</title>\r\n </head>\r\n <body>\r\n <h1>Hi, ${userName}!</h1>\r\n <p>${currAnswer}</p>\r\n <p>${currQuestion}</p>\r\n <form action=\"/chat\" method=\"post\">\r\n <input type=\"text\" name=\"userInput\"/>\r\n <input type=\"submit\" value=\"Submit\"/>\r\n </form><br>\r\n <form action=\"/dict\" method=\"post\"> \r\n <input type=\"submit\" value=\"New Dictionary\"/>\r\n </form>\r\n </body>\r\n </html>`);\r\n res.end();\r\n}", "function BOT_onReply() {\r\n\tif(BOT_theReqValue){\r\n\t\tif(BOT_theReqReplyFunc && BOT_theReqReplyIndex == BOT_sessionCounter-1 ) { BOT_theReqReplyIndex = null; BOT_theReqReplyFunc() }\r\n\t\telse BOT_reqSay(true,\"PUZZLED\",\"NONREQUIREDVALUE\",BOT_theReqValue); \r\n\t}\r\n\telse BOT_reqSay(true,\"WARNING\",\"VALUENEEDED\"); \r\n}", "function getResponse(handleResponse, handleError) {\r\n try {\r\n var matches = handleResponse.results;\r\n if (handleResponse.selectedItemIndex > 0) {\r\n selectedItemIndex = handleResponse.selectedItemIndex\r\n storeCurrent();\r\n return\r\n }\r\n selectedItemIndex = handleResponse.selectedItemIndex\r\n // reset the result textarea\r\n if (selectedItemIndex <= 0) {\r\n resultTextarea.value = \"\";\r\n for (var i = 0; i < matches.length; i++) {\r\n resultTextarea.value += matches[i] + \"\\n\";\r\n }\r\n if (matches.length == 0 || matches == undefined) {\r\n matchesCount.innerText = \"No Matches Found\";\r\n } else {\r\n matchesCount.innerText = `${matches.length} match${matches.length > 1 ? 'es' : ''} found`;\r\n }\r\n }\r\n // store current values in the storage so user doesn't have to type again when he comes back to popup\r\n storeCurrent();\r\n }\r\n catch (ex) { \r\n window.eval(`console.error(ex)`);\r\n }\r\n }", "async function onResponse(messId, reqType, reqRes){\n \n try{\n let response = await api.response(user._id, messId, reqType, reqRes);\n setLoadNot(true); \n user.messages = response.user.messages;\n }catch(error){\n console.error(error); \n setLoadNot(false); \n }\n\n }", "function handle_c_response(jo) {\n var status = jo.status;\n var last_cmd = jo.last_cmd;\n var code = jo.code; \n var msg = jo.msg;\n var tracker = jo.tracker;\n //dump(':response: ' + status + ', ' + last_cmd + ', ' + msg + ',' + tracker);\n\n if (status == 'ok') { updateInfo(''); }\n\n if (last_cmd == 'register') { handle_cr_register(status, msg, code, tracker); }\n else if (last_cmd == 'login') { handle_cr_login(status, msg, code, tracker); }\n else if (last_cmd == 'update_pwd') { handle_cr_update_pwd(status, msg, code, tracker); }\n else if (last_cmd == 'get_room_list') { handle_cr_get_room_list(status, msg, code, tracker); }\n else if (last_cmd == 'get_user_list') { handle_cr_get_user_list(status, msg, code, tracker); }\n else if (last_cmd == 'get_room_user_list') { handle_cr_get_room_user_list(status, msg, code, tracker); }\n else if (last_cmd == 'create_room') { handle_cr_create_room(status, msg, code, tracker); }\n else if (last_cmd == 'invite') { handle_cr_invite(status, msg, code, tracker); }\n else if (last_cmd == 'invite_reply') { handle_cr_invite_reply(status, msg, code, tracker); }\n else if (last_cmd == 'master') { handle_cr_master(status, msg, code, tracker); }\n else if (last_cmd == 'kick') { handle_cr_kick(status, msg, code, tracker); }\n else if (last_cmd == 'max') { handle_cr_max(status, msg, code, tracker); }\n else if (last_cmd == 'set_room_permission') { handle_cr_set_room_permission(status, msg, code, tracker); }\n else if (last_cmd == 'join_room') { handle_cr_join_room(status, msg, code, tracker); }\n else if (last_cmd == 'leave_room') { handle_cr_leave_room(status, msg, code, tracker); }\n else if (last_cmd == 'speak') { handle_cr_speak(status, msg, code, tracker); }\n else if (last_cmd == 'whisper') { handle_cr_whisper(status, msg, code, tracker); }\n else if (last_cmd == 'broadcast') { handle_cr_broadcast(status, msg, code, tracker); }\n else if (last_cmd == 'admin_show_table') { handle_cr_admin_show_table(status, msg, code, tracker); }\n else if (last_cmd == 'logout') { handle_cr_logout(status, msg, code, tracker); }\n }", "function handleAuthenticationCallBack(authResponse) {\n var authnDataObj = {};\n var authnData = [];\n if (authResponse && authResponse.status === \"success\") {\n hintToShowPage = authResponse.content.hint;\n\t\t\tif(authResponse.content.hint == \"SHOW_SERVER_OTP\"){\n\t\t\t\tauthnData = authResponse.content.data;\n\t\t\t\tauthnData.forEach(function(authnDataObj) {\n\t\t\t\t\tif (authnDataObj.type === \"authId\") {\n\t\t\t\t\t\tAUTH_ID = authnDataObj.value;\n\t\t\t\t\t} else if (authnDataObj.type === \"error\") {\n\t\t\t\t\t\tINVALID_OTP = authnDataObj.value;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n if(authResponse.content.hint !== \"CALL_AUTHORIZE\"){\n\t\t\t\tauthnData = authResponse.content.data;\n\t\t\t\tauthnData.forEach(function(authnDataObj) {\n\t\t\t\t\tif (authnDataObj.type === \"authId\") {\n\t\t\t\t\t\tAUTH_ID = authnDataObj.value;\n\t\t\t\t\t} else if (authnDataObj.type === \"qr\") {\n\t\t\t\t\t\tQR_SHAREDSECRET = authnDataObj.value;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} \n } else {\n hintToShowPage = authResponse.content.hint;\n authnData = authResponse.content.data;\n authnData.forEach(function(authnDataObj) {\n if (authnDataObj.type === \"error\") {\n ERROR_CODE = authnDataObj.value;\n }\n if(authnDataObj.type === \"error_description\") {\n ERROR_DESCRIPTION = authnDataObj.value;\n }\n });\n }\n}", "function handleServerResponse(response) {\n if (!!response.error) {\n deferred.reject(response.error);\n } else {\n deferred.resolve(response.data);\n }\n }", "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\nwhile(dataTypes[0] === \"*\") {dataTypes.shift();if(ct === undefined){ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\nif(ct){for(type in contents) {if(contents[type] && contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\nif(dataTypes[0] in responses){finalDataType = dataTypes[0];}else { // Try convertible dataTypes\nfor(type in responses) {if(!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]){finalDataType = type;break;}if(!firstDataType){firstDataType = type;}} // Or just use first one\nfinalDataType = finalDataType || firstDataType;} // If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType !== dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function processResponse(response, options) {\n console.log(response);\n if (response.didCancel) {\n // Do nothing\n return null;\n } else if (response.error) {\n if (response.error.indexOf('Photo library') > -1) {\n showPermissionDeniedMessage(\n options.permissionDenied.title,\n options.permissionDenied.storageMessage,\n );\n } else if (response.error.indexOf('Camera') > -1) {\n showPermissionDeniedMessage(\n options.permissionDenied.title,\n options.permissionDenied.text,\n );\n } else {\n // Do nothing.\n }\n return null;\n }\n // Return the response URI to perform further operation.\n // const source = { uri: response.uri };\n // return source;\n return response;\n}", "function displayForm(res) {\n fs.readFile('form.html', function (err, data) {\n res.writeHead(200, {\n 'Content-Type': 'text/html',\n 'Content-Length': data.length\n });\n res.write(data);\n res.end();\n });\n}", "function PostRequestHandler(HandledRequest, response, request, body) {\n switch (request.url) {\n case '/AuthUser':\n HandledRequest.body = JSON.parse(body);\n HandledRequest.type = 'AuthUser'\n break;\n case '/PriPubKeys':\n HandledRequest.body = JSON.parse(body);\n HandledRequest.type = 'ChangePriPubKey';\n break;\n case '/UpdateCreatePDID':\n HandledRequest.body = JSON.parse(body);\n HandledRequest.type = 'ChangePDID'\n break;\n case '/PDIDToUSB':\n HandledRequest.body = JSON.parse(body);\n HandledRequest.type = 'WritePDID';\n break;\n case '/PostPassword':\n HandledRequest.body = body.split('\\t');\n let cookies = parseCookies(request)\n if (Object.keys(cookies).length === 0 && cookies.constructor === Object) {\n RejectRequest(response, \"smile\")\n } else {\n HandledRequest.cookies = {\n UserID: cookies['user-id'],\n MasterPw: cookies.masterpw,\n Message: JSON.parse(cookies.message),\n }\n HandledRequest.type = 'PostPassword'\n }\n break;\n case '/ChooseUserUSB':\n HandledRequest.body = JSON.parse(body);\n HandledRequest.type = 'ChooseUserUSB';\n break;\n case '/ChooseUserPDID':\n HandledRequest.body = JSON.parse(body);\n HandledRequest.type = 'ChooseUserPDID';\n break;\n default:\n break;\n }\n return HandledRequest;\n}", "function handleChat(req, res, dictionary) {\r\n let body = '';\r\n let input;\r\n\r\n req.on('data', chunk => {\r\n body += chunk;\r\n });\r\n\r\n // Processes request when the form data is fully submitted\r\n req.on('end', () => {\r\n input = qstring.parse(body);\r\n\r\n let currAnswer;\r\n let currQuestion;\r\n\r\n // If user submits a userName, sets the userName and responds to the user\r\n if (Object.prototype.hasOwnProperty.call(input, 'userName')) {\r\n userName = input.userName;\r\n if (!userName) handleNew(res);\r\n else {\r\n currAnswer = `Nice to meet you, ${userName}!`;\r\n currQuestion = dictionary.getQuestion(dictionary.getKeywords('welcome'));\r\n logAndRespond(currAnswer, currQuestion, userName, res);\r\n\r\n // Starts the 2min timer\r\n timer = setInterval(() => { timeToAsk = true; }, 120000);\r\n }\r\n }\r\n\r\n // If user submits a userInput, process it\r\n else if (Object.prototype.hasOwnProperty.call(input, 'userInput')) {\r\n let userResponse = input.userInput;\r\n\r\n // If the user quits, clears user data and resets to new user screen\r\n if (userResponse === 'quit') {\r\n log = 'Eliza: Hi, there! What is your name?<br>';\r\n userName = undefined;\r\n clearInterval(timer);\r\n handleNew(res);\r\n }\r\n\r\n // If user logs, displays and updates the log\r\n else if (userResponse === 'log') {\r\n currQuestion = timeToAsk ? `You sure can talk. I need some coffee. Join me at Dunkin', ${userName}?` : dictionary.getQuestion(dictionary.getKeywords('other'));\r\n respond(log, currQuestion, res);\r\n log = log + `Eliza: ${currQuestion}<br>`;\r\n }\r\n\r\n // If user responds normally, continues conversation with an answer and question\r\n else {\r\n // Turns the timer off if the conditions are appropriate\r\n if (userResponse === 'maybe' && justAsked) {\r\n clearInterval(timer);\r\n timeToAsk = false;\r\n }\r\n\r\n // Constructs the answer\r\n let keywords = dictionary.getKeywords(userResponse);\r\n currAnswer = dictionary.getAnswer(keywords);\r\n currQuestion = timeToAsk ? `You sure can talk. I need some coffee. Join me at Dunkin', ${userName}?` : dictionary.getQuestion(keywords);\r\n logAndRespond(currAnswer, currQuestion, userResponse, res);\r\n }\r\n }\r\n\r\n // If user submits a newDictionary, tries adding it to the current one.\r\n else if (Object.prototype.hasOwnProperty.call(input, 'newDictionary')) {\r\n let userResponse = '*attempts to add a dictionary*';\r\n let toAdd;\r\n\r\n try {\r\n toAdd = JSON.parse(input.newDictionary);\r\n dictionary.addDictionary(toAdd);\r\n currAnswer = `I just got smarter, I imported ${toAdd.dictionary_name}!`\r\n } catch (err) {\r\n currAnswer = 'Failed to import! :(';\r\n }\r\n currQuestion = timeToAsk ? `You sure can talk. I need some coffee. Join me at Dunkin', ${userName}?` : dictionary.getQuestion(dictionary.getKeywords('other'));\r\n logAndRespond(currAnswer, currQuestion, userResponse, res);\r\n }\r\n\r\n timeToAsk = false;\r\n justAsked = (currQuestion === `You sure can talk. I need some coffee. Join me at Dunkin', ${userName}?`);\r\n })\r\n}", "function getFormValuesAndDisplayResults() {\n}", "function _processRequestGET(req, res){\n\t\tres.writePage(_buildInboundForm(req));\n\t}", "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "async function handle_user(response) {\n if (response.status === 200) {\n const user = await response.json();\n\n var title = document.querySelector(\"title\");\n var name = document.querySelector(\".name\");\n var username = document.querySelector(\".username\");\n var contributions = document.querySelector(\".number-contributions\");\n var date = document.querySelector(\".date-joined\");\n\n // Set the title of the page, name, username, contributions, and date\n // joined of the user to the correct values.\n title.innerHTML = user.username;\n name.innerHTML = user.firstname + \" \" + user.surname;\n username.innerHTML = user.username;\n contributions.innerHTML += user.contributions + \" contributions\";\n date.innerHTML += \"Member since \" + user.joindate;\n\n // Now fetch all of the contributions\n fetch('/contributions', { method: 'GET', credentials: 'include' } ).then(handle_contributions);\n } else {\n window.location.href = '/login';\n }\n}", "function get_form_data() {\n var data = {};\n data[\"out\"] = $(\"#outcome-resp\").val();\n data[\"int\"] = $(\"#intervention-resp\").val();\n data[\"cmp\"] = $(\"#comparator-resp\").val();\n data[\"ans\"] = getCheckBoxSelection();\n data[\"res\"] = $(\"#reasoning-resp\").val();\n data[\"xml\"] = $(\"#reasoning-resp\").attr('xml_offsets');\n return data;\n}", "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\nif(dataTypes[0] in responses){finalDataType=dataTypes[0];}else { // Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}} // Or just use first one\nfinalDataType=finalDataType||firstDataType;} // If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function getResponse(handleResponse, handleError) {\r\n try {\r\n var matches = handleResponse.results;\r\n if (handleResponse.selectedItemIndex != matches.length -1) {\r\n selectedItemIndex = handleResponse.selectedItemIndex;\r\n storeCurrent();\r\n return\r\n }\r\n selectedItemIndex = handleResponse.selectedItemIndex\r\n // reset the result textarea\r\n resultTextarea.value = \"\";\r\n for (var i = 0; i < matches.length; i++) {\r\n resultTextarea.value += matches[i] + \"\\n\";\r\n }\r\n if (matches.length == 0 || matches == undefined) {\r\n matchesCount.innerText = \"No Matches Found\";\r\n } else {\r\n matchesCount.innerText = `${matches.length} match${matches.length > 1 ? 'es' : ''} found`;\r\n }\r\n // store current values in the storage so user doesn't have to type again when he comes back to popup\r\n storeCurrent();\r\n }\r\n catch (ex) { \r\n window.eval(`console.error(ex)`);\r\n }\r\n }", "validateFormResponse() {\n var newInputStatus = Object.assign({}, this.state.inputStatus);\n var newErrorMessage = Object.assign({}, this.state.errorMessage);\n\n //@@ DO VAILDATION HERE\n\n //Username Validation\n if (this.state.username.length == 0) {\n newErrorMessage.usernameMessage = \"Please enter valid username\";\n newInputStatus.username = -1;\n } else {\n newErrorMessage.usernameMessage = \"\";\n newInputStatus.username = 1;\n }\n\n //Email Validation\n if (this.state.email.length == 0) {\n newErrorMessage.emailMessage = \"Please enter valid email address\";\n newInputStatus.email = -1;\n } else {\n newErrorMessage.emailMessage = \"\";\n newInputStatus.email = 1;\n }\n\n //Password Validation\n if (this.state.password.length == 0) {\n newErrorMessage.passwordMessage = \"Password too short\";\n newInputStatus.password = -1;\n } else {\n newErrorMessage.passwordMessage = \"\";\n newInputStatus.password = 1;\n }\n\n //Chapter Validation\n if (this.state.selectedChapter == \"default\") {\n newInputStatus.chapter = -1;\n } else {\n newInputStatus.chapter = 1;\n }\n\n //SetState with new Form Errors/Success\n this.setState({\n inputStatus: newInputStatus,\n errorMessage: newErrorMessage\n });\n\n //return True if an error in any form is present, otherwise false\n if (Object.values(newInputStatus).indexOf(-1) > -1) return true;\n else return false;\n }", "function dataCallback(response) {\n return new Promise(function (resolve, reject) {\n var checkRecaptcha = firebase.functions().httpsCallable(\"checkRecaptcha\");\n checkRecaptcha({ response: encodeURIComponent(response) })\n .then((result) => {\n if (result[\"data\"].success === true) {\n $(\"#submit\").prop(\"disabled\", false);\n }\n resolve();\n })\n .catch((error) => {\n console.log(error);\n });\n });\n}", "async handleCall(req, res)\n\t{\n\t\tlogger.info('handleCall() [req:\"%s\", res:\"%s\"]', req, res);\n\n\t\ttry\n\t\t{\n\t\t\t// This is the SDP from Kurento\n\t\t\tconst localSdp = await this._processSipSdp(req.body, 'RtpEndpoint');\n\n\t\t\tthis._dialog = await this._srf.createUAS(req, res, {\n\t\t\t\tlocalSdp : localSdp,\n\t\t\t\theaders : {\n\t\t\t\t\t'User-Agent' : 'multiparty-meeting-sipgw'\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis._dialog.on('destroy', () =>\n\t\t\t{\n\t\t\t\tlogger.debug('handleCall() | caller hung up');\n\n\t\t\t\tthis.close();\n\t\t\t});\n\n\t\t\t// eslint-disable-next-line space-before-function-paren\n\t\t\tthis._dialog.on('modify', (modifyreq, modifyres) =>\n\t\t\t{\n\t\t\t\tlogger.debug('handleCall() | caller sent reInvite');\n\n\t\t\t\t// This is the SDP from Kurento\n\t\t\t\tthis._processSipSdp(modifyreq.body, 'RtpEndpoint')\n\t\t\t\t\t.then((newLocalSdp) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tmodifyres.send(200, {\n\t\t\t\t\t\t\tlocalSdp : newLocalSdp,\n\t\t\t\t\t\t\theaders : {\n\t\t\t\t\t\t\t\t'User-Agent' : 'multiparty-meeting-sipgw'\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});\n\n\t\t\tlogger.info('handleCall() | dialog created');\n\n\t\t\tthis._join({\n\t\t\t\tdisplayName : this._displayName,\n\t\t\t\tdevice : this._device\n\t\t\t});\n\t\t}\n\t\tcatch (error)\n\t\t{\n\t\t\tif (error instanceof Srf.SipError && error.status === 487)\n\t\t\t{\n\t\t\t\tlogger.debug('handleCall() | call canceled by caller');\n\t\t\t}\n\n\t\t\tthis.close();\n\t\t}\n\t}", "handleSubmit(values, { setStatus, resetForm }) {\n axios\n // free api that simulates a post request for any data \n .post('http://localhost:5000/api/register', values)\n\n .then(response => {\n // successful \n console.log(\"post api response object\", response)\n resetForm(); \n console.log(\"current user\", values);\n })\n\n .catch(error => {\n // unsuccessful \n console.log(\"The api is currently down.\", error.response);\n resetForm();\n });\n }", "function handleHttpResponse() \n\t{\n\t\tif (http.readyState == 4) \n\t\t{\n\t\t\tvar response = http.responseText;\n\t\t\teval(\"var arr = \"+response); //cria objeto com o resultado\n\t\t\tdocument.getElementById(\"endereco\").value = arr.endereco;\n\t\t\tdocument.getElementById(\"bairro\").value = arr.bairro;\n\t\t\tdocument.getElementById(\"cidade\").value = arr.cidade;\n\t\t\tdocument.getElementById(\"uf\").value = arr.uf;\n\t\t}\n\t}", "function doPost(e){\n return handleResponse(e);\n}", "function changePasswordHandler(response) {\n messageData = JSON.parse(response);\n if (messageData.success) \n\tdocument.getElementById(\"changePasswordForm\").reset();\n}", "function submitResultsToEmail(){\n var resultAndEmail = {}\n\n // document.getElementById('result').innerHTML\n\n // if (form.result.value) resultAndEmail.result = form.result.value\n if (document.getElementById('result').innerHTML) resultAndEmail.result = document.getElementById('result').innerHTML\n if (form.email.value) resultAndEmail.email = form.email.value \n\n console.log(resultAndEmail)\n\n fetch('/myresults/email', {\n headers: {\n 'Content-Type': 'application/json'\n },\n method: 'POST',\n body: JSON.stringify(resultAndEmail)\n }).then(function(res) {\n res.json()\n .then(function(user) {\n // alert(JSON.stringify(user))\n })\n }).catch(function(argument) {\n console.error(err)\n })\n}", "function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "function respond(req, res, next) {\n query = req.body.query\n // Naive sanity check\n if(!checkParentheses(query)) {\n console.log(\"Incorrectly formatted parentheses\")\n }\n response = parser.parse(query)\n res.send(response)\n next()\n}", "function createUserResponse(response) {\r\n if (response) {\r\n accountRequestlistclicked();\r\n setFormMessage(accreqlist_form, \"User wurde erstellt\", response);\r\n } else {\r\n setFormMessage(\r\n accreqlist_form,\r\n \"User konnte nicht erstellt werden\",\r\n response\r\n );\r\n }\r\n}", "function interpret_questionnaire(content) {\n var name = content['name'];\n if (content.hasOwnProperty('get')) { // Answer to a get request\n if (content['quest'] === 'FINISHED') {\n QUESTS[name] = true;\n return;\n }\n } else if (content.hasOwnProperty('post')) { // Answer to post request\n if (content['result'] === 'OK') {\n printLog('Questionnaire \"' + name + '\" successfully submitted and accepted by the server!');\n // Run the callafter, delete the temporary quest, and mark it as done\n QUEST_CURRENT_TO_SEND.callafter();\n\n // Send the duration to the server\n //var duration = Math.floor((QUEST_CURRENT_TO_SEND.end_time - QUEST_CURRENT_TO_SEND.start_time) / 1000);\n //sendQuestionnaireDuration(name, duration);\n\n QUEST_CURRENT_TO_SEND = {};\n QUESTS[name] = true;\n } else if (content['quest'] === 'ERROR') {\n printLog('Some error occurred while sending the questionnaire \"' + name + '\" to the server. ' +\n 'Creating error dialog.');\n viewErrorOverlay($('<div></div>').load('views/dialogs/dia_questionnaire_post_error.html'));\n } else if (content['quest'] === 'FINISHED') {\n printLog('POST questionnaire was already FINISHED! Name: ' + content['name']);\n // Run the callafter, delete the temporary quest, and mark it as done\n QUEST_CURRENT_TO_SEND.callafter();\n QUEST_CURRENT_TO_SEND = {};\n QUESTS[name] = true;\n }\n } else {\n // Should not happen with current API implementation\n printLog('Neither GET nor POST in questionnaire answer. Ignore this thing: ' + JSON.stringify(content));\n }\n}" ]
[ "0.58821845", "0.5860963", "0.5850275", "0.584663", "0.58455175", "0.5825443", "0.577574", "0.577574", "0.5771209", "0.5771209", "0.5771209", "0.5771209", "0.5771209", "0.5755652", "0.57258236", "0.570497", "0.5658164", "0.55834943", "0.5578811", "0.554056", "0.55220217", "0.5507857", "0.5501405", "0.5499692", "0.54930645", "0.5487846", "0.5437309", "0.53870106", "0.53701276", "0.5365217", "0.53525656", "0.53390867", "0.5330908", "0.53153205", "0.52991605", "0.528834", "0.5273824", "0.5257612", "0.5251263", "0.5249299", "0.52435964", "0.5241322", "0.52193457", "0.5214054", "0.5206917", "0.5204118", "0.51918346", "0.51798284", "0.51738095", "0.51671827", "0.5165374", "0.5156945", "0.5152745", "0.5148034", "0.5142391", "0.51398456", "0.5136869", "0.51280355", "0.5120305", "0.511876", "0.5116835", "0.51146483", "0.5107574", "0.510523", "0.510523", "0.5102477", "0.50958574", "0.50909734", "0.5087439", "0.50778246", "0.50736254", "0.5068452", "0.5065738", "0.50648767", "0.5062059", "0.50607616", "0.50607044", "0.5057394", "0.5055421", "0.50542307", "0.50540024", "0.5048667", "0.50445414", "0.50445414", "0.50445384", "0.5034743", "0.50329006", "0.5031059", "0.5030556", "0.5027157", "0.5026113", "0.5023595", "0.5023051", "0.50217575", "0.5020324", "0.5017101", "0.50167966", "0.50160074", "0.501595", "0.50157106" ]
0.56757134
16
START OF FPI Code / Template processing code START Creates a dictionary that has all PI fields mentioned in this template with information such as which one of them can be null and which ones are mandatory. Returns a tree of created template nodes.
function traverse_template_create_tree(fd, curr_node, site_pi_fields) { var all_kids = $(fd).children('div'); var last_kid = null; curr_node.children = []; curr_node.xml_node = fd; curr_node.name = $(fd).attr('name'); if (all_kids.length == 0) { //This is a leaf node .. represents actual value to be downloaded from the site var name = $(fd).attr('name'); var can_be_a_null = $(fd).attr('can_be_a_null'); site_pi_fields[name] = {}; if (can_be_a_null != undefined) { site_pi_fields[name].can_be_a_null = (can_be_a_null == 'no') ? false : true; } else { site_pi_fields[name].can_be_a_null = true; } site_pi_fields[name].filled = false; site_pi_fields[name].processed = false; site_pi_fields[name].value = []; } else { for(var i = 0; i < all_kids.length; i++) { var new_node = {}; new_node.parent = curr_node; new_node.sibling_num = i; new_node.completely_processed = false; if (last_kid != null) { new_node.left_sibling = last_kid; last_kid.right_sibling = new_node; new_node.right_sibling = null; last_kid = new_node; } else { new_node.left_sibling = null; last_kid = new_node; } curr_node.children.push(new_node); if ($(all_kids[i]).attr('type')) { new_node.type = $(all_kids[i]).attr('type'); } traverse_template_create_tree(all_kids[i], new_node, site_pi_fields); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TemplateInfo() {\n\tthis.code = '';\n\tthis.type = '';\n\tthis.parent = '';\n\tthis.description = '';\n}", "async process_fields() {\n\n const fields_template = this._blockkit_conifg.block_kit.fields;\n\n const result = {};\n result.type = \"section\";\n result.fields = [];\n\n for (const template_index in fields_template) {\n const template_value = fields_template[template_index];\n result.fields.push({\n type: \"mrkdwn\",\n text: \"*\" + template_index + \":*\\n\" + await helper.str_dot_walk_obj(this._obj, template_value)\n });\n }\n\n return result;\n }", "function generate (p) {\n // Type\n if (typeof p === 'string' && node.type === null) {\n node.type = p.replace(/^./, ch => ch.toUpperCase())\n return\n }\n\n // Type\n if (typeof p === 'function') {\n node.type = p\n return\n }\n\n // Children\n if (isArray(p)) {\n node.children = p\n return\n }\n\n // Attr\n if (typeof p === 'object') {\n node.attr = p\n return\n }\n\n // Content\n if (typeof p === 'string') {\n node.attr.content = p\n return\n }\n }", "function Template(priority) {\n this.paths = [];\n this.children = [];\n this.inits = [];\n this.priority = priority;\n this.newScope = false;\n}", "function createTableTemplates() {\n\t/*\n\t * Initialize the codes (from the xml in templates, the names in xml, and the transcription to cover all information)\n\t */\n\tvar done = {};\n\tif (trjs.data.codesxml) {\n\t\t/*\n\t\t * if template exists\n\t\t */\n\t\tfor (var i=0 ; i < trjs.data.codesxml.length; i++) {\n\t\t\tdone[trjs.data.codesxml[i][\"code\"]] = true;\n\t\t}\n\t} else {\n trjs.data.codesxml = {}; // creates it\n }\n\n\t/*\n\t * Initialize now codesxml with data from transcription if missing information.\n\t */\n\tfor (var i in trjs.data.codesdata) {\n\t\tif (done[i] !== true)\n trjs.data.codesxml.push({\n\t\t\t\t'code': i,\n\t\t\t\t'type': '-',\n\t\t\t\t'parent': 'none',\n\t\t\t\t'description': '',\n\t\t\t});\n\t}\n\n\t/*\n\t * Initialize the tiers (from the xml in templates, and the transcription to cover all information)\n\t */\n\tdone = {};\n\n\tif (trjs.data.tiersxml) {\n\t\t/*\n\t\t * if template exists\n\t\t */\n\t\tfor (var i=0 ; i < trjs.data.tiersxml.length; i++) {\n\t\t\tvar code = trjs.data.tiersxml[i][\"code\"];\n\t\t\tdone[code] = true;\n\t\t}\n\t} else {\n trjs.data.tiersxml = {};\n }\n\t/*\n\t * Initialize now pdata with data from transcription if missing information.\n\t */\n\tfor (var i in trjs.data.tiersdata) {\n\t\tif (done[i] !== true)\n trjs.data.tiersxml.push({\n\t\t\t\t'code': i,\n\t\t\t\t'type': trjs.data.ASSOC,\n\t\t\t\t'parent': 'main',\n\t\t\t\t'description': '',\n\t\t\t});\n\t}\n}", "function makeForTemplateDetails(forTemplate) {\n\n // Parse the root template\n var rem = [];\n\n // Create the details object\n var details = { any: undefined, first: undefined, last: undefined, nth: [] };\n\n // Loop over the child nodes\n for (var i = 0; i < forTemplate.dom.children.length; i++) {\n\n // Access the child\n var child = forTemplate.dom.children[i];\n\n // Access the node name\n var name = getNodeName(child);\n\n // Detarmine if the element is a collection item target\n if (name == \"FIRST\") {\n\n // Set the \"first\"\n details.first = child;\n\n // Mark the item to be removed\n rem.push(child);\n\n }\n else if (name == \"LAST\") {\n\n // Set the \"last\"\n details.last = child;\n\n // Mark the item to be removed\n rem.push(child);\n\n }\n else if (name == \"NTH\") {\n\n // Add the \"nth\"\n details.nth.push({ template: child, every: undefined, at: undefined, where: undefined });\n\n // Access the root NTH\n var rootNTH = details.nth[details.nth.length - 1];\n\n // Set the NTH properties\n rootNTH.every = child.getAttribute('every');\n rootNTH.at = child.getAttribute('at');\n rootNTH.where = child.getAttribute('where');\n\n // Process the \"at\" attrbiute further if its 0,1,2\n if ((rootNTH.at != undefined) && (rootNTH.at.indexOf(',') > -1)) {\n\n // Split the indicies\n var indicies = rootNTH.at.split(',');\n\n // Set the first nth item\n rootNTH.at = indicies[0];\n\n // Loop over the other indicies pushing more NTH items\n for (var iidx = 1; iidx < indicies.length; iidx++)\n details.nth.push({ template: child, every: rootNTH.every, at: indicies[iidx], where: rootNTH.where });\n\n }\n\n // Mark the item to be removed\n rem.push(child);\n\n }\n\n }\n\n // Remove the item targets\n for (i = 0; i < rem.length; i++)\n forTemplate.dom.removeChild(rem[i]);\n\n // Set the \"any\" template\n details.any = forTemplate.dom;\n\n // Determine the template status\n if ((details.first != undefined) || (details.last != undefined) || (details.nth.length > 0))\n details.hasTargets = true;\n else\n details.hasTargets = false;\n\n // Return\n return details;\n\n }", "function preProcessTemplate(template) {\n\n // Generate the ID base\n var baseid = (new Date()).getTime();\n\n // Establish the template \"lookup\"\n template.properties = new Object();\n template.scripts = new Object();\n template.code = new Object();\n template.conditions = new Object();\n template.wheres = new Object();\n\n // Establish the pre-processed\n template.pre = template.raw;\n\n // Indexes used for parsing\n var begin, end;\n\n // Loop over all the script segements\n while ((begin = template.pre.indexOf('{{')) >= 0) {\n\n // Generate a new key\n var key = '_k1_' + (baseid++).toString();\n\n // Determine the end\n end = template.pre.indexOf('}}', begin);\n\n // Extract the script\n var script = template.pre.slice(begin, end + 1);\n\n // Return the string with the item replaced\n template.pre = [template.pre.slice(0, begin), key, template.pre.slice(end + 2)].join('');\n\n // Add the property into the lookup\n template.scripts[key] = script.trim();\n\n }\n\n // Loop over all the property segments\n while ((begin = template.pre.indexOf('[')) >= 0) {\n\n // Generate a new key\n var key = '_k1_' + (baseid++).toString();\n\n // Determine the end\n end = template.pre.indexOf(']', begin);\n\n // Extract the property\n var property = template.pre.slice(begin, end + 1);\n\n // Return the string with the item replaced\n template.pre = [template.pre.slice(0, begin), key, template.pre.slice(end + 1)].join('');\n\n // Add the property into the lookup\n template.properties[key] = property.trim();\n\n }\n\n // Loop over all the free-code segments\n while ((begin = template.pre.indexOf('{')) >= 0) {\n\n // Generate a new key\n var key = '_k1_' + (baseid++).toString();\n\n // Determine the end\n end = template.pre.indexOf('}', begin);\n\n // Extract the property\n var code = template.pre.slice(begin, end + 1);\n\n // Return the string with the item replaced\n template.pre = [template.pre.slice(0, begin), key, template.pre.slice(end + 1)].join('');\n\n // Add the property into the lookup\n template.code[key] = code.trim();\n\n }\n\n // Define parse function\n this.parsePropCodes = function (name) {\n\n var codes = new Object();\n\n begin = 0;\n\n // Loop over all the condition=\n while ((begin = template.pre.indexOf(name, begin)) >= 0) {\n\n // Move past the whitespace\n while ((isWhitespace(template.pre.charAt(begin)) == false) && (template.pre.charAt(begin) != \"=\"))\n begin++;\n\n // Move past the whitespace\n while (isWhitespace(template.pre.charAt(begin)) == true)\n begin++;\n\n // If we hit an =\n if (template.pre.charAt(begin) == \"=\") {\n\n // Increment\n begin++;\n\n // Move past the whitespace\n while (isWhitespace(template.pre.charAt(begin)) == true)\n begin++;\n\n // If we hit a ' or \"\n if ((template.pre.charAt(begin) == \"\\\"\") || (template.pre.charAt(begin) == \"\\'\")) {\n\n // Get the break\n var brk = template.pre.charAt(begin);\n\n // Increment\n begin++;\n\n // Determine the end\n end = template.pre.indexOf(brk, begin);\n\n // Generate a new key\n var key = '_k1_' + (baseid++).toString();\n\n // Extract the snippet\n var code = template.pre.slice(begin, end);\n\n // Return the string with the item replaced\n template.pre = [template.pre.slice(0, begin), key, template.pre.slice(end)].join('');\n\n // Add the property into the lookup\n codes[key] = code.trim();\n\n }\n\n }\n\n }\n\n // Return\n return codes;\n\n }\n\n // Define parse \"special\" function\n this.parseSpecialElements = function (name) {\n\n begin = 0;\n\n // Loop over all the condition=\n while ((begin = template.pre.indexOf('<', begin)) >= 0) {\n\n var start = begin;\n var tag = '';\n var isclose = false;\n\n // Increment\n begin++;\n\n // Move past the whitespace\n while (isWhitespace(template.pre.charAt(begin)) == true)\n begin++;\n\n // Determine if this is a close tag\n if (template.pre.charAt(begin) == '/') {\n begin++;\n isclose = true;\n }\n\n // Move past the whitespace\n while (isWhitespace(template.pre.charAt(begin)) == true)\n begin++;\n\n // Parse the tag\n while ((isWhitespace(template.pre.charAt(begin)) == false) && (template.pre.charAt(begin) != '>')) {\n tag += template.pre.charAt(begin);\n begin++;\n }\n\n // If the tag matches the name\n if (tag.toLowerCase() == name.toLowerCase()) {\n\n // Replace the tag\n template.pre = [template.pre.slice(0, start), '<' + ((isclose == true) ? '/' : '') + 'div _ktype=\"' + name.toUpperCase() + '\"', template.pre.slice(begin)].join('');\n\n }\n\n }\n\n // Return\n return;\n\n }\n\n // Replace \"condition\" and \"where\"\n template.conditions = this.parsePropCodes(\"condition\");\n template.wheres = this.parsePropCodes(\"where\");\n\n // Replace the \"special\" elements\n this.parseSpecialElements('if');\n this.parseSpecialElements('elseif');\n this.parseSpecialElements('else');\n this.parseSpecialElements('for');\n this.parseSpecialElements('with');\n this.parseSpecialElements('nth');\n this.parseSpecialElements('first');\n this.parseSpecialElements('last');\n\n // Replace all \"src\" and \"href\" references\n template.pre = replaceAll(template.pre, \"src\", \"_src\", true);\n template.pre = replaceAll(template.pre, \"href\", \"_href\", true);\n\n // Wrap the pre-processed template\n template.pre = '<div>' + template.pre + '</div>';\n\n // Return\n return template;\n\n }", "static createTemplateDOM() {\n DataItemComponent.templateDOM = {};\n DataItemComponent.templateDOM.root = document.createElement('tr');\n\n DataItemComponent.templateDOM.root.innerHTML = '<tr>' +\n '<td class=\"col-md-1\">{{id}}</td>' +\n '<td class=\"col-md-4\"><a class=\"lbl\">-</a></td>' +\n '<td class=\"col-md-4\"><a class=\"remove\"><span class=\"glyphicon glyphicon-remove remove\" aria-hidden=\"true\"></span></a></td>' +\n '<td class=\"col-md-6\"></td>' +\n '</tr>'\n\n DataItemComponent.templateDOM.idText = DataItemComponent.templateDOM.root.firstChild.firstChild;\n DataItemComponent.templateDOM.labelText = DataItemComponent.templateDOM.root.firstChild.nextSibling.firstChild.firstChild;\n }", "function buildTemplateDataObject(template) {\n Object.keys(data).forEach(k => delete data[k])\n let templateCopy = JSON.parse(template);\n for (let i = 0; i < templateCopy.structure.length; i++) {\n let structure = templateCopy.structure[i];\n let files = templateCopy.files;\n let absolutePath = templateCopy.structure[i].absolutePath\n let templateNode = {\n [absolutePath]: {\n path: absolutePath,\n type: structure.fileType,\n isRoot: i === 0 ? true : false,\n isOpen: true,\n children: structure.children,\n content: files.find(x => x.fileName === structure.name)\n }\n }\n if (typeof templateNode[absolutePath].content === 'undefined') templateNode[absolutePath].content = '';\n data[absolutePath] = templateNode[absolutePath];\n }\n}", "function createNodes(rawData) {\n var myNodes = rawData.map(function (d) {\n var node = {\n title: idValue(d),\n impactValue: +d[year.start],\n radius: radiusScale(+d[year.start] > 0 ? +d[year.start] : 0),\n colorValue: colorValue(d, year.start),\n year: year.start,\n x: Math.random() * 900,\n y: Math.random() * 800,\n field: fosIndex(d),\n pub: pubIndex(d),\n };\n\n for(var key in d) {\n // Skip loop if the property is from prototype\n if (!d.hasOwnProperty(key)) continue;\n node[key] = d[key];\n }\n\n return node;\n\n });\n\n return myNodes;\n }", "buildRootNode() {\n return {};\n }", "buildRootNode() {\n return {};\n }", "function getNodeInfo() {\n const nodeForm = document.querySelector('#nodeForm');\n const inputs = nodeForm.querySelectorAll('input');\n const formData = new FormData(nodeForm);\n const newNode = {\n name: formData.get(\"name\"),\n description: formData.get(\"description\"),\n type: formData.get('type'),\n location_id: location.id,\n ipaddress: formData.get('ipAddress'),\n active: (formData.get(`active`) === \"on\") ? true : false\n };\n checkFields(newNode, inputs, nodeForm);\n }", "function nodes() { //Do not remove this line\n\tswitch(f['node']) { //Do not remove this line\n\n////\ncase \"start\":\n\td+=\"<h2>Path to Town</h2><p>The {Mountains|mountainsFar} tower on the horizon. {Atticus|atticus} and {Sam|sam} stand on the path leading toward the <span class='go'>{town|bridge}</span>.</p>\";\n\n\tif (f['billyWillGuide']) {\n\n\t\td+=\"<p>{Billy goat|billyGoatGoUp} here **</p>\";\n\t\t\n\t} \n\t\n\tif (!f['townComment']) {\n\t\tf['townComment']=1;\n\t\td+=\"<p><img src='i/sam_head.gif' class='left' />\\\"It's been a long trip. There it is.\\\"</div></p>\";\n\t}\n\troot = 1;\n\n\tbreak;\n\n\t\n\t///\n\tcase \"atticus\":\n\t\td=\"<p><img src='i/atticus.gif' class='left' />Tired but sharp eyes.</p>\";\n\t\tbreak;\n\t\n\t///\n\tcase \"sam\":\n\t\td=\"<p><img src='i/boy.gif' class='left' />Almost like a real boy. The seams on his joints speak otherwise.</p>\";\n\t\tbreak;\n\n\t////\n\tcase \"townFar\":\n\t\td=\"<p>[image of town: river, boy by river. Mountains in the distance]</p>\";\n\t\tbreak;\n\t\n\t\n\t\n\t///\n\tcase \"mountainsFar\":\n\t\td=\"<p><img src='i/town.gif' /></p>\";\n\t\tbreak;\n\n\n\n\n////\ncase \"bridge\":\n\troot=1;\n\t\n\tif(f['back']==\"deadEndCave\") {\n\t\td+=\"description of the three of them returning. Goat goes off into town.\";\n\t} else if (f['back']==\"market\" && f['girlNotWant']) {\n\t\td+=\"Student comes storming back, carrying book.\";\n\t\tf['samHasBook']=0;\n\t}\n\td+=\"***<h2>Bridge</h2>\";\n\tif(!f['studentHasRose']) {\n\t\td+=\"<p>A {young man|student} sits on a rock near the bank of the river.</p>\";\n\t}\n\t\n\tif(f['samHasBook']) {\n\t\td+=\"** {sam|samReading} reading book.\";\n\t} else if(f['girlNotWant']) {\n\t\td+=\"{Sam|samEnd} stands by river.\";\n\t}\n\td+=\"<p>{Path to market|market} ahead.</p>\";\n\t\n\tif(f['billyWillGuide']) {\n\t\td+=\"<p>{Path to mountains|start}</p>\";\n\t} else {\n\t\td+=\"<p>{Path to mountains|noGoMountain}</p>\";\n\t}\n\t\n\td+=\"Tree by river. Link to bigger image. Looks similar to big tree. Comment about a lot of these trees in city. {Fruit|fruit} on tree.\";\n\t\n\tbreak;\n\n\t\n///\ncase \"fruit\":\n\td+=\"Image of fruit.\";\n\tif(!f['studentHasRose'] && !f['fruitComment']) {\n\t\tf['fruitComment']=1;\n\t\td+=\"<p>Student comments about value of tree's fruit. Says sometimes tree has roses too. Not this season.</p>\";\n\t}\n\t\n\tbreak;\n\n\n///\ncase \"noGoMountain\":\n\td+=\"No point going back there\";\n\t\n\tbreak;\n\n\t\n///\ncase \"samEnd\":\n\troot=1;\n\td+=\"Well, he wanted his book back. Didn't say why. Says something oblivious. Time to move on. End\";\n\tbreak;\n\t\n///\ncase \"samReading\":\n\td+=\"** image sam reading. Confused\";\n\tif(!f['samReadComment']) {\n\t\tf['samReadComment']=1;\n\t\td+=\"** I'm going to stick around here for a while and read. You wander if you want.\";\n\t}\n\t\n\tbreak;\n\n///\ncase \"helpHim\":\n\td=\"[image of dog glaring at student. ] \\\" \";\n\tf['facePalmed']=1;\n\tbreak;\n\t\n\n////\ncase \"student\":\n\n\tif(f['haveRose']) {\n\t\td+=\"give him rose. ** He happy. Says will give to her. How can I repay you. I will give you this book. Student leaves. Sam sits down and starts reading. Dog wakes\"\n\t\tf['haveRose']=0;\n\t\tf['studentHasRose']=1;\n\t\tf['samHasBook']=1;\n\t}\n\t\n\tif (!f['roseStory']) {\n\t\n\t\n\t\td+=\"<p><img src='i/sam_head.gif' class='left' />\\\"Why are you so sad?\\\"</p><img src='i/student.gif' class='left' /><p>\\\"She said that she would dance with me if I brought her red roses, but in all the town there are no red roses.\\\"</p><p>His arms tighten around the {book|book} that he carries.</p> \";\n\t\tf['roseStory']=1;\n\t} else {\n\t\td+=\"<p>His brows are knitted in concentration. He clutches his book.</p>\";\n\t}\n\tbreak;\n\n\n///\ncase \"book\":\n\td=\"<p>The cover reads: \\\"Book of Very Wise Words\\\".</p>\";\n\tif (!f['booked']) {\n\t\td=\"<p><img src='i/showbook.gif' class='left' />I've read all that that the wise men have written, and all the secrets of philosophy are mine, yet for want of a red rose is my life made wretched.\\\"</p> \";\n\t\t\n\t\n\t\tf['roseStory']=1;\n\t}\n\n\t\n\tbreak;\n\ncase \"wretched\":\n\tif (f['roseStory'] && !f['facePalmed']) {\n\t\t\te=\"<p>[image of sam looking at Dog. Student talking into the air.] \\\"This sounds serious,\\\" says Hatboy. </p><p>\\\"The Prince gives a ball tomorrow night and my love will be of the company. If I bring her a red rose, I shall hold her in my arms and she will dance with me till dawn.\\\"</p><p>\\\"Did you hear that Dog? He can't find a red rose. We have to {help|helpHim} him.\\\"</p> \"\n\t\t\tback=0;\n\t\t}\n\tbreak;\n\n///\ncase \"market\":\n\troot=1;\n\td=\"<h1>city street Market</h1><p>{Flower Shop|flowerStand}</p><p>{River|bridge}</p><p>Path to {fountain|fountain}.</p>\"\n\t\n\n\tif(f['noRoses'] && !f['billyWillGuide']) {\n\t\td+=\"<p>{Goat|billyGoat} guy stands here.**</p>\";\n\t}\n\tbreak;\n\n\t\n\t\n///\ncase \"billyGoat\":\n\td+=\"<p>**Billy goat img</p>\";\n\t\n\tif(!f['billyWillGuide']) {\n\t\tf['billyWillGuide']=1;\n\t\td+=\"<p>Sam asks. ** Goat guy says ok. But will cost you. No guarantees either. Meet me back at mountain pass. He walks away.</p>\";\n\t}\n\t\n\tbreak;\n\n///\ncase \"mountains\":\n\troot=1;\n\td=\"<h2>Mountains</h2><p>{goat guy|goatGuy}.</p>\";\n\tbreak;\n\n\n///\ncase \"goatGuy\":\n\td=\"<p></p>\";\n\tbreak;\n\n///\ncase \"flowerStand\":\n\td+=\"<p>** rose shop</p>\";\n\tif (f['haveRose'] && !f['flowerGuySeenRose']) {\n\t\t//sam with you.\n\t\td+=\"Sam shows him rose. I don't believe it. You actually found one. I'll buy it from you. Sam refuses.\"\n\t\tf['flowerGuySeenRose']=1;\n\t} else {\n\t\t\n\t\t\n\t\tif (!f['noRoses'] && f['roseStory']) {\n\t\t\td+=\"<p>Guy says no more roses. Only place perhaps grow is in cloud kingdom. What do you need roses for? Boy answers. Guy says talk to the goat man behind you.</p>\";\n\t\t\tf['noRoses']=1;\n\t\t} else {\n\t\t\td+=\"<p>Seller looks at you.</p>\";\n\t\t\t\n\t\t}\n\t}\n\t\n\tbreak;\n\n\t\n\t\n\t\n\n////\ncase \"billyGoatGoUp\":\n\td+=\"<p>** well, it's good to see you. We can {make the trip|entranceCloudKingdom} now. asks for money. Greedy glint in eye. Sam gives him money</p>\";\n\tback=0;\n\tbreak;\n\n\t\n\t\n////\ncase \"entranceCloudKingdom\":\n\troot=1;\n\tif(f['back']==\"billyGoatGoUp\") {\n\t\td+=\"<p>Trek description. Billy says I will wait here. If you can't find the place, then you will never find it. I will wait for a day. Come back here.</p>\";\n\t\t\n\t}\n\td+=\"<h2>Cloud Kingdom Entrance</h2><p>Very foggy. Lampost.\";\n\tif(f['haveRose']) {\n\t\td+=\"{Path into cave|deadEndCave}.</p>\";\t\n\t} else {\n\t\td+=\"{Path into cave|cloudKingdom}.</p>\";\n\t}\n\t\n\tif(!f['goatKnowHaveRose']) {\n\t\td+=\"<p>{billy Goat|billyWaiting} waits here</p>\";\n\t}\n\t\n\tif(f['haveRose'] && !f['goatKnowHaveRose']) {\n\t\td=\"Cloud Kingdom Entrance by lampost. ** He looks at watch. Well, that was quick. Not even 5 minutes. You couldn't {get through|getThrough}, could you? Well that is not unexpected.\";\t\n\t\t\n\t}\n\t\n\tbreak;\n\n///\ncase \"getThrough\":\n\td+=\"Sam shows him rose and says we got it. Thanks for your help. \\\"no way\\\". He says. He walks into cave.\";\n\tf['goatKnowHaveRose']=1;\n\tbreak;\n\n\t\n///\ncase \"deadEndCave\":\n\troot=1;\n\td+=\"Goat guy standing there. Dead end. I don't believe it. It's time to go {back to town|bridge}.\";\n\t\n\t\n\tbreak;\n\t\n////\ncase \"cloudKingdom\":\n\troot=1;\n\tif(f['back']==\"entranceCloudKingdom\") {\n\t\td+=\"<p>** Trek description through cave</p>\";\n\t\t\n\t} else if(f['back']==\"rockTree\") {\n\t\n\t\td+=\"<p>** Atticus coming out of rock</p>\";\n\t\tif (f['day']<2) {\n\t\t\te+=\"<p>Sam waking. He looks tired. \\\"Well, lets see if the rose is ready.\\\"</p>\";\n\t\t} else {\n\t\t\te+=\"<p>Sam waking. looks very tired.</p>\";\n\t\t}\n\t\t\n\t\t//reset\n\t\tf['treeStealCounter']=0;\n\t\tf['day']++;\n\t\tf['samAsleep']=0;\n\t\tf['pricked']=0;\n\t}\n\t\n\td+=\"<h2>Cloud Kingdom</h2><p>Very foggy. {bed|bed}. {Path|tree}. {rock|rockBed}.\";\n\t\n\tif (f['haveRose']) {\n\t\td+=\"{Cave entrance|entranceCloudKingdom}\";\n\t} else {\n\t\td+=\"{cave entrance|leaveCloudKingdomEarly}\";\n\t}\n\t\n\t\n\t\n\tif (f['growledDone'] && !f['day']) {\n\t\td+=\"Sam ** {dreams|dream1}.\";\n\t\tback=0;\n\t}\n\t\n\tif (f['molePeep']==1) {\n\t\td+=\"<p>Mole peeps. then gone</p>\";\n\t\tf['molePeep']=2;\n\t}\n\t\n\tbreak;\n\n\n\t\n///\ncase \"rockBed\":\n\tif(f['molePeep']==2) { //if mole has already revealed secret path.\n\t\tif (f['samAsleep']) {\n\t\t\td+=\"** open it up, go {down|rockTree}\";\n\t\t\t\tf['treeStealCounter']=0;\n\t\t\t\tback=0;\n\t\t} else if(f['haveRose']) {\n\t\t\td+=\"<p>Don't fiddle around with rock, says Sam. We have to get going. </p>\";\n\t\t} else {\n\t\t\td+=\"<p>No time to waste. Let's see how the rose is. says sam.</p>\";\n\t\t}\n\t\n\t} else {\n\t\td+=\"ordinary ** desc\";\n\t}\n\tbreak;\n\n\n///\ncase \"rockTree\":\n\troot=1;\n\td+=\"<h1>Rock by tree</h1>** image atticus peeping up. tree pic. Tree can't see you.\";\n\tif (f['day']>1) {\n\t\td+=\"{senstive branch|sensitiveArea}\";\n\t}\t\n\n\t\n\t\n\tswitch(f['treeStealCounter']) {\n\t\tcase 0:\n\t\td+=\"Rose 1** Tree pulls {red rose|treeHasRose} from branch. Holds it in his hand staring at it.\";\n\t\tbreak;\n\t\n\t\tcase 1:\n\t\t\td=\"Rose 2** Tree opens up and puts it in storage. Atticus {leaves|cloudKingdom}.\";\n\t\t\t\n\t\tbreak;\n\t\n\t\n\t}\n\tf['treeStealCounter']++;\n\tbreak;\n\n\t\n\t\n///\ncase \"treeHasRose\":\n\td+=\"** can't take it. image of it glowing bright red.\";\n\tbreak;\n///\ncase \"treeSteal\":\n\tback=0;\n\td+=\"\";\n\tbreak;\n///\ncase \"bed\":\n\t\n\tif (f['pricked'] && !f['samAsleep'] && !f['samRecharged']) {\n\t\tf['samAsleep']=1;\n\t\t\n\t\td+=\"** Sam goes to bed. Atticus watches him.\"\n\t} else if (f['samAsleep']) {\n\t\td+=\"image of sam sleeping **\";\n\t\tif(f['pricked'] && f['molePeep']!=2 && f['day']) {\n\t\t\tf['molePeep']=1;\n\t\t}\n\t\tif(f['haveRose']) {\n\t\t\td+=\"sam waking up. Glad to see rose. Takes it out of Atticus's mouth. Says wants to go thank tree. Atticus tries to prevent him, but then falls asleep. Sam picks him up and puts him on his back. {Goes anyway|tree}.\";\n\t\t\tback=0;\n\t\t\tf['samAsleep']=0;\n\t\t\t\n\t\t}\n\t}else {\n\t\td+=\"<p>** bed image</p>\";\n\t}\n\tbreak;\n\n////\ncase \"leaveCloudKingdomEarly\":\n\tif(f['samAsleep']) {\n\t\td+=\"<p>Image of atticus thinking about Sam. Can't leave.</p>\";\n\t} else {\n\t\td+=\"<p>We haven't got the rose yet, says sam</p>** \";\n\t}\n\tbreak;\n\t\n\t\n////\ncase \"billyWaiting\":\n\t\n\tif(!f['billyGoAhead']) {\n\t\tf['billyGoAhead']=1;\n\t\td+=\"<p>**Well, get a move on already.</p>\";\n\t} else {\n\t\t\n\t\td+=\"<p>** Generic billy goat image or something</p>\";\n\t}\n\tbreak;\n\n\t\n\t\n////\ncase \"tree\":\n\troot=1;\n\t\n\t///already have rose\n\tif(f['haveRose']) {\n\t\td+=\"tree ordinary. No nore anthropomorphized\";\n\t\tif(!f['treeDeadComment']) {\n\t\t\td+=\"atticus says something about tree being dead now. Great sacrifice.\";\n\t\t\tf['treeDeadComment']=1;\n\t\t}\n\t} else {\n\t\t\n\t\t\n\t\t/// day 0\n\t\tif (!f['day']) {\n\t\t\tif(f['treeAwake']) {\n\t\t\t\td+=\"<h2>Tree</h2> ** <p>{Tree|talkTree} awake image</p> {bruised bark|sensitiveArea}\";\n\t\t\t\tif (f['thornOut']) {\n\t\t\t\t\td+=\"<p>** {Thorn|thorn} out.</p>\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\td+=\"<h2>Tree</h2> ** <p>Tree alseep image. {bruised bark|sensitiveArea}.</p>\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// day 1 - Sam already pricked once\n\t\telse if (f['day']==1) {\n\t\t\td+=\"<h2>Tree</h2> ** <p>{Tree|talkTree} awake image. Looks younger.</p> {bruised bark|sensitiveArea}\";\n\t\t\n\t\t\n\t\t\tif (f['thornOut']) {\n\t\t\t\td+=\"<p>** {Thorn|thornDay1} out.</p>\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t////day 2 - sam pricked twice already\n\t\telse if (f['day']==2) {\n\t\t\td+=\"<h2>Tree</h2> ** <p>{Tree|talkTree} tree day 2 awake image. Looks younger.</p> {bruised bark|sensitiveArea}\";\n\t\t\n\t\t\n\t\t\tif (f['thornOut']) {\n\t\t\t\td+=\"<p>** {Thorn|thornDay1} out.</p>\";\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\td+=\"<h2>Tree</h2> ** <p>{Tree|talkTree} tree day 2+ awake image. Looks younger.</p> {bruised bark|sensitiveArea}\";\n\t\t\n\t\t\n\t\t\tif (f['thornOut']) {\n\t\t\t\td+=\"<p>** {Thorn|thornDay1} out.</p>\";\n\t\t\t}\t\n\t\t}\n\t}\n\td+=\"<p>Path back to {bed|cloudKingdom}.</p><p>Rocks</p>\";\n\t\n\tbreak;\n\n\t\n////\ncase \"thorn\":\n\tif (!f['pricked']) {\n\t\td+=\"Atticus growls at tree. ** Sam pricks his finger. Feels tired. Tree says go rest. Come back and hopefully you will have red rose.\"\n\t\n\t\tf['pricked']=1;\n\t\tf['samRecharged']=0;\n\t\tf['thornOut']=0;\n\t} else {\n\t\td+=\"image of thorn.\";\n\t}\n\tbreak;\n\n\t\n////\ncase \"thornDay1\":\n\tif (!f['pricked']) {\n\t\td+=\"Atticus growls at tree AGAIN day 1. ** Sam pricks his finger. Feels tired. Tree says go rest. Sam walks away. Come back and hopefully you will have red rose.\"\n\t\tf['samAsleep']=1;\n\t\tf['pricked']=1;\n\t\tf['thornOut']=0;\n\t} else {\n\t\td+=\"image of thorn.\";\n\t}\n\tbreak;\t\n\n////\ncase \"talkTree\":\n\tswitch(f['day']) {\n\t\tdefault:\n\t\tif (f['samAsleep']) {\n\t\t\td+=\"Atticus growls at tree. Tree ignores him. **\";\n\t\n\t\t\tf['growledDone']=1;\n\t\t\t\n\t\t} else {\n\t\t\tif (!f['treeNoRosesComment']) {\n\t\t\t\tf['treeNoRosesComment']=1;\n\t\t\t\td+=\"<p>** Sam says he needs rose. tree tells story cold winter, No roses. He's old. SAm says must be way. This is for true love. Only one way to produce red rose, says tree. Thorn comes out. You must prick yourself on this thorn.</p>\";\n\t\t\t\tf['thornOut']=1;\n\t\t\t} else if (f['pricked']) {\n\t\t\t\td+=\"** tree tells sam to rest\";\n\t\t\t\t//adjust this according to day. **\n\t\t\t} else {\n\t\t\t\td+=\"Tree shakes his head. You must prick your finger for me to make a red rose\";\n\t\t\t\t//adjust this according to day. **\n\t\t\t\t\tf['thornOut']=1;\n\t\t\t}\n\t\t}\n\t\t\tbreak;\n\t\n\n\t\t//pricked once\n\t\tcase 1:\n\t\t\t\n\t\t\tif (f['samAsleep']) {\n\t\t\t\td+=\"Atticus growls at tree. Tree ignores him. **\";\n\t\t\n\t\t\t\tf['growledDone']=1;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tif (!f['treeNoRosesCommentDay1']) {\n\t\t\t\t\tf['treeNoRosesCommentDay1']=1;\n\t\t\t\t\td+=\"** Sam says how long have I been asleep? Tree says don't know. Time is different here. shows white rose. Not done yet. Need to prick again.</p>\";\n\t\t\t\t\tf['thornOut']=1;\n\t\t\t\t\t\n\t\t\t\t} else if (f['pricked']) {\n\t\t\t\t\td+=\"** tree tells sam to rest again. Day1. Sam walks away.\";\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\tf['samAsleep']=1;\n\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\td+=\"You must prick your finger again for the rose to become truly red.\";\n\t\t\t\t\tf['thornOut']=1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t\n\t\t//pricked twice\n\t\tcase 2:\n\t\t\tif (f['samAsleep']) {\n\t\t\td+=\"Atticus growls at tree. Tree ignores him. **\";\n\t\n\t\t\tf['growledDone']=1;\n\t\t\t\n\t\t} else {\n\t\t\tif (!f['treeNoRosesCommentDay1']) {\n\t\t\t\tf['treeNoRosesCommentDay1']=1;\n\t\t\t\td+=\"** Sam says how long have I been asleep? Tree says don't know. Time is different here. shows white rose. Not done yet. Need to prick again.</p>\";\n\t\t\t\tf['thornOut']=1;\n\t\t\t\t\n\t\t\t} else if (f['pricked']) {\n\t\t\t\td+=\"** tree tells sam to rest again. Day2. Sam walks away.\";\n\t\t\t\t\n\t\t\t\n\t\t\t\t\tf['samAsleep']=1;\n\t\t\t\n\t\t\t} else {\n\t\t\t\td+=\"You must prick your finger again for the rose to become truly red.\";\n\t\t\t\tf['thornOut']=1;\n\t\t\t}\n\t\t\tbreak;\n\t\n\n\t\n\t\n\t\n\t\n\t\t}\n\t\t\n\t\t\n\t\n\t}\n\t\n\tbreak;\n\n\t\n\n\t\n\n\t\n\t\n////\ncase \"sensitiveArea\":\n\tif(f['root']==\"rockTree\") {\n\t\td+=\"Atticus rushes out and steps on sensitive area. ** tree drops {rose|catchRose}\";\n\t\tback=0;\n\t} else {\n\t\tif(f['treeAwake']) {\n\t\t\tif(!f['samAsleep']) {\n\t\t\t\td+=\"** sam: better not cause him any more pain.\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\td+=\"** Don't touch that! says tree.\";\n\t\t\t}\n\t\t} else {\n\t\t\tf['treeAwake']=1;\n\t\t\td+=\"<p>Tree wakes up. Shouts in pain. Says something about termites.</p>\";\n\t\t}\n\t}\n\t\n\tbreak;\n\n\t\n///\ncase \"catchRose\":\n\td+=\"<p>** image of atticus jumping and grabbing it. He runs away. Tree angry. SAys something about you humans know nothing. I have lived thousands of years. My offspring are spread throughout the city. Dog back to {sam|cloudKingdom}.</p>\";\n\tf['haveRose']=1;\n\tback=0;\n\tbreak;\n\n/////\ncase \"dream1\":\n\troot=1;\n\td+=\"** Atticus lays down by bed and sleeps. dream 1 - Sam sees father. or some backstory.\";\n\td+=\"** Sam {wakes|cloudKingdom} up\";\n\tf['samRecharged']=1;\n\tf['pricked']=0;\n\tf['samAsleep']=0;\n\tf['day']=1;\n\tbreak;\n\t\n////////\ncase \"fountain\":\n\troot=1;\n\td+=\"<p>** fountain</p> university in background.\";\n\td+=\"<p>{path to market|market}</p>\";\n\t\n\tif(f['studentHasRose'] && !f['girlNotWant']) {\n\t\td=\"Student talking to {girl|girl} **\";\n\t}\n\t\n\tbreak;\n\n///\ncase \"girl\":\n\td+=\"It doesn't match. Boy throws {rose|roseCart} down. Ungrateful. They walk apart.\"\n\tf['girlNotWant']=1;\n\t\n\tbreak;\n\n\t\n///\ncase \"roseCart\":\n\td+=\"<p>Cart runs it over. Image of it completely broken.</p>\";\n\tbreak;\n/////////\ncase \"hints\":\n\tmetaNode=1;\n\td=\"<h2>hints</h2><p>hint info.</p>\";\n\t\n\tbreak;\n\n\n\t\t\n/////////\ncase \"about\":\n\tmetaNode=1;\n\td=\"<h2>About</h2><p>Demo info.</p>\";\n\t\n\tbreak;\n\n\n///////\ncase \"iPurse\":\n\td+=\"<p>just an ordinary purse.</p>\";\n\tbreak;\n\n\n///////\ncase \"iMenu\":\n\td+=\"<p>just an ordinary menu.</p>\";\n\tbreak;\n\n\n\n\n///////In case you link to a nonexistent node, then this error message will appear\ndefault:\n\td = \"Error\";\n\tbreak;\n\t}\n\t\n\t\n} //////do not remove this bracket", "buildTree() {\n\t\tthis.assignLevel(this.nodesList[0], 0);\n\t\tthis.positionMap = new Map();\n\t\tthis.assignPosition(this.nodesList[0], 0);\n\t}", "function addParentKeys( parseg, LastSeqNum, NewId, dbName, ProjName, EnvName, cobName, firstParFld, dType )\r\n {\r\n // alert( \"add parent fields\" );\r\n\r\n var numtempsegflds = parseg.getElementsByTagName( \"field\" ).length;\r\n var tempFldName = \"\";\r\n var fieldAtt = [];\r\n // Field loop \r\n for ( var z = 0; z < numtempsegflds; z++ )\r\n {\r\n // get each field in the segment and store it's properties in an array,\r\n // then add field to array to insert or update in DescFieldsTable\r\n var tempFld = parseg.getElementsByTagName( \"field\" )[z];\r\n\r\n // alert( \"tempFld.parentNode.getAttribute( 'id' ) = \" + tempFld.parentNode.getAttribute( \"id\" ) + \"\\nparseg.getAttribute( 'id' ) = \" + parseg.getAttribute( \"id\" ));\r\n\r\n if ( tempFld.parentNode == parseg )\r\n {\r\n fieldAtt = [];\r\n\r\n tempFldName = tempFld.getAttribute( \"id\" );\r\n tempFldName = toStrNTrim( tempFldName ); // tempFldName = tempFldName.trim();\r\n\r\n // alert( \"tempFldName = \" + tempFldName );\r\n\r\n var numAtoms = tempFld.getElementsByTagName( \"atom\" ).length;\r\n\r\n // alert( \"numAtoms = \" + numAtoms );\r\n\r\n // parenNode = tempFld.parentNode;\r\n // var parenName = parenNode.getAttribute( \"id\" );\r\n fieldAtt['fldParent'] = firstParFld;\r\n var NewFldId = NewId + \".\" + tempFldName;\r\n fieldAtt['nchildren'] = numtempsegflds;\r\n fieldAtt['noccurs'] = \"0\";\r\n fieldAtt['noccno'] = \"0\";\r\n fieldAtt['nscale'] = \"0\";\r\n fieldAtt['nlevel'] = attVal;\r\n fieldAtt['iskey'] = \"no\";\r\n fieldAtt['canNull'] = \"yes\";\r\n /// Attribute Loop\r\n for ( var j = 0; j < numAtoms; j++ )\r\n {\r\n var att = tempFld.getElementsByTagName( \"atom\" )[j];\r\n var attName = att.getAttribute( \"name\" );\r\n var attVal = att.childNodes[0].nodeValue;\r\n\r\n // alert( \"attName = \" + attName + \"\\nattVal = \" + attVal + \"\\natt.nextSibling = \" + att.nextSibling );\r\n\r\n switch ( attName )\r\n {\r\n case 'TYPE':\r\n fieldAtt['legType'] = attVal;\r\n fieldAtt['dataType'] = attVal;\r\n break;\r\n case 'NAME':\r\n fieldAtt['fldID'] = toStrNTrim( attVal );\r\n break;\r\n case 'START':\r\n fieldAtt['noffset'] = attVal;\r\n break;\r\n case 'KEY':\r\n fieldAtt['iskey'] = \"yes\";\r\n fieldAtt['canNull'] = \"no\";\r\n break;\r\n case 'LEN':\r\n fieldAtt['nlength'] = attVal;\r\n // curOffset = curOffset + attVal;\r\n break;\r\n default:\r\n break;\r\n }; // end switch\r\n\r\n // alert( \"field Name = \" + tempFldName + '\\n' + \"attribute = \" + attName + '\\n' + \"attribute Value = \" + attVal );\r\n\r\n if ( att.nextSibling == null )\r\n {\r\n // alert( \"break at next sibling == null?\" );\r\n break;\r\n };\r\n var nextsib = att.nextSibling;\r\n if ( nextsib.tagName == \"fld\" ) // nextsib.getAttributeNode( \"id\" )\r\n {\r\n // alert( \"break at next sibling has ID\" );\r\n break;\r\n };\r\n }; // end Attribute Loop\r\n if ( fieldAtt['iskey'] == \"yes\" )\r\n {\r\n // add Add fld to copybook in last place\r\n LastSeqNum = Number(LastSeqNum) + 1;\r\n fieldAtt['seqno'] = LastSeqNum;\r\n\r\n // alert( \"add key field = PFK_\" + tempFldName );\r\n // alert(\"breaks out of loop\");\r\n jQuery.ajax( { type: 'POST', //type of request GET or POST\r\n url: '../Studio/php/addDescField.php',\r\n data: {\r\n objid: NewFldId,\r\n projName: ProjName,\r\n envName: EnvName,\r\n descName: cobName,\r\n descId: NewId,\r\n descType: dType,\r\n fldName: \"PFK_\" + tempFldName,\r\n parentName: fieldAtt['fldParent'],\r\n seqno: fieldAtt['seqno'],\r\n descFldDesc: \"\",\r\n nchildren: fieldAtt['nchildren'],\r\n nlevel: fieldAtt['nlevel'],\r\n noccurs: fieldAtt['noccurs'],\r\n noccno: fieldAtt['noccno'],\r\n dataType: fieldAtt['dataType'],\r\n legType: fieldAtt['legType'],\r\n noffset: fieldAtt['noffset'],\r\n nlength: fieldAtt['nlength'],\r\n nscale: fieldAtt['nscale'],\r\n canNull: fieldAtt['canNull'],\r\n iskey: fieldAtt['iskey']\r\n },\r\n async: false,\r\n success: function ( return_data )\r\n {\r\n // alert( 'return_data : ' + return_data );\r\n if ( return_data != \"false\" )\r\n {\r\n //main_layout.progressOff();\r\n // alert( \"Return data: \" + return_data );\r\n // add field to descfldtree table\r\n var ischecked = \"0\";\r\n addDescfldnode = addDescFldNode( fieldAtt['fldParent'], objPar, \"PFK_\" + tempFldName, '105.gif', '105.gif', '105.gif', '105.gif', ischecked, NewId, fieldAtt['seqno'] );\r\n } else\r\n {\r\n propLayout.progressOff();\r\n alert( \"Error: \" + status + \"\\nReturn data: \" + data );\r\n return false;\r\n }; // end if/else\r\n } // end succes function\r\n } ); // end Ajax ADDdescField\r\n }\r\n }\r\n }; // end Field loop\r\n \r\n // alert( 'makes it to here' );\r\n /// get tempseg Parent\r\n var nextparseg = parseg.parentNode;\r\n if ( nextparseg != null && nextparseg.getAttribute( \"id\" ) != dbName )\r\n {\r\n // go to function to recurse through parents\r\n addParentKeys(nextparseg, LastSeqNum, NewId, dbName, ProjName, EnvName, cobName, firstParFld, dType);\r\n } \r\n return true;\r\n }", "function formTemplate() {\n\n\t\ttemplate = {\n\n\t\t\tdiv0: {\n\n\t\t\t\tclass: 'formTitle',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\ttext: 'Name',\n\n\t\t\t\t\tclosing: true\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tdiv2: {\n\n\t\t\t\tclass: 'formTitle',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\ttext: 'Email',\n\n\t\t\t\t\tclosing: true\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tdiv4: {\n\n\t\t\t\tclass: 'formTitle',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\ttext: 'Message',\n\n\t\t\t\t\tclosing: true\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tinput1: {\n\n\t\t\t\tclass: 'formInput',\n\n\t\t\t\ttype: 'text',\n\n\t\t\t\tplaceholder: 'John Smith...',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\tclosing: false\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tinput3: {\n\n\t\t\t\tclass: 'formInput',\n\n\t\t\t\ttype: 'text',\n\n\t\t\t\tplaceholder: '[email protected]...',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\tclosing: false\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tinput6: {\n\n\t\t\t\tclass: 'formSubmit',\n\n\t\t\t\ttype: 'button',\n\n\t\t\t\tvalue: 'Submit',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\tclosing: false\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\ttextarea5: {\n\n\t\t\t\tclass: 'formTextArea',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\tclosing: true\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\ttemplate.tag();\n\n\t}", "function makeWithTemplateDetails(withTemplate) {\n\n // Create the details object\n var details = { first: undefined, last: undefined, nth: [] };\n\n // Loop over the elements\n for (var i = 0; i < withTemplate.dom.children.length; i++) {\n\n // Access the child\n var child = withTemplate.dom.children[i];\n\n // Access the child node name\n var name = getNodeName(child);\n\n // Detarmine if the element is a collection item target\n if (name == \"FIRST\") {\n\n // Set the \"first\"\n details.first = child;\n\n }\n else if (name == \"LAST\") {\n\n // Set the \"last\"\n details.last = child;\n\n }\n else if (name == \"NTH\") {\n\n // Add the \"nth\"\n details.nth.push({ template: child, at: undefined });\n\n // Access the root NTH\n var rootNTH = details.nth[details.nth.length - 1];\n\n // Set the NTH properties\n rootNTH.at = child.getAttribute('at');\n\n // Process the \"at\" attrbiute further if its 0,1,2\n if ((rootNTH.at != undefined) && (rootNTH.at.indexOf(',') > -1)) {\n\n // Split the indicies\n var indicies = rootNTH.at.split(',');\n\n // Set the first nth item\n rootNTH.at = indicies[0];\n\n // Loop over the other indicies pushing more NTH items\n for (var iidx = 1; iidx < indicies.length; iidx++)\n details.nth.push({ template: child, at: indicies[iidx] });\n\n }\n\n }\n\n }\n\n // Return\n return details;\n\n }", "function generateDOMTree(node) {\n if(node.hasAttribute(\"knot-debugger-ignore\")) {\n return;\n }\n //when node is svg, there's no children. we don't support bind to svg at current stage\n if(!node.children){\n return;\n }\n var nodeInfo = {\n isExpanded:true,\n childrenInfo: []\n };\n\n for(var i=0; i<node.children.length; i++) {\n var info =generateDOMTree(node.children[i]);\n if(info) {\n nodeInfo.childrenInfo.push(info);\n info.parent = nodeInfo;\n }\n }\n\n if(!node.__knot && nodeInfo.childrenInfo.length === 0) {\n return null;\n }\n\n if(node.__knot) {\n nodeInfo.dataContext = node.__knot.dataContext;\n if(node.__knot.options) {\n nodeInfo.options = [];\n for(i=0; i< node.__knot.options.length; i++) {\n nodeInfo.options.push({\n description:getKnotOptionsStr(node.__knot.options[i]),\n knotOption:node.__knot.options[i],\n latestValueInfo:null\n });\n }\n }\n }\n else{\n nodeInfo.noKnotSetting = true;\n }\n\n nodeInfo.description = getHTMLElementDescription(node);\n nodeInfo.node = node;\n return nodeInfo;\n }", "visitPaymentInformation(paymentInformation) {\n this.currentPayment = this.currentTransfer.addElement('PmtInf');\n var node = this.currentPayment.addElement('PmtInfId');\n node.addTextNode(paymentInformation.getId());\n node = this.currentPayment.addElement('PmtMtd');\n node.addTextNode(paymentInformation.getPaymentMethod());\n node = this.currentPayment.addElement('BtchBookg');\n if (parseInt(paymentInformation.getBatchBooking()) <= 0)\n node.addTextNode('false');\n else\n node.addTextNode('true');\n node = this.currentPayment.addElement('NbOfTxs');\n node.addTextNode(paymentInformation.getNumberOfTransactions());\n node = this.currentPayment.addElement('CtrlSum');\n node.addTextNode(_formatCurrency(paymentInformation.getControlSumCents()));\n\n node = this.currentPayment.addElement('ReqdExctnDt');\n node.addTextNode(_formatDate(paymentInformation.getDueDate()));\n\n var debtor = this.currentPayment.addElement('Dbtr');\n node = debtor.addElement('Nm');\n node.addTextNode(paymentInformation.getOriginName());\n\n if (paymentInformation.getOriginBankPartyIdentification().length > 0) {\n this.appendOrganizationIdentificationElement(debtor, paymentInformation.getOriginBankPartyIdentification());\n }\n\n var debtorAccount = this.currentPayment.addElement('DbtrAcct');\n node = debtorAccount.addElement('Id');\n node = node.addElement('IBAN');\n node.addTextNode(paymentInformation.getOriginAccountIBAN());\n\n //Debit advice\n if (paymentInformation.getOriginAdvice().length > 0) {\n node = debtorAccount.addElement('Tp');\n node = node.addElement('Prtry');\n node.addTextNode(paymentInformation.getOriginAdvice());\n }\n\n /*if (paymentInformation.getOriginAccountCurrency().length > 0) {\n node = debtorAccount.addElement('Ccy');\n node.addTextNode(paymentInformation.getOriginAccountCurrency());\n }*/\n\n if (paymentInformation.getOriginAgentBIC().length > 0) {\n var debtorAgent = this.currentPayment.addElement('DbtrAgt');\n this.appendFinancialInstitutionElement(debtorAgent, paymentInformation.getOriginAgentBIC());\n }\n\n // Charge Bearer\n if (paymentInformation.getChargeBearer().length > 0) {\n var chargeBearer = this.currentPayment.addElement('ChrgBr');\n chargeBearer.addTextNode(paymentInformation.getChargeBearer());\n }\n }", "generate() {\r\n const rootNode = new TreeNode(0, null, null)\r\n let parent = rootNode\r\n let cursor = rootNode\r\n $('.readme .markdown-body :header').each((idx, obj) => {\r\n let element = $(obj).get(0)\r\n let tag = element.tagName\r\n // extract header level\r\n let level = /H(\\d)/i.exec(tag)[1]\r\n // extract anchor\r\n let content = {\r\n href: $($(element).children().get(0)).attr('href'),\r\n text: element.innerText\r\n }\r\n // build tree\r\n if (level > cursor.level) {\r\n parent = cursor\r\n } else if (level < cursor.level) {\r\n while (level <= parent.level) {\r\n parent = parent.parent\r\n }\r\n } \r\n let node = new TreeNode(level, content, parent)\r\n parent.addChild(node)\r\n cursor = node\r\n })\r\n return rootNode\r\n }", "function createNodes(rawData) {\n // Use map() to convert raw data into node data.\n // Checkout http://learnjsdata.com/ for more on\n // working with data.\n var myNodes = rawData.map(function (d) {\n var diff_lecture = d.allocated_lecture_h - d.planned_lecture_h;\n var diff_exercise = d.allocated_exercise_h - d.planned_exercise_h;\n var diff_lab = d.allocated_lab_h - d.planned_lab_h;\n var diff_assistance = d.allocated_assistance_h - d.planned_assistance_h;\n var diff_examination = d.allocated_examination_h - d.planned_examination_h;\n var diff_course_dev = d.allocated_course_dev_h - d.planned_course_dev_h;\n var diff_administration = d.allocated_administration_h - d.planned_administration_h;\n\n var bigArray = [diff_lecture, diff_exercise, diff_lab, diff_assistance, diff_examination, diff_course_dev, diff_administration];\n var positiveArray = [];\n var negativeArray = [];\n\n for (var i=0; i<bigArray.length;i++){\n if (bigArray[i]>=0){positiveArray.push(bigArray[i])}\n else {negativeArray.push(bigArray[i])};\n }\n\n var positiveValue = 0;\n var negativeValue = 0;\n\n for (var j=0; j<positiveArray.length;j++){\n positiveValue+=positiveArray[j];\n }\n\n for (var k=0; k<negativeArray.length;k++){\n negativeValue+=Math.abs(negativeArray[k]);\n }\n\n var radiusValue = positiveValue+negativeValue;\n return {\n radius: radiusScale(Math.abs(LimitRadius(radiusValue))),\n id: d.id,\n code: d.code,\n name: d.name,\n periods:d.periods,\n credits: d.credits,\n value: radiusValue,\n positiveValue: positiveValue,\n negativeValue: negativeValue,\n financial_outcome:d.financial_outcome,\n num_of_students:d.num_of_students,\n teachers:d.teachers,\n filterState:0,\n x: Math.random() * 900,\n y: Math.random() * 800\n };\n });\n\n function LimitRadius(val){\n if (Math.abs(val) <1){\n return 5;\n }\n // else if (Math.abs(val)>150){\n // return 80;\n // }\n else return (val);\n }\n\n // sort them to prevent occlusion of smaller nodes.\n myNodes.sort(function (a, b) { return b.value - a.value; });\n\n return myNodes;\n }", "function buildObject(props) {\r\n var rslt = {\r\n name: \"\",\r\n attribut: \"\",\r\n children: [],\r\n value: \"\",\r\n }\r\n //11 children\r\n var child = {\r\n name: \"\",\r\n attribut: \"\",\r\n children: [],\r\n value: \"\",\r\n }\r\n\r\n rslt.name = \"STP\"\r\n //first child STPid\r\n child.name = \"STPid\"\r\n child.value = props.activeEvent\r\n rslt.children.append(child)\r\n\r\n //second child\r\n child.name = \"eventName\"\r\n child.value = props.activeEvent\r\n rslt.children.append(child)\r\n}", "function tree_p(tree) {\n return node_p(tree, '')\n}", "create(data) {\n //eventually will need to do manipulation to convert template string into this format, but start simple for now\n return null;\n }", "create(data) {\n //eventually will need to do manipulation to convert template string into this format, but start simple for now\n return null;\n }", "function parseTemplateDef(s){ // \n\n\n\n\tvar tset= {DSTART:true, INNERDTEXT: true, PIPE: true, DEND:true};\n\n\tvar object= {name: \"templatedef\", dtext: null, pipeDtext:null}\n\n\t\n\n\t// DSTART HAS ALREADY BEEN VERYFIED IN OUTERTEXT (( if we want to testParseTemplate def re-write the code for testingDstart))\n\tobject.dtext= parseDtext(s);\n\t\n\n\tconsole.log(\"\\n----Dtext in template Definition parseTemplateDef------\\n\")\n\tconsole.log(object.dtext); // to prind the object\n\tconsole.log(\"\\n---- END Dtext in template Definition parseTemplateDef ------\\n\")\n\n\n\ttk= scaner(s.substr(counter),tset);\n\n\n\n\tif(tk.token==\"PIPE\"){\n\n\t\tcounter+=1;\n\t\tobject.pipeDtext= parsePipeDtext(s) // Recursive part \"+\"\n\t}\n\n\n\treturn object\n\n}", "function createNodes(rawData) {\n // Use map() to convert raw data into node data.\n // Checkout http://learnjsdata.com/ for more on\n // working with data.\n var myNodes = rawData.map(function (d) {\n return {\n // id= contry name\n id: d.id,\n radius: radiusScale(+d.O_1),\n value: +d.O_1,\n name: d.id,\n org: d.id,\n group: d.id,\n continents: d.continents,\n x: Math.random() * 900,\n y: Math.random() * 800\n };\n });\n\n // sort them to prevent smaller nodes hiding under.\n myNodes.sort(function (a, b) { return b.value - a.value; });\n\n return myNodes;\n }", "function getItmNodeStructure(iSec, iData, iItmLn, iForm) {\n var rtObj = null;\n if (iForm == \"GSTR1\") {\n switch (iSec) {\n case \"b2b\":\n case \"b2ba\":\n case \"b2cl\":\n case \"b2cla\":\n rtObj = {\n \"num\": iItmLn + 1,\n \"itm_det\": angular.copy(iData)\n };\n break;\n case \"at\":\n case \"ata\":\n case \"exp\":\n case \"expa\":\n rtObj = iData;\n break;\n }\n } else if (iForm == \"GSTR2\") {\n switch (iSec) {\n case \"b2b\":\n case \"b2ba\":\n case \"b2bur\":\n case \"b2bura\":\n case \"cdnr\":\n case \"cdnur\":\n var itc = angular.copy(iData.itc);\n delete iData.itc;\n rtObj = {\n \"num\": iItmLn + 1,\n \"itm_det\": angular.copy(iData),\n \"itc\": itc\n };\n break;\n case \"txi\":\n case \"atxi\":\n iData.num = iItmLn + 1;\n rtObj = iData;\n break;\n case \"imp_g\":\n case \"imp_ga\":\n case \"imp_s\":\n case \"imp_sa\":\n iData.num = iItmLn + 1;\n rtObj = iData;\n break;\n\n }\n }\n return rtObj;\n }", "function createNode(nodeNumber){\n var temp = {};\n var t = {};\n t['id'] = nodeNumber;\n temp['data'] = t;\n return temp;\n}", "function createNodes(rawData) { \n\n\t// Use map() to convert raw data into node data.\n\t// Checkout http://learnjsdata.com/ for more on\n\t// working with data.\n\tvar tempLab = \"\";\n\tvar myNodes = rawData.map(function (d) {\n\n\t\ttempLab = urlToLabs(d.labLink);\n\n\t\tif(tempLab == null){\n\t\t\tvar labsList = d.labLink.split(\",\");\n\t\t\ttempLab = urlToLabs(labsList[0]); //pernei to proto ergastirio pou yparxei stin lista twn data sto pedio labLink.\n\t\t}\n\n\t\tif(d.year>=2010 && d.year<=2020)\n\t\t\treturn {\n\t\t\t\tid: d.id,\n\t\t\t\tradius: initialRadius, // initialRadius = 4\n\t\t\t\tvalue: d.author,\n\t\t\t\tname: d.title,\n\t\t\t\ttype: d.type,\n\t\t\t\tyear: d.year,\n\t\t\t\tlab: tempLab,\n\n\t\t\t\tx: Math.random() * 900,\n\t\t\t\ty: Math.random() * 800\n\t\t\t};\n\t\telse\n\t\t\treturn 0;\n\t});\n\n\t// sort them to prevent occlusion of smaller nodes.\n\t//myNodes.sort(function (a, b) { return b.value - a.value; });\n\treturn myNodes;\n}", "function createNodes(rawData) {\n // Use map() to convert raw data into node data.\n // Checkout http://learnjsdata.com/ for more on\n // working with data.\n console.log(\"in create nodes\");\n\t console.log(rawData);\n\t var id = 0;\n var myNodes = rawData.map(function (d) {\n console.log(\"data \"+d.name+\";\"+d.number+\";\"+d.iq+\";\"+d.dtype);\n return {\n id: d.id,\n radius: radiusScale(+d.number),\n value: d.number,\n name: d.name,\n nameID: d.nameID,\n org: d.name,\n// group: d.group,\n group: d.dtype,\n topic: d.iq,\n dtype: d.dtype,\n\n x: Math.random() * 900,\n y: Math.random() * 800\n };\n });\n\n // sort them to prevent occlusion of smaller nodes.\n myNodes.sort(function (a, b) { return b.value - a.value; });\n\n return myNodes;\n }", "function PdfSectionTemplate(){var _this=_super.call(this)||this;_this.leftValue=_this.topValue=_this.rightValue=_this.bottomValue=_this.stampValue=true;return _this;}", "function generateMappingInstructions(tmplIndex, partIndex, translationParts, instructions, elements, expressions, templateRoots, lastChildIndex) {\n var tmplInstructions = [];\n var phVisited = [];\n var openedTagCount = 0;\n var maxIndex = 0;\n var currentElements = elements && elements[tmplIndex] ? elements[tmplIndex] : null;\n var currentExpressions = expressions && expressions[tmplIndex] ? expressions[tmplIndex] : null;\n instructions[tmplIndex] = tmplInstructions;\n for (; partIndex < translationParts.length; partIndex++) {\n // The value can either be text or the name of a placeholder (element/template root/expression)\n var value = translationParts[partIndex];\n // Odd indexes are placeholders\n if (partIndex & 1) {\n var phIndex = void 0;\n if (currentElements && currentElements[value] !== undefined) {\n phIndex = currentElements[value];\n // The placeholder represents a DOM element, add an instruction to move it\n var templateRootIndex = templateRoots ? templateRoots.indexOf(value) : -1;\n if (templateRootIndex !== -1 && (templateRootIndex + 1) !== tmplIndex) {\n // This is a template root, it has no closing tag, not treating it as an element\n tmplInstructions.push(phIndex | -2147483648 /* TemplateRoot */);\n }\n else {\n tmplInstructions.push(phIndex | 1073741824 /* Element */);\n openedTagCount++;\n }\n phVisited.push(value);\n }\n else if (currentExpressions && currentExpressions[value] !== undefined) {\n phIndex = currentExpressions[value];\n // The placeholder represents an expression, add an instruction to move it\n tmplInstructions.push(phIndex | 1610612736 /* Expression */);\n phVisited.push(value);\n }\n else {\n // It is a closing tag\n tmplInstructions.push(-1073741824 /* CloseNode */);\n if (tmplIndex > 0) {\n openedTagCount--;\n // If we have reached the closing tag for this template, exit the loop\n if (openedTagCount === 0) {\n break;\n }\n }\n }\n if (phIndex !== undefined && phIndex > maxIndex) {\n maxIndex = phIndex;\n }\n if (templateRoots) {\n var newTmplIndex = templateRoots.indexOf(value) + 1;\n if (newTmplIndex !== 0 && newTmplIndex !== tmplIndex) {\n partIndex = generateMappingInstructions(newTmplIndex, partIndex, translationParts, instructions, elements, expressions, templateRoots, lastChildIndex);\n }\n }\n }\n else if (value) {\n // It's a non-empty string, create a text node\n tmplInstructions.push(536870912 /* Text */, value);\n }\n }\n // Add instructions to remove elements that are not used in the translation\n if (elements) {\n var tmplElements = elements[tmplIndex];\n if (tmplElements) {\n var phKeys = Object.keys(tmplElements);\n for (var i = 0; i < phKeys.length; i++) {\n var ph = phKeys[i];\n if (phVisited.indexOf(ph) === -1) {\n var index = tmplElements[ph];\n // Add an instruction to remove the element\n tmplInstructions.push(index | -536870912 /* RemoveNode */);\n if (index > maxIndex) {\n maxIndex = index;\n }\n }\n }\n }\n }\n // Add instructions to remove expressions that are not used in the translation\n if (expressions) {\n var tmplExpressions = expressions[tmplIndex];\n if (tmplExpressions) {\n var phKeys = Object.keys(tmplExpressions);\n for (var i = 0; i < phKeys.length; i++) {\n var ph = phKeys[i];\n if (phVisited.indexOf(ph) === -1) {\n var index = tmplExpressions[ph];\n if (ngDevMode) {\n assertLessThan(index.toString(2).length, 28, \"Index \" + index + \" is too big and will overflow\");\n }\n // Add an instruction to remove the expression\n tmplInstructions.push(index | -536870912 /* RemoveNode */);\n if (index > maxIndex) {\n maxIndex = index;\n }\n }\n }\n }\n }\n if (tmplIndex === 0 && typeof lastChildIndex === 'number') {\n // The current parent is an ng-container and it has more children after the translation that we\n // need to append to keep the order of the DOM nodes correct\n for (var i = maxIndex + 1; i <= lastChildIndex; i++) {\n if (ngDevMode) {\n assertLessThan(i.toString(2).length, 28, \"Index \" + i + \" is too big and will overflow\");\n }\n tmplInstructions.push(i | -1610612736 /* Any */);\n }\n }\n return partIndex;\n}", "function generateMappingInstructions(tmplIndex, partIndex, translationParts, instructions, elements, expressions, templateRoots, lastChildIndex) {\n var tmplInstructions = [];\n var phVisited = [];\n var openedTagCount = 0;\n var maxIndex = 0;\n var currentElements = elements && elements[tmplIndex] ? elements[tmplIndex] : null;\n var currentExpressions = expressions && expressions[tmplIndex] ? expressions[tmplIndex] : null;\n instructions[tmplIndex] = tmplInstructions;\n for (; partIndex < translationParts.length; partIndex++) {\n // The value can either be text or the name of a placeholder (element/template root/expression)\n var value = translationParts[partIndex];\n // Odd indexes are placeholders\n if (partIndex & 1) {\n var phIndex = void 0;\n if (currentElements && currentElements[value] !== undefined) {\n phIndex = currentElements[value];\n // The placeholder represents a DOM element, add an instruction to move it\n var templateRootIndex = templateRoots ? templateRoots.indexOf(value) : -1;\n if (templateRootIndex !== -1 && (templateRootIndex + 1) !== tmplIndex) {\n // This is a template root, it has no closing tag, not treating it as an element\n tmplInstructions.push(phIndex | -2147483648 /* TemplateRoot */);\n }\n else {\n tmplInstructions.push(phIndex | 1073741824 /* Element */);\n openedTagCount++;\n }\n phVisited.push(value);\n }\n else if (currentExpressions && currentExpressions[value] !== undefined) {\n phIndex = currentExpressions[value];\n // The placeholder represents an expression, add an instruction to move it\n tmplInstructions.push(phIndex | 1610612736 /* Expression */);\n phVisited.push(value);\n }\n else {\n // It is a closing tag\n tmplInstructions.push(-1073741824 /* CloseNode */);\n if (tmplIndex > 0) {\n openedTagCount--;\n // If we have reached the closing tag for this template, exit the loop\n if (openedTagCount === 0) {\n break;\n }\n }\n }\n if (phIndex !== undefined && phIndex > maxIndex) {\n maxIndex = phIndex;\n }\n if (templateRoots) {\n var newTmplIndex = templateRoots.indexOf(value) + 1;\n if (newTmplIndex !== 0 && newTmplIndex !== tmplIndex) {\n partIndex = generateMappingInstructions(newTmplIndex, partIndex, translationParts, instructions, elements, expressions, templateRoots, lastChildIndex);\n }\n }\n }\n else if (value) {\n // It's a non-empty string, create a text node\n tmplInstructions.push(536870912 /* Text */, value);\n }\n }\n // Add instructions to remove elements that are not used in the translation\n if (elements) {\n var tmplElements = elements[tmplIndex];\n if (tmplElements) {\n var phKeys = Object.keys(tmplElements);\n for (var i = 0; i < phKeys.length; i++) {\n var ph = phKeys[i];\n if (phVisited.indexOf(ph) === -1) {\n var index = tmplElements[ph];\n // Add an instruction to remove the element\n tmplInstructions.push(index | -536870912 /* RemoveNode */);\n if (index > maxIndex) {\n maxIndex = index;\n }\n }\n }\n }\n }\n // Add instructions to remove expressions that are not used in the translation\n if (expressions) {\n var tmplExpressions = expressions[tmplIndex];\n if (tmplExpressions) {\n var phKeys = Object.keys(tmplExpressions);\n for (var i = 0; i < phKeys.length; i++) {\n var ph = phKeys[i];\n if (phVisited.indexOf(ph) === -1) {\n var index = tmplExpressions[ph];\n if (ngDevMode) {\n assertLessThan(index.toString(2).length, 28, \"Index \" + index + \" is too big and will overflow\");\n }\n // Add an instruction to remove the expression\n tmplInstructions.push(index | -536870912 /* RemoveNode */);\n if (index > maxIndex) {\n maxIndex = index;\n }\n }\n }\n }\n }\n if (tmplIndex === 0 && typeof lastChildIndex === 'number') {\n // The current parent is an ng-container and it has more children after the translation that we\n // need to append to keep the order of the DOM nodes correct\n for (var i = maxIndex + 1; i <= lastChildIndex; i++) {\n if (ngDevMode) {\n assertLessThan(i.toString(2).length, 28, \"Index \" + i + \" is too big and will overflow\");\n }\n tmplInstructions.push(i | -1610612736 /* Any */);\n }\n }\n return partIndex;\n}", "function AddCreateNodes() {\n if (LoggedIn) {\n toReplace = $(\".confirmCSRF\")\n for (i = 0; i<toReplace.length; i++) {\n parentID = $(toReplace[i]).find(\"input[name='ParentID']\").get(0).value\n\n newCreatePage = document.getElementById(\"createPageTemplate\").content.firstElementChild.cloneNode(true)\n $(newCreatePage).find(\"input[name='ParentID']\").get(0).value = parentID\n $(toReplace[i]).replaceWith(newCreatePage)\n }\n }\n}", "function processTemplate($, context, template) {\n const extracted = {};\n\n // Allow to iterate on a list of element changing context\n function iterate(nestedTemplate) {\n const usesRootGroup = typeof nestedTemplate === 'function';\n return (nestedContext, filter) => {\n const nestedProcessDefinition = createDefinitionProcessor($, nestedContext, iterate);\n return nestedContext\n .filter((i, node) => filter(nestedProcessDefinition))\n .map((i, node) => processTemplate($, node, usesRootGroup ? { root: nestedTemplate } : nestedTemplate))\n .get()\n .map(usesRootGroup ? (value) => value.root : identity);\n };\n }\n\n const processDefinition = createDefinitionProcessor($, context, iterate);\n Object.keys(template).forEach((key) => {\n if (typeof template[key] === 'function') {\n extracted[key] = processDefinition(template[key]);\n } else if (typeof template[key] === 'object') {\n extracted[key] = processTemplate($, context, template[key]);\n } else {\n extracted[key] = template[key];\n }\n });\n\n return extracted;\n}", "function Template (arrDOM,parentHead,vars) {\n\tDOM.apply(this,arguments);\n\tthis.mods = {\n\t\tdom: new DOM(this)\n\t\t,html: new fdom.html(this)\n\t\t,md: new fdom.md(this)\n\t\t,emmet: new fdom.emmet(this)\n\t\t,jsonml: new fdom.jsonml(this)\n\t\t,'3390': this\n\t};\n\tthis.mods.markdown = this.mods.md;\n\tthis.mods.json = this.mods.templar;\n\tthis.mods.zen = this.mods.emmet;\n\tthis.vars = vars || {};\n}", "function createPrimaryData() {\n //Only keep the ICH elements and biomes and whc\n nodes_primary = nodes.filter(function (d) {\n return d.type === 'element' || d.group === 'biome';\n });\n var node_by_id_primary = {};\n nodes_primary.forEach(function (d) {\n node_by_id_primary[d.id] = d;\n }); //Only keep the edges which have both source and target remaining\n\n edges_primary = edges.filter(function (d) {\n return node_by_id_primary[d.source] && node_by_id_primary[d.target];\n });\n edges_primary.forEach(function (d) {\n d.focus = 'primary';\n d.opacity = edge_primary_opacity;\n }); // console.log(nodes_primary.length, edges_primary.length)\n } //function createPrimaryData", "function buildPIS()\n{\n var tag = document.createElement(\"p\");\n tag.style.fontSize = \"1.3vw\";\n var text = document.createTextNode(\"Personal Susceptibility Index Not Available At This Time.\");\n tag.appendChild(text);\n var element = document.getElementById(\"personal\");\n element.appendChild(tag);\n}", "getTree() {\n\n return [\n 'procedure',\n this.params,\n this.body ? this.body.getTree() : null,\n this.isService\n ];\n }", "function createSection() {\n return {\n group: false,\n divisor: 0,\n multiplier: 0,\n integral: [],\n fraction: []\n };\n }", "function createSection() {\n return {\n group: false,\n divisor: 0,\n multiplier: 0,\n integral: [],\n fraction: []\n };\n }", "function handleTreeCreation(result) {\n console.log(\"in handleTree\");\n var lines = result.split('\\n'); //put each line of file in list @list\n\n setBagDependencies(lines);\n resizeConstructNodes();\n calculateDegrees();\n mapAngles();\n setAutoMove();\n\n if (prevLayoutNameTd == \"\") {\n //set on truein setlayout\n setLayout(\"customCise\", true);\n } else {\n //TODO should save layout on new load\n setLayout(prevLayoutNameTd, true);\n }\n\n console.log(\"out of handleCreation\");\n}", "function loadInUI(currentNode, parent) {\r\n\t \r\n\t // number of Field Tags at current level\r\n\t\t\tvar count = currentNode.length;\r\n\t\r\n\t\t\tfor( var i = 0 ; i < count ; i++ ) {\r\n\t\r\n\t // To store ith Field Tag object at current level\r\n\t\t\t\tvar content = null;\r\n\t\t\t\tvar tagType ;\r\n\t\t\t\tvar name , type ,xPath ,comment, customAtt;\r\n\t\r\n\t // Identify Type of Field Tag object \r\n\t\t\t\tif(currentNode[i][\"scalar\"]!=undefined) \r\n\t {\r\n\t\t\t\t\tcontent = currentNode[i][\"scalar\"];\r\n\t\t\t\t\ttagType = \"Scalar\";\r\n\t\t\t\t} \r\n\t else if(currentNode[i][\"collection\"]!=undefined)\r\n\t {\r\n\t\t\t\t\tcontent = currentNode[i][\"collection\"];\r\n\t\t\t\t\ttagType = \"Collection\";\r\n\t\t\t\t} \r\n\t else if(currentNode[i][\"composite\"]!=undefined) \r\n\t {\r\n\t\t\t\t\tcontent = currentNode[i][\"composite\"];\r\n\t\t\t\t\ttagType = \"Composite\";\r\n\t\t\t\t} \r\n\t else \r\n\t {\n\t \t//alert(JSON.stringify(currentNode[i]));\r\n\t\t\t\t\talert(\"Invalid Object - Unable to load in UI\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\r\n\t // Every one is identified by an ID which is set to Timestamp at which it is created.\r\n\t // Getting current timestamp\r\n\t\t\t\tvar currentID = new Date();\r\n\t\r\n\t // Fill in all standard field attributes is they exists\r\n\t\t\t\tname = content[\"name\"];\r\n\t\t\t\txPath = content[\"xpath\"]==undefined ? \"\" : content[\"xpath\"];\r\n\t\t\t\tcomment = content[\"comment\"]==undefined ? \"\" : content[\"comment\"];\r\n\t\n\t\t\t\tif(content[\"scalar_type\"] != undefined)\n\t\t\t\t{\n\t\t\t\t\ttype = content[\"scalar_type\"];\n\t\t\t\t}\n\t\t\t\telse if(content[\"child_type\"] != undefined)\n\t\t\t\t{\n\t\t\t\t\ttype = content[\"child_type\"];\n\t\t\t\t}\n\t\t\t\telse if(content[\"type\"] != undefined)\n\t\t\t\t{\n\t\t\t\t\ttype = content[\"type\"];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttype = \"\";\n\t\t\t\t}\n\t\t\t\t\r\n\t // Check existance of custom attributes using global list object customAttributeData\r\n\t\t\t\tcustomAtt = loadCustomAttributes(content);\r\n\t\r\n\t // Add node with all required field. true as 3rd parameter helps in identifying call type. \r\n\t\t\t\tAddNode(name,parent,true,type,xPath,comment,tagType,customAtt,currentID);\r\n\t\r\n\t // If ith Field Tag has kids then make a recursive call for all kids of ith Field tag.\r\n\t\t\t\tif(content[\"kids\"]!=undefined)\r\n\t {\r\n\t\t\t\t\tcurrentID = currentID.getTime();\r\n\t // Calling recursively by incrementing level and ID for parent.\t\t\t\r\n\t \tloadInUI(content[\"kids\"],currentID);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t}", "nodeInfo(item) {\n\t\treturn { leaf: !item.filters };\n\t}", "function portfolioTemplate() {\n\n\t\t// There's for sure a better way to make multiple Objects with different properties and differing child Objects.\n\n\t\t// I just had more important things to optimize last night.\n\n\t\ttemplate = {\n\n\t\t\tdiv0: makeObject(),\n\n\t\t\tdiv2: makeObject(),\n\n\t\t\tdiv3: makeObject(),\n\n\t\t\tdiv1: makeObject(),\n\n\t\t\tdiv5: makeObject(),\n\n\t\t\tdiv4: makeObject(),\n\n\t\t\tdiv6: makeObject(),\n\n\t\t\tdiv8: makeObject(),\n\n\t\t\tdiv7: makeObject(),\n\n\t\t\tdiv9: makeObject(),\n\n\t\t\tdiv11: makeObject(),\n\n\t\t\tdiv10: makeObject(),\n\n\t\t\tdiv12: makeObject(),\n\n\t\t\tdiv14: makeObject(),\n\n\t\t\tdiv13: makeObject(),\n\n\t\t\tdiv15: makeObject(),\n\n\t\t\tdiv17: makeObject(),\n\n\t\t\tdiv16: makeObject(),\n\n\t\t\tdiv18: makeObject(),\n\n\t\t\tdiv19: makeObject()\n\n\t\t}\n\n\t\ttemplate.tag();\n\n\t}", "static getTemplate() {\n return {\n location: null,\n language: null,\n timezone: null,\n locale: null,\n radar: null\n };\n }", "treeTemplatePlus(tree) {\n\t\treturn new PowerTreeTemplate({$powerUi: this, tree: tree, boilerplate: true}).template;\n\t}", "function fillNodeDataIntoCreateNodeModal() {\n const goJsElement = getSelectedGoJsElement();\n const node = goJsElement.sb;\n const chipElementTags = M.Chips.getInstance(document.getElementById(\"inputTags\"));\n const chipElementDepartments = M.Chips.getInstance(document.getElementById(\"inputDepartments\"));\n\n document.getElementById(\"inputName\").value = node.name;\n document.getElementById(\"inputCategory\").value = node.category;\n document.getElementById(\"inputDescription\").value = node.desc;\n pushChipDataToChipElement(chipElementTags, ArrayValueToChipJasonValues(node.tags));\n pushChipDataToChipElement(chipElementDepartments, ArrayValueToChipJasonValues(node.departments));\n document.getElementById(\"inputVersion\").value = node.version;\n document.getElementById(\"inputLicense\").value = node.license;\n document.getElementById(\"inputProfessionalOwner\").value = node.profOwner;\n document.getElementById(\"inputTechnicalOwner\").value = node.techOwner;\n document.getElementById(\"inputStartDate\").value = node.startDate;\n document.getElementById(\"inputShutdownDate\").value = node.shutdownDate;\n}", "function PdfSectionTemplate() {\n var _this = _super.call(this) || this;\n _this.leftValue = _this.topValue = _this.rightValue = _this.bottomValue = _this.stampValue = true;\n return _this;\n }", "function initializeAccountInfo() {\n var accountInfo = {};\n\n // initialize tree root\n accountInfo['accounts'] = { children: [], balanceAll: 0, balanceFiltered: 0 };\n \n accounts.forEach(function(account) {\n accountInfo[account.id] = { parent: account.parent, children: [], balanceAll: 0, balanceFiltered: 0, sign: account.sign };\n });\n return accountInfo;\n }", "function TcPackage() {\n\tthis.FCount = 0;\n\tthis.debug = false;\n}", "function generateAndSaveFormularTemplate() {\n rows = document.getElementById('form block').childElementCount;\n var parentNode = document.createElement('div');\n \n for (var i = 0; i < rows; i++) {\n var rowNode = document.createElement('div');\n\n var newLabel = document.createElement('label');\n newLabel.textContent = document.getElementById('inpt' + (i + 1)).value;\n if (document.getElementById('typeDrop ' + (i + 1) + \"\").value == \"Mandatory\") {\n newLabel.textContent += \"*\";\n }\n if (document.getElementById('typeDrop ' + (i + 1) + \"\").value == \"Numeric\") {\n newLabel.textContent += \"(numeric)\";\n }\n newLabel.className = \"leftMarginForm\";\n newLabel.id = \"lbl \" + (i + 1);\n rowNode.appendChild(newLabel);\n if (document.getElementById('inputType' + (i + 1)).value == \"Text Box\") {\n \n var newInput = document.createElement('input');\n newInput.type = \"text\";\n newInput.id = \"text\" + (i + 1);\n newInput.value = \" \";\n\n newInput.setAttribute('oninput', \"setTextValue(this.id);\")\n newInput.style.paddingRight = \"20%\";\n newInput.style.cssFloat = \"right\";\n newInput.style.marginRight = \"30%\";\n rowNode.appendChild(newInput);\n var line=document.createElement('hr');\n rowNode.appendChild(line);\n }\n\n\n var check1 = document.getElementById('countRadio' + (i + 1) + \" 1\");\n\n var check2 = document.getElementById('countRadio' + (i + 1) + \" 2\");\n\n var check3 = document.getElementById('countRadio' + (i + 1) + \" 3\");\n\n //checking if two radios are in store ,setting them and adding to parent node\n if (check1 && !check2 && !check3) {\n var radioBlock = document.createElement('div');\n\n radioBlock.style.display = \"block\";\n radioBlock.style.marginLeft = \"150px\";\n\n radioBlock.innerHTML = \"<form><input onclick=\\\"radioChangeState(this.id)\\\" name=\\\"option\\\" type=\\\"radio\\\" id=\\\"radio\" + (i + 1) + \" 1\\\" value=\\\"value\" + (i + 1) + \"\\\"> \" + check1.value + \"<br></form>\";\n rowNode.appendChild(radioBlock);\n rowNode.appendChild(document.createElement('hr'));\n\n }\n if (check1 && check2 && !check3) {\n var radioBlock = document.createElement('div');\n\n radioBlock.style.display = \"block\";\n radioBlock.style.marginLeft = \"150px\";\n\n radioBlock.innerHTML = \"<form><input onclick=\\\"radioChangeState(this.id)\\\" name=\\\"option\\\" type=\\\"radio\\\" id=\\\"radio\" + (i + 1) + \" 1\\\" value=\\\"value\" + (i + 1) + \"\\\"> \" + check1.value + \"<br><input onclick=\\\"radioChangeState(this.id)\\\" name=\\\"option\\\" type=\\\"radio\\\" id=\\\"radio\" + (i + 1) + \" 2\\\" value=\\\"value\" + (i + 2) + \"\\\"> \" + check2.value + \"<br></form>\";\n rowNode.appendChild(radioBlock);\n rowNode.appendChild(document.createElement('hr'));\n\n }\n //checking if all three radios are present in store,setting them and adding to parent node\n if (check1 && check2 && check3) {\n var radioBlock = document.createElement('div');\n\n radioBlock.style.display = \"block\";\n radioBlock.style.marginLeft = \"150px\";\n radioBlock.innerHTML = \"<form><input onclick=\\\"radioChangeState(this.id)\\\" name=\\\"option\\\" type=\\\"radio\\\" id=\\\"radio\" + (i + 1) + \" 1\\\" value=\\\"value\" + (i + 1) + \"\\\"> \" + check1.value + \"<br><input onclick=\\\"radioChangeState(this.id)\\\" name=\\\"option\\\" type=\\\"radio\\\" id=\\\"radio\" + (i + 1) + \" 2\\\" value=\\\"value\" + (i + 2) + \"\\\"> \" + check2.value + \"<br><input onclick=\\\"radioChangeState(this.id)\\\" name=\\\"option\\\" type=\\\"radio\\\" id=\\\"radio\" + (i + 1) + \" 3\\\" value=\\\"value\" + (i + 3) + \"\\\"> \" + check3.value + \"<br></form>\";\n rowNode.appendChild(radioBlock);\n rowNode.appendChild(document.createElement('hr'));\n }\n\n\n var check1 = document.getElementById('countCheck' + (i + 1) + \" 1\");\n\n var check2 = document.getElementById('countCheck' + (i + 1) + \" 2\");\n\n var check3 = document.getElementById('countCheck' + (i + 1) + \" 3\");\n //selection will be executed if only first checkbox is present in store\n if (check1 && !check2 && !check3) {\n var checkBlock = document.createElement('div');\n checkBlock.style.display = \"block\";\n checkBlock.style.marginLeft = \"150px\";\n checkBlock.innerHTML = \"<form><input onchange=\\\"checkBoxStateChanged(this.id)\\\" type=\\\"checkbox\\\" id=\\\"check\" + (i + 1) + \"1\\\">\" + check1.value + \"</form>\";\n rowNode.appendChild(checkBlock);\n rowNode.appendChild(document.createElement('hr'));\n }\n\n //selection will be executed if two checkboxes are present in store\n if (check1 && check2 && !check3) {\n var checkBlock = document.createElement('div');\n checkBlock.style.display = \"block\";\n checkBlock.style.marginLeft = \"150px\";\n checkBlock.innerHTML = \"<form><input onchange=\\\"checkBoxStateChanged(this.id)\\\" type=\\\"checkbox\\\" id=\\\"check\" + (i + 1) + \" 1\\\">\" + check1.value + \"<br><input checked=\\\"unchecked\\\" onchange=\\\"checkBoxStateChanged(this.id)\\\" type=\\\"checkbox\\\" id=\\\"check\" + (i + 1) + \" 2\\\">\" + check2.value + \"</form>\";\n rowNode.appendChild(checkBlock);\n rowNode.appendChild(document.createElement('hr'));\n }\n\n //selection will be executed if all three checkboxes are present\n if (check1 && check2 && check3) {\n var checkBlock = document.createElement('div');\n checkBlock.style.display = \"block\";\n checkBlock.style.marginLeft = \"150px\";\n checkBlock.innerHTML = \"<form><input onclick=\\\"checkBoxStateChanged(this.id)\\\" type=\\\"checkbox\\\" id=\\\"check\" + (i + 1) + \" 1\\\">\" + check1.value + \"<br><input onclick=\\\"checkBoxStateChanged(this.id)\\\" type=\\\"checkbox\\\" id=\\\"check\" + (i + 1) + \" 2\\\">\" + check2.value + \"<br><input onclick=\\\"checkBoxStateChanged(this.id)\\\" type=\\\"checkbox\\\" id=\\\"check\" + (i + 1) + \" 3\\\">\" + check3.value + \"</form>\";\n rowNode.appendChild(checkBlock);\n rowNode.appendChild(document.createElement('hr'));\n }\n parentNode.appendChild(rowNode);\n \n }\n //formular template will be aded in two object stores,first templates for admin panel and second as empty version for formular tab\n addFormularTemplateToDB(parentNode.innerHTML, document.getElementById('search').value);\n addToFormularData(parentNode.innerHTML, document.getElementById('search').value);\n //after save function will refresh formular list in formular tab\n updateFormularList();\n}", "function openRootTemplate(tmp) {\n\n // Create an \"empty\" template\n var template = {\n raw: undefined,\n pre: undefined,\n dom: undefined,\n root: undefined,\n parent: undefined,\n view: undefined\n }\n\n // Set the root \"root\"\n template.root = template;\n\n // Establish the pattern thhat identifies \"id\" from \"raw\" temlate\n var pattern = /^[a-z0-9]+$/i;\n\n // Establish the \"raw\" template - \"id\" may be a reference to a \"template\" located in the DOM or raw HTML template text \n if (pattern.test(tmp) == true)\n template.raw = loadTemplate(tmp);\n else\n template.raw = tmp;\n\n // Pre-Proccess the template\n template = preProcessTemplate(template);\n\n // Set the \"dom\"\n template.dom = parseTemplateHTML(template.pre);\n\n // Return \n return template;\n\n }", "function testInstantiateTemplate_children() {\r\n var template = ShadowTemplates[\"imageT\"];\r\n var dictionaryContext =\r\n [{\"image\": [{\"src\":\"http://images/complex.jpg\", \"alt\":\"ALT0\"},\r\n {\"src\":\"http://images/simple.jpg\", \"alt\":\"ALT1\"}]}];\r\n var instance = template.instantiateDom(dictionaryContext, '');\r\n document.body.insertBefore(instance, document.body.childNodes[0]);\r\n var imageElement0 = document.getElementById(\"image.0\");\r\n assertEquals(\"http://images/complex.jpg\",\r\n imageElement0.getAttribute('xbl2:src'));\r\n assertEquals(\"ALT0\", imageElement0.alt);\r\n var imageElement1 = document.getElementById(\"image.1\");\r\n assertEquals(\"http://images/simple.jpg\",\r\n imageElement1.getAttribute('xbl2:src'));\r\n assertEquals(\"ALT1\", imageElement1.alt);\r\n}", "function setupPrimaryPlacement() {\n //Find the location where the biome should center\n biomes.forEach(function (d, i) {\n d.degree = edges_primary.filter(function (l) {\n return l.source.id == d.id || l.target.id == d.id;\n }).length;\n d.angle = pi2 * i / biomes.length;\n d.x = d.focusX = radius_primary * Math.cos(d.angle);\n d.y = d.focusY = radius_primary * Math.sin(d.angle);\n d.fx = d.x;\n d.fy = d.y;\n }); //forEach\n //Set the central \"gravity\" point for each node and a first location\n\n nodes_primary.forEach(function (d) {\n //Get the angle\n var angle = d.type === 'element' ? biome_by_id[d.biome_main].angle : biome_by_id[d.id].angle; //Set the center focus\n\n d.focusX = radius_primary * Math.cos(angle);\n d.focusY = radius_primary * Math.sin(angle);\n d.x = d.focusX + Math.random();\n d.y = d.focusY + Math.random();\n }); //forEach\n } //function setupPrimaryPlacement", "static nodedef() {\n let def = this.toolDefine();\n return {\n name : def.name,\n uiName : def.uiName,\n flag : def.nodeFlag,\n icon : def.icon,\n inputs : def.nodeInputs,\n outputs : def.nodeOutputs\n }\n }", "static fields () {\n return {\n cod: this.attr(null),\n titulo: this.attr(''),\n precio: this.attr('')\n }\n }", "function template(){\n vm.docDefinition = {\n content: [\n {\n image: logo_bekasi,\n width: 90,\n height: 90\n },\n {\n margin: [90, -96, 0, 0],\n table: {\n widths: [400],\n body: [\n [\n {\n border: [false, false, false, false],\n text: 'PEMERINTAHAN KABUPATEN BEKASI',\n style: 'header'\n }\n ]\n ]\n }\n },\n {\n margin: [90, -5, 0, 0],\n table: {\n widths: [400],\n body: [\n [\n {\n border: [false, false, false, false],\n text: 'DINAS KOMUNIKASI DAN INFORMATIKA PERSANDIAN DAN STATISTIK',\n style: 'header'\n }\n ]\n ]\n },\n },\n {\n margin: [175, -5, 0, 0],\n table: {\n widths: [230],\n body: [\n [\n {\n border: [false, false, false, false],\n text: 'Komplek Perkantoran Pemerintah Kabupaten Bekasi Desa Sukamahi Kecamatan Cikarang Pusat',\n style: 'header2'\n }\n ]\n ]\n },\n },\n {\n margin: [115, -5, 0, 0],\n table: {\n widths: [90, 90, 150],\n body: [\n [\n {\n border: [false, false, false, false],\n text: 'Telp. (021) 89970696',\n fontSize: 9,\n alignment: 'right'\n },{\n border: [false, false, false, false],\n text: 'Fax. (021) 89970064',\n fontSize: 9,\n alignment: 'center'\n },{\n border: [false, false, false, false],\n text: 'email : [email protected]',\n fontSize: 9,\n alignment: 'left'\n }\n ]\n ]\n },\n },\n {\n margin: [0, 10, 0, 0],\n table: {\n widths: ['*'],\n body: [\n [\n {\n }\n ]\n ]\n },\n layout: {\n fillColor: 'Black'\n }\n },\n {\n text: '' + EkinerjaService.IndonesianDateFormat(vm.item.tanggal),\n margin: [0,20,0,0],\n alignment: 'right',\n fontSize: 10\n },\n {\n margin: [0, 10, 0, 0],\n table: {\n widths: [100],\n body: [\n [\n {\n border: [false, false, false, false],\n rowSpan: 3,\n text: 'Yth. ' + vm.item.pegawaiPenerima.nama,\n fontSize: 10\n }\n ],\n [\n {\n }\n ],\n [\n {\n }\n ]\n ]\n }\n },\n {\n margin: [0,30,0,0],\n text: 'SURAT PENGANTAR',\n style: 'header'\n },\n {\n margin: [0,0,0,0],\n text: 'NOMOR : '+ vm.item.nomorSurat +'/' + vm.item.nomorSurat1 + '/'+ vm.item.nomorSurat2 +'/' + ((new Date()).getYear() + 1900),\n fontSize: 10,\n alignment: 'center'\n },\n {\n margin: [0, 20, 0, 0],\n table:{\n widths: ['auto', 205, 130, 130],\n body: [\n [\n {\n text: 'No.',\n fontSize: 10,\n alignment: 'center'\n },\n {\n text: 'Naskah Dinas yang Dikirimkan',\n fontSize: 10,\n alignment: 'center'\n },\n {\n text: 'Banyaknya',\n fontSize: 10,\n alignment: 'center'\n },\n {\n text: 'Keterangan',\n fontSize: 10,\n alignment: 'center'\n }\n ]\n ]\n }\n },\n {\n margin: [0, 40, 0, 0],\n text: 'Di Terima Tanggal :',\n fontSize: 10\n },\n {\n margin: [92, -11.5, 0 ,0],\n text: '',\n fontSize: 10\n },\n {\n margin: [0, 30, 0 , 0],\n text: 'Penerima',\n fontSize: 10\n },\n {\n text: '' + vm.item.pegawaiPenerima.jabatan,\n fontSize: 10\n },\n {\n margin: [0, 50, 0, 0],\n text: '' + vm.item.pegawaiPenerima.nama,\n fontSize: 10\n },\n {\n text: '' + vm.item.pegawaiPenerima.nipPegawai,\n fontSize: 10\n },\n {\n margin: [300, -94, 0 , 0],\n text: 'Pengirim',\n fontSize: 10\n },\n {\n margin: [300, 0, 0, 0],\n text: '' + vm.item.pegawaiPembuat.jabatan,\n fontSize: 10\n },\n {\n margin: [300, 54, 0, 0],\n text: '' + vm.item.pegawaiPembuat.nama,\n fontSize: 10\n },\n {\n margin: [300, 0, 0, 0],\n text: ''+ vm.item.pegawaiPembuat.nipPegawai,\n fontSize: 10\n },\n {\n margin: [0, 40, 0, 0],\n text: 'No. Telephone :',\n fontSize: 10\n },\n {\n margin: [78, -11.5, 0 ,0],\n text: '' + vm.item.telepon,\n fontSize: 10\n }\n ],\n styles: {\n header: {\n bold: true,\n fontSize: 15,\n alignment: 'center'\n },\n header2: {\n fontSize: 10,\n alignment: 'center'\n }\n }\n };\n for(var i = 0; i < vm.isi.length; i++)\n vm.docDefinition.content[10].table.body.push([\n {\n text: '' + (i+1),\n fontSize: 10,\n alignment: 'center'\n },\n {\n text: '' + vm.isi[i].naskah,\n fontSize: 10\n },\n {\n text: '' + vm.isi[i].qty,\n fontSize: 10\n },\n {\n text: '' + vm.isi[i].keterangan,\n fontSize: 10\n }\n ]);\n console.log(vm.docDefinition.content[10]);\n\n }", "function CreateInfFile()\n{\n\ttry\n\t{\n\t\tvar oFSO, TemplatesFolder, TemplateFiles, strTemplate;\n\t\toFSO = new ActiveXObject(\"Scripting.FileSystemObject\");\n\n\t\tvar TemporaryFolder = 2;\n\t\tvar oFolder = oFSO.GetSpecialFolder(TemporaryFolder);\n\n\t\tvar strTempFolder = oFSO.GetAbsolutePathName(oFolder.Path);\n\t\tvar strWizTempFile = strTempFolder + \"\\\\\" + oFSO.GetTempName();\n\n\t\tvar strTemplatePath = wizard.FindSymbol(\"TEMPLATES_PATH\");\n\t\tvar strInfFile = strTemplatePath + \"\\\\Templates.inf\";\n\t\twizard.RenderTemplate(strInfFile, strWizTempFile);\n\n\t\tvar oWizTempFile = oFSO.GetFile(strWizTempFile);\n\t\treturn oWizTempFile;\n\n\t}\n\tcatch(e)\n\t{ \n\t\tthrow e;\n\t}\n}", "function constructCustomerTree() {\n var customers = vm.customers;\n //Sort customer list alphabetically\n customers.sort(function (a, b) {\n if (a.name.toUpperCase() < b.name.toUpperCase())\n return -1;\n if (a.name.toUpperCase() > b.name.toUpperCase())\n return 1;\n return 0;\n });\n\n var treeElement = document.getElementById(\"TEST11\");\n \n //Rewrite string to inject into Predix px-tree component\n let string = \"[\";\n for (let i = 0; i < customers.length; i++) {\n customerList.push(customers[i]);\n string += \"{\\\"label\\\":\\\"\";\n string += customers[i].name;\n string += \"\\\",\";\n string += \"\\\"id\\\":\\\"\";\n string += customers[i]._id;\n string += \"\\\",\\\"isSelectable\\\": true,\\\"children\\\":[\";\n var strcheck0 = string;\n \n for (let j = 0; j < customers[i].orders.length; j++) {\n string += \"{\\\"label\\\":\\\"Order #\";\n string += customers[i].orders[j].index + 1;\n string += \"\\\",\";\n string += \"\\\"id\\\":\\\"\";\n string += customers[i].orders[j].id;\n string += \"\\\",\\\"isSelectable\\\": true,\\\"children\\\":[\";\n var strcheck1 = string;\n \n for (let k = 0; k < customers[i].orders[j].shipments.length; k++) {\n string += \"{\\\"label\\\":\\\"\";\n string += \"Shipment #\" + (k + 1);\n string += \"\\\",\\\"id\\\":\\\"\";\n string += customers[i].orders[j].shipments[k].id;\n string += \"\\\"},\";\n }\n if (strcheck1 !== string)\n string = string.substring(0, string.length - 1);\n string += \"]},\";\n }\n if (strcheck0 !== string)\n string = string.substring(0, string.length - 1);\n string += \"]},\";\n }\n string = string.substring(0, string.length - 1);\n string += \"]\";\n \n //Inject Predix component with concatenated string\n treeElement.attributes.items.value = string;\n \n }", "function nodeTemplate(diagram, node) {\n node.labels[0].text = node.Name;\n}", "function createPrintStructureStatoPatrimoniale() {\n\n\tvar printStructure = [];\n\n\tprintStructure.push({\"dialogText\":\"STATO PATRIMONIALE -- DETTAGLIO MOVIMENTI --\", \"titleText\":\"RENDICONTO STATO PATRIMONIALE ANNO %1 DETTAGLIO MOVIMENTI\"});\n\n\tprintStructure.push({\"id\":\"dA\", \"isTitle\":true, \"newpage\":false});\n\tprintStructure.push({\"id\":\"AA\"});\n\tprintStructure.push({\"id\":\"dAB\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"dABI\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ABI1\"});\n\tprintStructure.push({\"id\":\"ABI2\"});\n\tprintStructure.push({\"id\":\"ABI3\"});\n\tprintStructure.push({\"id\":\"ABI4\"});\n\tprintStructure.push({\"id\":\"ABI5\"});\n\tprintStructure.push({\"id\":\"ABI6\"});\n\tprintStructure.push({\"id\":\"ABI7\"});\n\tprintStructure.push({\"id\":\"ABI\"});\n\tprintStructure.push({\"id\":\"dABII\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ABII1\"});\n\tprintStructure.push({\"id\":\"ABII2\"});\n\tprintStructure.push({\"id\":\"ABII3\"});\n\tprintStructure.push({\"id\":\"ABII4\"});\n\tprintStructure.push({\"id\":\"ABII5\"});\n\tprintStructure.push({\"id\":\"ABII\"});\n\tprintStructure.push({\"id\":\"dABIII\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ABIII1\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ABIII1a\"});\n\tprintStructure.push({\"id\":\"ABIII1b\"});\n\tprintStructure.push({\"id\":\"ABIII1c\"});\n\tprintStructure.push({\"id\":\"ABIII2\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ABIII2a\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ABIII2ae\"});\n\tprintStructure.push({\"id\":\"ABIII2ao\"});\n\tprintStructure.push({\"id\":\"ABIII2b\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ABIII2be\"});\n\tprintStructure.push({\"id\":\"ABIII2bo\"});\n\tprintStructure.push({\"id\":\"ABIII2c\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ABIII2ce\"});\n\tprintStructure.push({\"id\":\"ABIII2co\"});\n\tprintStructure.push({\"id\":\"ABIII2d\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ABIII2de\"});\n\tprintStructure.push({\"id\":\"ABIII2do\"});\n\tprintStructure.push({\"id\":\"ABIII3\"});\n\tprintStructure.push({\"id\":\"ABIII\"});\n\tprintStructure.push({\"id\":\"AB\"});\n\tprintStructure.push({\"id\":\"dAC\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"dACI\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACI1\"});\n\tprintStructure.push({\"id\":\"ACI2\"});\n\tprintStructure.push({\"id\":\"ACI3\"});\n\tprintStructure.push({\"id\":\"ACI4\"});\n\tprintStructure.push({\"id\":\"ACI5\"});\n\tprintStructure.push({\"id\":\"ACI\"});\n\tprintStructure.push({\"id\":\"dACII\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII1\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII1e\"});\n\tprintStructure.push({\"id\":\"ACII1o\"});\n\tprintStructure.push({\"id\":\"ACII2\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII2e\"});\n\tprintStructure.push({\"id\":\"ACII2o\"});\n\tprintStructure.push({\"id\":\"ACII3\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII3e\"});\n\tprintStructure.push({\"id\":\"ACII3o\"});\n\tprintStructure.push({\"id\":\"ACII4\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII4e\"});\n\tprintStructure.push({\"id\":\"ACII4o\"});\n\tprintStructure.push({\"id\":\"ACII5\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII5e\"});\n\tprintStructure.push({\"id\":\"ACII5o\"});\n\tprintStructure.push({\"id\":\"ACII6\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII6e\"});\n\tprintStructure.push({\"id\":\"ACII6o\"});\n\tprintStructure.push({\"id\":\"ACII7\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII7e\"});\n\tprintStructure.push({\"id\":\"ACII7o\"});\n\tprintStructure.push({\"id\":\"ACII8\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII8e\"});\n\tprintStructure.push({\"id\":\"ACII8o\"});\n\tprintStructure.push({\"id\":\"ACII9\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII9e\"});\n\tprintStructure.push({\"id\":\"ACII9o\"});\n\tprintStructure.push({\"id\":\"ACII10\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII10e\"});\n\tprintStructure.push({\"id\":\"ACII10o\"});\n\tprintStructure.push({\"id\":\"ACII11\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII11e\"});\n\tprintStructure.push({\"id\":\"ACII11o\"});\n\tprintStructure.push({\"id\":\"ACII12\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACII12e\"});\n\tprintStructure.push({\"id\":\"ACII12o\"});\n\tprintStructure.push({\"id\":\"ACII\"});\n\tprintStructure.push({\"id\":\"dACIII\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACIII1\"});\n\tprintStructure.push({\"id\":\"ACIII2\"});\n\tprintStructure.push({\"id\":\"ACIII3\"});\n\tprintStructure.push({\"id\":\"ACIII\"});\n\tprintStructure.push({\"id\":\"dACIV\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"ACIV1\"});\n\tprintStructure.push({\"id\":\"ACIV2\"});\n\tprintStructure.push({\"id\":\"ACIV3\"});\n\tprintStructure.push({\"id\":\"ACIV\"});\n\tprintStructure.push({\"id\":\"AC\"});\n\tprintStructure.push({\"id\":\"AD\"});\n\tprintStructure.push({\"id\":\"A\"});\n\n\tprintStructure.push({\"id\":\"dP\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"dPA\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PAI\"});\n\tprintStructure.push({\"id\":\"dPAII\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PAII1\"});\n\tprintStructure.push({\"id\":\"PAII2\"});\n\tprintStructure.push({\"id\":\"PAII3\"});\n\tprintStructure.push({\"id\":\"PAII\"});\n\tprintStructure.push({\"id\":\"dPAIII\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PAIII1\"});\n\tprintStructure.push({\"id\":\"PAIII2\"});\n\tprintStructure.push({\"id\":\"PAIII\"});\n\tprintStructure.push({\"id\":\"PAIV\"});\n\tprintStructure.push({\"id\":\"PA\"});\n\tprintStructure.push({\"id\":\"dPB\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PB1\"});\n\tprintStructure.push({\"id\":\"PB2\"});\n\tprintStructure.push({\"id\":\"PB3\"});\n\tprintStructure.push({\"id\":\"PB\"});\n\tprintStructure.push({\"id\":\"PC\"});\n\tprintStructure.push({\"id\":\"dPD\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD1\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD1e\"});\n\tprintStructure.push({\"id\":\"PD1o\"});\n\tprintStructure.push({\"id\":\"PD2\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD2e\"});\n\tprintStructure.push({\"id\":\"PD2o\"});\n\tprintStructure.push({\"id\":\"PD3\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD3e\"});\n\tprintStructure.push({\"id\":\"PD3o\"});\n\tprintStructure.push({\"id\":\"PD4\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD4e\"});\n\tprintStructure.push({\"id\":\"PD4o\"});\n\tprintStructure.push({\"id\":\"PD5\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD5e\"});\n\tprintStructure.push({\"id\":\"PD5o\"});\n\tprintStructure.push({\"id\":\"PD6\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD6e\"});\n\tprintStructure.push({\"id\":\"PD6o\"});\n\tprintStructure.push({\"id\":\"PD7\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD7e\"});\n\tprintStructure.push({\"id\":\"PD7o\"});\n\tprintStructure.push({\"id\":\"PD8\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD8e\"});\n\tprintStructure.push({\"id\":\"PD8o\"});\n\tprintStructure.push({\"id\":\"PD9\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD9e\"});\n\tprintStructure.push({\"id\":\"PD9o\"});\n\tprintStructure.push({\"id\":\"PD10\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD10e\"});\n\tprintStructure.push({\"id\":\"PD10o\"});\n\tprintStructure.push({\"id\":\"PD11\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD11e\"});\n\tprintStructure.push({\"id\":\"PD11o\"});\n\tprintStructure.push({\"id\":\"PD12\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"PD12e\"});\n\tprintStructure.push({\"id\":\"PD12o\"});\n\tprintStructure.push({\"id\":\"PD\"});\n\tprintStructure.push({\"id\":\"PE\"});\n\tprintStructure.push({\"id\":\"P\"});\n\n\treturn printStructure;\n}", "function Cluster_templateObject() {\n var data = Cluster_taggedTemplateLiteral([\"\\n align-items: center;\\n justify-content: center;\\n\"]);\n\n Cluster_templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}", "buildTree() {\n // note: in this function you will assign positions and levels by making calls to assignPosition() and assignLevel()\n let rootNode = this.nodeList.find(theRootNode => theRootNode.parentName === \"root\");\n this.assignLevel(rootNode, 0);\n this.assignPosition(rootNode, 0);\n }", "function traverse_and_fill(curr_node, site_pi_fields, my_slave_tab, level) {\n if (curr_node.parent == null) {\n\tconsole.log(\"APPU DEBUG: Creating root process_div\");\n\t//This is the root node. So we should be good to process next kid.\n\tcurr_node.process_next_kid = true;\n\n\t//Also create a <div> element and attach it to main body.\n\t//This will be used to indicate that the current child has been\n\t//processed upto its leaf node.\n\t//Current level(which will be 0) and since this node is root, child number = 0;\n\tvar dummy_tab_id = sprintf('child-processing-complete-%s-%s-%s', my_slave_tab.tabid, level, \"0\");\n\tvar dummy_div_str = sprintf('<div id=\"%s\"></div>', dummy_tab_id);\n\tvar dummy_div = $(dummy_div_str);\n\t$('body').append(dummy_div);\n\tcurr_node.child_processing_div = dummy_div;\n\n\tconsole.log(\"APPU DEBUG: TRAVERSE_AND_FILL(), curr_node: \" + curr_node.name + \", PROCEEDING (ROOT)\");\n\tprocess_action(curr_node, $(curr_node.xml_node).children('action'), \n\t\t site_pi_fields, my_slave_tab, level);\n }\n else {\n\t//We are not root node.\n\tvar dummy_tab_id = sprintf('child-processing-complete-%s-%s-%s', my_slave_tab.tabid, \n\t\t\t\t level, curr_node.sibling_num);\n\tvar dummy_div_str = sprintf('<div id=\"%s\"></div>', dummy_tab_id);\n\tvar dummy_div = $(dummy_div_str);\n\t$($(curr_node.parent.child_processing_div)).append(dummy_div);\n\tcurr_node.child_processing_div = dummy_div;\n\n\tif (curr_node.parent.process_next_kid == true) {\n\t curr_node.parent.process_next_kid = false;\n\t curr_node.process_next_kid = true;\n\t console.log(\"APPU DEBUG: TRAVERSE_AND_FILL(), curr_node: \" + curr_node.name + \", PROCEEDING\");\n\t process_action(curr_node, $(curr_node.xml_node).children('action'), \n\t\t\t site_pi_fields, my_slave_tab, level);\n\t}\n\telse {\n\t curr_node.process_next_kid = false;\n\t console.log(\"APPU DEBUG: TRAVERSE_AND_FILL(), curr_node: \" + curr_node.name + \", SLEEPING\");\n\t wait_on_sibling_processing_to_finish(curr_node, site_pi_fields, my_slave_tab, level);\n\t}\n }\n}", "prepareNodes() {\n const render = (node) => {\n node.html = nodeToHTML(node);\n node.nodesHTML = subnodesToHTML(node.nodes);\n\n const dimensions = getDimensions(node.html, {}, 'mindmap-node');\n node.width = dimensions.width;\n node.height = dimensions.height;\n\n const nodesDimensions = getDimensions(node.nodesHTML, {}, 'mindmap-subnode-text');\n node.nodesWidth = nodesDimensions.width;\n node.nodesHeight = nodesDimensions.height;\n };\n\n this.props.nodes.forEach(node => render(node));\n }", "function preTaskListT1NoSecurity() {\n departureDeclarationPage()\n lrnPage(getLRN())\n additionalDeclarationTypePage(getLRN(), 'value')\n officeOfDeparturePage(getLRN(), 'GB000068')\n procedureTypePage(getLRN(), 'value')\n declarationTypePage(getLRN(), 'value')\n securityDetails(getLRN(), 'value')\n preTaskListCYA(getLRN())\n taskListPage(getLRN())\n}", "function initializeNode() {\r\n // set root fixed in the middle\r\n root.fixed = true;\r\n root.x = mC.panelWidth / 2;\r\n root.y = mC.panelHeight / 2;\r\n root.px = mC.panelWidth / 2;\r\n root.py = mC.panelHeight / 2;\r\n // assign locations for nodes\r\n initialNodes.forEach(function(d) {\r\n if (d.type != \"root\") {\r\n var location = setInitialLocation(d);\r\n d.x = location[0];\r\n d.y = location[1];\r\n d.px = location[0];\r\n d.py = location[1];\r\n }\r\n // for each node type create new tempNode and add them to their lookup\r\n if (d.type == \"dp\") {\r\n d.fixed = true;\r\n var newTempDpNode = new tempDpNode(d.id, d.type, d.label);\r\n tempDpNodes.push(newTempDpNode);\r\n tempDpNodes_lookup[newTempDpNode.id] = newTempDpNode;\r\n }\r\n if (d.type == \"dec\") {\r\n var newTempDecNode = new tempDecNode(d.id, d.type, d.label, d.parent);\r\n tempDecNodes.push(newTempDecNode);\r\n tempDecNodes_lookup[newTempDecNode.id] = newTempDecNode;\r\n }\r\n if (d.type == \"out\") {\r\n var newTempNode = new tempNode(\"out\" + d.parent, d.id, d.type, d.label,\r\n d.parent);\r\n tempNodes.push(newTempNode);\r\n tempNodes_lookup[newTempNode.id] = newTempNode;\r\n }\r\n\r\n });\r\n }", "function CreateInfFile()\r\n{\r\n\ttry\r\n\t{\r\n\t\tvar oFSO, TemplatesFolder, TemplateFiles, strTemplate;\r\n\t\toFSO = new ActiveXObject(\"Scripting.FileSystemObject\");\r\n\r\n\t\tvar TemporaryFolder = 2;\r\n\t\tvar oFolder = oFSO.GetSpecialFolder(TemporaryFolder);\r\n\r\n\t\tvar strTempFolder = oFSO.GetAbsolutePathName(oFolder.Path);\r\n\t\tvar strWizTempFile = strTempFolder + \"\\\\\" + oFSO.GetTempName();\r\n\r\n\t\tvar strTemplatePath = wizard.FindSymbol(\"TEMPLATES_PATH\");\r\n\t\tvar strInfFile = strTemplatePath + \"\\\\Templates.inf\";\r\n\t\twizard.RenderTemplate(strInfFile, strWizTempFile);\r\n\r\n\t\tvar oWizTempFile = oFSO.GetFile(strWizTempFile);\r\n\t\treturn oWizTempFile;\r\n\r\n\t}\r\n\tcatch(e)\r\n\t{ \r\n\t\tthrow e;\r\n\t}\r\n}", "function initNodeSpace(){\n\tvar owner = this.patcher.box;\n\tif(owner != null){\n\t\towner = this.patcher.box;\n\t\tif(owner != null){\n // get the node abstraction file names \n var nodepath = owner.patcher.filepath;\n myNodeFileName = nodepath.substring(nodepath.lastIndexOf(\"/\") + 1, nodepath.lastIndexOf(\".\"));\n \n var nodeName = myNodeFileName.substring(8, myNodeFileName.length); // cutting away 'bs.node.'\n if(myNodeEnableBody == 1){\n myNodePBodyFileName = \"bs.props.\" + nodeName + \".p\";\n } else if (myNodeEnableBody == 2){\n myNodePBodyFileName = \"bs.props.\" + nodeName + \".b\";\n }\n myNodePropsFileName = \"bs.props.\" + nodeName + \".p\";\n \n vpl_nodeBox = owner.patcher.box;\n\t\t\tif(vpl_nodeBox != null){\n\t\t\t\tvpl_nodeSpacePatcher = vpl_nodeBox.patcher;\n\t\t\t} else {\n post(\"didnt find nodespacepatcher\\n\");\n }\n\t\t}\n\t}\n}", "function generateTree(){\n //empty the tree section\n try{\n $('#treeDiv').html(\"\");\n $('#tree').jstree().destroy();\n } catch(e){}\n //call the tree builder\n sakura.apis.operator.get_file_tree().then(print_file_tree);\n}", "function createPrintStructureRendicontoCassa() {\n\n\tvar printStructure = [];\n\n\tprintStructure.push({\"dialogText\":\"RENDICONTO PER CASSA -- DETTAGLIO MOVIMENTI --\", \"titleText\":\"RENDICONTO PER CASSA ANNO %1 CON DETTAGLIO MOVIMENTI\"});\n\n\tprintStructure.push({\"id\":\"dC\", \"isTitle\":true, \"newpage\":false});\n\tprintStructure.push({\"id\":\"dCA\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CA1\"});\n\tprintStructure.push({\"id\":\"CA2\"});\n\tprintStructure.push({\"id\":\"CA3\"});\n\tprintStructure.push({\"id\":\"CA4\"});\n\tprintStructure.push({\"id\":\"CA7\"});\n\tprintStructure.push({\"id\":\"CA\"});\n\tprintStructure.push({\"id\":\"dCB\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CB1\"});\n\tprintStructure.push({\"id\":\"CB2\"});\n\tprintStructure.push({\"id\":\"CB3\"});\n\tprintStructure.push({\"id\":\"CB4\"});\n\tprintStructure.push({\"id\":\"CB7\"});\n\tprintStructure.push({\"id\":\"CB\"});\n\tprintStructure.push({\"id\":\"dCC\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CC1\"});\n\tprintStructure.push({\"id\":\"CC2\"});\n\tprintStructure.push({\"id\":\"CC3\"});\n\tprintStructure.push({\"id\":\"CC\"});\n\tprintStructure.push({\"id\":\"dCD\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CD1\"});\n\tprintStructure.push({\"id\":\"CD2\"});\n\tprintStructure.push({\"id\":\"CD3\"});\n\tprintStructure.push({\"id\":\"CD4\"});\n\tprintStructure.push({\"id\":\"CD6\"});\n\tprintStructure.push({\"id\":\"CD\"});\n\tprintStructure.push({\"id\":\"dCE\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CE1\"});\n\tprintStructure.push({\"id\":\"CE2\"});\n\tprintStructure.push({\"id\":\"CE3\"});\n\tprintStructure.push({\"id\":\"CE4\"});\n\tprintStructure.push({\"id\":\"CE7\"});\n\tprintStructure.push({\"id\":\"CE\"});\n\tprintStructure.push({\"id\":\"C\"});\n\n\tprintStructure.push({\"id\":\"dR\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"dRA\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RA1\"});\n\tprintStructure.push({\"id\":\"RA2\"});\n\tprintStructure.push({\"id\":\"RA3\"});\n\tprintStructure.push({\"id\":\"RA4\"});\n\tprintStructure.push({\"id\":\"RA5\"});\n\tprintStructure.push({\"id\":\"RA6\"});\n\tprintStructure.push({\"id\":\"RA7\"});\n\tprintStructure.push({\"id\":\"RA8\"});\n\tprintStructure.push({\"id\":\"RA9\"});\n\tprintStructure.push({\"id\":\"RA10\"});\n\tprintStructure.push({\"id\":\"RA\"});\n\tprintStructure.push({\"id\":\"dRB\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RB1\"});\n\tprintStructure.push({\"id\":\"RB2\"});\n\tprintStructure.push({\"id\":\"RB4\"});\n\tprintStructure.push({\"id\":\"RB5\"});\n\tprintStructure.push({\"id\":\"RB6\"});\n\tprintStructure.push({\"id\":\"RB\"});\n\tprintStructure.push({\"id\":\"dRC\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RC1\"});\n\tprintStructure.push({\"id\":\"RC2\"});\n\tprintStructure.push({\"id\":\"RC3\"});\n\tprintStructure.push({\"id\":\"RC\"});\n\tprintStructure.push({\"id\":\"dRD\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RD1\"});\n\tprintStructure.push({\"id\":\"RD2\"});\n\tprintStructure.push({\"id\":\"RD3\"});\n\tprintStructure.push({\"id\":\"RD4\"});\n\tprintStructure.push({\"id\":\"RD5\"});\n\tprintStructure.push({\"id\":\"RD\"});\n\tprintStructure.push({\"id\":\"dRE\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RE1\"});\n\tprintStructure.push({\"id\":\"RE2\"});\n\tprintStructure.push({\"id\":\"RE\"});\n\tprintStructure.push({\"id\":\"R\"});\n\t//printStructure.push({\"id\":\"IM\"});\n\n\tprintStructure.push({\"id\":\"dCF\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"CF1\"});\n\tprintStructure.push({\"id\":\"CF2\"});\n\tprintStructure.push({\"id\":\"CF3\"});\n\tprintStructure.push({\"id\":\"CF4\"});\n\tprintStructure.push({\"id\":\"CF\"});\n\tprintStructure.push({\"id\":\"dRF\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RF1\"});\n\tprintStructure.push({\"id\":\"RF2\"});\n\tprintStructure.push({\"id\":\"RF3\"});\n\tprintStructure.push({\"id\":\"RF4\"});\n\tprintStructure.push({\"id\":\"RF\"});\n\t//printStructure.push({\"id\":\"IMRC\"});\n\n\tprintStructure.push({\"id\":\"dACIV\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"ACIV\"});\n\tprintStructure.push({\"id\":\"ACIV3\"});\n\tprintStructure.push({\"id\":\"ACIV1\"});\n\n\tprintStructure.push({\"id\":\"dCG\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"RC1\"});\n\tprintStructure.push({\"id\":\"RC2\"});\n\tprintStructure.push({\"id\":\"RC\"});\n\tprintStructure.push({\"id\":\"dRG\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RG1\"});\n\tprintStructure.push({\"id\":\"RG2\"});\n\tprintStructure.push({\"id\":\"RG\"});\n\n\n\n\treturn printStructure;\n}", "function fields() {\n personal_data = {\n 'my_name': ['Tim Booher'],\n 'grade': ['O-5'],\n 'ssn': ['111-22-2222'],\n 'address_and_street': ['200 E Dudley Ave'],\n 'b CITY': ['Westfield'],\n 'c STATE': ['NJ'],\n 'daytime_tel_num': ['732-575-0226'],\n 'travel_order_auth_number': ['7357642'],\n 'org_and_station': ['US CYBER JQ FFD11, MOFFETT FLD, CA'],\n 'e EMAIL ADDRESS': ['[email protected]'],\n 'eft': ['X'],\n 'tdy': ['X'],\n 'house_hold_goodies': ['X'],\n 'the_year': ['2018']\n }\n trip_data = { 'a DATERow3_2': ['07/19'], 'reason1': ['AT'], 'a DATERow5_2': ['07/19'], 'reason2': ['AT'], 'reason3': ['TD'], 'a DATERow7_2': ['07/21'], 'a DATERow9_2': ['07/15'], 'b NATURE OF EXPENSERow81': ['Capital Bikeshare'], 'a DATERow1_2': ['07/15'], 'b NATURE OF EXPENSERow41': ['Travel from summit to BOS'], 'b NATURE OF EXPENSERow1': ['Travel from IAD to Hotel'], 'from1': ['07/15'], 'to2': ['07/15'], 'to1': ['07/15'], 'from4': ['07/19'], 'to4': ['07/19'], 'to3': ['07/19'], 'from5': ['07/21'], 'from2': ['07/15'], 'to6': ['07/21'], 'from3': ['07/19'], 'to5': ['07/21'], 'reason4': ['TD'], 'reason5': ['AT'], 'from6': ['07/21'], 'reason6': ['MC'], 'c AMOUNTRow8': ['25.0'], 'c AMOUNTRow7': ['45.46'], 'c AMOUNTRow6': ['11.56'], 'c AMOUNTRow5': ['38.86'], 'c AMOUNTRow9': ['23.0'], 'b NATURE OF EXPENSERow7': ['Travel from EWR to HOR'], 'b NATURE OF EXPENSERow3': ['Travel between meetings'], 'a DATERow10_2': ['07/18'], 'c AMOUNTRow4': ['28.4'], 'c AMOUNTRow3': ['21.1'], 'c AMOUNTRow2': ['23.77'], 'c AMOUNTRow1': ['43.5'], 'mode6': ['CA'], 'a DATERow2_2': ['07/15'], 'mode5': ['CP'], 'mode4': ['CP'], 'a DATERow4_2': ['07/19'], 'mode3': ['CP'], 'ardep6': ['HOR'], 'a DATERow6_2': ['07/19'], 'a DATERow8_2': ['07/21'], 'b NATURE OF EXPENSERow6': ['Travel from hotel to IAD'], 'ardep1': ['EWR'], 'd ALLOWEDRow10': ['6.25'], 'b NATURE OF EXPENSERow2': ['Travel from BOS to Meeting'], 'ardep5': ['EWR'], 'ardep4': ['Arlington VA'], 'ardep3': ['BOS'], 'ardep2': ['Arlington VA'], 'c AMOUNTRow10': ['6.25'], 'mode2': ['CP'], 'mode1': ['CA'], 'b NATURE OF EXPENSERow9': ['Metro'], 'b NATURE OF EXPENSERow5': ['Travel from hotel to DCA'], 'd ALLOWEDRow1': ['43.5'], 'b NATURE OF EXPENSERow1': ['Travel from HOR to EWR'], 'd ALLOWEDRow3': ['21.1'], 'd ALLOWEDRow2': ['23.77'], 'd ALLOWEDRow5': ['38.86'], 'd ALLOWEDRow4': ['28.4'], 'd ALLOWEDRow7': ['45.46'], 'd ALLOWEDRow6': ['11.56'], 'd ALLOWEDRow9': ['23.0'], 'd ALLOWEDRow8': ['25.0'] }\n return Object.assign({}, personal_data, trip_data);\n}", "function createPrintStructureRendicontoGestionale() {\n\n\tvar printStructure = [];\n\n\tprintStructure.push({\"dialogText\":\"RENDICONTO GESTIONALE -- DETTAGLIO MOVIMENTI --\", \"titleText\":\"RENDICONTO GESTIONALE ANNO %1 DETTAGLIO MOVIMENTI\"});\n\n\tprintStructure.push({\"id\":\"dC\", \"isTitle\":true, \"newpage\":false});\n\tprintStructure.push({\"id\":\"dCA\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CA1\"});\n\tprintStructure.push({\"id\":\"CA2\"});\n\tprintStructure.push({\"id\":\"CA3\"});\n\tprintStructure.push({\"id\":\"CA4\"});\n\tprintStructure.push({\"id\":\"CA5\"});\n\tprintStructure.push({\"id\":\"CA5b\"});\n\tprintStructure.push({\"id\":\"CA6\"});\n\tprintStructure.push({\"id\":\"CA7\"});\n\tprintStructure.push({\"id\":\"CA8\"});\n\tprintStructure.push({\"id\":\"CA9\"});\n\tprintStructure.push({\"id\":\"CA10\"});\n\tprintStructure.push({\"id\":\"CA\"});\n\tprintStructure.push({\"id\":\"dCB\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CB1\"});\n\tprintStructure.push({\"id\":\"CB2\"});\n\tprintStructure.push({\"id\":\"CB3\"});\n\tprintStructure.push({\"id\":\"CB4\"});\n\tprintStructure.push({\"id\":\"CB5\"});\n\tprintStructure.push({\"id\":\"CB5b\"});\n\tprintStructure.push({\"id\":\"CB6\"});\n\tprintStructure.push({\"id\":\"CB7\"});\n\tprintStructure.push({\"id\":\"CB8\"});\n\tprintStructure.push({\"id\":\"CB\"});\n\tprintStructure.push({\"id\":\"dCC\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CC1\"});\n\tprintStructure.push({\"id\":\"CC2\"});\n\tprintStructure.push({\"id\":\"CC3\"});\n\tprintStructure.push({\"id\":\"CC\"});\n\tprintStructure.push({\"id\":\"dCD\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CD1\"});\n\tprintStructure.push({\"id\":\"CD2\"});\n\tprintStructure.push({\"id\":\"CD3\"});\n\tprintStructure.push({\"id\":\"CD4\"});\n\tprintStructure.push({\"id\":\"CD5\"});\n\tprintStructure.push({\"id\":\"CD6\"});\n\tprintStructure.push({\"id\":\"CD\"});\n\tprintStructure.push({\"id\":\"dCE\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CE1\"});\n\tprintStructure.push({\"id\":\"CE2\"});\n\tprintStructure.push({\"id\":\"CE3\"});\n\tprintStructure.push({\"id\":\"CE4\"});\n\tprintStructure.push({\"id\":\"CE5\"});\n\tprintStructure.push({\"id\":\"CE5b\"});\n\tprintStructure.push({\"id\":\"CE6\"});\n\tprintStructure.push({\"id\":\"CE7\"});\n\tprintStructure.push({\"id\":\"CE8\"});\n\tprintStructure.push({\"id\":\"CE9\"});\n\tprintStructure.push({\"id\":\"CE\"});\n\tprintStructure.push({\"id\":\"C\"});\n\n\tprintStructure.push({\"id\":\"dR\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"dRA\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RA1\"});\n\tprintStructure.push({\"id\":\"RA2\"});\n\tprintStructure.push({\"id\":\"RA3\"});\n\tprintStructure.push({\"id\":\"RA4\"});\n\tprintStructure.push({\"id\":\"RA5\"});\n\tprintStructure.push({\"id\":\"RA6\"});\n\tprintStructure.push({\"id\":\"RA7\"});\n\tprintStructure.push({\"id\":\"RA8\"});\n\tprintStructure.push({\"id\":\"RA9\"});\n\tprintStructure.push({\"id\":\"RA10\"});\n\tprintStructure.push({\"id\":\"RA11\"});\n\tprintStructure.push({\"id\":\"RA\"});\n\tprintStructure.push({\"id\":\"dRB\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RB1\"});\n\tprintStructure.push({\"id\":\"RB2\"});\n\tprintStructure.push({\"id\":\"RB4\"});\n\tprintStructure.push({\"id\":\"RB5\"});\n\tprintStructure.push({\"id\":\"RB6\"});\n\tprintStructure.push({\"id\":\"RB7\"});\n\tprintStructure.push({\"id\":\"RB\"});\n\tprintStructure.push({\"id\":\"dRC\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RC1\"});\n\tprintStructure.push({\"id\":\"RC2\"});\n\tprintStructure.push({\"id\":\"RC3\"});\n\tprintStructure.push({\"id\":\"RC\"});\n\tprintStructure.push({\"id\":\"dRD\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RD1\"});\n\tprintStructure.push({\"id\":\"RD2\"});\n\tprintStructure.push({\"id\":\"RD3\"});\n\tprintStructure.push({\"id\":\"RD4\"});\n\tprintStructure.push({\"id\":\"RD5\"});\n\tprintStructure.push({\"id\":\"RD\"});\n\tprintStructure.push({\"id\":\"dRE\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RE1\"});\n\tprintStructure.push({\"id\":\"RE2\"});\n\tprintStructure.push({\"id\":\"RE\"});\n\tprintStructure.push({\"id\":\"R\"});\n\n\tprintStructure.push({\"id\":\"dCG\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"CG1\"});\n\tprintStructure.push({\"id\":\"CG2\"});\n\tprintStructure.push({\"id\":\"CG\"});\n\tprintStructure.push({\"id\":\"dRG\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RG1\"});\n\tprintStructure.push({\"id\":\"RG2\"});\n\tprintStructure.push({\"id\":\"RG\"});\n\n\n\treturn printStructure;\n}", "function createPMTreeViewJSON(data){\n//\tvar parser = new DOMParser();\n//\tvar xmlDoc = parser.parseFromString( data , \"text/xml\" );\n//\tvar device = data.MAINCONFIG[0].DEVICE;\n\tvar str2 = \"<ul id='ulOutlet'>\";\n\tif (data.MAINCONFIG[0].DEVICE){\n\t\tdevice = data.MAINCONFIG[0].DEVICE;\n\t\tfor(x=0; x<device.length; x++){\n\t\t\tvar outlet = device[x].OUTLET; \n\t\t\tvar devName = device[x].HostName;\n\t\t\tvar ip = device[x].ManagementIp;\n\t\t\tvar devId = device[x].DeviceId;\n\t\t\tvar deviceOCP = device[x].availableocp;\n\t\t\tif (deviceOCP != undefined && deviceOCP.toLowerCase()!=\"none\" && deviceOCP != ''){\n\t\t\t\tvar label = devName;\n\t\t\t\tif(devName == \"\"){\n\t\t\t\t\tlabel = ip;\n\t\t\t\t}\n\t\t\t\tstr2 += \"<li><a id='powerstrip_\"+devId+\"' did='\"+ip+\"' name='\"+devId+\"' onclick=\\\"showPMTable(1);PMRibbon('','\"+label+\"');LoadPowerController('\"+ip+\"');\\\">\"+label+\"</a>\";\n\t\t\t\tstr2 += \"<ul>\";\n\t\t\t\tvar avin=device[x].availableinlet;\n\t\t\t\tif (avin !=null){\n\t\t\t\tstr2 += \"<li id='powerInlet'>Inlet<ul>\";\n\t\t\t\t\tvar availInlet = avin.split(\",\");\n\t\t\t\t\tfor (var a =0; a<availInlet.length; a++){\n\t\t\t\t\t\tvar inHdr = label+\" >> Inlet\";\n\t\t\t\t\t\tstr2 += \"<li id='powerinlet_\"+devId+\"_\"+availInlet[a]+\"' did='\"+ip+\"' onclick=\\\"showPMTable(2);PMRibbon('\"+inHdr+\"','\"+availInlet[a]+\"');LoadInlet('\"+ip+\"',this.id);\\\"><a>\"+availInlet[a]+\"</a></li>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstr2+=\"</ul></li>\";\n\t\t\t\tvar availOCP =deviceOCP.split(\",\");\n\t\t\t\tfor (var i=0; i<availOCP.length; i++){\n\t\t\t\t\tvar ocp = availOCP[i];\n\t\t\t\t\t\tvar str4 = \"\";\n\t\t\t\t\t\tstr2+=\"<li><a id='\"+devId+\"' did='\"+ip+\"' onclick=\\\"PMRibbon('\"+label+\"','\"+ocp+\"');showPMTable(4);LoadOCP('\"+devId+\"','\"+ip+\"','\"+ocp+\"');\\\">\"+ocp+\"</a>\";\n\t\t\t\t\t\tstr2+=\"<ul id='ulDevices\"+devId+\"'>\";\n\t\t\t\t\t\tstr4 = createOutletTreeViewOCPJSON(outlet,ip,devId,ocp,devName,ip);\n\t\t\t\t\t\tstr2+=str4;\n\t\t\t\t\t\tstr2+=\"</ul></li>\";\n\t\t\t\t\t}\n\t\t\t\tstr2+=\"<li id='ocpLog\"+devId+\"' myname='\"+devName+\"' onclick=\\\"showPMTable(5);PMRibbon('\"+label+\"','Logs');LoadPDULogs('\"+ip+\"');\\\"><a>Logs</a></li>\";\n\t\t\t\tstr2+=\"</ul></li>\";\n\t\t\t}else{\n\t\n\t\t\t\tvar label = devName;\n\t\t\t\tif(devName == \"\"){\n\t\t\t\t\tlabel = ip;\n\t\t\t\t}\n\t\t\t\tstr2 += \"<li><a id='powerstrip_\"+devId+\"' did='\"+ip+\"' name='\"+devId+\"'onclick=\\\"showPMTable(1);PMRibbon('','\"+label+\"');LoadPowerController('\"+ip+\"')\\\">\"+label+\"</a>\";\n\t\t\t\tstr2 += \"<ul>\";\n\t\t\t\tvar avin=device[x].availableinlet;\n\t\t\t\tstr2 += \"<li id='powerInlet'>Inlet<ul>\";\n\t\t\t\tif (avin !=null){\n\t\t\t\t\tvar availInlet = avin.split(\",\");\n\t\t\t\t\tfor (var a =0; a<availInlet.length; a++){\n\t\t\t\t\t\tvar inHdr = label+\" >> Inlet\";\n\t\t\t\t\t\tstr2 += \"<li id='powerinlet_\"+devId+\"_\"+availInlet[a]+\"' did='\"+ip+\"' onclick=\\\"showPMTable(2);PMRibbon('\"+inHdr+\"','\"+availInlet[a]+\"');LoadInlet('\"+ip+\"',this.id)\\\"><a>\"+availInlet[a]+\"</a></li>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstr2+=\"</ul></li>\";\n\t\t\t\tstr2 += \"<li><a id='powerStrip\"+devId+\"' did='\"+ip+\"' onclick=\\\"showPMTable(3);PMRibbon('\"+label+\"','Outlet');LoadOutlet('\"+ip+\"')\\\">Outlet</a><ul id='ulDevices\"+devId+\"'>\";\n\t\t\t\tvar str4 = \"\";\n\t\t\t\tstr4 = createOutletTreeViewJSON(outlet,ip,devId);\n\t\t\t\tif(str4 != \"\"){\n\t\t\t\t\tstr2+=str4;\n\t\t\t\t}\n\t\t\t\tstr2+=\"</ul></li>\";\n\t\n\t\t\t\tstr2+=\"<li id='ocpLog\"+devId+\"' myname='\"+devName+\"' did='\"+ip+\"' onclick=\\\"showPMTable(5);PMRibbon('\"+label+\"','Logs');LoadPDULogs('\"+ip+\"')\\\"><a>Logs</a></li>\";\n\t\t\t\tstr2+=\"</ul></li>\";\n\t\t\t}\n\t\t}\n\t\t$('#ulPDU').html(str2);\n\t\t$(\"#PMtree\").treeview({collapsed: true});\n\t}\n}", "function p(doc) {\n return doc.map((i) => {\n return {\n label: i.label,\n detail: (i.detail ? i.detail : null),\n insertText: (i.insertText ? i.insertText : i.label),\n documentation: (i.documentation ? i.documentation : null),\n kind: (i.kind ? i.kind : 17), // 17 = Keyword, 18 = Text, 25 = Snippet\n insertTextRules: (i.insertTextRules ? i.insertTextRules : null),\n };\n });\n}", "function Node(nodeCreatingOption){\n var options = nodeCreatingOption || {};\n\n // Copy all the expansion data for the specific system\n // usage, such as tree ui Node which might have expanded and selected\n // flags so the ui can use it to render correctly by basic cases so\n // we don't loose it.\n objectAssign(this, options);\n this.key = nodeCreatingOption.key || _generateKey();\n this.parent = options.parent || \"\";\n this.name = options.name || \"object\";\n this.label = options.label || \"object name\";\n this.type = new NodeType({\n typeName: options.type ? options.type.typeName : Types.String,\n displayTypeName: options.type ? options.type.displayTypeName : DisplayTypes.Text,\n options: options.type && options.type.options ? options.type.options : {defaultValue: null, items: []}\n });\n\n this.displayValidators = [];\n if (options.displayValidators && options.displayValidators.length > 0){\n options.displayValidators.forEach(function(item){\n this.displayValidators.push(clone(item));\n }.bind(this));\n }\n\n this.validators = [];\n if (options.validators && options.validators.length > 0){\n options.validators.forEach(function(item){\n this.validators.push(clone(item));\n }.bind(this));\n }\n\n this.nodes = _cloneNodes(nodeCreatingOption.nodes);\n}", "function Tag(parent_id, item) {\n // standard attributs\n this.parent_id = parent_id;\n\n this.label = item.label || \"\";\n this.value = item.value || \"\";\n this.name = item.name || \"\";\n this.type = item.type || \"\";\n this.id = item.id || \"\";\n this.name = item.name || this.id;\n this.correct = item.correct;\n this.question_color = item.question_color || \"black-800\";\n this.question = \"\";\n\n //default settings\n this.newline = item.newline || false;\n this.disabled = (item.disabled) ? 'disabled=\"disabled\"' : \"\";\n this.maxlength = item.maxlength || \"\";\n this.readonly = (item.readonly) ? 'readonly=\"readonly\"' : \"\";\n this.required = (item.required) ? 'required=\"required\"' : \"\";\n this.autofocus = (item.autofocus) ? 'autofocus=\"autofocus\"' : \"\";\n this.size = item.size || \"\";\n\n if (this.required != \"\") {\n this.star = '<nobr class=\"mdl-color-text--red-800 style=\"font-weight: bold;\" > *</nobr>';\n } else\n this.star = \"\";\n\n // processing question_description\n this.question_description = item.question_description || \"\";\n this.question_description_size = item.question_description_size || \"14px\";\n this.question_description_color = item.question_description_color || \"grey-600\";\n if (this.question_description)\n this.question_description_html = '<p style=\"font-size: {0};padding-top: 20px;\" class=\"mdl-layout-title mdl-color-text--{1}\">{2}</p>'.format(\n this.question_description_size, this.question_description_color, this.question_description\n );\n else\n this.question_description_html = \"\";\n\n this.needQuestion = (item.needQuestion == false) ? false : true;\n if (this.needQuestion) {\n this.question = item.question || \"Untitled Question\";\n this.question_html = '<label class=\"mdl-layout-title mdl-color-text--{0}\" style=\"font-weight: bold;\" >{1}{2}</label>'.format(\n this.question_color, this.question, this.star\n );\n } else {\n this.question_html = \"\";\n }\n\n\n this.html = \"\";\n }", "function NNF(statement){\n \n if(statement.type == \"individual\")\n return statement;\n\n else if(statement.type == \"class\")\n return statement;\n\n else if(statement.type == \"classApplication\")\n return {\n type: \"classApplication\",\n children: [\n NNF(statement.children[0]),\n NNF(statement.children[1])\n ]\n };\n\n else if(statement.type == \"subclass\")\n return {\n type: \"union\",\n children: [\n NNF({type: \"complement\", children: [statement.children[0]]}),\n NNF(statement.children[1])\n ]\n };\n\n // not sure about this one...\n // else if(statement.type == \"role\")\n // return { };\n else if(statement.type == \"role\")\n return statement;\n\n else if(statement.type == \"roleApplication\")\n return {\n type: \"roleApplication\",\n children: [\n NNF(statement.children[0]),\n NNF(statement.children[1]),\n NNF(statement.children[2])\n ]\n };\n\n else if(statement.type == \"restriction\")\n return {\n type: statement.type,\n quantifier: statement.quantifier,\n children: statement.children.map(NNF)\n }\n \n else if(statement.type == \"negation\"){\n if(statement.children[0].type == \"negation\"){\n return NNF(statement.children[0].children[0]);\n }\n else if (statement.children[0].type == \"or\"){\n console.log(\"here\");\n return NNF({\n type: \"and\",\n children: statement.children[0].children.map(function(c){ return {type: \"negation\", children: [NNF(c)]};})\n })\n }\n else if (statement.children[0].type == \"and\"){\n return NNF({\n type: \"or\",\n children: statement.children[0].children.map(function(c){ return {type: \"negation\", children: [NNF(c)]}})\n })\n }\n else if(statement.children[0].type == \"implication\"){\n return NNF({type: \"negation\", children: [NNF(statement.children[0])]});\n }\n else if ([\"individual\", \"classApplication\", \"roleApplication\"].includes(statement.children[0].type)){\n return statement;\n }\n else{\n console.error(`Taking negation of ${statement.children[0].type}?`);\n }\n }\n\n else if(statement.type == \"complement\"){\n if(statement.children[0].type == \"complement\"){\n return NNF(statement.children[0].children[0]);\n }\n else if (statement.children[0].type == \"union\"){\n return NNF({\n type: \"intersection\",\n children: statement.children[0].children.map(function(c){ return {type: \"complement\", children: [NNF(c)]};})\n })\n }\n else if (statement.children[0].type == \"intersection\"){\n return NNF({\n type: \"union\",\n children: statement.children[0].children.map(function(c){ return {type: \"complement\", children: [NNF(c)]}})\n })\n }\n\n else if ( statement.children[0].type == \"restriction\"){\n let restriction = statement.children[0];\n let [role, clazz] = restriction.children;\n if (restriction.quantifier == \"universal\"){\n return {\n type: \"restriction\",\n quantifier: \"existential\",\n children: [\n role, \n {type: \"complement\", children: [clazz]}\n ].map(NNF)\n }\n }\n else{\n return {\n type: \"restriction\",\n quantifier: \"universal\",\n children: [\n role, \n {type: \"complement\", children: [clazz]}\n ].map(NNF)\n }\n }\n }\n\n else if (statement.children[0].type == \"class\"){\n if (statement.children[0].name == \"Empty\")\n return {type: \"class\", name: \"Universe\"};\n else if (statement.children[0].name == \"Universe\")\n return {type: \"class\", name: \"Empty\"};\n return statement;\n }\n\n else if (statement.children[0].type == \"subclass\"){\n return NNF({type: \"complement\", children: [NNF(statement.children[0])]});\n }\n\n else{\n console.error(`Taking complement of ${statement.children[0].type}?`);\n }\n }\n\n else if([\"and\",\"or\",\"intersection\",\"union\"].includes(statement.type)){\n return {\n type: statement.type,\n children: statement.children.map(NNF)\n }\n }\n\n else if(statement.type == \"implication\"){\n return {\n type: \"or\",\n children: [\n {type: \"negation\", children: [NNF(statement.children[0])]},\n NNF(statement.children[1])\n ]\n }\n }\n}", "buildElement() {\n const templateString = fs.readFileSync(this.__template, {encoding: 'utf-8'});\n const parser = new DOMParser();\n const doc = parser.parseFromString(templateString, 'text/html');\n return doc.querySelector('.pio-template-root').cloneNode(true);\n }", "function caab_as_icicle_node(object){\n var icicle_node = {};\n\n/* icicle_node.id = object.caab_code; */\n icicle_node.name = object.code_name;\n\n/*\n icicle_node['area'] = 5;\n icicle_node['dim'] = 5;\n*/\n icicle_node['color'] = '#'+object.point_colour;\n icicle_node['caabcode_object'] = object.caab_code;\n icicle_node['caabcode_id'] = object.id;\n //icicle_node.children = [];\n return icicle_node;\n}", "function generateTemplate (info, next) {\n //get what the full response would look like in hash form\n let rpcHash = generateRpcObjectHash(info.rpcs, info.permissionRelations, info.hmiValues);\n\n //convert the hash into an array\n rpcHashToArray(rpcHash, function (err, rpcs) {\n let template = baseTemplate();\n template.rpcs = rpcs;\n next(err, template);\n });\n}", "function initPercDataTree()\n {\n // Initialize the PercDataTree plugin\n var dataTreeConfig = {\n 'instanceIdSuffix' : '-instance1', // Supply a suffix to make an internal ID really unique\n 'title' : I18N.message(\"perc.ui.workflow.view@Assigned\"), // title of PercDataTree\n 'addTitle' : I18N.message(\"perc.ui.workflow.view@Assign Sites and Folders to Workflow\"), // title atribute of add button\n 'collapsible' : true,\n 'levelLimit' : 2,\n 'createItem' : openAssignWorkflowSitesAndFoldersDialog, // function invoked when clickking add button\n 'showCheckboxes' : false,\n 'selectedWorkflow' : selectedWorkflow\n };\n $.PercDataTree.init(assign_container, dataTreeConfig);\n assign_container.append('<div role=\"status\" class=\"perc-sa-loading-warning-message\"><img src=\"../css/dynatree/skin/loading.gif\" alt=\"perc.ui.assign.workflow@LoadingGifAlt\" style=\"vertical-align:bottom\"/>' +I18N.message(\"perc.ui.assign.workflow@Workflow Loading\") + '</div>');\n\n }", "function packageHierarchy_lp(classes,initial)\n{\n\tvar map = {};\t\t//Create blank object\n \n\tfunction find(name, data) \n\t{\n\t\tvar lp_id = name.replace( /^\\D+/g, ''); // replace all leading non-digits with nothing\n\t\tvar pe_id = Math.floor(lp_id/Math.ceil(num_lp/num_pe));\n\t\tif(selected_pes_array[pe_id] != -1)\n {\n\t\t\tvar node = map[name];\t//Check if name is in our map and assign it to variable \"node\"\n\t\t\tvar i;\n\t\t\tif (!node) //IF node for given name currently does not exist in our map then create it\n\t\t\t{\n\t\t\t\tnode = map[name] = data || {name: name, children: []};\n\t\t\t\tif (name.length) \n\t\t\t\t{\n\t\t\t\t\tif(!initial)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete map[name].connections;\n\t\t\t\t\t\tdelete node.connections;\n\t\t\t\t\t\tmap[name].connections = [];\n\t\t\t\t\t\tnode.connections = [];\n \n\t\t\t\t\t\tfor (var ii = 0; ii < selected_pes.length; ii++){\n\t\t\t\t\t\t\tif(data.connections[0])\n\t\t\t\t\t\t\t{\n var tempnum = data.connections[0].replace( /^\\D+/g, ''); // replace all leading non-digits with nothing\n var tempnum1 = Math.floor(tempnum/Math.ceil(num_lp/num_pe)); //convert to PE ID\n\t\t\t\t\t\t\t\tvar tempnum2 = selected_pes[ii].key.replace( /^\\D+/g, ''); // replace all leading non-digits with nothing\n\t\t\t\t\t\t\t\tif(tempnum1 == tempnum2)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t \t\tnode.connections.push.apply(node.connections,data.connections);\n\t\t\t\t\t\t \t\tnode.messages.push(data.num_messages);\n\t\t\t\t\t\t \t\tnode.num_messages += data.num_messages;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\tnode.parent = find(name.substring(0, i = name.lastIndexOf(\".\")));\n\t\t\t\t\tnode.parent.children.push(node);\n\t\t\t\t\tnode.key = name.substring(i + 1);\n\t\t node.messages = [];\n\t\t node.messages[0] = data.num_messages;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //If a node for given name currently exists in our map\n\t\t\t{\n\t\t\t\tif(name.length)\n {\n if(initial)\n {\n node.connections.push.apply(node.connections,data.connections);\n node.messages.push(data.num_messages);\n node.num_messages += data.num_messages;\n }\n else\n {\n for (var ii = 0; ii < selected_pes.length; ii++){\n if(data.connections[0])\n {\n var tempnum = data.connections[0].replace( /^\\D+/g, ''); // replace all leading non-digits with nothing\n var tempnum1 = Math.floor(tempnum/Math.ceil(num_lp/num_pe)); //convert to PE ID\n var tempnum2 = selected_pes[ii].key.replace( /^\\D+/g, ''); // replace all leading non-digits with nothing\n if(tempnum1 == tempnum2)\n {\n node.connections.push.apply(node.connections,data.connections);\n node.messages.push(data.num_messages);\n node.num_messages += data.num_messages;\n }\n }\n }\n }\n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn node;\n\t\t}\n\t}\n\n\tclasses.forEach(\n\t\tfunction(d) \n\t\t{\n\t\t\tfind(d.name, d);\n\t\t}\n\t);\n\n\treturn map[\"\"];\n}", "function makeTree(){\n introNode.leftChild = day_0_Job_Selection;\n \n day_0_Job_Selection.leftChild = day_1_Choosing_Savings;\n \n day_1_Choosing_Savings.leftChild = day_2_Moving;\n}", "function createPartialTree (currentFile, partials, visitedFiles) {\n if (visitedFiles[currentFile.name]) {\n return {\n label: '*' + currentFile.name + '*',\n name: currentFile.name\n }\n }\n visitedFiles[currentFile.name] = true\n\n var result = {\n label: currentFile.name,\n name: currentFile.name,\n summary: _.trunc(chainOrUndefined(currentFile, 'apidocs', 0, 'parsed', 'description'), {\n separator: ' ',\n length: 50\n })\n }\n if (currentFile.children.length > 0) {\n _.merge(result, {\n children: currentFile.children.map(function (child) {\n return createPartialTree(partials[child], partials, visitedFiles)\n })\n })\n }\n return result\n}", "function createNodes(rawData) {\n // Use the max total_amount in the data as the max in the scale's domain\n // note we have to ensure the total_amount is a number.\n var maxAmount = d3.max(rawData, function(d) {\n return +d.Initial_Penalty_num;\n });\n\n // Sizes bubbles based on area.\n // @v4: new flattened scale names.\n var radiusScale = d3.scalePow()\n .exponent(0.5)\n .range([42000, 500000])\n .domain([42000, maxAmount]);\n\n // Use map() to convert raw data into node data.\n // Checkout http://learnjsdata.com/ for more on\n // working with data.\n var myNodes = rawData.map(function(d) {\n return {\n id: d.id,\n radius: radiusScale(+d.Initial_Penalty_num) * 0.00015,\n value: +d.Initial_Penalty_num,\n name: d.Establishment_Name,\n safety: d.ltwo,\n states: d.State,\n City: d.City,\n State: d.State,\n type: d.Inspection_Type,\n office: d.Office,\n open: d.Open_Date,\n close: d.Close_Date,\n scope: d.Scope,\n status: d.Case_Status,\n emphasis: d.Emphasis_N,\n union: d.ustat,\n year: d.test,\n x: Math.random() * 900,\n y: Math.random() * 800\n };\n });\n\n // sort them to prevent occlusion of smaller nodes.\n myNodes.sort(function(a, b) {\n return b.value - a.value;\n });\n\n return myNodes;\n }", "function buildTree(jsonData, arrayTitles) {\n // current date and time to display on front end\n const date = new Date().toLocaleString('en-GB', {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n hour: 'numeric',\n minute: 'numeric'\n });\n\n // the initialisation of the object\n let outputData = {\n name: 'Financial Services',\n lastModified: date,\n children: []\n };\n\n // loops through each row of data\n jsonData.forEach(function(data) {\n // initialise the levels\n let l1, l2, l3, l4, l5;\n for (var i = 0; i < arrayTitles.length; i++) {\n // initialise new object\n let newObject;\n\n // checks to see if it's the final object, if it is then returns all data otherwise just returns name and child\n if (i === arrayTitles.length - 1) {\n newObject = {\n name: data[arrayTitles[i]],\n size: 1,\n workforceType: data['Workforce Type'],\n newClientName: data['NEW CLIENT NAME'],\n smartAccountGroupName: data['Smart Account Group Name'],\n jobRoleSpecialty: data['Job Role/Specialty'],\n bandLow: data['Band Low'],\n bandHigh: data['Band High'],\n startDate: data['Start Date'],\n candidatesInPlay: data['Has Candidates in Play'],\n additionalComments: data['Additional Comments'],\n contractStatus: data['Contract Status'],\n csaID: data['CSA Request ID'],\n endDate: data['End Date'],\n jrsService: data['JR/S Service'],\n jrsPractice: data['JR/S Practice'],\n skillsToHave: data['Nice to Have Skills'],\n opportunityOwnerNotesId: data['Opportunity Owner Notes ID'],\n opportunityName: data['Opportunity Name'],\n ownerNotesId: data['Owner Notes ID'],\n planTotalRequiredPositions: data['Plan Total Required Positions'],\n positionDescription: data['Position Description'],\n projectDescription: data['Project Description'],\n roadmapStatus: data['New Roadmap Status'],\n projectName: data['Project Name'],\n projectContactEmail: data['Project Contact Email Address'],\n requiredSkills: data['Required Skills'],\n createdDate: data['Created Date'],\n hoursPerWeek: data['Hours Per Week'],\n workLocationCity: data['Work Location City'],\n metroHiringRequestId: data['Metro Hiring Request ID'],\n priorityRankingNumber: data['Priority Ranking Number'],\n urgentFlag: data['Urgent Flag'],\n urgentReason: data['Urgent Reason'],\n winOdds: data['Roadmap Status'],\n positionId: data['Position ID'],\n seatContractorCandidates: data['Seat Contractor Candidates'],\n seatIBMCandidates: data['Seat IBM Regular Candidates'],\n seatCandidatesNotSelected: data['Seat Candidates Not Selected'],\n seatCandidatesWithdrawn: data['Seat Candidates Withdrawn'],\n seatCandidatesProposed: data['Seat Candidates Proposed'],\n seatCandidatesSelected: data['Seat Candidates Selected']\n };\n } else {\n newObject = {\n name: data[arrayTitles[i]],\n children: []\n };\n }\n\n // checks which level to push the object to\n if (i === 0) {\n if (!checkExists(data[arrayTitles[i]], outputData.children)) {\n outputData.children.push(newObject);\n }\n } else if (i === 1) {\n l1 = findIndex(data[arrayTitles[i - 1]], outputData.children);\n if (\n !checkExists(data[arrayTitles[i]], outputData.children[l1].children)\n ) {\n outputData.children[l1].children.push(newObject);\n } else {\n if (i === arrayTitles.length - 1) {\n outputData.children[l1].children[\n findIndex(data[arrayTitles[i]], outputData.children[l1].children)\n ].size++;\n }\n }\n } else if (i === 2) {\n l2 = findIndex(\n data[arrayTitles[i - 1]],\n outputData.children[l1].children\n );\n if (\n !checkExists(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children\n )\n ) {\n outputData.children[l1].children[l2].children.push(newObject);\n } else {\n if (i === arrayTitles.length - 1) {\n outputData.children[l1].children[l2].children[\n findIndex(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children\n )\n ].size++;\n }\n }\n } else if (i === 3) {\n l3 = findIndex(\n data[arrayTitles[i - 1]],\n outputData.children[l1].children[l2].children\n );\n if (\n !checkExists(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children[l3].children\n )\n ) {\n outputData.children[l1].children[l2].children[l3].children.push(\n newObject\n );\n } else {\n if (i === arrayTitles.length - 1) {\n outputData.children[l1].children[l2].children[l3].children[\n findIndex(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children[l3].children\n )\n ].size++;\n }\n }\n } else if (i === 4) {\n l4 = findIndex(\n data[arrayTitles[i - 1]],\n outputData.children[l1].children[l2].children[l3].children\n );\n if (\n !checkExists(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children\n )\n ) {\n outputData.children[l1].children[l2].children[l3].children[\n l4\n ].children.push(newObject);\n } else {\n if (i === arrayTitles.length - 1) {\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children[\n findIndex(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children\n )\n ].size++;\n }\n }\n } else if (i === 5) {\n l5 = findIndex(\n data[arrayTitles[i - 1]],\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children\n );\n if (\n !checkExists(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children[l5].children\n )\n ) {\n outputData.children[l1].children[l2].children[l3].children[\n l4\n ].children[l5].children.push(newObject);\n } else {\n if (i === arrayTitles.length - 1) {\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children[l5].children[\n findIndex(\n data[arrayTitles[i]],\n outputData.children[l1].children[l2].children[l3].children[l4]\n .children[l5].children\n )\n ].size++;\n }\n }\n }\n }\n });\n\n // returns the value back to where the function is called from\n return outputData;\n}", "function generateAllData(tenantid, layoutid, subscriptionid, sequenceid, fields, data, includeSchema = true, sequenceReset = false) {\r\n var element = {};\r\n element.p0 = tenantid;\r\n element.p1 = layoutid;\r\n element.p2 = subscriptionid;\r\n element.p3 = sequenceid;\r\n if (sequenceReset) {\r\n element.p4 = sequenceReset;\r\n }\r\n if (includeSchema) {\r\n element.s = fields;\r\n }\r\n element.d = data;\r\n\r\n return element;\r\n}", "function createBlankRecipe(){\n var recipeInfo = {\n //ste true if recipe has been selected\n recipeOnThisDate: false,\n name: \"\", \n ingredients: [], \n healthLabels: [], \n servings: 0, \n recipeUrl: \"\", \n imageUrl: \"\"\n };\n\n return recipeInfo;\n}", "function cfnTaskTemplateRequiredFieldInfoPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnTaskTemplate_RequiredFieldInfoPropertyValidator(properties).assertSuccess();\n return {\n Id: cfnTaskTemplateFieldIdentifierPropertyToCloudFormation(properties.id),\n };\n}", "static create_tree() {\n return new Tree();\n }", "treeTemplate(tree) {\n\t\treturn new PowerTreeTemplate({$powerUi: this, tree: tree}).template;\n\t}", "function createParserInfo(node, data, path, context, suggesting) {\n const result = {\n context,\n data,\n node_properties: node.properties || {},\n path,\n suggesting\n };\n return result;\n}", "function generateCourseNode(courseCode, courseName, courseDesc, courseLevel, courseSeasons, coursePrereq) {\n const courseDescription = courseCode + \" (\" + courseName + \")\\n\"\n + \"--------------------------------\" + \"\\n\"\n + stringParse(courseDesc);\n const courseTitle = (courseCode === \"HS\") ? courseCode : courseCode + \" \" + courseSeasons;\n var courseNode = {\n id: courseCode,\n label: courseTitle,\n title: courseDescription,\n level: courseLevel,\n labelHighLightBold: true,\n borderWidth: 1.5,\n // color: {\n // border: 'green',\n // },\n font: {\n face: 'Lato',\n size: 16,\n multi: 'html',\n },\n nodes: {\n\n },\n shapeProperties: {\n borderRadius: 2.5,\n }\n }\n\n let updateCourseNode = function (courseNode, properties) {\n return { ...courseNode, ...properties };\n }\n\n let courseSubject = courseCode.split(\" \")[0];\n let colorShapeProperties = {};\n // console.log(courseSubject);\n if (courseSubject === \"MATH\") { // green\n colorShapeProperties = {\n color: {\n background: '#169131',\n border: 'black',\n highlight: {\n background: '#81f087',\n border: 'black', \n }\n },\n shape: 'diamond',\n size: 15,\n };\n }\n else if (courseSubject === \"STAT\") { // yellow\n colorShapeProperties = {\n color: {\n background: '#d5db16',\n border: 'black',\n highlight: {\n background: '#f7fa8c',\n border: 'black', \n }\n },\n shape: 'hexagon',\n size: 15,\n }\n }\n else if (courseSubject === \"CS\") { // orange\n colorShapeProperties = {\n color: {\n background: '#eb7c28',\n border: 'black',\n highlight: {\n background: '#edb68c',\n border: 'black', \n }\n },\n shape: 'star',\n size: 15,\n };\n }\n else if (courseSubject === \"CO\") { // aqua\n colorShapeProperties = {\n color: {\n background: '#0ebfc2',\n border: 'black',\n highlight: {\n background: '#63e8eb',\n border: 'black', \n }\n },\n shape: 'triangleDown',\n size: 12,\n };\n }\n else if (courseSubject === \"PMATH\") { // pink\n colorShapeProperties = {\n color: {\n background: '#d40dc0',\n border: 'black',\n highlight: {\n background: '#f294e9',\n border: 'black', \n }\n },\n shape: 'dot',\n size: 12,\n }\n }\n else if (courseSubject === \"HS\") { // blue\n colorShapeProperties = {\n color: {\n background: 'blue',\n border: 'black',\n },\n shape: 'dot',\n size: 8,\n fixed: true,\n }\n }\n else if (courseSubject === \"SPCOM\" || courseSubject === \"ENGL\") { // purple\n colorShapeProperties = {\n color: {\n background: '#661499',\n border: 'black',\n highlight: {\n background: '#c578f5',\n border: 'black', \n }\n },\n shape: 'triangle',\n size: 12,\n }\n }\n else { // red\n colorShapeProperties = {\n color: {\n background: '#a30b2c',\n border: 'black',\n highlight: {\n background: '#e66e88',\n border: 'black', \n }\n },\n shape: 'square',\n size: 12,\n };\n }\n\n courseNode = updateCourseNode(courseNode, colorShapeProperties);\n\n return courseNode;\n}", "function template(){\n vm.docDefinition = {\n pageSize: 'A4',\n content: [\n {\n image: logo_garuda,\n width: 50,\n height: 50,\n alignment: 'center',\n margin: [0,0,0,5]\n },\n\n {\n text: '' , style: ['nama_instansi', 'nama_judul']\n },\n\n {\n text: 'REPUBLIK INDONESIA', style: 'nama_judul', margin: [0,0,0,15]\n },\n\n {\n text: 'SURAT PERINTAH', style: 'nama_judul'\n },\n\n {\n text: 'NOMOR ' + vm.item.urusan + '-....-' + vm.item.unit + '-'+ ((new Date()).getYear() + 1900) , style: 'judul_nomor'\n },\n\n {\n style: 'demoTable', margin: [0,15,0,0],\n table: {\n widths: [50, 5, '*'],\n body: [\n [{text: 'Nama', bold: true},{text: ':'},{text: '' + vm.item.pegawaiPenandatangan.gelarDepan + vm.item.pegawaiPenandatangan.nama + vm.item.pegawaiPenandatangan.gelarBelakang}],\n [{text: 'Jabatan', bold: true},{text: ':'},{text: '' + vm.item.pegawaiPenandatangan.jabatan}]\n ]\n },\n layout: 'noBorders'\n },\n\n {\n style: 'demoTable', margin: [0,15,0,10],\n table: {\n widths: [80, 5, '*'],\n body: [\n [{text: 'Menimbang', style:'header4'},{text: ':', style:'header5'},\n {\n ol: []\n }\n ],\n [{text: '',margin: [0,0,0,3], colSpan: 3}],\n [{text: 'Dasar', style:'header4'},{text: ':', style:'header5'},\n {\n ol: []\n }\n ]\n ]\n },\n layout: 'noBorders'\n },\n\n {\n text: 'Memberi Perintah', alignment: 'center', fontSize: 12\n },\n\n {\n style: 'demoTable', margin: [0,10,0,15],\n table: {\n widths: [80, 5, '*'],\n body: [\n [{text: 'Kepada', style:'header4'},{text: ':', style:'header5'},\n\n {\n ol: []\n }],\n [{text: '',margin: [0,0,0,3], colSpan: 3}],\n [{text: 'Untuk', style:'header4'},{text: ':', style:'header5'},\n {\n ol : []\n }\n ]\n ]\n },\n layout: 'noBorders'\n },\n\n {\n columns: [\n {\n width: '63%',\n text: ''\n },\n {\n style: 'tandaTangan',\n table: {\n widths: [200],\n body: [\n [{text: '' + vm.item.tempat.toUpperCase() + ', ' + EkinerjaService.IndonesianDateFormat(vm.item.tanggal1), alignment : 'left'}],\n [{text: '' + vm.item.pegawaiPenandatangan.jabatan + ',', alignment : 'left', bold: true}],\n [{text: ' ',margin: [0,20]}],\n [{text: '' + vm.item.pegawaiPenandatangan.gelarDepan + vm.item.pegawaiPenandatangan.nama + vm.item.pegawaiPenandatangan.gelarBelakang, alignment : 'left', bold:true}],\n [{text: '' + vm.item.pegawaiPenandatangan.pangkat, alignment : 'left', bold:true}],\n [{text: 'NIP. ' + vm.item.pegawaiPenandatangan.nipPegawai, alignment : 'left'}]\n ]\n },\n layout: 'noBorders'\n }\n ]\n },\n\n {text: 'Tembusan :'}\n\n ],\n\n styles: {\n header: {\n bold: true,\n fontSize: 14,\n alignment: 'center'\n },\n header2: {\n fontSize: 12,\n alignment: 'center'\n },\n header3: {\n fontSize: 10,\n alignment: 'center'\n },\n nama_judul: {\n alignment : 'center',\n bold: true,\n fontSize: 12\n },\n judul_nomor: {\n alignment : 'center',\n bold: true,\n fontSize: 12\n },\n demoTable: {\n color: '#000',\n fontSize: 12\n },\n tandaTangan: {\n color: '#000',\n fontSize: 12,\n alignment:'right'\n },\n header4: {\n bold: true,\n fontSize: 12\n },\n header5: {\n fontSize: 12\n }\n }\n };\n\n for(var i = 0; i < vm.target.length; i++){\n var dat = {\n widths: ['*', '*', '*'],\n table: {\n body: [\n [{text: 'Nama', bold: true}, {text: ':'}, {text: '' + vm.target[i].gelarDepan + vm.target[i].nama + vm.target[i].gelarBelakang}],\n [{text: 'NIP', bold: true}, {text: ':'}, {text: '' + vm.target[i].nipPegawai}],\n [{text: 'Pangkat/Gol. Ruang', bold: true}, {text: ':'}, {text: '' + vm.target[i].pangkat + ' - ' + vm.target[i].golongan}],\n [{text: 'Jabatan', bold: true}, {text: ':'}, {text: '' + vm.target[i].jabatan}]\n ]\n },\n layout: 'noBorders'\n };\n vm.docDefinition.content[8].table.body[0][2].ol.push(dat);\n }\n\n var tembusan = {\n ol:[]\n }\n\n for(var i = 0; i < vm.tembusanSurat.length; i++)\n tembusan.ol.push(vm.tembusanSurat[i].jabatan);\n vm.docDefinition.content.push(tembusan);\n\n // var menimbang = vm.item.menimbang.split(\"\\n\");\n // for(var i = 0; i < menimbang.length; i++){\n // var kata = '';\n // for(var j = 1; j < (menimbang[i].split(\" \")).length; j++)\n // kata += (menimbang[i].split(\" \"))[j] + ' ';\n // vm.docDefinition.content[6].table.body[0][2].ol.push(kata);\n // }\n for(var i = 0; i < vm.menimbang.length; i++)\n vm.docDefinition.content[6].table.body[0][2].ol.push(vm.menimbang[i].deskripsimenimbang);\n \n // var dasar = vm.item.dasar.split(\"\\n\");\n // for(var i = 0; i < dasar.length; i++){\n // var kata = '';\n // for(var j = 1; j < (dasar[i].split(\" \")).length; j++)\n // kata += (dasar[i].split(\" \"))[j] + ' ';\n // vm.docDefinition.content[6].table.body[2][2].ol.push(kata);\n // }\n for(var i = 0; i < vm.dasar.length; i++)\n vm.docDefinition.content[6].table.body[2][2].ol.push(vm.dasar[i].deskripsidasar);\n \n // var untuk = vm.item.untuk.split(\"\\n\");\n // for(var i = 0; i < untuk.length; i++){\n // var kata = '';\n // for(var j = 1; j < (untuk[i].split(\" \")).length; j++)\n // kata += (untuk[i].split(\" \"))[j] + ' ';\n // vm.docDefinition.content[8].table.body[2][2].ol.push(kata);\n // }\n for(var i = 0; i < vm.untuk.length; i++)\n vm.docDefinition.content[8].table.body[2][2].ol.push(vm.untuk[i].deskripsiuntuk);\n\n if($state.current.name == \"suratperintahnonpejabat\" || $state.current.name == \"perintahnonpejabatterusan\"){\n vm.docDefinition.content[0] = {\n margin:[0,0,0,15],\n table:{\n widths: [100,'*'],\n body: [\n [\n {\n image: logo_bekasi,\n width: 90,\n height: 90,\n alignment: 'center'\n },\n [\n {\n text:[\n {text: 'PEMERINTAHAN KABUPATEN BEKASI\\n', alignment: 'center', style:'header'},\n {text: '' + vm.item.pegawaiPenandatangan.unitKerja.toUpperCase() + '\\n', alignment: 'center', style:'header'},\n {text: 'Komplek Perkantoran Pemerintah Kabupaten\\nBekasi Desa Sukamahi Kecamatan Cikarang Pusat', style: 'header2'}\n ]\n },\n {\n margin: [15,0,0,0],\n table: {\n body: [\n [\n {text: 'Telp. (021) 89970696', style: 'header3'},\n {text: 'Fax. (021) 89970064', style: 'header3'},\n {text: 'email : [email protected]', style: 'header3'}\n ]\n ]\n }, layout: 'noBorders'\n }\n ]\n ],\n [{text:'', colSpan: 2}],\n [{text:'', fillColor: 'black', colSpan: 2}]\n ]\n },\n layout: 'noBorders'\n };\n\n vm.docDefinition.content[1] = {};\n\n vm.docDefinition.content[2] = {};\n }\n else vm.docDefinition.content[1].text += vm.item.pegawaiPenandatangan.jabatan.toUpperCase();\n }", "function displayNodeDetails(d) { \n $(\"#node-details\").empty();\n $(\"#node-details\").append('<h4>' + d.name + '</h4>');\n $(\"#node-details\").append('<hr>');\n $(\"#node-details\").append('<p><b>PSI:</b> ' + (d.psi ? d.psi : 0) + '</p>');\n $(\"#node-details\").append('<p><b>Size:</b> ' + (d.value ? d.value : 0) + '</p>');\n $(\"#node-details\").append('<p><b>Depth:</b> ' + d.depth + '</p>');\n if (d.children) {\n $(\"#node-details\").append('<p><b>Number of children:</b> ' + (d.children.length ? d.children.length : 0) + '</p>'); \n }\n if (d.parent.name) {\n $(\"#node-details\").append('<p><b>Parent:</b> ' + d.parent.name + '</p>'); \n } \n}", "function parse(template,options){warn$1=options.warn||baseWarn;platformGetTagNamespace=options.getTagNamespace||no;platformMustUseProp=options.mustUseProp||no;platformIsPreTag=options.isPreTag||no;preTransforms=pluckModuleFunction(options.modules,'preTransformNode');transforms=pluckModuleFunction(options.modules,'transformNode');postTransforms=pluckModuleFunction(options.modules,'postTransformNode');delimiters=options.delimiters;var stack=[];var preserveWhitespace=options.preserveWhitespace!==false;var root;var currentParent;var inVPre=false;var inPre=false;var warned=false;parseHTML(template,{expectHTML:options.expectHTML,isUnaryTag:options.isUnaryTag,shouldDecodeNewlines:options.shouldDecodeNewlines,start:function start(tag,attrs,unary){// check namespace.\n\t// inherit parent ns if there is one\n\tvar ns=currentParent&&currentParent.ns||platformGetTagNamespace(tag);// handle IE svg bug\n\t/* istanbul ignore if */if(isIE&&ns==='svg'){attrs=guardIESVGBug(attrs);}var element={type:1,tag:tag,attrsList:attrs,attrsMap:makeAttrsMap(attrs),parent:currentParent,children:[]};if(ns){element.ns=ns;}if(isForbiddenTag(element)&&!isServerRendering()){element.forbidden=true;\"development\"!=='production'&&warn$1('Templates should only be responsible for mapping the state to the '+'UI. Avoid placing tags with side-effects in your templates, such as '+\"<\"+tag+\">\"+', as they will not be parsed.');}// apply pre-transforms\n\tfor(var i=0;i<preTransforms.length;i++){preTransforms[i](element,options);}if(!inVPre){processPre(element);if(element.pre){inVPre=true;}}if(platformIsPreTag(element.tag)){inPre=true;}if(inVPre){processRawAttrs(element);}else{processFor(element);processIf(element);processOnce(element);processKey(element);// determine whether this is a plain element after\n\t// removing structural attributes\n\telement.plain=!element.key&&!attrs.length;processRef(element);processSlot(element);processComponent(element);for(var i$1=0;i$1<transforms.length;i$1++){transforms[i$1](element,options);}processAttrs(element);}function checkRootConstraints(el){if(\"development\"!=='production'&&!warned){if(el.tag==='slot'||el.tag==='template'){warned=true;warn$1(\"Cannot use <\"+el.tag+\"> as component root element because it may \"+'contain multiple nodes:\\n'+template);}if(el.attrsMap.hasOwnProperty('v-for')){warned=true;warn$1('Cannot use v-for on stateful component root element because '+'it renders multiple elements:\\n'+template);}}}// tree management\n\tif(!root){root=element;checkRootConstraints(root);}else if(!stack.length){// allow root elements with v-if, v-else-if and v-else\n\tif(root.if&&(element.elseif||element.else)){checkRootConstraints(element);addIfCondition(root,{exp:element.elseif,block:element});}else if(\"development\"!=='production'&&!warned){warned=true;warn$1(\"Component template should contain exactly one root element:\"+\"\\n\\n\"+template+\"\\n\\n\"+\"If you are using v-if on multiple elements, \"+\"use v-else-if to chain them instead.\");}}if(currentParent&&!element.forbidden){if(element.elseif||element.else){processIfConditions(element,currentParent);}else if(element.slotScope){// scoped slot\n\tcurrentParent.plain=false;var name=element.slotTarget||'default';(currentParent.scopedSlots||(currentParent.scopedSlots={}))[name]=element;}else{currentParent.children.push(element);element.parent=currentParent;}}if(!unary){currentParent=element;stack.push(element);}// apply post-transforms\n\tfor(var i$2=0;i$2<postTransforms.length;i$2++){postTransforms[i$2](element,options);}},end:function end(){// remove trailing whitespace\n\tvar element=stack[stack.length-1];var lastNode=element.children[element.children.length-1];if(lastNode&&lastNode.type===3&&lastNode.text===' '){element.children.pop();}// pop stack\n\tstack.length-=1;currentParent=stack[stack.length-1];// check pre state\n\tif(element.pre){inVPre=false;}if(platformIsPreTag(element.tag)){inPre=false;}},chars:function chars(text){if(!currentParent){if(\"development\"!=='production'&&!warned&&text===template){warned=true;warn$1('Component template requires a root element, rather than just text:\\n\\n'+template);}return;}// IE textarea placeholder bug\n\t/* istanbul ignore if */if(isIE&&currentParent.tag==='textarea'&&currentParent.attrsMap.placeholder===text){return;}var children=currentParent.children;text=inPre||text.trim()?decodeHTMLCached(text)// only preserve whitespace if its not right after a starting tag\n\t:preserveWhitespace&&children.length?' ':'';if(text){var expression;if(!inVPre&&text!==' '&&(expression=parseText(text,delimiters))){children.push({type:2,expression:expression,text:text});}else if(text!==' '||children[children.length-1].text!==' '){currentParent.children.push({type:3,text:text});}}}});return root;}" ]
[ "0.58117586", "0.57724404", "0.5176685", "0.5152908", "0.51514655", "0.49836132", "0.49600205", "0.49585125", "0.4946984", "0.4917042", "0.4888747", "0.4888747", "0.48701122", "0.4855201", "0.48429745", "0.48386312", "0.4812062", "0.48064396", "0.48003817", "0.4792527", "0.47912875", "0.4774025", "0.47375906", "0.47367305", "0.46956477", "0.46956477", "0.46955034", "0.46791536", "0.46688864", "0.46537617", "0.46448907", "0.46396425", "0.46244666", "0.46188903", "0.46188903", "0.46149755", "0.4610237", "0.46018243", "0.460026", "0.457982", "0.4576879", "0.45763287", "0.45763287", "0.45682034", "0.45668066", "0.45608163", "0.4536408", "0.45249507", "0.45159674", "0.45136964", "0.45103782", "0.4507906", "0.4506401", "0.45055607", "0.45031834", "0.4488813", "0.447236", "0.4467888", "0.44586095", "0.44547975", "0.44445676", "0.44433314", "0.4441254", "0.44362497", "0.44278616", "0.4424379", "0.44196236", "0.44133332", "0.44097975", "0.44069937", "0.44048047", "0.44012776", "0.44007954", "0.4398393", "0.4397657", "0.43922824", "0.4390805", "0.4385706", "0.43844035", "0.438297", "0.4374524", "0.43703702", "0.43690246", "0.43677866", "0.43649563", "0.43639135", "0.43607205", "0.4357367", "0.43566027", "0.43532065", "0.43520737", "0.4344042", "0.4343904", "0.43426403", "0.43357873", "0.43353146", "0.43348077", "0.4333532", "0.43291733", "0.43277472" ]
0.69365865
0
Instead of doing direct recursion, one has to do indirect one as JS has all the calls such as fetch URLs async.(to not annoy users waiting and blocking) and also because slavetab is a resource that multiple nodes will want to use to fetch their URLs. This async business is making me insane...because of soooo much indirection. Can't wait to have "yield" in ECMAScript 6.
function traverse_and_fill(curr_node, site_pi_fields, my_slave_tab, level) { if (curr_node.parent == null) { console.log("APPU DEBUG: Creating root process_div"); //This is the root node. So we should be good to process next kid. curr_node.process_next_kid = true; //Also create a <div> element and attach it to main body. //This will be used to indicate that the current child has been //processed upto its leaf node. //Current level(which will be 0) and since this node is root, child number = 0; var dummy_tab_id = sprintf('child-processing-complete-%s-%s-%s', my_slave_tab.tabid, level, "0"); var dummy_div_str = sprintf('<div id="%s"></div>', dummy_tab_id); var dummy_div = $(dummy_div_str); $('body').append(dummy_div); curr_node.child_processing_div = dummy_div; console.log("APPU DEBUG: TRAVERSE_AND_FILL(), curr_node: " + curr_node.name + ", PROCEEDING (ROOT)"); process_action(curr_node, $(curr_node.xml_node).children('action'), site_pi_fields, my_slave_tab, level); } else { //We are not root node. var dummy_tab_id = sprintf('child-processing-complete-%s-%s-%s', my_slave_tab.tabid, level, curr_node.sibling_num); var dummy_div_str = sprintf('<div id="%s"></div>', dummy_tab_id); var dummy_div = $(dummy_div_str); $($(curr_node.parent.child_processing_div)).append(dummy_div); curr_node.child_processing_div = dummy_div; if (curr_node.parent.process_next_kid == true) { curr_node.parent.process_next_kid = false; curr_node.process_next_kid = true; console.log("APPU DEBUG: TRAVERSE_AND_FILL(), curr_node: " + curr_node.name + ", PROCEEDING"); process_action(curr_node, $(curr_node.xml_node).children('action'), site_pi_fields, my_slave_tab, level); } else { curr_node.process_next_kid = false; console.log("APPU DEBUG: TRAVERSE_AND_FILL(), curr_node: " + curr_node.name + ", SLEEPING"); wait_on_sibling_processing_to_finish(curr_node, site_pi_fields, my_slave_tab, level); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function list() {\n const urls = itemize('https://nodebin.herokai.com/', { depth: 3, query: true })\n while (!urls.done()) {\n console.log(await urls.next())\n }\n}", "crawlNextUrl() {\n var _this4 = this;\n\n const urlsPoolSize = this.crawlStatesRepository.urlsPoolSize();\n const urlsSize = this.crawlStatesRepository.urlsSize();\n\n if (urlsPoolSize === 0 || urlsSize >= this.args.limit && this.args.limit !== -1) {\n this.browser.close();\n return this.resolve(this.crawlStatesRepository.findAllUrls());\n }\n\n let url = CrawlerRepository.cleanUrl(this.crawlStatesRepository.popPoolUrl());\n this.processPage(url).then(\n /*#__PURE__*/\n function () {\n var _ref = _asyncToGenerator(function* (data) {\n const newUrl = new _Url.default(url);\n\n if (newUrl) {\n _this4.crawlStatesRepository.addUrl(newUrl);\n\n const urlsSize = _this4.crawlStatesRepository.urlsSize();\n\n _this4.progress(new _Progress.default(newUrl, data.html, data.headers, urlsSize, urlsPoolSize - 1));\n\n if (urlsSize <= _this4.args.screenshots && _this4.args.screenshots !== -1 || _this4.args.screenshots === -1) {\n _this4.page.screenshot({\n path: _path.default.join(_this4.screenshotsPath, \"\".concat(newUrl.name, \".png\"))\n });\n }\n\n if (_this4.args.isSingle()) {\n _this4.resolve(_this4.crawlStatesRepository.findAllUrls());\n } else {\n const links = yield _this4.page.$$(\"a\");\n\n for (let linkHandle of links) {\n const href = yield _this4.page.evaluate(link => link.href, linkHandle);\n let foundUrl = CrawlerRepository.cleanUrl(href);\n\n if (_this4.isFreshUrl(foundUrl)) {\n _this4.crawlStatesRepository.addPoolUrl(foundUrl);\n }\n }\n\n _this4.crawlNextUrl();\n }\n } else {\n _this4.crawlNextUrl();\n }\n });\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }()).catch(() => {\n this.crawlNextUrl();\n });\n }", "function recursiveScrape (csw, start, increment, max) {\n buildRequests(csw, start, increment, function (get) {\n parse.parseCsw(get, function (data) {\n if (data) {\n sync.constructor(dirs, data, host, function (linkages) {\n if (linkages) {\n sync.processor(linkages)\n }\n })\n }\n if (data['next']) {\n var start = Number(data['next']);\n console.log(start);\n if (start > 0 && start <= max)\n recursiveScrape(csw, start, increment, max);\n }\n })\n })\n }", "async function list() {\n const urls = itemize('https://news.ycombinator.com', { depth: 2 })\n while (!urls.done()) {\n console.log(await urls.next())\n }\n}", "function recurse(url) {\n console.log(url);\n var sinceNumberOfNext = getSinceNumber(url) || 0;\n console.log('sinceNumberOfNext', sinceNumberOfNext);\n if (sinceNumberOfNext >= endId) {\n return;\n } else {\n // console.log('in else');\n var options = {\n url: addAuthQueryParameters(url),\n headers: {\n 'User-Agent': 'stat'\n }\n };\n\n console.log('options', options)\n \n function requestCallback(error, response, body) {\n // console.log('in request callback');\n console.log('err', error);\n if (!error && response.statusCode == 200) {\n var repos = JSON.parse(body);\n var nextUrl = extractSinceUrl(response.headers.link);\n for (var i = 0; i < repos.length; i++) {\n parseAndSaveToDB(repos[i]);\n }\n\n console.log('nextUrl', nextUrl);\n // console.log('repooos', repos);\n recurse(nextUrl);\n // console.log('responselink', response.headers);\n // console.log('repos', repos);\n // console.log(info.stargazers_count + \" Stars\");\n // console.log(info.forks_count + \" Forks\");\n }\n }\n\n request(options, requestCallback);\n }\n }", "function spiderLinks(currentUrl, body, nesting) {\n if(nesting === 0) { \n return nextTick(); \n }\n\n return callback => {\n let completed = 0, hasErrors = false;\n const links = utilities.getPageLinks(currentUrl, body);\n if(links.length === 0) { \n return process.nextTick(callback); \n }\n }\n function done(err, result) {\n if(err && !hasErrors) { \n hasErrors = true; \n return callback(err); \n } \n if(++completed === links.length && !hasErrors) {\n callback(); \n }\n }\n \n for(let i = 0; i < links.length; i++) { \n co(spider(links[i], nesting - 1)).then(done); \n }\n}", "function recursiveScrape (csw, start, increment, max) {\n buildRequests(csw, start, increment, function (get) {\n parse.parseCsw(get, function (data) {\n if (data) {\n async.waterfall([\n function (callback) {\n utility.constructorCsw(dirs, data, callback);\n },\n function (data, callback) {\n if (data) utility.processorCsw(data, callback);\n },\n ], function (err) {\n if (err) console.log(err);\n })\n }\n if (data[\"next\"]) {\n var start = Number(data['next']);\n console.log(start);\n if (start > 0 && start <= max)\n recursiveScrape(csw, start, increment, max);\n }\n })\n })\n }", "process(id) {\n return __awaiter(this, void 0, void 0, function* () {\n let result = yield this.checkCache(id);\n if (result === undefined) {\n // console.log(\"requesting id\", id)\n //console.time(\"ldfetch\")\n let request = this.ldfetch.get(id);\n result = new Promise(function (resolve) {\n request.then((requestresult) => {\n //console.timeEnd(\"ldfetch\")\n //console.time(\"processing\")\n resolve(new TreeConstructor_1.TreeConstructor().getProperties(requestresult.triples));\n });\n });\n this._cache.set(id.replace(/#.*/, ''), result);\n }\n if (result === undefined) {\n throw new Error(\"ERROR UNDEFINED \");\n }\n let processed = yield result;\n //console.timeEnd(\"processing\")\n return processed;\n });\n }", "function recursiveScrape (csw, start, increment, max) {\n buildRequests(csw, start, increment, function (get) {\n parse.parseCsw(get, function (data) {\n if (data) {\n async.waterfall([\n function (callback) {\n utility.constructorWfs(dirs, data, callback);\n },\n function (wfsData, callback) {\n async.each(wfsData, function (d) {\n if (d) utility.processWfs(d, callback);\n })\n },\n ], function (err) {\n if (err) console.log(err);\n })\n }\n if (data[\"next\"]) {\n var start = Number(data['next']);\n console.log(start);\n if (start > 0 && start <= max)\n recursiveScrape(csw, start, increment, max);\n }\n })\n })\n }", "async function loop(parents) {\n if (nextURL(parents.headers.get(\"Link\")) === undefined) {\n return;\n //otherwise keep going.\n } else {\n const RESPONSE = await fetch(\n nextURL(parents.headers.get(\"Link\")),\n OPTIONS\n );\n let data = await RESPONSE.json();\n let res = {\n data: data,\n ok: RESPONSE.ok,\n headers: RESPONSE.headers\n };\n if (res.ok) {\n //console.log(res.data);\n parentCollection.data = parentCollection.data.concat(res.data);\n console.log(res.data);\n console.info(Object.keys(parents.data).length);\n console.info(Object.keys(parentCollection.data).length);\n }\n await loop(res);\n //or:\n //await loop(res);\n //if you want to wait for it.\n\n //You need to call it from within an async function.\n }\n }", "async function recursiveFetch({ url, array }) {\n\tif(url) {\n\t\tconst tracks = await fetch(url, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': 'Bearer ' + accessToken\n\t\t\t}\n\t\t})\n\t\t\t.then(res => res.json())\n\t\t\t.then(data => {\n\t\t\t\tpushToArray(array, data.items)\n\t\t\t\tif(data.next) {\n\t\t\t\t\treturn recursiveFetch({ url: data.next, array: array })\n\t\t\t\t}\n\t\t\t\treturn array\n\t\t\t})\n\t\treturn tracks\n\t}\n\treturn array\n}", "async *walk() {\n for await (let relPath of this.walkRecursively('')) {\n yield relPath;\n }\n }", "function crawler() {\n var _this = this;\n\n this.articles = {\n /**\n * @description Gets all articleUrls from a open news web page\n */\n getUrls: function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, articleListSelector) {\n var browser, page, html, $, articles, _articleUrls, i;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n\n console.log(_colors2.default.yellow('> [Crawling] for article Urls ' + url));\n // const browser = await puppeteer.launch({ args: ['--no-sandbox, --disable-setuid-sandbox'], headless: true, ignoreHTTPSErrors: true });\n _context.next = 4;\n return _puppeteer2.default.launch({ headless: true });\n\n case 4:\n browser = _context.sent;\n _context.next = 7;\n return browser.newPage();\n\n case 7:\n page = _context.sent;\n _context.next = 10;\n return page.goto(url, { waitUntil: ['load', 'domcontentloaded', 'networkidle2'], timeout: 60000 });\n\n case 10:\n _context.next = 12;\n return page.content();\n\n case 12:\n html = _context.sent;\n $ = _cheerio2.default.load(html);\n articles = $(articleListSelector);\n _articleUrls = [];\n\n // Push all articles into array\n\n for (i = 0; i < articles.length; i++) {\n _articleUrls.push('' + articles[i].attribs.href);\n }\n\n // Clean articles to remove duplicate links if any\n _articleUrls = (0, _underscore.uniq)(_articleUrls);\n console.log(_colors2.default.green.bold('> Found ' + _articleUrls.length + ' unique article links'));\n _context.next = 21;\n return browser.close();\n\n case 21:\n return _context.abrupt('return', _articleUrls);\n\n case 24:\n _context.prev = 24;\n _context.t0 = _context['catch'](0);\n\n console.log('> Error in crawling for article urls: ', _context.t0.message);\n\n case 27:\n case 'end':\n return _context.stop();\n }\n }\n }, _callee, _this, [[0, 24]]);\n }));\n\n function getUrls(_x, _x2) {\n return _ref.apply(this, arguments);\n }\n\n return getUrls;\n }(),\n /**\n * @description Gets article content from an article web page\n */\n getContent: function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(crawlParams) {\n var articleUrls, articlePrependUrl, articleHeaderSelector, articleDateSelector, articleTextSelector, hasWriter, hasHeader, hasDate, siteArticles, browser, i, articleUrl, page, html, $, articleHeader, articleWriter, articleDate, articleText, article;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n articleUrls = crawlParams.articleUrls, articlePrependUrl = crawlParams.articlePrependUrl, articleHeaderSelector = crawlParams.articleHeaderSelector, articleDateSelector = crawlParams.articleDateSelector, articleTextSelector = crawlParams.articleTextSelector, hasWriter = crawlParams.hasWriter, hasHeader = crawlParams.hasHeader, hasDate = crawlParams.hasDate;\n siteArticles = [];\n _context2.next = 4;\n return _puppeteer2.default.launch({ headless: true });\n\n case 4:\n browser = _context2.sent;\n i = 0;\n\n case 6:\n if (!(i < articleUrls.length)) {\n _context2.next = 33;\n break;\n }\n\n _context2.prev = 7;\n articleUrl = articleUrls[i];\n\n console.log(_colors2.default.bold.green('> [Scraping] article url for content: ' + articlePrependUrl + articleUrl));\n // const browser = await puppeteer.launch({ args: ['--no-sandbox, --disable-setuid-sandbox'], headless: true, ignoreHTTPSErrors: true });\n _context2.next = 12;\n return browser.newPage();\n\n case 12:\n page = _context2.sent;\n _context2.next = 15;\n return page.goto('' + articlePrependUrl + articleUrl, { waitUntil: ['load', 'domcontentloaded', 'networkidle2'], timeout: 60000 });\n\n case 15:\n _context2.next = 17;\n return page.content();\n\n case 17:\n html = _context2.sent;\n $ = _cheerio2.default.load(html);\n articleHeader = hasHeader ? $(articleHeaderSelector).text() : '';\n articleWriter = hasWriter ? $(articleHeaderSelector).text() : '';\n articleDate = hasDate ? $(articleDateSelector).text() : '';\n articleText = $(articleTextSelector).text();\n article = {\n date: articleDate,\n header: articleHeader,\n text: articleText,\n writer: articleWriter,\n url: '' + articlePrependUrl + articleUrl\n // TODO: Do not push all article that are written more than 24 hours ago.\n };\n siteArticles.push(article);\n _context2.next = 30;\n break;\n\n case 27:\n _context2.prev = 27;\n _context2.t0 = _context2['catch'](7);\n\n console.log('Error scraping url: ' + articleUrls[i] + ': \\n ' + _context2.t0.message);\n\n case 30:\n i++;\n _context2.next = 6;\n break;\n\n case 33:\n _context2.next = 35;\n return browser.close();\n\n case 35:\n return _context2.abrupt('return', siteArticles);\n\n case 36:\n case 'end':\n return _context2.stop();\n }\n }\n }, _callee2, _this, [[7, 27]]);\n }));\n\n function getContent(_x3) {\n return _ref2.apply(this, arguments);\n }\n\n return getContent;\n }(),\n /**\n * @description Crawl all article urls from a list of company sites and subsequently crawl all their contents\n */\n getAll: function () {\n var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(companies) {\n var allSitesArticles, i, company, _articleUrls2, _siteArticles, siteArticlesWithInfo;\n\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n allSitesArticles = [];\n i = 0;\n\n case 2:\n if (!(i < companies.length)) {\n _context3.next = 21;\n break;\n }\n\n _context3.prev = 3;\n company = companies[i];\n _context3.next = 7;\n return _this.articles.getUrls(company.url, company.articleListSelector);\n\n case 7:\n _articleUrls2 = _context3.sent;\n _context3.next = 10;\n return _this.articles.getContent({\n articleUrls: _articleUrls2,\n articlePrependUrl: company.articlePrependUrl,\n articleHeaderSelector: company.articleHeaderSelector,\n articleDateSelector: company.articleDateSelector,\n articleTextSelector: company.articleTextSelector,\n hasWriter: company.hasWriter,\n hasHeader: company.hasHeader,\n hasDate: company.hasDate\n });\n\n case 10:\n _siteArticles = _context3.sent;\n siteArticlesWithInfo = {\n siteArticles: _siteArticles,\n name: company.name,\n url: company.url\n };\n\n allSitesArticles.push(siteArticlesWithInfo);\n _context3.next = 18;\n break;\n\n case 15:\n _context3.prev = 15;\n _context3.t0 = _context3['catch'](3);\n\n console.log('> Error in getAll: ', _context3.t0.message);\n\n case 18:\n i++;\n _context3.next = 2;\n break;\n\n case 21:\n return _context3.abrupt('return', allSitesArticles);\n\n case 22:\n case 'end':\n return _context3.stop();\n }\n }\n }, _callee3, _this, [[3, 15]]);\n }));\n\n function getAll(_x4) {\n return _ref3.apply(this, arguments);\n }\n\n return getAll;\n }(),\n /**\n * @description save each article from each\n */\n saveAndSummarizeToDb: function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {\n var allSitesArticles, i, siteArticlesWithInfo, _name, _url, _siteArticles2, j;\n\n return regeneratorRuntime.wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return _this.articles.getAll(_constants.COMPANY_SITES);\n\n case 2:\n allSitesArticles = _context5.sent;\n i = 0;\n\n case 4:\n if (!(i < allSitesArticles.length)) {\n _context5.next = 22;\n break;\n }\n\n siteArticlesWithInfo = allSitesArticles[i];\n _name = siteArticlesWithInfo.name, _url = siteArticlesWithInfo.url, _siteArticles2 = siteArticlesWithInfo.siteArticles;\n j = 0;\n\n case 8:\n if (!(j < _siteArticles2.length)) {\n _context5.next = 19;\n break;\n }\n\n _context5.prev = 9;\n return _context5.delegateYield( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {\n var article, originalText, originalHeader, options, _ref5, summary_title, summary_points, summarizedArticle, query;\n\n return regeneratorRuntime.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n article = _siteArticles2[j];\n originalText = article.text;\n originalHeader = article.header;\n options = {\n title: article.header,\n text: article.text,\n summary_length: 10,\n coref: false,\n sort_by_salience: true,\n include_all_sentences: false\n };\n _context4.next = 6;\n return _Agolo2.default.summarizer.summarize(options);\n\n case 6:\n _ref5 = _context4.sent;\n summary_title = _ref5.summary_title;\n summary_points = _ref5.summary_points;\n summarizedArticle = {\n summary_title: summary_title,\n summary_points: summary_points,\n site_name: _name,\n site_url: _url,\n article_url: article.url,\n original_text: originalText,\n original_header: originalHeader,\n summarized: true,\n project: 'IB-III',\n date_written: article.date\n };\n query = { article_url: summarizedArticle.article_url };\n // Only save articles of unique article urls\n\n _context4.next = 13;\n return _article2.default.findOneAndUpdate(query, summarizedArticle, { upsert: true }, function (error) {\n if (error) {\n console.log('> Error saving article:', error.message);\n }\n console.log(_colors2.default.bold.cyan('> [Saving] Summarized Article to Db: ' + summarizedArticle.article_url));\n });\n\n case 13:\n case 'end':\n return _context4.stop();\n }\n }\n }, _callee4, _this);\n })(), 't0', 11);\n\n case 11:\n _context5.next = 16;\n break;\n\n case 13:\n _context5.prev = 13;\n _context5.t1 = _context5['catch'](9);\n\n console.log('Error in summarizing article:: \\n' + _context5.t1.message);\n\n case 16:\n j++;\n _context5.next = 8;\n break;\n\n case 19:\n i++;\n _context5.next = 4;\n break;\n\n case 22:\n case 'end':\n return _context5.stop();\n }\n }\n }, _callee5, _this, [[9, 13]]);\n }));\n\n function saveAndSummarizeToDb() {\n return _ref4.apply(this, arguments);\n }\n\n return saveAndSummarizeToDb;\n }(),\n getPage: function () {\n var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {\n var browser, page, url, html;\n return regeneratorRuntime.wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return _puppeteer2.default.launch({ headless: true });\n\n case 2:\n browser = _context6.sent;\n _context6.next = 5;\n return browser.newPage();\n\n case 5:\n page = _context6.sent;\n url = 'http://localhost:3000/';\n _context6.next = 9;\n return page.goto(url, { waitUntil: ['load', 'domcontentloaded', 'networkidle2'], timeout: 60000 });\n\n case 9:\n _context6.next = 11;\n return page.content();\n\n case 11:\n html = _context6.sent;\n _context6.next = 14;\n return browser.close;\n\n case 14:\n return _context6.abrupt('return', html);\n\n case 15:\n case 'end':\n return _context6.stop();\n }\n }\n }, _callee6, _this);\n }));\n\n function getPage() {\n return _ref6.apply(this, arguments);\n }\n\n return getPage;\n }()\n };\n}", "function recursive(url) {\n $.ajax({type: 'GET',dataType: 'jsonp',url: url}).done(function(data){\n //console.log(data);\n $.each(data.entries, function(i,item){\n \n if(item.img.orig){\n\n photos.push({\n 'preview' : item.img.XXS.href,\n //'original': item.img.origin.href, // High load page!\n 'original': item.img.XL.href,\n 'id' : item.id,\n 'index' : photos.length+1\n });\n\n }; \n });\n if(data.links.next)\n recursive(data.links.next);\n else{\n def.resolve();\n };\n });\n }", "async function getChildren(childURLs) {\n const children = []\n\n if (childURLs) {\n for (let i = 0; i < childURLs.length; i++) {\n children[i] = await axios.get(childURLs[i]).then(response => {\n return (response.data);\n }).catch(error => {\n console.log('NETWORKING ERROR: ' + error);\n });\n }\n return (children);\n }\n return (null);\n}", "findAllUrls(progress) {\n var _this = this;\n\n return _asyncToGenerator(function* () {\n _this.progress = progress;\n\n if (_this.crawlStatesRepository.urlsPoolSize() === 0) {\n _this.crawlStatesRepository.addPoolUrl(_this.initialUrl);\n }\n\n _this.browser = yield _puppeteer.default.launch({\n ignoreHTTPSErrors: true,\n headless: true\n });\n _this.page = yield _this.browser.newPage();\n\n _this.page.setJavaScriptEnabled(true);\n\n if (_this.option.credentials) {\n yield _this.login();\n }\n\n return new Promise(resolve => {\n _this.resolve = resolve;\n\n _this.crawlNextUrl();\n });\n })();\n }", "function run(){\n fetchContent(root_url + home_suffix)\n .then((html) => parseHomeContent(html))\n\n // Process sublinks\n .then(\n links => {\n\n // Build list of Promise to run sequentially\n var promises = links.reduce((promiseChain, link) => {\n return promiseChain\n .then(() => fetchContent(root_url + link))\n .then(html => parseDetailContent(html))\n .then(song => {\n if (song.content.length > 0) dataset.push(song)\n })\n .then(() => new Promise((resolve) => {\n asyncResolve(resolve, 1000);\n }));\n\n\n }, Promise.resolve());\n\n // Save dataset to file\n promises.then(\n data => {\n // Sort array by ke\n sortArrayBy(dataset, 'id')\n //console.log(dataset)\n saveData(JSON.stringify(dataset), \"./data/data.json\")\n }\n ).then(() => console.log('treated ' + dataset.length + ' items'))\n\n }\n );\n\n }", "*descendants() {\r\n let state = this.next;\r\n while (state != null) {\r\n yield state;\r\n state = state.next;\r\n }\r\n }", "function familyTreeGetDown({\n // public parameters\n // @param callback: function({depth, from, infolocal, fullinfo})\n // @param from: family search identifier XXXX-YYY\n // @param depthmax: maximal depth\n // @param callbackEnd: called at the end\n callback=function(){{depth=0, from='UNKNOWN', infolocal={}, fullinfo={}, chain=[]}},\n from=getCurrentId(),\n depthmax=10,\n callbackBeforePerson=function(identifier) {return true;},\n callbackEnd=function({visited=0, errors=0}){console.log(\"Default ended method\");},\n // private parameters\n // @param depth: the current depth\n // @param currentChain: the current chain to the current 'from' (not included) [{id, name, nextisfather}]\n // @param currentalgo: shared parameters for the current process\n depth=0, currentChain=[],\n shareddata={},\n currentalgo={totaldone:0, currentmax:0, errors:0}}={}) {\n if (!callbackBeforePerson(from)) {\n return;\n }\n currentalgo.currentmax++;\n //console.log(\"After call:\" + from + \" \" + objectId(currentalgo));\n fetch(familyTreeRecursive_urlSimple(from)\n )\n .then(response => {\n return response.json();\n })\n .then(function (infolocal) {\n fetch(familyTreeRecursive_urlComplete(from)).then(response => {\n return response.json();\n }).then(function (fullinfo) {\n var command = callback({depth:depth, from:from, infolocal:infolocal, fullinfo:fullinfo, chain:currentChain,shareddata:shareddata});\n if (command == \"stop\") {\n // do not go deeper\n return;\n }\n if (depth < depthmax && fullinfo.data.spouses) {\n var childCounter = 0;\n for (var i=0; i < fullinfo.data.spouses.length; i++) {\n if (!fullinfo.data.spouses[i].children) continue;\n for (var j=0; j < fullinfo.data.spouses[i].children.length; j++) {\n var child = fullinfo.data.spouses[i].children[j];\n childCounter++;\n //console.log(\"In \"+from+\", child \" + i + \"-\"+j)\n // new chain in order to tell we are in a father\n var newChain = currentChain.slice(0);\n newChain.push({id:from, name:infolocal.name, child:childCounter});\n var arguments = {callback:callback, depthmax:depthmax, callbackEnd:callbackEnd, currentChain:newChain, depth:depth+1, currentalgo:currentalgo, shareddata:shareddata,\n from:child.id};\n familyTreeGetDown(arguments);\n }\n }\n }\n }).catch(function(e) {\n console.log(e);\n currentalgo.errors++;\n }).finally(function() {\n currentalgo.totaldone++;\n if (currentalgo.totaldone == currentalgo.currentmax) {\n console.log(\"Ended, \" + currentalgo.totaldone + \" visited, \"+currentalgo.errors+\" errors.\");\n callbackEnd({visited:currentalgo.totaldone, errors:currentalgo.errors, shareddata:shareddata})\n }\n });\n }\n ).catch(function(err) {\n console.log(err);\n currentalgo.currentmax--;\n currentalgo.errors++;\n if (currentalgo.totaldone == currentalgo.currentmax) {\n console.log(\"Ended, \" + currentalgo.totaldone + \" visited, \"+currentalgo.errors+\" errors.\");\n callbackEnd({visited:currentalgo.totaldone, errors:currentalgo.errors, shareddata:shareddata})\n }\n });\n}", "async function asyncWrapperFunction() {\r\n await htmlRouting();\r\n await videoRouting();\r\n const data = await dataProcessing();\r\n const nodes = await nodesGetting();\r\n dynamic(data,nodes);\r\n display(data,nodes);\r\n}", "function fetchData(){\n\n if(URLS.length == 0 ){\n storedata();\n\t return;\n }\n let url = URLS.shift()\n console.log(\"-----------------\");\n console.log(url);\n https.get(url,function(res){\n var response_data = \"\";\n res.setEncoding('utf8');\n res.on('data', function(chunk) {\n response_data += chunk;\n });\n res.on('end', function() {\n html_links = parseXml(response_data); // each individual url from sitemap.xml has html links which are fetched and stored in this variable.\n\t\t\n\t\tconsole.log(\"-------------html link length: \"+html_links.length);\n fetchHtml();\n \n });\n }).on('error',function(e){\n console.log(\"Error in fetching XML url: \"+e.message);\n fetchData(URLS.shift());\n });\n}", "function buildLinks() {\n\n return new Promise(function(resolve, reject) {\n\n // Holds URLS\n var urlHolder = [];\n\n // Add one url as seed\n urlHolder.push(startingUrl);\n\n // For tracking recursion\n var called = 0;\n\n // Initialize\n crawlHeldLinks();\n\n\n // -== Called Recursively to build links\n function crawlHeldLinks() {\n // Track call\n called++\n // Record length\n var currentLen = urlHolder.length;\n // Scrape links\n h.waitAndFire(0, urlHolder.length, function(x) {\n\n xray(urlHolder[x], ['a @href'])(function(err, content) {\n if (err) reject(err);\n // Append new links\n urlHolder = urlHolder.concat(content);\n // Remove Duplicates\n urlHolder = h.removeDuplicates(urlHolder);\n // Remove all that dont fit url\n urlHolder = h.removeAllWithout(urlHolder, startingUrl);\n\n // Log\n console.log(urlHolder);\n console.log(currentLen)\n console.log(x);\n\n // Call again with new links or console.log all links\n if (x === currentLen - 1) {\n if (called === limit) {\n // Create hash\n var redisHash = {};\n\n // Add all links Redis as keys and values\n _.each(urlHolder, function(linkToHash, linkIndex) {\n rClient.set(linkToHash, linkToHash);\n });\n\n // Log\n console.log('Finished');\n resolve();\n\n } else {\n crawlHeldLinks(urlHolder);\n console.log('Restart Recursion:' + called);\n }\n\n } else {\n console.log('Continuing');\n }\n\n });\n });\n\n };\n })\n}", "_loadHierarchyLearningData() {\n let {webservice} = this.props.config,\n currentUser = AppStore.getState().currentuser,\n audience = AppStore.getState().audiencemembers;\n\n getLearningForManagerHierarchy(webservice, currentUser.id, audience ,this._onLoadingProgress.bind(this)).fork(console.error, res => {\n console.log('hierarchy loaded', res);\n AppStore.dispatch(SetHierarchy(res));\n // this._loadAudience();\n this._loadAllego();\n });\n }", "function makeRecursiveRequest() {\n $.get( url, function parseResponse(data) {\n console.log(data);\n if (Object.keys(listOfTasks).length === 0) {\n console.log(\"-----------TASK GRAPH FINISHED CLOSE LOOP !-----------------\");\n return;\n }\n for (var key in data[\"tasks\"]) {\n if (!isEmpty(data[\"tasks\"][key][\"resolution\"])) {\n if (data[\"tasks\"][key][\"resolution\"][\"completed\"] !== undefined && listOfTasks[key] !== undefined) {\n $('<a>',{\n text: \" result\",\n title: 'task',\n href: \"http://docs.taskcluster.net/tools/task-inspector/#\" + data[\"tasks\"][key]['taskId']\n }).appendTo('#'+ key);\n var resultUrl = data[\"tasks\"][key][\"resolution\"][\"resultUrl\"];\n delete(listOfTasks[key]);\n }\n\n }\n }\n\n setInterval(makeRecursiveRequest, 5000);\n });\n}", "async function findDownload(UrlModel, identifier){\n //await identifier;\n //console.log('thread ' + identifier + ' looking for new download');\n //prevent stack overflow\n await Promise.resolve();\n\n //will find all websites that still need their screenshts downloaded\n UrlModel.find({downloaded: false, assigned: false},\n function(err, response){\n //deal with errors\n if(err){\n console.log(result);\n return console.error(err);\n }\n\n if (response.length == 0){\n //console.log('no potential websites found');\n //after finnished wait for min number of seconds and then search for next ss to be downloaded\n setTimeout(function(){findDownload(UrlModel, identifier);}, 500);\n return;\n }\n\n //return if there are no websites that need screenshots\n if (response.length !=0){\n console.log(response.length + ' potential websites found');\n //for now we will just use the top result but later we will build better\n //rankng system for which screnshots to download first\n var urlToDownload = response[0];\n console.log('starting download for ' + urlToDownload.url);\n\n //set us as the downloader for this url\n UrlModel.update({_id: urlToDownload._id},\n {\n assigned: true,\n downloader: config.serverName,\n downloadStartTime: new Date().getTime()\n }, async function(err, response){\n if(err){\n console.log(result);\n return console.error(err);\n }\n\n //download the screenshot\n await downloadScreenshot(urlToDownload.url,\n urlToDownload.imgLink, urlToDownload.fileName,\n urlToDownload._id).then(() => {\n //after finnished look for another website to download\n findDownload(UrlModel, identifier);\n });\n\n //update database to signify that download has finnished\n UrlModel.update({_id: urlToDownload._id}, {downloaded: true}, function(err, response){\n if(err){\n console.log(resut);\n return console.error(err);\n }\n });\n })\n }\n })\n\n\n}", "async function main() {\n browser = await puppeteer.launch({\n headless: true,\n // headless: false,\n });\n const [page] = await browser.pages();\n const splitLink = url.split(\"/\");\n const userInfo = {\n username: splitLink[3],\n repoTitle: splitLink[4],\n branch: splitLink[6] || \"master\",\n };\n console.log(\n \"---------------------------- creating folder's tree structure & parsing links ----------------------------\"\n );\n await parseTree({ url, page, currPath: destPath });\n await browser.close();\n console.log(\n \"---------------------------- downloading files ----------------------------\"\n );\n // browser = await puppeteer.launch({\n // headless: false,\n // defaultViewport: false,\n // });\n await downloaderCaller(userInfo);\n // await browser.close();\n}", "function fetchNodes() {\n return api[\"b\" /* default */].get(config[\"a\" /* default */].getSiteServersUrl(config[\"a\" /* default */].defaultSiteId)).then(function (json) {\n return Object(lodash[\"map\"])(json, makeNode);\n });\n}", "function iterate(iteration){ //recursive function to iterate through promises\n const yieldedObject = iteration.value;\n if(iteration.done) //stop iterating when done and return the final value wrapped in a promise\n return Promise.resolve(iteration.value);\n return Promise.resolve(iteration.value) //returns a promise with its then() and catch() methods filled\n .then(x => iterate(genObject.next(x))) //calls recursive function on the next value to be iterated\n .catch(x => iterate(genObject.throw(x))); //throws an error if a rejection is encountered\n }", "function scrapeServer (base, csw, host, start, increment, max) {\n start = typeof start !== \"undefined\" ? start : 1;\n increment = typeof increment !== \"undefined\" ? increment : 10;\n max = typeof max !== 'undefined' ? max : 10000000;\n\n var dirs = utility.buildDirs(base);\n\n // Pretty simple recursion here, expects a 'next' parameter in the CSW.\n function recursiveScrape (csw, start, increment, max) {\n buildRequests(csw, start, increment, function (get) {\n parse.parseCsw(get, function (data) {\n if (data) {\n sync.constructor(dirs, data, host, function (linkages) {\n if (linkages) {\n sync.processor(linkages)\n }\n })\n }\n if (data['next']) {\n var start = Number(data['next']);\n console.log(start);\n if (start > 0 && start <= max)\n recursiveScrape(csw, start, increment, max);\n }\n })\n })\n }\n recursiveScrape(csw, start, increment, max);\n}", "*[Symbol.iterator]() {\n\t\tlet node = this.head;\n\t\twhile(node.next !== null){\n\t\t\tyield node;\n\t\t\tnode = node.next;\n\t\t}\n\t}", "async function ids(node, s)\n{\n for(let i=0;i<=2;i++){\n await rdls(node, s, 0, i)\n\n }\n}", "*forwards() {\r\n yield this;\r\n yield* this.descendants();\r\n }", "function scrapeAll (base, csw, start, increment, max, s3Bucket) {\n start = typeof start !== \"undefined\" ? start : 1;\n increment = typeof increment !== \"undefined\" ? increment : 10;\n max = typeof max !== 'undefined' ? max : 10000000;\n\n var dirs = utility.buildDirs(base);\n\n function recursiveScrape (csw, start, increment, max) {\n buildRequests(csw, start, increment, function (get) {\n parse.parseCsw(get, function (data) {\n if (data) {\n async.waterfall([\n function (callback) {\n utility.constructor(dirs, data, 'all', callback);\n },\n function (data, callback) {\n async.each(data, function (d) {\n if (d['wfs']) {\n utility.processWfs(d, callback);\n } else {\n utility.processorCsw(d, callback);\n }\n })\n },\n ], function (err) {\n if (err) console.log(err);\n })\n }\n if (data[\"next\"]) {\n var start = Number(data['next']);\n console.log(start);\n if (start > 0 && start <= max)\n recursiveScrape(csw, start, increment, max);\n }\n })\n })\n }\n recursiveScrape(csw, start, increment, max);\n}", "function make_async(){\n let anchors = document.querySelectorAll('a.async');\n\n anchors.forEach((anchor => {\n anchor.addEventListener('click', (a) => {\n a.preventDefault();\n\n fetchHTML(anchor.pathname);\n })\n }))\n}", "function crawlWeb (seed){\n\tvar toCrawl = [seed];\n\tvar crawled = [];\n\twhile (toCrawl.length > 0){\n\t\tvar page = toCrawl.pop();\n\t\tfor(var i = 0; i < crawled.length; i++){\n\t\t\tif (page == crawled[i]){\n\t\t\t\treturn crawled;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tunion(tocrawl, getAllLinks(page))\n\t\t\t\tcrawled.push(page);\n\n\t\t\t}\n\t\t}\n\n\t\t\n\n\t}\n\n}", "function recursivelyNext(data) {\n let yielded = iterator.next.apply(iterator, arguments); // { value: Any, done: Boolean }\n\n if (isPromise(yielded.value)) {\n yielded.value.then((data) => {\n recursivelyNext(data);\n });\n }\n\n function isPromise(val) {\n return val && typeof val.then === 'function';\n }\n}", "function doTheWork() {\n getUrlsFromPage()\n // .then(urls => {\n // // check in reddis if url exists\n // // return filtered array\n // })\n .then((urls) => {\n urls.forEach(url => {\n //return console.log(url);\n crawl(url).then((car) => {\n printCar(car);\n // send email\n // for later us: client.set(\"string key\", \"string val\", redis.print);\n });\n });\n })\n}", "async function sendurlrequestStatic (url,blockElement){ \n try{\n let content = await rp(url)\n\n let results = await scrape(content,blockElement)//pass the HTML content to cheerio to be scraped \n return await results; //return the string array from cheerio;\n }catch(err){\n throw new Error(err.message)//throws an error if any issue occurs\n }\n}", "getParentInfos() {\n return __awaiter(this, void 0, void 0, function* () {\n const urlInfo = yield this.select(\"ServerRelativeUrl\", \"ListItemAllFields/ParentList/Id\", \"ListItemAllFields/ParentList/RootFolder/UniqueId\", \"ListItemAllFields/ParentList/RootFolder/ServerRelativeUrl\", \"ListItemAllFields/ParentList/RootFolder/ServerRelativePath\", \"ListItemAllFields/ParentList/ParentWeb/Id\", \"ListItemAllFields/ParentList/ParentWeb/Url\", \"ListItemAllFields/ParentList/ParentWeb/ServerRelativeUrl\", \"ListItemAllFields/ParentList/ParentWeb/ServerRelativePath\").expand(\"ListItemAllFields/ParentList\", \"ListItemAllFields/ParentList/RootFolder\", \"ListItemAllFields/ParentList/ParentWeb\")();\n return {\n Folder: {\n ServerRelativeUrl: urlInfo.ServerRelativeUrl,\n },\n ParentList: {\n Id: urlInfo.ListItemAllFields.ParentList.Id,\n RootFolderServerRelativePath: urlInfo.ListItemAllFields.ParentList.RootFolder.ServerRelativePath,\n RootFolderServerRelativeUrl: urlInfo.ListItemAllFields.ParentList.RootFolder.ServerRelativeUrl,\n RootFolderUniqueId: urlInfo.ListItemAllFields.ParentList.RootFolder.UniqueId,\n },\n ParentWeb: {\n Id: urlInfo.ListItemAllFields.ParentList.ParentWeb.Id,\n ServerRelativePath: urlInfo.ListItemAllFields.ParentList.ParentWeb.ServerRelativePath,\n ServerRelativeUrl: urlInfo.ListItemAllFields.ParentList.ParentWeb.ServerRelativeUrl,\n Url: urlInfo.ListItemAllFields.ParentList.ParentWeb.Url,\n },\n };\n });\n }", "getMutualFriendsBetweenFriendsOfMyFriendsAndFriendsOfDestinationFriends(myFriends, destFriends, myFriendsFriends, destFriendsFriends) {\n // if we found any link then return\n if (this.linksAreFound) {\n return;\n }\n\n let myFriendsCount = myFriends.length;\n let destFriendsCount = destFriends.length;\n let smallList = [];\n let bigList = [];\n let bigFriendsFriends = [];\n let smallCount = 0;\n let smallIsMyList = false;\n if (myFriendsCount < destFriendsCount) {\n smallList = myFriends;\n bigList = destFriends;\n smallCount = myFriendsCount;\n smallIsMyList = true;\n bigFriendsFriends = destFriendsFriends;\n }\n else {\n smallList = destFriends;\n bigList = myFriends;\n smallCount = destFriendsCount;\n bigFriendsFriends = myFriendsFriends;\n }\n\n let processedFriends = 0;\n let processedFriendsBigList = 0;\n let currentPartOfBigListProcessed = true;\n let stepByBigList = 5; //5 * 300 friends = 1500 friends\n let partOfBigList = [];\n let bigFriendsFriendsLength = this.getLengthOfArray(bigFriendsFriends);\n\n // 2 request per second\n let interval = setInterval(() => {\n if (this.maxIsReached) {\n clearInterval(interval);\n return;\n }\n\n if (currentPartOfBigListProcessed) {\n currentPartOfBigListProcessed = false;\n partOfBigList = this.getPartOfList(bigFriendsFriends, processedFriendsBigList, stepByBigList);\n processedFriends = 0;\n }\n\n let commandCode = this.getMutualCommandCode(smallList, processedFriends, this.step, partOfBigList);\n console.log('last chance');\n VK.api('execute', { code: commandCode }, (data) => {\n console.log(data);\n let response = data.response;\n\n let links = [];\n\n //go by small list\n for (name in response) {\n let friendId = name.substring(3, name.length);\n let commonFriends = response[name];\n if (commonFriends) {\n // go by big list\n commonFriends.forEach((element) => {\n if (element.common_count > 0) {\n console.log('common_count > 0');\n // go to common friends between my friends and dest' friends friends\n element.common_friends.forEach((friend) => {\n let destFriendFriend = this.getFriendsOfThisFriend(bigFriendsFriends, element.id);\n destFriendFriend.forEach((firstFriendOfDest) => {\n if (smallIsMyList) {\n links.push(new Array(this.viewer_id, friendId, friend, element.id, firstFriendOfDest, this.search_id));\n }\n else {\n links.push(new Array(this.viewer_id, firstFriendOfDest, element.id, friend, friendId, this.search_id));\n }\n });\n });\n }\n });\n }\n }\n\n if (links.length > 0) {\n this.linksAreFound = true;\n this.linksRenderer.addLinks(links);\n }\n });\n\n processedFriends += this.step;\n\n if (processedFriends >= smallCount) {\n currentPartOfBigListProcessed = false;\n processedFriendsBigList += stepByBigList;\n processedFriends = 0;\n }\n\n if (processedFriendsBigList >= bigFriendsFriendsLength) {\n clearInterval(interval);\n }\n }, 700);\n }", "visit() {\n this.state = 'visiting'\n const _this = this\n this.recordInfor('开始遍历文件树...')\n removeOutOfVisitlessQueue(this)\n addToVisitingQueue(this)\n visitTask(this.target, this.name, this.type, this.rootSize, this.dirUUID, this.tree, this, (err, data) => {\n if (err) return _this.error(err, '遍历服务器数据出错')\n _this.tree[0].downloadPath = _this.downloadPath\n removeOutOfVisitingQueue(this)\n _this.recordInfor('遍历文件树结束...')\n this.diff()\n })\n }", "function crawlUrl(options,callback){\n \n request(options.url,(err,response,body)=>{\n if(err) {\n debug('Error on request to URL: ',err);\n if(response == null){\n // console.log('Error on request to URL',err);\n return callback(err,null,null);\n } \n else{\n return callback(err,null,response.statusCode);\n } \n \n }else {\n /* \n * crawl links only to specified depth and domain\n * for rest only check whether the link is broken or not \n */\n let alinks = null;\n \n if(response.statusCode === 200 && body!=null){\n if(options.depth_count<global.getDepth() && options.regex.test(options.hostname)){ \n let $ = cheerio.load(body);\n options.depth_count+=1;\n alinks = $('a').map((i,e)=>{\n return {\n link: e.attribs.href,\n title: e.attribs.title,\n depth: options.depth_count \n }\n }).get();\n }\n } \n callback(null,alinks,response.statusCode);\n }\n }); \n}", "dfsRecursive(start){ \n let results = []\n let visited = {}\n let adjacenyList = this.adjacenyList\n \n function traverse(vertex){\n if(!vertex) return null\n results.push(vertex)\n visited[vertex] = true\n adjacenyList[vertex].forEach(neighbour => {\n if(!visited[neighbour]){\n return traverse(neighbour)\n }\n })\n }\n\n traverse(start)\n return results\n }", "function familyTreeRecursive({\n // public parameters\n // @param callback: function({depth, from, infolocal, fullinfo})\n // @param from: family search identifier XXXX-YYY\n // @param depthmax: maximal depth\n // @param callbackEnd: called at the end\n callback=function(){{depth=0, from='UNKNOWN', infolocal={}, fullinfo={}, chain=[]}},\n from=getCurrentId(),\n depthmax=10,\n callbackBeforePerson=function(identifier) {return true;},\n callbackEnd=function({visited=0, errors=0}){console.log(\"Default ended method\");},\n // private parameters\n // @param depth: the current depth\n // @param currentChain: the current chain to the current 'from' (not included) [{id, name, nextisfather}]\n // @param currentalgo: shared parameters for the current process\n depth=0, currentChain=[], shareddata={},\n currentalgo={totaldone:0, currentmax:0, errors:0}}={}) {\n\n function familyTreeRecursiveCheckEnd() {\n if (currentalgo.totaldone == currentalgo.currentmax) {\n console.log(\"Ended, \" + currentalgo.totaldone + \" visited, \"+currentalgo.errors+\" errors.\");\n callbackEnd({visited:currentalgo.totaldone, errors:currentalgo.errors, shareddata:shareddata})\n }\n }\n if (!callbackBeforePerson(from)) {\n return;\n }\n currentalgo.currentmax++;\n //console.log(\"After call:\" + from + \" \" + objectId(currentalgo));\n fetch(familyTreeRecursive_urlSimple(from)\n )\n .then(response => {\n return response.json();\n })\n .then(function (infolocal) {\n fetch(familyTreeRecursive_urlComplete(from)).then(response => {\n return response.json();\n }).then(function (fullinfo) {\n var command = callback({depth:depth, from:from, infolocal:infolocal, fullinfo:fullinfo, chain:currentChain, shareddata:shareddata});\n if (command == \"stop\") {\n // do not go deeper\n return;\n }\n if (depth < depthmax && fullinfo.data.parents) {\n for (var i=0; i < fullinfo.data.parents.length; i++) {\n //console.log(\"In \"+from+\", parent \" + i)\n //console.log(fullinfo.data.parents[i]);\n // new chain in order to tell we are in a father\n var newChain = currentChain.slice(0);\n newChain.push({id:from, name:infolocal.name, nextisfather:true});\n var arguments = {callback:callback, depthmax:depthmax, callbackEnd:callbackEnd, callbackBeforePerson:callbackBeforePerson,\n currentChain:newChain, depth:depth+1, currentalgo:currentalgo, shareddata:shareddata};\n //console.log(\"Before any call:\" + from + \" \" + objectId(currentalgo) + \" \" + objectId(arguments.currentalgo));\n // checking father (husband of couple)\n if (typeof fullinfo.data.parents[i].husband != \"undefined\") {\n arguments.from = fullinfo.data.parents[i].husband.id;\n //console.log(\"Before call1:\" + arguments.from + \" \" + objectId(currentalgo) + \" \" + objectId(arguments.currentalgo));\n familyTreeRecursive(arguments);\n }\n if (typeof fullinfo.data.parents[i].wife != \"undefined\") {\n // new parameters in order to tell we are in a mother\n arguments.from = fullinfo.data.parents[i].wife.id;\n arguments.currentChain = newChain = currentChain.slice(0);\n newChain.push({id:from, name:infolocal.name, nextisfather:false});\n arguments.currentalgo = currentalgo;\n //console.log(\"Before call2:\" + arguments.from + \" \" + objectId(currentalgo));\n familyTreeRecursive(arguments);\n }\n [\"spouse1\", \"spouse2\"].forEach(function (attr) {\n if (typeof fullinfo.data.parents[i][attr] != \"undefined\") {\n // new parameters in order to tell we are in a mother or father\n var arguments = {callback:callback, depthmax:depthmax, callbackEnd:callbackEnd, callbackBeforePerson:callbackBeforePerson,\n currentChain:newChain, depth:depth+1, currentalgo:currentalgo, shareddata:shareddata};\n var attrvalue = fullinfo.data.parents[i][attr];\n arguments.from = attrvalue.id;\n if (arguments.from == \"UNKNOWN\") return;\n arguments.currentChain = newChain = currentChain.slice(0);\n arguments.currentalgo = currentalgo;\n newChain.push({id:from, name:infolocal.name, nextisfather:attrvalue.gender == \"MALE\"});\n //console.log(\"Before call3:\" + arguments.from + \" \" + objectId(currentalgo) + \" \" + objectId(arguments.currentalgo));\n familyTreeRecursive(arguments);\n }\n });\n }\n }\n }).catch(function(err) {\n console.log(err);\n currentalgo.errors++;\n }).finally(function() {\n currentalgo.totaldone++;\n familyTreeRecursiveCheckEnd();\n });\n }\n ).catch(function(err) {\n console.log(err);\n currentalgo.currentmax--;\n currentalgo.errors++;\n familyTreeRecursiveCheckEnd();\n });\n}", "async function executeSeqWithForAwait(urls) {\n const responses = [];\n const promises = urls.map((url) => {\n return fetchUrlDataWithAsyncAwait(url);\n });\n\n for await (const res of promises) {\n console.log(res);\n responses.push(res);\n }\n console.log(responses);\n}", "async function executeHardAsync() {\n const r1 = await fetchUrlData(apis[0]);\n const r2 = await fetchUrlData(apis[1]);\n}", "function Test_GetLink() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_create_link, out_rpc_create_link;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_GetLink\");\n in_rpc_create_link = new VPN.VpnRpcCreateLink({\n HubName_Ex_str: hub_name,\n AccountName_utf: \"linktest\"\n });\n return [4 /*yield*/, api.GetLink(in_rpc_create_link)];\n case 1:\n out_rpc_create_link = _a.sent();\n console.log(out_rpc_create_link);\n console.log(\"End: Test_GetLink\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function next(){\n console.log(\"\\n\\n fetch next ...\");\n if( !debug ){_next();}\n}", "viewchildIteration (baseUrl,username,spacename,iterationname,children){\n browser.get(baseUrl + username + \"/\" + spacename +\"/iterations/\" + iterationname +\"/\" +children);\n }", "function yielding_promises() {\n function asyncPromise(value) {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve(value);\n }, 500);\n });\n } \n\n function *yieldPromise() {\n var result = yield asyncPromise('foo');\n\n return result; // Note that you can return from generators\n }\n\n var co = require('co');\n\n co(function *() {\n var result = yield yieldPromise();\n\n console.log('This should be foo ->', result);\n });\n}", "function checkUrls(data) {\n let pattern = new RegExp('^((http?:)?\\\\/\\\\/)?')\n if (!pattern.test(data)) {\n alert('No valid URLs found.');\n return false;\n } else {\n //gathers address urls from each list as an origin for crawler\n const addressUrls = function(data) {\n let urls = [];\n \n //pulls in data using same order as json object, sets it to objLength for iteration\n const objLength = Object.values(data.pages);\n \n //iteration through address urls, moving data into urls array\n for (let i = 0; i < objLength.length; i++) {\n urls.push(data.pages[i].address)\n }\n return urls\n };\n\n function webCrawler(data) {\n let success = [];\n let skipped = [];\n let errors = [];\n \n //grab starting point from getUrls\n const linkUrls = addressUrls(data);\n \n //iterate through links, pushing links into array if not a duplicate\n for (let i = 0; i < linkUrls.length; i++) {\n const links = data.pages[i].links\n \n //TODO - maybe use sets?\n links.forEach(function(el) {\n if (!success.includes(el) && !success.includes(linkUrls[i])) {\n success.push(linkUrls[i])\n }\n \n if (!linkUrls.includes(el)) {\n errors.push(el)\n } else if (!success.includes(el)) {\n success.push(el)\n } else if (!skipped.includes(el)) {\n skipped.push(el)\n }\n });\n }\n\n console.log('Success:', success);\n console.log('Skipped:', skipped);\n console.log('Error:', errors);\n\n //clears values of arrays for net2 data\n success = [];\n skipped = [];\n errors = [];\n }\n webCrawler(data);\n } \n}", "function makeRequests(generator){\t\n\t// Wrapper Function with builtin callback\n\tfunction request(url){\n\t\tmakeAjaxRequest(url, function(response){\n\t\t\tit.next(response); //reference to iterator\n\t\t});\n\t}\n\n\t// Call main and yield the response to us\n\t// 1st time - runs once only\n\tvar it = generator(request); // generates the iterator -> doesnt start \n\tit.next(); \t// start execution of the iterator\n}", "function recusion() {\n // some serious code\n recusion();\n}", "function initializeExtension() {\n var _this = this;\n // Load the sites\n (function () { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"working\");\n return [4 /*yield*/, loadSites()];\n case 1:\n _a.sent();\n return [4 /*yield*/, setTopBar()];\n case 2:\n _a.sent();\n return [2 /*return*/];\n }\n });\n }); })();\n}", "async function first()\n{\n for (let i = 0; i< nbdepages+1 ; i++)\n {\n await sandbox2(i);\n }\n}", "getRestChains (identifier){\n return local_RestChains.slice(); \t\n }", "function Test_SetLinkOffline() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_link, out_rpc_link;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_SetLinkOffline\");\n in_rpc_link = new VPN.VpnRpcLink({\n HubName_str: hub_name,\n AccountName_utf: \"linktest\"\n });\n return [4 /*yield*/, api.SetLinkOffline(in_rpc_link)];\n case 1:\n out_rpc_link = _a.sent();\n console.log(out_rpc_link);\n console.log(\"End: Test_SetLinkOffline\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "async function rdls(node, s, depth, limit)\n{\n\n if(!node || depth > limit)\n return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n node.active = true;\n drawTree(tree15, 300, 100, 100);\n await sleep(1000);\n node.active = false;\n //console.log(depth);\n if(node.Node === s){\n console.log(\"Nodul s-a gasit\");\n alert(\"Nodul s-a gasit\");\n return;\n }\n if(node.Lefttree)\n await rdls(node.Lefttree, s, depth+1, limit)\n if(node.Righttree)\n await rdls(node.Righttree, s, depth+1, limit)\n}", "async function parseTree({ url, currPath, page }) {\n console.log(`creating/recreating path: ${currPath}`);\n await page.goto(url);\n resolveFolder(currPath);\n await page.waitForSelector(\".Box-row\");\n const itemRows = await page.$$(\".Box-row\");\n const folders = [];\n // potential parallel spot\n for (let i = 0; i < itemRows.length; i++) {\n const currRow = itemRows[i];\n const toSkip = await page.evaluate((ele) => {\n return ele.innerText === \". .\";\n }, currRow);\n if (toSkip) {\n continue;\n }\n const { isFolder, name, href } = await getRowData({ page, currRow });\n if (isFolder) {\n folders.push({ name, href });\n } else {\n toDownload.push({ name, href, currPath });\n }\n }\n const folderVisiter_p = [];\n for (let i = 0; i < folders.length; i++) {\n const { href, name } = folders[i];\n const parseFolder_p = callParser({ href, name, currPath });\n folderVisiter_p.push(parseFolder_p);\n }\n await Promise.all(folderVisiter_p);\n}", "function crawlURL(url, referer) {\n var linkIndex = _.findIndex(crawled, {url:url});\n if(linkIndex !== -1 ) {\n return;\n }\n\n var lObj = link(url);\n crawled.push(lObj);\n\n var data;\n var brokenStr;\n var checkedStr;\n var index;\n\n var req = request(url) \n .on('response', function(response) {\n if(response.statusCode === 200) {\n checkedStr = 'CHECKED: ' + url + ' - 200 ('+referer+')';\n if(crawler.verbose()) console.log(checkedStr.dim)\n crawler.emit('responseSuccess', {url:url, response: response});\n }else{\n brokenStr = 'BROKEN!! : ' + url + ' - '+response.statusCode+' referer: ('+ referer+ ')';\n broken.push({url: url, referer: referer, statusCode: response.statusCode});\n if(response.statusCode === 404) {\n if(crawler.verbose()) console.log(brokenStr.red);\n index = _.findIndex(crawled, {url:url});\n crawled[index].broken = true;\n crawled[index].referers = crawled[index].referers || [];\n crawled[index].referers.push(referer);\n crawler.emit('response404', {url:url, statusCode:response.statusCode, response: response});\n }else{\n if(crawler.verbose()) console.log(brokenStr.red);\n crawler.emit('responseError', {url:url, statusCode:response.statusCode, response: response});\n }\n }\n })\n .on('data', function(d) {\n data+=d;\n })\n .on('end', function(d) {\n if(url.indexOf(protocol+'://'+host) > -1) {\n getURLs(data.toString(), referer, url).forEach(function(link) {\n //console.log('crawl to ', nodeUrl.parse(link).href)\n crawlURL(link, url)\n })\n }\n })\n .on('crawlError', function(e) {\n console.log('ERROR!!: ', e , ' ', url, ' - ', 'referer: ('+referer+')');\n })\n}", "dfsIterative(start){\n let stack = []\n let data = []\n let visited = {}\n \n stack.push(start)\n while(stack.length){\n let vertex = stack.pop()\n if(!visited[vertex]){\n data.push(vertex)\n visited[vertex] = true\n }\n this.adjacenyList[vertex].forEach(neighbour => {\n if(!visited[neighbour]){\n stack.push(neighbour)\n }\n })\n }\n return data\n }", "setup_getAllPossibleHtmlBlocks() {\n let that = this;\n // 2. Project creator user ID compared to auth token's user ID\n fetch('https://api.webwizards.me/v1/htmlblocks', {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n })\n .then(function (response) {\n\n if (response.ok) {\n response.json().then(function (result) {\n //console.log(result);\n\n let brickContainer = {};\n\n // rotate the result so that it's a dictionary with names as keys\n for (let i = 0; i < result.length; i++) {\n let current = result[i];\n brickContainer[current.name] = {\n 'id': i,\n 'translation': current.translation,\n 'description': current.description,\n 'type': current.type,\n 'unallowed_children': current.unallowed_children,\n 'self_closing': current.self_closing\n }\n }\n //console.log(brickContainer);\n that.setState({\n 'bricksById': result,\n 'bricksByName': brickContainer\n });\n //console.log(result);\n\n // If body not built yet, build it\n if (that.state.needsHtmlRoot === true) {\n\n // build <html> with <head> and <body> inside\n that.setState({\n 'needsHtmlRoot': false // if <html> has been built\n });\n that.setup_buildHtmlRoot();\n } else {\n that.setState({\n 'finishedBuildingHeadBody': true\n });\n that.makeLayout(); // If HTML root already exists, make the layout on the right\n }\n });\n\n } else {\n response.text().then(text => {\n console.log(text);\n });\n\n }\n })\n .catch(err => {\n console.log('ERROR: ', err);\n });\n\n }", "async function dataRetriever() {\n var $ = await rp(options);\n var count = 0;\n $('.individual_internship').each(async function () {\n\n\n var link = $(this).children('.button_container').children('a').attr('href');\n links.push(link) //making array of all the internship links on the page \n count++;\n }\n )\n //sending requests on all the links \n for (i = 0; i < count; i++) {\n console.log(`https://internshala.com${links[i]}`)\n\n\n await sleep(100) //delay of 0.1sec with each request \n //request execution\n var options1 = {\n uri: `https://internshala.com${links[i]}`,\n transform: function (body) {\n return cheerio.load(body);\n },\n\n }\n await rp(options1).then(async ($) => {\n var res = $('#skillsContainer').text() \n var res1 = $('.stipend_container_table_cell').text()\n console.log(res)\n console.log(\"Stipend : \" + res1) \n }).catch((err) => {\n console.log(err);\n });\n }\n console.log(count);\n}", "function cautiousNext() {\n depth++;\n if (depth > 100) {\n depth = 0;\n setImmediate(next);\n } else {\n next();\n }\n }", "dfsIterative(start) {\n let stackOfVertices = [start]\n let listResult = []\n let visited = {}\n let adjacencyList = this.adjacencyList\n let nextVertex\n visited[start] = true\n while (stackOfVertices.length !== 0) {\n nextVertex = stackOfVertices.pop()\n listResult.push(nextVertex)\n if (!visited[nextVertex]) {\n visited[nextVertex] = true\n stackOfVertices.push(...adjacencyList[nextVertex])\n //or adjacencyList.forEach(neighbor => {\n // if (!visited[neighbor]){\n // visited[neighbor] = true\n // stackOfVertices.push(neighbor)\n // }\n // })\n }\n }\n return listResult\n }", "function fetch(url) {\n\n d3.select('.main').style('z-index', '-1');\n d3.select('.loading').style('display', 'block');\n\n d3.json(url, function(data) {\n\n candidates = candidates.concat(data['objects']);\n\n if (data['meta'] !== undefined) {\n if (data['meta']['next'] !== undefined) {\n if (data['meta']['next'] !== null) {\n next_url = BASE_URL + data['meta']['next'];\n fetch(next_url);\n } else {\n doneFetch();\n }\n } else {\n doneFetch();\n }\n } else {\n doneFetch();\n }\n });\n }", "function iteration() {\n // exit if we cross the max-depth level \n if (currentLink >= upTo) {\n casper.echo('Maximum depth exceeded!', 'WARNING');\n return casper.exit();\n }\n\n // exit if there are no more links to be crawled\n if (!links[currentLink]) {\n casper.echo('All Linked Pages are crawled', 'INFO');\n return casper.exit();\n }\n\n sitemap[links[currentLink]] = []; // an empty container for all the assets on page\n crawl.call(this, links[currentLink]);\n currentLink++;\n this.run(iteration);\n}", "async fetchChain(handleError) {\n try {\n const { Height } = await lotus.getChainHead();\n if (Height === 0) throw new Error('chain sync in progress')\n await lotus.explore({\n fromHeight: Height - 5,\n toHeight: Height - 1,\n });\n } catch (err) {\n handleError(err)\n }\n }", "async fetchBlocks() {\n\n //\n // blocks are already downloading\n //\n if (this.downloading_active == 1) { return; }\n\n try {\n\n this.downloading_active = 1;\n\n //\n // for each peer, we loop through all outstanding blocks and make\n // our request. Note that we do NOT use .map to make these download\n // requests as that pulls them entirely out of order...\n //\n for (var key in this.downloads) {\n\n let peer = this.app.network.returnPeerByPublicKey(key)\n if (peer != null) {\n while (this.downloads[key].length > 0) {\n for (let d = 0; d < this.downloads[key].length && d != -1;) {\n let mypkey = this.app.wallet.returnPublicKey();\n let block_to_download_url = peer.returnBlockURL(this.downloads[key][d]);\n\n\t if (block_to_download_url.indexOf(\"localhost\") > -1 && this.app.BROWSER == 0) {\n console.log(\"ERROR 482039: network misconfiguration trying to download from myself - peer as localhost\");\n this.downloads[key].shift();\n this.downloading_active = 0;\n\t } else {\n\n try {\n await this.fetchBlock(`${block_to_download_url}/${this.downloads[key][d]}/${mypkey}`, this.downloads[key][d]);\n this.downloads[key].shift();\n } catch (err) {\n if (err == -1) {\n //\n // network is down\n //\n console.log(\"error downloading block... network down\");\n this.downloading_active = 0;\n return;\n } else {\n //\n // network is up, but file is off\n //\n console.log(\"error downloading block... network up (remove block)\");\n console.log(\"err: \" + JSON.stringify(err));\n this.downloads[key].shift();\n this.downloading_active = 0;\n }\n }\n\t }\n }\n }\n }\n\n delete this.downloads[key];\n }\n\n } catch (err) {\n\nconsole.log(\"ERROR 852034: error downloading blocks from peer\");\n\n }\nconsole.log(\"and out...downloading set tozero\");\n this.downloading_active = 0;\n this.app.mempool.processBlockQueue();\n }", "function fetchHtml(){\n let url = html_links.shift();\n connections++;\n var request = https.get(url,function(res){\n let new_data = \"\";\n \n res.on('data', function(chunk) {\n new_data += chunk;\n \n });\n while(connections < limit && html_links.length){\n fetchHtml();\n }\n res.on('end', function() {\n final_data[url] = parseHtml(new_data);\n if(html_links.length == 0){\n storedata();\n }\n connections--; \n }); \n }).on('error',function(e){\n console.log(\"In HTMl error\"+e.message);\n fetchHtml();\n });\n if(html_links.length == 0 || url == undefined){\n console.log(\"----ending a connections-----\"+url);\n if(URLS.length){\n storedata();\n fetchData();\n }\n else{\n console.log(\"Nothing to fetch\");\n storedata();\n return; \n } \n }\n\n \n}", "function fetchResources() {\n fetch('/api/resources')\n .then(response => response.json())\n .then(resources => {\n console.log(resources);\n for (x = 0; x < resources.length; x++) {\n buildResources(resources[x], category[x])\n }\n })\n}", "*[Symbol.iterator]() {\n let node = this.head;\n while (node) {\n yield node;\n node = node.next;\n }\n }", "parseArticlePaths(folder){\n if(folder && folder.children && folder.children.length){\n let articles = [];\n folder.children.forEach((e, i, a) => {\n if(!e.children && e.name && e.path){\n articles.push({name: e.name, path: e.path});\n }\n });\n let articlesDone = new Promise ((aResolve, aReject) => {\n let promiseCount = articles.length;\n let articlePromises = articles.map((e) => {\n let promise = new Promise((resolve, reject) => {\n fetch(e.path).then((response) => {\n return response.text();\n }).then((markdown) => {\n e.content = {__html: generateVideoIframe(Marked(markdown))};\n resolve();\n });\n });\n promise.then(() => {\n promiseCount--;\n if(promiseCount === 0){\n aResolve();\n }\n });\n return promise;\n });\n }).then(() => {\n this.setState({articles: articles});\n });\n }\n else return;\n }", "async fetchChildren(block) {\n const height = block.header.height;\n const maxHeight = this.chainCache.length - 1;\n if (height >= maxHeight) return null;\n let nextGen = null;\n // walk up the chain until we find the next gen or we run out of chain\n for (\n let nextHeight = height + 1;\n !nextGen && nextHeight <= maxHeight;\n nextHeight++\n ) {\n nextGen = await this.chainCache[nextHeight];\n }\n if (!nextGen) return null;\n // only return blocks that point the requested parent\n return nextGen.filter(b => {\n const cids = Chain.getParentCids(b);\n return cids.some(cid => cid === block.cid);\n });\n }", "function iterate(iteration) { //recursive function to iterate through promises\n if (iteration.done) //stop iterating when done and return the final value wrapped in a promise\n return Promise.resolve(iteration.value);\n return Promise.resolve(iteration.value) //returns a promise with its then() and catch() methods filled\n .then(x => iterate(genObject.next(x))) //calls recursive function on the next value to be iterated\n .catch(x => iterate(genObject.throw(x))); //throws an error if a rejection is encountered\n }", "*[Symbol.iterator]() {\n let node = this.head;\n\n while(node) {\n yield node;\n node = node.next;\n }\n }", "function crawlHeldLinks() {\n // Track call\n called++\n // Record length\n var currentLen = urlHolder.length;\n // Scrape links\n h.waitAndFire(0, urlHolder.length, function(x) {\n\n xray(urlHolder[x], ['a @href'])(function(err, content) {\n if (err) reject(err);\n // Append new links\n urlHolder = urlHolder.concat(content);\n // Remove Duplicates\n urlHolder = h.removeDuplicates(urlHolder);\n // Remove all that dont fit url\n urlHolder = h.removeAllWithout(urlHolder, startingUrl);\n\n // Log\n console.log(urlHolder);\n console.log(currentLen)\n console.log(x);\n\n // Call again with new links or console.log all links\n if (x === currentLen - 1) {\n if (called === limit) {\n // Create hash\n var redisHash = {};\n\n // Add all links Redis as keys and values\n _.each(urlHolder, function(linkToHash, linkIndex) {\n rClient.set(linkToHash, linkToHash);\n });\n\n // Log\n console.log('Finished');\n resolve();\n\n } else {\n crawlHeldLinks(urlHolder);\n console.log('Restart Recursion:' + called);\n }\n\n } else {\n console.log('Continuing');\n }\n\n });\n });\n\n }", "function recursivelyCallNextOnIterator(data) {\n var yielded = iterator.next.apply(iterator, arguments);\n // yielded = { value: Any, done: Boolean }\n\n if (yielded.done) {\n taskInstance.isIdle = true;\n taskInstance.isRunning = false;\n // call setState with the same state to trigger another render\n // so that you can use task properties like isIdle directly\n // in your render function\n component.setState(component.state);\n return;\n }\n\n if (isPromise(yielded.value)) {\n yielded.value.then(function (data) {\n if (component._isMounted) {\n recursivelyCallNextOnIterator(data);\n }\n }, function (e) {\n if (component._isMounted) {\n iterator.throw(e);\n }\n });\n }\n }", "all(inner, outer, traceId) {\n // NOTE: `reject` does not settle nested promises!\n const rootId = this.getCurrentVirtualRootContextId();\n const from = inner.map(p => getPromiseId(p)).filter(Boolean);\n // const from = getPromiseId(inner);\n const to = getPromiseId(outer);\n // if (!from || !to) {\n // this.logger.error(`resolve link failed: promise did not have an id, from=${from}, to=${to}, trace=${traceCollection.makeTraceInfo(traceId)}`);\n // }\n // else {\n return nestedPromiseCollection.addLink(PromiseLinkType.All, from, to, traceId, rootId);\n }", "populateLinkedResources() {\n Promise.all([\n getResourcesTxtFromCustomField(this.props.client),\n this.props.client.metadata(),\n getTokens(this.props.client)\n ])\n .then(values => {\n const resourcesArr = decodeLinkedResources(values[0]),\n domain = values[1].settings.bloomfire_domain,\n loginToken = values[2].loginToken;\n getResources(this.props.client, resourcesArr)\n .then(linkedResources => {\n let i = linkedResources.length;\n while (i--) { // loop backwards since we may slice while iterating\n if (linkedResources[i].code === 'not_found') {\n this.removeLinkedResourceFromTicket(linkedResources.splice(i, 1)[0]); // remove from ticket data and array\n }\n }\n linkedResources = linkedResources.map(normalizeResource); // remove unnecessary properties\n addHrefs(domain, linkedResources, loginToken);\n this.setState({ linkedResources });\n });\n });\n }", "function scrapeWfs (base, csw, start, increment, max) {\n start = typeof start !== \"undefined\" ? start : 1;\n increment = typeof increment !== \"undefined\" ? increment : 10;\n max = typeof max !== 'undefined' ? max : 10000000;\n\n var dirs = utility.buildDirs(base);\n\n // Another recursion here, expects the 'next' parameter same as 'scrapeCsw()'\n function recursiveScrape (csw, start, increment, max) {\n buildRequests(csw, start, increment, function (get) {\n parse.parseCsw(get, function (data) {\n if (data) {\n async.waterfall([\n function (callback) {\n utility.constructorWfs(dirs, data, callback);\n },\n function (wfsData, callback) {\n async.each(wfsData, function (d) {\n if (d) utility.processWfs(d, callback);\n })\n },\n ], function (err) {\n if (err) console.log(err);\n })\n }\n if (data[\"next\"]) {\n var start = Number(data['next']);\n console.log(start);\n if (start > 0 && start <= max)\n recursiveScrape(csw, start, increment, max);\n }\n })\n })\n }\n recursiveScrape(csw, start, increment, max);\n}", "function Test_SetLinkOnline() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_link, out_rpc_link;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_SetLinkOnline\");\n in_rpc_link = new VPN.VpnRpcLink({\n HubName_str: hub_name,\n AccountName_utf: \"linktest\"\n });\n return [4 /*yield*/, api.SetLinkOnline(in_rpc_link)];\n case 1:\n out_rpc_link = _a.sent();\n console.log(out_rpc_link);\n console.log(\"End: Test_SetLinkOnline\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "fetchPostsSerially(urls) {\n if (urls.length > 0 && !this.state.stopFetchingPosts) {\n const firstUrl = urls[0];\n this.fetchPosts(firstUrl)\n .then(() => this.fetchPostsSerially(urls.slice(1)));\n } else {\n this.setState({loadingPosts: false})\n }\n }", "load(uid) {\n return __awaiter(this, void 0, void 0, function* () {\n let connection;\n let output = null;\n try {\n connection = yield this.getConnection();\n if (uid) {\n const [err, results] = yield this.queryAsync(connection, \"SELECT * FROM wsmath WHERE uid=? LIMIT 1\", [uid]);\n output = results;\n }\n else {\n const [err, results] = yield this.queryAsync(connection, \"SELECT w.*, u.fullname FROM wsmath as w INNER JOIN users as u ON u.id=w.idUser WHERE visibility=2\");\n output = results;\n }\n }\n catch (Ex) {\n console.log(Ex);\n }\n finally {\n connection && connection.release();\n }\n if (output && output.length) {\n if (uid) {\n output.forEach(e => e.json = JSON.parse(e.json));\n if (output.length === 1) {\n output = output[0];\n }\n }\n }\n else {\n return null;\n }\n return output;\n });\n }", "function getOffersUrl() {\n\n return getOffersPages()\n .then(list_url_pages => {\n var list_url_offers = [];\n var promises = [];\n for (var i = 0; i < list_url_pages.length; i++) {\n promises.push(getHtml(list_url_pages[i])\n .then(res => {\n var doc = cheerio.load(res);\n var list_url_offers_this_page = [];\n doc('li.offerlist-item h3 a').each((i, el) => {\n list_url_offers_this_page.push(new Offer(el.attribs['href']));\n });\n return list_url_offers_this_page;\n })\n );\n }\n return Promise.all(promises).then(list_offers_all_pages => {\n return list_offers_all_pages.reduce((prev, curr) => {\n return curr.concat(prev);\n })\n });\n });\n\n}", "function asyncGenerator(iter) {\n\n let front = null, back = null;\n\n let aIter = {\n\n next(val) { return send(\"next\", val) },\n throw(val) { return send(\"throw\", val) },\n return(val) { return send(\"return\", val) },\n };\n\n aIter[Symbol.asyncIterator] = function() { return this };\n return aIter;\n\n function send(type, value) {\n\n return new Promise((resolve, reject) => {\n\n let x = { type, value, resolve, reject, next: null };\n\n if (back) {\n\n // If list is not empty, then push onto the end\n back = back.next = x;\n\n } else {\n\n // Create new list and resume generator\n front = back = x;\n resume(type, value);\n }\n });\n }\n\n function settle(type, value) {\n\n switch (type) {\n\n case \"return\":\n front.resolve({ value, done: true });\n break;\n\n case \"throw\":\n front.reject(value);\n break;\n\n default:\n front.resolve({ value, done: false });\n break;\n }\n\n front = front.next;\n\n if (front) resume(front.type, front.value);\n else back = null;\n }\n\n function resume(type, value) {\n\n // HACK: If the generator does not support the \"return\" method, then\n // emulate it (poorly) using throw. (V8 circa 2015-02-13 does not support\n // generator.return.)\n if (type === \"return\" && !(type in iter)) {\n\n type = \"throw\";\n value = { value, __return: true };\n }\n\n try {\n\n let result = iter[type](value);\n value = result.value;\n\n if (value && typeof value === \"object\" && \"_esdown_await\" in value) {\n\n if (result.done)\n throw new Error(\"Invalid async generator return\");\n\n Promise.resolve(value._esdown_await).then(\n x => resume(\"next\", x),\n x => resume(\"throw\", x));\n\n } else {\n\n settle(result.done ? \"return\" : \"normal\", result.value);\n }\n\n } catch (x) {\n\n // HACK: Return-as-throw\n if (x && x.__return === true)\n return settle(\"return\", x.value);\n\n settle(\"throw\", x);\n }\n }\n}", "async function sandbox (searchLink = 'https://guide.michelin.com/fr/fr/restaurants/bib-gourmand/page/') {\n let bib_gourmand = [];\n let temp = searchLink;\n const one = 1;\n let first = searchLink + one.toString(); // Url du site de la première page\n console.log(`🕵️‍♀️ browsing ${first} source`); \n const restaurant1 = await michelin.scrapeRestaurant(first); \n // Recherche des informations contenu dans l'Url + stocke les informations sous forme de tableau \n bib_gourmand = restaurant1; // ajout des informations du 1 er restaurant\n //console.log(tab);\n //tab.forEach(restau => tab2.push(restau));\n // Boucle pour faire une recherche sur les 14 autres pages \n for(let i=2;i <= 15;i++) // 15\n {\n temp += i.toString() + \"/\";\n console.log(`🕵️‍♀️ browsing ${temp} source`);\n\n let restaurant = await michelin.scrapeRestaurant(temp);\n //restaurant.forEach(restau => tab.push(restau));\n bib_gourmand = bib_gourmand.concat(restaurant);\n temp = searchLink;\n\n }\n //tab.forEach(element => tab2.push(element));\n //console.log(tab);\n //ParseToJson(tab, '/bib-gourmand.json'); // exporte les informations dans un fichier JSON \n console.log('done'); \n return bib_gourmand;\n \t\n}", "async function parentAlbum (tgt) {\n\n//console.log(\"tgt\",tgt);\n\n if (!tgt) {\n await new Promise (z => setTimeout (z, 4000));\n tgt = document.getElementsByClassName (\"img_mini\") [0].getElementsByTagName (\"img\") [1];\n }\n let classes = $ (tgt).parent (\"a\").parent (\"div\").attr(\"class\");\n//console.log(\"classes\",classes);\n let albumDir, file, tmp, imgs;\n if (classes && -1 < classes.split (\" \").indexOf (\"symlink\")) { // ...yes! a symlink...\n tmp = $ (tgt).parent (\"a\").parent (\"div\").find (\"img\").attr (\"title\");\n tmp = $ (\"#imdbPath\").text () + tmp;\n // ...then go to the linked picture:\n getFilestat (tmp).then (async result => {\n result = result.replace (/(<br>)+/g, \"\\n\");\n result = result.replace(/<(?:.|\\n)*?>/gm, \"\"); // Remove <tags>\n file = result.split (\"\\n\") [0].replace (/^[^/]*\\/(\\.\\.\\/)*/, \"/\");\n albumDir = file.slice ($ (\"#imdPath\").text ().length).replace (/\\/[^/]*$/, \"\");\n //albumDir = file.replace (/^[^/]+(.*)\\/[^/]+$/, \"$1\").trim ();\n let idx = $ (\"#imdbDirs\").text ().split (\"\\n\").indexOf (albumDir);\n if (idx < 0) {\n infoDia (null, null, \"Tyvärr ...\", \"<br>Albumet <b>\" + albumDir.replace (/^(.*\\/)+/, \"\") + \"</b> med den här bilden kan inte visas<br>(rätt till gömda album saknas)\", \"Ok\", true);\n return \"\";\n }\n $.spinnerWait (true);\n // Get the number of imgs in the album; open and read it from the jstree node\n $ (\".ember-view.jstree\").jstree (\"_open_to\", \"#j1_\" + (1 + idx));\n await new Promise (z => setTimeout (z, 400));\n imgs = $ (\"#j1_\" + (1 + idx) + \" a small\").text ();\n imgs = Number (imgs.replace (/^.*\\(([0-9]+)\\).*$/, \"$1\"));\n if (imgs < 2) imgs = 2; // for a minimum wait time\n $ (\".ember-view.jstree\").jstree (\"close_all\");\n $ (\".ember-view.jstree\").jstree (\"deselect_all\");\n $ (\".ember-view.jstree\").jstree (\"open_node\", $ (\"#j1_1\"));\n $ (\".ember-view.jstree\").jstree (\"_open_to\", \"#j1_\" + (1 + idx));\n $ (\".ember-view.jstree\").jstree (\"select_node\", $ (\"#j1_\" + (1 + idx))); // calls selectAlbum\n let namepic = file.replace (/^(\\/.*)*\\/(.+)\\.[^.]*$/, \"$2\");\n//console.log(\"parentAlbum:namepic imgs\",namepic,imgs);\n return namepic;\n }).then (async (namepic) => {\n await new Promise (z => setTimeout (z, 111*imgs)); // proportional pause, was 111\n if (namepic) gotoMinipic (namepic);\n });\n } // ...else do nothing\n}", "async function get_urls() {\n const getUrls = await fetch(\"http://localhost:3000\").then((data) => data.json());\n \n getUrls.urls.map( ({name, url}) => writeUrl({name, url}) ); // Add all URLs.\n}", "function workMyCollection(arr) {\n var resultArr = [];\n function _recursive(idx) {\n console.log(idx);\n if (idx >= resultArr.length) return resultArr;\n\n return doSomethingAsync(arr[idx]).then(function(res) {\n resultArr.push(res);\n return _recursive(idx + 1);\n });\n }\n return _recursive(0);\n}", "getAllChildrenSlugs(slug, result) {\n const staticData = new StaticDataSingleton().getInstance();\n\n const slugs = staticData.categories.list\n .filter(({ parent }) => parent === slug)\n .map(({ slug }) => slug);\n\n if (!slugs.length) {\n return;\n }\n\n result.push(...slugs);\n\n const childSlugs = slugs.map((slug) =>\n new StaticDataSingleton().getAllChildrenSlugs(slug, result)\n );\n\n if (!childSlugs.length || !childSlugs[0]) {\n return;\n }\n\n result.push(...childSlugs);\n }", "function fetchPairs(url, cb) {\n \n fetch(url)\n .then((res) => {\n parseLink(res.headers.get('link'));\n return res.json();\n })\n .then((data) => {\n data.tickers.forEach(itm => {\n if(!itm.is_anomaly && !itm.is_stale) {\n const quote = itm.base + '/' + itm.target;\n \n getPrice(itm.last, quote)\n } \n }) \n\n //checking and fetching next page data\n if(pages.next) {\n fetchPairs(pages.next, cb) \n }else cb(prices)\n })\n .catch(err => console.log(err.message)) \n}", "function FlattenChildren(list) {\n if (!list.head) return null;\n let output = new link.SLL();\n let cur = list.head;\n\n while (cur) {\n output.addNode(cur);\n if (cur.child != null) {\n let sublist = FlattenChildren(cur.child);\n ///////////////\n // this line is janky.\n // this *should* be handled by removing the else statement and having this be a constant operation. That somehow creates an infinite loop in the last child list;\n cur = cur.next;\n // might be caused by working with pointers instead of a copy of the nodes.\n ///////////////\n output.tail.next = sublist.head;\n output.tail = sublist.tail;\n } else {\n cur = cur.next;\n }\n }\n return output;\n}", "async function sendurlrequestDynamic (url,blockElement){\n try{\n let browser = await puppeteer.launch(); //launch puppeteer browser\n let page = await browser.newPage(); //open a new page in the browser\n await page.goto(url); //go to the given url from the params\n let content = await page.content(); //save the contents of the page\n await browser.close(); //close the browser instance after we are done\n let results = await scrape(content,blockElement)//pass the HTML content to cheerio to be scraped \n return await results; //return the string array from cheerio;\n }catch(err){\n throw new Error(err.message); //catch and pass on any error messages\n }\n}", "function myRun(async){\n var gen = async();\n\n var isDone=false;\n\n var middle = [];\n\n while(!isDone){\n\n middle.push(gen);\n\n var res = gen.next();\n\n gen = res.value;\n\n isDone = res.done;\n\n }\n\n /*middle.forEach(function(item){\n\n item.next();\n\n\n })*/\n\n for(var i=0; i< 4;i++){\n middle.pop().next();\n\n }\n //gen.next();\n\n\n }", "function _dfs(obj, cb) { \n\t// Recursive fn\n\tfunction _walk(current) {\n\t\t// Run callback\n\t\tcb(current);\n\t\t// Destructure to get children\n\t\tconst {\n\t\t\tchildren\n\t\t} = current;\n\n\t\tif (children) {\n\t\t\tchildren.forEach(e => {\n\t\t\t\t_walk(e);\n\t\t\t});\n\t\t}\n\t};\n\n\twalk(obj);\n}", "function traverse(bookmarkItems) {\n console.log(\"START\",bookmarkItems);\n for (node of bookmarkItems) {\n console.log(\"current node: \", node);\n if (node.title == \"saved pages\") {\n console.log(\"existing folder node: \", node);\n return (node);\n }\n else if (node.children) {\n\n //wraping result in a promise\n var recursivePromiseBranch = Promise.resolve().then(\n function () {\n console.log(\"traversing to next child\")\n return (traverse(node.children));\n }\n );\n return (recursivePromiseBranch);\n }\n }\n }", "function getPathedGraph()\n\t\t{\n\t\t\tlet json_file = 'result.json' // can change later\n\t\t\tlet url = 'http://127.0.0.1:5000/getJsonLink/' + json_file\n\t\t\tfetch(url)\n\t\t\t\t.then((response) => {\n\t\t\t\t\treturn response.json()\n\t\t\t\t}).then((linkAndPath) => {\n\t\t\t\t\t// console.log(linkAndPath.path)\n\t\t\t\t\tfor(var i = 0; i < linkAndPath.path.length; i++)\n\t\t\t\t\t\tgeneratePathedGraph(i, linkAndPath.link, linkAndPath.path[i])\n\t\t\t\t})\n\t\t}", "executeFetch(url, data, req){\n\t\tlet callId = this.generateCallId(url, data)\n\t\tthis.stageCall(url, data, fetch(url, req))\n\t\treturn this.makeCall(callId)\n\t}", "function loop_request(){\r\n let waisted_count = 0; // set to 0\r\n \r\n //requset from api\r\n async function StartR() \r\n {\r\n // request, fetch api data\r\n const response = await fetch(api_url); //fetch\r\n const data = await response.json(); //api\r\n let json_split = JSON.parse(JSON.stringify(data)); // split api data\r\n\r\n // only for the first request\r\n if (beginvar == true){\r\n console.log(\"first try\");\r\n render_call(json_split, waisted_count, beginvar);\r\n last_api = json_split[0].id;\r\n beginvar = false; \r\n } \r\n else{\r\n console.log(\"secound try\");\r\n waisted_count = while_count(last_api, json_split);\r\n render_call(json_split, waisted_count, beginvar);\r\n }\r\n console.log(\"assync vege 15perc \" + \"Last API: \" + last_api);\r\n }\r\n StartR();\r\n}", "async function fetchComponents() {\r\n let componentsArray = document.getElementsByTagName(\"component\");\r\n for (let i = 0; i < componentsArray.length; i++) {\r\n node = componentsArray[i];\r\n componentKey = node.getAttribute(\"html\");\r\n if (componentKey) {\r\n if (CACHE_COMPONENTS.get(componentKey)) {\r\n renderComponent(node, CACHE_COMPONENTS.get(componentKey), !INITIAL_RENDER_COMPONENT)\r\n //recursion to fetch any inner components\r\n fetchComponents();\r\n continue;\r\n }\r\n\r\n try {\r\n let response = await fetch(componentKey);\r\n let component = await response.text();\r\n renderComponent(node, component, INITIAL_RENDER_COMPONENT);\r\n CACHE_COMPONENTS.set(componentKey, component)\r\n //recursion to fetch any inner components\r\n fetchComponents();\r\n } catch (err) {\r\n renderComponent(node, \"Component not found\", INITIAL_RENDER_COMPONENT)\r\n }\r\n return;\r\n }\r\n }\r\n\r\n}" ]
[ "0.6329586", "0.6091885", "0.6077464", "0.6040151", "0.5970379", "0.5848444", "0.5801038", "0.578965", "0.5783529", "0.5777084", "0.571731", "0.57038796", "0.5640876", "0.56333613", "0.5618298", "0.5590522", "0.55784726", "0.55001986", "0.5499873", "0.54934645", "0.5486687", "0.54732573", "0.5460979", "0.5445581", "0.5398352", "0.5362207", "0.5354516", "0.5352042", "0.5343019", "0.53267515", "0.5324382", "0.5306379", "0.5303964", "0.5299133", "0.52817166", "0.527869", "0.52694196", "0.5265557", "0.5264629", "0.52555084", "0.5251114", "0.52424836", "0.5221433", "0.52193886", "0.52107096", "0.5207842", "0.5186999", "0.5176917", "0.5175566", "0.51737946", "0.5170458", "0.514926", "0.51452047", "0.5142819", "0.51388115", "0.51381654", "0.5119308", "0.51130635", "0.5102733", "0.5100402", "0.5099689", "0.50896204", "0.5087366", "0.50864404", "0.5081677", "0.5075116", "0.5074784", "0.5072562", "0.50672597", "0.5066528", "0.50655997", "0.5049433", "0.50474536", "0.5045089", "0.5043799", "0.5042717", "0.50360155", "0.50354517", "0.5033097", "0.5028061", "0.50256234", "0.50182444", "0.50135523", "0.50124556", "0.50074005", "0.49901077", "0.49854994", "0.4974397", "0.49743402", "0.49724755", "0.49717852", "0.49688798", "0.4968036", "0.4966949", "0.4961645", "0.49591902", "0.49526632", "0.49516815", "0.4950725", "0.494304", "0.49416807" ]
0.0
-1
Simulate a waiting queue. When someone calls to fetch url and if their slave tab is busy fetching another url, then put that node on waiting queue. Waiting on the slave tab occurs in a situation where parentnode's link has been fetched and all children now want to fetch their links.
function make_slavetab_do_work(action_type, curr_node, site_pi_fields, fetch_url, my_slave_tab, level) { if (!('gatekeeper_initialized' in my_slave_tab)) { my_slave_tab.gatekeeper_initialized = true; my_slave_tab.wait_queue = []; var event_name = "waiting_queue"; var wait_dummy_tab_id = sprintf('wait-queue-tab-%s', my_slave_tab.tabid); $('#' + wait_dummy_tab_id).on(event_name, function() { console.log("APPU DEBUG: woken up from SLAVE-TAB waiting queue"); if (my_slave_tab.in_use == true) { console.log("APPU DEBUG: Woken up from wait queue but tab is in use"); } else { if (my_slave_tab.wait_queue.length > 0) { var t = my_slave_tab.wait_queue.pop(); my_slave_tab.in_use = true; send_cmd_to_tab(t.action_type, t.curr_node, t.site_pi_fields, t.fetch_url, my_slave_tab, t.level); } } }); } if (my_slave_tab.in_use == true) { var t = { 'action_type' : action_type, 'curr_node' : curr_node, 'site_pi_fields' : site_pi_fields, 'fetch_url' : fetch_url, 'level' : level }; my_slave_tab.wait_queue.push(t); } else { my_slave_tab.in_use = true; send_cmd_to_tab(action_type, curr_node, site_pi_fields, fetch_url, my_slave_tab, level); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fill() {\n // Note:\n // - queue.running(): number of items that are currently running\n // - queue.length(): the number of items that are waiting to be run\n while (this.queue.running() + this.queue.length() < this.concurrency && this.path.peersToQuery.length > 0) {\n this.queue.push(this.path.peersToQuery.dequeue());\n }\n }", "queue(url, callback, bypass_queue = false, bypass_depth = 0) {\n callback = callback || function() { };\n\n let deferred = rsvp.defer();\n let promise = deferred.promise;\n\n let index = bypass_queue ? -1 : (++counter % semaphores.length);\n let next = bypass_queue ? resolved_promise() : semaphores[index];\n\n if (bypass_queue == false)\n semaphores[index] = promise;\n\n next.then(function() {\n let request_object = request(url).on(\"error\", function() {\n if (bypass_depth > MAX_QUEUE_DEPTH)\n deferred.resolve();\n else\n self.queue(url, callback, true, bypass_depth + 1).then(_ => deferred.resolve());\n }).on(\"end\", function() {\n deferred.resolve();\n });\n\n callback(request_object);\n });\n\n return promise;\n }", "queueJob(url, msg) {\n const newId = ++this.globalMsgId;\n var job = {\n \"url\": url,\n \"msg\": msg,\n \"id\": newId\n };\n this.jobs.push(job);\n\t\tconst thiz = this;\t\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\tthiz.resolves[newId] = resolve\n\t\t\tthiz.rejects[newId] = reject\n thiz.nextJob();\n\t\t}) \n }", "function checkQueue(currentTime, job, worker, index) {\n var link = queue[queueIndex];\n // If the queue is still empty, wait a second and try again.\n if (link === undefined) {\n setTimeout(function () {\n jobCallback(job, worker, index + 1)\n }, 1000);\n return;\n }\n\n // If the domain of this URL is not on cooldown, process and set cooldown.\n if (domains[link.domain].next < currentTime) {\n domains[link.domain].next = currentTime + msBetween;\n checkRobotsAndCrawl(job, link, worker, queueIndex);\n queueIndex++;\n } else {\n timeQueue[queueIndex] = link;\n // Try the next URL.\n queueIndex++;\n jobCallback(job, worker, index + 1, true);\n }\n}", "_issueNewRequestsAsync() {\n this._updateNeeded = false;\n\n const freeSlots = Math.max(this.props.maxRequests - this.activeRequestCount, 0);\n\n if (freeSlots === 0) {\n return;\n }\n\n this._updateAllRequests();\n\n // Resolve pending promises for the top-priority requests\n for (let i = 0; i < freeSlots; ++i) {\n if (this.requestQueue.length > 0) {\n const request = this.requestQueue.shift();\n request.resolve(true);\n }\n }\n\n // Uncomment to debug\n // console.log(`${freeSlots} free slots, ${this.requestQueue.length} queued requests`);\n }", "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) {}\n }", "function waitFor (jq, query, context, remainingStatements, executor, handlers, minWait, maxWait) {\n var element = retriever.get(jq, query, context);\n if (element) {\n return executor.execute(jq, \"\", handlers, remainingStatements, context);\n }\n if (maxWait > 0) {\n maxWait = maxWait - minWait;\n setTimeout(function() {\n waitFor(jq, query, context, remainingStatements, executor, handlers, minWait, maxWait);\n }, minWait);\n }\n }", "function DownloadQueue() {}", "function queueUpdate() {\n /*\n * If auto-queueing has been enabled, and we are currently\n * not in the waitlist, then try to join the list.\n */\n if (autoqueue && !isInQueue()) {\n joinQueue();\n }\n}", "waitToFetch (callback) {\n\t\tsetTimeout(callback, 10000);\n\t}", "function makeRecursiveRequest() {\n $.get( url, function parseResponse(data) {\n console.log(data);\n if (Object.keys(listOfTasks).length === 0) {\n console.log(\"-----------TASK GRAPH FINISHED CLOSE LOOP !-----------------\");\n return;\n }\n for (var key in data[\"tasks\"]) {\n if (!isEmpty(data[\"tasks\"][key][\"resolution\"])) {\n if (data[\"tasks\"][key][\"resolution\"][\"completed\"] !== undefined && listOfTasks[key] !== undefined) {\n $('<a>',{\n text: \" result\",\n title: 'task',\n href: \"http://docs.taskcluster.net/tools/task-inspector/#\" + data[\"tasks\"][key]['taskId']\n }).appendTo('#'+ key);\n var resultUrl = data[\"tasks\"][key][\"resolution\"][\"resultUrl\"];\n delete(listOfTasks[key]);\n }\n\n }\n }\n\n setInterval(makeRecursiveRequest, 5000);\n });\n}", "_issueNewRequestsAsync() {\n this._deferredUpdate = null;\n\n const freeSlots = Math.max(this.props.maxRequests - this.activeRequestCount, 0);\n\n if (freeSlots === 0) {\n return;\n }\n\n this._updateAllRequests();\n\n // Resolve pending promises for the top-priority requests\n for (let i = 0; i < freeSlots; ++i) {\n if (this.requestQueue.length > 0) {\n const request = this.requestQueue.shift();\n request.resolve(true);\n }\n }\n\n // Uncomment to debug\n // console.log(`${freeSlots} free slots, ${this.requestQueue.length} queued requests`);\n }", "async function findDownload(UrlModel, identifier){\n //await identifier;\n //console.log('thread ' + identifier + ' looking for new download');\n //prevent stack overflow\n await Promise.resolve();\n\n //will find all websites that still need their screenshts downloaded\n UrlModel.find({downloaded: false, assigned: false},\n function(err, response){\n //deal with errors\n if(err){\n console.log(result);\n return console.error(err);\n }\n\n if (response.length == 0){\n //console.log('no potential websites found');\n //after finnished wait for min number of seconds and then search for next ss to be downloaded\n setTimeout(function(){findDownload(UrlModel, identifier);}, 500);\n return;\n }\n\n //return if there are no websites that need screenshots\n if (response.length !=0){\n console.log(response.length + ' potential websites found');\n //for now we will just use the top result but later we will build better\n //rankng system for which screnshots to download first\n var urlToDownload = response[0];\n console.log('starting download for ' + urlToDownload.url);\n\n //set us as the downloader for this url\n UrlModel.update({_id: urlToDownload._id},\n {\n assigned: true,\n downloader: config.serverName,\n downloadStartTime: new Date().getTime()\n }, async function(err, response){\n if(err){\n console.log(result);\n return console.error(err);\n }\n\n //download the screenshot\n await downloadScreenshot(urlToDownload.url,\n urlToDownload.imgLink, urlToDownload.fileName,\n urlToDownload._id).then(() => {\n //after finnished look for another website to download\n findDownload(UrlModel, identifier);\n });\n\n //update database to signify that download has finnished\n UrlModel.update({_id: urlToDownload._id}, {downloaded: true}, function(err, response){\n if(err){\n console.log(resut);\n return console.error(err);\n }\n });\n })\n }\n })\n\n\n}", "function run() {\n running = true;\n if (queue.length == 0) {\n debug('queue flushed');\n running = false;\n return;\n }\n\n var req = queue.splice(0, 1)[0];\n var cached = db.get(req.url);\n\n if (cached && typeof cached.err === 'undefined' && typeof cached.body !== 'undefined') {\n debug(req.url + ' found in cache');\n var $ = cheerio.load(cached.body);\n req.callback(null, $);\n debug('callback called, running next item immediately because no web request was made');\n setImmediate(function() {\n run();\n })\n } else {\n debug(req.url + ' not found in cache, requesting...');\n module.exports.requestOptions.url = req.url;\n debug('request options: ' + JSON.stringify(module.exports.requestOptions, null, 2));\n request(module.exports.requestOptions, function(e, r, b) {\n if (e) {\n debug('error requesting url ' + req.url);\n debug(e);\n db.set(req.url, {err: e, body: b});\n req.callback(e);\n return;\n }\n\n db.set(req.url, {body: b});\n var $ = cheerio.load(b);\n req.callback(null, $);\n debug('callback called, running next item with timeout interval ' + module.exports.interval);\n setTimeout(function() {\n run();\n }, module.exports.interval);\n });\n }\n}", "function startFetch(){\n\n gTimer = new Date().valueOf();\n gProjectQueue = _.clone(gProjectList);\n\n connect();\n connection.connect(function(err) {\n if(err) {\n onError('Worker: error when connecting to db', err);\n\n throw err;\n }\n else{\n fetchNext();\n }\n });\n\n}", "function wait(){}", "_issueNewRequestsAsync() {\n this._deferredUpdate = null;\n\n const freeSlots = Math.max(this.props.maxRequests - this.activeRequestCount, 0);\n\n if (freeSlots === 0) {\n return;\n }\n\n this._updateAllRequests();\n\n // Resolve pending promises for the top-priority requests\n for (let i = 0; i < freeSlots; ++i) {\n if (this.requestQueue.length > 0) {\n const request = this.requestQueue.shift();\n this._issueRequest(request);\n }\n }\n\n // Uncomment to debug\n // console.log(`${freeSlots} free slots, ${this.requestQueue.length} queued requests`);\n }", "fetchQueued() {\n return fetchSoon.fetchSearchRequests(this._myStartableQueued());\n }", "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) { }\n }", "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) { }\n }", "function waiting(){\n if(waitingFlag == true){\n setTimeout(waiting, 100);\n }\n else\n {\n }\n }", "function buildLinks() {\n\n return new Promise(function(resolve, reject) {\n\n // Holds URLS\n var urlHolder = [];\n\n // Add one url as seed\n urlHolder.push(startingUrl);\n\n // For tracking recursion\n var called = 0;\n\n // Initialize\n crawlHeldLinks();\n\n\n // -== Called Recursively to build links\n function crawlHeldLinks() {\n // Track call\n called++\n // Record length\n var currentLen = urlHolder.length;\n // Scrape links\n h.waitAndFire(0, urlHolder.length, function(x) {\n\n xray(urlHolder[x], ['a @href'])(function(err, content) {\n if (err) reject(err);\n // Append new links\n urlHolder = urlHolder.concat(content);\n // Remove Duplicates\n urlHolder = h.removeDuplicates(urlHolder);\n // Remove all that dont fit url\n urlHolder = h.removeAllWithout(urlHolder, startingUrl);\n\n // Log\n console.log(urlHolder);\n console.log(currentLen)\n console.log(x);\n\n // Call again with new links or console.log all links\n if (x === currentLen - 1) {\n if (called === limit) {\n // Create hash\n var redisHash = {};\n\n // Add all links Redis as keys and values\n _.each(urlHolder, function(linkToHash, linkIndex) {\n rClient.set(linkToHash, linkToHash);\n });\n\n // Log\n console.log('Finished');\n resolve();\n\n } else {\n crawlHeldLinks(urlHolder);\n console.log('Restart Recursion:' + called);\n }\n\n } else {\n console.log('Continuing');\n }\n\n });\n });\n\n };\n })\n}", "waitForPage (url) {\n debug('waitForPage', url)\n var waitFor = this.wait.bind(this)\n var childPages = this.childPages\n return new Promise(async resolve => {\n var page = await waitFor(async () => {\n return childPages.filter((val) => {\n return val.url.includes(url)\n })\n })\n resolve(page[0])\n })\n }", "function crawlHeldLinks() {\n // Track call\n called++\n // Record length\n var currentLen = urlHolder.length;\n // Scrape links\n h.waitAndFire(0, urlHolder.length, function(x) {\n\n xray(urlHolder[x], ['a @href'])(function(err, content) {\n if (err) reject(err);\n // Append new links\n urlHolder = urlHolder.concat(content);\n // Remove Duplicates\n urlHolder = h.removeDuplicates(urlHolder);\n // Remove all that dont fit url\n urlHolder = h.removeAllWithout(urlHolder, startingUrl);\n\n // Log\n console.log(urlHolder);\n console.log(currentLen)\n console.log(x);\n\n // Call again with new links or console.log all links\n if (x === currentLen - 1) {\n if (called === limit) {\n // Create hash\n var redisHash = {};\n\n // Add all links Redis as keys and values\n _.each(urlHolder, function(linkToHash, linkIndex) {\n rClient.set(linkToHash, linkToHash);\n });\n\n // Log\n console.log('Finished');\n resolve();\n\n } else {\n crawlHeldLinks(urlHolder);\n console.log('Restart Recursion:' + called);\n }\n\n } else {\n console.log('Continuing');\n }\n\n });\n });\n\n }", "function worker() {\n // deleting obsolete data\n executed = executed.filter(obj => obj.executedAt + 1000 > Date.now());\n\n // running available requests\n for (let q in queue) {\n // max 2 request in 1 sec. for one client\n if (queue.hasOwnProperty(q) && executed.filter(obj => obj.client === queue[q].client).length < 2) {\n // remember for control API restrictions\n executed.push({\n client: queue[q].client,\n executedAt: Date.now(),\n });\n // execute request\n queue[q].callback();\n // exclude repeated request\n queue[q] = null;\n }\n }\n\n // clear queue\n queue = queue.filter(obj => obj);\n setTimeout(worker, 300);\n}", "addWaitingJob(job) {\n this.waitingQueue.push(job);\n }", "initiate(url){\n console.log(`\\nKicking off with base url ${url} \\n`);\n \n //create workers\n for(let i=0; i<maxConcurrent; i++){\n let worker = new Worker();\n this.workers.set(worker, IDLE);\n }\n\n //start distributing\n this.pushToTaskQueue([url]);\n this.distribute();\n }", "_waitFor(msg, timeout) {\n\n let me = this;\n\n return new Promise(function(resolve, reject) {\n\n let timer = setTimeout(function() {\n me._resolveRequest(msg, new Error('No Response to ' + msg));\n }, timeout || DEFAULT_TIMEOUT);\n\n let cb = function(err, result) {\n if(err) {\n reject(err);\n } else {\n resolve(result);\n }\n };\n\n // put it on the list of things we are waiting for\n me.requestQueue.push({\n regex: msg,\n timer: timer,\n cb: cb\n });\n });\n }", "_connectNewNodesWaitlist(setTimeOut){\n\n // console.log(\"Waitlist length\", this.waitlist.length);\n // for (let i=0; i<this.waitlist.length; i++)\n // console.log(this.waitlist[i].toString())\n\n this._deleteUselessWaitlist();\n\n for (let i=0; i < this.waitlist.length; i++){\n\n let nextNode = this.waitlist[i];\n\n this._tryToConnectNextNode(nextNode);\n\n }\n\n\n if (setTimeOut === true)\n setTimeout(()=>{ return this._connectNewNodesWaitlist( true ) }, consts.NODES_WAITLIST_INTERVAL);\n }", "handleNodeResponse(e){const detail=e.detail;// this means that it was an internal path, fake \"loading\"\nif(typeof null===typeof detail.response){setTimeout(()=>{this.items[this.active].metadata.status=\"available\";this.set(\"items.\"+this.active+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+this.active+\".metadata.status\");this._responseList[this.active]=detail.response;this.activeNodeResponse=this._responseList[this.active]},1500)}// valid response, pass it along for other things to use\nelse{this.items[this.active].metadata.status=\"available\";this.set(\"items.\"+this.active+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+this.active+\".metadata.status\");this._responseList[this.active]=detail.response;this.activeNodeResponse=this._responseList[this.active]}}", "run(arg){\n if (this.count < this.maxConcurrency){\n this.count ++;\n return new Promise((resolve, reject) => {\n setTimeout(function(){\n resolve();\n console.log('done', arg)\n },10);\n console.log('running', arg)\n }).then( response => {\n this.count--;\n if (this.queue.length > 0){\n let nextJob = this.queue.shift();\n this.run(nextJob);\n }\n })\n } else {\n this.queue.push(arg);\n // console.log(this.queue);\n }\n \n }", "function checkQueue() {\n\tlet jobsToAdd = 10 - workers.length;\n\tfor (let i = 0; i < workers.length; i++) {\n\t\tif (!workers[i].done) continue;\n\t\tworkers[i] = null;\n\t\tworkers.splice(i, 1);\n\t\tjobsToAdd++;\n\t}\n\n\tfor (let i = 0; queuePosition < pageQueue.size && jobsToAdd > 0; queuePosition++) {\n\t\tlet url = [...pageQueue][queuePosition];\n\t\tworkers.push(createJob(url));\n\t\tjobsToAdd--;\n\t}\n\n\tsetTitle('Workers: ' + workers.length + '/10, Queue: ' + pageQueue.size);\n}", "_queue () {\n var _this = this;\n async.whilst(\n function condition () {\n return !!_this._queueTasks.length || _this._break;\n },\n function iterator (next) {\n var task = _this._queueTasks.shift();\n task.consumer(next);\n },\n function end () {\n setTimeout(_this._queue.bind(_this), 100);\n }\n );\n }", "function activate(){\n busy = queue[0]\n if(busy) fetch(busy.url,busy.options)\n .then(busy.onComplete,err=>false)\n .then(ok=>{\n if(ok || !busy.retry){\n queue = queue.filter(item=>item!==busy)\n activate()\n }\n else setTimeout(()=>activate(),1000)\n })\n }", "function wait () { return new Promise( (resolve,reject)=>{ setTimeout(resolve,5000)} )}", "function _addKnownUrls( crawler ) {\n return new Promise( function( resolve, reject ) {\n let sql = 'SELECT url FROM cfpb_content';\n db.each( sql, function( err, row ) {\n if ( err ) {\n reject( err );\n } else {\n crawler.queueURL( row.url, undefined, true );\n console.log( 'Added known URL: ' + row.url ); \n }\n } );\n resolve();\n } );\n}", "function requestqueue() {\n\t\t// If the queue is already running, abort.\n\t\tif(requesting) return;\n\t\trequesting = true;\n\t\tlink.request({\n\t\t\turl: \"api/events\",\n\t\t\tmethod: \"POST\",\n\t\t\tparams: {\n\t\t\t\tsid: gSessionID\n\t\t\t},\n\t\t\tcallback: queuecallback\n\t\t});\n\t}", "wait() {}", "function make_async(){\n let anchors = document.querySelectorAll('a.async');\n\n anchors.forEach((anchor => {\n anchor.addEventListener('click', (a) => {\n a.preventDefault();\n\n fetchHTML(anchor.pathname);\n })\n }))\n}", "crawlNextUrl() {\n var _this4 = this;\n\n const urlsPoolSize = this.crawlStatesRepository.urlsPoolSize();\n const urlsSize = this.crawlStatesRepository.urlsSize();\n\n if (urlsPoolSize === 0 || urlsSize >= this.args.limit && this.args.limit !== -1) {\n this.browser.close();\n return this.resolve(this.crawlStatesRepository.findAllUrls());\n }\n\n let url = CrawlerRepository.cleanUrl(this.crawlStatesRepository.popPoolUrl());\n this.processPage(url).then(\n /*#__PURE__*/\n function () {\n var _ref = _asyncToGenerator(function* (data) {\n const newUrl = new _Url.default(url);\n\n if (newUrl) {\n _this4.crawlStatesRepository.addUrl(newUrl);\n\n const urlsSize = _this4.crawlStatesRepository.urlsSize();\n\n _this4.progress(new _Progress.default(newUrl, data.html, data.headers, urlsSize, urlsPoolSize - 1));\n\n if (urlsSize <= _this4.args.screenshots && _this4.args.screenshots !== -1 || _this4.args.screenshots === -1) {\n _this4.page.screenshot({\n path: _path.default.join(_this4.screenshotsPath, \"\".concat(newUrl.name, \".png\"))\n });\n }\n\n if (_this4.args.isSingle()) {\n _this4.resolve(_this4.crawlStatesRepository.findAllUrls());\n } else {\n const links = yield _this4.page.$$(\"a\");\n\n for (let linkHandle of links) {\n const href = yield _this4.page.evaluate(link => link.href, linkHandle);\n let foundUrl = CrawlerRepository.cleanUrl(href);\n\n if (_this4.isFreshUrl(foundUrl)) {\n _this4.crawlStatesRepository.addPoolUrl(foundUrl);\n }\n }\n\n _this4.crawlNextUrl();\n }\n } else {\n _this4.crawlNextUrl();\n }\n });\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }()).catch(() => {\n this.crawlNextUrl();\n });\n }", "function BeginDiscoveryQueue( eQueueType, eleAnchorTarget )\r\n{\r\n\tWebStorage.SetCookie( 'queue_type', eQueueType );\r\n\twindow.location = eleAnchorTarget.href;\r\n}", "async start() {\n this.childProcess = ChildProcess.fork(`${__dirname}/checkQueue.js`);\n this.startChildProcess();\n this.childProcess.on('message', async (message)=>{\n let urlData = message['urlData'];\n if (urlData) {\n if (urlData) {\n broadcast(this.queue, urlData);\n }\n }\n });\n }", "function createJob(myURL) {\n return new Promise(function (resolve, reject){\n\n //initialize worker on queue getCode \n var worker = client.worker(['getCode']);\n\n //assign job to worker\n worker.register({\n //define function getHTML to get the html code of requested url\n getHTML: function(params, callback) {\n try {\n //request html code from provided params.url\n request({\n uri: params.url,\n }, function(error, response, body) {\n callback(null, body);\n });\n\n } catch (err) {\n callback(err);\n }\n }\n });\n\n //add job getHTML to queue\n queue.enqueue('getHTML', {\n url: myURL\n }, function(err, job) {\n if (err) return console.log(err.message);\n console.log('ENQUEUED');\n console.log(job.data);\n //return job data after job is completed by worker\n resolve(job.data); \n //create \n });\n\n worker.start();\n\n //event listeners to give status and data updates throughout the job process\n worker.on('dequeued', function(data) {\n console.log('DEQUEUED: ');\n console.log(data);\n });\n worker.on('failed', function(data) {\n console.log('FAILED: ');\n console.log(data);\n });\n worker.on('complete', function(data) {\n console.log('COMPLETE: ');\n console.log(data);\n\n });\n worker.on('error', function(err) {\n reject(err);\n console.log('ERROR: ')\n console.log(err)\n worker.stop()\n });\n });\n}", "function Waiter() {}", "function crawlNpmPathCollection(urlCollection, callback) {\n\n var urlQty = urlCollection.length;\n var downloadsLeft = urlCollection.length;\n var doneQty = 0;\n\n print(\"Pages left: \" + downloadsLeft);\n\n var urlCollectionEmptyFlag = false;\n\n //Queue to handle addition of items into the database\n var databaseQueue = async.queue(function(moduleData, taskCallback) {\n \n //Add this module data to the database\n addNpmModuleToDb(moduleData, function(err) {\n if(err)\n console.log(err);\n\n taskCallback(err, moduleData.path);\n });\n\n }, 1);\n\n //Callback to be called when the database queue are empty\n databaseQueue.drain = function() {\n console.log(\"Database queue is empty.\");\n\n //If the url collection to be download is empty, call the finish callback\n if(urlCollectionEmptyFlag)\n callback();\n }\n\n //Queue to handle the download of the wikipedia pages\n var npmPathQueue = async.queue(function(path, taskCallback) {\n\n print(\"Getting data of module: '\" + path + \"'\");\n\n npmApi.getNpmModuleData(path, function(error, moduleData) {\n downloadsLeft--;\n \n //If error, exit with it\n if(error) {\n taskCallback(getErrorString(error, \n \"Crawl Error with module: '\" + path + \"': \"), path);\n return;\n }\n\n //Push this pageinfo to the database queue\n databaseQueue.push(moduleData, function(err, modulePath) {\n doneQty++;\n if(err) {\n var errorString = getErrorString(err, \n \"Error while adding data to database from url \" + modulePath + \": \");\n print(errorString);\n writeErrorLog(errorString);\n } else {\n print(\"Module '\" + modulePath + \"' added to the database.\");\n } \n print(\"Modules done: \" + doneQty + \"/\" + urlQty);\n \n //Call the task finish callback\n taskCallback(null, path);\n\n });\n\n\n });\n\n }, 3);\n\n //Callback to be called when the wikipages queue are empty\n npmPathQueue.drain = function() {\n print(\"Npm paths queue is empty.\");\n urlCollectionEmptyFlag = true;\n }\n\n npmPathQueue.push(urlCollection, function(err, path){\n if(err) {\n var errorString = getErrorString(err, \"Error while downloading page: \" + path);\n print(errorString);\n writeErrorLog(errorString);\n } else {\n print(\"Module '\" + path + \"' downloaded. Modules left: \" + downloadsLeft);\n }\n });\n}", "function getTaskFromBag() {\n\tif (currentlyWorking)\n\t\treturn;\n\tcountCurrentPath = 0;\n\tcurrentPathIndex = 0;\n\tcurrentPath = new Array();\n\tcurrentTaskId = \"\";\n\t// logbox.setContent(\"Checking bag \" + new Date().toString());\n\t// screen.render();\n\tpostWithCallBack('/getTask', {\n\t\tip : my_ip\n\t}, bag_ip, bag_port, function(response) {\n\n\t\tresponse = JSON.parse(response);\n\t\t// myLogs(response.gotTask);\n\t\tif (response.gotTask === true) {\n\t\t\tmyLogs(\"\\nMoving to \");\n\t\t\tcurrentlyWorking = true;\n\t\t\tmoveToTarget(response);\n\t\t}\n\t});\n\tsetTimeout(getTaskFromBag, 3000);\n\n}", "function startPollingBuildInfo(jstreeInst){\n\t\t\t$.get('pollActiveAtomicBuildsTableRowHtml')\n\t\t\t\t.done(function( data, textStatus, jqXHR ){\n\t\t\t\t\tvar nodeId;\n\t\t\t\t\tfor(nodeId in data){\n\t\t\t\t\t\tjstreeInst.update_redraw_template(nodeId, '.jstree-table-row', data[nodeId]);\n\t\t\t\t\t\t(function(nodeId){\n\t\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t\t// if need to uncheck the node\n\t\t\t\t\t\t\t\tuncheckBasedOnJobStatus(jstreeInst,\n\t\t\t\t\t\t\t\t\tjstreeInst.get_json(nodeId,\n\t\t\t\t\t\t\t\t\t\t{no_data: true, no_children: true, no_state: true, flat: true}));\n\t\t\t\t\t\t\t}, 500);\n\t\t\t\t\t\t})(nodeId);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.fail(function( jqXHR, textStatus, errorThrown) {\n\t\t\t\t\t// popup an alert to stop the polling\n\t\t\t\t\talert('Jenkins server encountered problems. Please check relevant server log.');\n\t\t\t\t})\n\t\t\t\t.always(function(){\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\tstartPollingBuildInfo(jstreeInst);\n\t\t\t\t\t}, 5000); // just follow jenkins itself polling interval\n\t\t\t\t})\n\t\t}", "function poll() {\n var res;\n if (queue.length == 0) {\n // Queue empty, stop polling.\n clearTimeout(pollerId);\n pollerId = undefined;\n }\n else if (!wait) {\n // Resource group loaded, continue to the next one.\n wait = true;\n res = queue.shift();\n db('#poll - loading next resource: ', res)\n loadResources(res);\n }\n }", "function wait (jq, query, context, remainingStatements, executor, handlers, minWait, maxWait) {\n if (!remainingStatements || !remainingStatements.length) {\n return true;\n }\n minWait = minWait || 200;\n maxWait = maxWait || 2000;\n waitFor(jq, query, context, remainingStatements, executor, handlers, minWait, maxWait);\n }", "function waitForChildren(number, callback){\n var waitingFor = number;\n\n function countOne(){\n waitingFor--;\n if(waitingFor == 0){\n finish(callback);\n }\n }\n\n countOne.add = function(number){\n waitingFor += number || 1;\n }\n\n return countOne;\n}", "function startJobWithCallback(job, url, index, robots)\n{\n // we pass url and robots boolean to worker\n job({url: url, robots: robots}, function (err, result) {\n totalCrawled++;\n if (err && err.message === \"404\") {\n notFoundCounter++;\n return;\n }\n console.log('DONE: ' + index);\n if (result !== undefined) {\n processLinks(result.hyperlinks);\n writeOutput(result);\n }\n else{\n notFoundCounter++;\n }\n });\n}", "function ConnectionsPoolJobOrder(url) {// to be called with \"new\"\n // data and function stores\n var self = this;\n this.urlToFetch = url;\n this.state = 'created';\n this.andThen = [];\n this.andCatch = function() {};\n this.andFinally = function() {};\n // interface like normal fetch()\n this.then = function (aFunction) {\n self.andThen.push(aFunction);\n return self;\n };\n this.catch = function (aFunction) {\n self.andCatch = aFunction;\n return self;\n };\n this.finally = function (aFunction) {\n self.andFinally = aFunction;\n return self;\n };\n // runner!\n this.perform = function() {\n self.state = 'running';\n var current = originalFetch(self.urlToFetch);\n while(self.andThen.length > 0) {\n current = current.then(self.andThen.shift());\n }\n current = current.catch(self.andCatch);\n current = current.finally(function() {\n self.andFinally();\n self.state = 'terminated';\n connectionsPool.terminatedJob(self);\n })\n }\n}", "function HTML_AJAX_Queue_Immediate() {}", "function checkSyncQueue() {\n if (sync.queue.length == 0 || Object.keys(sync.jobs).length >= sync.size)\n return;\n\n var download = sync.queue.pop();\n var dest = path.join(config['data_root'], download.hash);\n if (fs.existsSync(dest) || sync.jobs[download.hash])\n return;\n\n var parts = url.parse(config['tracker']);\n var req = sync.jobs[download.hash] = http.request({\n method: \"GET\",\n hostname: parts['hostname'],\n port: parts['port'],\n path: \"/tracker/api/upload/\" + download.id + \"/servers\",\n headers: {\n \"X-Server-Auth\": config['token'],\n \"User-Agent\": \"server-\" + config['id']\n }\n }, function(res) {\n var body = \"\";\n res.on('data', function(chunk) {\n body += chunk;\n });\n res.on('error', function(e) {\n console.log(\"error reading server list response from tracker: \" + e);\n });\n res.on('end', function() {\n try {\n var data = JSON.parse(body);\n if (!data.servers)\n throw \"no servers in response\";\n downloadFile(download, data.servers);\n }\n catch (e) {\n console.log(e);\n }\n });\n });\n req.on(\"error\", function(e) {\n console.log(\"erroring fetching server list from tracker: \" . e);\n });\n req.end();\n}", "function dispatch() {\n if (blocked || cycles || !jobs) return;\n// console.time('DOM_REFLOW_TIME');\n\n cycles = 3;\n\n // reflow job queue loop\n while (cycles-- && jobs) {\n//console.log(\"REFLOW_DISPATCH_CYCLE\", cycles);\n for (var type in queues) {\n runQueue(type, queues[type]);\n }\n // start the depth-first flow tree traversal\n if (Tile.root.flowViews || Tile.root.flowFlags) {\n Tile.root.flow();\n }\n }\n\n // check for loop overflow\n if (!cycles) {\n console.error('Reflow Dispatch Cycle Overflow');\n //console.trace();\n }\n cycles = 0;\n\n // measure time for DOM to reflow\n _.defer(function() {\n// console.timeEnd('DOM_REFLOW_TIME');\n });\n }", "wait() {\r\n this._wait = true;\r\n }", "_issueNewRequests() {\n this._updateNeeded = true;\n setTimeout(() => this._issueNewRequestsAsync(), 0);\n }", "function searchToQueue(url, name){\n\t socket.emit('link', {\n\t\turl : url,\n\t\ttitle: getVidDeets(url, 'title'),\n\t\tname : name,\n\t\troom : roomID\n\t });\t \n}", "function enQueue1(cell){\nvar queue = [];\nvar outboundLinks = App.graph.getConnectedLinks(cell, {outbound: true});\nvar inboundLinks = App.graph.getConnectedLinks(cell, {inbound: true});\nfor (var i = inboundLinks.length - 1; i >= 0; i--) {\n\tvar linkType = inboundLinks[i].attr('.link-type')\n\tif (linkType == 'Dependency' || linkType == 'Actor'){\n\t\tvar sourceCell = inboundLinks[i].getSourceElement();\n\t\tqueue.push(sourceCell);\n\t}\n}\n\nfor (var i = outboundLinks.length - 1; i >= 0; i--) {\n\tvar linkType = outboundLinks[i].attr('.link-type')\n\tif (linkType != 'Error' && linkType != 'Dependency' && linkType != 'Actor' && linkType != 'Qualification'){\n\t\tvar targetCell = outboundLinks[i].getTargetElement();\n\t\tqueue.push(targetCell);\n\t}\n}\nreturn queue;\n\n}", "async fetchQueue( endpoint ){\n\t\treturn await axios.get( endpoint )\n\t}", "function DownloadQueue() {\n}", "function joinQueue() {\n if ($(\"#button-dj-play\").css(\"display\") === \"block\") {\n $(\"#button-dj-play\").click();\n } else if (API.getWaitList().length < MAX_USERS_WAITLIST) {\n API.waitListJoin();\n }\n}", "function currentQueuePoll(){\n\tif(currentQueue==undefined){\n\t\tgetCurrentQueue();\n\t} else{\n\t\tvar msg={\"type\":\"getQueue\"};\n\t\ttry{\n\t\t\tchrome.runtime.sendMessage(msg,function(response){\n\t\t\t\tcurrentQueue.setVideos(response.data.videos);\n\t\t\t\tupdateVideoCountMastHead();\n\t\t\t});\n\t\t}catch(e){\n\t\t\tconsole.log(e);\n\t\t}\n\t}\n\tsetTimeout(currentQueuePoll,2000);\n}", "function buildFollowing () {\n\n // Create queue object\n var q = async.queue(function (task, callback) {\n jQuery.getJSON(getUsersByIds({userids: task.ids}), function (data) {\n for (var i = 0, l = data.length; i < l; i++) {\n following.push(data[i]);\n }\n message('Fetched '+following.length+'/'+ids.length+' users');\n callback();\n })\n .error(function () {\n show();\n message('Bad request: Twitter rate limit.');\n })\n }, MAX_CONCURRENT_REQS);\n\n\n // When all tasks processed\n q.drain = function () {\n show();\n }\n\n // Push to queue\n toFetch = ids.slice();\n while (toFetch.length > 0) {\n batch = toFetch.splice(0,Math.min(100,toFetch.length));\n q.push({ids: batch}, function () {});\n }\n}", "async makeQuery (url, data, wait=true) {\n let qeueIndex = this.qeue.indexOf(url + this.serialize(data));\n if (qeueIndex !== -1 && wait) return new Promise((resolve, reject) => reject('Plese, wait!'));\n \n qeueIndex = this.qeue.length;\n this.qeue.push(url + this.serialize(data));\n\n return new Promise((resolve, reject) => {\n let response = '';\n fetch(url, data).then(async (res) => {\n\n response = await res.text();\n this.removeFromQeue(qeueIndex);\n\n res = JSON.parse(response);\n \n if (res.error) {\n this.handler(res)\n return reject(res)\n }\n return resolve(res.response);\n }).catch((r) => {\n\n let err = new String('Произошла ошибка');\n \n err.response = response;\n err.isServerError = true;\n \n this.removeFromQeue(qeueIndex);\n\n if (this.handler) {\n this.handler(err)\n return reject(err)\n }\n return reject(err);\n });\n })\n }", "function waitForData(){\n if(data.fetching){\n setTimeout(waitForData, 10);\n } else {\n callback(data);\n }\n }", "_issueNewRequests() {\n if (!this._deferredUpdate) {\n this._deferredUpdate = setTimeout(() => this._issueNewRequestsAsync(), 0);\n }\n }", "_issueNewRequests() {\n if (!this._deferredUpdate) {\n this._deferredUpdate = setTimeout(() => this._issueNewRequestsAsync(), 0);\n }\n }", "function check() {\r\n\t\tif (urlsLeft == 0) callback(results);\r\n\t\telse setTimeout(check, 500); \r\n\t}", "async function fetchAndQueue() {\n const rnpages = await reloadRandomPages()\n const npages = rnpages && rnpages.filter(e => e !== null)\n if (npages && npages.length > 0) {\n Array.prototype.push.apply(articles, npages)\n }\n return true\n}", "function crawler() \n{\n\t// There are still links to be Crawled.\n\tif (noneCrawledURLs.length > 0 && allURLsInOrder.length > 0)\n\t{\n\t\t// Then, we need to update \"noneCrawledURLs\" after redirecting a particular URL.\n\t\tvar urlOfInProcessDOM = allURLsInOrder[allURLsInOrder.length - 1];\n\n\t\tvar arrayOfOutGoingLinks = new Array();\n\n\t\t// the array contains all the outgoing links of the 'urlOfInProcessDOM'\n\t\tarrayOfOutGoingLinks = getTheLinksFromCurrentURL(urlOfInProcessDOM);\n\n\t\t// This URL has not been visited yet.\n\t\tif (arrayOfOutGoingLinks != null && arrayOfOutGoingLinks.length > 0 && !alreadyInProcess(arrayOfOutGoingLinks[0]))\n\t\t\treadyForClick(arrayOfOutGoingLinks, urlOfInProcessDOM);\n\t\t\n\t\t// This URL has been visited before.\n\t\telse if (arrayOfOutGoingLinks != null && arrayOfOutGoingLinks.length > 0 && alreadyInProcess(arrayOfOutGoingLinks[0]))\n\t\t{\n\t\t\tarrayOfOutGoingLinks = deleteTheFirstIndex(arrayOfOutGoingLinks);\n\n\t\t\t// update the array of outgoing links for curURL\n\t\t\tupdateTheArrayOfLinks(urlOfInProcessDOM, arrayOfOutGoingLinks);\n\n\t\t\tvar step = false\n\n\t\t\t// Checks if there is still something for this URL to be Crawled.\n\t\t\tif (arrayOfOutGoingLinks.length == 0)\n\t\t\t{\n\t\t\t\tdeleteTheIndex(urlOfInProcessDOM);\n\t\t\t\tcrawledURLs.push(urlOfInProcessDOM);\n\t\t\t\tallURLsInOrder.pop();\n\t\t\t\tstep= true;\n\t\t\t}\n\n\t\t\tif (allURLsInOrder.length > 0)\n\t\t\t\tloadURL(allURLsInOrder[allURLsInOrder.length - 1], step);\n\t\t\telse\n\t\t\t{\n\t\t\t\tcreateXMLFile();\n\t\t\t\tphantom.exit();\n\t\t\t}\n\t\t}\n\n\t\t// There is an URL in 'allURLsInOrder' which does not exist in 'noneCrawledURLs'. This should not happen!\n\t\telse\n\t\t{\n\t\t\tif (noneCrawledURLs.length == 0 || noneCrawledURLs == null || allURLsInOrder.length == 1)\n\t\t\t{\n\t\t\t\tdumpLogsPerStep();\n\t\t\t\tcreateXMLFile();\n\t\t\t\tphantom.exit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tallURLsInOrder.pop();\n\n\t\t\t\tif (allURLsInOrder.length > 0)\n\t\t\t\t\tloadURL(allURLsInOrder[allURLsInOrder.length - 1], true);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcreateXMLFile();\n\t\t\t\t\tphantom.exit();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tcreateXMLFile();\n\t\tphantom.exit();\n\t}\n}", "function preloadUrls() {\n\tgetUrls()\n\n\t// If the queue is empty, bail\n\tif ( queue.length === 0 ) {\n\t\treturn\n\t}\n\n\t// grab the next 10 URLs and get the paths\n\tconst requestUrls = queue.slice( 0, 10 )\n\n\t// hack off the 10 items just placed in requestUrls.\n\tqueue = queue.slice( 10 )\n\n\t// fetch the data\n\tnew Promise( async ( res, rej ) => {\n\t\tconst data = await fetch( {\n\t\t\tpath: `/nicholas/v1/page-info?paths=${requestUrls.map( url => url.pathname )}`,\n\t\t} )\n\n\t\t// Loop through each dataset and set the cache from the request URL\n\t\tdata.forEach( ( datum, key ) => {\n\t\t\tsetTimeout( () => {\n\t\t\t\trequestUrls[key].updateCache( datum )\n\t\t\t}, 100 * key )\n\t\t} )\n\t} )\n}", "function modify_child_Parent_relationship() {\n\t\n\tvar parent_index = 0, child_index = 1;\n\t\n\t\n\n\tparent = modify_Parent_Child_relationship_queue[parent_index].node,\n\tchild = modify_Parent_Child_relationship_queue[child_index].node;\n\t\n\t//If I get here no matter what I have to clear the queue\n\tmodify_Parent_Child_relationship_queue.length = 0;\n\t\n\tif ( parent === child ) {\n\t\t//If parent is child i'll delete the earliest clicked element\n\t\t//modify_Parent_Child_relationship_queue.splice(0);\n\t\tLog('Warning: Node ' + parent.id + ' cannot be a parent or child of itself');\n\t\t//modify_Parent_Child_relationship_queue.length = 0;\n\t\treturn;\n\t\t\n\t}\n\t\n\t\n\t//If you clicked on the two nodes and they are already\n\t//parent child but in the reverse order that you clicked\n\t//them break them up\n\tif ( child.animationChildren[parent.id] == parent ) {\n\t\t\n\t\tbreakConnection(child, parent);\t\n\t\t/*Log(\"Breaking Parent - Child ( \"+ parent.id + \" ---> \"\n\t\t + child.id + \" ) relationship\");\t*/\n\t\treturn; \n\t}\n\t\n\t//If they already parent child then break the relationship\n\tif (child.animationParent == parent ) {\n\t\tbreakConnection(parent, child);\t\n\t\t/*Log(\"Breaking Parent - Child ( \"+ parent.id + \" ---> \"\n\t\t + child.id + \" ) relationship\");*/\n\t\t \n\t\treturn; \n\t}\n\t\t\n\t//If child already has parent... See yaaaa\n\tif( (child.animationParent && child.animationParent != parent && max_number_of_parents<=1)){\n\t\tLog('Warning: No node including Node ' + child.id +\n\t\t ' can have more than one parent');\n\t\treturn;\t\n\t}\n\t\n\tif( Object.keys(parent.animationChildren).length \n\t\t>= max_number_of_children && parent.animationChildren[child.id]!=child ){\n\t\tLog('Warning: No node including Node ' + parent.id +\n\t\t ' can have more than '+ max_number_of_children + ' child(ren)');\n\t\t\treturn;\n\t\t\n\t\t}\n\t\t\n\t\n\tif ( parent.getLineConnectedToNode[child.id] ||\n\t child.getLineConnectedToNode[parent.id]) {\n\t\t\n\t\tbreakConnection( parent, child, true);\n\t\t//Lets disconnect them if theyre not parent-child\n\t\t\n\t\t \n\t\tLog(\"Breaking Connection from Node \"+ parent.id + \" to Node \"\n\t\t\t+ child.id );\n\t\t \n\t\t return;\n\t}\t\n\t\t\n\tcreateParent_Child_Relationship(parent, child); \n\t \n\t\n}", "function requestDownloadLinks(callback) {\n var count = 0\n , downloads = []\n\n $.getJSON('/handler/lixian/get_lixian_status.php'/*, {mids : [ids]} NOUSE*/)\n .done(function (res) {\n $.each(res.data, function (i, task) {\n // check\n if (\n !$('#task_sel_' + task.mid).is(':checked') || // user selected\n task.file_size !== task.comp_size || // download finished\n task.dl_status !== TASK_STATUS['ST_UL_OK']\n ) return\n\n\n count++\n $.post('/handler/lixian/get_http_url.php', {\n hash: task.hash\n , filename: task.file_name\n //, g_tk : getACSRFToken(cookie.get('skey', 'qq.com'))\n //, browser : 'other'\n }, null, 'json')\n .done(function (res) {\n count--\n if (res && res.ret === 0) {\n // break speed limit\n // thanks @4023 https://userscripts.org/users/381599\n var url = res.data.com_url\n .replace('xflx.store.cd.qq.com:443', 'xfcd.ctfs.ftn.qq.com')\n .replace('xflx.sz.ftn.qq.com:80', 'sz.disk.ftn.qq.com')\n .replace('xflx.cd.ftn.qq.com:80', 'cd.ctfs.ftn.qq.com')\n .replace('xflxsrc.store.qq.com:443', 'xfxa.ctfs.ftn.qq.com')\n\n downloads.push({\n url: url\n , cookie: res.data.com_cookie\n , filename: task.file_name\n })\n }\n })\n .fail(function () {\n msg.show('获取失败', 2, 2000)\n })\n .always(function () {\n if (count === 0) {\n // sort according to filename\n downloads.sort(function (a, b) {\n return a.filename.localeCompare(b.filename)\n })\n callback(downloads)\n }\n })\n\n })\n })\n .fail(function () {\n msg.show('获取列表的接口坏了嘛?! 请联系脚本作者', 2, 2000)\n })\n }", "producer(successCallback, failCallback) {\r\n const waitingPromise = new CustomPromise();\r\n //queue promises are based on their closures \r\n this.orderQueue.push([waitingPromise, successCallback, failCallback]);\r\n // console.log(this.orderQueue.length); //delete this\r\n\r\n if (this.state === states[1]) {\r\n this.backtrackTheChain();\r\n } else if (this._state === states[2]) {\r\n this.backtrackTheChainR();\r\n }\r\n\r\n return waitingPromise;\r\n }", "function populateHistoryCacheAsync(t) {\r\n // flag ourselves as populating and calcuate the turns needing to be requested\r\n t.historyCachePopulating = true;\r\n var startTurn = Math.max(0, Math.min(t.activeTurn, t.historyCacheTurn) - HISTORY_CACHE_BUFFER);\r\n var endTurn = Math.max(0, t.historyCacheTurn - 1);\r\n console.log(\"requesting states in range [\" + startTurn + \", \" + endTurn + \"]\");\r\n // send the async history request\r\n AcquireRequest.requestHistoryAsync(t.connInfo, startTurn, endTurn, function (response) {\r\n // on completion, populate the cache iwth the results and set state according the results \r\n for (var _i = 0, _a = JSON.parse(response); _i < _a.length; _i++) {\r\n var state_1 = _a[_i];\r\n var server = new AcquireServer.T(state_1);\r\n t.cache[server.turn] = server;\r\n // console.log(\"added server with turn [\" + server.turn + \"] to cache\")\r\n }\r\n t.historyCacheTurn = startTurn;\r\n t.historyCachePopulating = false;\r\n });\r\n }", "function init_queued() {\n\t// response handler for when the queue element changes\n\tvar mutationHandler = function(records) {\n\t\t\tfor (var j = 0; j < records.length; j++) {\n\t\t\t\tvar record = records[j];\n\n\t\t\t\tif (record.addedNodes) {\n\t\t\t\t\tvar nodes = record.addedNodes;\n\t\t\t\t\t// loop through every new element\n\t\t\t\t\tfor (var i = 0; i < nodes.length; i++) {\n\t\t\t\t\t\t// if a button was added (so trade is ready)\n\t\t\t\t\t\tif (nodes[i].className === \"button\") {\n\t\t\t\t\t\t\t// if timer is above 0\n\t\t\t\t\t\t\tif ((420000 - (Date.now() - localStorage.whenbet)/1000) > 0) {\n\t\t\t\t\t\t\t\t// TODO: save relevant info to ensure safe trade\n\t\t\t\t\t\t\t\tchrome.storage.local.set({\"steam_trading\": true}, (function(link){\n\t\t\t\t\t\t\t\t\t\treturn function(){window.location = link;}\n\t\t\t\t\t\t\t\t\t})(nodes[i].href));\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\n\tvar obs = new MutationObserver(mutationHandler);\n\tobs.observe(document.getElementById(\"queue\"), {childList: true});\n}", "function init_queue(unvisited) {\n var total_edge_info = \"\";\n for(var i = 0; i < unvisited.length; i=i+2) {\n var next_name = idToName(unvisited[i]);\n var start_name = idToName(unvisited[i + 1]);\n var edge_info = start_name +\" -> \"+ next_name + \"; \";\n total_edge_info = total_edge_info.concat(edge_info);\n }\n var queue_elem = document.getElementById(\"waiting_edges\");\n console.log(queue_elem);\n var infos = document.createTextNode(total_edge_info);\n queue_elem.appendChild(infos);\n}", "function processQueue(cb){\n\n}", "function fetchURL(qno){\r\n// i ll write the logic behind fetchin the image from folders...for now i am hardcoding url of images\r\n// 1) modify pending_images tabel to add bundle_id\r\n// 2) select top 10 pending_images which are not evaluated and correspond to this bundle_id (pending_images)\r\n// 3) select see image table to see if evaluation_done = 0 then only fetch url from (image) table\r\n// 4) evaluation complete hote hi pending_images se remove plus insert into completed table \r\n//var imageurls= [\"1pi12cs002/t112CS4011a2016.jpg\",\"1pi12cs003/t112CS4011a2016.jpg\",\"1pi12cs004/t112CS4011a2016.jpg\",\"1pi12cs005/t112CS4011a2016.jpg\",\"1pi12cs008/t112CS4011a2016.jpg\"];\r\n\t/*var xhr = new XMLHttpRequest();\r\n\txhr.onreadystatechange = getURL;\r\n\txhr.open(\"GET\",\"http://localhost/REAP/dataFetchingFiles/getImageURL.php?bundle_id=\"+bundle_id+\"&qno=\"+qno,true);\r\n\txhr.send(); \r\n\tvar imageurls= [\"1pi12cs003/t112CS4011a2016.jpg\",\"1pi12cs004/t112CS4011a2016.jpg\",\"1pi12cs005/t112CS4011a2016.jpg\",\"1pi12cs008/t112CS4011a2016.jpg\"];\r\n\tvar imageIds = [10004,10005,10006,10007,10008];\r\n\tvar imageDetails ={\"imageurls\":imageurls,\"imageids\":imageIds};\r\n\tif(questionNumber != \"1a\") \r\n \t\treturn null; \r\n\treturn imageDetails;*/\r\n\r\n}", "function LaunchQueue(){\n\tthis._queue = [];\n}", "function queueAsyncReload(element, requestURL, callback, countdown)\n\t{\n\t\telement.find(\".update\").html(countdown);\n\t\tif(countdown == 0)\n\t\t{\n\t\t\tasyncLoadPage(element, requestURL, callback, -1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\twindow.setTimeout(function() \n\t\t\t{\n\t\t\t\tqueueAsyncReload(element, requestURL, callback, countdown - 1);\n\t\t\t}, 1000);\n\t\t}\n\t}", "function enqueue( a ){\n\t\t\t\n\t\t\t// filters\n\t\t\tif ( a.depth > maxDepth ) return;\n\t\t\tif ( queued[a.path] ) return;\n\t\t\tif ( a.hostname != origin.hostname || a.protocol != origin.protocol ) return;\n\t\t\tif ( blockedExtentions.test(a.path) ) return;\n\t\t\t\n\t\t\t// output\n\t\t\t$(\"<div class='page depth_\"+a.depth+\" queued' data-depth='\"+a.depth+\"'>\"+\n\t\t\t\t\t\"<a class='url' href='\"+a.path+\"'>\"+a.path+\"</a> \"+\n\t\t\t\t\t\"<span class='time'></span> \"+\n\t\t\t\t\t\"<span class='total'></span> \"+\n\t\t\t\t\t\"<ul class='resources'></ul> \"+\n\t\t\t\t\"</div>\")\n\t\t\t\t.appendTo($gc)\n\t\t\t\t.bind('call',get)\n\t\t\t\t.bind('done',handleResponse);\n\t\t\t\n\t\t\tqueued[a.path] = true;\n\t\t}", "function enQueue2(cell){\nvar queue = [];\nvar outboundLinks = App.graph.getConnectedLinks(cell, {outbound: true});\nvar inboundLinks = App.graph.getConnectedLinks(cell, {inbound: true});\nfor (var i = outboundLinks.length - 1; i >= 0; i--) {\n\tvar linkType = outboundLinks[i].attr('.link-type')\n\tif (linkType == 'Dependency' || linkType == 'Actor'){\n\t\tvar targetCell = outboundLinks[i].getTargetElement();\n\t\tqueue.push(targetCell);\n\t}\n}\n\nfor (var i = inboundLinks.length - 1; i >= 0; i--) {\n\tvar linkType = inboundLinks[i].attr('.link-type')\n\tif (linkType != 'Error' && linkType != 'Dependency' && linkType != 'Actor' && linkType != 'Qualification'){\n\t\tvar sourceCell = inboundLinks[i].getSourceElement();\n\t\tqueue.push(sourceCell);\n\t}\n}\nreturn queue;\n\n}", "fetch() {\n const self = this;\n let req = _.first(self._myStartableQueued());\n\n if (!req) {\n const errorHandler = (request, error) => {\n request.defer.reject(error);\n request.abort();\n };\n req = self._createRequest({ errorHandler });\n }\n\n fetchSoon.fetchSearchRequests([req]);\n return req.getCompletePromise();\n }", "async replayRequests() {\n let entry;\n\n while (entry = await this.shiftRequest()) {\n try {\n await fetch(entry.request.clone());\n\n if (\"dev\" !== 'production') {\n logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(entry.request.url)}' ` + `has been replayed in queue '${this._name}'`);\n }\n } catch (error) {\n await this.unshiftRequest(entry);\n\n {\n logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(entry.request.url)}' ` + `failed to replay, putting it back in queue '${this._name}'`);\n }\n\n throw new WorkboxError_js.WorkboxError('queue-replay-failed', {\n name: this._name\n });\n }\n }\n\n {\n logger_js.logger.log(`All requests in queue '${this.name}' have successfully ` + `replayed; the queue is now empty!`);\n }\n }", "function initAllQueue() {\n queue.clickTargetBlank.dequeue();\n queue.validClick.dequeue();\n}", "async function newTab(item, timeout, waitTime) {\n const url = item.url;\n const id = item.id;\n let client;\n try {\n // new tab\n const target = await CDP.New({\n host: config.host,\n port: config.port,\n url: url\n });\n // profile the page\n if (target.type === 'page') {\n client = await CDP({\n host: config.host,\n port: config.port,\n target: target\n });\n \n let num = 0;\n let seq = 1;\n let total = 1; \n const callbackArray = new Array();\n const sessions = new Set();\n // const requestUrls = [];\n const initTime = new Date();\n const paramsArray = new Array();\n \n const {Debugger, Network, Target, Profiler} = client;\n \n await Promise.all([\n Debugger.enable(),\n Network.enable({maxTotalBufferSize: 10000000, maxResourceBufferSize: 5000000}),\n Profiler.enable(),\n ]);\n\n await Target.setAutoAttach({autoAttach: true, waitForDebuggerOnStart: false}); \n \n Debugger.scriptParsed(async ({scriptId}) => {\n try {\n const {scriptSource} = await Debugger.getScriptSource({scriptId: scriptId});\n await rcvDebuggerGetScriptSource(scriptSource, {id, scriptId});\n } catch(err) {\n console.log('script source error!');\n console.error(err);\n }\n });\n\n Network.requestWillBeSent(async ({initiator, request}) => {\n const sourceUrl = request.url;\n await rcvNetworkRequestWillBeSent({id, url, initiator, sourceUrl});\n });\n\n Target.attachedToTarget((obj) => {\n if (obj.sessionId !== undefined) {\n let sessionId = obj.sessionId;\n console.log(`attched: ${sessionId}`);\n sessions.add(sessionId);\n Target.sendMessageToTarget({\n message: JSON.stringify({id: seq++, method:\"Debugger.enable\"}),\n sessionId: sessionId\n });\n Target.sendMessageToTarget({\n message: JSON.stringify({id: seq++, method:\"Network.enable\", params:{\"maxTotalBufferSize\":10000000,\"maxResourceBufferSize\":5000000}}),\n sessionId: sessionId\n });\n Target.sendMessageToTarget({\n message: JSON.stringify({id: seq++, method:\"Profiler.enable\"}),\n sessionId: sessionId\n });\n }\n });\n Target.detachedFromTarget((obj) => {\n if (obj.sessionId !== undefined) {\n console.log(`detached: ${obj.sessionId}`);\n sessions.delete(obj.sessionId);\n }\n });\n Target.receivedMessageFromTarget(async (obj)=>{\n const message = JSON.parse(obj.message);\n let callback, others;\n if (message.method === 'Debugger.scriptParsed') {\n callbackArray[seq] = rcvDebuggerGetScriptSource;\n paramsArray[seq] = {id: id, scriptId: message.params.scriptId};\n Target.sendMessageToTarget({\n message: JSON.stringify({id: seq++, method:\"Debugger.getScriptSource\", params:{scriptId: message.params.scriptId}}),\n sessionId: obj.sessionId\n });\n } else if (message.method !== undefined) {\n callback = callbackMap.get(message.method);\n const {initiator, request} = message.params;\n const sourceUrl = request.url;\n if(callback !== undefined) {\n await callback({id, url, initiator, sourceUrl});\n }\n } else if(message.id !== undefined) {\n callback = callbackArray[message.id];\n if (callback === rcvProfileStop){\n await callback(id, total++, message.result.profile); \n } else if(callback === rcvDebuggerGetScriptSource){\n others = paramsArray[message.id]; \n await callback(message.result.scriptSource, others);\n delete paramsArray[message.id];\n } \n delete callbackArray[message.id];\n }\n });\n await delay(waitTime);\n let pSessions = Array.from(sessions);\n if (pSessions.length > 8) {\n pSessions = pSessions.slice(0, 8);\n }\n await Promise.all([\n (async()=>{\n /* profile the main thread */\n await Profiler.setSamplingInterval({interval: 100});\n await Profiler.start();\n await delay(timeout);\n const {profile} = await Profiler.stop();\n await writeJson(id, 0, profile);\n })(),\n (async()=>{\n /* profile the other thread */\n await Promise.map(pSessions, async (sessionId)=>{\n await Target.sendMessageToTarget({\n message: JSON.stringify({id: seq++, method:\"Profiler.setSamplingInterval\", params:{interval:100}}),\n sessionId: sessionId\n }); \n await Target.sendMessageToTarget({\n message: JSON.stringify({id: seq++, method:\"Profiler.start\"}),\n sessionId: sessionId\n });\n await delay(timeout);\n callbackArray[seq] = rcvProfileStop;\n Target.sendMessageToTarget({\n message: JSON.stringify({id: seq++, method:\"Profiler.stop\"}),\n sessionId: sessionId\n });\n }, {concurrency: 8});\n })()\n ]);\n num += sessions.size;\n await db.updateRerunUrl({id, threads: num + 1});\n await new Promise(async (resolve, reject)=>{\n let count = 0;\n while (total <= num && count < 10) {\n await delay(0.5);\n count++;\n }\n resolve(); \n });\n await CDP.Close({\n host: config.host,\n port: config.port,\n id: target.id\n });\n }\n } catch (err) {\n console.log('tab error!');\n console.error(err);\n } finally {\n if (client) {\n await client.close();\n }\n }\n}", "function checkRequestQueue()\r\n{\r\n\tif (checkRequestQueue != null)\r\n\t{\r\n\t\tif (requestQueueArray.length > 0) \r\n\t\t{\r\n\t\t\tif (!callInProgress(XMLRequest))\r\n\t\t\t{\r\n\t\t\t\tprocessRequest();\r\n\t\t\t}\r\n\t\t\telse if (requestQueueArray.length < queueThreshold)\r\n\t\t\t{\r\n\t\t\t\tsetTimeout('checkRequestQueue();', 50);\r\n\t\t\t}\r\n\t\t\telse if (requestQueueArray.length > queueThreshold)\r\n\t\t\t{\r\n\t\t\t\tReloadPolling();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function processQueue(inst,updateQueue){ReactComponentEnvironment.processChildrenUpdates(inst,updateQueue);}", "function processQueue(inst,updateQueue){ReactComponentEnvironment.processChildrenUpdates(inst,updateQueue);}", "function processQueue(inst,updateQueue){ReactComponentEnvironment.processChildrenUpdates(inst,updateQueue);}", "whenReady(url) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this._whenReady(url, new Set());\n });\n }", "function work(){\n var jobsToQueue = []\n jobsToQueue = scheduleJobQueue.take(5000)//, 5000)\n \n if(worker && !worker.running){\n worker.run(jobsToQueue, jobResult)\n } else {\n worker.addJobs(jobsToQueue)\n }\n jobsToQueue = []\n setTimeout(work, 5 * 1000)\n}", "function scrapeSingleCategoryPage(inputUrl, page){\n incrementRequests();\n\n console.log(\"initial request \" +numberOfRequests);\n var categoryPage = inputUrl + \"?page=\" + page;\n request(categoryPage, function (err, resp, body) {\n if (err)\n throw err;\n $ = cheerio.load(body);\n\n \n\n //add the product URL to the queue\n\n var selector = $('.tile-grid-unit-wrapper');\n \n\n selector.each(function(index){\n var nextLink = 'http://www.walmart.com' + $(this).find('a').attr('href');\n console.log(\"Product: \" + nextLink + \" \" + categoryPage);\n productQueue.push(nextLink);\n });\n \n if($('.paginator-btn-next').length == 0){\n console.log(\"Finish: \" + categoryPage);\n decrementRequests();\n console.log(\"pageend req: \" + numberOfRequests);\n return;\n }\n \n scrapeSingleCategoryPage(inputUrl, page+1);\n\n decrementRequests();\n console.log(\"end req: \" + numberOfRequests);\n });\n\n}", "function Queue() {\n this.emptyCallback = null;\n this.callbacks = [];\n this.yielded = false;\n this.response = null;\n this.responseChain = []; \n}", "function doTheWork() {\n getUrlsFromPage()\n // .then(urls => {\n // // check in reddis if url exists\n // // return filtered array\n // })\n .then((urls) => {\n urls.forEach(url => {\n //return console.log(url);\n crawl(url).then((car) => {\n printCar(car);\n // send email\n // for later us: client.set(\"string key\", \"string val\", redis.print);\n });\n });\n })\n}", "function batchRequest(){\n // Use the lower value of items left in the link array or maxRequests\n var total = (linkArr.length-1 > maxRequests) ? maxRequests : linkArr.length-1;\n for(var i = 0; i<= total; i++) {\n qwest.get(endPoint+encodeURIComponent(linkArr[0]))\n .then(function(response) {\n apiActions.response({pageURL: response.url, report: response.data});\n })\n .catch(function(e, response) {\n console.log('>> Error: ', e, '\\nResponse: ', response);\n })\n // Remove the head from the array\n linkArr.shift();\n }\n\n // Batch request again if there's anything left in the array\n if(linkArr.length > 0) {\n setTimeout(function() {\n batchRequest();\n }, 30*1000);\n }\n}", "function queueSetup() {\n console.log(\"q setup done\");\n}", "join() {\n if (this.ancestor) this.ancestor.dispatchEvent(Events.createRequest(this));\n }" ]
[ "0.5778248", "0.56094426", "0.55767995", "0.550193", "0.54694515", "0.5414653", "0.53997904", "0.5398549", "0.53968996", "0.53924865", "0.53765005", "0.53718394", "0.5323947", "0.53234255", "0.5306173", "0.5286078", "0.5278313", "0.5249631", "0.5230891", "0.5230891", "0.52287203", "0.5190528", "0.51755714", "0.5163237", "0.5155375", "0.514513", "0.51399106", "0.51359415", "0.5123396", "0.51182944", "0.50878453", "0.5084738", "0.50822264", "0.50791156", "0.50785464", "0.5073394", "0.5071029", "0.50521785", "0.50478697", "0.50365716", "0.5033314", "0.5032016", "0.50319874", "0.50180477", "0.5013942", "0.50122607", "0.500164", "0.4974453", "0.4967852", "0.49598187", "0.495725", "0.4953842", "0.49534723", "0.49372587", "0.49372402", "0.49276322", "0.49227366", "0.49141416", "0.49109554", "0.49106702", "0.49104357", "0.4894188", "0.48908004", "0.48809248", "0.48754615", "0.48748887", "0.4872818", "0.4872818", "0.48702", "0.4869493", "0.4868886", "0.48676467", "0.4864715", "0.48487544", "0.483807", "0.48273742", "0.48228368", "0.48135483", "0.48117125", "0.48068035", "0.4806566", "0.4803091", "0.47969592", "0.47950664", "0.47938344", "0.47882348", "0.4785647", "0.47777817", "0.47774053", "0.47692075", "0.47692075", "0.47692075", "0.47668505", "0.4765897", "0.4763793", "0.4763439", "0.47607163", "0.47573757", "0.4753509", "0.47502023" ]
0.5859284
0
Template processing code END
function start_pi_download_process(domain, data) { var process_template_tabid = undefined; //Just some link so that appu content script runs on it. var default_url = 'http://google.com'; //Create a new tab. Once its ready, send message to process the template. chrome.tabs.create({ url: default_url, active: false }, function(tab) { process_template_tabid = tab.id; var my_slave_tab = { tabid: process_template_tabid, 'in_use': true} template_processing_tabs[process_template_tabid] = default_url; //console.log("APPU DEBUG: XXX tabid: " + tab.id + ", value: " + // template_processing_tabs[tab.id]); //Dummy element to wait for HTML fetch var dummy_tab_id = sprintf('tab-%s', process_template_tabid); var dummy_div_str = sprintf('<div id="%s"></div>', dummy_tab_id); var dummy_div = $(dummy_div_str); $('body').append(dummy_div); //Dummy element to wait for SLAVE tab to become free. var wait_dummy_tab_id = sprintf('wait-queue-tab-%s', process_template_tabid); var wait_dummy_div_str = sprintf('<div id="%s"></div>', wait_dummy_tab_id); var wait_dummy_div = $(wait_dummy_div_str); $('body').append(wait_dummy_div); $('#' + dummy_tab_id).on("page-is-loaded", function() { my_slave_tab.in_use = false; $('#' + dummy_tab_id).off("page-is-loaded"); process_template(domain, data, my_slave_tab); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function templateEngine () { }", "\"VElement[name=template]:exit\"(node) {\n const result = builder.build();\n const json = JSON.stringify(result);\n context.report({ node: node, message: json });\n builder.reset();\n }", "function templatePage(req, res, template, block, next) {\n\n // Set any variables\n var myVariable = \"Hello World\";\n\n // Create a content item\n var item = {\n id: \"NA\",\n type: 'content',\n meta: {\n variable: myVariable\n }\n };\n \n // Raise a ping\n calipso.e.custom_emit('TEMPLATE_EVENT','PING',{req:req}, function(options) {\n \n // Render the item via the template provided above\n calipso.theme.renderItem(req, res, template, block, {\n item: item\n },next);\n\n });\n\n \n}", "function shutdown() {\n\t\teasyTemplate = undefined;\n\t}", "onApplyTemplate() {\r\n this.i.ac();\r\n }", "function Freemarker() {}", "function templatePage(req, res, options, next) {\n\n // Set any variables\n var myVariable = \"Hello World\";\n\n // Create a content item\n var item = {\n id: \"NA\",\n type: 'content',\n meta: {\n variable: myVariable\n }\n };\n\n // Raise a ping\n calipso.e.custom_emit('TEMPLATE_EVENT', 'PING', {data:'Hello', pid: process.pid }, function(eventData) {\n\n // Render the item via the template provided above\n calipso.theme.renderItem(req, res, options.templateFn, options.block, {\n item: item,\n options: options\n },next);\n\n });\n\n\n}", "function templateEvent(event, content, next) {\n\n // Content - fires\n console.log('TEMPLATE MODULE received ' + event + \" @ \" + content.title);\n return next();\n\n}", "function END() {}", "end() {\n }", "end() {\n }", "end() { }", "function renderMainTemplate () {\n\n // Render the template\n $el = $.helpers.insertTemplate({\n template: 'endpoint-thread',\n data: options,\n renderTo: $('#endpoint-messaging')\n });\n\n // Bind the form submission to our postMessage method\n $el.find('.em-message').bind('submit', postMessage);\n\n }", "function inlinedTemplates() { }", "exitLiteral(ctx) {\n\t}", "function renderKpccFooterTemplate(){\n getTemplateAjax('static-files/templates/kpcc-footer.handlebars', function(template) {\n jqueryNoConflict('#kpcc-footer').html(template());\n })\n}", "visitTemplate(template) { }", "function templating(){\n\t\tvar lots1 = JSON.parse(window.localStorage.getItem('lots'));\n\t\tvar content = document.getElementById(\"template1\").innerHTML;\n\t\tvar template = Handlebars.compile(content);\n\t\tvar contentData = template(lots1);\n\t\tdocument.getElementById(\"cont_load\").innerHTML += contentData;\n\t\t$('.selling_item').hide();\n\t\t}", "bind(data) {\n this.template = this.template.replace(/\\@{[^{}]+}/g, function(w) {\n w = w.slice(2, -1).trim();\n return data[w] ? data[w] : \"\";\n });\n }", "function templateEvent(event,content,next) {\n \n // Content - fires\n console.log(event + \" @ \" + content.title);\n return next();\n \n}", "function handlerEnd() {\n\tconsole.log(\"at handlerEnd\");\n\t// use the static file server \n\tfile.serve(request, response);\n\t// notice it takes request and response from closure\n }", "function ApplicationTemplatesPage() {\n }", "function finish(env) {\n\tvar rendertime = process.hrtime(env.res.start);\n\tenv._page.rendertime = (new Number(rendertime[0]*1000 + rendertime[1]/1000000)).toFixed(1);\n\tvar meta = env._cmeta;\n\n\tif (meta.error !== null) {\n\t\tsend_error(env);\n\t}\n\telse if (meta.json) {\n\t\tenv.res.send(env._page);\n\t}\n\telse if (meta.redirect) {\n\t\tenv.res.redirect(meta.redirect);\n\t}\n\telse if (meta.template != '') {\n\t\tdust.render(meta.template, env._page, function(err, out) {\n\t\t\tif (err) {\n\t\t\t\tenv.$error(err, 'Unable to process dust template: \"'+meta.template+'\"');\n\t\t\t\tsend_error(env);\n\t\t\t}\n\t\t\telse\n\t\t\t\tenv.res.send(out);\n\t\t});\n\t}\n\telse if (meta.raw) {\n\t\t// Do nothing, because raw output was already supplied earlier in the chain\n\t\tlogger.warn('Raw mode used to handle request. Consider finding and rewriting the offending code!');\n\t}\n\telse {\n\t\tlogger.warn('No output metadata supplied in environment.');\n\t\tenv.res.status(500).send('No output generated.');\n\t}\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn == $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn == $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn == $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn == $.U)\n callAdoptionAgency(p, token);\n\n else if (tn === $.P)\n pEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn == $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n\n else if (tn === $.LI)\n liEndTagInBody(p, token);\n\n else if (tn === $.DD || tn === $.DT)\n ddEndTagInBody(p, token);\n\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\n numberedHeaderEndTagInBody(p, token);\n\n else if (tn === $.BR)\n brEndTagInBody(p, token);\n\n else if (tn === $.EM || tn === $.TT)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG)\n callAdoptionAgency(p, token);\n\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY)\n bodyEndTagInBody(p, token);\n\n else if (tn === $.HTML)\n htmlEndTagInBody(p, token);\n\n else if (tn === $.FORM)\n formEndTagInBody(p, token);\n\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE)\n addressEndTagInBody(p, token);\n\n else if (tn === $.SMALL)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\n addressEndTagInBody(p, token);\n\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n\n else if (tn == $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\n addressEndTagInBody(p, token);\n\n else if (tn === $.MARQUEE)\n appletEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET)\n addressEndTagInBody(p, token);\n\n else if (tn === $.TEMPLATE)\n endTagInHead(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n\n else\n genericEndTagInBody(p, token);\n\n break;\n\n default :\n genericEndTagInBody(p, token);\n }\n}", "render(context) {\n try {\n this.__context = context;\n this.__parent.insertAdjacentHTML('beforeend', footerTemplate(this.__context.data));\n this.__addListeners();\n } catch (err) {\n sentryManager.captureException(err);\n console.log(err.message);\n }\n }", "function complete(){\r\n callbackCount++;\r\n if(callbackCount >= 1){\r\n res.render('browsecustomerorders', context);\r\n }\r\n\r\n }", "function endTagInBody(p, token) {\r\n var tn = token.tagName;\r\n\r\n switch (tn.length) {\r\n case 1:\r\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)\r\n callAdoptionAgency(p, token);\r\n\r\n else if (tn === $.P)\r\n pEndTagInBody(p, token);\r\n\r\n else\r\n genericEndTagInBody(p, token);\r\n\r\n break;\r\n\r\n case 2:\r\n if (tn === $.DL || tn === $.UL || tn === $.OL)\r\n addressEndTagInBody(p, token);\r\n\r\n else if (tn === $.LI)\r\n liEndTagInBody(p, token);\r\n\r\n else if (tn === $.DD || tn === $.DT)\r\n ddEndTagInBody(p, token);\r\n\r\n else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)\r\n numberedHeaderEndTagInBody(p, token);\r\n\r\n else if (tn === $.BR)\r\n brEndTagInBody(p, token);\r\n\r\n else if (tn === $.EM || tn === $.TT)\r\n callAdoptionAgency(p, token);\r\n\r\n else\r\n genericEndTagInBody(p, token);\r\n\r\n break;\r\n\r\n case 3:\r\n if (tn === $.BIG)\r\n callAdoptionAgency(p, token);\r\n\r\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\r\n addressEndTagInBody(p, token);\r\n\r\n else\r\n genericEndTagInBody(p, token);\r\n\r\n break;\r\n\r\n case 4:\r\n if (tn === $.BODY)\r\n bodyEndTagInBody(p, token);\r\n\r\n else if (tn === $.HTML)\r\n htmlEndTagInBody(p, token);\r\n\r\n else if (tn === $.FORM)\r\n formEndTagInBody(p, token);\r\n\r\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\r\n callAdoptionAgency(p, token);\r\n\r\n else if (tn === $.MAIN || tn === $.MENU)\r\n addressEndTagInBody(p, token);\r\n\r\n else\r\n genericEndTagInBody(p, token);\r\n\r\n break;\r\n\r\n case 5:\r\n if (tn === $.ASIDE)\r\n addressEndTagInBody(p, token);\r\n\r\n else if (tn === $.SMALL)\r\n callAdoptionAgency(p, token);\r\n\r\n else\r\n genericEndTagInBody(p, token);\r\n\r\n break;\r\n\r\n case 6:\r\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)\r\n addressEndTagInBody(p, token);\r\n\r\n else if (tn === $.APPLET || tn === $.OBJECT)\r\n appletEndTagInBody(p, token);\r\n\r\n else if (tn === $.STRIKE || tn === $.STRONG)\r\n callAdoptionAgency(p, token);\r\n\r\n else\r\n genericEndTagInBody(p, token);\r\n\r\n break;\r\n\r\n case 7:\r\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)\r\n addressEndTagInBody(p, token);\r\n\r\n else if (tn === $.MARQUEE)\r\n appletEndTagInBody(p, token);\r\n\r\n else\r\n genericEndTagInBody(p, token);\r\n\r\n break;\r\n\r\n case 8:\r\n if (tn === $.FIELDSET)\r\n addressEndTagInBody(p, token);\r\n\r\n else if (tn === $.TEMPLATE)\r\n endTagInHead(p, token);\r\n\r\n else\r\n genericEndTagInBody(p, token);\r\n\r\n break;\r\n\r\n case 10:\r\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\r\n addressEndTagInBody(p, token);\r\n\r\n else\r\n genericEndTagInBody(p, token);\r\n\r\n break;\r\n\r\n default :\r\n genericEndTagInBody(p, token);\r\n }\r\n}", "function end(html, name) {\n html = html.replace(/[\\n,\\r,\\t]/gi, '').replace(/\\\"/gi, '\\\\\"');\n body.push(`\n <script id=${'componet_' + name}>\n bigpipe(\\\"${name}\\\",\\\"${html || \"empty\"}\\\");\n </script>\n `);\n }", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (\n tn === $.A ||\n tn === $.B ||\n tn === $.I ||\n tn === $.S ||\n tn === $.U\n )\n callAdoptionAgency(p, token);\n else if (tn === $.P) pEndTagInBody(p, token);\n else genericEndTagInBody(p, token);\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL)\n addressEndTagInBody(p, token);\n else if (tn === $.LI) liEndTagInBody(p, token);\n else if (tn === $.DD || tn === $.DT) ddEndTagInBody(p, token);\n else if (\n tn === $.H1 ||\n tn === $.H2 ||\n tn === $.H3 ||\n tn === $.H4 ||\n tn === $.H5 ||\n tn === $.H6\n )\n numberedHeaderEndTagInBody(p, token);\n else if (tn === $.BR) brEndTagInBody(p, token);\n else if (tn === $.EM || tn === $.TT) callAdoptionAgency(p, token);\n else genericEndTagInBody(p, token);\n\n break;\n\n case 3:\n if (tn === $.BIG) callAdoptionAgency(p, token);\n else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)\n addressEndTagInBody(p, token);\n else genericEndTagInBody(p, token);\n\n break;\n\n case 4:\n if (tn === $.BODY) bodyEndTagInBody(p, token);\n else if (tn === $.HTML) htmlEndTagInBody(p, token);\n else if (tn === $.FORM) formEndTagInBody(p, token);\n else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)\n callAdoptionAgency(p, token);\n else if (tn === $.MAIN || tn === $.MENU)\n addressEndTagInBody(p, token);\n else genericEndTagInBody(p, token);\n\n break;\n\n case 5:\n if (tn === $.ASIDE) addressEndTagInBody(p, token);\n else if (tn === $.SMALL) callAdoptionAgency(p, token);\n else genericEndTagInBody(p, token);\n\n break;\n\n case 6:\n if (\n tn === $.CENTER ||\n tn === $.FIGURE ||\n tn === $.FOOTER ||\n tn === $.HEADER ||\n tn === $.HGROUP\n )\n addressEndTagInBody(p, token);\n else if (tn === $.APPLET || tn === $.OBJECT)\n appletEndTagInBody(p, token);\n else if (tn === $.STRIKE || tn === $.STRONG)\n callAdoptionAgency(p, token);\n else genericEndTagInBody(p, token);\n\n break;\n\n case 7:\n if (\n tn === $.ADDRESS ||\n tn === $.ARTICLE ||\n tn === $.DETAILS ||\n tn === $.SECTION ||\n tn === $.SUMMARY\n )\n addressEndTagInBody(p, token);\n else if (tn === $.MARQUEE) appletEndTagInBody(p, token);\n else genericEndTagInBody(p, token);\n\n break;\n\n case 8:\n if (tn === $.FIELDSET) addressEndTagInBody(p, token);\n else if (tn === $.TEMPLATE) endTagInHead(p, token);\n else genericEndTagInBody(p, token);\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)\n addressEndTagInBody(p, token);\n else genericEndTagInBody(p, token);\n\n break;\n\n default:\n genericEndTagInBody(p, token);\n }\n }", "function TemplateOutput() {\n\tthis.outputQueue = [];\n}", "function endTagInBody(p, token) {\n const tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U) {\n callAdoptionAgency(p, token);\n } else if (tn === $.P) {\n pEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL) {\n addressEndTagInBody(p, token);\n } else if (tn === $.LI) {\n liEndTagInBody(p, token);\n } else if (tn === $.DD || tn === $.DT) {\n ddEndTagInBody(p, token);\n } else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) {\n numberedHeaderEndTagInBody(p, token);\n } else if (tn === $.BR) {\n brEndTagInBody(p, token);\n } else if (tn === $.EM || tn === $.TT) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 3:\n if (tn === $.BIG) {\n callAdoptionAgency(p, token);\n } else if (tn === $.DIR || tn === $.DIV || tn === $.NAV || tn === $.PRE) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 4:\n if (tn === $.BODY) {\n bodyEndTagInBody(p, token);\n } else if (tn === $.HTML) {\n htmlEndTagInBody(p, token);\n } else if (tn === $.FORM) {\n formEndTagInBody(p, token);\n } else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR) {\n callAdoptionAgency(p, token);\n } else if (tn === $.MAIN || tn === $.MENU) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 5:\n if (tn === $.ASIDE) {\n addressEndTagInBody(p, token);\n } else if (tn === $.SMALL) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 6:\n if (\n tn === $.CENTER ||\n tn === $.FIGURE ||\n tn === $.FOOTER ||\n tn === $.HEADER ||\n tn === $.HGROUP ||\n tn === $.DIALOG\n ) {\n addressEndTagInBody(p, token);\n } else if (tn === $.APPLET || tn === $.OBJECT) {\n appletEndTagInBody(p, token);\n } else if (tn === $.STRIKE || tn === $.STRONG) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 7:\n if (\n tn === $.ADDRESS ||\n tn === $.ARTICLE ||\n tn === $.DETAILS ||\n tn === $.SECTION ||\n tn === $.SUMMARY ||\n tn === $.LISTING\n ) {\n addressEndTagInBody(p, token);\n } else if (tn === $.MARQUEE) {\n appletEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 8:\n if (tn === $.FIELDSET) {\n addressEndTagInBody(p, token);\n } else if (tn === $.TEMPLATE) {\n endTagInHead(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n default:\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n const tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U) {\n callAdoptionAgency(p, token);\n } else if (tn === $.P) {\n pEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL) {\n addressEndTagInBody(p, token);\n } else if (tn === $.LI) {\n liEndTagInBody(p, token);\n } else if (tn === $.DD || tn === $.DT) {\n ddEndTagInBody(p, token);\n } else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) {\n numberedHeaderEndTagInBody(p, token);\n } else if (tn === $.BR) {\n brEndTagInBody(p, token);\n } else if (tn === $.EM || tn === $.TT) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 3:\n if (tn === $.BIG) {\n callAdoptionAgency(p, token);\n } else if (tn === $.DIR || tn === $.DIV || tn === $.NAV || tn === $.PRE) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 4:\n if (tn === $.BODY) {\n bodyEndTagInBody(p, token);\n } else if (tn === $.HTML) {\n htmlEndTagInBody(p, token);\n } else if (tn === $.FORM) {\n formEndTagInBody(p, token);\n } else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR) {\n callAdoptionAgency(p, token);\n } else if (tn === $.MAIN || tn === $.MENU) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 5:\n if (tn === $.ASIDE) {\n addressEndTagInBody(p, token);\n } else if (tn === $.SMALL) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 6:\n if (\n tn === $.CENTER ||\n tn === $.FIGURE ||\n tn === $.FOOTER ||\n tn === $.HEADER ||\n tn === $.HGROUP ||\n tn === $.DIALOG\n ) {\n addressEndTagInBody(p, token);\n } else if (tn === $.APPLET || tn === $.OBJECT) {\n appletEndTagInBody(p, token);\n } else if (tn === $.STRIKE || tn === $.STRONG) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 7:\n if (\n tn === $.ADDRESS ||\n tn === $.ARTICLE ||\n tn === $.DETAILS ||\n tn === $.SECTION ||\n tn === $.SUMMARY ||\n tn === $.LISTING\n ) {\n addressEndTagInBody(p, token);\n } else if (tn === $.MARQUEE) {\n appletEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 8:\n if (tn === $.FIELDSET) {\n addressEndTagInBody(p, token);\n } else if (tn === $.TEMPLATE) {\n endTagInHead(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n default:\n genericEndTagInBody(p, token);\n }\n}", "function endTagInBody(p, token) {\n const tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U) {\n callAdoptionAgency(p, token);\n } else if (tn === $.P) {\n pEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL) {\n addressEndTagInBody(p, token);\n } else if (tn === $.LI) {\n liEndTagInBody(p, token);\n } else if (tn === $.DD || tn === $.DT) {\n ddEndTagInBody(p, token);\n } else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) {\n numberedHeaderEndTagInBody(p, token);\n } else if (tn === $.BR) {\n brEndTagInBody(p, token);\n } else if (tn === $.EM || tn === $.TT) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 3:\n if (tn === $.BIG) {\n callAdoptionAgency(p, token);\n } else if (tn === $.DIR || tn === $.DIV || tn === $.NAV || tn === $.PRE) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 4:\n if (tn === $.BODY) {\n bodyEndTagInBody(p, token);\n } else if (tn === $.HTML) {\n htmlEndTagInBody(p, token);\n } else if (tn === $.FORM) {\n formEndTagInBody(p, token);\n } else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR) {\n callAdoptionAgency(p, token);\n } else if (tn === $.MAIN || tn === $.MENU) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 5:\n if (tn === $.ASIDE) {\n addressEndTagInBody(p, token);\n } else if (tn === $.SMALL) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 6:\n if (\n tn === $.CENTER ||\n tn === $.FIGURE ||\n tn === $.FOOTER ||\n tn === $.HEADER ||\n tn === $.HGROUP ||\n tn === $.DIALOG\n ) {\n addressEndTagInBody(p, token);\n } else if (tn === $.APPLET || tn === $.OBJECT) {\n appletEndTagInBody(p, token);\n } else if (tn === $.STRIKE || tn === $.STRONG) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 7:\n if (\n tn === $.ADDRESS ||\n tn === $.ARTICLE ||\n tn === $.DETAILS ||\n tn === $.SECTION ||\n tn === $.SUMMARY ||\n tn === $.LISTING\n ) {\n addressEndTagInBody(p, token);\n } else if (tn === $.MARQUEE) {\n appletEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 8:\n if (tn === $.FIELDSET) {\n addressEndTagInBody(p, token);\n } else if (tn === $.TEMPLATE) {\n endTagInHead(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n default:\n genericEndTagInBody(p, token);\n }\n}", "function EndofPrompts() {\r\n fs.writeFileSync(genFilePath, \"\");\r\n let markupData = genStartHtml();\r\n\r\n for (var a in staff) {\r\n markupData += staffHtml(staff[a]);\r\n }\r\n markupData += genFinalHtml();\r\n fs.writeFileSync(genFilePath, markupData);\r\n\r\n }", "function endTagInBody(p, token) {\n var tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U) {\n callAdoptionAgency(p, token);\n } else if (tn === $.P) {\n pEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL) {\n addressEndTagInBody(p, token);\n } else if (tn === $.LI) {\n liEndTagInBody(p, token);\n } else if (tn === $.DD || tn === $.DT) {\n ddEndTagInBody(p, token);\n } else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) {\n numberedHeaderEndTagInBody(p, token);\n } else if (tn === $.BR) {\n brEndTagInBody(p, token);\n } else if (tn === $.EM || tn === $.TT) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 3:\n if (tn === $.BIG) {\n callAdoptionAgency(p, token);\n } else if (tn === $.DIR || tn === $.DIV || tn === $.NAV || tn === $.PRE) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 4:\n if (tn === $.BODY) {\n bodyEndTagInBody(p, token);\n } else if (tn === $.HTML) {\n htmlEndTagInBody(p, token);\n } else if (tn === $.FORM) {\n formEndTagInBody(p, token);\n } else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR) {\n callAdoptionAgency(p, token);\n } else if (tn === $.MAIN || tn === $.MENU) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 5:\n if (tn === $.ASIDE) {\n addressEndTagInBody(p, token);\n } else if (tn === $.SMALL) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 6:\n if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP || tn === $.DIALOG) {\n addressEndTagInBody(p, token);\n } else if (tn === $.APPLET || tn === $.OBJECT) {\n appletEndTagInBody(p, token);\n } else if (tn === $.STRIKE || tn === $.STRONG) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 7:\n if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY || tn === $.LISTING) {\n addressEndTagInBody(p, token);\n } else if (tn === $.MARQUEE) {\n appletEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 8:\n if (tn === $.FIELDSET) {\n addressEndTagInBody(p, token);\n } else if (tn === $.TEMPLATE) {\n endTagInHead(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n default:\n genericEndTagInBody(p, token);\n }\n}", "function renderDataFooterTemplate(){\n getTemplateAjax('static-files/templates/data-footer.handlebars', function(template) {\n jqueryNoConflict('#data-footer').html(template());\n })\n}", "function i18nEnd(){var tView=getLView()[TVIEW];ngDevMode&&assertDefined(tView,\"tView should be defined\");i18nEndFirstPass(tView);}", "_onEnd() {}", "function endTagInBody(p, token) {\n const tn = token.tagName;\n\n switch (tn.length) {\n case 1:\n if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U) {\n callAdoptionAgency(p, token);\n } else if (tn === $.P) {\n pEndTagInBody(p);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 2:\n if (tn === $.DL || tn === $.UL || tn === $.OL) {\n addressEndTagInBody(p, token);\n } else if (tn === $.LI) {\n liEndTagInBody(p);\n } else if (tn === $.DD || tn === $.DT) {\n ddEndTagInBody(p, token);\n } else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) {\n numberedHeaderEndTagInBody(p);\n } else if (tn === $.BR) {\n brEndTagInBody(p);\n } else if (tn === $.EM || tn === $.TT) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 3:\n if (tn === $.BIG) {\n callAdoptionAgency(p, token);\n } else if (tn === $.DIR || tn === $.DIV || tn === $.NAV || tn === $.PRE) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 4:\n if (tn === $.BODY) {\n bodyEndTagInBody(p);\n } else if (tn === $.HTML) {\n htmlEndTagInBody(p, token);\n } else if (tn === $.FORM) {\n formEndTagInBody(p);\n } else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR) {\n callAdoptionAgency(p, token);\n } else if (tn === $.MAIN || tn === $.MENU) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 5:\n if (tn === $.ASIDE) {\n addressEndTagInBody(p, token);\n } else if (tn === $.SMALL) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 6:\n if (\n tn === $.CENTER ||\n tn === $.FIGURE ||\n tn === $.FOOTER ||\n tn === $.HEADER ||\n tn === $.HGROUP ||\n tn === $.DIALOG\n ) {\n addressEndTagInBody(p, token);\n } else if (tn === $.APPLET || tn === $.OBJECT) {\n appletEndTagInBody(p, token);\n } else if (tn === $.STRIKE || tn === $.STRONG) {\n callAdoptionAgency(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 7:\n if (\n tn === $.ADDRESS ||\n tn === $.ARTICLE ||\n tn === $.DETAILS ||\n tn === $.SECTION ||\n tn === $.SUMMARY ||\n tn === $.LISTING\n ) {\n addressEndTagInBody(p, token);\n } else if (tn === $.MARQUEE) {\n appletEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 8:\n if (tn === $.FIELDSET) {\n addressEndTagInBody(p, token);\n } else if (tn === $.TEMPLATE) {\n endTagInHead(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n case 10:\n if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) {\n addressEndTagInBody(p, token);\n } else {\n genericEndTagInBody(p, token);\n }\n\n break;\n\n default:\n genericEndTagInBody(p, token);\n }\n}", "function after_loop()\n {\n disable_buttons(); //Disable control buttons.\n display_output($result); //Display output based on the result; Error or Accept\n }", "exitImportSection(ctx) {\n\t}", "exitParagraph(ctx) {\n\t}", "function i18nEnd() {\n var tView = getLView()[TVIEW];\n ngDevMode && assertDefined(tView, \"tView should be defined\");\n i18nEndFirstPass(tView);\n}", "function i18nEnd() {\n var tView = getLView()[TVIEW];\n ngDevMode && assertDefined(tView, \"tView should be defined\");\n i18nEndFirstPass(tView);\n}", "function nextTemplateToken() {\n state.tokens.push(new Token());\n state.start = state.pos;\n readTmplToken();\n}", "function renderStartTemplate(){\r\n console.log(\"renderStartTemplate ran\")\r\n const startTemplateString = startTemplate();\r\n $('main').html(startTemplateString); \r\n}", "function templateLoaded() {\n setUpStars();\n checkIfReserved();\n $('.breadcrumb-end').html($('.info h2').html());\n}", "endGroup() {\n this.macros.endGroup();\n }", "function renderStaticTpl() {\n\t\t$(\"#from-text-span\").html($.localise.tr(\"From\"));\n\t\t$(\"#to-text-span\").html($.localise.tr(\"To\"));\n\t\t$(\"#execute-btn\").val($.localise.tr(\"OK\"));\n\n\t\t$(\"#page\").html($.localise.tr(\"Page&nbsp;\"));\n\t\t$(\"#of\").html($.localise.tr(\"&nbsp;of&nbsp;\"));\n\n\t\t$(\"#print-btn\").val($.localise.tr(\"Print\"));\n\t}", "template() { }", "function processTemplate(template, model) {\n\n // Establish the current \"view\" model\n template.view = bindView(template.root.scripts, model, template.dom);\n\n var replace = [];\n\n // Loop over the template constructs\n for (var i = 0; i < template.dom.children.length; i++) {\n\n // Acces the child\n var child = template.dom.children[i];\n\n // Access the node name\n var name = getNodeName(child);\n\n // Process the construct node types\n if (name == \"IF\")\n replace.push({ p: child.parentNode, r: child, w: processIF(template, child) });\n else if (name == \"FOR\")\n replace.push({ p: child.parentNode, r: child, w: processFOR(template, child) });\n else if (name == \"WITH\")\n replace.push({ p: child.parentNode, r: child, w: processWITH(template, child) });\n else if (hasTemplateContent(child) == true) {\n\n // Evaluate the template with the array object instance and add the result to the \"add\" collection\n child.innerHTML = processTemplate(openSubTemplate(child, template), template.view);\n\n }\n\n }\n\n // Replace the nodes\n for (var ri = 0; ri < replace.length; ri++)\n replaceNode(replace[ri].p, replace[ri].r, replace[ri].w);\n\n // Access the \"raw\" html template\n var html = template.dom.innerHTML;\n\n // Loop over the \"code\" snipptes processing\n for (var codeID in template.root.code) {\n\n // If the text contains the code,\n if (html.indexOf(codeID) >= 0) {\n\n // Access the \"code\"\n var code = template.root.code[codeID];\n\n // Trim the { and }\n code = code.substring(1, code.length - 1);\n\n // Replace with the value\n html = replaceKey(html, codeID, (new Function(code)).call(template.view));\n\n }\n\n }\n\n // Loop over the \"property\" processing\n for (var propertyID in template.root.properties) {\n\n // If the text contains the property,\n if (html.indexOf(propertyID) >= 0) {\n\n // Access the \"property\"\n var property = template.root.properties[propertyID];\n\n // Trim the [ and ] and whitespace\n property = property.substring(1, property.length - 1).trim();\n\n // Replace with the value\n if (property == \"#\")\n html = replaceKey(html, propertyID, template.index);\n else if (property == \"##\")\n html = replaceKey(html, propertyID, template.count);\n else if (property == \"$\")\n html = replaceKey(html, propertyID, template.str);\n else\n html = replaceKey(html, propertyID, parseValue(template.view, property));\n\n }\n\n }\n\n // Replace all \"src\" and \"href\" references\n html = replaceAll(html, \"_src\", \"src\", true);\n html = replaceAll(html, \"_href\", \"href\", true);\n\n // Return\n return html;\n\n }", "exitRdfLiteral(ctx) {\n\t}", "function tagCleanup() {\n\n\t}", "function ɵɵi18nEnd() {\n setInI18nBlock(false);\n }", "function done(err, srcOrTemplate) {\n var template;\n if (err) {\n return chunk.setError(err);\n }\n // Prefer a template that is passed via callback over the cached version.\n template = getTemplate(srcOrTemplate, false) || getTemplate(name, dust.config.cache);\n if (!template) {\n // It's a template string, compile it and register under `name`\n if (dust.compile) {\n template = dust.loadSource(dust.compile(srcOrTemplate, name));\n } else {\n return chunk.setError(new Error('Dust compiler not available'));\n }\n }\n template(chunk, Context.wrap(context, template.templateName)).end();\n }", "static get template() {\n return '<!--empty-->';\n }", "function nextTemplateToken() {\n _base.state.tokens.push(new Token());\n _base.state.start = _base.state.pos;\n readTmplToken();\n}", "exitMacro(ctx) {\n\t}", "exitImportDefinition(ctx) {\n\t}", "function readTmplToken() {\n for (;;) {\n if (_base.state.pos >= _base.input.length) {\n _util.unexpected.call(void 0, \"Unterminated template\");\n return;\n }\n const ch = _base.input.charCodeAt(_base.state.pos);\n if (\n ch === _charcodes.charCodes.graveAccent ||\n (ch === _charcodes.charCodes.dollarSign && _base.input.charCodeAt(_base.state.pos + 1) === _charcodes.charCodes.leftCurlyBrace)\n ) {\n if (_base.state.pos === _base.state.start && match(_types.TokenType.template)) {\n if (ch === _charcodes.charCodes.dollarSign) {\n _base.state.pos += 2;\n finishToken(_types.TokenType.dollarBraceL);\n return;\n } else {\n ++_base.state.pos;\n finishToken(_types.TokenType.backQuote);\n return;\n }\n }\n finishToken(_types.TokenType.template);\n return;\n }\n if (ch === _charcodes.charCodes.backslash) {\n _base.state.pos++;\n }\n _base.state.pos++;\n }\n}", "function displayLastSaleTable(data) {\n //takes template and populate it with passed array\n var rawTemplate = document.getElementById(\"lastSaleTemplate\").innerHTML;\n var compiledTemplate = Handlebars.compile(rawTemplate);\n var loggTableGeneratedHTML = compiledTemplate(data);\n // display template in choosen ID tag\n var loggContainer = document.getElementById(\"lastSaleContainer\");\n loggContainer.innerHTML = loggTableGeneratedHTML;\n}", "clearSeparators() {\n // empty template\n }", "function configureTemplates(e) {\nvar bpfn = 'boilerplate.tpl';\n\n\te.templatipi = {};\t\t\t\t\t\t// start with an empty templatipi object\n e.skeletipi = {};\n\n\tfs.readFile(__dirname + '/' + bpfn, function (err, data) {\t//read in the file contents\n\t\tif (err) { throw err; }\n\n\t\te.templatipi[bpfn] = String(data).replace(/\\{\\{APP\\}\\}/g, e.appname)\n\t\t\t\t\t.replace(/\\{\\{STATIC\\}\\}/g, \"http://\" + e.staticurl + \"/\");\n\n populatipi(e, e.dir + '/templates/baseplates', 'templatipi', // load all base- templates into memory\n\t\t\tfunction(){ populatipi(e, e.dir + '/templates/skeleta', 'skeletipi',\t\t// load all skeleta into memory\n\t\t\t\tfunction(){\n\t\t\t\tvar txt;\n\t\t\t\t\tfor (i in e.skeletipi) {\n\t\t\t\t\t\ttxt = (e.templatipi[i] = e.skeletipi[i]);\n\t\t\t\t\t\ttxt = txt.replace(/[\\t\\n\\r]/g, ' ');\n\t\t\t\t\t\te.skeletipi[i] = txt.replace(/'/g, \"\\\\'\");\n\t\t\t\t\t}\n\t\t\t\t\ttxt = JSON.stringify(e.skeletipi);\n\t\t\t\t\ttxt = txt.replace(/\\\\\\\\\\'/g, \"\\\\'\");\n\t\t\t\t\te.scriptplatestring = \"var swxmodeskeleta = JSON.parse(\\'\" + txt + \"\\');\\n\\n\";\n\t\t\t\t\tgenericDynamicLoadAppFiles(e, \"js\", \"scriptplatestring\",\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\te.cssstring = \"\";\n\t\t\t\t\t\t\tgenericDynamicLoadAppFiles(e, \"css\", \"cssstring\");\n\t\t\t\t\t\t});\n\n\t\t\t\t});\n\t\t\t});\n\t});\n\n\n\te.respond = function(){\t\t\t\t\t\t\t// respond calls the basic welder with this env.\n\t\t\tvar args = [this.templatipi];\n\t\t\tfor (i=0; i<arguments.length; i++)\n\t\t\t\targs.push(arguments[i]);\n\t\t\tswxmo.respond.apply(this, args);\n\t\t};\n}", "function displayTemplate(){\n\t//var glueFrame = Mustache.render(tplContent,data);// alternative version with just one template\n\tvar glueFrame = Mustache.render(tplFrame,data,partials);//ADD for template\n\ttarget.html(glueFrame);// ADD for template\n}", "function complete(){\r\n callbackCount++;\r\n if(callbackCount >= 3){\t\t\t\t//CHANGE IF FUNCTIONS BEING CALLED CHANGES!!\r\n res.render('search_topic', context);\r\n }\r\n\r\n }", "getFooter(mainFileName) {\n const ret =\n `files.exit = () => {\\n` +\n ` core.exit();\\n` +\n `};\\n` +\n `if (!isDryRun){ files['${mainFileName}'](); }\\n` +\n `return { files, scope }\\n` +\n `}`;\n return ret;\n }", "function renderTemplate(layout,template,data) {\n //Get our primary template\n var tpl = grace.read(\"grace/views/\"+template+\".html\");\n var finalTemplate = tpl;\n var replacements = {\n main:tpl\n };\n \n //look for content for our yield\n var replacementRegex = /::[^\\s].*[^\\s]::/g;\n var tokens = tpl.match(replacementRegex);\n \n //If we have any content to replace in a layout, let's capture them\n if (tokens) {\n for (var i = 0; i < tokens.length; i++) {\n var tkn = tokens[i];\n var idx = tpl.indexOf(tkn);\n if (i == 0) {\n replacements.main = tpl.substring(0,idx);\n }\n //Grab the appropriate substring to replace in a layout\n if (i+1 == tokens.length) {\n replacements[tokens[i].replace(/:/g,\"\")] = tpl.substring(idx+tkn.length);\n }\n else {\n replacements[tokens[i].replace(/:/g,\"\")] = tpl.substring(idx+tkn.length,tpl.indexOf(tokens[i+1]));\n }\n }\n }\n \n //now, let's grab our layout (if we have one)\n if (layout != \"\") {\n var layoutTemplate = grace.read(\"grace/views/layouts/\"+layout+\".html\");\n //If we have any content to replace in a layout, let's replace\n grace.each(replacements,function(value,key) {\n layoutTemplate = layoutTemplate.replace(\"::\"+key+\"::\",value);\n });\n //replace any unused ::*:: placeholders\n finalTemplate = layoutTemplate.replace(replacementRegex,\"\");\n }\n \n //finally, render our template\n grace.info(\"grace.render: rendering template: \"+template);\n grace.respond(grace.template(finalTemplate,data),\"text/html\",200);\n }", "scanTemplateElement() {\n\t let startLocation = this.getLocation();\n\t let start = this.index;\n\t while (this.index < this.source.length) {\n\t let ch = this.source.charCodeAt(this.index);\n\t switch (ch) {\n\t case 0x60:\n\t {\n\t // `\n\t // don't include the traling \"`\"\n\t let slice = this.getSlice(start, startLocation);\n\t this.index++;\n\t return {\n\t type: _tokenizer.TokenType.TEMPLATE,\n\t tail: true,\n\t interp: false,\n\t slice: slice\n\t };\n\t }\n\t case 0x24:\n\t // $\n\t if (this.source.charCodeAt(this.index + 1) === 0x7B) {\n\t // {\n\t // don't include the trailing \"$\"\n\t let slice = this.getSlice(start, startLocation);\n\t this.index += 1;\n\t return {\n\t type: _tokenizer.TokenType.TEMPLATE,\n\t tail: false,\n\t interp: true,\n\t slice: slice\n\t };\n\t }\n\t this.index++;\n\t break;\n\t case 0x5C:\n\t // \\\\\n\t {\n\t let octal = this.scanStringEscape(\"\", null)[1];\n\t if (octal != null) {\n\t throw this.createILLEGAL();\n\t }\n\t break;\n\t }\n\t default:\n\t this.index++;\n\t }\n\t }\n\n\t throw this.createILLEGAL();\n\t }", "_page_clear(){\r\n\t\tvar core = this;\r\n\t\tcore._app_templates = [];\r\n\t}", "_render() {}", "exitDirective(ctx) {\n\t}", "function TMP() {\n return;\n }", "function complete() {\n callbackCount++;\n if(callbackCount >= 2) {\n res.render('charactersInFilms', context);\n }\n }", "_template_output(_atname, _abuffer = false){\r\n\t\tvar core = this;\r\n\r\n\t\t// Embed constant variable before printing\r\n\t\tif(_abuffer == true){\r\n\t\t\treturn core._app_templates_buffer[_atname];\r\n\t\t} else {\r\n\t\t\treturn core._app_templates[_atname];\r\n\t\t}\r\n\t}", "function displayAllLastSaleTable(data) {\n //takes template and populate it with passed array\n var rawTemplate = document.getElementById(\"allLastSaleTemplate\").innerHTML;\n var compiledTemplate = Handlebars.compile(rawTemplate);\n var loggTableGeneratedHTML = compiledTemplate(data);\n // display template in choosen ID tag\n var loggContainer = document.getElementById(\"allLastSaleContainer\");\n loggContainer.innerHTML = loggTableGeneratedHTML;\n}", "function reload() {\n calipso.log(\"Template module reloaded\");\n}", "function reload() {\n calipso.log(\"Template module reloaded\");\n}", "function _generateFooterReport() {\n\t\n\n\tthis.htmlFile.writeln( \"</body>\");\n\tthis.htmlFile.writeln( \"</html>\");\n}", "function preProcessTemplate(template) {\n\n // Generate the ID base\n var baseid = (new Date()).getTime();\n\n // Establish the template \"lookup\"\n template.properties = new Object();\n template.scripts = new Object();\n template.code = new Object();\n template.conditions = new Object();\n template.wheres = new Object();\n\n // Establish the pre-processed\n template.pre = template.raw;\n\n // Indexes used for parsing\n var begin, end;\n\n // Loop over all the script segements\n while ((begin = template.pre.indexOf('{{')) >= 0) {\n\n // Generate a new key\n var key = '_k1_' + (baseid++).toString();\n\n // Determine the end\n end = template.pre.indexOf('}}', begin);\n\n // Extract the script\n var script = template.pre.slice(begin, end + 1);\n\n // Return the string with the item replaced\n template.pre = [template.pre.slice(0, begin), key, template.pre.slice(end + 2)].join('');\n\n // Add the property into the lookup\n template.scripts[key] = script.trim();\n\n }\n\n // Loop over all the property segments\n while ((begin = template.pre.indexOf('[')) >= 0) {\n\n // Generate a new key\n var key = '_k1_' + (baseid++).toString();\n\n // Determine the end\n end = template.pre.indexOf(']', begin);\n\n // Extract the property\n var property = template.pre.slice(begin, end + 1);\n\n // Return the string with the item replaced\n template.pre = [template.pre.slice(0, begin), key, template.pre.slice(end + 1)].join('');\n\n // Add the property into the lookup\n template.properties[key] = property.trim();\n\n }\n\n // Loop over all the free-code segments\n while ((begin = template.pre.indexOf('{')) >= 0) {\n\n // Generate a new key\n var key = '_k1_' + (baseid++).toString();\n\n // Determine the end\n end = template.pre.indexOf('}', begin);\n\n // Extract the property\n var code = template.pre.slice(begin, end + 1);\n\n // Return the string with the item replaced\n template.pre = [template.pre.slice(0, begin), key, template.pre.slice(end + 1)].join('');\n\n // Add the property into the lookup\n template.code[key] = code.trim();\n\n }\n\n // Define parse function\n this.parsePropCodes = function (name) {\n\n var codes = new Object();\n\n begin = 0;\n\n // Loop over all the condition=\n while ((begin = template.pre.indexOf(name, begin)) >= 0) {\n\n // Move past the whitespace\n while ((isWhitespace(template.pre.charAt(begin)) == false) && (template.pre.charAt(begin) != \"=\"))\n begin++;\n\n // Move past the whitespace\n while (isWhitespace(template.pre.charAt(begin)) == true)\n begin++;\n\n // If we hit an =\n if (template.pre.charAt(begin) == \"=\") {\n\n // Increment\n begin++;\n\n // Move past the whitespace\n while (isWhitespace(template.pre.charAt(begin)) == true)\n begin++;\n\n // If we hit a ' or \"\n if ((template.pre.charAt(begin) == \"\\\"\") || (template.pre.charAt(begin) == \"\\'\")) {\n\n // Get the break\n var brk = template.pre.charAt(begin);\n\n // Increment\n begin++;\n\n // Determine the end\n end = template.pre.indexOf(brk, begin);\n\n // Generate a new key\n var key = '_k1_' + (baseid++).toString();\n\n // Extract the snippet\n var code = template.pre.slice(begin, end);\n\n // Return the string with the item replaced\n template.pre = [template.pre.slice(0, begin), key, template.pre.slice(end)].join('');\n\n // Add the property into the lookup\n codes[key] = code.trim();\n\n }\n\n }\n\n }\n\n // Return\n return codes;\n\n }\n\n // Define parse \"special\" function\n this.parseSpecialElements = function (name) {\n\n begin = 0;\n\n // Loop over all the condition=\n while ((begin = template.pre.indexOf('<', begin)) >= 0) {\n\n var start = begin;\n var tag = '';\n var isclose = false;\n\n // Increment\n begin++;\n\n // Move past the whitespace\n while (isWhitespace(template.pre.charAt(begin)) == true)\n begin++;\n\n // Determine if this is a close tag\n if (template.pre.charAt(begin) == '/') {\n begin++;\n isclose = true;\n }\n\n // Move past the whitespace\n while (isWhitespace(template.pre.charAt(begin)) == true)\n begin++;\n\n // Parse the tag\n while ((isWhitespace(template.pre.charAt(begin)) == false) && (template.pre.charAt(begin) != '>')) {\n tag += template.pre.charAt(begin);\n begin++;\n }\n\n // If the tag matches the name\n if (tag.toLowerCase() == name.toLowerCase()) {\n\n // Replace the tag\n template.pre = [template.pre.slice(0, start), '<' + ((isclose == true) ? '/' : '') + 'div _ktype=\"' + name.toUpperCase() + '\"', template.pre.slice(begin)].join('');\n\n }\n\n }\n\n // Return\n return;\n\n }\n\n // Replace \"condition\" and \"where\"\n template.conditions = this.parsePropCodes(\"condition\");\n template.wheres = this.parsePropCodes(\"where\");\n\n // Replace the \"special\" elements\n this.parseSpecialElements('if');\n this.parseSpecialElements('elseif');\n this.parseSpecialElements('else');\n this.parseSpecialElements('for');\n this.parseSpecialElements('with');\n this.parseSpecialElements('nth');\n this.parseSpecialElements('first');\n this.parseSpecialElements('last');\n\n // Replace all \"src\" and \"href\" references\n template.pre = replaceAll(template.pre, \"src\", \"_src\", true);\n template.pre = replaceAll(template.pre, \"href\", \"_href\", true);\n\n // Wrap the pre-processed template\n template.pre = '<div>' + template.pre + '</div>';\n\n // Return\n return template;\n\n }", "function buildEnd(options) {\n html += `</main>\n\n <footer>\n <p>Copyright info?</p>\n </footer>\n </body>\n </html>`\n}", "parseTemplates() {\n var self = this;\n var templates = this.view.find('[data-view-templates]');\n templates.find('[data-view-template-wrapper]').each(function(){\n var twrapper = $(this);\n self.templates[twrapper.data('view-template-name')] = twrapper.html();\n })\n .remove();\n }", "function sc_EOF() {\n}", "exitFor_stmt(ctx) {\n\t}", "exitBlock(ctx) {\n\t}", "function createTemplateValue(start, end) {\n var value = \"\";\n while (start <= end) {\n if (tokens[start].value) {\n value += tokens[start].value;\n } else if (tokens[start].type !== tt.template) {\n value += tokens[start].type.label;\n }\n start++;\n }\n return value;\n }", "compileAll() {\n\t\tconst options = this.options\n\t\tfor (let template of this.templates) {\n\t\t\tlet code = ejs.compile(template.source, {\n\t\t\t\tclient: true,\n\t\t\t\t_with: false,\n\t\t\t\tlocalsName: 'data',\n\t\t\t\tasync: !!options.async,\n\t\t\t\tdelimiter: options.delimiter ? options.delimiter : '%',\n\t\t\t\topenDelimiter: options.openDelimiter ? options.openDelimiter : '<',\n\t\t\t\tcloseDelimiter: options.closeDelimiter ? options.closeDelimiter : '>',\n\t\t\t})\n\t\t\ttemplate.code = code.toString()\n\t\t}\n\t}", "function devTools(req, res, template, block, next) {\n\n calipso.theme.renderItem(req, res, template, block, {blocks:res.renderedBlocks},next);\n\n}", "template() {\n return '';\n }" ]
[ "0.6270733", "0.6256593", "0.6012496", "0.5819999", "0.58072686", "0.5780257", "0.5702037", "0.5698193", "0.56741583", "0.5664723", "0.5664723", "0.56235194", "0.5623119", "0.559801", "0.5552621", "0.5542879", "0.55408096", "0.554058", "0.551069", "0.5506277", "0.55061495", "0.5496138", "0.54954517", "0.548661", "0.548661", "0.548661", "0.548661", "0.548661", "0.548661", "0.548661", "0.548661", "0.548661", "0.548661", "0.548661", "0.548661", "0.5484845", "0.5484845", "0.54748034", "0.547283", "0.54690427", "0.54474753", "0.5446583", "0.54331464", "0.5415586", "0.5415586", "0.5415586", "0.5414675", "0.5407754", "0.54069483", "0.5402311", "0.5400885", "0.53893423", "0.53877115", "0.53713554", "0.5345254", "0.53244823", "0.53244823", "0.532315", "0.5306673", "0.53010917", "0.52824455", "0.52796525", "0.52759373", "0.52741367", "0.527265", "0.526767", "0.5253928", "0.52529746", "0.52505654", "0.5233672", "0.52234656", "0.5222136", "0.5222129", "0.52127975", "0.51997066", "0.51990986", "0.51936394", "0.5193442", "0.51851684", "0.51808524", "0.51798433", "0.51766634", "0.5164701", "0.5163008", "0.51582485", "0.5158089", "0.5155267", "0.5151006", "0.51465327", "0.51465327", "0.51434636", "0.5140443", "0.5132479", "0.51269096", "0.5125299", "0.5116748", "0.51114696", "0.5108606", "0.51070446", "0.5100265", "0.50973934" ]
0.0
-1
This is older code when FPI fetching occurred everytime form server. This code has been replaced now as FPIs are stored along with extension.
function fetch_fpi_template_from_server(domain) { wr = {}; wr.command = 'get_template'; wr.domain = domain; try { $.post("http://appu.gtnoise.net:5005/get_template", JSON.stringify(wr), function(data) { pii_vault.aggregate_data.per_site_pi[domain].attempted_download_time = new Date(); flush_selective_entries("aggregate_data", ["per_site_pi"]); if (data.toString() != 'No template present') { console.log("APPU DEBUG: Got the template for: " + domain); // We are here that means template is present. // Attempt to fetch the PI if user has already approved it. if ('user_approved' in pii_vault.aggregate_data.per_site_pi[domain]) { if (pii_vault.aggregate_data.per_site_pi[domain].user_approved == 'always') { //We are here, that means user has given PI download approval for this site start_pi_download_process(domain, data); return; } else if (pii_vault.aggregate_data.per_site_pi[domain].user_approved == 'never') { console.log("APPU DEBUG: User has already set NEVER for PI on this domain: " + domain); return; } } //We are here, that means that we have to seek permission from user to download PI for //this site. chrome.tabs.sendMessage(sender_tab_id, { 'type' : "get-permission-to-fetch-pi", 'site' : domain, }, function(response) { if (response.fetch_pi_permission == "always") { pii_vault.aggregate_data.per_site_pi[domain].user_approved = 'always'; flush_selective_entries("aggregate_data", ["per_site_pi"]); start_pi_download_process(domain, data); } else if (response.fetch_pi_permission == "just-this-time") { pii_vault.aggregate_data.per_site_pi[domain].user_approved = 'seek-permission'; flush_selective_entries("aggregate_data", ["per_site_pi"]); start_pi_download_process(domain, data); } else if (response.fetch_pi_permission == "never") { pii_vault.aggregate_data.per_site_pi[domain].user_approved = 'never'; flush_selective_entries("aggregate_data", ["per_site_pi"]); console.log("APPU DEBUG: User set NEVER for PI on this domain: " + domain); } }); } else { print_appu_error("Appu Error: FPI Template for domain(" + domain + ") is not present on the server"); } }) .error(function(domain) { return function(data, status) { print_appu_error("Appu Error: Service down, attempted to fetch template: " + domain + ", " + status.toString() + " @ " + (new Date())); console.log("APPU DEBUG: Service down, attempted to fetch:" + domain); } } (domain)); } catch (e) { console.log("Error: while fetching template(" + domain + ") from server"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fxifClass()\r\n{\r\n const SOI_MARKER = 0xFFD8; // start of image\r\n const SOS_MARKER = 0xFFDA; // start of stream\r\n const EOI_MARKER = 0xFFD9; // end of image\r\n const APP1_MARKER = 0xFFE1; // start of binary EXIF data\r\n const APP13_MARKER = 0xFFED; // start of IPTC-NAA data\r\n const COM_MARKER = 0xFFFE; // start of JFIF comment data\r\n\r\n const INTEL_BYTE_ORDER = 0x4949;\r\n\r\n\r\n var fxifUtils = new fxifUtilsClass();\r\n var metadataUtils = new metadataUtilsClass();\r\n\r\n var stringBundle;\r\n var imgURL = null;\r\n\r\n var originalLoad = window.onLoad;\r\n\r\n\r\n function getDataStream(imgUrl)\r\n {\r\n var istream = null;\r\n/*\r\n disabling this for now since it delivers compressed content\r\n if the server sends it compressed\r\n try {\r\n let {LoadContextInfo} = Components.utils.import(\"resource://gre/modules/LoadContextInfo.jsm\", {});\r\n var cs = Components.classes[\"@mozilla.org/network/cache-storage-service;1\"].getService(Components.interfaces.nsICacheStorageService);\r\n var storage = cacheService.diskCacheStorage(LoadContextInfo.default, false);\r\n var cdesc = storage.openCacheEntry(imgUrl, \"\", OPEN_READONLY, \r\n Components.interfaces.nsICacheStorage.OPEN_NORMALLY,\r\n {\r\n onCacheEntryCheck: function (entry, appcache) {\r\n return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED;\r\n },\r\n onCacheEntryAvailable: function (entry, isnew, appcache, status) {\r\n // And here is the cache v2 entry\r\n }\r\n }\r\n );\r\n istream = cdesc.openInputStream(0);\r\n }\r\n catch(ex) {}\r\n*/\r\n try {\r\n if(!istream) {\r\n var ios = Components.classes[\"@mozilla.org/network/io-service;1\"].getService(Components.interfaces.nsIIOService);\r\n var u = ios.newURI(imgUrl, null, null);\r\n // if it's a web resource, load it with bypassing the cache\r\n if(u.schemeIs(\"http\") ||\r\n u.schemeIs(\"https\")) {\r\n var c = ios.newChannelFromURI(u);\r\n// c.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE;\r\n istream = c.open();\r\n }\r\n else\r\n // see if it's a local file and we can open it\r\n if(u.schemeIs(\"file\")) {\r\n var fileHandler = ios.getProtocolHandler(\"file\").QueryInterface(Components.interfaces.nsIFileProtocolHandler);\r\n var f = fileHandler.getFileFromURLSpec(imgUrl);\r\n istream = Components.classes[\"@mozilla.org/network/file-input-stream;1\"].createInstance(Components.interfaces.nsIFileInputStream);\r\n istream.init(f, 1, 0, false);\r\n }\r\n else\r\n // or is it some sort of message\r\n if(u.schemeIs(\"mailbox\") ||\r\n u.schemeIs(\"news\") ||\r\n u.schemeIs(\"imap\")) {\r\n // get a channel\r\n var c = ios.newChannelFromURI(u);\r\n // and buffered open it into a stream\r\n // not that great in terms of responsiveness,\r\n // but ways easier than asyncOpen().\r\n istream = c.open();\r\n }\r\n else {\r\n // no input stream and not a local file. oh well.\r\n // might be in the process of loading or just not\r\n // cached.\r\n return null;\r\n }\r\n }\r\n }\r\n catch(ex) {}\r\n\r\n return istream;\r\n }\r\n\r\n function gatherData(imgUrl)\r\n {\r\n var dataObj = {};\r\n\r\n var istream = getDataStream(imgUrl);\r\n if (istream) {\r\n try {\r\n var bis = Components.classes[\"@mozilla.org/binaryinputstream;1\"].createInstance(Components.interfaces.nsIBinaryInputStream);\r\n bis.setInputStream(istream);\r\n var swapbytes = false;\r\n var marker = bis.read16();\r\n var len;\r\n\r\n if (marker == SOI_MARKER) {\r\n marker = bis.read16();\r\n // reading SOS marker indicates start of image stream\r\n while (marker != SOS_MARKER &&\r\n (!fxifUtils.exifDone || !fxifUtils.iptcDone || !fxifUtils.xmpDone)) {\r\n // length includes the length bytes\r\n len = bis.read16() - 2;\r\n\r\n if (marker == APP1_MARKER && len >= 6) {\r\n // for EXIF the first 6 bytes should be 'Exif\\0\\0'\r\n var header = bis.readBytes(6);\r\n // Is it EXIF?\r\n if (header == 'Exif\\0\\0') {\r\n // 8 byte TIFF header\r\n // first two determine byte order\r\n var exifData = bis.readByteArray(len - 6);\r\n\r\n swapbytes = fxifUtils.read16(exifData, 0, false) == INTEL_BYTE_ORDER;\r\n\r\n // next two bytes are always 0x002A\r\n // offset to Image File Directory (includes the previous 8 bytes)\r\n var ifd_ofs = fxifUtils.read32(exifData, 4, swapbytes);\r\n var exifReader = new exifClass(stringBundle);\r\n try {\r\n exifReader.readExifDir(dataObj, exifData, ifd_ofs, swapbytes);\r\n }\r\n catch(ex) {\r\n pushError(dataObj, \"EXIF\", ex);\r\n }\r\n fxifUtils.exifDone = true;\r\n }\r\n else {\r\n if (len > 28)\r\n {\r\n // Maybe it's XMP. If it is, it starts with the XMP namespace URI\r\n // 'http://ns.adobe.com/xap/1.0/\\0'.\r\n // see http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf\r\n header += bis.readBytes(22); // 6 bytes read means 22 more to go\r\n if (header == 'http://ns.adobe.com/xap/1.0/') {\r\n // There is at least one programm which writes spaces behind the namespace URI.\r\n // Overread up to 5 bytes of such garbage until a '\\0'. I deliberately don't read\r\n // until reaching len bytes.\r\n var a; var j = 0;\r\n do\r\n {\r\n a = bis.readBytes(1);\r\n } while(++j < 5 && a == ' ');\r\n if (a == '\\0') {\r\n var xmpData = bis.readByteArray(len - (28 + j));\r\n try {\r\n var xmpReader = new xmpClass(stringBundle);\r\n xmpReader.parseXML(dataObj, xmpData);\r\n }\r\n catch(ex) {\r\n pushError(dataObj, \"XMP\", ex);\r\n }\r\n fxifUtils.xmpDone = true;\r\n }\r\n else\r\n bis.readBytes(len - (28 + j));\r\n }\r\n else\r\n bis.readBytes(len - 28);\r\n }\r\n else\r\n {\r\n bis.readBytes(len - 6); \r\n }\r\n }\r\n }\r\n else\r\n // Or is it IPTC-NAA record as IIM?\r\n if (marker == APP13_MARKER && len > 14) {\r\n // 6 bytes, 'Photoshop 3.0\\0'\r\n var psString = bis.readBytes(14);\r\n var psData = bis.readByteArray(len - 14);\r\n if (psString == 'Photoshop 3.0\\0') {\r\n var iptcReader = new iptcClass(stringBundle);\r\n try {\r\n iptcReader.readPsSection(dataObj, psData);\r\n }\r\n catch(ex) {\r\n pushError(dataObj, \"IPTC\", ex);\r\n }\r\n fxifUtils.iptcDone = true;\r\n }\r\n }\r\n else\r\n // Or perhaps a JFIF comment?\r\n if (marker == COM_MARKER && len >= 1) {\r\n dataObj.UserComment = fxifUtils.bytesToString(bis.readByteArray(len), 0, len, false, 1);\r\n }\r\n else {\r\n // read and discard data ...\r\n bis.readBytes(len);\r\n }\r\n\r\n marker = bis.read16();\r\n }\r\n }\r\n bis.close();\r\n bis = istream = cdesc = httpCacheSession = null;\r\n }\r\n catch(ex) {\r\n dump(ex + '\\n');\r\n dataObj.error = stringBundle.getString(\"generalError\");\r\n }\r\n }\r\n\r\n return dataObj;\r\n }\r\n\r\n function pushError(dataObj, type, message)\r\n {\r\n if (dataObj.error)\r\n dataObj.error += '\\n';\r\n else\r\n dataObj.error = '';\r\n dataObj.error += stringBundle.getFormattedString(\"specialError\", [type, type]) + ' ' + message;\r\n }\r\n\r\n // Returns true if imgUrl is a JPEG image, false otherwise.\r\n // This isn't bullet proof but solely relies on the first\r\n // two bytes being SOI_MARER. This should suffice.\r\n // Since it's merely a hack, I'd rather like asking the app\r\n // what type of image it is. But how to?\r\n function isJPEG(imgUrl)\r\n {\r\n var istream = getDataStream(imgUrl);\r\n if (istream) {\r\n var bis = Components.classes[\"@mozilla.org/binaryinputstream;1\"].createInstance(Components.interfaces.nsIBinaryInputStream);\r\n bis.setInputStream(istream);\r\n if (bis.read16() == SOI_MARKER)\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n\r\n showEXIFDataFor = function (url)\r\n {\r\n var ed = gatherData(url);\r\n // ed always exists, so we need a way to find out\r\n // if it's empty or not.\r\n // This is the best idea I could come up with, any better idea?\r\n var edEmpty = true;\r\n for(var tmp in ed) {\r\n if (tmp != \"error\")\r\n {\r\n edEmpty = false;\r\n break;\r\n }\r\n }\r\n\r\n if(!ed.error)\r\n document.getElementById(\"error\").style.display = \"none\";\r\n else\r\n document.getElementById(\"error-label\").value = ed.error;\r\n\r\n if(!edEmpty) {\r\n document.getElementById(\"no-data\").style.display = \"none\";\r\n metadataUtils.setInfo(\"camera-make\", ed.Make);\r\n metadataUtils.setInfo(\"camera-model\", ed.Model);\r\n metadataUtils.setInfo(\"camera-lens\", ed.Lens);\r\n metadataUtils.setInfo(\"image-date\", ed.Date);\r\n metadataUtils.setInfo(\"image-orientation\", ed.Orientation);\r\n metadataUtils.setInfo(\"image-bw\", ed.IsColor);\t\t// TODO: what's this?\r\n metadataUtils.setInfo(\"image-flash\", ed.FlashUsed);\r\n metadataUtils.setInfo(\"image-focallen\", ed.FocalLengthText);\r\n metadataUtils.setInfo(\"image-digitalzoom\", ed.DigitalZoomRatio);\r\n metadataUtils.setInfo(\"image-exposuretime\", ed.ExposureTime);\r\n metadataUtils.setInfo(\"image-aperture\", ed.ApertureFNumber);\r\n metadataUtils.setInfo(\"image-focusdist\", ed.Distance);\r\n metadataUtils.setInfo(\"image-isoequiv\", ed.ISOequivalent);\r\n metadataUtils.setInfo(\"image-exposurebias\", ed.ExposureBias);\r\n metadataUtils.setInfo(\"image-whitebalance\", ed.WhiteBalance);\r\n metadataUtils.setInfo(\"image-lightsource\", ed.LightSource);\r\n metadataUtils.setInfo(\"image-meteringmode\", ed.MeteringMode);\r\n metadataUtils.setInfo(\"image-exposureprogram\", ed.ExposureProgram);\r\n metadataUtils.setInfo(\"image-exposuremode\", ed.ExposureMode);\r\n metadataUtils.setInfo(\"image-colorspace\", ed.ColorSpace);\r\n metadataUtils.setInfo(\"image-gpscoord\", ed.GPSLat + \", \" + ed.GPSLon);\r\n metadataUtils.setInfo(\"image-gpsalt\", ed.GPSAlt);\r\n metadataUtils.setInfo(\"image-gpsimgdir\", ed.GPSImgDir);\r\n metadataUtils.setInfo(\"image-creator\", ed.Creator);\r\n metadataUtils.setInfo(\"image-city\", ed.City);\r\n metadataUtils.setInfo(\"image-sublocation\", ed.Sublocation);\r\n metadataUtils.setInfo(\"image-provincestate\", ed.ProvinceState);\r\n metadataUtils.setInfo(\"image-countryname\", ed.CountryName);\r\n metadataUtils.setInfo(\"image-copyright\", ed.Copyright);\r\n metadataUtils.setInfo(\"image-title\", ed.Headline);\r\n metadataUtils.setInfo(\"image-caption\", ed.Caption);\r\n metadataUtils.setInfo(\"image-comment\", ed.UserComment);\r\n metadataUtils.setInfo(\"image-instructions\", ed.Instructions);\r\n metadataUtils.setInfo(\"image-software\", ed.Software);\r\n\r\n if (ed.GPSPureDdLat && ed.GPSPureDdLon) {\r\n var href = 'http://www.openstreetmap.org/?mlat=%lat%&mlon=%lon%&layers=M';\r\n try {\r\n var mapProvider = fxifUtils.getPreferences().getCharPref(\"mapProvider\");\r\n if(mapProvider.length)\r\n href = mapProvider;\r\n } catch(ex) {}\r\n href = href.replace(/%lat%/g, ed.GPSPureDdLat);\r\n href = href.replace(/%lon%/g, ed.GPSPureDdLon);\r\n href = href.replace(/%lang%/g, fxifUtils.getLang());\r\n document.getElementById(\"maplink-href\").setAttribute(\"href\", href);\r\n }\r\n else {\r\n document.getElementById(\"image-gpscoord\").style.display = \"none\";\r\n }\r\n }\r\n else {\r\n // Show at least a message if there's nothing. Else \"it just leaves you guessing\r\n // whether the extension is at fault or what.\" as a comment on AMO says.\r\n document.getElementById(\"copy-button\").style.display = \"none\";\r\n document.getElementById(\"data-list\").style.display = \"none\";\r\n }\r\n }\r\n\r\n /*\r\n Simulate a normal link to a new window but obey browser.link.open_newwindow.\r\n Not using openUILinkIn from utilityOverlay.js since we can't control opening\r\n of a new tab in foreground/background (resp. it relies on browser.tabs.loadInBackground\r\n instead of browser.tabs.loadBookmarksInBackground).\r\n */\r\n this.loadInBrowser = function (urlstring, event)\r\n {\r\n var browser = window.opener.getBrowser();\r\n try {\r\n var prefRoot = Components.classes[\"@mozilla.org/preferences-service;1\"].getService(Components.interfaces.nsIPrefService).getBranch(\"browser.\");\r\n var destpref = prefRoot.getIntPref(\"link.open_newwindow\");\r\n if (destpref == 1)\r\n browser.loadURI(urlstring);\r\n else\r\n {\r\n if (destpref == 2)\r\n window.open(urlstring);\r\n else\r\n if (destpref == 3)\r\n {\r\n var selectNewTab = !prefRoot.getBoolPref(\"tabs.loadInBackground\");\r\n if (event.shiftKey)\r\n selectNewTab = !selectNewTab;\r\n var tab = browser.addTab(urlstring);\r\n if (selectNewTab)\r\n browser.selectedTab = tab;\r\n }\r\n }\r\n } catch(ex) {}\r\n }\r\n\r\n this.copyDataToClipboard = function ()\r\n {\r\n try {\r\n var data = \"\";\r\n // Get all label/value combinations.\r\n // Relies on each line having one label and one textbox element.\r\n var labels = document.getElementById(\"exif-sec\").getElementsByTagName(\"grid\")[0].getElementsByTagName(\"label\");\r\n var values = document.getElementById(\"exif-sec\").getElementsByTagName(\"grid\")[0].getElementsByTagName(\"textbox\");\r\n for(var i=0; i<labels.length; i++) {\r\n var val = values[i].value;\r\n if(val) {\r\n data += labels[i].value + \" \" + val + \"\\r\\n\";\r\n }\r\n }\r\n\r\n if(data != \"\") {\r\n var clipboardHelper = Components.classes[\"@mozilla.org/widget/clipboardhelper;1\"].getService(Components.interfaces.nsIClipboardHelper);\r\n clipboardHelper.copyString(data);\r\n }\r\n }\r\n catch(ex) {}\r\n }\r\n\r\n\r\n this.onPropertiesOverlayLoad = function ()\r\n {\r\n originalLoad();\r\n\r\n stringBundle = document.getElementById(\"bundle_fxif\");\r\n if(onImage) {\r\n showEXIFDataFor(document.getElementById(\"image-url-text\").value);\r\n }\r\n else {\r\n document.getElementById(\"exif-sec\").style.display = \"none\";\r\n }\r\n }\r\n\r\n this.onGraphicinfoOverlayLoad = function ()\r\n {\r\n originalLoad();\r\n/*\r\n stringBundle = document.getElementById(\"bundle_fxif\");\r\n if(onImage) {\r\n showEXIFDataFor(document.getElementById(\"image-url-text\").value);\r\n }\r\n else {\r\n document.getElementById(\"exif-sec\").style.display = \"none\";\r\n }\r\n*/\r\n }\r\n\r\n this.onFxIFDataDialogLoad = function ()\r\n {\r\n stringBundle = document.getElementById(\"bundle_fxif\");\r\n var fileName = window.arguments[0]; // imgURL passed to window.openDialog() in showImageData()\r\n var pos = fileName.lastIndexOf('/');\r\n // if no /, pos is -1 and the + 1 will result in\r\n // using the whole string - that's what we want\r\n window.document.title = stringBundle.getString(\"windowtitle\") + \" \" + decodeURI(fileName.substr(pos + 1));\r\n showEXIFDataFor(window.arguments[0]);\r\n }\r\n\r\n // do initialisation stuff for adding our own\r\n // context menu entry for Firefox >= 3.6\r\n this.initMenuItems = function ()\r\n {\r\n var contextMenu = document.getElementById(\"contentAreaContextMenu\");\r\n if (contextMenu)\r\n contextMenu.addEventListener(\"popupshowing\", fxifObj.visibilityOfMenuItems, false);\r\n }\r\n\r\n // hides or shows the menu entry depending on the context\r\n this.visibilityOfMenuItems = function()\r\n {\r\n var item1 = document.getElementById(\"context-fxif\");\r\n var item2 = document.getElementById(\"context-fxif-sep\");\r\n\r\n try {\r\n // only show the entries if no properties entry available\r\n var properties_entry = document.getElementById(\"context-metadata\");\r\n// var bOnImage = imgURL && !properties_entry && gContextMenu.onImage;\r\n\r\n if (!properties_entry && (imgURL = metadataUtils.showMetadataFor(gContextMenu.target))) {\r\n item1.hidden = false;\r\n item2.hidden = false;\r\n\r\n // matching url endings of .jpeg, .jpe and .jpg each with\r\n // optional HTTP GET parameters after a following ?\r\n var reg_jpg = new RegExp(/\\.jp(eg|e|g)(\\?.*)?$/i);\r\n if (reg_jpg.test(imgURL)/* || isJPEG(imgURL)*/) {\r\n item1.disabled = false;\r\n item2.disabled = false;\r\n }\r\n else {\r\n item1.disabled = true;\r\n item2.disabled = true;\r\n }\r\n }\r\n else {\r\n item1.hidden = true;\r\n item2.hidden = true;\r\n }\r\n }\r\n catch(ex) {\r\n item1.hidden = true;\r\n item2.hidden = true;\r\n }\r\n }\r\n\r\n this.showImageData = function () {\r\n window.openDialog(\"chrome://fxif/content/fxifPropertiesDialog.xul\", \"_blank\", \"chrome,resizable\", imgURL);\r\n }\r\n\r\n}", "function LoadFilesystemInfo()\n{\n path = document.getElementById('@@PATH_INPUT_CLIENTID@@').value;\n\n MatrixPACS.ImageServer.Web.Application.Services.FilesystemInfoService.GetFilesystemInfo(path, OnLoadFilesystemInfoSuccess, OnLoadFilesystemInfoError); \n}", "function file_get(fid, callback) {\n var method = 'file.get';\n var timestamp = get_timestamp();\n var nonce = get_nonce();\n \n // Generating hash according to ServicesAPI Key method\n hash = get_hash(key, timestamp, domain, nonce, method);\n \n //array to pass all parameters\n var params = new Array(hash, domain, timestamp, nonce, fid);\n \n //formatted xmlrpc call\n var xml = xmlrpc_encode(method, params);\n \n //Ti.API.info(hash);\n \n var xhr = Titanium.Network.createHTTPClient();\n xhr.open(\"POST\",url);\n xhr.onload = callback;\n \n Titanium.API.info(\"xmlrpc: xml: \"+xml);\n xhr.send(xml);\n Titanium.API.info(\"xmlrpc: end\");\n}", "function loadFilesuserfilesOnline(){\n var fb = new fileBrowser.Browser($(\"#fileSysDiv\"), \"online\");\n //fb1 = fb;\n progressModalOpen(\"Loading file list, please wait\");\n \n $.post(\"/api/1/flash/getFileList\")\n .done(function(data) {\n if (data.ok) {\n fb.load(data.ok);\n fb.render();\n progressModalClose();\n } else if (data.err) {\n fileBrowser.showInputDialog(\"Error: \" + data.err, false, null, {text: \"Close\"});\n } else {\n fileBrowser.showInputDialog(\"Error: \" + data.err, false, null, {text: \"Close\"});\n }\n })\n .fail(function() {\n fileBrowser.showInputDialog(\"Error\", false, null, {text: \"Close\"});\n });\n}", "async function getFtbRevelation() {\n // return \"https://media.forgecdn.net/files/2778/975/FTBRevelationServer_3.2.0.zip\";\n return \"https://media.forgecdn.net/files/2690/320/FTB+Presents+Direwolf20+1.12-1.12.2-2.5.0-Server.zip\";\n}", "function loadFilesuserfiles(){\n \n \n $('#fileActionSelectAction').addClass('btnDisabled').off('click');\n \n var fb = new fileBrowser.Browser($(\"#fileSysDiv\"), \"offline\", projectName);\n gFileBrowser = fb;\n //fb1 = fb;\n /*\n $.post(\"/api/1/flash/getFileList\")\n .done(function(data) {\n if (data.ok) {\n fb.load(data.ok);\n fb.render();\n } else if (data.err) {\n fileBrowser.showInputDialog(\"Error: \" + data.err, false);\n } else {\n fileBrowser.showInputDialog(\"Error: \" + data.err, false);\n }\n })\n .fail(function() {\n fileBrowser.showInputDialog(\"Error\", false);\n });\n */\n if (projectName) {\n $.post(\"/api/1/flash/loadUserFiles\", {\"name\": projectName})\n .done(function(data) {\n if (data.ok) {\n fb.load(data.ok);\n } else {\n if (data.err) {\n alert(\"error loading user files\");\n }\n }\n \n fb.render();\n })\n .fail(function(data) {\n alert(\"error loading user files\");\n });\n }\n \n if(project.header.DeviceType != 'CC3100')\n {\n $($('#fileActionSelect')[0].options[2]).show();\n \n }\n else\n {\n $($('#fileActionSelect')[0].options[2]).hide();\n }\n\n $(\"#checkUnchekDiv\").children().eq(0).on(\"click\", function() { fb.selectAll.call(fb) })\n $(\"#checkUnchekDiv\").children().eq(1).on(\"click\", function() { fb.unselectAll.call(fb) })\n \n return;\n \n \n\tif(!project){\n\t\tproject={};\n\t}\n\tif(!project.userFiles){\n\t\tproject.userFiles=[];\n\t}\t\n\tif(project && project.userFiles){\n\t\tvar found=-1;\n\t\tfor (var cert=0;cert< project.userFiles.length;cert++){\n\t\t\tif( project.userFiles[cert].id==\"cert\" && project.userFiles[cert].type==\"folder\"){\n\t\t\t\tfound=cert\n\t\t\t}\n\t\t}\n\t\t//if not found create \n\t\tif (found==-1){\n\t\t\tvar cert={\n\t\t\t\tid:'cert',\n\t\t\t\ttype:\"folder\",\n\t\t\t\tobject:[]\n\t\t\t};\n\t\t\tproject.userFiles.push(cert)\n\t\t}\n\t\tbuild_files(project.userFiles,'#fileSysDiplayPageDiv','','');\n\t}\n\t//unbind drop in main\n\t$('#fileSysDiv').unbind('dragover');\n\t$('#fileSysDiv').unbind('dragenter');\n\t$('#fileSysDiv').unbind('drop');\n\t// stop propagation on default draganddrop\n\t$('#fileSysDiv').on('dragover', function(e) {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t}\n\t);\n\t$('#fileSysDiv').on( 'dragenter', function(e) {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t}\n\t);\n\t$('#fileSysDiv').on( 'drop', function(e) {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t}\n\t);\n\t//bind upload event\n\t$('#fileElement').change(function (e) {\n\t//get the folder name\n\tvar foldername=\"\"\n\tvar toAction=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\tif(toAction.length>0)\n\t{\n\t\tfoldername=$(toAction[0]).attr(\"id\").replace('//FileSelect','').split('//').reverse();\n\t}\n\t//upload\n\t upload(e.target.files,foldername);\n });\n\n //bind mcuimg event\n $('#MCUImg').change(function (e) {\n\t//get the folder name\n\tvar foldername=[\"sys\"]\n\tvar toAction=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\tif(toAction.length>0)\n\t{\n\t\tfoldername=$(toAction[0]).attr(\"id\").replace('//FileSelect','').split('//').reverse();\n\t}\n\t//upload\n\t upload(e.target.files,foldername, true);\n });\n \n if(project.header.DeviceType == 'CC3100')\n {\n document.getElementById('fileActionSelect').options[6].style.display = 'none'; \n }\n else\n {\n document.getElementById('fileActionSelect').options[6].style.display = 'block';\n }\n}", "function waAddFIProcess(pv_action,pv_details) {\nvar callType=\"page\"; //used in call to waLinkClick function\n\tif(!wa.containerPageName) {\twaCaptureContainerVariables(\"capture\"); }\n\n\ts.prop7=\"fi:\"+pv_action;\n\tif(pv_details) { \n\t\tpv_details=pv_details.toLowerCase();\n\t\ts.prop7=s.prop7+\"_\"+pv_details;\n\t}\n\t\n\t//do not change page names if sysmsg\n\tif(pv_action==\"sysmsg\") {\n\t\tif(pv_details==\"success\") { wa.events=\"event37\"; }\t//send on SUCCESSFUL fi add\n\t\tcallType=\"link\";\n\t} \n\telse {\n\t\tpv_action=pv_action.toLowerCase();\n\t\twa.pageDetail=pv_action;\n\t\twaSetDefaultVariables();\n\t\t\n\t\tswitch(pv_action) {\n\t\t\tcase \"searchfi\":\t\twa.events=\"event12\";break;\n\t\t\tcase \"selectfi\":\t\tbreak;\n\t\t\tcase \"addfi\":\t\t\t\n\t\t\t\twa.events=\"event11,event10\"; //represents addfi ATTEMPT\n\t\t\t\t//if(!wa.createMboxFIAttempt) {\n\t\t\t\t//\tmboxDefine('offermatica-div','mint_addfiattempt_metrics');\n\t\t\t\t//\twa.createMboxFIAttempt=true;\n\t\t\t\t//}\n\t\t\t\t//mboxUpdate('mint_addfiattempt_metrics');\n\t\t\t\tbreak;\n\t\t\tcase \"verify identity\":\tbreak;\n\t\t\tdefault:\t\t\t\tbreak;\n\t\t}\n\t}\n\t\n\twaLinkClick(this,pv_action,callType);\n\twa.events=s.events=s.prop7=\"\";\n}", "function reloadFFAPI (is_autoDetected) {\r\n // Make sure completeBookmarks will behave properly on this tree reload\r\n endLoadTime = (new Date()).getTime();\r\n savedBNList = curBNList;\r\n savedHNList = curHNList;\r\n faviconWorkerPostMessage({data: [\"hysteresis\"]});\r\n countBookmarks = countFolders = countSeparators = countOddities = countFetchFav = countNoFavicon = 0;\r\n\r\n browser.bookmarks.getTree()\r\n .then(storeAndConvertTree, onRejected)\r\n .catch( // Asynchronous, like .then\r\n\tfunction (err) {\r\n\t let msg = \"Error on processing reloadFFAPI : \"+err;\r\n\t console.log(msg);\r\n\t if (err != undefined) {\r\n\t\tlet fn = err.fileName;\r\n\t\tif (fn == undefined) fn = err.filename; // Not constant :-( Some errors have filename, and others have fileName \r\n\t\tconsole.log(\"fileName: \"+fn);\r\n\t\tconsole.log(\"lineNumber: \"+err.lineNumber);\r\n\t }\r\n\t}\r\n );\r\n\r\n if (is_autoDetected) { // Ask all instances of sidebars to display a modal warning that\r\n\t\t\t\t\t\t // bookmark are being reloaded and to wait until then\r\n\tsendAddonMessage(\"notifAutoFFReload\");\r\n\t// Record auto reload action\r\n\thistoryListAdd(curHNList, HNACTION_AUTORELOADFFAPI);\r\n }\r\n else {\r\n\tsendAddonMessage(\"notifFFReload\");\r\n\t// Record manual reload action\r\n\thistoryListAdd(curHNList, HNACTION_RELOADFFAPI);\r\n }\r\n // Make sure we save the last known state, including history\r\n saveBNList();\r\n}", "function tryNextExtension() {\n\t\tvar ext = extsToTry.pop();\n\t\tif (ext == null) {\n\t\t\tconsole.log(\"Ran out of extensions to try for \"+targetHost+\"/favicon.???\");\n\t\t\t// We run the callback anyway!\n\t\t\tcallback(null);\n\t\t} else {\n\t\t\tfavicon.src = targetProtocol+\"//\"+targetHost+\"/favicon.\"+ext;\n\t\t}\n\t}", "static formImages() {\n let mainfsDirCount = PP64.fs.mainfs.getDirectoryCount();\n for (let d = 0; d < mainfsDirCount; d++) {\n let dirFileCount = PP64.fs.mainfs.getFileCount(d);\n for (let f = 0; f < dirFileCount; f++) {\n let fileBuffer = PP64.fs.mainfs.get(d, f);\n if (!PP64.utils.FORM.isForm(fileBuffer))\n continue;\n\n try {\n let formUnpacked = PP64.utils.FORM.unpack(fileBuffer);\n if (formUnpacked.BMP1.length) {\n formUnpacked.BMP1.forEach(bmpEntry => {\n let dataUri = PP64.utils.arrays.arrayBufferToDataURL(bmpEntry.parsed.src, bmpEntry.parsed.width, bmpEntry.parsed.height);\n console.log(`${d}/${f}:`);\n console.log(dataUri);\n });\n }\n }\n catch (e) {}\n }\n }\n }", "populateFiles(dataresponse) {\n //console.log(\"filepanel.populateFiles()\")\n Vfstorage.setValue(\"filepanel\" + this.panelid, this.path);\n //it is assumed that first element is \".\" describing the content of current dir\n if (dataresponse.length>0 && dataresponse[0].name === \".\") this.currentdir = dataresponse.shift();\n else this.currentdir = null;\n //console.log(\"populateFiles currentdir:\",this.currentdir);\n this.files = dataresponse;//JSON.parse(dataresponse);//,this.dateTimeReviver);//populate window list\n this.filescount = this.files.length + this.resources.length;\n let that = this;\n this.files.forEach(function (item, index, arr) {\n if (!arr[index].name && arr[index].alias) {\n arr[index].name = arr[index].alias;\n arr[index].attributes = 16;\n arr[index].date = \"\";\n arr[index].filetype = 8;\n arr[index].nicesize = \"VF-DIR\";arr[index].isdir =true;\n }\n arr[index].provenance = false;\n //console.log(arr[index]);\n arr[index].ext = that.extension(arr[index].name); //may return undefined\n arr[index].nicedate = that.dateTimeReviver(null, arr[index].date);\n if (!arr[index].ext) arr[index].ext = \"\";\n arr[index].available = !!(arr[index].filetype & 8); //available if the filetype attribute contains flag 8\n if (arr[index].attributes & 16) { if (!arr[index].nicesize) {arr[index].nicesize = \"DIR\";arr[index].isdir =true;} }\n else {\n arr[index].isdir =false;\n //convert to 4GB or 30MB or 20kB or 100b\n arr[index].nicesize = ~~(arr[index].size / 1000000000) > 0 ? ~~(arr[index].size / 1000000000) + \"GB\" : (~~(arr[index].size / 1000000) > 0 ? ~~(arr[index].size / 1000000) + \"MB\" : (~~(arr[index].size / 1000) > 0 ? ~~(arr[index].size / 1000) + \"kB\" : arr[index].size + \" b\"));\n }\n });\n if (this.path.length > 0) {//non root path\n this.addUpDir();\n }\n\n }", "function PixFileDownload() {\n}", "function refract_existing_files(fileName,hash){\r\n\turl = \"https://ipfs.io/ipfs/\" + hash;\r\n\tresponse = get_response_https(url);\r\n\tvar parsedDoc = new DOMParser().parseFromString(response, 'text/html');\r\n\tfor(var i=0;i<tag_arr_len;i++){\r\n\t\tvar tag = parsedDoc.getElementsByTagName(tag_arr[i]);\r\n\t\tvar len = tag.length;\r\n\t\tfor(var j=0;j<len;j++){\r\n\t\tif( tag_arr[i] === 'link' ){\r\n\t\t\t//console.log(tag[j].href);\r\n\t\t\tif(tag[j].href.startsWith(\"https://ipfs.io/ipfs/\"))\r\n\t\t\t{\r\n\t\t\t\tvar old_hash = tag[j].href.split('https://ipfs.io/ipfs/')[1];\r\n\t\t\t\t//console.log(\"Older Hash=\"+old_hash);\r\n\t\t\t\tvar file_name_from_hash = get_file_name_from_hash(old_hash);//older hash\r\n\t\t\t\tvar new_hash = get_new_hash(file_name_from_hash);\r\n\t\t\t\ttag[j].href = 'https://ipfs.io/ipfs/' + new_Hash;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if( tag_arr[i] === \"a\" )\r\n\t\t{\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//console.log(tag[j].src);\r\n\t\t\tif(tag[j].src.startsWith(\"https://ipfs.io/ipfs/\"))\r\n\t\t\t{\r\n\t\t\t\tvar old_hash = tag[j].src.split('https://ipfs.io/ipfs/')[1];\r\n\t\t\t\t//console.log(\"Older Hash=\"+old_hash);\r\n\t\t\t\tvar file_name_from_hash = get_file_name_from_hash(old_hash);//older hash\r\n\t\t\t\tvar new_hash = get_new_hash(file_name_from_hash);\r\n\t\t\t\ttag[j].src = 'https://ipfs.io/ipfs/' + new_Hash;\r\n\t\t }\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\treturn parsedDoc.documentElement.outerHTML + \"\";\r\n}", "function fastDownload( ){\n return function(info, tab) {\n\tpre_notif();\n\tvar url = info['srcUrl'];\n\tvar file = url.split(/\\?/)[0];\n\tvar filename = file.split(/\\//);\n\tdo_download( url, filename[filename.length -1] );\n };\n}", "async uploadDocumentToIPFS() {\n const formData = new FormData();\n const files = Array.from(document.querySelector(\"#document\").files);\n if (files.length > 0) {\n if (this.approveFileType(files[0])) {\n formData.set(\"document\", files[0]);\n const { IpfsHash } = await fetch(\"http://localhost:3000/upload\", {\n method: \"POST\",\n body: formData,\n }).then((response) => response.json());\n return IpfsHash;\n } else {\n new Alert(\n \"#alert-container\",\n \"alert\",\n \"danger\",\n \"File type is not approved\"\n );\n }\n } else {\n return \"\";\n }\n }", "get ipfs () {\n return this._orbitdb._ipfs\n }", "handleFile() {\n let that = this;\n\n // The inputted file\n var file = this.refs.inputBox.files[0];\n\n // Ignore click if no file chosen\n if (file === undefined) {\n return;\n }\n\n // Check for .pdf extension. Weak method of checking filetype, but it's\n // the best we can do in the front end.\n if (!file.name.endsWith('.pdf')) {\n this.setState({error: 'The input is not a PDF file!'});\n return;\n }\n\n // Check if the server is busy with 2 other PDFs right now\n database.ref('/server').once('value').then(function(server_snapshot) {\n if (server_snapshot.val().processCount >= 2) {\n that.setState({\n error: 'There are 2 PDFs already being processed! \\nPlease wait for them to complete and try again, our poor server is working really hard.'\n });\n } else {\n that.setState({\n error: ''\n });\n\n that.updateUploadInProgress(true);\n\n // Declare file to be PDF\n var metadata = {\n contentType: 'application/pdf'\n };\n // Upload the file and metadata to 'lectureid/file.pdf' in FB Storage\n var uploadTask = storageRef.child(that.props.currentLecture.id + '/' + file.name).put(file, metadata);\n\n\n // Listener for state changes, errors, and completion of the upload\n uploadTask.on(firebaseApp.storage.TaskEvent.STATE_CHANGED,\n function(snapshot) {\n var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n that.setState({\n uploadProgress: progress\n });\n // Get upload progress\n }, function (error) {\n // Handle errors in upload\n console.log('Error in FBS upload: ' + error.code);\n }, function () {\n // Upload successful, get download URL\n var url = uploadTask.snapshot.downloadURL;\n that.setState({\n downloadURL: url,\n error: ''\n });\n\n that.updateUploadInProgress(false);\n\n database.ref('lectures/' + that.props.currentCourse.id + '/' + that.props.currentLecture.id).update({\n slides_url: url\n });\n\n // Call the label API with the new download URL\n that.callLabelAPI(url);\n }\n );\n }\n });\n }", "function getFileList(extension){\n $scope[extension+'_list'] = \"\";\n File.getFiles({ filter: extension, location: ProjectObject.original_location }).then(function (resp) {\n $scope[extension+'_list'] = resp;\n $scope[extension+'_file'] = resp[0];\n getFileContent(extension);\n },function(error){\n });\n }", "function doBrowseFiles()\n{\n var srbundle = srGetStrBundle(\"chrome://pippki/locale/pippki.properties\");\n var fp = Components.classes[nsFilePicker].createInstance(nsIFilePicker);\n fp.init(window,\n srbundle.GetStringFromName(\"loadPK11TokenDialog\"),\n nsIFilePicker.modeOpen);\n fp.appendFilters(nsIFilePicker.filterAll);\n if (fp.show() == nsIFilePicker.returnOK) {\n var pathbox = document.getElementById(\"device_path\");\n pathbox.setAttribute(\"value\", fp.file.path);\n }\n}", "getFileInfo(url) {\n return new Promise((resolve, reject) => {\n if (this.infos[url])\n return resolve(this.infos[url]);\n const req = require('request');\n req.head(url, (err, response, _) => {\n if (err)\n return reject(err);\n try {\n const result = {\n name: response.headers['content-disposition'].split('filename=')[1].split(';')[0],\n type: response.headers['content-type'].split(';')[0]\n };\n this.infos[url] = result;\n BdApi.saveData('RepoUtils', 'infos', this.infos);\n resolve(result);\n }\n catch (e) {\n reject(e);\n }\n });\n });\n }", "getFileIconDropzone(fileType, fileName) {\n\n\n if(fileType === 'png' || fileType === 'jpg' || fileType === 'gif' ){\n if(fileName.indexOf('sites') >= 0) \n return `https://flextronics365.sharepoint.com/${fileName}`;\n }\n\n\n let fileExtension = \"\";\n if(fileType !== \"\")\n fileExtension = fileType.split('/')[1] || fileType\n else \n fileExtension = fileName.split('.')[1]\n\n let iconSrc = `https://flextronics365.sharepoint.com/sites/project_intake/ProjectIntake/assets/File-Icons/${fileExtension}.png`;\n //console.log('iconSrc', iconSrc);\n\n return iconSrc;\n\n // if(fileType === 'png' || fileType === 'jpg' || fileType === 'gif' ){\n // if(fileName.indexOf('sites') >= 0) \n // return `https://flextronics365.sharepoint.com/${fileName}`;\n // }\n \n // let fileExtension = \"\";\n // let iconSrc = \"\";\n // if(fileName.indexOf('sites/') >= 0) {\n // fileExtension = fileType;\n // iconSrc = `/${fileName}`;\n // }\n // else if(fileType !== \"\") {\n // fileExtension = fileType.split('/')[1]\n // iconSrc = `https://flextronics365.sharepoint.com/sites/project_intake/ProjectIntake/assets/File-Icons/${fileExtension}.png`;\n // }\n \n // else {\n // fileExtension = fileName.split('.')[1]\n // iconSrc = `https://flextronics365.sharepoint.com/sites/project_intake/ProjectIntake/assets/File-Icons/${fileExtension}.png`;\n \n // }\n \n // //console.log('iconSrc', iconSrc);\n\n // return iconSrc;\n }", "function get_pic_fdisplay(id) {\n\t\n\t//$('#fddiv_'+id).find('input, textarea, button, select').attr('disabled','disabled');\n\talert (id)\n\n\tvar div_id=\"fdSL_image_div_\"+id;\n\ttemp_image_div=div_id;\n\tvar hidden_name=\"fdSL_image_name_hidden_\"+id;\n\tvar tempTime = $.now();\n\tfd_image_name=tempTime.toString()+\"_\"+localStorage.selectedOutlet+id.toString()+\".jpg\";\n\t$(\"#\"+hidden_name).val(fd_image_name);\n\tnavigator.camera.getPicture(onSuccessFd, onFailFd, { quality: 70,\n\t\ttargetWidth: 450,\n\t\tdestinationType: Camera.DestinationType.FILE_URI , correctOrientation: true });\n\t\n}", "function offlineOnload() {\n var didFail = src.endsWith(\"-etc1.pvr\") && new DataView(request.response).getInt32(0) !== PVR_MAGIC_NUMBER;\n if (didFail) {\n error(new Error(\"Failed offline PVR get request: \" + request.status + \" - \" + request.statusText));\n } else {\n callback(request.response);\n }\n }", "function getImageInfo() {\n\n}", "function process_icons_dfa() {\n\n\t\tvar builder_frame;\n var module;\n var target_element;\n var icon_data;\n var icon_parts;\n var icon_modules;\n\n var is_et_fb = false;\n\t\t\n\t\t// Check if the iframe exists (Divi 3.18.x)\n if( et_fb_check() && $('iframe#' + builder_frame_selector).length ) {\n is_et_fb = true;\n builder_frame = $('iframe#' + builder_frame_selector);\n icon_modules = $( targetClasses, builder_frame.contents() );\n } else {\n icon_modules = $( targetClasses );\n }\n\t\t\n\t\t// Loop through modules and work with icon data.\n\t\tfor( i = 0; i < icon_modules.length; i++ ) {\n\t\t\n\t\t\tmodule = icon_modules[i];\n \n if( is_et_fb ) {\n target_element = $( module, builder_frame.contents() );\n } else {\n target_element = $( module );\n }\n\n // If the module isn't found, skip this iteration.\n if( ! target_element.length ) {\n continue;\n }\n\n\t\t\t// If the module has a 'data-icon' attribute set, we'll use it.\n\t\t\tif ( target_element.data('icon') !== undefined ) {\n\t\t\t\t\n\t\t\t\tvar icon_data = target_element.attr( 'data-icon');\n\t\t\t\ticon_data = icon_data.split(\"~|\");\n\n\t\t\t\tif( icon_data.length >= 2 ) {\n\t\t\t\t\ttarget_element.attr( 'data-icon', icon_data[0] );\n\t\t\t\t}\n\t\t\t\n\t\t\t// Otherwise the icon information is in the html.\n\t\t\t} else {\n\n\t\t\t\tvar icon_data = target_element.html();\n\t\t\t\ticon_data = icon_data.split(\"~|\");\n\t\t\t\t\n\t\t\t\tif( icon_data.length >= 2 ) {\n\t\t\t\t\ttarget_element.html( icon_data[0] );\n\t\t\t\t}\n }\n \n target_element.attr('data-family', icon_data[2]);\n target_element.removeClass('divi_font_awesome_icon divi_font_awesome_icon--elegant-themes divi_font_awesome_icon--font-awesome divi_font_awesome_icon--undefined');\n target_element.addClass( 'divi_font_awesome_icon divi_font_awesome_icon--' + icon_data[2] );\n \n if( target_element.is('[data-family]') ) {\n var this_fam = target_element.attr('data-family');\n if( ! target_element.hasClass('divi_font_awesome_icon--' + this_fam ) ) {\n target_element.addClass('divi_font_awesome_icon--' + this_fam );\n }\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "retrieveUploads() {\n return freendiesApi.retrieveUploads(this.__userApiToken__)\n }", "function fileInfo(appweburl, hostweburl, f) {\r\n //console.log('fileInfo('+f.ID+')');\r\n var deferred = $.Deferred();\r\n\r\n var executor = new SP.RequestExecutor(appweburl);\r\n var itemid = f.ID;\r\n var url = appweburl +\r\n \"/_api/SP.AppContextSite(@target)/web/lists/getbytitle('assets')/Items(\" + itemid + \")/File?@target='\" + hostweburl + \"'\";\r\n executor.executeAsync({\r\n url: url,\r\n method: \"GET\",\r\n headers: { \"Accept\": \"application/json; odata=verbose\" },\r\n success: function (data) {\r\n var obj = JSON.parse(data.body);\r\n var fileInfo = obj.d;\r\n //console.log('fileInfo => ' + JSON.stringify(obj.d));\r\n deferred.resolve(fileInfo);\r\n },\r\n error: function (err) {\r\n deferred.reject('Fail: ' + JSON.stringify(err));\r\n }\r\n });\r\n\r\n return deferred;\r\n}", "async saveToIpfs([file]) {\n \n try {\n const added = await this.state.ipfs.add(\n file, {\n progress: (prog) => console.log(`received: ${prog}`)\n }\n )\n console.log(added)\n // call seallake with ipfs hash TODO sha256 or send file into env\n let hashofIpfsCID = SHA256(added.path);\n console.log(hashofIpfsCID);\n \n const body = {\n \"envelope\": {\n \"dataHash\": hashofIpfsCID.toString(),\n \"metadata\": {\n \"storage\": {\n \"url\": 'https://ipfs.io/ipfs/' + added.path,\n \"contenttype\": \"text/html\"\n },\n \"location\": \"File Upload Demo\",\n \"type\": \"demo data\",\n \"protocol\": \"IPFS\",\n \"name\": \"Random file for demo\"\n }\n }\n }\n \n const options1 = {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n }\n }\n \n // const apiUrl1 = `http://ec2-100-20-87-209.us-west-2.compute.amazonaws.com/API/v1/envelope/gatsby1/` + added.path\n \n // const response = await fetch(apiUrl1, body, options1);\n \n fetch('https://plato.seallake.net/API/v1/envelope/ipfs/' + added.path, {\n method: 'POST',\n body: JSON.stringify(body),\n headers: {\n 'Accept': 'application/json'\n },\n })\n .then(res => res.json())\n .then(json => console.log(json))\n .catch((error) => {\n console.error('Error:', error);\n });\n \n this.setState({\n added_file_hash: added.cid.toString()\n })\n\n } catch (err) {\n console.error(err)\n }\n }", "function s$2(){if(t$q(i$4)){const e=e=>a$o(`esri/libs/basisu/${e}`);i$4=import('./basis_transcoder-37795199.js').then((function(e){return e.b})).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))));}return i$4}", "function get_file(fid) {\n var phpCmd = \"\";\n var response = \"still_no_answer\";\n if ( fid == 'config' ) {\n phpCmd = 'read_config_file';\n }\n else {\n return null;\n }\n var myREQ = new XMLHttpRequest();\n myREQ.open(method=\"GET\", url=\"php/functions.php?command=\" + phpCmd, async=false);\n myREQ.send();\n return (myREQ.responseText);\n}", "function verifExtensionArchIcono(extension) {\n var data = {\n icono: \"fa fa-file\",\n color: \"#95A5A6\",\n descripcion: \"Archivo\"\n };\n var archivos = {\n jpg: \"fa fa-file-image&#F1C40F&Imagen\",\n jpeg: \"fa fa-file-image&#F1C40F&Imagen\",\n png: \"fa fa-file-image&#F1C40F&Imagen\",\n gif: \"fa fa-file-image&#F1C40F&Imagen\",\n tiff: \"fa fa-file-image&#F1C40F&Imagen\",\n psd: \"fa fa-file-image&#F1C40F&Imagen\",\n eps: \"fa fa-file-image&#F1C40F&Imagen\",\n ai: \"fa fa-adobe&#CD6155&Adobe\",\n pdf: \"fa fa-file-pdf&#CB4335&PDF\",\n doc: \"fa fa-file-word&#2980B9&Word\",\n docx: \"fa fa-file-word&#2980B9&Word\",\n xls: \"fa fa-file-excel6#27AE60&Excel\",\n xslx: \"fa fa-file-excel&#27AE60&Excel\",\n ppt: \"fa fa-file-powerpoint&#B9770E&PowerPoint\",\n pot: \"fa fa-file-powerpoint&#B9770E&PowerPoint\",\n pptx: \"fa fa-file-powerpoint&#B9770E&Imagen\",\n txt: \"fa fa-file-alt&#212F3D&Texto\",\n zip: \"fa fa-file-archive&#7D3C98&Zip\",\n rar: \"fa fa-file-archive&#7D3C98&Rar\",\n }\n if (archivos[extension.toLowerCase()] !== undefined) {\n data.icono = archivos[extension.toLowerCase()].split(\"&\")[0];\n data.color = archivos[extension.toLowerCase()].split(\"&\")[1];\n data.descripcion = archivos[extension.toLowerCase()].split(\"&\")[2];\n }\n return data;\n}", "function prerun() \n{\n var fileUrl = \"/public/js/\";\n var fileName;\n var folderName = \"/\";\n var canRead = true;\n var canWrite = false;\n\n fileName = [\n \"Master Bank.bank\",\n \"Master Bank.strings.bank\",\n// \"Character.bank\",\n// \"Music.bank\",\n// \"UI_Menu.bank\",\n \"Vehicles.bank\",\n// \"Surround_Ambience.bank\",\n// \"VO_Menu_English.bank\",\n// \"Weapons.bank\" \n ];\n\n for (var count = 0; count < fileName.length; count++)\n {\n document.querySelector(\"#display_out2\").value = \"Loading \" + fileName[count] + \"...\";\n\n FMOD.FS_createPreloadedFile(folderName, fileName[count], fileUrl + fileName[count], canRead, canWrite);\n }\n}", "function opf(f) {\n // Get the document title\n // Depending on the browser, namespaces may or may not be handled here\n var title = $(f).find('title').text(); // Safari\n var author = $(f).find('creator').text();\n $('#content-title').html(title + ' by ' + author);\n // Firefox\n if (title == null || title == '') {\n\t$('#content-title').html($(f).find('dc\\\\:title').text() + ' by ' + $(f).find('dc\\\\:creator').text());\n }\n // Get the NCX\n var opf_item_tag = 'opf\\\\:item';\n if ($(f).find('opf\\\\:item').length == 0) {\n\topf_item_tag = 'item';\n }\n\n $(f).find(opf_item_tag).each(function() {\n\t// Cheat and find the first file ending in NCX\n\tif ( $(this).attr('href').indexOf('.ncx') != -1) {\n\t ncx_file = epub_dir + '/' + oebps_dir + '/' + $(this).attr('href');\n\t jQuery.get(ncx_file, {}, toc);\n\t}\n });\n\n}", "function FilE_selectpre(file){\n\t//fitlerfitlerfitlerfitlerfitler\n\t/*\ttype:image\n\t * format:.png \n\t *size:<=2.5MB \n\t * name:<=250 \n\t * hw: \n\t */\n\t ///////////////////////////////\t\n\t //type\n\t var type=file.type;//格式:例image/png image/gif\n\t var rtype=/^(image\\/png|image\\/png|image\\/png)$/i;\n\t var result=rtype.test(type);\n\t if(result==false){\n\t\t$('#UploaD_tip').css('display','block');\t \t\t\t\t\t \t\n\t \treturn false;\t \t\n\t }\n\t var size=file.size;//单位:B\n\t if((2.5*1024*1024)<size){\n\t\t$('#UploaD_tip').css('display','block');\t \t\t\n\t \treturn false;\t\t \t\n\t }\n\t\t//browserbrowserbrowserbrowser\n\t\t/*image:url\n\t\t *name\n\t\t *hw \n\t\t */\n\t\t //custom the upload file as ReadFile\n\t\t var oReader = new FileReader();\n\t\t //turn 'file':var file=document.getElementById('InpuT').files[0];to a dataurl\n\t\t oReader.readAsDataURL(file);\t\t\t\t \n\t\t //when it onload\n\t\t oReader.onload = function(e){\t\t \t\t\t\t \t \n\t\t\t $('#PrE_imageupload').css({display:'none'});\n\t\t\t //give the dataurl to the img src\n\t\t\t var imgurl=e.target.result;//e.target.result = dataurl\n\t\t\t var imgid='#PrE_imageuploadbrowsershowconcon';\t\t\t \n\t\t\t var framew=360;\n\t\t\t var frameh=360;\n\t\t\t PicturE_auto(imgurl,imgid,framew,frameh);\n\t\t\t $('#PrE_imageuploadbrowser').css('display','block');\n\t\t }\n}", "function getFiles(fl) {\n\n var files = [];\n\n if(fl == 'l50') {\n files = [\n {size: \"50\", url: base_url + \"50kB.html\", name: \"50kB\"},\n {size: \"100\", url: base_url + \"100kB.html\", name: \"100kB\"},\n {size: \"150\", url: base_url + \"150kB.html\", name: \"150kB\"},\n {size: \"200\", url: base_url + \"200kB.html\", name: \"200kB\"},\n {size: \"250\", url: base_url + \"250kB.html\", name: \"250kB\"},\n {size: \"300\", url: base_url + \"300kB.html\", name: \"300kB\"},\n {size: \"350\", url: base_url + \"350kB.html\", name: \"350kB\"},\n {size: \"400\", url: base_url + \"400kB.html\", name: \"400kB\"},\n {size: \"450\", url: base_url + \"450kB.html\", name: \"450kB\"},\n {size: \"500\", url: base_url + \"500kB.html\", name: \"500kB\"},\n {size: \"550\", url: base_url + \"550kB.html\", name: \"550kB\"},\n {size: \"600\", url: base_url + \"600kB.html\", name: \"600kB\"},\n {size: \"650\", url: base_url + \"650kB.html\", name: \"650kB\"},\n {size: \"700\", url: base_url + \"700kB.html\", name: \"700kB\"},\n {size: \"750\", url: base_url + \"750kB.html\", name: \"750kB\"},\n {size: \"800\", url: base_url + \"800kB.html\", name: \"800kB\"},\n {size: \"850\", url: base_url + \"850kB.html\", name: \"850kB\"},\n {size: \"900\", url: base_url + \"900kB.html\", name: \"900kB\"},\n {size: \"950\", url: base_url + \"950kB.html\", name: \"950kB\"},\n {size: \"1000\", url: base_url + \"1000kB.html\", name: \"1000kB\"}\n ];\n } else if(fl == 'l100') {\n files = [\n {size: \"100\", url: base_url + \"100kB.html\", name: \"100kB\"},\n {size: \"200\", url: base_url + \"200kB.html\", name: \"200kB\"},\n {size: \"300\", url: base_url + \"300kB.html\", name: \"300kB\"},\n {size: \"400\", url: base_url + \"400kB.html\", name: \"400kB\"},\n {size: \"500\", url: base_url + \"500kB.html\", name: \"500kB\"},\n {size: \"600\", url: base_url + \"600kB.html\", name: \"600kB\"},\n {size: \"700\", url: base_url + \"700kB.html\", name: \"700kB\"},\n {size: \"800\", url: base_url + \"800kB.html\", name: \"800kB\"},\n {size: \"900\", url: base_url + \"900kB.html\", name: \"900kB\"},\n {size: \"1000\", url: base_url + \"1000kB.html\", name: \"1000kB\"}\n ];\n } else {\n files = [\n {size: \"16\", url: base_url + \"16kB.html\", name: \"16kB\"},\n {size: \"32\", url: base_url + \"32kB.html\", name: \"32kB\"},\n {size: \"64\", url: base_url + \"64kB.html\", name: \"64kB\"},\n {size: \"128\", url: base_url + \"128kB.html\", name: \"128kB\"},\n {size: \"256\", url: base_url + \"256kB.html\", name: \"256kB\"},\n {size: \"512\", url: base_url + \"512kB.html\", name: \"512kB\"},\n {size: \"1024\", url: base_url + \"1024kB.html\", name: \"1024kB\"}\n ];\n }\n\n // Add original index for each file\n for(var i=0; i<files.length; i++) {\n files[i].index = i;\n }\n\n $scope.graph.progressPart = 100/files.length;\n\n return files;\n }", "function upldOnlyFile(evt,Route,Ext,FB2ndRoute){\n\tevt.stopPropagation();\n\tevt.preventDefault();\n\n\tvar file = evt.target.files[0];\n\n\t// Prepara Metadata\n\tvar metadata = {'contentType': file.type};\n\t// Subir archivo con nombre nuevo\n\tvar uploadTask = firebase.storage().ref().child(Route+\"/\"+Ext).put(file, metadata);\n\t// Atender cambios de estado, errores, y fin de carga exitosa (almacenar URL).\n\tuploadTask.on('state_changed', function(estado) {\n\t\t// Obtener % de carga, mediante monto de bytes cargados / totales\n\t\tvar carga = (estado.bytesTransferred / estado.totalBytes) * 100;\n\t\tif(tst_logs)console.log('Cargando '+carga+'%...');\n\t\tprogBar.MaterialProgress.setBuffer(carga);\n\t\tswitch (estado.state) {\n\t\t\tcase firebase.storage.TaskState.PAUSED: // or 'paused'\n\t\t\t\tif(tst_logs)console.log('Carga Pausada!');\n\t\t\t\tbreak;\n\t\t\tcase firebase.storage.TaskState.RUNNING: // or 'running'\n\t\t\t\tif(tst_logs)console.log('Carga Corriendo...');\n\t\t\t\tbreak;\n\t\t}\n\t}, function(error) {\n\t\t// Si hay error\n\t\tconsole.error('Carga fallida:', error);\n\t\treject(error);\n\t}, function() {\n\t\tif(tst_logs)console.log('Cargados ',uploadTask.snapshot.totalBytes,'bytes.');\n\t\tprogBar.MaterialProgress.setProgress(30);\n\t\tprogBar.MaterialProgress.setBuffer(100);\n\t\tif(tst_logs)console.log(uploadTask.snapshot.metadata);\n\t\tvar url = uploadTask.snapshot.metadata.downloadURLs[0];\n\t\tvar name = uploadTask.snapshot.metadata.name;\n\t\tif(tst_logs)console.log(name+'- Archivo disponible aqui: ', url);\n\t\tprogBar.MaterialProgress.setProgress(50);\n\n\t\t// Almacenar 2da Referencia de archivos\n\t\tif(FB2ndRoute)firebase.database().ref(FB2ndRoute+\"/\"+Ext).transaction(function(current){\n\t\t\tprogBar.MaterialProgress.setProgress(90);\n\t\t\treturn url;\n\t\t}).catch(function(error){console.error(error.message);});\n\n\t\t// Almacenar Referencia de archivos\n\t\tfirebase.database().ref(Route+\"/\"+Ext).transaction(function(current){\n\t\t\tif(tst_logs)console.log(name+\"- Referencias Guardadas:\", url);\n\t\t\tprogBar.MaterialProgress.setProgress(100);\n\t\t\tsetTimeout('progBar.style.opacity=0',300);\n\t\t\treturn url;\n\t\t}).catch(function(error){console.error(error.message);});\n\n\t});\t// uploadTask\n}", "function OnLoadFilesystemInfoSuccess(result)\n{\n filesysteminfo = result;\n if (filesysteminfo!=null && filesysteminfo.Exists)\n {\n \n sizeTotal = document.getElementById('@@TOTAL_SIZE_CLIENTID@@');\n sizeTotal.value = filesysteminfo.SizeInKB;\n \n sizeUsed = document.getElementById('@@USED_SIZE_CLIENTID@@');\n sizeUsed.value = sizeTotal.value - filesysteminfo.FreeSizeInKB;\n\n total = document.getElementById('@@TOTAL_SIZE_INDICATOR_CLIENTID@@'); \n total.innerHTML = FormatSize(sizeTotal.value);\n \n used = document.getElementById('@@USED_SIZE_INDICATOR_CLIENTID@@');\n used.innerHTML = FormatSize(sizeUsed.value) + ' (' + FormatPercentage(sizeUsed.value/sizeTotal.value, 4) +')';\n\n EnableWatermarkInput();\n RecalculateWatermark();\n \n }\n else\n {\n sizeTotal = document.getElementById('@@TOTAL_SIZE_CLIENTID@@');\n sizeTotal.value = 0;\n \n sizeUsed = document.getElementById('@@USED_SIZE_CLIENTID@@');\n sizeUsed.value = 0;\n \n total = document.getElementById('@@TOTAL_SIZE_INDICATOR_CLIENTID@@'); \n total.innerHTML = SR.Unknown;\n \n used = document.getElementById('@@USED_SIZE_INDICATOR_CLIENTID@@');\n used.innerHTML = SR.Unknown;\n\n RecalculateWatermark();\n\n DisableWatermarkInput();\n }\n \n}", "function init() \n{\n FlickrOAuth.setFlickrUpdateCb(function(s, m, d, o){flickrUpdate(s, m, d, o);});\n FlickrOAuth.setAuthenticateCb(function(status, oAuthData){authenticateCb(status, oAuthData);});\n // load the number of simultanious downloads from the prefs\n prefs = Services.prefs.getBranch(\"extensions.FlickrGetSet.\");\n try\n {\n simultaniousDownloads = prefs.getIntPref(\"simultaniousDownloads\");\n }\n catch (e)\n {\n logError(\"No simultaniousDownloads pref found\");\n }\n}", "function ff3_getPath(fileBrowser) {\n\ttry {\n\t\tnetscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\");\n\t} catch (e) {\n\t alert('Unable to access local files due to browser security settings. '\n\t +'To overcome this, follow these steps: (1) Enter \"about:config\" in the URL field; '+ \n\t '(2) Right click and select New->Boolean; (3) Enter \"signed.applets.codebase_principal_support\" '+\n\t '(without the quotes) as a new preference name; (4) Click OK and try loading the file'+\n\t ' again.');\n\t return false;\n\t}\n\tvar fileName=fileBrowser.value;\n\treturn fileName;\n}", "function getExtension(success) {\n\t console.log(MessengerExtensions);\n\t if (MessengerExtensions) {\n\t success(MessengerExtensions);\n\t return;\n\t }\n\t setTimeout(getExtension, 150, success);\n\t}", "function changeIcon()\n{\n var pic = document.getElementById(\"user-info-icon-img\");\n var file = document.getElementById(\"upload-icon\");\n var ext = file.value.substring(file.value.lastIndexOf(\".\") + 1).toLowerCase();\n // gif在IE浏览器暂时无法显示\n if (ext != 'png' && ext != 'jpg' && ext != 'jpeg' && ext != 'gif') {\n alert(\"文件必须为图片!\");\n return;\n }\n // IE浏览器\n if (document.all) {\n\n file.select();\n var reallocalpath = document.selection.createRange().text;\n var ie6 = /msie 6/i.test(navigator.userAgent);\n // IE6浏览器设置img的src为本地路径可以直接显示图片\n if (ie6)\n pic.src = reallocalpath;\n else {\n // 非IE6版本的IE由于安全问题直接设置img的src无法显示本地图片,但是可以通过滤镜来实现\n pic.style.filter = \"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='image',src=\\\"\" + reallocalpath + \"\\\")\";\n // 设置img的src为base64编码的透明图片 取消显示浏览器默认图片\n pic.src = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n }\n } else {\n html5IconReader(file);\n }\n}", "readyModeFavorite(classInst) {\n\n let count = 1;\n\n let url = \"https://api.themoviedb.org/3/account/5cc983f092514119e5f94e46/favorite/movies?page=1&sort_by=\" +\n \"created_at.asc&language=en-US&session_id=968092a83b4016a49c3ddde1cc030d149fc6ba0b&api_key=\" +\n \"a8ac0ce418f28d6ec56424ebad76ed12\";\n\n\n fetch(url, {\n method: 'GET',\n\n }).then(function (response) {\n\n return response.json();\n\n // extract token from JSON response\n // return token\n }).then(function (token) {\n // endpoint where file will be uploaded\n\n let results = token.total_pages;\n classInst.setPages(results);\n classInst.setFavoriteResults(count, token.results);\n\n // file that has been selected in the form\n\n for (let x = 2; x <= results; x++) {\n\n\n fetch(\"https://api.themoviedb.org/3/account/5cc983f092514119e5f94e46/favorite/movies?page=\" + x + \"&sort_by=\" +\n \"created_at.asc&language=en-US&session_id=968092a83b4016a49c3ddde1cc030d149fc6ba0b&api_key=\" +\n \"a8ac0ce418f28d6ec56424ebad76ed12\", {\n method: 'GET',\n\n }).then(function (response) {\n return response.json();\n }).then(function (token) {\n\n\n classInst.setFavoriteResults(x, token.results);\n\n\n });\n\n\n }\n\n }).catch(function (error) {\n console.log(error)\n // handle error\n });\n\n }", "uploadUrl(app, module, x, y, url) {\n var filename = url.toString().split('/').pop();\n var extension = filename.toString().split('.').pop();\n filename = filename.toString().split('.').shift();\n if (extension == \"dsp\") {\n Utilitary.getXHR(url, (codeFaust) => {\n var dsp_code = \"process = vgroup(\\\"\" + filename + \"\\\",environment{\" + codeFaust + \"}.process);\";\n if (module == null) {\n app.compileFaust({ isMidi: false, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { app.createModule(factory); } });\n }\n else {\n module.update(filename, dsp_code);\n }\n }, Utilitary.errorCallBack);\n }\n else if (extension == \"polydsp\") {\n Utilitary.getXHR(url, (codeFaust) => {\n var dsp_code = \"process = vgroup(\\\"\" + filename + \"\\\",environment{\" + codeFaust + \"}.process);\";\n if (module == null) {\n app.compileFaust({ isMidi: true, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { app.createModule(factory); } });\n }\n else {\n module.isMidi = true;\n module.update(filename, dsp_code);\n }\n }, Utilitary.errorCallBack);\n }\n else if (extension == \"json\") {\n Utilitary.getXHR(url, (codeFaust) => {\n let moduleJson = JSON.parse(codeFaust);\n app.compileFaust({ isMidi: false, name: filename, sourceCode: \"process=_,_;\", x: x, y: y, callback: (factory) => { app.createNonFaustModule(factory, moduleJson); } });\n //app.createNonFaustModule({ name:filename, sourceCode:codeFaust, x:x, y:y})\n }, Utilitary.errorCallBack);\n }\n }", "function readFileInfo(x){\n\tconsole.log(\"Cur \" + x + \" Tot \" + nrOfFiles);\n\tif (x >= nrOfFiles) {\n\t\tofferShare();\n\t\treturn;\n\t}\n\tvar f = files[x];\n\tvar reader = new FileReader();\n\t\treader.onloadend = function (e) {\n\t\t\tif(reader.readyState == FileReader.DONE){\n\t\t\t\tconsole.log(f.name);\n\t\t\t\tfmArray[x].stageLocalFile(f.name, f.type, reader.result);\n\t\t\t\treadFileInfo(x+1);\n\t\t\t}\n\t\t}; \n\t\treader.readAsArrayBuffer(f);\n}", "function adbpFFDownload(){\n\ttry {\n\t\ttrackMetrics({\n\t\t\ttype: \"cnt-game-unity-download\",\n\t\t\tdata: {\n\t\t\t\tgame : {\n\t\t\t\t\tdetail:\t\"fusionfall\",\n\t\t\t\t\ttitle:\t\"fusionfall\",\n\t\t\t\t\ttype:\t\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} catch(e){}\n}", "static uploadPoPFile() {\n return `purchase/payment-methods/regular-eft/payment-proof/upload`\n }", "function getPathFoto(feature)\r\n{\r\n\tvar path_foto = \"\";\r\n\tvar pf = feature.properties.path_foto;\r\n\t\r\n\tswitch(pf)\r\n\t{\r\n\t\tcase null:\r\n\t\t\tpath_foto = '\"http://www.bsmc.net.au/wp-content/uploads/No-image-available.jpg\"'; break;\r\n\t\tcase \"\":\r\n\t\t\tpath_foto = '\"http://www.bsmc.net.au/wp-content/uploads/No-image-available.jpg\"'; break;\r\n\t\tcase \"unknown\":\r\n\t\t\tpath_foto = '\"http://www.bsmc.net.au/wp-content/uploads/No-image-available.jpg\"'; break;\r\n\t\tdefault:\r\n\t\t\tpath_foto = '\"http://'+ip[0]+'/dataGIS/'+pf+'\"'; break;\r\n\t}\r\n\treturn path_foto;\r\n}", "function updateFile ( sf, df, q, vStr )\r\n{\r\nvar cpRet;\r\nvar xCopy = false ;\r\nvar fsrc, fdst, dsRet, destDrive, dCheck, qVer, fxExt, sFV = '', dFV = '' ;\r\nif ( fo.fileExists ( sf ) )\r\n {\r\n try\r\n {\r\n fsrc = fo.GetFile(sf);\r\n if ( fo.fileExists ( df ) )\r\n {\r\n fdst = fo.GetFile(df);\r\n\t\t\tif ( q == false )\r\n\t\t\t\t{\r\n\t\t\t\tif ( vStr == 'file' || vStr == 'extended' )\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfxExt = fo.GetExtensionName ( sf ).toLowerCase();\r\n\t\t\t\t\tif ( fxExt == 'hxa' || fxExt == 'hxt'\r\n\t\t\t\t\t\t|| fxExt == 'hxk' || fxExt == 'hxc' )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tsFV = getVersionAttrib(sf);\r\n\t\t\t\t\t\tdFV = getVersionAttrib(df);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( fxExt.substr ( 0, 2 ) == 'hx' )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tsFV = fo.GetFileVersion(sf);\r\n\t\t\t\t\t\t\tdFV = fo.GetFileVersion(df);\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\tswitch ( vStr )\r\n\t\t\t\t\t{\r\n\t\t\t\t\tcase 'date':\r\n\t\t\t\t\t\tif ( fdst.DateLastModified < fsrc.DateLastModified )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\txCopy = true;\r\n\t\t\t\t\t\t} break;\r\n\t\t\t\t\tcase 'file':\r\n\t\t\t\t\t\tif ( Math.abs(sFV) > Math.abs(dFV) )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\txCopy = true;\r\n\t\t\t\t\t\t} break; \r\n\t\t\t\t\tcase 'extended':\r\n\t\t\t\t\t\tif ( q == false )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tvar sVerFull=sFV.split('.');\r\n\t\t\t\t\t\t\tvar dVerFull=dFV.split('.');\r\n\t\t\t\t\t\t\tif ( sVerFull.length > 1 && dVerFull.length > 1 && sVerFull != null && dVerFull != null )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tvar sVerNum = Math.abs (sVerFull[0] + sVerFull[1]);\r\n\t\t\t\t\t\t\t\tvar dVerNum = Math.abs (dVerFull[0] + dVerFull[1]);\r\n\t\t\t\t\t\t\t\tvar sVerSku = sVerFull[2]; var dVerSku = dVerFull[2];\r\n\t\t\t\t\t\t\t\tvar sVerLng = sVerFull[3]; var dVerLng = dVerFull[3];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif ( sVerSku != dVerSku )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tqVer = WSHShell.Popup ( 'You are about to overwrite existing Help with Help from a different edition of the product. Proceed?', 0, mbTitle, 33 );\r\n\t\t\t\t\t\t\t\tif ( qVer == 1 )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tq = true;\r\n\t\t\t\t\t\t\t\t\txCopy = true;\r\n\t\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\t{\r\n\t\t\t\t\t\t\t\t\tWSHShell.Popup ( 'Help maintenance operation concluded.', 0, mbTitle, 64 );\r\n\t\t\t\t\t\t\t\t\tWScript.Echo ( 'Help maintenance operation concluded.' );\r\n\t\t\t\t\t\t\t\t\tWSHShell = null; WScript.Quit(); \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\tif ( sVerLng != dVerLng )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tqVer = WSHShell.Popup ( 'You are about to overwrite existing Help with a different localized version. Proceed?', 0, mbTitle, 33 );\r\n\t\t\t\t\t\t\t\tif ( qVer == 1 )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tq = true;\r\n\t\t\t\t\t\t\t\t\txCopy = true;\r\n\t\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\t{\r\n\t\t\t\t\t\t\t\t\tWSHShell.Popup ( 'Help maintenance operation concluded.', 0, mbTitle, 64 );\r\n\t\t\t\t\t\t\t\t\tWScript.Echo ( 'Help maintenance operation concluded.' );\r\n\t\t\t\t\t\t\t\t\tWSHShell = null; WScript.Quit(); \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\tif ( sVerNum > dVerNum )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\txCopy = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\txCopy = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault: xCopy = true;\r\n\t\t\t\t\t} // end switch\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\txCopy = true;\r\n\t\t\t\t}\r\n\r\n if ( xCopy == true )\r\n {\r\n destDrive = fo.GetDrive(fo.GetDriveName(fo.GetParentFolderName(df)));\r\n checkDrive ( destDrive, ( fsrc.size * 2 ) - ( fdst.size ) );\r\n try\r\n {\r\n if ( fdst.attributes > 0 ) { fdst.attributes = 0; }\r\n }\r\n catch ( err_attrchange )\r\n {\r\n cpRet = -1;\r\n }\r\n try\r\n {\r\n fo.copyFile ( sf, df, true );\r\n if ( q == true ) { cpRet = 0; } else { cpRet = 1; }\r\n }\r\n catch ( err_copydest )\r\n {\r\n cpRet = -1;\r\n }\r\n }\r\n else { cpRet = -1; }\r\n }\r\n else\r\n {\r\n try\r\n {\r\n if ( !fo.folderExists(fo.GetParentFolderName(df)) )\r\n {\r\n createFoldersFromPath ( df );\r\n }\r\n fo.copyFile ( sf, df, true );\r\n if ( q == true ) { cpRet = 0; } else { cpRet = 1; }\r\n }\r\n catch ( err_copynodest )\r\n {\r\n cpRet = -1;\r\n }\r\n }\r\n }\r\n catch ( err_updatefile )\r\n {\r\n cpRet = -1;\r\n }\r\n }\r\nelse\r\n {\r\n cpRet = -1;\r\n }\r\nreturn cpRet;\r\n}", "function getInfoFiles(pol_id,id_name,selected_layer,tableName){\n _self.emit(\"log\",\"form.js\",\"getInfoFiles()\",\"info\",{'pol_id': pol_id,'id_name': id_name, 'selected_layer':\tselected_layer,'tableName': tableName});\n return new Promise((resolve, reject) => {\n let dataToSend \t\t\t\t= {};\n\t\t\t//dataToSend.layer\t\t\t= layer\n\t\t\tdataToSend.device\t\t\t= _device;\n\t\t\tdataToSend.pol_id\t\t\t= pol_id;\n\t\t\tdataToSend.id_name\t\t= id_name;\n\t\t\tdataToSend.selected_layer = selected_layer;\n\t\t\tdataToSend.tableName = tableName;\n\t\t\tdataToSend.token\t\t\t= _token;\n\t\t\tdataToSend.what\t\t\t\t= 'GET_INFO_FILES';\n\t\t\tdataToSend.expected_api_version = _expected_api_version;\n axios.post(_baseHref+'/ajax.sewernet.php', dataToSend).then(function (response) {\n\t\t\t\t_self.emit(\"log\",\"visits.js\",\"getInfoFiles\",\"success\",response.data.message);\n\t\t\t\tresolve(response.data.message.body);\n }).catch((e)=>{\n\t\t\t\t_self.emit(\"log\",\"visits.js\",\"getInfoFiles\",\"error\",response.data);\n\t\t\t\treject(e);\n });\n });\n }", "function _trackFID() {\n\t onFID(metric => {\n\t const entry = metric.entries.pop();\n\t if (!entry) {\n\t return;\n\t }\n\n\t const timeOrigin = msToSec(browserPerformanceTimeOrigin );\n\t const startTime = msToSec(entry.startTime);\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Measurements] Adding FID');\n\t _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n\t _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n\t });\n\t}", "function successCallbackWithFsCaching(resp, status, headers, config) {\n var docs = [];\n var totalEntries = resp.items.length;\n console.log(totalEntries);\n resp.items.forEach(function (entry, i) {\n var doc = {\n title: entry.title,\n updatedDate: Util.formatDate(entry.modifiedDate),\n updatedDateFull: entry.modifiedDate,\n icon: entry.iconLink,\n alternateLink: entry.alternateLink,\n size: entry.fileSize ? '( ' + entry.fileSize + ' bytes)' : null\n };\n // 'http://gstatic.google.com/doc_icon_128.png' -> 'doc_icon_128.png'\n doc.iconFilename = doc.icon.substring(doc.icon.lastIndexOf('/') + 1);\n console.log(doc.icon);\n // If file exists, it we'll get back a FileEntry for the filesystem URL.\n // Otherwise, the error callback will fire and we need to XHR it in and\n // write it to the FS.\n var fsURL = fs.root.toURL() + FOLDERNAME + '/' + doc.iconFilename;\n window.webkitResolveLocalFileSystemURL(fsURL, function (entry) {\n console.log('Fetched icon from the FS cache');\n doc.icon = entry.toURL();\n // should be === to fsURL, but whatevs.\n $scope.docs.push(doc);\n // Only want to sort and call $apply() when we have all entries.\n if (totalEntries - 1 == i) {\n $scope.docs.sort(Util.sortByDate);\n $scope.$apply(function ($scope) {\n }); // Inform angular we made changes.\n }\n }, function (e) {\n $http.get(doc.icon, { responseType: 'blob' }).success(function (blob) {\n console.log('Fetched icon via XHR');\n blob.name = doc.iconFilename;\n // Add icon filename to blob.\n writeFile(blob);\n // Write is async, but that's ok.\n doc.icon = window.URL.createObjectURL(blob);\n $scope.docs.push(doc);\n if (totalEntries - 1 == i) {\n $scope.docs.sort(Util.sortByDate);\n }\n });\n });\n });\n }", "function pwfs() {\n return pdfs('wfFrame' + pdf('CurrentDesk'));\n}", "function UciStorage() {\nvar oNewNode = document.createElement(\"iframe\");\n if(document.location.port) {\n oNewNode.setAttribute(\"src\", hebergementFullPath + 'cookie.html?hostname='+document.location.hostname+'&origin=' + document.location.protocol + '//' + document.location.hostname + ':' + document.location.port + document.location.pathname);\n } else {\n oNewNode.setAttribute(\"src\", hebergementFullPath + 'cookie.html?hostname='+document.location.hostname+'&origin=' + document.location.protocol + '//' + document.location.hostname + document.location.pathname);\n }\n oNewNode.setAttribute(\"id\", 'id_frame_cookie');\n oNewNode.setAttribute(\"name\", 'frame_cookie');\n oNewNode.setAttribute(\"width\", '0');\n oNewNode.setAttribute(\"height\", '0');\n oNewNode.setAttribute(\"style\", 'width:0;height:0;border:0;display:block;');\n oNewNode.setAttribute(\"aria-hidden\", 'true');\n oNewNode.setAttribute(\"title\", accessibilitytoolbar.get('uci_iframe_cookie'));\n\n /**\n * Update browser cookies in order to save each of user preference value.\n */\n this.updateUserPref = function(profilName) {\n // Update the cdu cookies with the stackv3 value\n if(profilName) {\n this.setStoredValue(this.encode(),profilName);\n }\n var UsageConfortpref = this.encodeUsageConfort();\n if(document.location.port) {\n document.getElementById('id_frame_cookie').src=hebergementFullPath+\"cookie.html?UsageConfort=\"+UsageConfortpref+\"&origin=\"+document.location.protocol + \"//\" + document.location.hostname + ':' + document.location.port + document.location.pathname;\n } else {\n document.getElementById('id_frame_cookie').src=hebergementFullPath+\"cookie.html?UsageConfort=\"+UsageConfortpref+\"&origin=\"+document.location.protocol + \"//\" + document.location.hostname + document.location.pathname;\n }\n\n\n };\n\n /**\n * Update browser cookies in order to save each of user preference value.\n */\n this.updateBlackList = function() {\n // Update the cdu cookies with the stackv3 value\n document.getElementById('id_frame_cookie').src=hebergementFullPath+\"cookie.html?hostname=\"+document.location.hostname;\n };\n\n /**\n * Receive message from the iframe\n */\n this.receiveMessage = function (event) {\n // Do we trust the sender of this message?\n if ( event.origin.replace('https:', '') !== hebergementDomaine.replace('https:', '') && event.origin.replace('https:', '') !== hebergementDomaine.replace('https:', '') || typeof event.data === 'object')\n return;\n\n // back from cookie Save\n if (event.data == \"saveDone\") {\n if(accessibilitytoolbar.needToReload)\n {\n accessibilitytoolbar.reloadToolbar();\n }\n }\n //cookieData\n else\n {\n // new version with profiles\n accessibilitytoolbar.userPref.decodeUsageConfort(event.data);\n }\n };\n\n /*****************************************************************************************************************/\n\n if (window.addEventListener) {\n window.addEventListener(\"message\", this.receiveMessage, false);\n }\n else if (window.attachEvent) {\n window.attachEvent(\"onmessage\", this.receiveMessage);\n }\n\n document.getElementsByTagName('body')[0].appendChild(oNewNode);\n}", "function _trackFID() {\n getFID.onFID(metric => {\n const entry = metric.entries.pop();\n if (!entry) {\n return;\n }\n\n const timeOrigin = utils$1.msToSec(utils.browserPerformanceTimeOrigin );\n const startTime = utils$1.msToSec(entry.startTime);\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Measurements] Adding FID');\n _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n });\n}", "function _stFpc(){\n\t\t\tif(!document.domain){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar cVal=_stGetFpc(\"__unam\");\n\t\t\tif(cVal==false){\n\t\t\t\tvar bigRan=Math.round(Math.random() * 2147483647);\n\t\t\t\tbigRan=bigRan.toString(16);\n\t\t\t\tvar time=(new Date()).getTime();\n\t\t\t\ttime=time.toString(16);\n\t\t\t\tvar guid=\"\";\n\t\t\t\tvar hashD=_stGetD();\n\t\t\t\thashD=hashD.split(/\\./)[1];\n\t\t\t\tif(!hashD){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tguid=_stdHash(hashD)+\"-\"+time+\"-\"+bigRan+\"-1\";\n\t\t\t\tcVal=guid;\n\t\t\t\t_stSetFpc(cVal);\n\t\t\t}else{\n\t\t\t\tvar cv=cVal;\n\t\t\t\tvar cvArray = cv.split(/\\-/);\n\t\t\t\tif(cvArray.length==4){\n\t\t\t\t\tvar num=Number(cvArray[3]);\n\t\t\t\t\tnum++;\n\t\t\t\t\tcv=cvArray[0]+\"-\"+cvArray[1]+\"-\"+cvArray[2]+\"-\"+num;\n\t\t\t\t\tcVal=cv;\n\t\t\t\t\t_stSetFpc(cVal);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\treturn cVal;\n\t\t}", "function getGlobDataAPI(){\n\n}", "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}", "function getFS(file, type, fs){\n if(file){\n if(type == \"audio\") {\n console.log(\"audio file lookup\");\n window.requestFileSystem(fs, 0, gotFSAudio, fail);\n } else {\n console.log(\"image file lookup\");\n window.requestFileSystem(fs, 0, gotFSImage, fail);\n }\n } else {\n console.log(\"No file recorded!\");\n }\n}", "function initialize2 () {\r\n try {\r\n\t// Start the favicon worker, with a delay if there are fetches triggered by the tree load\r\n/*\r\n\tfaviconWorker = new Worker (\"favicon.js\");\r\n \tfaviconWorker.onmessage = asyncFavicon;\r\n \tfaviconWorker.onerror = errorFavicon;\r\n \tfaviconWorker.onmessageerror = msgerrorFavicon;\r\n \tfaviconWorker.postMessage([\"hysteresis\"]);\r\n*/\r\n\tfaviconWorkerPostMessage({data: [\"hysteresis\"]});\r\n\r\n\t// If just installed, or if load FF API each time is forced, or if we didn't retrieve the Bookmark node\r\n\t// saved structure, then re-read the Bookmark tree from FF API to sync / re-sync.\r\n\tif (justInstalled || options.loadffapi || (savedBNList == undefined)) {\r\n\t trace(\"(Loading from FF API)\", true);\r\n\t browser.bookmarks.getTree()\r\n\t .then(storeAndConvertTree, onRejected)\r\n\t .catch( // Asynchronous also, like .then\r\n\t\tfunction (err) {\r\n\t\t let msg = \"initialize2() error : \"+err;\r\n\t\t console.log(msg);\r\n\t\t if (err != undefined) {\r\n\t\t\tlet fn = err.fileName;\r\n\t\t\tif (fn == undefined) fn = err.filename; // Not constant :-( Some errors have filename, and others have fileName \r\n\t\t\tconsole.log(\"fileName: \"+fn);\r\n\t\t\tconsole.log(\"lineNumber: \"+err.lineNumber);\r\n\t\t }\r\n\t\t}\r\n\t );\r\n\t}\r\n\telse { // We got a full Bookmark node saved structure and we are on an add-on update or reload\r\n\t // Use the saved structure as current one\r\n\t curBNList = savedBNList;\r\n\t endTreeLoadTime = (new Date ()).getTime();\r\n\t bypassedFFAPI = true;\r\n\t trace(\"(Bypass FF API) Tree load duration: \"+(treeLoadDuration = (endTreeLoadTime - endLoadTime))+\" ms\", true);\r\n\r\n\t // Scan tree to get stats and if we have still favicons to fetch, trigger that.\r\n\t scanBNTree(rootBN, faviconWorkerPostMessage);\r\n\t endTreeBuildTime = (new Date ()).getTime();\r\n\t trace(\"Tree build duration: \"+(treeBuildDuration = (endTreeBuildTime - endTreeLoadTime))+\" ms\", true);\r\n\r\n\t completeBookmarks();\r\n\t}\r\n } catch (err) {\r\n\tlet msg = \"Error in initialize2() : \"+err;\r\n\tconsole.log(msg);\r\n\tif (err != undefined) {\r\n\t let fn = err.fileName;\r\n\t if (fn == undefined) fn = err.filename; // Not constant :-( Some errors have filename, and others have fileName \r\n\t console.log(\"fileName: \"+fn);\r\n\t console.log(\"lineNumber: \"+err.lineNumber);\r\n\t}\r\n }\r\n}", "function getPDFFilesFromCurFolder() {\n var files = folder.getFiles();\n var allFileNameUrls = [];\n\n while (files.hasNext()) {\n var file = files.next();\n\n var fileName = file.getName();\n if(fileName.endsWith(\".pdf\") && !fileName.includes(\"_protected\")){\n // Create Pre-Signed URL from PDF.co\n var respPresignedUrl = getPDFcoPreSignedURL(fileName)\n\n if(!respPresignedUrl.error){\n var fileData = file.getBlob();\n if(uploadFileToPresignedURL(respPresignedUrl.presignedUrl, fileData)){\n // Add Url\n allFileNameUrls.push({url: respPresignedUrl.url, fileName: fileName});\n }\n }\n }\n }\n\n return allFileNameUrls;\n}", "function jsonFlickrApi(response) {\n up2day.imageURL = \"https://farm\"\n + response.photos.photo[0].farm + \".staticflickr.com/\"\n + response.photos.photo[0].server + \"/\"\n + response.photos.photo[0].id + \"_\"\n + response.photos.photo[0].secret + \".jpg\";\n\n up2day.flickrImageLoaded = 1;\n }", "function createFileIcons(file) {\r\n\tvar icons = new Object();\r\n\t// fid\r\n\tif (file.pseudoFile || (file.relatedFiles && file.relatedFiles.length)) {\r\n\t\tvar a = createIcon(null, '[+]', null, expandFiles, 'expand this entry', 'i_expand');\r\n\t\ticons['expand'] = a;\r\n\t}\r\n\tif (!LAY_SHOWFID) {\r\n\t\tif (!file.pseudoFile)\r\n\t\t\ticons['fid'] = createIcon(null, file.id, 'animedb.pl?show=file&fid='+file.id, null, 'show file details - FID: '+file.id, 'i_file_details');\r\n\t\telse\r\n\t\t\ticons['fid'] = createIcon(null, 'P'+file.id, 'http://wiki.anidb.net/w/Files:Pseudo_files', null, 'Pseudo File: P'+file.id, 'i_file_details');\r\n\t} else {\r\n\t\tif (!file.pseudoFile)\r\n\t\t\ticons['fid'] = createLink(null, file.id, 'animedb.pl?show=file&fid='+file.id, null, null ,null, null);\r\n\t\telse\r\n\t\t\ticons['fid'] = createLink(null, 'P'+file.id, 'http://wiki.anidb.net/w/Files:Pseudo_files', null, null ,null, null);\r\n\t}\r\n\t// extension\r\n\tif (file.type != 'generic') {\r\n\t\tvar tooltip = 'type: '+file.type+' | added: '+cTimeDate(file.date);\r\n\t\tif (file.relDate > 0) tooltip += ' | released: '+cTimeDate(file.relDate);\r\n\t\tif (file.fileType != '') tooltip += ' | extension: '+file.fileType;\r\n\t\ticons['ext'] = createIcon(null, file.fileType, null, null, tooltip, 'i_ext '+file.fileType);\r\n\t}\r\n\t// avdumped\r\n\tif (file.avdumped)\r\n\t\ticons['avdump'] = createIcon(null,' [avdumped]','http://wiki.anidb.net/w/Avdump',null,'File was verified by an AniDB Client','i_av_yes');\r\n\t// vid\r\n\tif (file.type == 'video') { // VIDEO StrEAM\r\n\t\tfor (var st in file.videoTracks) {\r\n\t\t\tvar stream = file.videoTracks[st];\r\n\t\t\tif (stream && stream.codec) {\r\n\t\t\t\tvar res;\r\n\t\t\t\tvar vc_RXP = /[^\\w]/ig;\r\n\t\t\t\tvar vcodec = 'unknown';\r\n\t\t\t\tif (stream.codec) vcodec = stream.codec.toLowerCase();\r\n\t\t\t\tvar vstyle = vcodec.replace(vc_RXP,'_');\r\n\t\t\t\tvar tooltip = 'video';\r\n\t\t\t\tif (file.resolution != 'unknown') tooltip += ' | resolution: '+file.resolution;\r\n\t\t\t\tif (stream.codec != 'unknown') tooltip += ' | codec: '+stream.codec;\r\n\t\t\t\tif (stream.ar != 'unknown')tooltip += ' | ar: '+stream.ar;\r\n\t\t\t\tif (file.length) tooltip += ' | duration: '+formatFileLength(file.length,'long');\r\n\t\t\t\t//createIcon(icons, 'vid0 ', null, null, tooltip, 'i_videostream_'+vstyle);\r\n\t\t\t\ticons['vid'] = createIcon(null, 'vid0 ', null, null, tooltip, 'i_video '+stream.codec_sname);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// audio languages\r\n\tif (file.type == 'video' || file.type == 'audio') { // AUDIO StrEAM\r\n\t\tvar audioLangs = new Array();\r\n\t\tvar audioCodecs = new Array();\r\n\t\tfor (var st in file.audioTracks) {\r\n\t\t\tvar stream = file.audioTracks[st];\r\n\t\t\tif (stream && stream.lang) {\r\n\t\t\t\tvar tooltip = 'audio: '+mapLanguage(stream.lang);\r\n\t\t\t\tif (st < 2) { // EXP only exports info other than lang for the first 2 streams\r\n\t\t\t\t\tif (stream.codec != 'unknown') tooltip += ' | codec: '+stream.codec;\r\n\t\t\t\t\tif (stream.chan != 'other') tooltip += ' | channels: '+mapAudioChannels(stream.chan);\r\n\t\t\t\t\tif (stream.type) tooltip += ' | type: '+mapAudioType(stream.type);\r\n\t\t\t\t\tif (file.length) tooltip += ' | duration: '+formatFileLength(file.length,'long');\r\n\t\t\t\t\taudioCodecs.push(createIcon(null, stream.codec, 'http://wiki.anidb.info/w/Codecs', null, 'Audio codec: '+stream.codec,'i_audio '+stream.codec_sname));\r\n\t\t\t\t}\r\n\t\t\t\taudioLangs.push(createIcon(null, 'aud'+st+'.'+stream.lang+' ', null, null, tooltip, 'i_audio_'+stream.lang));\r\n\t\t\t}\r\n\t\t}\r\n\t\ticons['audlangs'] = audioLangs;\r\n\t\ticons['audcodecs'] = audioCodecs;\r\n\t}\r\n\t// subtitle languages\r\n\tif (file.type == 'video' || file.type == 'subtitle' || file.type == 'other') { // SUBTITLE StrEAM\r\n\t\tvar subtitleLangs = new Array();\r\n\t\tfor (var st in file.subtitleTracks) {\r\n\t\t\tvar stream = file.subtitleTracks[st];\r\n\t\t\tif (stream && stream.lang) {\r\n\t\t\t\tvar tooltip = 'subtitle: '+mapLanguage(stream.lang);\r\n\t\t\t\tif (st < 2) {\r\n\t\t\t\t\tif (stream.type && stream.type != 'unknown') tooltip += ' | type: '+mapSubTypeData(stream.type);\r\n\t\t\t\t\tif (stream.flags) tooltip += ' | flags: '+mapSubFlagData(stream.flags);\r\n\t\t\t\t}\r\n\t\t\t\tsubtitleLangs.push(createIcon(null, 'sub'+st+'.'+stream.lang+' ', null, null, tooltip, 'i_sub_'+stream.lang));\r\n\t\t\t}\r\n\t\t}\r\n\t\ticons['sublangs'] = subtitleLangs;\r\n\t}\r\n\t// crc status\r\n\tif (file.crcStatus == 'valid') \r\n\t\ticons['crc'] = createIcon(null, 'crc.ok ', null, null, 'crc *matches* official crc ('+file.crc32.toUpperCase()+')', 'i_crc_yes');\r\n\telse if (file.crcStatus == 'invalid') \r\n\t\ticons['crc'] = createIcon(null, 'crc.bad ', null, null, 'crc *does not match* official crc', 'i_crc_no');\r\n\telse if (file.type != 'generic') \r\n\t\ticons['crc'] = createIcon(null, 'crc.unv ', null, null, 'crc *not* compared to official crc', 'i_crc_unv');\r\n\t// file version\r\n\tif (file.version != 'v1') \r\n\t\ticons['ver'] = createIcon(null, file.version+' ', null, null, 'version *'+file.version.charAt(1)+'* (error corrections)', 'i_vrs_'+file.version.charAt(1));\r\n\t// censor\r\n\tif (file.isCensored) \r\n\t\ticons['cen'] = createIcon(null, 'cen ', null, null, '*censored*', 'i_censored');\r\n\tif (file.isUncensored) \r\n\t\ticons['cen'] = createIcon(null, 'uncen ', null, null, '*uncensored*', 'i_uncensored');\r\n\t// FILE<->EP RELATIONS\r\n\tif (file.epRelations && file.epRelations[file.episodeId]) { // Do some work\r\n\t\tvar rel = file.epRelations[file.episodeId];\r\n\t\tvar tooltip = 'File covers: [';\r\n\t\tfor (var bar = 0; bar < rel['startp']/10; bar++) tooltip += '-';\r\n\t\tfor (var bar = rel['startp']/10; bar < rel['endp']/10; bar++) tooltip += '=';\r\n\t\tfor (var bar = rel['endp']/10; bar < 10; bar++) tooltip += '-';\r\n\t\ticons['file_ep_rel'] = createIcon(null, '['+rel['startp']+'-'+rel['endp']+']', null, null, tooltip+']', 'i_file2ep_rel');\r\n\t}\r\n\t// FILE<->FILE RELATIONS\r\n\tif (file.fileRelations && file.fileRelations.length) { // Do some work\r\n\t\tfor (var r in file.fileRelations) {\r\n\t\t\tvar rel = file.fileRelations[r];\r\n\t\t\tif (rel['relfile'] == undefined) continue;\r\n\t\t\tvar tooltip = 'File relation of type \\\"'+rel['type']+'\\\" \\\"'+rel['dir']+'\\\" with file id \\\"'+rel['relfile']+'\\\"';\r\n\t\t\ticons['file_file_rel'] = createIcon(null,'[rel: '+ rel['relfile'] + ']', null, null, tooltip, 'i_file2file_rel');\r\n\t\t}\r\n\t}\r\n\t// FILE COMMENT\r\n\tif ((file.other) && (file.other != '') && (file.other != undefined)) \r\n\t\ticons['cmt'] = createIcon(null, 'comment ', null, null, 'comment: '+file.other, 'i_comment');\r\n\t// NEW FILE\r\n\tif (file.newFile)\r\n\t\ticons['date'] = createIcon(null, 'new.file ', null, null, '*new file* (last 24h)', 'i_new_icon');\r\n\t// MYLIST\r\n\tvar temp = new Array();\r\n\tvar mylistEntry = mylist[file.id];\r\n\tif (mylistEntry) {\r\n\t\ticons['mylist'] = createIcon(null, 'in.mylist ', null, null, '*in mylist*', 'i_mylist');\r\n\t\t// Mylist status icon\r\n\t\tvar tooltip = 'mylist status: '+mylistEntry.status;\r\n\t\tif (mylistEntry.storage && mylistEntry.storage != '') tooltip += ' | storage: '+mylistEntry.storage;\r\n\t\tvar className = mapMEStatusName(mylistEntry.status);\r\n\t\ticons['mylist_status'] = createLink(null, mylistEntry.status+' ', 'http://wiki.anidb.net/w/Filetype', 'anidb::wiki', null, tooltip, 'i_icon i_state_'+className);\r\n\t\t//createIcon(null, mylistEntry.status+' ', null, null, tooltip, 'i_state_'+className);\r\n\t\t// Mylist FileState\r\n\t\tif (mylistEntry.fstate && mylistEntry.fstate != 'unknown') {\r\n\t\t\tvar className = mapFState(mylistEntry.fstate);\r\n\t\t\tvar tooltip = 'mylist state: '+mylistEntry.fstate;\r\n\t\t\ticons['mylist_fstate'] = createLink(null, mylistEntry.fstate+' ', 'http://wiki.anidb.net/w/Filetype', 'anidb::wiki', null, tooltip, 'i_icon '+className);\r\n\t\t\t//createIcon(null, mylistEntry.fstate+' ', null, null, tooltip, className);\r\n\t\t}\r\n\t\tvar animeFL = anime.getTitle().charAt(0).toLowerCase();\r\n\t\t// Seen status\r\n\t\tif (mylistEntry.seen) \r\n\t\t\ticons['mylist_seen'] = createIcon(null, 'seen ', null, null, 'seen on: '+cTimeDateHour(mylistEntry.seenDate), 'i_seen');\r\n\t\t// mylist comment\r\n\t\tif ((mylistEntry.other) && (mylistEntry.other != '') && (mylistEntry.other != undefined)) \r\n\t\t\ticons['mylist_cmt'] = createIcon(null, 'mylist comment ', null, null, 'mylist comment: '+mylistEntry.other, 'i_comment');\r\n\t\t// mylist action\r\n\t\ticons['mylist_remove'] = createIcon(null, 'mylist.remove ', 'animedb.pl?show=mylist&do=del&lid='+mylistEntry.id+'&expand=' + file.animeId + '&showfiles=1&char='+animeFL+'#a'+file.animeId, null, 'remove from mylist', 'i_file_removemylist');\r\n\t\tif (mylistEntry.seen) \r\n\t\t\ticons['mylist_watch'] = createIcon(null, 'mylist.unwatch ', 'animedb.pl?show=mylist&do=seen&seen=0&lid='+mylistEntry.id+'&expand='+ file.animeId+'&showfiles=1&char='+animeFL+'#a'+file.animeId, null, 'mark unwatched', 'i_seen_no');\r\n\t\telse \r\n\t\t\ticons['mylist_watch'] = createIcon(null, 'mylist.watch ', 'animedb.pl?show=mylist&do=seen&seen=1&lid='+mylistEntry.id+'&expand='+file.animeId+'&showfiles=1&char='+animeFL+'#a'+file.animeId, null, 'mark watched', 'i_seen_yes');\r\n\t\ticons['mylist_edit'] = createIcon(null, 'mylist.edit ', 'animedb.pl?show=mylist&do=add&lid='+mylistEntry.id+'&fid='+mylistEntry.fileId, null, 'edit mylist entry', 'i_file_edit');\r\n\t} else {\r\n\t\t// mylist action\r\n\t\ticons['mylist_add'] = createIcon(null, 'mylist.add ', 'animedb.pl?show=mylist&do=add&fid=' + file.id, null, 'add to mylist', 'i_file_addmylist');\r\n\t}\r\n\t// ed2k\r\n\tif (uid != undefined && file.ed2k != '') {\r\n\t\tif (file.crcStatus != 'invalid') \r\n\t\t\ticons['ed2k'] = createIcon(null, 'ed2k', \"!fillme!\", null, 'ed2k hash', 'i_file_ed2k');\r\n\t\telse \r\n\t\t\ticons['ed2k'] = createIcon(null, 'ed2k.crc.bad', \"!fillme!\", null, 'ed2k hash (invalid CRC file)', 'i_file_ed2k_corrupt');\r\n\t}\r\n\t// Action icons\r\n\tif (file.type != 'generic') {\r\n\t\ticons['edit'] = createIcon(null, 'edit', 'animedb.pl?show=addfile&aid='+file.animeId+'&eid='+file.episodeId+'&edit='+file.id, null, 'edit', 'i_file_edit');\r\n\t\tvar qual = file.quality.replace(' ','');\r\n\t\ticons['quality'] = createIcon(null, file.quality, null, null, 'quality: '+file.quality, 'i_rate_'+qual);\r\n\t}\r\n\treturn icons;\r\n}", "function easeApiChanges (ipfs) {\n if (!ipfs) return\n // Handle the move of regular files api to top level\n // https://github.com/ipfs/interface-ipfs-core/pull/378\n // https://github.com/ipfs/js-ipfs/releases/tag/v0.34.0-pre.0\n movedFilesApis.forEach(cmd => {\n // Fix old backend (add new methods)\n if (typeof ipfs[cmd] !== 'function' && ipfs.files && typeof ipfs.files[cmd] === 'function') {\n ipfs[cmd] = ipfs.files[cmd]\n // console.log(`[ipfs-companion] fixed missing ipfs.${cmd}: added an alias for ipfs.files.${cmd}`)\n }\n // Fix new backend (add old methods)\n // This ensures ipfs-postmsg-proxy always works and can be migrated later\n if (ipfs.files && typeof ipfs.files[cmd] !== 'function' && typeof ipfs[cmd] === 'function') {\n ipfs.files[cmd] = ipfs[cmd]\n // console.log(`[ipfs-companion] fixed missing ipfs.files.${cmd}: added an alias for ipfs.${cmd}`)\n }\n })\n}", "function checkFileInfo(wopi, req, res, userHost) {\n let userAddress = req.docManager.curUserHostAddress(userHost);\n let version = req.docManager.getKey(wopi.id, userAddress);\n\n let path = req.docManager.storagePath(wopi.id, userAddress);\n // add wopi query\n var query = new URLSearchParams(wopi.accessToken);\n let user = users.getUser(query.get(\"userid\"));\n\n // create the file information object\n let fileInfo = {\n \"BaseFileName\": wopi.id,\n \"OwnerId\": req.docManager.getFileData(wopi.id, userAddress)[1],\n \"Size\": fileSystem.statSync(path).size,\n \"UserId\": user.id,\n \"UserFriendlyName\": user.name,\n \"Version\": version,\n \"UserCanWrite\": true,\n \"SupportsGetLock\": true,\n \"SupportsLocks\": true,\n \"SupportsUpdate\": true,\n };\n res.status(200).send(fileInfo);\n}", "function upload_files(form_id){\r\n\tvar url = $(\"#\" + form_id).prop(\"action\");\r\n if (url.lastIndexOf(\"master_id\") > 0){\r\n $.getJSON(url, function(files){\r\n var fu = $(\"#\" + form_id).data('blueimpFileupload'), template;\r\n fu._adjustMaxNumberOfFiles(-files.length);\r\n console.log(files);\r\n template = fu._renderDownload(files).appendTo($('#'+ form_id +' .files'));\r\n fu._reflow = fu._transition && template.length && template[0].offsetWidth;\r\n template.addClass('in');\r\n $('#loading').remove();\r\n });\r\n }\r\n\r\n}", "function loadShowUpdateFile(){\n\t$('a[data-tar=\"consultFile\"][data-loaded=\"0\"]').each(function(){\n\t\t$(this).on('click',function(e){\n\t\t\te.preventDefault();\n\t\t\tpre_fnloadFile($(this).attr(\"data-folio\"));\n\t\t\t$(this).attr(\"data-loaded\",\"1\");\n\t\t})\n\t});\n\t$('[data-btn=\"uploadFiles\"][data-loaded=\"0\"]').each(function(){\n\t\t$(this).on('click',function(e){\n\t\t\t$(\"#uploadFiles\").attr(\"data-grade\",$(this).attr(\"data-grade\"))\n\t\t\t\t\t\t\t .attr(\"data-period\",$(this).attr(\"data-period\"))\n\t\t\t\t\t\t\t .attr(\"data-document\",$(this).attr(\"data-document\"));\n\t\t});\n\t\t$(this).attr(\"data-loaded\",\"1\");\n\t});\n}", "handlePreregisteredExtensions() {\n window.MIP = window.MIP || {};\n window.MIP.push = extensions => {\n if (extensions && typeof extensions.func === 'function') {\n extensions.func();\n }\n };\n let preregisteredExtensions = window.MIP.extensions;\n if (preregisteredExtensions && preregisteredExtensions.length) {\n for (let i = 0; i < preregisteredExtensions.length; i++) {\n let curExtensionObj = preregisteredExtensions[i];\n if (curExtensionObj && typeof curExtensionObj.func === 'function') {\n curExtensionObj.func();\n }\n }\n }\n }", "async saveToIpfsWithFilename([file]) {\n const fileDetails = {\n path: file.name,\n content: file\n }\n const options = {\n wrapWithDirectory: true,\n progress: (prog) => console.log(`received: ${prog}`)\n }\n\n try {\n const added = await this.state.ipfs.add(fileDetails, options)\n console.log(added.cid.string)\n // Don't hate me for repeating this I'm just a lazy prototyper\n // call seallake with ipfs hash TODO sha256 or send file into env\n \n let hashofIpfsCID = SHA256(added.path);\n console.log(hashofIpfsCID);\n\n const body = {\n \"envelope\": {\n \"dataHash\": hashofIpfsCID.toString(),\n \"metadata\": {\n \"storage\": {\n \"url\": 'https://ipfs.io/ipfs/' + added.cid.string,\n \"contenttype\": \"text/html\"\n },\n \"location\": \"File Uploaded\",\n \"type\": \"File\",\n \"offer\": \"IPFS\",\n \"name\": \"Chrystler Building\"\n }\n }\n }\n \n const options1 = {\n method: 'POST',\n headers: {\n 'Accept': 'application/json'\n }\n }\n \n // const apiUrl1 = `http://ec2-100-20-87-209.us-west-2.compute.amazonaws.com/API/v1/envelope/gatsby1/` + added.path\n \n // const response = await fetch(apiUrl1, body, options1);\n fetch('https://plato.seallake.net/API/v1/envelope/ipfs/' + added.cid.string, {\n method: 'POST',\n body: JSON.stringify(body),\n headers: {\n 'Accept': 'application/json'\n },\n })\n .then(res => res.json())\n .then(json => console.log(json))\n .catch((error) => {\n console.error('Error:', error);\n });\n\n // cid is CID of the DAG node created by adding a link\n\n this.setState({\n added_file_hash: added.cid.toString()\n })\n\n } catch (err) {\n console.error(err)\n }\n }", "function get_barcode_info(fax_id,api_key,token){\n var url = \"https://api.sfaxme.com/api/InboundFaxInfo?token=\" + encodeURIComponent(token) + \"&apikey=\" + encodeURIComponent(api_key) + \"&FaxId=\" + encodeURIComponent(fax_id)\n try{\n var res = JSON.parse(UrlFetchApp.fetch(url).getContentText())\n return extract_fax_info(res)\n } catch(err){\n return err\n }\n}", "function handleUploadFile(req, res) {\n var domain = checkUserIpAddress(req, res);\n if (domain == null) return;\n if ((domain.id !== '') || (!req.session) || (req.session == null) || (!req.session.userid) || (domain.userQuota == -1)) { res.sendStatus(401); return; }\n var user = obj.users[req.session.userid];\n if ((user.siteadmin & 8) == 0) { res.sendStatus(401); return; } // Check if we have file rights\n\n var multiparty = require('multiparty');\n var form = new multiparty.Form();\n form.parse(req, function (err, fields, files) {\n if ((fields == null) || (fields.link == null) || (fields.link.length != 1)) { res.sendStatus(404); return; }\n var xfile = getServerFilePath(user, domain, decodeURIComponent(fields.link[0]));\n if (xfile == null) { res.sendStatus(404); return; }\n // Get total bytes in the path\n var totalsize = readTotalFileSize(xfile.fullpath);\n if (totalsize < xfile.quota) { // Check if the quota is not already broken\n if (fields.name != null) {\n // Upload method where all the file data is within the fields.\n var names = fields.name[0].split('*'), sizes = fields.size[0].split('*'), types = fields.type[0].split('*'), datas = fields.data[0].split('*');\n if ((names.length == sizes.length) && (types.length == datas.length) && (names.length == types.length)) {\n for (var i = 0; i < names.length; i++) {\n if (obj.common.IsFilenameValid(names[i]) == false) { res.sendStatus(404); return; }\n var filedata = new Buffer(datas[i].split(',')[1], 'base64');\n if ((totalsize + filedata.length) < xfile.quota) { // Check if quota would not be broken if we add this file\n obj.fs.writeFileSync(xfile.fullpath + '/' + names[i], filedata);\n }\n }\n }\n } else {\n // More typical upload method, the file data is in a multipart mime post.\n for (var i in files.files) {\n var file = files.files[i], fpath = xfile.fullpath + '/' + file.originalFilename;\n if (obj.common.IsFilenameValid(file.originalFilename) && ((totalsize + file.size) < xfile.quota)) { // Check if quota would not be broken if we add this file\n obj.fs.rename(file.path, fpath);\n } else {\n try { obj.fs.unlinkSync(file.path); } catch (e) { }\n }\n }\n }\n }\n res.send('');\n obj.parent.DispatchEvent([user._id], obj, 'updatefiles') // Fire an event causing this user to update this files\n });\n }", "_FBPReady() {\n super._FBPReady();\n\n }", "function add_file_of_point(uid, fobj) {\n var tmp={\"uid\":uid,\"file\":fobj.name};\n ucvm_point_file_list.push(tmp);\n}", "function GetFileIcon(ext,size)\n{\n if(typeof(size)===\"undefined\")\n size = \"small\";\n\n if(size==\"big\")\n var url = \"../../../../skin/images/body/icons/big/\";\n else\n var url = \"../../../../skin/images/body/icons/\";\n\n switch (ext) {\n case 'pdf':\n return url+\"pdf.png\";\n break;\n\n case 'avi':\n case 'mp4':\n return url+\"avi.png\";\n break;\n\n case 'wav':\n case 'mp3':\n return url+\"mp3.png\";\n break;\n\n case \"doc\":\n\t\tcase \"dot\":\n\t\tcase \"docx\":\n\t\tcase \"docm\":\n\t\tcase \"dotx\":\n\t\tcase \"dotm\":\n return url+\"doc.png\";\n break;\n\n case \"xls\":\n\t\tcase \"xlsx\":\n\t\tcase \"xlt\":\n\t\tcase \"xltx\":\n\t\tcase \"csv\":\n return url+\"xls.png\";\n break;\n\n case 'rar':\n case 'zip':\n return url+\"rar.png\";\n break;\n\n case \"ppt\":\n\t\tcase \"pot\":\n\t\tcase \"pps\":\n return url+\"ppt.png\";\n break;\n\n case \"eml\":\n return url+\"eml.png\";\n break;\n\n case \"bmp\":\n\t\tcase \"jpeg\":\n\t\tcase \"jpg\":\n\t\tcase \"png\":\n\t\t return \"self\";\n\t\tbreak;\n\n default: return url+\"txt.png\";\n }\n}", "function fetchInfo() {\n $scope.showProcessing = true;\n var url = apiPath + \"profile.php\";\n mediasoftHTTP.actionProcess(url, [{\n user_id: $rootScope.selectedID,\n type: 'users',\n\n }])\n .success(loadInfoSuccess)\n .error(loadError);\n }", "saveToIpfs (file) {\n let ipfsId\n const fileStream = fileReaderPullStream(file)\n this.ipfsApi.add(fileStream, { progress: (prog) => console.log(`received: ${prog}`) })\n .then((response) => {\n console.log(response)\n ipfsId = response[0].hash\n console.log(ipfsId)\n this.setState({added_file_hash: ipfsId})\n }).catch((err) => {\n console.error(err)\n })\n }", "function show_full_file(pi) {\n\tvar text = woas.get__text(pi);\n\tif (text===null)\n\t\treturn;\n\t// put WoaS in loading mode\n\twoas.progress_init(\"Loading full file\");\n\t// clear the partial display and put in the whole file content\n\twoas.setHTML(d$('_part_display'), '');\n\twoas.setHTML(d$('woas_file_ct'), woas.xhtml_encode(woas.base64.decode(text)));\n\t// finished loading the file\n\twoas.progress_finish();\n}", "addUserDataAndGetIPFS(value){\n //alert('here..2'+\"value\" +value +JSON.stringify(facebookProfileResult));\n var jsonData = JSON.stringify(facebookProfileResult);\n var self = this;\n webAPICall.postApiWithJosnDataInMainThread(addProfileJSON,jsonData,'POST').then((result) =>\n {\n if(result)\n {\n //alert(\"Adding User Data and GET IPFS Token \" + JSON.stringify(result));\n if(result.err){\n Alert.alert( 'Alert', 'Something went wrong while getting iPFS token.',\n [\n {text: 'OK', onPress: () => self.setState({loaderVisible:false})},\n ], { cancelable: false } );\n }else{\n userIpfs = result.ipfshash;\n //alert('userIpfs' +userIpfs)\n if(typeof userIpfs === 'undefined'){\n Alert.alert( 'Alert', 'Something went wrong while getting iPFS token.',\n [\n {text: 'OK', onPress: () => self.setState({loaderVisible:false})},\n ], { cancelable: false } );\n }else{\n AsyncStorage.setItem(\"userIpfs\", userIpfs === 'undefined'?'':userIpfs)\n if(value === '1'){\n self.openHomeScreen();\n }else{\n self.registerUserToCommuterz();\n }\n }\n\n }\n }\n }).done();\n}", "function ajaxReq(fileName1, imelem) {\n\n var linkArr = fileName1.split(\"/\");\n var lastElem = (linkArr.length)-1;\n var x = linkArr[lastElem];// 'x' holds file name with extenion\n var y = x.lastIndexOf(\".\");\n var fileName = x.substr(0,y);\n var jtext = fileName + \".json\";\n var abspath = window.location.origin;// Fetching absolute path\n var req = [abspath, \"/metaInfo/\", jtext].join(\"\");\n\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\",req, true);\n xmlhttp.send(\"\");\n xmlhttp.onreadystatechange = function(){\n if(xmlhttp.readyState==4 && xmlhttp.status==200){\n {\n var x = JSON.parse(xmlhttp.responseText);\n // Add other attributes to metaInfo\n if(imelem.tagName == 'IMG')\n {\n x.type = \"blob\";\n }\n else\n {\n x.type = \"stream\";\n }\n x.url = imelem.data_src;\n if(!staticFiles[x.infoHash])\n staticFiles[x.infoHash]= { \"element\": [imelem], \"metainfo\": x};\n else\n staticFiles[x.infoHash].element.push(imelem);\n // TODO : add error handling if we don't receive valid metainfo\n logger.DEBUG(xmlhttp.responseText)\n num_files_remaining--;\n if(num_files_remaining == 0)\n onComplete();\n }\n //return metOb;\n }\n }\n logger.DEBUG(\"Sending \"+req);\n myval = xmlhttp.onreadystatechange;\n }", "function powermailFileUploadLabel(){\n var inputs = document.querySelectorAll( '.form__input--file' );\n Array.prototype.forEach.call( inputs, function( input )\n {\n var label = input.nextElementSibling;\n var labelVal = label.lastChild.innerHTML;\n\n input.addEventListener( 'change', function( e )\n {\n var fileName = '';\n if( this.files && this.files.length > 1 )\n fileName = ( this.getAttribute( 'data-multiple-caption' ) || '' ).replace( '#count#', this.files.length );\n else\n fileName = e.target.value.split( '\\\\' ).pop();\n\n if( fileName )\n label.lastChild.innerHTML = fileName;\n else\n label.lastChild.innerHTML = labelVal;\n });\n });\n }", "function _trackFID() {\n onFID(metric => {\n const entry = metric.entries.pop();\n if (!entry) {\n return;\n }\n\n const timeOrigin = msToSec(browserPerformanceTimeOrigin );\n const startTime = msToSec(entry.startTime);\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Measurements] Adding FID');\n _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n });\n }", "function fetch(pmid) {\n\n // search for pdf\n var pdf_url = discover_pdf_url(pmid);\n if (!pdf_url) {\n notify.warning('fetch error'); return\n }\n var service = Components.classes[\"@mozilla.org/network/io-service;1\"]\n .getService(Components.interfaces.nsIIOService);\n var channel = service.newChannel(pdf_url, 0, null);\n var stream = channel.open();\n // check if found\n if (channel instanceof Components.interfaces.nsIHttpChannel && channel.responseStatus != 200) {\n notify.warning('fetch error'); return\n }\n // download if found\n var pdf_stream = Components.classes[\"@mozilla.org/binaryinputstream;1\"]\n .createInstance(Components.interfaces.nsIBinaryInputStream);\n pdf_stream.setInputStream(stream);\n var size = 0;\n var pdf = \"\";\n while(size = pdf_stream.available()) {\n pdf += pdf_stream.readBytes(size);\n }\n pdf_stream.close();\n // check if pdf\n if (!pdf.match(/^%PDF-1\\.\\d{1}/)) {\n notify.warning('fetch error'); return\n }\n // check size of pdf\n var max_filesize = 10*1048576; // 10 megabytes\n if (pdf.length > max_filesize) {\n notify.warning('fetch error'); return\n }\n\n // write pdf to a storage stream\n var binary_stream = Components.classes[\"@mozilla.org/binaryoutputstream;1\"].createInstance(Components.interfaces.nsIBinaryOutputStream);\n var storage_stream = Components.classes[\"@mozilla.org/storagestream;1\"].createInstance(Components.interfaces.nsIStorageStream);\n storage_stream.init(4096, pdf.length, null);\n binary_stream.setOutputStream(storage_stream.getOutputStream(0));\n binary_stream.writeBytes(pdf, pdf.length);\n binary_stream.close();\n\n // put to gae datastore\n var req_post = new XMLHttpRequest();\n req_post.open(\"POST\", url_for('articles', pmid, 'reprint'), true);\n req_post.setRequestHeader(\"Content-type\", \"application/pdf\");\n req_post.setRequestHeader(\"Content-length\", pdf.length);\n req_post.onload = function(e) {\n if (e.target.status == 200) {\n doc.location.href= url_for('articles', pmid, 'reprint');\n } else {\n notify.warning('fetch error'); return\n }\n };\n req_post.send(storage_stream.newInputStream(0));\n }", "function detailDataEfiling(respon, menu_title) {\n let data = respon.data;\n // ket Is_jenis 1 = Sefin, Is_jenis 2 = webtool\n let jenis_data = data.efilling['is_jenis'];\n let no_rekening = ((data.header_efiling== null)? '' : data.header_efiling['no_rekening'])\n\n $(\".custom-file-input\").attr({ // create atribut is jenis di form upload file\n \"is_jenis\": jenis_data\n })\n let path_file = data.efilling['folder_master'];\n let pathFileUpload = '';\n\n if (jenis_data == 2) {\n // link http://103.234.254.186/efiling/2018/03/02/02-38-00029-18/fatmah%20-%20PH.pdf\n let tgl_realisasi = '';\n let kode_kantor = '';\n let y = '';\n let m = '';\n let no_rek_webtool = '';\n if (data.efilling['no_rekening_lama'] == null) {\n no_rek_webtool = ((data.header_efiling == null) ? '' : data.header_efiling['no_rekening'])\n tgl_realisasi = ((data.header_efiling == null) ? '' : data.header_efiling['tgl_realisasi'])\n kode_kantor = ((data.header_efiling == null) ? '' : data.header_efiling['kode_kantor'])\n y = tgl_realisasi.split(\"-\")[2]\n m = tgl_realisasi.split(\"-\")[1]\n } else {\n no_rek_webtool = data.efilling['no_rekening_lama']\n tgl_realisasi = data.efilling['tgl_realisasi_eng_lama']\n kode_kantor = data.efilling['kode_kantor_lama']\n y = tgl_realisasi.split(\"-\")[0]\n m = tgl_realisasi.split(\"-\")[1]\n }\n\n pathFileUpload = `http://103.234.254.186/${path_file}/${y}/${m}/${kode_kantor}/${no_rek_webtool}/`;\n }else{\n pathFileUpload = `${path_file}/`;\n }\n\n $(\"#update_verifikasi_data\").attr({ // create atribut di btn update upload file\n \"jenis_data\": jenis_data\n });\n $('#nama_debitur').html(`Data E-Filling ${data.header_efiling['nama_debitur']}`) // inner nama debitur halaman edit & verifikasi\n \n // variable get data status verifikasi efilling\n let status_nasabah = data.efilling_nasabah['verifikasi_nasabah'];\n let status_permohonan = data.efilling_permohonan['verifikasi_permohonan'];\n let status_jaminan = data.efilling_jaminan['verifikasi_jaminan'];\n let status_bichecking = data.efilling_bichecking['verifikasi_bichecking'];\n let status_ca = data.efilling_ca['verifikasi_ca'];\n let status_legal = data.efilling_legal['verifikasi_legal'];\n let status_spkndk = data.efilling_spkndk['verifikasi_spkndk'];\n let status_foto = data.efilling_foto['verifikasi_foto'];\n\n // notes innerNotes (data notes, id inner html, status efiling)\n let notes_nasabah = innertNotes(data.efilling_nasabah['notes_nasabah'], \"verifikasi_nasabah\", status_nasabah, menu_title)\n let notes_bi_checking = innertNotes(data.efilling_bichecking['notes_bichecking'], \"verifikasi_bi_checking\", status_bichecking, menu_title)\n let notes_credit_analist = innertNotes(data.efilling_ca['notes_ca'], \"verifikasi_credit_analist\", status_ca, menu_title)\n let notes_foto = innertNotes(data.efilling_foto['notes_foto'], \"verifikasi_foto\", status_foto, menu_title)\n let notes_jaminan = innertNotes(data.efilling_jaminan['notes_jaminan'], \"verifikasi_jaminan\", status_jaminan, menu_title)\n let notes_legal = innertNotes(data.efilling_legal['notes_legal'], \"verifikasi_legal\", status_legal, menu_title)\n let notes_permohonan_kredit = innertNotes(data.efilling_permohonan['notes_permohonan'], \"verifikasi_premohonan_kredit\", status_permohonan, menu_title)\n let notes_spk_ndk = innertNotes(data.efilling_spkndk['notes_spkndk'], \"verifikasi_spk\", status_spkndk, menu_title)\n let menu = ''\n if (menu_title == 'Edit') {\n menu = '_edit'\n }\n // notes innerStatusVerifikasi(status, inner data to id, menu_title)\n let verifikasi_nasabah = innerStatusVerifikasi(status_nasabah, \"verifikasi_nasabah\", menu_title)\n let verifikasi_bi_checking = innerStatusVerifikasi(status_bichecking, \"verifikasi_bi_checking\", menu_title)\n let verifikasi_credit_analist = innerStatusVerifikasi(status_ca, \"verifikasi_credit_analist\", menu_title)\n let verifikasi_foto = innerStatusVerifikasi(status_foto, \"verifikasi_foto\", menu_title)\n let verifikasi_jaminan = innerStatusVerifikasi(status_jaminan, \"verifikasi_jaminan\", menu_title)\n let verifikasi_legal = innerStatusVerifikasi(status_legal, \"verifikasi_legal\", menu_title)\n let verifikasi_permohonan_kredit = innerStatusVerifikasi(status_permohonan, \"verifikasi_premohonan_kredit\", menu_title)\n let verifikasi_spk_ndk = innerStatusVerifikasi(status_spkndk, \"verifikasi_spk\", menu_title)\n /*Notes Function menu InnerListData(data, jenis data, pathUpload, id inner data ke html, no rekening )*/\n // Data nasabah\n let nasbah_ktp = innerListData(data.efilling_nasabah['ktp'],data.efilling_nasabah['ktp_nama'], jenis_data, pathFileUpload, \"ktp_all\", no_rekening);\n let nasabah_kk = innerListData(data.efilling_nasabah['kk'], data.efilling_nasabah['kk_nama'],jenis_data, pathFileUpload, \"kartu_keluarga\", no_rekening);\n let nasbah_npwp = innerListData(data.efilling_nasabah['npwp'], data.efilling_nasabah['npwp_nama'], jenis_data, pathFileUpload, \"inp_npwp\", no_rekening);\n let nasabah_surat_nikah = innerListData(data.efilling_nasabah['surat_nikah'], data.efilling_nasabah['surat_nikah_nama'], jenis_data, pathFileUpload, \"surat_nikah\", no_rekening);\n let nasabah_surat_cerai = innerListData(data.efilling_nasabah['surat_cerai'], data.efilling_nasabah['surat_cerai_nama'], jenis_data, pathFileUpload, \"surat_cerai\", no_rekening);\n let nasabah_surat_lahir = innerListData(data.efilling_nasabah['surat_lahir'], data.efilling_nasabah['surat_lahir_nama'], jenis_data, pathFileUpload, \"surat_lahir\", no_rekening);\n let nasabah_surat_kematian = innerListData(data.efilling_nasabah['surat_kematian'], data.efilling_nasabah['surat_kematian_nama'], jenis_data, pathFileUpload, \"surat_kematian\", no_rekening);\n let nasabah_skd = innerListData(data.efilling_nasabah['skd'], data.efilling_nasabah['skd_nama'], jenis_data, pathFileUpload, \"surat_keterangan_desa\", no_rekening);\n let nasabah_slip_gaji = innerListData(data.efilling_nasabah['slip_gaji'], data.efilling_nasabah['slip_gaji_nama'], jenis_data, pathFileUpload, \"slip_gaji\", no_rekening);\n let nasabah_take_over = innerListData(data.efilling_nasabah['take_over'], data.efilling_nasabah['take_over_nama'], jenis_data, pathFileUpload, \"take_over\", no_rekening);\n let nasabah_sk_kerja = innerListData(data.efilling_nasabah['sk_kerja'], data.efilling_nasabah['sk_kerja_nama'], jenis_data, pathFileUpload, \"surat_keterangan_kerja\", no_rekening);\n let nasabah_sk_usaha = innerListData(data.efilling_nasabah['sk_usaha'], data.efilling_nasabah['sk_usaha_nama'], jenis_data, pathFileUpload, \"surat_keterangan_usaha\", no_rekening);\n let nasabah_rek_koran = innerListData(data.efilling_nasabah['rek_koran'], data.efilling_nasabah['rek_koran_nama'], jenis_data, pathFileUpload, \"rekening_koran\", no_rekening);\n let nasabah_tdp = innerListData(data.efilling_nasabah['tdp'], data.efilling_nasabah['tdp_nama'], jenis_data, pathFileUpload, \"tdp_siup\", no_rekening);\n let nasabah_bon_usaha = innerListData(data.efilling_nasabah['bon_usaha'], data.efilling_nasabah['bon_usaha_nama'], jenis_data, pathFileUpload, \"bon_usaha\", no_rekening);\n // Data permohonan kredit\n let permohonan_kredit_aplikasi = innerListData(data.efilling_permohonan['aplikasi'], data.efilling_permohonan['aplikasi_nama'], jenis_data, pathFileUpload, \"aplikasi_permohonan_kredit\", no_rekening);\n let permohonan_kredit_denah_lokasi = innerListData(data.efilling_permohonan['denah_lokasi'], data.efilling_permohonan['denah_lokasi_nama'], jenis_data, pathFileUpload, \"denah_lokasi\", no_rekening);\n let permohonan_kredit_checklist_kelengkapan = innerListData(data.efilling_permohonan['checklist_kelengkapan'], data.efilling_permohonan['checklist_kelengkapan_nama'], jenis_data, pathFileUpload, \"kelengkapan_dokumen_kredit\", no_rekening);\n // Data jaminan\n let jaminan_adendum = innerListData(data.efilling_jaminan['adendum'], data.efilling_jaminan['adendum_nama'], jenis_data, pathFileUpload, \"jaminan_addendum\", no_rekening);\n let jaminan_ahli_waris = innerListData(data.efilling_jaminan['ahli_waris'], data.efilling_jaminan['ahli_waris_nama'], jenis_data, pathFileUpload, \"jaminan_ahli_waris\", no_rekening);\n let jaminan_ajb = innerListData(data.efilling_jaminan['ajb'], data.efilling_jaminan['ajb_nama'], jenis_data, pathFileUpload, \"jaminan_ajb\", no_rekening);\n let jaminan_akta_pengakuan_hak_bersama = innerListData(data.efilling_jaminan['akta_pengakuan_hak_bersama'], data.efilling_jaminan['akta_pengakuan_hak_bersama_nama'], jenis_data, pathFileUpload, \"jaminan_pengakuan_hak\", no_rekening);\n let jaminan_apht = innerListData(data.efilling_jaminan['apht'], data.efilling_jaminan['apht_nama'], jenis_data, pathFileUpload, \"jaminan_apht\", no_rekening);\n let jaminan_bpkb = innerListData(data.efilling_jaminan['bpkb'], data.efilling_jaminan['bpkb_nama'], jenis_data, pathFileUpload, \"jaminan_bpkb\", no_rekening);\n let jaminan_cabut_roya = innerListData(data.efilling_jaminan['cabut_roya'], data.efilling_jaminan['cabut_roya_nama'], jenis_data, pathFileUpload, \"jaminan_roya\", no_rekening);\n let jaminan_fidusia = innerListData(data.efilling_jaminan['fidusia'], data.efilling_jaminan['fidusia_nama'], jenis_data, pathFileUpload, \"jaminan_fidusia\", no_rekening);\n let jaminan_imb = innerListData(data.efilling_jaminan['imb'], data.efilling_jaminan['imb_nama'], jenis_data, pathFileUpload, \"jaminan_imb\", no_rekening);\n let jaminan_pbb = innerListData(data.efilling_jaminan['pbb'], data.efilling_jaminan['pbb_nama'], jenis_data, pathFileUpload, \"jaminan_pbb\", no_rekening);\n let jaminan_pengakuan_hutang = innerListData(data.efilling_jaminan['pengakuan_hutang'], data.efilling_jaminan['pengakuan_hutang_nama'], jenis_data, pathFileUpload, \"jaminan_pengakuan_hutang\", no_rekening);\n let jaminan_sertifikat = innerListData(data.efilling_jaminan['sertifikat'], data.efilling_jaminan['sertifikat_nama'], jenis_data, pathFileUpload, \"jaminan_sertifikat\", no_rekening);\n let jaminan_sht = innerListData(data.efilling_jaminan['sht'], data.efilling_jaminan['sht_nama'], jenis_data, pathFileUpload, \"jaminan_sht\", no_rekening);\n let jaminan_skmht = innerListData(data.efilling_jaminan['skmht'], data.efilling_jaminan['skmht_nama'], jenis_data, pathFileUpload, \"jaminan_skmht\", no_rekening);\n\n // Data bi checking\n let bi_checking_hasil = innerListData(data.efilling_bichecking['hasil'], data.efilling_bichecking['hasil_nama'], jenis_data, pathFileUpload, \"view_form_hasil_bi_checking\");\n let bi_checking_persetujuan = innerListData(data.efilling_bichecking['persetujuan'], data.efilling_bichecking['persetujuan_nama'], jenis_data, pathFileUpload, \"persetujuan_bi_checking\", no_rekening);\n let bi_checking_pengajuan_bi = innerListData(data.efilling_bichecking['pengajuan_bi'], data.efilling_bichecking['pengajuan_bi_nama'], jenis_data, pathFileUpload, \"pengajuan_bi_checking\", no_rekening);\n // Data credit analist\n let credit_analist_cheklist_survey = innerListData(data.efilling_ca['cheklist_survey'], data.efilling_ca['cheklist_survey_nama'], jenis_data, pathFileUpload, \"checklist_survey\", no_rekening);\n let credit_analist_memo_ao = innerListData(data.efilling_ca['memo_ao'], data.efilling_ca['memo_ao_nama'], jenis_data, pathFileUpload, \"credit_analist_memo_ao\", no_rekening);\n let credit_analist_memo_ca = innerListData(data.efilling_ca['memo_ca'], data.efilling_ca['memo_ca_nama'], jenis_data, pathFileUpload, \"credit_analist_memo_ca\", no_rekening);\n let credit_analist_offering_letter = innerListData(data.efilling_ca['offering_letter'], data.efilling_ca['offering_letter_nama'], jenis_data, pathFileUpload, \"offering_letter\", no_rekening);\n let credit_analist_penilaian_jaminan = innerListData(data.efilling_ca['penilaian_jaminan'], data.efilling_ca['penilaian_jaminan_nama'], jenis_data, pathFileUpload, \"verifikasi_penilaian\", no_rekening);\n let credit_analist_persetujuan_kredit = innerListData(data.efilling_ca['persetujuan_kredit'], data.efilling_ca['persetujuan_kredit_nama'], jenis_data, pathFileUpload, \"persetujuan_kredit\", no_rekening);\n // Data legal\n let legal_cheklist_pengikatan = innerListData(data.efilling_legal['cheklist_pengikatan'], data.efilling_legal['cheklist_pengikatan_nama'], jenis_data, pathFileUpload, \"check_pengikatan\", no_rekening);\n let legal_lpdk = innerListData(data.efilling_legal['lpdk'], data.efilling_legal['lpdk_nama'], jenis_data, pathFileUpload, \"lpdk\",no_rekening);\n let legal_order_pengikatan = innerListData(data.efilling_legal['order_pengikatan'], data.efilling_legal['order_pengikatan_nama'], jenis_data, pathFileUpload, \"oder_pengikatan\", no_rekening);\n let legal_pengajuan_lpdk = innerListData(data.efilling_legal['pengajuan_lpdk'], data.efilling_legal['pengajuan_lpdk_nama'], jenis_data, pathFileUpload, \"pengajuan\", no_rekening);\n // Data spk & ndk\n let spk_ndk_asuransi = innerListData(data.efilling_spkndk['asuransi'], data.efilling_spkndk['asuransi_nama'], jenis_data, pathFileUpload, \"asuransi\", no_rekening);\n let spk_ndk_hal_penting = innerListData(data.efilling_spkndk['hal_penting'], data.efilling_spkndk['hal_penting_nama'], jenis_data, pathFileUpload, \"hal_penting\", no_rekening);\n let spk_ndk_hold_dana = innerListData(data.efilling_spkndk['hold_dana'], data.efilling_spkndk['hold_dana_nama'], jenis_data, pathFileUpload, \"hold_dana\", no_rekening);\n let spk_ndk_jadwal_angsuran = innerListData(data.efilling_spkndk['jadwal_angsuran'], data.efilling_spkndk['jadwal_angsuran_nama'], jenis_data, pathFileUpload, \"jadwal_angsuran\", no_rekening);\n let spk_ndk_keabsahan_data = innerListData(data.efilling_spkndk['keabsahan_data'], data.efilling_spkndk['keabsahan_data_nama'], jenis_data, pathFileUpload, \"srt_keabsahan\", no_rekening);\n let spk_ndk_personal_guarantee = innerListData(data.efilling_spkndk['personal_guarantee'], data.efilling_spkndk['personal_guarantee_nama'], jenis_data, pathFileUpload, \"personal_guarantee\", no_rekening);\n let spk_ndk_restruktur_bunga_denda = innerListData(data.efilling_spkndk['restruktur_bunga_denda'], data.efilling_spkndk['restruktur_bunga_denda_nama'], jenis_data, pathFileUpload, \"denda\", no_rekening);\n let spk_ndk_sp_authentic = innerListData(data.efilling_spkndk['sp_authentic'], data.efilling_spkndk['sp_authentic_nama'], jenis_data, pathFileUpload, \"srt_auth\", no_rekening);\n let spk_ndk_sp_beda_jt_tempo = innerListData(data.efilling_spkndk['sp_beda_jt_tempo'], data.efilling_spkndk['sp_beda_jt_tempo_nama'], jenis_data, pathFileUpload, \"srt_jth_tempo\", no_rekening);\n let spk_ndk_sp_no_imb = innerListData(data.efilling_spkndk['sp_no_imb'], data.efilling_spkndk['sp_no_imb_nama'], jenis_data, pathFileUpload, \"sp_no_imb\", no_rekening);\n let spk_ndk_sp_pendebetan_rekening = innerListData(data.efilling_spkndk['sp_pendebetan_rekening'], data.efilling_spkndk['sp_pendebetan_rekening_nama'], jenis_data, pathFileUpload, \"pendebetan_rekening\", no_rekening);\n let spk_ndk_sp_penyerahan_jaminan = innerListData(data.efilling_spkndk['sp_penyerahan_jaminan'], data.efilling_spkndk['sp_penyerahan_jaminan_nama'], jenis_data, pathFileUpload, \"srt_penyerahan_jaminan\", no_rekening);\n let spk_ndk_sp_plang = innerListData(data.efilling_spkndk['sp_plang'], data.efilling_spkndk['sp_plang_nama'], jenis_data, pathFileUpload, \"sp_plang\", no_rekening);\n let spk_ndk_spk_ndk = innerListData(data.efilling_spkndk['spk_ndk'], data.efilling_spkndk['spk_ndk_nama'], jenis_data, pathFileUpload, \"spk\", no_rekening);\n let spk_ndk_surat_aksep = innerListData(data.efilling_spkndk['surat_aksep'], data.efilling_spkndk['surat_aksep_nama'], jenis_data, pathFileUpload, \"srt_aksep\", no_rekening);\n let spk_ndk_surat_transfer = innerListData(data.efilling_spkndk['surat_transfer'], data.efilling_spkndk['surat_transfer_nama'], jenis_data, pathFileUpload, \"srt_transfer\", no_rekening);\n let spk_ndk_tt_uang = innerListData(data.efilling_spkndk['tt_uang'], data.efilling_spkndk['tt_uang_nama'], jenis_data, pathFileUpload, \"tt_uang\", no_rekening);\n let spk_ndk_spajk_spa_fpk = innerListData(data.efilling_spkndk['spajk_spa_fpk'], data.efilling_spkndk['spajk_spa_fpk_nama'], jenis_data, pathFileUpload, \"spajk_spa_fpk\", no_rekening);\n // Data foto\n let foto_ft_domisili = innerListData(data.efilling_foto['ft_domisili'], data.efilling_foto['ft_domisili_nama'], jenis_data, pathFileUpload, \"foto_domisili\", no_rekening);\n let foto_ft_jaminan = innerListData(data.efilling_foto['ft_jaminan'], data.efilling_foto['ft_jaminan_nama'], jenis_data, pathFileUpload, \"foto_jaminan\", no_rekening);\n let foto_ft_pengikatan = innerListData(data.efilling_foto['ft_pengikatan'], data.efilling_foto['ft_pengikatan_nama'], jenis_data, pathFileUpload, \"foto_pengikatan\", no_rekening);\n let foto_ft_usaha = innerListData(data.efilling_foto['ft_usaha'], data.efilling_foto['ft_usaha_nama'], jenis_data, pathFileUpload, \"foto_usaha\", no_rekening);\n}", "saveToIpfsWithFilename (file) {\n let ipfsId\n const fileStream = fileReaderPullStream(file)\n const fileDetails = {\n path: file.name,\n content: fileStream\n }\n const options = {\n wrapWithDirectory: true,\n progress: (prog) => console.log(`received: ${prog}`)\n }\n this.ipfsApi.add(fileDetails, options)\n .then((response) => {\n console.log(response)\n // CID of wrapping directory is returned last\n ipfsId = response[response.length-1].hash\n console.log(ipfsId)\n this.setState({added_file_hash: ipfsId})\n }).catch((err) => {\n console.error(err)\n })\n }", "function supportFileAPI() {\r\n\t var fi = document.createElement('INPUT');\r\n\t fi.type = 'file';\r\n\t return 'files' in fi;\r\n\t }", "function getServerFileList(conf) {\r\n\t\tvar ts = \"?_=\" + new Date().getTime();// + Math.random();\r\n\t\tvar flist = conf.host + conf.list + ts;\r\n\t\tvar logLvl = conf.log;\r\n\t\t\r\n\t\tjQuery.ajax({ type: \"GET\", url: flist, processData: false})\r\n\t\t.done(function(data, status, jqXHR) {\r\n\t\t\t// jqXHR.done(function( data, textStatus, jqXHR ) {});\r\n\r\n\t\t\t\tvar files = jqXHR.responseText.readBracketedList();\r\n\t\t\t\tif (files) {\r\n\t\t\t\t\tgetAll(conf, files);\r\n\t\t\t\t\tlog(\"count\", conf.list + \" contains \" + files.length + \" elements\"); \r\n\t\t\t\t}\r\n\t\t\t} // .done\r\n\t\t).fail(function(jqXHR, textStatus, errorThrown) {\r\n\t\t\t// jqXHR.fail(function( jqXHR, textStatus, errorThrown ) {});\r\n\t\t\t\t\r\n\t\t\t\t// min loglvl error\r\n\t\t\t\t// log(\"error\", \"Error: External File Handling - loadExternalFiles.js\")\r\n\t\t\t\tlog(\"error\", \"ServerFileList not found. Check: \" + efc + \"!\")\r\n\t\t\t\tlog(\"error\", \"Using: ExternalFiles tiddler!\")\r\n\t\t\t\t\r\n\t\t\t\tfiles = store.getTiddlerText(\"ExternalFiles\")\r\n\t\t\t\tfiles = files ? files.readBracketedList() : [];\r\n\t\t\t\t\r\n\t\t\t\tif (files.length > 0) {\r\n\t\t\t\t\tgetAll(conf, files)\r\n\t\t\t\t}\r\n\t\t\t\telse { \r\n\t\t\t\t\tlog(\"error\", \" - ExternalFiles tiddler is empty!\")\r\n\t\t\t\t\tlog(\"tiddler\", \"------\")\r\n\t\t\t\t}\r\n\t\t\t} // .fail\r\n\t\t)\r\n\t} // function getServerFileList()", "function supportFileAPI() {\n var fi = document.createElement('INPUT');\n fi.type = 'file';\n return 'files' in fi;\n }", "function supportFileAPI() {\n var fi = document.createElement('INPUT');\n fi.type = 'file';\n return 'files' in fi;\n }", "function pullFile(){\n var i = 1;\n var xmlHttp = null;\n xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.responseText && xmlHttp.status == 200 && xmlHttp.readyState == 4) {\n var obj = jQuery.parseJSON( xmlHttp.responseText );\n $.each(obj, function() {\n FileName[FileName.length] = this['FileName'];\n File[File.length] = this['File']; \n });\n console.log(FileName);\n console.log(File);\n showfile();\n }\n };\n xmlHttp.open(\"GET\", \"https://mydesigncompany.herokuapp.com/portfolio\", true);\n //xmlHttp.open(\"GET\", \"https://infinite-stream-2919.herokuapp.com/portfolio\", true);\n xmlHttp.send(null);\n}", "function successCallbackWithFsCaching(resp, status, headers, config) {\n\t\t\tvar docs = [];\n\n\t\t\tvar totalEntries = resp.items.length;\n\n\t\t\tresp.items.forEach(function(entry, i) {\n\t\t\t\tvar doc = {\n\t\t\t\t\ttitle : entry.title,\n\t\t\t\t\tupdatedDate : Util.formatDate(entry.modifiedDate),\n\t\t\t\t\tupdatedDateFull : entry.modifiedDate,\n\t\t\t\t\ticon : entry.iconLink,\n\t\t\t\t\talternateLink : entry.alternateLink,\n\t\t\t\t\tsize : entry.fileSize ? '( ' + entry.fileSize + ' bytes)' : null\n\t\t\t\t};\n\n\t\t\t\t// 'http://gstatic.google.com/doc_icon_128.png' -> 'doc_icon_128.png'\n\t\t\t\tdoc.iconFilename = doc.icon.substring(doc.icon.lastIndexOf('/') + 1);\n\n\t\t\t\t// If file exists, it we'll get back a FileEntry for the filesystem URL.\n\t\t\t\t// Otherwise, the error callback will fire and we need to XHR it in and write it to the FS.\n\t\t\t\tvar fsURL = fs.root.toURL() + FOLDERNAME + '/' + doc.iconFilename;\n\t\t\t\twindow.webkitResolveLocalFileSystemURL(fsURL, function(entry) {\n\t\t\t\t\tconsole.log('Fetched icon from the FS cache');\n\n\t\t\t\t\tdoc.icon = entry.toURL(); // should\n\t\t\t\t\t// be === to fsURL, but whatevs.\n\n\t\t\t\t\t$scope.docs.push(doc);\n\n\t\t\t\t\t// Only want to sort and call $apply() when we have all entries.\n\t\t\t\t\tif (totalEntries - 1 == i) {\n\t\t\t\t\t\t$scope.docs.sort(Util.sortByDate);\n\t\t\t\t\t\t$scope.$apply(function($scope) {\n\t\t\t\t\t\t}); // Inform angular we made changes.\n\t\t\t\t\t}\n\t\t\t\t}, function(e) {\n\t\t\t\t\t$http.get(doc.icon, {\n\t\t\t\t\t\tresponseType : 'blob'\n\t\t\t\t\t}).success(function(blob) {\n\t\t\t\t\t\tconsole.log('Fetched icon via XHR');\n\t\t\t\t\t\tblob.name = doc.iconFilename; // Add icon filename to blob.\n\t\t\t\t\t\twriteFile(blob); // Write is async, but that's ok.\n\t\t\t\t\t\tdoc.icon = window.URL.createObjectURL(blob);\n\t\t\t\t\t\t$scope.docs.push(doc);\n\t\t\t\t\t\tif (totalEntries - 1 == i) {\n\t\t\t\t\t\t\t$scope.docs.sort(Util.sortByDate);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t});\n\t\t\t});\n\t\t}", "function FileUpload() {\n $('#bootstrapped-fine-uploader').fineUploader({\n template: 'qq-template-bootstrap',\n classes: {\n success: 'alert alert-success',\n fail: 'alert alert-error'\n },\n thumbnails: {\n placeholders: {\n waitingPath: \"../assets/fineuploader/waiting-generic.png\",\n notAvailablePath: \"../assets/fineuploader/not_available-generic.png\"\n }\n },\n request: {\n endpoint: appContext + '/fileUpload'\n },\n validation: {\n allowedExtensions: ['jpeg', 'jpg', 'gif', 'png']\n }\n });\n}", "function storage_initload() {\r\n\t$('body').bind('myfiles_storage_update', function(event) { \r\n\t\tstorage_refresh();\t\r\n\t}); \r\n}", "function uploadSignatureBase(filePath, upload)\n{ \n var apiFuncPath = '';\n if($('#USER_SIG_FILE'))\n {\n var spf = document.getElementById('USER_SIG_FILE');\n \n if(upload)\n {\n $('#userSigFileInput').val(spf.value.replace(/^.*[\\\\\\/]/, ''));\n apiFuncPath= \"/api/1/flash/uploadProjectSigFile\";\n }\n else//clear\n {\n $('#userSigFileInput').val('');\n apiFuncPath = \"/api/1/flash/deleteProjectSigFile\";\n }\n \n uploadSignature(spf.files, filePath, apiFuncPath);\n }\n}", "function APIcompatible(){\n return (window.File && window.FileReader && window.FileList && window.Blob);\n }", "function ajaxFileUpload(id,filename,module)\t\r\n{\t//alert(\"id,filename,module,imagename\"+id + \" \"+ filename+ \" \"+ module+ \" \"+ imagename);\r\n\tvar callurl=CMSSITEPATH+'/doajaxfileupload.php?elementname='+id;\t\r\n\t$.ajaxFileUpload\r\n\t\t(\r\n\t\t\t{\t\r\n\t\t\t\turl:callurl, \r\n\t\t\t\tsecureuri:false,\r\n\t\t\t\tfileElementId:id,\r\n\t\t\t\tfileElementName:filename,\r\n\t\t\t\tmoduleName:module,\r\n\t\t\t\tdataType: 'json',\r\n\t\t\t\tasync:false,\r\n\t\t\t\tsuccess: function (data, status)\r\n\t\t\t\t{\t//alert(data.msg);\r\n\t\t\t\t\tif(typeof(data.error) != 'undefined')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(data.error != '')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tvar set=0;\r\n\t\t\t\t\t\t\tsendrequest();\r\n\t\t\t\t\t\t}else{ \t\r\n\t\t\t\t\t\t\tsendrequest(data.msg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\terror: function (data, status, e)\r\n\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}", "function getFSInfo(fsid, token, callback) {\n var req;\n var path = '/webida/api/fs/' + fsid + '?access_token=' + token;\n var options = {\n hostname: internalAccessInfo.fs.host,\n port: internalAccessInfo.fs.port,\n path: path\n };\n logger.info('getFSInfo', {fsid, token, options});\n\n req = http.request(options, function (response) {\n var data = '';\n response.setEncoding('utf8');\n response.on('data', function (chunk) {\n data += chunk;\n });\n response.on('end', function () {\n if (response.statusCode === 200) {\n try {\n return callback(null, JSON.parse(data).data);\n } catch (e) {\n logger.error('Invalid fs response');\n return callback(new ServerError('Invalid fs response'));\n }\n } else if (response.statusCode === 401) {\n return callback(new ClientError(401, 'Not authorized'));\n } else {\n return callback(new ServerError('Internal error while check createPolicy authority.'));\n }\n });\n });\n\n req.on('error', function (e) {\n return callback(e);\n });\n\n req.end();\n}", "function setWebCrawlerExtraInfos(furl,session,exec){\n $jQ('body').attr(vars.htmlFile,furl+'.html');\n $jQ('body').attr(vars.imgFile,furl+'.png');\n $jQ('body').attr(vars.htmlFile+':original',furl+'_original.html');\n $jQ('body').attr(vars.imgFile+':original',furl+'_original.png');\n $jQ('body').attr(vars.session,session);\n $jQ('body').attr(vars.executionTime,exec);\n}", "function get_presigned_url(info){\n\tfile_manager.get_presigned_url(info)\n\t.then(\n\t\trequest_resolved_handler,\n\t\trequest_failure_handler\n\t);\n}", "function checkFiles(fObject){\r\n var files = {};\r\n if (fObject.natid) {\r\n files.nationalIDCard = { filePath: fObject.natid[0].filename };\r\n }\r\n if (fObject.npbil) {\r\n files.nepaBill = { filePath: fObject.npbil[0].filename };\r\n }\r\n if (fObject.dlsc) {\r\n files.driversLiscence = { filePath: fObject.dlsc[0].filename };\r\n }\n return files;\r\n}", "function showFFDCFileDialog(fname){\n\t\n\t // prepare the structure to query the server for key\n\t // message key is sent to the function\n\t var xhrArgs = {\n\t url: \"/ibm/console/ffdcFileViewServlet\",\n\t content: {\n\t filename: fname\n\t },\n handleAs: \"json\", // return value will be a json\n\t load: function(data){\n\t appInstallWaitHideProbDeter();\n\t // handle the invalid session scenario\n\t\t if (data.errors) {\n\t\t \t/*\n\t\t \t * clear all previous errors\n\t\t \t */\n\t\t var dlg = dijit.byId('errorDialog');\n\n\t\t dlg.processError(data);\n\t\t \n\t\t dlg.show();\n\t\t\n\t\t } else { \n\t\t\t // clear the field first\n\t\t dijit.byId(\"ffdcfile\").set('value', ' Empty to be filled by actual report. Only visible during error');\n\t\t // update the fields in the dialog box\n\t\t if (data.filecontent && data.filecontent[0]) {\n\t\t \tdijit.byId(\"ffdcfile\").set('value', data.filecontent[0]);\n\t\t }\n\t\t \n\t\t // find the message dialog and show it\n\t\t var dlgffdc = dijit.byId('FFDCFileDialog');\n\t\t dlgffdc.show();\n\t\t }\n\t },\n\t error: function(error){\n\t // show error when something goes wrong\n\t\n\t appInstallWaitHideProbDeter();\n\t var dlg = dijit.byId('errorDialog');\n\t dlg.clearAll();\n\t dlg.addError(nlsArray.ras_logviewer_showidError , dojo.toJson(error, true));\n\t dlg.show();\n\t\n\t console.error(\"Error during filter\", dojo.toJson(error, true));\n\t }\n\t };\n\t \n\t // send the data to server\n\t // it is ok to use get since cached information will be same\n\t var deferred = dojo.xhrGet(xhrArgs);\n\t appInstallWaitShowProbDeter();\n\t}", "function getCurrentFavs() {\n $.ajax({\n method: \"GET\",\n url: $protocol+\"//www.athabascau.ca/archive/course_program/cookie.php\",\n //url: \"http://alfresco-development.athabascau.ca/alfresco/athabasca-university-web-optimization-alfresco-development/archive/course_program/cookie.php\",\n }).done(function (msg) {\n $favList.html(msg);\n //Count number of items favorited\n getFavCount();\n });\n }" ]
[ "0.60156757", "0.5778784", "0.56302863", "0.54533035", "0.5324817", "0.5307998", "0.5301271", "0.5290196", "0.51995033", "0.5189064", "0.51858383", "0.5173228", "0.50666016", "0.5066317", "0.50652534", "0.50480527", "0.50440097", "0.5043728", "0.5040398", "0.5029752", "0.502251", "0.5004555", "0.49960786", "0.49916157", "0.49891293", "0.4980976", "0.49801546", "0.4978321", "0.4974399", "0.49665785", "0.49632493", "0.4953046", "0.49506238", "0.49477878", "0.4930773", "0.49306735", "0.492915", "0.49226487", "0.49215087", "0.49211648", "0.4919443", "0.49106574", "0.49015006", "0.48929825", "0.48923138", "0.48916996", "0.48839965", "0.48830393", "0.48797563", "0.48770532", "0.4874901", "0.48747885", "0.48722538", "0.48694548", "0.48667774", "0.48498276", "0.48475206", "0.48458833", "0.48382953", "0.48322353", "0.48312375", "0.48277274", "0.48259342", "0.48238373", "0.4821769", "0.48217595", "0.48157912", "0.48109534", "0.47968736", "0.47962666", "0.4795232", "0.47926816", "0.47862393", "0.4785794", "0.47853023", "0.4783683", "0.47802186", "0.47784305", "0.47655228", "0.47641706", "0.47639045", "0.4755722", "0.47455326", "0.47394085", "0.47368354", "0.47353002", "0.47353002", "0.47350043", "0.47349942", "0.47317234", "0.47263935", "0.47260833", "0.4724519", "0.47179818", "0.47095272", "0.47067142", "0.470556", "0.47013015", "0.46988004", "0.46986234" ]
0.51274467
12