id int32 0 58k | repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 |
|---|---|---|---|---|---|---|---|---|---|---|---|
18,900 | webduinoio/webduino-blockly | components/blockly-src/blocks/text.js | function() {
var container = document.createElement('mutation');
var isAt1 = this.getInput('AT1').type == Blockly.INPUT_VALUE;
container.setAttribute('at1', isAt1);
var isAt2 = this.getInput('AT2').type == Blockly.INPUT_VALUE;
container.setAttribute('at2', isAt2);
return container;
} | javascript | function() {
var container = document.createElement('mutation');
var isAt1 = this.getInput('AT1').type == Blockly.INPUT_VALUE;
container.setAttribute('at1', isAt1);
var isAt2 = this.getInput('AT2').type == Blockly.INPUT_VALUE;
container.setAttribute('at2', isAt2);
return container;
} | [
"function",
"(",
")",
"{",
"var",
"container",
"=",
"document",
".",
"createElement",
"(",
"'mutation'",
")",
";",
"var",
"isAt1",
"=",
"this",
".",
"getInput",
"(",
"'AT1'",
")",
".",
"type",
"==",
"Blockly",
".",
"INPUT_VALUE",
";",
"container",
".",
... | Create XML to represent whether there are 'AT' inputs.
@return {!Element} XML storage element.
@this Blockly.Block | [
"Create",
"XML",
"to",
"represent",
"whether",
"there",
"are",
"AT",
"inputs",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/text.js#L450-L457 | |
18,901 | webduinoio/webduino-blockly | components/blockly-src/blocks/text.js | function(xmlElement) {
var isAt1 = (xmlElement.getAttribute('at1') == 'true');
var isAt2 = (xmlElement.getAttribute('at2') == 'true');
this.updateAt_(1, isAt1);
this.updateAt_(2, isAt2);
} | javascript | function(xmlElement) {
var isAt1 = (xmlElement.getAttribute('at1') == 'true');
var isAt2 = (xmlElement.getAttribute('at2') == 'true');
this.updateAt_(1, isAt1);
this.updateAt_(2, isAt2);
} | [
"function",
"(",
"xmlElement",
")",
"{",
"var",
"isAt1",
"=",
"(",
"xmlElement",
".",
"getAttribute",
"(",
"'at1'",
")",
"==",
"'true'",
")",
";",
"var",
"isAt2",
"=",
"(",
"xmlElement",
".",
"getAttribute",
"(",
"'at2'",
")",
"==",
"'true'",
")",
";",... | Parse XML to restore the 'AT' inputs.
@param {!Element} xmlElement XML storage element.
@this Blockly.Block | [
"Parse",
"XML",
"to",
"restore",
"the",
"AT",
"inputs",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/text.js#L463-L468 | |
18,902 | webduinoio/webduino-blockly | components/blockly-src/blocks/text.js | function() {
var OPERATORS =
[[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE, 'UPPERCASE'],
[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE, 'LOWERCASE'],
[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE, 'TITLECASE']];
this.setHelpUrl(Blockly.Msg.TEXT_CHANGECASE_HELPURL);
this.set... | javascript | function() {
var OPERATORS =
[[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE, 'UPPERCASE'],
[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE, 'LOWERCASE'],
[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE, 'TITLECASE']];
this.setHelpUrl(Blockly.Msg.TEXT_CHANGECASE_HELPURL);
this.set... | [
"function",
"(",
")",
"{",
"var",
"OPERATORS",
"=",
"[",
"[",
"Blockly",
".",
"Msg",
".",
"TEXT_CHANGECASE_OPERATOR_UPPERCASE",
",",
"'UPPERCASE'",
"]",
",",
"[",
"Blockly",
".",
"Msg",
".",
"TEXT_CHANGECASE_OPERATOR_LOWERCASE",
",",
"'LOWERCASE'",
"]",
",",
"... | Block for changing capitalization.
@this Blockly.Block | [
"Block",
"for",
"changing",
"capitalization",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/text.js#L524-L536 | |
18,903 | webduinoio/webduino-blockly | components/blockly-src/blocks/text.js | function() {
this.jsonInit({
"message0": Blockly.Msg.TEXT_PRINT_TITLE,
"args0": [
{
"type": "input_value",
"name": "TEXT"
}
],
"previousStatement": null,
"nextStatement": null,
"colour": Blockly.Blocks.texts.HUE,
"tooltip": Blockly.Msg.TE... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.TEXT_PRINT_TITLE,
"args0": [
{
"type": "input_value",
"name": "TEXT"
}
],
"previousStatement": null,
"nextStatement": null,
"colour": Blockly.Blocks.texts.HUE,
"tooltip": Blockly.Msg.TE... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"TEXT_PRINT_TITLE",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"input_value\"",
",",
"\"name\"",
":",
"\"TEXT\"",
"}",
"]",
",",
"\"pr... | Block for print statement.
@this Blockly.Block | [
"Block",
"for",
"print",
"statement",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/text.js#L564-L579 | |
18,904 | webduinoio/webduino-blockly | components/blockly-src/blocks/logic.js | function(xmlElement) {
this.elseifCount_ = parseInt(xmlElement.getAttribute('elseif'), 10) || 0;
this.elseCount_ = parseInt(xmlElement.getAttribute('else'), 10) || 0;
this.updateShape_();
} | javascript | function(xmlElement) {
this.elseifCount_ = parseInt(xmlElement.getAttribute('elseif'), 10) || 0;
this.elseCount_ = parseInt(xmlElement.getAttribute('else'), 10) || 0;
this.updateShape_();
} | [
"function",
"(",
"xmlElement",
")",
"{",
"this",
".",
"elseifCount_",
"=",
"parseInt",
"(",
"xmlElement",
".",
"getAttribute",
"(",
"'elseif'",
")",
",",
"10",
")",
"||",
"0",
";",
"this",
".",
"elseCount_",
"=",
"parseInt",
"(",
"xmlElement",
".",
"getA... | Parse XML to restore the else-if and else inputs.
@param {!Element} xmlElement XML storage element.
@this Blockly.Block | [
"Parse",
"XML",
"to",
"restore",
"the",
"else",
"-",
"if",
"and",
"else",
"inputs",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/logic.js#L94-L98 | |
18,905 | webduinoio/webduino-blockly | components/blockly-src/blocks/logic.js | function(containerBlock) {
var clauseBlock = containerBlock.nextConnection.targetBlock();
var i = 1;
while (clauseBlock) {
switch (clauseBlock.type) {
case 'controls_if_elseif':
var inputIf = this.getInput('IF' + i);
var inputDo = this.getInput('DO' + i);
clauseBl... | javascript | function(containerBlock) {
var clauseBlock = containerBlock.nextConnection.targetBlock();
var i = 1;
while (clauseBlock) {
switch (clauseBlock.type) {
case 'controls_if_elseif':
var inputIf = this.getInput('IF' + i);
var inputDo = this.getInput('DO' + i);
clauseBl... | [
"function",
"(",
"containerBlock",
")",
"{",
"var",
"clauseBlock",
"=",
"containerBlock",
".",
"nextConnection",
".",
"targetBlock",
"(",
")",
";",
"var",
"i",
"=",
"1",
";",
"while",
"(",
"clauseBlock",
")",
"{",
"switch",
"(",
"clauseBlock",
".",
"type",... | Store pointers to any connected child blocks.
@param {!Blockly.Block} containerBlock Root block in mutator.
@this Blockly.Block | [
"Store",
"pointers",
"to",
"any",
"connected",
"child",
"blocks",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/logic.js#L165-L190 | |
18,906 | webduinoio/webduino-blockly | components/blockly-src/blocks/logic.js | function() {
this.setColour(Blockly.Blocks.logic.HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.CONTROLS_IF_IF_TITLE_IF);
this.setNextStatement(true);
this.setTooltip(Blockly.Msg.CONTROLS_IF_IF_TOOLTIP);
this.contextMenu = false;
} | javascript | function() {
this.setColour(Blockly.Blocks.logic.HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.CONTROLS_IF_IF_TITLE_IF);
this.setNextStatement(true);
this.setTooltip(Blockly.Msg.CONTROLS_IF_IF_TOOLTIP);
this.contextMenu = false;
} | [
"function",
"(",
")",
"{",
"this",
".",
"setColour",
"(",
"Blockly",
".",
"Blocks",
".",
"logic",
".",
"HUE",
")",
";",
"this",
".",
"appendDummyInput",
"(",
")",
".",
"appendField",
"(",
"Blockly",
".",
"Msg",
".",
"CONTROLS_IF_IF_TITLE_IF",
")",
";",
... | Mutator block for if container.
@this Blockly.Block | [
"Mutator",
"block",
"for",
"if",
"container",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/logic.js#L227-L234 | |
18,907 | webduinoio/webduino-blockly | components/blockly-src/blocks/logic.js | function() {
this.setColour(Blockly.Blocks.logic.HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF);
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip(Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP);
this.contextMenu = false;
} | javascript | function() {
this.setColour(Blockly.Blocks.logic.HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF);
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip(Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP);
this.contextMenu = false;
} | [
"function",
"(",
")",
"{",
"this",
".",
"setColour",
"(",
"Blockly",
".",
"Blocks",
".",
"logic",
".",
"HUE",
")",
";",
"this",
".",
"appendDummyInput",
"(",
")",
".",
"appendField",
"(",
"Blockly",
".",
"Msg",
".",
"CONTROLS_IF_ELSEIF_TITLE_ELSEIF",
")",
... | Mutator bolck for else-if condition.
@this Blockly.Block | [
"Mutator",
"bolck",
"for",
"else",
"-",
"if",
"condition",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/logic.js#L242-L250 | |
18,908 | webduinoio/webduino-blockly | components/blockly-src/blocks/logic.js | function() {
this.setColour(Blockly.Blocks.logic.HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE);
this.setPreviousStatement(true);
this.setTooltip(Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP);
this.contextMenu = false;
} | javascript | function() {
this.setColour(Blockly.Blocks.logic.HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE);
this.setPreviousStatement(true);
this.setTooltip(Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP);
this.contextMenu = false;
} | [
"function",
"(",
")",
"{",
"this",
".",
"setColour",
"(",
"Blockly",
".",
"Blocks",
".",
"logic",
".",
"HUE",
")",
";",
"this",
".",
"appendDummyInput",
"(",
")",
".",
"appendField",
"(",
"Blockly",
".",
"Msg",
".",
"CONTROLS_IF_ELSE_TITLE_ELSE",
")",
";... | Mutator block for else condition.
@this Blockly.Block | [
"Mutator",
"block",
"for",
"else",
"condition",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/logic.js#L258-L265 | |
18,909 | webduinoio/webduino-blockly | components/blockly-src/blocks/logic.js | function() {
var OPERATORS = this.RTL ? [
['=', 'EQ'],
['\u2260', 'NEQ'],
['>', 'LT'],
['\u2265', 'LTE'],
['<', 'GT'],
['\u2264', 'GTE']
] : [
['=', 'EQ'],
['\u2260', 'NEQ'],
['<', 'LT'],
['\u2264', 'LTE'],
... | javascript | function() {
var OPERATORS = this.RTL ? [
['=', 'EQ'],
['\u2260', 'NEQ'],
['>', 'LT'],
['\u2265', 'LTE'],
['<', 'GT'],
['\u2264', 'GTE']
] : [
['=', 'EQ'],
['\u2260', 'NEQ'],
['<', 'LT'],
['\u2264', 'LTE'],
... | [
"function",
"(",
")",
"{",
"var",
"OPERATORS",
"=",
"this",
".",
"RTL",
"?",
"[",
"[",
"'='",
",",
"'EQ'",
"]",
",",
"[",
"'\\u2260'",
",",
"'NEQ'",
"]",
",",
"[",
"'>'",
",",
"'LT'",
"]",
",",
"[",
"'\\u2265'",
",",
"'LTE'",
"]",
",",
"[",
"... | Block for comparison operator.
@this Blockly.Block | [
"Block",
"for",
"comparison",
"operator",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/logic.js#L273-L311 | |
18,910 | webduinoio/webduino-blockly | components/blockly-src/blocks/logic.js | function(e) {
var blockA = this.getInputTargetBlock('A');
var blockB = this.getInputTargetBlock('B');
// Disconnect blocks that existed prior to this change if they don't match.
if (blockA && blockB &&
!blockA.outputConnection.checkType_(blockB.outputConnection)) {
// Mismatch between two ... | javascript | function(e) {
var blockA = this.getInputTargetBlock('A');
var blockB = this.getInputTargetBlock('B');
// Disconnect blocks that existed prior to this change if they don't match.
if (blockA && blockB &&
!blockA.outputConnection.checkType_(blockB.outputConnection)) {
// Mismatch between two ... | [
"function",
"(",
"e",
")",
"{",
"var",
"blockA",
"=",
"this",
".",
"getInputTargetBlock",
"(",
"'A'",
")",
";",
"var",
"blockB",
"=",
"this",
".",
"getInputTargetBlock",
"(",
"'B'",
")",
";",
"// Disconnect blocks that existed prior to this change if they don't matc... | Called whenever anything on the workspace changes.
Prevent mismatched types from being compared.
@param {!Blockly.Events.Abstract} e Change event.
@this Blockly.Block | [
"Called",
"whenever",
"anything",
"on",
"the",
"workspace",
"changes",
".",
"Prevent",
"mismatched",
"types",
"from",
"being",
"compared",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/logic.js#L318-L338 | |
18,911 | webduinoio/webduino-blockly | components/blockly-src/blocks/logic.js | function() {
this.jsonInit({
"message0": Blockly.Msg.LOGIC_NEGATE_TITLE,
"args0": [
{
"type": "input_value",
"name": "BOOL",
"check": "Boolean"
}
],
"output": "Boolean",
"colour": Blockly.Blocks.logic.HUE,
"tooltip": Blockly.Msg.LOGIC... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.LOGIC_NEGATE_TITLE,
"args0": [
{
"type": "input_value",
"name": "BOOL",
"check": "Boolean"
}
],
"output": "Boolean",
"colour": Blockly.Blocks.logic.HUE,
"tooltip": Blockly.Msg.LOGIC... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"LOGIC_NEGATE_TITLE",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"input_value\"",
",",
"\"name\"",
":",
"\"BOOL\"",
",",
"\"check\"",
":... | Block for negation.
@this Blockly.Block | [
"Block",
"for",
"negation",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/logic.js#L377-L392 | |
18,912 | webduinoio/webduino-blockly | components/blockly-src/blocks/logic.js | function() {
this.jsonInit({
"message0": Blockly.Msg.LOGIC_NULL,
"output": null,
"colour": Blockly.Blocks.logic.HUE,
"tooltip": Blockly.Msg.LOGIC_NULL_TOOLTIP,
"helpUrl": Blockly.Msg.LOGIC_NULL_HELPURL
});
} | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.LOGIC_NULL,
"output": null,
"colour": Blockly.Blocks.logic.HUE,
"tooltip": Blockly.Msg.LOGIC_NULL_TOOLTIP,
"helpUrl": Blockly.Msg.LOGIC_NULL_HELPURL
});
} | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"LOGIC_NULL",
",",
"\"output\"",
":",
"null",
",",
"\"colour\"",
":",
"Blockly",
".",
"Blocks",
".",
"logic",
".",
"HUE",
",",
"\"tooltip\"",
... | Block for null data type.
@this Blockly.Block | [
"Block",
"for",
"null",
"data",
"type",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/logic.js#L426-L434 | |
18,913 | webduinoio/webduino-blockly | components/blockly-src/blocks/logic.js | function() {
this.setHelpUrl(Blockly.Msg.LOGIC_TERNARY_HELPURL);
this.setColour(Blockly.Blocks.logic.HUE);
this.appendValueInput('IF')
.setCheck('Boolean')
.appendField(Blockly.Msg.LOGIC_TERNARY_CONDITION);
this.appendValueInput('THEN')
.appendField(Blockly.Msg.LOGIC_TERNARY_IF_T... | javascript | function() {
this.setHelpUrl(Blockly.Msg.LOGIC_TERNARY_HELPURL);
this.setColour(Blockly.Blocks.logic.HUE);
this.appendValueInput('IF')
.setCheck('Boolean')
.appendField(Blockly.Msg.LOGIC_TERNARY_CONDITION);
this.appendValueInput('THEN')
.appendField(Blockly.Msg.LOGIC_TERNARY_IF_T... | [
"function",
"(",
")",
"{",
"this",
".",
"setHelpUrl",
"(",
"Blockly",
".",
"Msg",
".",
"LOGIC_TERNARY_HELPURL",
")",
";",
"this",
".",
"setColour",
"(",
"Blockly",
".",
"Blocks",
".",
"logic",
".",
"HUE",
")",
";",
"this",
".",
"appendValueInput",
"(",
... | Block for ternary operator.
@this Blockly.Block | [
"Block",
"for",
"ternary",
"operator",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/logic.js#L442-L455 | |
18,914 | webduinoio/webduino-blockly | components/blockly-src/blocks/logic.js | function(e) {
var blockA = this.getInputTargetBlock('THEN');
var blockB = this.getInputTargetBlock('ELSE');
var parentConnection = this.outputConnection.targetConnection;
// Disconnect blocks that existed prior to this change if they don't match.
if ((blockA || blockB) && parentConnection) {
f... | javascript | function(e) {
var blockA = this.getInputTargetBlock('THEN');
var blockB = this.getInputTargetBlock('ELSE');
var parentConnection = this.outputConnection.targetConnection;
// Disconnect blocks that existed prior to this change if they don't match.
if ((blockA || blockB) && parentConnection) {
f... | [
"function",
"(",
"e",
")",
"{",
"var",
"blockA",
"=",
"this",
".",
"getInputTargetBlock",
"(",
"'THEN'",
")",
";",
"var",
"blockB",
"=",
"this",
".",
"getInputTargetBlock",
"(",
"'ELSE'",
")",
";",
"var",
"parentConnection",
"=",
"this",
".",
"outputConnec... | Called whenever anything on the workspace changes.
Prevent mismatched types.
@param {!Blockly.Events.Abstract} e Change event.
@this Blockly.Block | [
"Called",
"whenever",
"anything",
"on",
"the",
"workspace",
"changes",
".",
"Prevent",
"mismatched",
"types",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/logic.js#L462-L485 | |
18,915 | webduinoio/webduino-blockly | components/blockly-src/core/flyout.js | function(e) {
var blocks = this.workspace_.getTopBlocks(false);
for (var i = 0, block; block = blocks[i]; i++) {
block.removeSelect();
}
} | javascript | function(e) {
var blocks = this.workspace_.getTopBlocks(false);
for (var i = 0, block; block = blocks[i]; i++) {
block.removeSelect();
}
} | [
"function",
"(",
"e",
")",
"{",
"var",
"blocks",
"=",
"this",
".",
"workspace_",
".",
"getTopBlocks",
"(",
"false",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"block",
";",
"block",
"=",
"blocks",
"[",
"i",
"]",
";",
"i",
"++",
")",
"{",
... | IE 11 is an incompetant browser that fails to fire mouseout events. When the mouse is over the background, deselect all blocks. | [
"IE",
"11",
"is",
"an",
"incompetant",
"browser",
"that",
"fails",
"to",
"fire",
"mouseout",
"events",
".",
"When",
"the",
"mouse",
"is",
"over",
"the",
"background",
"deselect",
"all",
"blocks",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/core/flyout.js#L455-L460 | |
18,916 | webduinoio/webduino-blockly | components/blockly-src/demos/plane/blocks.js | function() {
this.setHelpUrl(Blockly.Msg.VARIABLES_SET_HELPURL);
this.setColour(330);
this.appendValueInput('VALUE')
.appendField(Plane.getMsg('Plane_setSeats'));
this.setTooltip(Blockly.Msg.VARIABLES_SET_TOOLTIP);
this.setDeletable(false);
} | javascript | function() {
this.setHelpUrl(Blockly.Msg.VARIABLES_SET_HELPURL);
this.setColour(330);
this.appendValueInput('VALUE')
.appendField(Plane.getMsg('Plane_setSeats'));
this.setTooltip(Blockly.Msg.VARIABLES_SET_TOOLTIP);
this.setDeletable(false);
} | [
"function",
"(",
")",
"{",
"this",
".",
"setHelpUrl",
"(",
"Blockly",
".",
"Msg",
".",
"VARIABLES_SET_HELPURL",
")",
";",
"this",
".",
"setColour",
"(",
"330",
")",
";",
"this",
".",
"appendValueInput",
"(",
"'VALUE'",
")",
".",
"appendField",
"(",
"Plan... | Block seat variable setter. | [
"Block",
"seat",
"variable",
"setter",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/demos/plane/blocks.js#L28-L35 | |
18,917 | webduinoio/webduino-blockly | components/blockly-src/demos/plane/blocks.js | function() {
this.setHelpUrl(Blockly.Msg.VARIABLES_GET_HELPURL);
this.setColour(330);
this.appendDummyInput()
.appendField(Plane.getMsg('Plane_getRows2'), 'title');
this.setOutput(true, 'Number');
} | javascript | function() {
this.setHelpUrl(Blockly.Msg.VARIABLES_GET_HELPURL);
this.setColour(330);
this.appendDummyInput()
.appendField(Plane.getMsg('Plane_getRows2'), 'title');
this.setOutput(true, 'Number');
} | [
"function",
"(",
")",
"{",
"this",
".",
"setHelpUrl",
"(",
"Blockly",
".",
"Msg",
".",
"VARIABLES_GET_HELPURL",
")",
";",
"this",
".",
"setColour",
"(",
"330",
")",
";",
"this",
".",
"appendDummyInput",
"(",
")",
".",
"appendField",
"(",
"Plane",
".",
... | Block for second class row variable getter. | [
"Block",
"for",
"second",
"class",
"row",
"variable",
"getter",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/demos/plane/blocks.js#L87-L93 | |
18,918 | webduinoio/webduino-blockly | components/blockly-src/demos/blockfactory/factory.js | formatChange | function formatChange() {
var mask = document.getElementById('blocklyMask');
var languagePre = document.getElementById('languagePre');
var languageTA = document.getElementById('languageTA');
if (document.getElementById('format').value == 'Manual') {
Blockly.hideChaff();
mask.style.display = 'block';
... | javascript | function formatChange() {
var mask = document.getElementById('blocklyMask');
var languagePre = document.getElementById('languagePre');
var languageTA = document.getElementById('languageTA');
if (document.getElementById('format').value == 'Manual') {
Blockly.hideChaff();
mask.style.display = 'block';
... | [
"function",
"formatChange",
"(",
")",
"{",
"var",
"mask",
"=",
"document",
".",
"getElementById",
"(",
"'blocklyMask'",
")",
";",
"var",
"languagePre",
"=",
"document",
".",
"getElementById",
"(",
"'languagePre'",
")",
";",
"var",
"languageTA",
"=",
"document"... | Change the language code format. | [
"Change",
"the",
"language",
"code",
"format",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/demos/blockfactory/factory.js#L46-L66 |
18,919 | webduinoio/webduino-blockly | components/blockly-src/demos/blockfactory/factory.js | updateLanguage | function updateLanguage() {
var rootBlock = getRootBlock();
if (!rootBlock) {
return;
}
var blockType = rootBlock.getFieldValue('NAME').trim().toLowerCase();
if (!blockType) {
blockType = UNNAMED;
}
blockType = blockType.replace(/\W/g, '_').replace(/^(\d)/, '_\\1');
switch (document.getElementBy... | javascript | function updateLanguage() {
var rootBlock = getRootBlock();
if (!rootBlock) {
return;
}
var blockType = rootBlock.getFieldValue('NAME').trim().toLowerCase();
if (!blockType) {
blockType = UNNAMED;
}
blockType = blockType.replace(/\W/g, '_').replace(/^(\d)/, '_\\1');
switch (document.getElementBy... | [
"function",
"updateLanguage",
"(",
")",
"{",
"var",
"rootBlock",
"=",
"getRootBlock",
"(",
")",
";",
"if",
"(",
"!",
"rootBlock",
")",
"{",
"return",
";",
"}",
"var",
"blockType",
"=",
"rootBlock",
".",
"getFieldValue",
"(",
"'NAME'",
")",
".",
"trim",
... | Update the language code based on constructs made in Blockly. | [
"Update",
"the",
"language",
"code",
"based",
"on",
"constructs",
"made",
"in",
"Blockly",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/demos/blockfactory/factory.js#L71-L91 |
18,920 | webduinoio/webduino-blockly | components/blockly-src/demos/blockfactory/factory.js | formatJavaScript_ | function formatJavaScript_(blockType, rootBlock) {
var code = [];
code.push("Blockly.Blocks['" + blockType + "'] = {");
code.push(" init: function() {");
// Generate inputs.
var TYPES = {'input_value': 'appendValueInput',
'input_statement': 'appendStatementInput',
'input_dummy':... | javascript | function formatJavaScript_(blockType, rootBlock) {
var code = [];
code.push("Blockly.Blocks['" + blockType + "'] = {");
code.push(" init: function() {");
// Generate inputs.
var TYPES = {'input_value': 'appendValueInput',
'input_statement': 'appendStatementInput',
'input_dummy':... | [
"function",
"formatJavaScript_",
"(",
"blockType",
",",
"rootBlock",
")",
"{",
"var",
"code",
"=",
"[",
"]",
";",
"code",
".",
"push",
"(",
"\"Blockly.Blocks['\"",
"+",
"blockType",
"+",
"\"'] = {\"",
")",
";",
"code",
".",
"push",
"(",
"\" init: function()... | Update the language code as JavaScript.
@param {string} blockType Name of block.
@param {!Blockly.Block} rootBlock Factory_base block.
@return {string} Generanted language code.
@private | [
"Update",
"the",
"language",
"code",
"as",
"JavaScript",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/demos/blockfactory/factory.js#L202-L272 |
18,921 | webduinoio/webduino-blockly | components/blockly-src/demos/blockfactory/factory.js | connectionLineJs_ | function connectionLineJs_(functionName, typeName) {
var type = getOptTypesFrom(getRootBlock(), typeName);
if (type) {
type = ', ' + type;
} else {
type = '';
}
return ' this.' + functionName + '(true' + type + ');';
} | javascript | function connectionLineJs_(functionName, typeName) {
var type = getOptTypesFrom(getRootBlock(), typeName);
if (type) {
type = ', ' + type;
} else {
type = '';
}
return ' this.' + functionName + '(true' + type + ');';
} | [
"function",
"connectionLineJs_",
"(",
"functionName",
",",
"typeName",
")",
"{",
"var",
"type",
"=",
"getOptTypesFrom",
"(",
"getRootBlock",
"(",
")",
",",
"typeName",
")",
";",
"if",
"(",
"type",
")",
"{",
"type",
"=",
"', '",
"+",
"type",
";",
"}",
"... | Create JS code required to create a top, bottom, or value connection.
@param {string} functionName JavaScript function name.
@param {string} typeName Name of type input.
@return {string} Line of JavaScript code to create connection.
@private | [
"Create",
"JS",
"code",
"required",
"to",
"create",
"a",
"top",
"bottom",
"or",
"value",
"connection",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/demos/blockfactory/factory.js#L281-L289 |
18,922 | webduinoio/webduino-blockly | components/blockly-src/demos/blockfactory/factory.js | updatePreview | function updatePreview() {
// Toggle between LTR/RTL if needed (also used in first display).
var newDir = document.getElementById('direction').value;
if (oldDir != newDir) {
if (previewWorkspace) {
previewWorkspace.dispose();
}
var rtl = newDir == 'rtl';
previewWorkspace = Blockly.inject('pr... | javascript | function updatePreview() {
// Toggle between LTR/RTL if needed (also used in first display).
var newDir = document.getElementById('direction').value;
if (oldDir != newDir) {
if (previewWorkspace) {
previewWorkspace.dispose();
}
var rtl = newDir == 'rtl';
previewWorkspace = Blockly.inject('pr... | [
"function",
"updatePreview",
"(",
")",
"{",
"// Toggle between LTR/RTL if needed (also used in first display).",
"var",
"newDir",
"=",
"document",
".",
"getElementById",
"(",
"'direction'",
")",
".",
"value",
";",
"if",
"(",
"oldDir",
"!=",
"newDir",
")",
"{",
"if",... | Update the preview display. | [
"Update",
"the",
"preview",
"display",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/demos/blockfactory/factory.js#L612-L696 |
18,923 | webduinoio/webduino-blockly | components/blockly-src/demos/blockfactory/factory.js | getRootBlock | function getRootBlock() {
var blocks = mainWorkspace.getTopBlocks(false);
for (var i = 0, block; block = blocks[i]; i++) {
if (block.type == 'factory_base') {
return block;
}
}
return null;
} | javascript | function getRootBlock() {
var blocks = mainWorkspace.getTopBlocks(false);
for (var i = 0, block; block = blocks[i]; i++) {
if (block.type == 'factory_base') {
return block;
}
}
return null;
} | [
"function",
"getRootBlock",
"(",
")",
"{",
"var",
"blocks",
"=",
"mainWorkspace",
".",
"getTopBlocks",
"(",
"false",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"block",
";",
"block",
"=",
"blocks",
"[",
"i",
"]",
";",
"i",
"++",
")",
"{",
"... | Return the uneditable container block that everything else attaches to.
@return {Blockly.Block} | [
"Return",
"the",
"uneditable",
"container",
"block",
"that",
"everything",
"else",
"attaches",
"to",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/demos/blockfactory/factory.js#L716-L724 |
18,924 | webduinoio/webduino-blockly | components/blockly-src/demos/blockfactory/factory.js | init | function init() {
if ('BlocklyStorage' in window) {
BlocklyStorage.HTTPREQUEST_ERROR =
'There was a problem with the request.\n';
BlocklyStorage.LINK_ALERT =
'Share your blocks with this link:\n\n%1';
BlocklyStorage.HASH_ERROR =
'Sorry, "%1" doesn\'t correspond with any saved Block... | javascript | function init() {
if ('BlocklyStorage' in window) {
BlocklyStorage.HTTPREQUEST_ERROR =
'There was a problem with the request.\n';
BlocklyStorage.LINK_ALERT =
'Share your blocks with this link:\n\n%1';
BlocklyStorage.HASH_ERROR =
'Sorry, "%1" doesn\'t correspond with any saved Block... | [
"function",
"init",
"(",
")",
"{",
"if",
"(",
"'BlocklyStorage'",
"in",
"window",
")",
"{",
"BlocklyStorage",
".",
"HTTPREQUEST_ERROR",
"=",
"'There was a problem with the request.\\n'",
";",
"BlocklyStorage",
".",
"LINK_ALERT",
"=",
"'Share your blocks with this link:\\n... | Initialize Blockly and layout. Called on page load. | [
"Initialize",
"Blockly",
"and",
"layout",
".",
"Called",
"on",
"page",
"load",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/demos/blockfactory/factory.js#L737-L804 |
18,925 | webduinoio/webduino-blockly | components/blockly-src/blocks/math.js | function() {
this.setHelpUrl(Blockly.Msg.MATH_NUMBER_HELPURL);
this.setColour(Blockly.Blocks.math.HUE);
this.appendDummyInput()
.appendField(new Blockly.FieldTextInput('0',
Blockly.FieldTextInput.numberValidator), 'NUM');
this.setOutput(true, 'Number');
// Assign 'this' to a variable... | javascript | function() {
this.setHelpUrl(Blockly.Msg.MATH_NUMBER_HELPURL);
this.setColour(Blockly.Blocks.math.HUE);
this.appendDummyInput()
.appendField(new Blockly.FieldTextInput('0',
Blockly.FieldTextInput.numberValidator), 'NUM');
this.setOutput(true, 'Number');
// Assign 'this' to a variable... | [
"function",
"(",
")",
"{",
"this",
".",
"setHelpUrl",
"(",
"Blockly",
".",
"Msg",
".",
"MATH_NUMBER_HELPURL",
")",
";",
"this",
".",
"setColour",
"(",
"Blockly",
".",
"Blocks",
".",
"math",
".",
"HUE",
")",
";",
"this",
".",
"appendDummyInput",
"(",
")... | Block for numeric value.
@this Blockly.Block | [
"Block",
"for",
"numeric",
"value",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/math.js#L42-L56 | |
18,926 | webduinoio/webduino-blockly | components/blockly-src/blocks/math.js | function() {
this.jsonInit({
"message0": "%1 %2 %3",
"args0": [
{
"type": "input_value",
"name": "A",
"check": "Number"
},
{
"type": "field_dropdown",
"name": "OP",
"options":
[[Blockly.Msg.MATH_ADDITION_SYMB... | javascript | function() {
this.jsonInit({
"message0": "%1 %2 %3",
"args0": [
{
"type": "input_value",
"name": "A",
"check": "Number"
},
{
"type": "field_dropdown",
"name": "OP",
"options":
[[Blockly.Msg.MATH_ADDITION_SYMB... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"\"%1 %2 %3\"",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"input_value\"",
",",
"\"name\"",
":",
"\"A\"",
",",
"\"check\"",
":",
"\"Number\"",
"}",
",",
"{",
"\"... | Block for basic arithmetic operator.
@this Blockly.Block | [
"Block",
"for",
"basic",
"arithmetic",
"operator",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/math.js#L64-L107 | |
18,927 | webduinoio/webduino-blockly | components/blockly-src/blocks/math.js | function() {
this.jsonInit({
"message0": "%1 %2",
"args0": [
{
"type": "field_dropdown",
"name": "OP",
"options": [
[Blockly.Msg.MATH_SINGLE_OP_ROOT, 'ROOT'],
[Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE, 'ABS'],
['-', 'NEG'],
... | javascript | function() {
this.jsonInit({
"message0": "%1 %2",
"args0": [
{
"type": "field_dropdown",
"name": "OP",
"options": [
[Blockly.Msg.MATH_SINGLE_OP_ROOT, 'ROOT'],
[Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE, 'ABS'],
['-', 'NEG'],
... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"\"%1 %2\"",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
"\"name\"",
":",
"\"OP\"",
",",
"\"options\"",
":",
"[",
"[",
"Blockly",
".",
"Ms... | Block for advanced math operators with single operand.
@this Blockly.Block | [
"Block",
"for",
"advanced",
"math",
"operators",
"with",
"single",
"operand",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/math.js#L115-L157 | |
18,928 | webduinoio/webduino-blockly | components/blockly-src/blocks/math.js | function() {
this.jsonInit({
"message0": "%1 %2",
"args0": [
{
"type": "field_dropdown",
"name": "OP",
"options": [
[Blockly.Msg.MATH_TRIG_SIN, 'SIN'],
[Blockly.Msg.MATH_TRIG_COS, 'COS'],
[Blockly.Msg.MATH_TRIG_TAN, 'TAN'],
... | javascript | function() {
this.jsonInit({
"message0": "%1 %2",
"args0": [
{
"type": "field_dropdown",
"name": "OP",
"options": [
[Blockly.Msg.MATH_TRIG_SIN, 'SIN'],
[Blockly.Msg.MATH_TRIG_COS, 'COS'],
[Blockly.Msg.MATH_TRIG_TAN, 'TAN'],
... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"\"%1 %2\"",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
"\"name\"",
":",
"\"OP\"",
",",
"\"options\"",
":",
"[",
"[",
"Blockly",
".",
"Ms... | Block for trigonometry operators.
@this Blockly.Block | [
"Block",
"for",
"trigonometry",
"operators",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/math.js#L165-L205 | |
18,929 | webduinoio/webduino-blockly | components/blockly-src/blocks/math.js | function() {
var PROPERTIES =
[[Blockly.Msg.MATH_IS_EVEN, 'EVEN'],
[Blockly.Msg.MATH_IS_ODD, 'ODD'],
[Blockly.Msg.MATH_IS_PRIME, 'PRIME'],
[Blockly.Msg.MATH_IS_WHOLE, 'WHOLE'],
[Blockly.Msg.MATH_IS_POSITIVE, 'POSITIVE'],
[Blockly.Msg.MATH_IS_NEGATIVE, 'NEGATIVE']... | javascript | function() {
var PROPERTIES =
[[Blockly.Msg.MATH_IS_EVEN, 'EVEN'],
[Blockly.Msg.MATH_IS_ODD, 'ODD'],
[Blockly.Msg.MATH_IS_PRIME, 'PRIME'],
[Blockly.Msg.MATH_IS_WHOLE, 'WHOLE'],
[Blockly.Msg.MATH_IS_POSITIVE, 'POSITIVE'],
[Blockly.Msg.MATH_IS_NEGATIVE, 'NEGATIVE']... | [
"function",
"(",
")",
"{",
"var",
"PROPERTIES",
"=",
"[",
"[",
"Blockly",
".",
"Msg",
".",
"MATH_IS_EVEN",
",",
"'EVEN'",
"]",
",",
"[",
"Blockly",
".",
"Msg",
".",
"MATH_IS_ODD",
",",
"'ODD'",
"]",
",",
"[",
"Blockly",
".",
"Msg",
".",
"MATH_IS_PRIM... | Block for checking if a number is even, odd, prime, whole, positive,
negative or if it is divisible by certain number.
@this Blockly.Block | [
"Block",
"for",
"checking",
"if",
"a",
"number",
"is",
"even",
"odd",
"prime",
"whole",
"positive",
"negative",
"or",
"if",
"it",
"is",
"divisible",
"by",
"certain",
"number",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/math.js#L244-L265 | |
18,930 | webduinoio/webduino-blockly | components/blockly-src/blocks/math.js | function() {
this.jsonInit({
"message0": Blockly.Msg.MATH_CHANGE_TITLE,
"args0": [
{
"type": "field_variable",
"name": "VAR",
"variable": Blockly.Msg.MATH_CHANGE_TITLE_ITEM
},
{
"type": "input_value",
"name": "DELTA",
"c... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.MATH_CHANGE_TITLE,
"args0": [
{
"type": "field_variable",
"name": "VAR",
"variable": Blockly.Msg.MATH_CHANGE_TITLE_ITEM
},
{
"type": "input_value",
"name": "DELTA",
"c... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"MATH_CHANGE_TITLE",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_variable\"",
",",
"\"name\"",
":",
"\"VAR\"",
",",
"\"variable\"",
... | Block for adding to a variable in place.
@this Blockly.Block | [
"Block",
"for",
"adding",
"to",
"a",
"variable",
"in",
"place",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/math.js#L311-L337 | |
18,931 | webduinoio/webduino-blockly | components/blockly-src/blocks/math.js | function() {
this.jsonInit({
"message0": "%1 %2",
"args0": [
{
"type": "field_dropdown",
"name": "OP",
"options": [
[Blockly.Msg.MATH_ROUND_OPERATOR_ROUND, 'ROUND'],
[Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP, 'ROUNDUP'],
[Blockly.M... | javascript | function() {
this.jsonInit({
"message0": "%1 %2",
"args0": [
{
"type": "field_dropdown",
"name": "OP",
"options": [
[Blockly.Msg.MATH_ROUND_OPERATOR_ROUND, 'ROUND'],
[Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP, 'ROUNDUP'],
[Blockly.M... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"\"%1 %2\"",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
"\"name\"",
":",
"\"OP\"",
",",
"\"options\"",
":",
"[",
"[",
"Blockly",
".",
"Ms... | Block for rounding functions.
@this Blockly.Block | [
"Block",
"for",
"rounding",
"functions",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/math.js#L345-L369 | |
18,932 | webduinoio/webduino-blockly | components/blockly-src/blocks/math.js | function() {
this.jsonInit({
"message0": Blockly.Msg.MATH_MODULO_TITLE,
"args0": [
{
"type": "input_value",
"name": "DIVIDEND",
"check": "Number"
},
{
"type": "input_value",
"name": "DIVISOR",
"check": "Number"
}... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.MATH_MODULO_TITLE,
"args0": [
{
"type": "input_value",
"name": "DIVIDEND",
"check": "Number"
},
{
"type": "input_value",
"name": "DIVISOR",
"check": "Number"
}... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"MATH_MODULO_TITLE",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"input_value\"",
",",
"\"name\"",
":",
"\"DIVIDEND\"",
",",
"\"check\"",
... | Block for remainder of a division.
@this Blockly.Block | [
"Block",
"for",
"remainder",
"of",
"a",
"division",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/math.js#L452-L473 | |
18,933 | webduinoio/webduino-blockly | components/blockly-src/blocks/math.js | function() {
this.jsonInit({
"message0": Blockly.Msg.MATH_CONSTRAIN_TITLE,
"args0": [
{
"type": "input_value",
"name": "VALUE",
"check": "Number"
},
{
"type": "input_value",
"name": "LOW",
"check": "Number"
},
... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.MATH_CONSTRAIN_TITLE,
"args0": [
{
"type": "input_value",
"name": "VALUE",
"check": "Number"
},
{
"type": "input_value",
"name": "LOW",
"check": "Number"
},
... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"MATH_CONSTRAIN_TITLE",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"input_value\"",
",",
"\"name\"",
":",
"\"VALUE\"",
",",
"\"check\"",
... | Block for constraining a number between two limits.
@this Blockly.Block | [
"Block",
"for",
"constraining",
"a",
"number",
"between",
"two",
"limits",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/math.js#L481-L507 | |
18,934 | webduinoio/webduino-blockly | components/blockly-src/blocks/math.js | function() {
this.jsonInit({
"message0": Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM,
"output": "Number",
"colour": Blockly.Blocks.math.HUE,
"tooltip": Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP,
"helpUrl": Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL
});
} | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM,
"output": "Number",
"colour": Blockly.Blocks.math.HUE,
"tooltip": Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP,
"helpUrl": Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL
});
} | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"MATH_RANDOM_FLOAT_TITLE_RANDOM",
",",
"\"output\"",
":",
"\"Number\"",
",",
"\"colour\"",
":",
"Blockly",
".",
"Blocks",
".",
"math",
".",
"HUE",
... | Block for random fraction between 0 and 1.
@this Blockly.Block | [
"Block",
"for",
"random",
"fraction",
"between",
"0",
"and",
"1",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/math.js#L544-L552 | |
18,935 | webduinoio/webduino-blockly | components/blockly-src/generators/php/lists.js | cacheList | function cacheList() {
if (list.match(/^\w+$/)) {
return '';
}
var listVar = Blockly.PHP.variableDB_.getDistinctName(
'tmp_list', Blockly.Variables.NAME_TYPE);
var code = listVar + ' = &' + list + ';\n';
list = listVar;
return code;
} | javascript | function cacheList() {
if (list.match(/^\w+$/)) {
return '';
}
var listVar = Blockly.PHP.variableDB_.getDistinctName(
'tmp_list', Blockly.Variables.NAME_TYPE);
var code = listVar + ' = &' + list + ';\n';
list = listVar;
return code;
} | [
"function",
"cacheList",
"(",
")",
"{",
"if",
"(",
"list",
".",
"match",
"(",
"/",
"^\\w+$",
"/",
")",
")",
"{",
"return",
"''",
";",
"}",
"var",
"listVar",
"=",
"Blockly",
".",
"PHP",
".",
"variableDB_",
".",
"getDistinctName",
"(",
"'tmp_list'",
",... | Cache non-trivial values to variables to prevent repeated look-ups. Closure, which accesses and modifies 'list'. | [
"Cache",
"non",
"-",
"trivial",
"values",
"to",
"variables",
"to",
"prevent",
"repeated",
"look",
"-",
"ups",
".",
"Closure",
"which",
"accesses",
"and",
"modifies",
"list",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/generators/php/lists.js#L236-L245 |
18,936 | webduinoio/webduino-blockly | components/blockly-src/blocks/lists.js | function() {
this.setHelpUrl(Blockly.Msg.LISTS_CREATE_WITH_HELPURL);
this.setColour(Blockly.Blocks.lists.HUE);
this.itemCount_ = 3;
this.updateShape_();
this.setOutput(true, 'Array');
this.setMutator(new Blockly.Mutator(['lists_create_with_item']));
this.setTooltip(Blockly.Msg.LISTS_CREATE_W... | javascript | function() {
this.setHelpUrl(Blockly.Msg.LISTS_CREATE_WITH_HELPURL);
this.setColour(Blockly.Blocks.lists.HUE);
this.itemCount_ = 3;
this.updateShape_();
this.setOutput(true, 'Array');
this.setMutator(new Blockly.Mutator(['lists_create_with_item']));
this.setTooltip(Blockly.Msg.LISTS_CREATE_W... | [
"function",
"(",
")",
"{",
"this",
".",
"setHelpUrl",
"(",
"Blockly",
".",
"Msg",
".",
"LISTS_CREATE_WITH_HELPURL",
")",
";",
"this",
".",
"setColour",
"(",
"Blockly",
".",
"Blocks",
".",
"lists",
".",
"HUE",
")",
";",
"this",
".",
"itemCount_",
"=",
"... | Block for creating a list with any number of elements of any type.
@this Blockly.Block | [
"Block",
"for",
"creating",
"a",
"list",
"with",
"any",
"number",
"of",
"elements",
"of",
"any",
"type",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/lists.js#L62-L70 | |
18,937 | webduinoio/webduino-blockly | components/blockly-src/blocks/lists.js | function() {
this.setColour(Blockly.Blocks.lists.HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE);
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP);
this.contextMenu = false;
} | javascript | function() {
this.setColour(Blockly.Blocks.lists.HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE);
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP);
this.contextMenu = false;
} | [
"function",
"(",
")",
"{",
"this",
".",
"setColour",
"(",
"Blockly",
".",
"Blocks",
".",
"lists",
".",
"HUE",
")",
";",
"this",
".",
"appendDummyInput",
"(",
")",
".",
"appendField",
"(",
"Blockly",
".",
"Msg",
".",
"LISTS_CREATE_WITH_ITEM_TITLE",
")",
"... | Mutator bolck for adding items.
@this Blockly.Block | [
"Mutator",
"bolck",
"for",
"adding",
"items",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/lists.js#L201-L209 | |
18,938 | webduinoio/webduino-blockly | components/blockly-src/blocks/lists.js | function() {
this.jsonInit({
"message0": Blockly.Msg.LISTS_REPEAT_TITLE,
"args0": [
{
"type": "input_value",
"name": "ITEM"
},
{
"type": "input_value",
"name": "NUM",
"check": "Number"
}
],
"output": "Array",
... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.LISTS_REPEAT_TITLE,
"args0": [
{
"type": "input_value",
"name": "ITEM"
},
{
"type": "input_value",
"name": "NUM",
"check": "Number"
}
],
"output": "Array",
... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"LISTS_REPEAT_TITLE",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"input_value\"",
",",
"\"name\"",
":",
"\"ITEM\"",
"}",
",",
"{",
"\"... | Block for creating a list with one element repeated.
@this Blockly.Block | [
"Block",
"for",
"creating",
"a",
"list",
"with",
"one",
"element",
"repeated",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/lists.js#L217-L236 | |
18,939 | webduinoio/webduino-blockly | components/blockly-src/blocks/lists.js | function() {
this.jsonInit({
"message0": Blockly.Msg.LISTS_LENGTH_TITLE,
"args0": [
{
"type": "input_value",
"name": "VALUE",
"check": ['String', 'Array']
}
],
"output": 'Number',
"colour": Blockly.Blocks.lists.HUE,
"tooltip": Blockly... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.LISTS_LENGTH_TITLE,
"args0": [
{
"type": "input_value",
"name": "VALUE",
"check": ['String', 'Array']
}
],
"output": 'Number',
"colour": Blockly.Blocks.lists.HUE,
"tooltip": Blockly... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"LISTS_LENGTH_TITLE",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"input_value\"",
",",
"\"name\"",
":",
"\"VALUE\"",
",",
"\"check\"",
"... | Block for list length.
@this Blockly.Block | [
"Block",
"for",
"list",
"length",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/lists.js#L244-L259 | |
18,940 | webduinoio/webduino-blockly | components/blockly-src/blocks/lists.js | function() {
this.jsonInit({
"message0": Blockly.Msg.LISTS_ISEMPTY_TITLE,
"args0": [
{
"type": "input_value",
"name": "VALUE",
"check": ['String', 'Array']
}
],
"output": 'Boolean',
"colour": Blockly.Blocks.lists.HUE,
"tooltip": Block... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.LISTS_ISEMPTY_TITLE,
"args0": [
{
"type": "input_value",
"name": "VALUE",
"check": ['String', 'Array']
}
],
"output": 'Boolean',
"colour": Blockly.Blocks.lists.HUE,
"tooltip": Block... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"LISTS_ISEMPTY_TITLE",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"input_value\"",
",",
"\"name\"",
":",
"\"VALUE\"",
",",
"\"check\"",
... | Block for is the list empty?
@this Blockly.Block | [
"Block",
"for",
"is",
"the",
"list",
"empty?"
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/lists.js#L267-L282 | |
18,941 | webduinoio/webduino-blockly | components/blockly-src/blocks/lists.js | function() {
var MODE =
[[Blockly.Msg.LISTS_GET_INDEX_GET, 'GET'],
[Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE, 'GET_REMOVE'],
[Blockly.Msg.LISTS_GET_INDEX_REMOVE, 'REMOVE']];
this.WHERE_OPTIONS =
[[Blockly.Msg.LISTS_GET_INDEX_FROM_START, 'FROM_START'],
[Blockly.Msg.LISTS_... | javascript | function() {
var MODE =
[[Blockly.Msg.LISTS_GET_INDEX_GET, 'GET'],
[Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE, 'GET_REMOVE'],
[Blockly.Msg.LISTS_GET_INDEX_REMOVE, 'REMOVE']];
this.WHERE_OPTIONS =
[[Blockly.Msg.LISTS_GET_INDEX_FROM_START, 'FROM_START'],
[Blockly.Msg.LISTS_... | [
"function",
"(",
")",
"{",
"var",
"MODE",
"=",
"[",
"[",
"Blockly",
".",
"Msg",
".",
"LISTS_GET_INDEX_GET",
",",
"'GET'",
"]",
",",
"[",
"Blockly",
".",
"Msg",
".",
"LISTS_GET_INDEX_GET_REMOVE",
",",
"'GET_REMOVE'",
"]",
",",
"[",
"Blockly",
".",
"Msg",
... | Block for getting element at index.
@this Blockly.Block | [
"Block",
"for",
"getting",
"element",
"at",
"index",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/lists.js#L312-L350 | |
18,942 | webduinoio/webduino-blockly | components/blockly-src/blocks/lists.js | function() {
var container = document.createElement('mutation');
var isStatement = !this.outputConnection;
container.setAttribute('statement', isStatement);
var isAt = this.getInput('AT').type == Blockly.INPUT_VALUE;
container.setAttribute('at', isAt);
return container;
} | javascript | function() {
var container = document.createElement('mutation');
var isStatement = !this.outputConnection;
container.setAttribute('statement', isStatement);
var isAt = this.getInput('AT').type == Blockly.INPUT_VALUE;
container.setAttribute('at', isAt);
return container;
} | [
"function",
"(",
")",
"{",
"var",
"container",
"=",
"document",
".",
"createElement",
"(",
"'mutation'",
")",
";",
"var",
"isStatement",
"=",
"!",
"this",
".",
"outputConnection",
";",
"container",
".",
"setAttribute",
"(",
"'statement'",
",",
"isStatement",
... | Create XML to represent whether the block is a statement or a value.
Also represent whether there is an 'AT' input.
@return {Element} XML storage element.
@this Blockly.Block | [
"Create",
"XML",
"to",
"represent",
"whether",
"the",
"block",
"is",
"a",
"statement",
"or",
"a",
"value",
".",
"Also",
"represent",
"whether",
"there",
"is",
"an",
"AT",
"input",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/lists.js#L357-L364 | |
18,943 | webduinoio/webduino-blockly | components/blockly-src/blocks/lists.js | function(xmlElement) {
// Note: Until January 2013 this block did not have mutations,
// so 'statement' defaults to false and 'at' defaults to true.
var isStatement = (xmlElement.getAttribute('statement') == 'true');
this.updateStatement_(isStatement);
var isAt = (xmlElement.getAttribute('at') != 'f... | javascript | function(xmlElement) {
// Note: Until January 2013 this block did not have mutations,
// so 'statement' defaults to false and 'at' defaults to true.
var isStatement = (xmlElement.getAttribute('statement') == 'true');
this.updateStatement_(isStatement);
var isAt = (xmlElement.getAttribute('at') != 'f... | [
"function",
"(",
"xmlElement",
")",
"{",
"// Note: Until January 2013 this block did not have mutations,",
"// so 'statement' defaults to false and 'at' defaults to true.",
"var",
"isStatement",
"=",
"(",
"xmlElement",
".",
"getAttribute",
"(",
"'statement'",
")",
"==",
"'true'",... | Parse XML to restore the 'AT' input.
@param {!Element} xmlElement XML storage element.
@this Blockly.Block | [
"Parse",
"XML",
"to",
"restore",
"the",
"AT",
"input",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/lists.js#L370-L377 | |
18,944 | webduinoio/webduino-blockly | components/blockly-src/blocks/lists.js | function(newStatement) {
var oldStatement = !this.outputConnection;
if (newStatement != oldStatement) {
this.unplug(true, true);
if (newStatement) {
this.setOutput(false);
this.setPreviousStatement(true);
this.setNextStatement(true);
} else {
this.setPreviousSta... | javascript | function(newStatement) {
var oldStatement = !this.outputConnection;
if (newStatement != oldStatement) {
this.unplug(true, true);
if (newStatement) {
this.setOutput(false);
this.setPreviousStatement(true);
this.setNextStatement(true);
} else {
this.setPreviousSta... | [
"function",
"(",
"newStatement",
")",
"{",
"var",
"oldStatement",
"=",
"!",
"this",
".",
"outputConnection",
";",
"if",
"(",
"newStatement",
"!=",
"oldStatement",
")",
"{",
"this",
".",
"unplug",
"(",
"true",
",",
"true",
")",
";",
"if",
"(",
"newStateme... | Switch between a value block and a statement block.
@param {boolean} newStatement True if the block should be a statement.
False if the block should be a value.
@private
@this Blockly.Block | [
"Switch",
"between",
"a",
"value",
"block",
"and",
"a",
"statement",
"block",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/lists.js#L385-L399 | |
18,945 | webduinoio/webduino-blockly | components/blockly-src/blocks/lists.js | function() {
// Assign 'this' to a variable for use in the closures below.
var thisBlock = this;
var dropdown = new Blockly.FieldDropdown(
[[Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT, 'SPLIT'],
[Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST, 'JOIN']],
function(newMode) {
thisBlock.u... | javascript | function() {
// Assign 'this' to a variable for use in the closures below.
var thisBlock = this;
var dropdown = new Blockly.FieldDropdown(
[[Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT, 'SPLIT'],
[Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST, 'JOIN']],
function(newMode) {
thisBlock.u... | [
"function",
"(",
")",
"{",
"// Assign 'this' to a variable for use in the closures below.",
"var",
"thisBlock",
"=",
"this",
";",
"var",
"dropdown",
"=",
"new",
"Blockly",
".",
"FieldDropdown",
"(",
"[",
"[",
"Blockly",
".",
"Msg",
".",
"LISTS_SPLIT_LIST_FROM_TEXT",
... | Block for splitting text into a list, or joining a list into text.
@this Blockly.Block | [
"Block",
"for",
"splitting",
"text",
"into",
"a",
"list",
"or",
"joining",
"a",
"list",
"into",
"text",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/lists.js#L651-L679 | |
18,946 | webduinoio/webduino-blockly | components/blockly-src/blocks/lists.js | function(newMode) {
if (newMode == 'SPLIT') {
this.outputConnection.setCheck('Array');
this.getInput('INPUT').setCheck('String');
} else {
this.outputConnection.setCheck('String');
this.getInput('INPUT').setCheck('Array');
}
} | javascript | function(newMode) {
if (newMode == 'SPLIT') {
this.outputConnection.setCheck('Array');
this.getInput('INPUT').setCheck('String');
} else {
this.outputConnection.setCheck('String');
this.getInput('INPUT').setCheck('Array');
}
} | [
"function",
"(",
"newMode",
")",
"{",
"if",
"(",
"newMode",
"==",
"'SPLIT'",
")",
"{",
"this",
".",
"outputConnection",
".",
"setCheck",
"(",
"'Array'",
")",
";",
"this",
".",
"getInput",
"(",
"'INPUT'",
")",
".",
"setCheck",
"(",
"'String'",
")",
";",... | Modify this block to have the correct input and output types.
@param {string} newMode Either 'SPLIT' or 'JOIN'.
@private
@this Blockly.Block | [
"Modify",
"this",
"block",
"to",
"have",
"the",
"correct",
"input",
"and",
"output",
"types",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/blocks/lists.js#L686-L694 | |
18,947 | webduinoio/webduino-blockly | components/blockly-src/generators/python/loops.js | function(arg, suffix) {
if (Blockly.isNumber(arg)) {
// Simple number.
arg = parseFloat(arg);
} else if (arg.match(/^\w+$/)) {
// Variable.
arg = 'float(' + arg + ')';
} else {
// It's complicated.
var varName = Blockly.Python.variableDB_.getDistinctName... | javascript | function(arg, suffix) {
if (Blockly.isNumber(arg)) {
// Simple number.
arg = parseFloat(arg);
} else if (arg.match(/^\w+$/)) {
// Variable.
arg = 'float(' + arg + ')';
} else {
// It's complicated.
var varName = Blockly.Python.variableDB_.getDistinctName... | [
"function",
"(",
"arg",
",",
"suffix",
")",
"{",
"if",
"(",
"Blockly",
".",
"isNumber",
"(",
"arg",
")",
")",
"{",
"// Simple number.",
"arg",
"=",
"parseFloat",
"(",
"arg",
")",
";",
"}",
"else",
"if",
"(",
"arg",
".",
"match",
"(",
"/",
"^\\w+$",... | Cache non-trivial values to variables to prevent repeated look-ups. | [
"Cache",
"non",
"-",
"trivial",
"values",
"to",
"variables",
"to",
"prevent",
"repeated",
"look",
"-",
"ups",
"."
] | f656474c6e4ba1fc12fda217280714c3ca044bbe | https://github.com/webduinoio/webduino-blockly/blob/f656474c6e4ba1fc12fda217280714c3ca044bbe/components/blockly-src/generators/python/loops.js#L154-L169 | |
18,948 | h2non/rocky | lib/rocky.js | Rocky | function Rocky (opts) {
if (!(this instanceof Rocky)) return new Rocky(opts)
opts = opts || {}
Base.call(this, opts)
this.server = null
this.router = router(opts.router)
this._setupMiddleware()
} | javascript | function Rocky (opts) {
if (!(this instanceof Rocky)) return new Rocky(opts)
opts = opts || {}
Base.call(this, opts)
this.server = null
this.router = router(opts.router)
this._setupMiddleware()
} | [
"function",
"Rocky",
"(",
"opts",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Rocky",
")",
")",
"return",
"new",
"Rocky",
"(",
"opts",
")",
"opts",
"=",
"opts",
"||",
"{",
"}",
"Base",
".",
"call",
"(",
"this",
",",
"opts",
")",
"this",... | Rocky implements an HTTP and WebSocket proxy with built-in router
and hierarchical middleware layer.
@param {Object} opts
@class Rocky
@extend Base
@constructor | [
"Rocky",
"implements",
"an",
"HTTP",
"and",
"WebSocket",
"proxy",
"with",
"built",
"-",
"in",
"router",
"and",
"hierarchical",
"middleware",
"layer",
"."
] | 10053ae457e169be0f118d599e1fd0919ba59331 | https://github.com/h2non/rocky/blob/10053ae457e169be0f118d599e1fd0919ba59331/lib/rocky.js#L21-L29 |
18,949 | lsm/alfa | src/store.js | setSingle | function setSingle(store, key, value, flag) {
const { _store, _subscriptions } = store
// Uncurry alfa action functions
if (typeof value === 'function' && value.alfaAction) {
value = value.alfaAction(store)
}
// Save the value to the store.
_store[key] = value
if (flag === 'merge') {
return
}... | javascript | function setSingle(store, key, value, flag) {
const { _store, _subscriptions } = store
// Uncurry alfa action functions
if (typeof value === 'function' && value.alfaAction) {
value = value.alfaAction(store)
}
// Save the value to the store.
_store[key] = value
if (flag === 'merge') {
return
}... | [
"function",
"setSingle",
"(",
"store",
",",
"key",
",",
"value",
",",
"flag",
")",
"{",
"const",
"{",
"_store",
",",
"_subscriptions",
"}",
"=",
"store",
"// Uncurry alfa action functions",
"if",
"(",
"typeof",
"value",
"===",
"'function'",
"&&",
"value",
".... | Set a single value to an object. | [
"Set",
"a",
"single",
"value",
"to",
"an",
"object",
"."
] | a3ba606502ec4da5f86cfc7d1b3e964bb884028c | https://github.com/lsm/alfa/blob/a3ba606502ec4da5f86cfc7d1b3e964bb884028c/src/store.js#L181-L231 |
18,950 | lsm/alfa | src/injection.js | getDynamicProps | function getDynamicProps({ keys, maps, inputs }, outputs, alfaStore) {
const _props = getInjectedProps(inputs, outputs, alfaStore)
if (maps) {
keys.forEach(key => {
_props[key] = _props[maps[key]]
})
// Map outputs
if (outputs && 'function' === typeof _props.set) {
// The `set` of `prop... | javascript | function getDynamicProps({ keys, maps, inputs }, outputs, alfaStore) {
const _props = getInjectedProps(inputs, outputs, alfaStore)
if (maps) {
keys.forEach(key => {
_props[key] = _props[maps[key]]
})
// Map outputs
if (outputs && 'function' === typeof _props.set) {
// The `set` of `prop... | [
"function",
"getDynamicProps",
"(",
"{",
"keys",
",",
"maps",
",",
"inputs",
"}",
",",
"outputs",
",",
"alfaStore",
")",
"{",
"const",
"_props",
"=",
"getInjectedProps",
"(",
"inputs",
",",
"outputs",
",",
"alfaStore",
")",
"if",
"(",
"maps",
")",
"{",
... | Load dependencies with the result of calling `keys` function of the component.
This gives people the ability to load dynamic dependencies based on the props
of the component at runtime.
It makes a map between the dynamic names of the dependencies and the names
of the properties injected in `state` of the component.
Th... | [
"Load",
"dependencies",
"with",
"the",
"result",
"of",
"calling",
"keys",
"function",
"of",
"the",
"component",
"."
] | a3ba606502ec4da5f86cfc7d1b3e964bb884028c | https://github.com/lsm/alfa/blob/a3ba606502ec4da5f86cfc7d1b3e964bb884028c/src/injection.js#L205-L227 |
18,951 | chrisdickinson/beefy | lib/setup-bundlers.js | setupBundler | function setupBundler(cwd, entryPoints, flags, noWatchify, ready) {
noWatchify ?
onlocalwatchify() :
resolve('watchify', {basedir: cwd}, onlocalwatchify)
function onlocalwatchify(err, localDir) {
if(err || !localDir) {
return resolve('browserify', {basedir: cwd}, onlocalbrowserify)
}
set... | javascript | function setupBundler(cwd, entryPoints, flags, noWatchify, ready) {
noWatchify ?
onlocalwatchify() :
resolve('watchify', {basedir: cwd}, onlocalwatchify)
function onlocalwatchify(err, localDir) {
if(err || !localDir) {
return resolve('browserify', {basedir: cwd}, onlocalbrowserify)
}
set... | [
"function",
"setupBundler",
"(",
"cwd",
",",
"entryPoints",
",",
"flags",
",",
"noWatchify",
",",
"ready",
")",
"{",
"noWatchify",
"?",
"onlocalwatchify",
"(",
")",
":",
"resolve",
"(",
"'watchify'",
",",
"{",
"basedir",
":",
"cwd",
"}",
",",
"onlocalwatch... | local watchify, local browserify -> global watchify, global browserify | [
"local",
"watchify",
"local",
"browserify",
"-",
">",
"global",
"watchify",
"global",
"browserify"
] | 7a4727851c3c318d8a866d14c4c2f9b93a064b08 | https://github.com/chrisdickinson/beefy/blob/7a4727851c3c318d8a866d14c4c2f9b93a064b08/lib/setup-bundlers.js#L12-L52 |
18,952 | danielpigott/cloudflare-cli | lib/formatters.js | TableFormatter | function TableFormatter(options) {
const table = new Table(options);
this.format = format;
function format(result, formatOptions) {
let data = [];
_.each(result, function (item) {
data.push(_.values(_.pick(item, options.values)));
});
if (formatOptions.format === 'csv') {
_.each(data, f... | javascript | function TableFormatter(options) {
const table = new Table(options);
this.format = format;
function format(result, formatOptions) {
let data = [];
_.each(result, function (item) {
data.push(_.values(_.pick(item, options.values)));
});
if (formatOptions.format === 'csv') {
_.each(data, f... | [
"function",
"TableFormatter",
"(",
"options",
")",
"{",
"const",
"table",
"=",
"new",
"Table",
"(",
"options",
")",
";",
"this",
".",
"format",
"=",
"format",
";",
"function",
"format",
"(",
"result",
",",
"formatOptions",
")",
"{",
"let",
"data",
"=",
... | Formatter to output tabular data
@param options
@constructor | [
"Formatter",
"to",
"output",
"tabular",
"data"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/lib/formatters.js#L9-L28 |
18,953 | danielpigott/cloudflare-cli | lib/formatters.js | MessageFormatter | function MessageFormatter() {
this.format = format;
function format(result) {
_.each(result, function(message) {
console.log(message);
});
}
} | javascript | function MessageFormatter() {
this.format = format;
function format(result) {
_.each(result, function(message) {
console.log(message);
});
}
} | [
"function",
"MessageFormatter",
"(",
")",
"{",
"this",
".",
"format",
"=",
"format",
";",
"function",
"format",
"(",
"result",
")",
"{",
"_",
".",
"each",
"(",
"result",
",",
"function",
"(",
"message",
")",
"{",
"console",
".",
"log",
"(",
"message",
... | Log plain messages
@constructor | [
"Log",
"plain",
"messages"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/lib/formatters.js#L34-L41 |
18,954 | danielpigott/cloudflare-cli | index.js | init | function init(options) {
self.email = options.email;
self.key = options.token;
self.cloudflareClient = new CloudFlareClient(options.email, options.token);
} | javascript | function init(options) {
self.email = options.email;
self.key = options.token;
self.cloudflareClient = new CloudFlareClient(options.email, options.token);
} | [
"function",
"init",
"(",
"options",
")",
"{",
"self",
".",
"email",
"=",
"options",
".",
"email",
";",
"self",
".",
"key",
"=",
"options",
".",
"token",
";",
"self",
".",
"cloudflareClient",
"=",
"new",
"CloudFlareClient",
"(",
"options",
".",
"email",
... | Set up client
@param options | [
"Set",
"up",
"client"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/index.js#L163-L167 |
18,955 | danielpigott/cloudflare-cli | index.js | runCommand | function runCommand(command, options) {
let cmd = getCommand(command);
if (!cmd || command === 'help') {
cmd = getCommand('help');
} else {
try {
validateConfig(options);
} catch (error) {
console.log(error.message);
process.exit(1);
}
}
let fn = cmd.c... | javascript | function runCommand(command, options) {
let cmd = getCommand(command);
if (!cmd || command === 'help') {
cmd = getCommand('help');
} else {
try {
validateConfig(options);
} catch (error) {
console.log(error.message);
process.exit(1);
}
}
let fn = cmd.c... | [
"function",
"runCommand",
"(",
"command",
",",
"options",
")",
"{",
"let",
"cmd",
"=",
"getCommand",
"(",
"command",
")",
";",
"if",
"(",
"!",
"cmd",
"||",
"command",
"===",
"'help'",
")",
"{",
"cmd",
"=",
"getCommand",
"(",
"'help'",
")",
";",
"}",
... | Run the given command and output the result
@param command
@param options | [
"Run",
"the",
"given",
"command",
"and",
"output",
"the",
"result"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/index.js#L174-L205 |
18,956 | danielpigott/cloudflare-cli | index.js | addRecord | function addRecord(options) {
options.type = options.type || 'CNAME';
return getZone(options.domain)
.then(function (zone) {
return self.cloudflareClient.addRecord(
zone.id,
_.extend({ttl: 1}, mapRecordOptions(options)));
})
.then(function (response) {
ret... | javascript | function addRecord(options) {
options.type = options.type || 'CNAME';
return getZone(options.domain)
.then(function (zone) {
return self.cloudflareClient.addRecord(
zone.id,
_.extend({ttl: 1}, mapRecordOptions(options)));
})
.then(function (response) {
ret... | [
"function",
"addRecord",
"(",
"options",
")",
"{",
"options",
".",
"type",
"=",
"options",
".",
"type",
"||",
"'CNAME'",
";",
"return",
"getZone",
"(",
"options",
".",
"domain",
")",
".",
"then",
"(",
"function",
"(",
"zone",
")",
"{",
"return",
"self"... | Create a new record of the given type
@param options
@return {*} | [
"Create",
"a",
"new",
"record",
"of",
"the",
"given",
"type"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/index.js#L212-L231 |
18,957 | danielpigott/cloudflare-cli | index.js | editRecord | function editRecord(options) {
return find(options.domain, getQueryParams(options, ['name', 'type', 'query'])).then(function (response) {
const records = response.data.result;
//Properties that are editable
options = mapRecordOptions(options);
if (records.length === 0) {
throw new Er... | javascript | function editRecord(options) {
return find(options.domain, getQueryParams(options, ['name', 'type', 'query'])).then(function (response) {
const records = response.data.result;
//Properties that are editable
options = mapRecordOptions(options);
if (records.length === 0) {
throw new Er... | [
"function",
"editRecord",
"(",
"options",
")",
"{",
"return",
"find",
"(",
"options",
".",
"domain",
",",
"getQueryParams",
"(",
"options",
",",
"[",
"'name'",
",",
"'type'",
",",
"'query'",
"]",
")",
")",
".",
"then",
"(",
"function",
"(",
"response",
... | Edit a record
@param options
@returns {Promise} | [
"Edit",
"a",
"record"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/index.js#L258-L279 |
18,958 | danielpigott/cloudflare-cli | index.js | find | function find(domain, query) {
if (query.name && !query.name.includes(domain)) {
query.name = query.name + '.' + domain;
}
if (query.query) {
query = _.extend(query, query.query);
delete query.query;
}
return getZone(domain).then(function (zone) {
return self.cloudflareClient... | javascript | function find(domain, query) {
if (query.name && !query.name.includes(domain)) {
query.name = query.name + '.' + domain;
}
if (query.query) {
query = _.extend(query, query.query);
delete query.query;
}
return getZone(domain).then(function (zone) {
return self.cloudflareClient... | [
"function",
"find",
"(",
"domain",
",",
"query",
")",
"{",
"if",
"(",
"query",
".",
"name",
"&&",
"!",
"query",
".",
"name",
".",
"includes",
"(",
"domain",
")",
")",
"{",
"query",
".",
"name",
"=",
"query",
".",
"name",
"+",
"'.'",
"+",
"domain"... | Find a given record
@param domain
@param query
@return {Promise} | [
"Find",
"a",
"given",
"record"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/index.js#L324-L335 |
18,959 | danielpigott/cloudflare-cli | index.js | listRecords | function listRecords(options) {
return getZone(options.domain).then(function (zone) {
return self.cloudflareClient.findRecord(zone.id, {page: 1, per_page: self.perPage})
.then(function (response) {
let promises = [Promise.resolve(response)];
for (let i = 2; i <= response.data['resu... | javascript | function listRecords(options) {
return getZone(options.domain).then(function (zone) {
return self.cloudflareClient.findRecord(zone.id, {page: 1, per_page: self.perPage})
.then(function (response) {
let promises = [Promise.resolve(response)];
for (let i = 2; i <= response.data['resu... | [
"function",
"listRecords",
"(",
"options",
")",
"{",
"return",
"getZone",
"(",
"options",
".",
"domain",
")",
".",
"then",
"(",
"function",
"(",
"zone",
")",
"{",
"return",
"self",
".",
"cloudflareClient",
".",
"findRecord",
"(",
"zone",
".",
"id",
",",
... | List records for given domain
@param options
@returns {Promise} | [
"List",
"records",
"for",
"given",
"domain"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/index.js#L342-L362 |
18,960 | danielpigott/cloudflare-cli | index.js | listZones | function listZones() {
return self.cloudflareClient.findZones({page: 1, per_page: self.perPage})
.then(function (response) {
let promises = [Promise.resolve(response)];
for (let i = 2; i <= response.data['result_info']['total_pages']; i++) {
promises.push(self.cloudflareClient.findZo... | javascript | function listZones() {
return self.cloudflareClient.findZones({page: 1, per_page: self.perPage})
.then(function (response) {
let promises = [Promise.resolve(response)];
for (let i = 2; i <= response.data['result_info']['total_pages']; i++) {
promises.push(self.cloudflareClient.findZo... | [
"function",
"listZones",
"(",
")",
"{",
"return",
"self",
".",
"cloudflareClient",
".",
"findZones",
"(",
"{",
"page",
":",
"1",
",",
"per_page",
":",
"self",
".",
"perPage",
"}",
")",
".",
"then",
"(",
"function",
"(",
"response",
")",
"{",
"let",
"... | List zones in the current account
@return {Promise} | [
"List",
"zones",
"in",
"the",
"current",
"account"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/index.js#L397-L421 |
18,961 | danielpigott/cloudflare-cli | index.js | purgeCache | function purgeCache(options) {
return getZone(options.domain).then(function (zone) {
let query = (options._[1]) ? {files: options._.slice(1)} : {purge_everything: true};
return self.cloudflareClient.purgeCache(zone.id, query);
}).then(function () {
return new Result('Purged cache successfully'... | javascript | function purgeCache(options) {
return getZone(options.domain).then(function (zone) {
let query = (options._[1]) ? {files: options._.slice(1)} : {purge_everything: true};
return self.cloudflareClient.purgeCache(zone.id, query);
}).then(function () {
return new Result('Purged cache successfully'... | [
"function",
"purgeCache",
"(",
"options",
")",
"{",
"return",
"getZone",
"(",
"options",
".",
"domain",
")",
".",
"then",
"(",
"function",
"(",
"zone",
")",
"{",
"let",
"query",
"=",
"(",
"options",
".",
"_",
"[",
"1",
"]",
")",
"?",
"{",
"files",
... | Purge files from cache
@param options
@returns {Promise} | [
"Purge",
"files",
"from",
"cache"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/index.js#L441-L448 |
18,962 | danielpigott/cloudflare-cli | index.js | getCommand | function getCommand(commandName) {
return _.find(commands, function (command) {
return _.includes(command.aliases, commandName);
});
} | javascript | function getCommand(commandName) {
return _.find(commands, function (command) {
return _.includes(command.aliases, commandName);
});
} | [
"function",
"getCommand",
"(",
"commandName",
")",
"{",
"return",
"_",
".",
"find",
"(",
"commands",
",",
"function",
"(",
"command",
")",
"{",
"return",
"_",
".",
"includes",
"(",
"command",
".",
"aliases",
",",
"commandName",
")",
";",
"}",
")",
";",... | Get command from available commands by name
@param commandName
@return {Object} | [
"Get",
"command",
"from",
"available",
"commands",
"by",
"name"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/index.js#L474-L478 |
18,963 | danielpigott/cloudflare-cli | index.js | mapRecordOptions | function mapRecordOptions(options) {
if (options.type === 'SRV') {
let contentParts = options.content.split(' ');
let serverParts = options.name.split('.');
options.data = {
service: serverParts[0],
proto: serverParts[1],
name: _.slice(serverParts, 2).join('.'),
pri... | javascript | function mapRecordOptions(options) {
if (options.type === 'SRV') {
let contentParts = options.content.split(' ');
let serverParts = options.name.split('.');
options.data = {
service: serverParts[0],
proto: serverParts[1],
name: _.slice(serverParts, 2).join('.'),
pri... | [
"function",
"mapRecordOptions",
"(",
"options",
")",
"{",
"if",
"(",
"options",
".",
"type",
"===",
"'SRV'",
")",
"{",
"let",
"contentParts",
"=",
"options",
".",
"content",
".",
"split",
"(",
"' '",
")",
";",
"let",
"serverParts",
"=",
"options",
".",
... | Map options to parameters when adding or editing records
@param options
@return {*} | [
"Map",
"options",
"to",
"parameters",
"when",
"adding",
"or",
"editing",
"records"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/index.js#L512-L532 |
18,964 | danielpigott/cloudflare-cli | index.js | validateConfig | function validateConfig(config) {
let missing = [];
_.each(requiredOptions, function (option) {
if (config[option] === undefined) {
missing.push(option);
}
});
if (missing.length > 0) {
throw new Error('The following required parameters were not provided: ' + missing.join(','))... | javascript | function validateConfig(config) {
let missing = [];
_.each(requiredOptions, function (option) {
if (config[option] === undefined) {
missing.push(option);
}
});
if (missing.length > 0) {
throw new Error('The following required parameters were not provided: ' + missing.join(','))... | [
"function",
"validateConfig",
"(",
"config",
")",
"{",
"let",
"missing",
"=",
"[",
"]",
";",
"_",
".",
"each",
"(",
"requiredOptions",
",",
"function",
"(",
"option",
")",
"{",
"if",
"(",
"config",
"[",
"option",
"]",
"===",
"undefined",
")",
"{",
"m... | Check that required config is set
@param config | [
"Check",
"that",
"required",
"config",
"is",
"set"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/index.js#L547-L557 |
18,965 | danielpigott/cloudflare-cli | lib/configReader.js | ConfigReader | function ConfigReader(path) {
const self = this;
const fs = require('fs');
const util = require('util');
const yaml = require('js-yaml');
const _ = require('lodash');
const allowedEnvironmentVars = {
token: 'CF_API_KEY',
email: 'CF_API_EMAIL',
domain: 'CF_API_DOMAIN'
};
const homePath = pro... | javascript | function ConfigReader(path) {
const self = this;
const fs = require('fs');
const util = require('util');
const yaml = require('js-yaml');
const _ = require('lodash');
const allowedEnvironmentVars = {
token: 'CF_API_KEY',
email: 'CF_API_EMAIL',
domain: 'CF_API_DOMAIN'
};
const homePath = pro... | [
"function",
"ConfigReader",
"(",
"path",
")",
"{",
"const",
"self",
"=",
"this",
";",
"const",
"fs",
"=",
"require",
"(",
"'fs'",
")",
";",
"const",
"util",
"=",
"require",
"(",
"'util'",
")",
";",
"const",
"yaml",
"=",
"require",
"(",
"'js-yaml'",
"... | Read config at given path
@param path
@constructor | [
"Read",
"config",
"at",
"given",
"path"
] | 1cfbb99041f123aae278550bdcc6b44642103c0d | https://github.com/danielpigott/cloudflare-cli/blob/1cfbb99041f123aae278550bdcc6b44642103c0d/lib/configReader.js#L6-L67 |
18,966 | koopjs/winnow | src/options/normalizeOptions.js | normalizeLimit | function normalizeLimit (options) {
const limit = options.limit || options.resultRecordCount || options.count || options.maxFeatures
// If there is a limit, add 1 to it so we can later calculate a limitExceeded. The result set will be resized accordingly, post SQL
if (limit) return limit + 1
} | javascript | function normalizeLimit (options) {
const limit = options.limit || options.resultRecordCount || options.count || options.maxFeatures
// If there is a limit, add 1 to it so we can later calculate a limitExceeded. The result set will be resized accordingly, post SQL
if (limit) return limit + 1
} | [
"function",
"normalizeLimit",
"(",
"options",
")",
"{",
"const",
"limit",
"=",
"options",
".",
"limit",
"||",
"options",
".",
"resultRecordCount",
"||",
"options",
".",
"count",
"||",
"options",
".",
"maxFeatures",
"// If there is a limit, add 1 to it so we can later ... | Normalize the limit option; defaults to undefined
@param {object} options
@returns {integer} or undefined | [
"Normalize",
"the",
"limit",
"option",
";",
"defaults",
"to",
"undefined"
] | 90293fe930ad34ef4eeb6df73a8426d887b4ec69 | https://github.com/koopjs/winnow/blob/90293fe930ad34ef4eeb6df73a8426d887b4ec69/src/options/normalizeOptions.js#L171-L175 |
18,967 | koopjs/winnow | src/options/normalizeOptions.js | normalizeIdField | function normalizeIdField (options, features = []) {
const collection = options.collection || {}
const metadata = collection.metadata || {}
const feature = features[0] || {}
const featureProperties = feature.properties || feature.attributes || {}
let idField = null
// First, check metadata for idField
if... | javascript | function normalizeIdField (options, features = []) {
const collection = options.collection || {}
const metadata = collection.metadata || {}
const feature = features[0] || {}
const featureProperties = feature.properties || feature.attributes || {}
let idField = null
// First, check metadata for idField
if... | [
"function",
"normalizeIdField",
"(",
"options",
",",
"features",
"=",
"[",
"]",
")",
"{",
"const",
"collection",
"=",
"options",
".",
"collection",
"||",
"{",
"}",
"const",
"metadata",
"=",
"collection",
".",
"metadata",
"||",
"{",
"}",
"const",
"feature",... | Ensure idField is set if metadata doesn't have a value but a field named OBJECTID is present
@param {object} metadata | [
"Ensure",
"idField",
"is",
"set",
"if",
"metadata",
"doesn",
"t",
"have",
"a",
"value",
"but",
"a",
"field",
"named",
"OBJECTID",
"is",
"present"
] | 90293fe930ad34ef4eeb6df73a8426d887b4ec69 | https://github.com/koopjs/winnow/blob/90293fe930ad34ef4eeb6df73a8426d887b4ec69/src/options/normalizeOptions.js#L208-L229 |
18,968 | koopjs/winnow | src/select/fields.js | createClause | function createClause (options = {}, idField = null) {
// Default clause
let clause = `type, properties as properties`
// Comma-delimited list of date-fields is needed for formatting ESRI specific output
let dateFields = options.dateFields.join(',')
let requiresObjectId = !!options.returnIdsOnly || !(options... | javascript | function createClause (options = {}, idField = null) {
// Default clause
let clause = `type, properties as properties`
// Comma-delimited list of date-fields is needed for formatting ESRI specific output
let dateFields = options.dateFields.join(',')
let requiresObjectId = !!options.returnIdsOnly || !(options... | [
"function",
"createClause",
"(",
"options",
"=",
"{",
"}",
",",
"idField",
"=",
"null",
")",
"{",
"// Default clause",
"let",
"clause",
"=",
"`",
"`",
"// Comma-delimited list of date-fields is needed for formatting ESRI specific output",
"let",
"dateFields",
"=",
"opti... | Create the SQL fragment used to SELECT GeoJSON attributes
@param {object} options
@param {string} idField a string that identifies which property can be used as the OBJECTID | [
"Create",
"the",
"SQL",
"fragment",
"used",
"to",
"SELECT",
"GeoJSON",
"attributes"
] | 90293fe930ad34ef4eeb6df73a8426d887b4ec69 | https://github.com/koopjs/winnow/blob/90293fe930ad34ef4eeb6df73a8426d887b4ec69/src/select/fields.js#L6-L26 |
18,969 | koopjs/winnow | src/options/normalizeSQL.js | normalizeFields | function normalizeFields (options) {
const fields = options.fields || options.outFields
const idField = _.get(options, 'collection.metadata.idField')
if (options.returnIdsOnly === true && idField) return [idField]
else if (options.returnIdsOnly === true) return ['OBJECTID']
if (fields === '*') return undefine... | javascript | function normalizeFields (options) {
const fields = options.fields || options.outFields
const idField = _.get(options, 'collection.metadata.idField')
if (options.returnIdsOnly === true && idField) return [idField]
else if (options.returnIdsOnly === true) return ['OBJECTID']
if (fields === '*') return undefine... | [
"function",
"normalizeFields",
"(",
"options",
")",
"{",
"const",
"fields",
"=",
"options",
".",
"fields",
"||",
"options",
".",
"outFields",
"const",
"idField",
"=",
"_",
".",
"get",
"(",
"options",
",",
"'collection.metadata.idField'",
")",
"if",
"(",
"opt... | Transform the input of requested response fields
@param {Object} options - object that may contain 'fields' or 'outFields' property | [
"Transform",
"the",
"input",
"of",
"requested",
"response",
"fields"
] | 90293fe930ad34ef4eeb6df73a8426d887b4ec69 | https://github.com/koopjs/winnow/blob/90293fe930ad34ef4eeb6df73a8426d887b4ec69/src/options/normalizeSQL.js#L21-L30 |
18,970 | koopjs/winnow | src/where.js | handleExpr | function handleExpr (node, options) {
let expr
if (node.type === 'unary_expr') {
expr = `${node.operator} ${traverse(node.expr, options)}`
} else if (node.operator === '=' && node.left.value === 1 && node.right.value === 1) {
// a special case related to arcgis server
return '1=1'
} else if (node.o... | javascript | function handleExpr (node, options) {
let expr
if (node.type === 'unary_expr') {
expr = `${node.operator} ${traverse(node.expr, options)}`
} else if (node.operator === '=' && node.left.value === 1 && node.right.value === 1) {
// a special case related to arcgis server
return '1=1'
} else if (node.o... | [
"function",
"handleExpr",
"(",
"node",
",",
"options",
")",
"{",
"let",
"expr",
"if",
"(",
"node",
".",
"type",
"===",
"'unary_expr'",
")",
"{",
"expr",
"=",
"`",
"${",
"node",
".",
"operator",
"}",
"${",
"traverse",
"(",
"node",
".",
"expr",
",",
... | Convert an expression node to its string representation.
@param {object} node AST expression node
@param {object} options winnow options
@return {string} expression string | [
"Convert",
"an",
"expression",
"node",
"to",
"its",
"string",
"representation",
"."
] | 90293fe930ad34ef4eeb6df73a8426d887b4ec69 | https://github.com/koopjs/winnow/blob/90293fe930ad34ef4eeb6df73a8426d887b4ec69/src/where.js#L11-L40 |
18,971 | koopjs/winnow | src/where.js | handleExprList | function handleExprList (node, options) {
const values = node.value.map((valueNode) => traverse(valueNode, options)).join(',')
return `(${values})`
} | javascript | function handleExprList (node, options) {
const values = node.value.map((valueNode) => traverse(valueNode, options)).join(',')
return `(${values})`
} | [
"function",
"handleExprList",
"(",
"node",
",",
"options",
")",
"{",
"const",
"values",
"=",
"node",
".",
"value",
".",
"map",
"(",
"(",
"valueNode",
")",
"=>",
"traverse",
"(",
"valueNode",
",",
"options",
")",
")",
".",
"join",
"(",
"','",
")",
"re... | Convert an expression list node to its string representation.
@param {object} node AST expression list node
@param {object} options winnow options
@return {string} expression list string | [
"Convert",
"an",
"expression",
"list",
"node",
"to",
"its",
"string",
"representation",
"."
] | 90293fe930ad34ef4eeb6df73a8426d887b4ec69 | https://github.com/koopjs/winnow/blob/90293fe930ad34ef4eeb6df73a8426d887b4ec69/src/where.js#L48-L51 |
18,972 | koopjs/winnow | src/where.js | handleFunction | function handleFunction (node, options) {
const args = handleExprList(node.args, options)
return `${node.name}${args}`
} | javascript | function handleFunction (node, options) {
const args = handleExprList(node.args, options)
return `${node.name}${args}`
} | [
"function",
"handleFunction",
"(",
"node",
",",
"options",
")",
"{",
"const",
"args",
"=",
"handleExprList",
"(",
"node",
".",
"args",
",",
"options",
")",
"return",
"`",
"${",
"node",
".",
"name",
"}",
"${",
"args",
"}",
"`",
"}"
] | Convert a function node to its string representation.
@param {object} node AST function node
@param {object} options winnow options
@return {string} function string | [
"Convert",
"a",
"function",
"node",
"to",
"its",
"string",
"representation",
"."
] | 90293fe930ad34ef4eeb6df73a8426d887b4ec69 | https://github.com/koopjs/winnow/blob/90293fe930ad34ef4eeb6df73a8426d887b4ec69/src/where.js#L59-L62 |
18,973 | koopjs/winnow | src/where.js | handleValue | function handleValue (node, options) {
let value = node.value
if (node.columnNode) {
const field = _.find(options.esriFields, { name: node.columnNode.column })
if (_.has(field, 'domain.codedValues')) {
const actual = _.find(field.domain.codedValues, { code: value })
if (actual) {
valu... | javascript | function handleValue (node, options) {
let value = node.value
if (node.columnNode) {
const field = _.find(options.esriFields, { name: node.columnNode.column })
if (_.has(field, 'domain.codedValues')) {
const actual = _.find(field.domain.codedValues, { code: value })
if (actual) {
valu... | [
"function",
"handleValue",
"(",
"node",
",",
"options",
")",
"{",
"let",
"value",
"=",
"node",
".",
"value",
"if",
"(",
"node",
".",
"columnNode",
")",
"{",
"const",
"field",
"=",
"_",
".",
"find",
"(",
"options",
".",
"esriFields",
",",
"{",
"name",... | Convert a value node to its string representation.
If the value node has a reference to its column and this column is an encoded
field, this function will try to decode the value.
@param {object} node AST value node
@param {object} options winnow options
@return {string} value string | [
"Convert",
"a",
"value",
"node",
"to",
"its",
"string",
"representation",
"."
] | 90293fe930ad34ef4eeb6df73a8426d887b4ec69 | https://github.com/koopjs/winnow/blob/90293fe930ad34ef4eeb6df73a8426d887b4ec69/src/where.js#L84-L104 |
18,974 | koopjs/winnow | src/where.js | traverse | function traverse (node, options) {
if (!node) {
return ''
}
switch (node.type) {
case 'unary_expr':
case 'binary_expr':
return handleExpr(node, options)
case 'function':
return handleFunction(node, options)
case 'expr_list':
return handleExprList(node, options)
case 'co... | javascript | function traverse (node, options) {
if (!node) {
return ''
}
switch (node.type) {
case 'unary_expr':
case 'binary_expr':
return handleExpr(node, options)
case 'function':
return handleFunction(node, options)
case 'expr_list':
return handleExprList(node, options)
case 'co... | [
"function",
"traverse",
"(",
"node",
",",
"options",
")",
"{",
"if",
"(",
"!",
"node",
")",
"{",
"return",
"''",
"}",
"switch",
"(",
"node",
".",
"type",
")",
"{",
"case",
"'unary_expr'",
":",
"case",
"'binary_expr'",
":",
"return",
"handleExpr",
"(",
... | Traverse a SQL AST and return its string representation
@param {object} node AST node
@param {object} options winnow options
@return {string} AST string | [
"Traverse",
"a",
"SQL",
"AST",
"and",
"return",
"its",
"string",
"representation"
] | 90293fe930ad34ef4eeb6df73a8426d887b4ec69 | https://github.com/koopjs/winnow/blob/90293fe930ad34ef4eeb6df73a8426d887b4ec69/src/where.js#L123-L148 |
18,975 | koopjs/winnow | src/sql.js | esriFy | function esriFy (properties, geometry, dateFields, requiresObjectId, idField) {
const parsedDateFields = (dateFields.length === 0) ? [] : dateFields.split(',')
if (parsedDateFields.length) {
parsedDateFields.forEach(field => {
properties[field] = new Date(properties[field]).getTime()
})
}
// If t... | javascript | function esriFy (properties, geometry, dateFields, requiresObjectId, idField) {
const parsedDateFields = (dateFields.length === 0) ? [] : dateFields.split(',')
if (parsedDateFields.length) {
parsedDateFields.forEach(field => {
properties[field] = new Date(properties[field]).getTime()
})
}
// If t... | [
"function",
"esriFy",
"(",
"properties",
",",
"geometry",
",",
"dateFields",
",",
"requiresObjectId",
",",
"idField",
")",
"{",
"const",
"parsedDateFields",
"=",
"(",
"dateFields",
".",
"length",
"===",
"0",
")",
"?",
"[",
"]",
":",
"dateFields",
".",
"spl... | Modify propterties to fit ESRI specs
@param {object} properties GeoJSON properties
@param {object} geometry GeoJSON geometry
@param {string} dateFields comma-delimited list of date fields
@param {string} requiresObjectId boolean-string flagging requirement of OBJECTID as part of properties
@param {string} idField name ... | [
"Modify",
"propterties",
"to",
"fit",
"ESRI",
"specs"
] | 90293fe930ad34ef4eeb6df73a8426d887b4ec69 | https://github.com/koopjs/winnow/blob/90293fe930ad34ef4eeb6df73a8426d887b4ec69/src/sql.js#L127-L152 |
18,976 | mckamey/countdownjs | lib/qunit/qunit.js | function(a, msg) {
a = !!a;
var details = {
result: a,
message: msg
};
msg = escapeInnerText(msg);
runLoggingCallbacks( 'log', QUnit, details );
config.current.assertions.push({
result: a,
message: msg
});
} | javascript | function(a, msg) {
a = !!a;
var details = {
result: a,
message: msg
};
msg = escapeInnerText(msg);
runLoggingCallbacks( 'log', QUnit, details );
config.current.assertions.push({
result: a,
message: msg
});
} | [
"function",
"(",
"a",
",",
"msg",
")",
"{",
"a",
"=",
"!",
"!",
"a",
";",
"var",
"details",
"=",
"{",
"result",
":",
"a",
",",
"message",
":",
"msg",
"}",
";",
"msg",
"=",
"escapeInnerText",
"(",
"msg",
")",
";",
"runLoggingCallbacks",
"(",
"'log... | Asserts true.
@example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); | [
"Asserts",
"true",
"."
] | cb5b1877ca474d3c86e0407c090a7af90fbded41 | https://github.com/mckamey/countdownjs/blob/cb5b1877ca474d3c86e0407c090a7af90fbded41/lib/qunit/qunit.js#L309-L321 | |
18,977 | mckamey/countdownjs | lib/qunit/qunit.js | function(actual, expected, message) {
QUnit.push(expected == actual, actual, expected, message);
} | javascript | function(actual, expected, message) {
QUnit.push(expected == actual, actual, expected, message);
} | [
"function",
"(",
"actual",
",",
"expected",
",",
"message",
")",
"{",
"QUnit",
".",
"push",
"(",
"expected",
"==",
"actual",
",",
"actual",
",",
"expected",
",",
"message",
")",
";",
"}"
] | Checks that the first two arguments are equal, with an optional message.
Prints out both actual and expected values.
Prefered to ok( actual == expected, message )
@example equal( format("Received {0} bytes.", 2), "Received 2 bytes." );
@param Object actual
@param Object expected
@param String message (optional) | [
"Checks",
"that",
"the",
"first",
"two",
"arguments",
"are",
"equal",
"with",
"an",
"optional",
"message",
".",
"Prints",
"out",
"both",
"actual",
"and",
"expected",
"values",
"."
] | cb5b1877ca474d3c86e0407c090a7af90fbded41 | https://github.com/mckamey/countdownjs/blob/cb5b1877ca474d3c86e0407c090a7af90fbded41/lib/qunit/qunit.js#L335-L337 | |
18,978 | mckamey/countdownjs | lib/qunit/qunit.js | function() {
extend(config, {
stats: { all: 0, bad: 0 },
moduleStats: { all: 0, bad: 0 },
started: +new Date,
updateRate: 1000,
blocking: false,
autostart: true,
autorun: false,
filter: "",
queue: [],
semaphore: 0
});
var tests = id( "qunit-tests" ),
banner = id( "qunit-banner" )... | javascript | function() {
extend(config, {
stats: { all: 0, bad: 0 },
moduleStats: { all: 0, bad: 0 },
started: +new Date,
updateRate: 1000,
blocking: false,
autostart: true,
autorun: false,
filter: "",
queue: [],
semaphore: 0
});
var tests = id( "qunit-tests" ),
banner = id( "qunit-banner" )... | [
"function",
"(",
")",
"{",
"extend",
"(",
"config",
",",
"{",
"stats",
":",
"{",
"all",
":",
"0",
",",
"bad",
":",
"0",
"}",
",",
"moduleStats",
":",
"{",
"all",
":",
"0",
",",
"bad",
":",
"0",
"}",
",",
"started",
":",
"+",
"new",
"Date",
... | Initialize the configuration options | [
"Initialize",
"the",
"configuration",
"options"
] | cb5b1877ca474d3c86e0407c090a7af90fbded41 | https://github.com/mckamey/countdownjs/blob/cb5b1877ca474d3c86e0407c090a7af90fbded41/lib/qunit/qunit.js#L519-L556 | |
18,979 | mckamey/countdownjs | lib/qunit/qunit.js | function() {
if ( window.jQuery ) {
jQuery( "#qunit-fixture" ).html( config.fixture );
} else {
var main = id( 'qunit-fixture' );
if ( main ) {
main.innerHTML = config.fixture;
}
}
} | javascript | function() {
if ( window.jQuery ) {
jQuery( "#qunit-fixture" ).html( config.fixture );
} else {
var main = id( 'qunit-fixture' );
if ( main ) {
main.innerHTML = config.fixture;
}
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"window",
".",
"jQuery",
")",
"{",
"jQuery",
"(",
"\"#qunit-fixture\"",
")",
".",
"html",
"(",
"config",
".",
"fixture",
")",
";",
"}",
"else",
"{",
"var",
"main",
"=",
"id",
"(",
"'qunit-fixture'",
")",
";",
"... | Resets the test setup. Useful for tests that modify the DOM.
If jQuery is available, uses jQuery's html(), otherwise just innerHTML. | [
"Resets",
"the",
"test",
"setup",
".",
"Useful",
"for",
"tests",
"that",
"modify",
"the",
"DOM",
"."
] | cb5b1877ca474d3c86e0407c090a7af90fbded41 | https://github.com/mckamey/countdownjs/blob/cb5b1877ca474d3c86e0407c090a7af90fbded41/lib/qunit/qunit.js#L563-L572 | |
18,980 | mckamey/countdownjs | lib/qunit/qunit.js | function( elem, type, event ) {
if ( document.createEvent ) {
event = document.createEvent("MouseEvents");
event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
elem.dispatchEvent( event );
} else if ( elem.fireEvent ) {
elem.fir... | javascript | function( elem, type, event ) {
if ( document.createEvent ) {
event = document.createEvent("MouseEvents");
event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
elem.dispatchEvent( event );
} else if ( elem.fireEvent ) {
elem.fir... | [
"function",
"(",
"elem",
",",
"type",
",",
"event",
")",
"{",
"if",
"(",
"document",
".",
"createEvent",
")",
"{",
"event",
"=",
"document",
".",
"createEvent",
"(",
"\"MouseEvents\"",
")",
";",
"event",
".",
"initMouseEvent",
"(",
"type",
",",
"true",
... | Trigger an event on an element.
@example triggerEvent( document.body, "click" );
@param DOMElement elem
@param String type | [
"Trigger",
"an",
"event",
"on",
"an",
"element",
"."
] | cb5b1877ca474d3c86e0407c090a7af90fbded41 | https://github.com/mckamey/countdownjs/blob/cb5b1877ca474d3c86e0407c090a7af90fbded41/lib/qunit/qunit.js#L582-L592 | |
18,981 | mckamey/countdownjs | lib/qunit/qunit.js | diff | function diff( a, b ) {
var result = a.slice();
for ( var i = 0; i < result.length; i++ ) {
for ( var j = 0; j < b.length; j++ ) {
if ( result[i] === b[j] ) {
result.splice(i, 1);
i--;
break;
}
}
}
return result;
} | javascript | function diff( a, b ) {
var result = a.slice();
for ( var i = 0; i < result.length; i++ ) {
for ( var j = 0; j < b.length; j++ ) {
if ( result[i] === b[j] ) {
result.splice(i, 1);
i--;
break;
}
}
}
return result;
} | [
"function",
"diff",
"(",
"a",
",",
"b",
")",
"{",
"var",
"result",
"=",
"a",
".",
"slice",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"result",
".",
"length",
";",
"i",
"++",
")",
"{",
"for",
"(",
"var",
"j",
"=",
"0"... | returns a new Array with the elements that are in a but not in b | [
"returns",
"a",
"new",
"Array",
"with",
"the",
"elements",
"that",
"are",
"in",
"a",
"but",
"not",
"in",
"b"
] | cb5b1877ca474d3c86e0407c090a7af90fbded41 | https://github.com/mckamey/countdownjs/blob/cb5b1877ca474d3c86e0407c090a7af90fbded41/lib/qunit/qunit.js#L948-L960 |
18,982 | mckamey/countdownjs | lib/qunit/qunit.js | runLoggingCallbacks | function runLoggingCallbacks(key, scope, args) {
//debugger;
var callbacks;
if ( QUnit.hasOwnProperty(key) ) {
QUnit[key].call(scope, args);
} else {
callbacks = config[key];
for( var i = 0; i < callbacks.length; i++ ) {
callbacks[i].call( scope, args );
}
}
} | javascript | function runLoggingCallbacks(key, scope, args) {
//debugger;
var callbacks;
if ( QUnit.hasOwnProperty(key) ) {
QUnit[key].call(scope, args);
} else {
callbacks = config[key];
for( var i = 0; i < callbacks.length; i++ ) {
callbacks[i].call( scope, args );
}
}
} | [
"function",
"runLoggingCallbacks",
"(",
"key",
",",
"scope",
",",
"args",
")",
"{",
"//debugger;",
"var",
"callbacks",
";",
"if",
"(",
"QUnit",
".",
"hasOwnProperty",
"(",
"key",
")",
")",
"{",
"QUnit",
"[",
"key",
"]",
".",
"call",
"(",
"scope",
",",
... | Supports deprecated method of completely overwriting logging callbacks | [
"Supports",
"deprecated",
"method",
"of",
"completely",
"overwriting",
"logging",
"callbacks"
] | cb5b1877ca474d3c86e0407c090a7af90fbded41 | https://github.com/mckamey/countdownjs/blob/cb5b1877ca474d3c86e0407c090a7af90fbded41/lib/qunit/qunit.js#L1007-L1018 |
18,983 | mckamey/countdownjs | lib/qunit/qunit.js | useStrictEquality | function useStrictEquality(b, a) {
if (b instanceof a.constructor || a instanceof b.constructor) {
// to catch short annotaion VS 'new' annotation of a
// declaration
// e.g. var i = 1;
// var j = new Number(1);
return a == b;
} else {
return a === b;
}
} | javascript | function useStrictEquality(b, a) {
if (b instanceof a.constructor || a instanceof b.constructor) {
// to catch short annotaion VS 'new' annotation of a
// declaration
// e.g. var i = 1;
// var j = new Number(1);
return a == b;
} else {
return a === b;
}
} | [
"function",
"useStrictEquality",
"(",
"b",
",",
"a",
")",
"{",
"if",
"(",
"b",
"instanceof",
"a",
".",
"constructor",
"||",
"a",
"instanceof",
"b",
".",
"constructor",
")",
"{",
"// to catch short annotaion VS 'new' annotation of a",
"// declaration",
"// e.g. var i... | for string, boolean, number and null | [
"for",
"string",
"boolean",
"number",
"and",
"null"
] | cb5b1877ca474d3c86e0407c090a7af90fbded41 | https://github.com/mckamey/countdownjs/blob/cb5b1877ca474d3c86e0407c090a7af90fbded41/lib/qunit/qunit.js#L1043-L1053 |
18,984 | jackbearheart/email-addresses | lib/email-addresses.js | o | function o(name, value) {
return {
name: name,
tokens: value || "",
semantic: value || "",
children: []
};
} | javascript | function o(name, value) {
return {
name: name,
tokens: value || "",
semantic: value || "",
children: []
};
} | [
"function",
"o",
"(",
"name",
",",
"value",
")",
"{",
"return",
"{",
"name",
":",
"name",
",",
"tokens",
":",
"value",
"||",
"\"\"",
",",
"semantic",
":",
"value",
"||",
"\"\"",
",",
"children",
":",
"[",
"]",
"}",
";",
"}"
] | parser helper functions | [
"parser",
"helper",
"functions"
] | 30a1e654f8d2227322d54683dbf418c4b956fec9 | https://github.com/jackbearheart/email-addresses/blob/30a1e654f8d2227322d54683dbf418c4b956fec9/lib/email-addresses.js#L47-L54 |
18,985 | jackbearheart/email-addresses | lib/email-addresses.js | displayName | function displayName() {
return wrap('display-name', function phraseFixedSemantic() {
var result = phrase();
if (result !== null) {
result.semantic = collapseWhitespace(result.semantic);
}
return result;
}());
} | javascript | function displayName() {
return wrap('display-name', function phraseFixedSemantic() {
var result = phrase();
if (result !== null) {
result.semantic = collapseWhitespace(result.semantic);
}
return result;
}());
} | [
"function",
"displayName",
"(",
")",
"{",
"return",
"wrap",
"(",
"'display-name'",
",",
"function",
"phraseFixedSemantic",
"(",
")",
"{",
"var",
"result",
"=",
"phrase",
"(",
")",
";",
"if",
"(",
"result",
"!==",
"null",
")",
"{",
"result",
".",
"semanti... | display-name = phrase | [
"display",
"-",
"name",
"=",
"phrase"
] | 30a1e654f8d2227322d54683dbf418c4b956fec9 | https://github.com/jackbearheart/email-addresses/blob/30a1e654f8d2227322d54683dbf418c4b956fec9/lib/email-addresses.js#L491-L499 |
18,986 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | searchNodeInTree | function searchNodeInTree(treeRoot, nodeId){
if (treeRoot.childNodes){
for (var i = 0; i < treeRoot.childNodes.length; ++i){
var currentNode = treeRoot.childNodes[i];
if (currentNode._id == nodeId){
return currentNode;
} else {
var found = ... | javascript | function searchNodeInTree(treeRoot, nodeId){
if (treeRoot.childNodes){
for (var i = 0; i < treeRoot.childNodes.length; ++i){
var currentNode = treeRoot.childNodes[i];
if (currentNode._id == nodeId){
return currentNode;
} else {
var found = ... | [
"function",
"searchNodeInTree",
"(",
"treeRoot",
",",
"nodeId",
")",
"{",
"if",
"(",
"treeRoot",
".",
"childNodes",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"treeRoot",
".",
"childNodes",
".",
"length",
";",
"++",
"i",
")",
"{",
"... | Depth First Search algorithm that returns the node and its children with the id "nodeId"
@param treeRoot
@param nodeId
@returns {*} | [
"Depth",
"First",
"Search",
"algorithm",
"that",
"returns",
"the",
"node",
"and",
"its",
"children",
"with",
"the",
"id",
"nodeId"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L209-L224 |
18,987 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | createTree | function createTree(){
for (var i = 0; i < gRootNodes.length; ++i){
var node = {
_id : gRootNodes[i]._id, //todo : id instead of name?
node : gRootNodes[i],
parent : "root",
childNodes : loadChildNodes(gRootNodes[i])
};
gTree.childNodes.push(no... | javascript | function createTree(){
for (var i = 0; i < gRootNodes.length; ++i){
var node = {
_id : gRootNodes[i]._id, //todo : id instead of name?
node : gRootNodes[i],
parent : "root",
childNodes : loadChildNodes(gRootNodes[i])
};
gTree.childNodes.push(no... | [
"function",
"createTree",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"gRootNodes",
".",
"length",
";",
"++",
"i",
")",
"{",
"var",
"node",
"=",
"{",
"_id",
":",
"gRootNodes",
"[",
"i",
"]",
".",
"_id",
",",
"//todo : id inste... | Creates an object containing the nodes of the graph in the form of a tree | [
"Creates",
"an",
"object",
"containing",
"the",
"nodes",
"of",
"the",
"graph",
"in",
"the",
"form",
"of",
"a",
"tree"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L273-L283 |
18,988 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | loadChildNodes | function loadChildNodes(parentNode){
if (gNodesWithChildren[parentNode._id]){
var children = [];
for (var i = 0; i < gNodesWithChildren[parentNode._id].length; ++i){
var currentNode = gNodesWithChildren[parentNode._id][i];
children.push({
_id : currentNode._id... | javascript | function loadChildNodes(parentNode){
if (gNodesWithChildren[parentNode._id]){
var children = [];
for (var i = 0; i < gNodesWithChildren[parentNode._id].length; ++i){
var currentNode = gNodesWithChildren[parentNode._id][i];
children.push({
_id : currentNode._id... | [
"function",
"loadChildNodes",
"(",
"parentNode",
")",
"{",
"if",
"(",
"gNodesWithChildren",
"[",
"parentNode",
".",
"_id",
"]",
")",
"{",
"var",
"children",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"gNodesWithChildren",
"[",... | Returns the nodes children of the node in parameter
@param parentNode
@returns {Array} | [
"Returns",
"the",
"nodes",
"children",
"of",
"the",
"node",
"in",
"parameter"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L290-L304 |
18,989 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | displayNameDOM | function displayNameDOM(node){
$('.nodeLabel').remove();
var nodePos = layout.getNodePosition(node._id);
var domPos = {
x: nodePos.x,
y: nodePos.y
};
graphics.transformGraphToClientCoordinates(domPos);
var labelStyle = generateDOMLabel(node).style;
labelStyle.left = domPos.... | javascript | function displayNameDOM(node){
$('.nodeLabel').remove();
var nodePos = layout.getNodePosition(node._id);
var domPos = {
x: nodePos.x,
y: nodePos.y
};
graphics.transformGraphToClientCoordinates(domPos);
var labelStyle = generateDOMLabel(node).style;
labelStyle.left = domPos.... | [
"function",
"displayNameDOM",
"(",
"node",
")",
"{",
"$",
"(",
"'.nodeLabel'",
")",
".",
"remove",
"(",
")",
";",
"var",
"nodePos",
"=",
"layout",
".",
"getNodePosition",
"(",
"node",
".",
"_id",
")",
";",
"var",
"domPos",
"=",
"{",
"x",
":",
"nodePo... | Removes the previous label and add a new one for the current node
@param node | [
"Removes",
"the",
"previous",
"label",
"and",
"add",
"a",
"new",
"one",
"for",
"the",
"current",
"node"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L323-L336 |
18,990 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | generateDOMLabel | function generateDOMLabel(node) {
var label = document.createElement('span');
label.className = 'nodeLabel';
label.id = node._id;
if (node.name){
label.innerText = node.name;
} else {
label.innerText = node._id;
}
divGraph.appendChild(label);
return label;
} | javascript | function generateDOMLabel(node) {
var label = document.createElement('span');
label.className = 'nodeLabel';
label.id = node._id;
if (node.name){
label.innerText = node.name;
} else {
label.innerText = node._id;
}
divGraph.appendChild(label);
return label;
} | [
"function",
"generateDOMLabel",
"(",
"node",
")",
"{",
"var",
"label",
"=",
"document",
".",
"createElement",
"(",
"'span'",
")",
";",
"label",
".",
"className",
"=",
"'nodeLabel'",
";",
"label",
".",
"id",
"=",
"node",
".",
"_id",
";",
"if",
"(",
"nod... | Create a span element containing the name of the parameter node
@param node
@returns {Element} | [
"Create",
"a",
"span",
"element",
"containing",
"the",
"name",
"of",
"the",
"parameter",
"node"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L343-L355 |
18,991 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | createTableLayout | function createTableLayout(){
var tableItem = {
type: 'component',
componentName: 'Table'
};
var stackItem = myLayout.root.getItemsById('stack-topleft')[0];
stackItem.addChild(tableItem);
// get focus on the search tab
stackItem.setActiveContentItem(myLayout.root.getItemsById('n... | javascript | function createTableLayout(){
var tableItem = {
type: 'component',
componentName: 'Table'
};
var stackItem = myLayout.root.getItemsById('stack-topleft')[0];
stackItem.addChild(tableItem);
// get focus on the search tab
stackItem.setActiveContentItem(myLayout.root.getItemsById('n... | [
"function",
"createTableLayout",
"(",
")",
"{",
"var",
"tableItem",
"=",
"{",
"type",
":",
"'component'",
",",
"componentName",
":",
"'Table'",
"}",
";",
"var",
"stackItem",
"=",
"myLayout",
".",
"root",
".",
"getItemsById",
"(",
"'stack-topleft'",
")",
"[",... | Creates a golden-layout component for SlickGrid and initializes it | [
"Creates",
"a",
"golden",
"-",
"layout",
"component",
"for",
"SlickGrid",
"and",
"initializes",
"it"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L360-L371 |
18,992 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | initJQueryEvents | function initJQueryEvents(){
$('#searchDiv').parent().scroll(function() {
if($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 100) {
globalFunc.addNodesInList();
}
});
$('#toggleLayout').click(function() {
toggleLayout();
});
$("#sliderTe... | javascript | function initJQueryEvents(){
$('#searchDiv').parent().scroll(function() {
if($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 100) {
globalFunc.addNodesInList();
}
});
$('#toggleLayout').click(function() {
toggleLayout();
});
$("#sliderTe... | [
"function",
"initJQueryEvents",
"(",
")",
"{",
"$",
"(",
"'#searchDiv'",
")",
".",
"parent",
"(",
")",
".",
"scroll",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"$",
"(",
"this",
")",
".",
"scrollTop",
"(",
")",
"+",
"$",
"(",
"this",
")",
".",
... | Initializes the necessary events | [
"Initializes",
"the",
"necessary",
"events"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L376-L403 |
18,993 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | panToNode | function panToNode(node) {
var pos = layout.getNodePosition(node._id);
renderer.moveTo(pos.x, pos.y);
highlightNodeWebGL(node);
} | javascript | function panToNode(node) {
var pos = layout.getNodePosition(node._id);
renderer.moveTo(pos.x, pos.y);
highlightNodeWebGL(node);
} | [
"function",
"panToNode",
"(",
"node",
")",
"{",
"var",
"pos",
"=",
"layout",
".",
"getNodePosition",
"(",
"node",
".",
"_id",
")",
";",
"renderer",
".",
"moveTo",
"(",
"pos",
".",
"x",
",",
"pos",
".",
"y",
")",
";",
"highlightNodeWebGL",
"(",
"node"... | Center the focus on the node with nodeId, then highlight it
@param node | [
"Center",
"the",
"focus",
"on",
"the",
"node",
"with",
"nodeId",
"then",
"highlight",
"it"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L409-L414 |
18,994 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | highlightNodeWebGL | function highlightNodeWebGL(node) {
var ui = graphics.getNodeUI(node._id);
if (prevNodeUI){
prevNodeUI.size = NODE_SIZE;
//prevNodeUI.color = hexColorToWebGLColor(colorsByNodeType[node._type]);
}
prevNodeUI = ui;
ui.size = NODE_SIZE * 4;
//ui.color = 0xFFA500FF; //orange
if ... | javascript | function highlightNodeWebGL(node) {
var ui = graphics.getNodeUI(node._id);
if (prevNodeUI){
prevNodeUI.size = NODE_SIZE;
//prevNodeUI.color = hexColorToWebGLColor(colorsByNodeType[node._type]);
}
prevNodeUI = ui;
ui.size = NODE_SIZE * 4;
//ui.color = 0xFFA500FF; //orange
if ... | [
"function",
"highlightNodeWebGL",
"(",
"node",
")",
"{",
"var",
"ui",
"=",
"graphics",
".",
"getNodeUI",
"(",
"node",
".",
"_id",
")",
";",
"if",
"(",
"prevNodeUI",
")",
"{",
"prevNodeUI",
".",
"size",
"=",
"NODE_SIZE",
";",
"//prevNodeUI.color = hexColorToW... | Highlight function especially for WebGL
@param node | [
"Highlight",
"function",
"especially",
"for",
"WebGL"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L420-L433 |
18,995 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | addToGlobalNodes | function addToGlobalNodes(node){
var nodeToAdd = {
"_id": node.id(),
"_world": node.world(),
"_time": node.time(),
"_type": (node.nodeTypeName() ? node.nodeTypeName() : "default")
};
var containsRel = false;
// add all the attributes of the node to the JSON
graph.res... | javascript | function addToGlobalNodes(node){
var nodeToAdd = {
"_id": node.id(),
"_world": node.world(),
"_time": node.time(),
"_type": (node.nodeTypeName() ? node.nodeTypeName() : "default")
};
var containsRel = false;
// add all the attributes of the node to the JSON
graph.res... | [
"function",
"addToGlobalNodes",
"(",
"node",
")",
"{",
"var",
"nodeToAdd",
"=",
"{",
"\"_id\"",
":",
"node",
".",
"id",
"(",
")",
",",
"\"_world\"",
":",
"node",
".",
"world",
"(",
")",
",",
"\"_time\"",
":",
"node",
".",
"time",
"(",
")",
",",
"\"... | Transform every node from mwg and add them to a global var
@param node | [
"Transform",
"every",
"node",
"from",
"mwg",
"and",
"add",
"them",
"to",
"a",
"global",
"var"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L439-L486 |
18,996 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | addNodeToGraph | function addNodeToGraph(node){
gNodesDisplayed.push(node);
g.addNode(node._id, node);
if (contains(childrenNodes, node._id)){
var parentNode = getNodeFromId(nodesToBeLinked[node._id].from);
if (contains(gNodesDisplayed, parentNode)){
addLinkToParent(node._id, parentNode._id);
... | javascript | function addNodeToGraph(node){
gNodesDisplayed.push(node);
g.addNode(node._id, node);
if (contains(childrenNodes, node._id)){
var parentNode = getNodeFromId(nodesToBeLinked[node._id].from);
if (contains(gNodesDisplayed, parentNode)){
addLinkToParent(node._id, parentNode._id);
... | [
"function",
"addNodeToGraph",
"(",
"node",
")",
"{",
"gNodesDisplayed",
".",
"push",
"(",
"node",
")",
";",
"g",
".",
"addNode",
"(",
"node",
".",
"_id",
",",
"node",
")",
";",
"if",
"(",
"contains",
"(",
"childrenNodes",
",",
"node",
".",
"_id",
")"... | Add the node in param to the graph
@param node | [
"Add",
"the",
"node",
"in",
"param",
"to",
"the",
"graph"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L492-L504 |
18,997 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | addRelToGraph | function addRelToGraph(node){
var children = [];
for (var prop in node){
if(node.hasOwnProperty(prop)){
if (typeof node[prop] === 'object') {
var linkedNodes = node[prop];
// same for links
if (colorsByLinkType[prop] == null) {
... | javascript | function addRelToGraph(node){
var children = [];
for (var prop in node){
if(node.hasOwnProperty(prop)){
if (typeof node[prop] === 'object') {
var linkedNodes = node[prop];
// same for links
if (colorsByLinkType[prop] == null) {
... | [
"function",
"addRelToGraph",
"(",
"node",
")",
"{",
"var",
"children",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"prop",
"in",
"node",
")",
"{",
"if",
"(",
"node",
".",
"hasOwnProperty",
"(",
"prop",
")",
")",
"{",
"if",
"(",
"typeof",
"node",
"[",
... | Add the necessary nodes and the relationships to the graph
@param node | [
"Add",
"the",
"necessary",
"nodes",
"and",
"the",
"relationships",
"to",
"the",
"graph"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L510-L541 |
18,998 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | getNodeFromId | function getNodeFromId(nodeId){
var res = $.grep(gAllNodes, function(e) {
return e._id === nodeId;
});
return res[0];
} | javascript | function getNodeFromId(nodeId){
var res = $.grep(gAllNodes, function(e) {
return e._id === nodeId;
});
return res[0];
} | [
"function",
"getNodeFromId",
"(",
"nodeId",
")",
"{",
"var",
"res",
"=",
"$",
".",
"grep",
"(",
"gAllNodes",
",",
"function",
"(",
"e",
")",
"{",
"return",
"e",
".",
"_id",
"===",
"nodeId",
";",
"}",
")",
";",
"return",
"res",
"[",
"0",
"]",
";",... | Function that will return the node from the id in parameter
@param nodeId
@returns {*} | [
"Function",
"that",
"will",
"return",
"the",
"node",
"from",
"the",
"id",
"in",
"parameter"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L548-L553 |
18,999 | datathings/greycat | plugins/incub/visualizer/old/src/js/demo_vivagraph.js | delayLinkCreation | function delayLinkCreation(idParent, idChild, relationName){
childrenNodes.push(idChild);
return {
from: idParent,
name: relationName
};
} | javascript | function delayLinkCreation(idParent, idChild, relationName){
childrenNodes.push(idChild);
return {
from: idParent,
name: relationName
};
} | [
"function",
"delayLinkCreation",
"(",
"idParent",
",",
"idChild",
",",
"relationName",
")",
"{",
"childrenNodes",
".",
"push",
"(",
"idChild",
")",
";",
"return",
"{",
"from",
":",
"idParent",
",",
"name",
":",
"relationName",
"}",
";",
"}"
] | Handle the links that need to be created by keeping the nodes id and the relationship name
@param idParent
@param idChild
@param relationName
@returns {{from: *, to: *, name: *}} | [
"Handle",
"the",
"links",
"that",
"need",
"to",
"be",
"created",
"by",
"keeping",
"the",
"nodes",
"id",
"and",
"the",
"relationship",
"name"
] | 602243bdd50e1f869bb19e3ac2991c540ea7af79 | https://github.com/datathings/greycat/blob/602243bdd50e1f869bb19e3ac2991c540ea7af79/plugins/incub/visualizer/old/src/js/demo_vivagraph.js#L561-L567 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.