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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(classes_string) {
var classes = [];
if (Lava.schema.view.VALIDATE_CLASS_NAMES) {
this.assertClassStringValid(classes_string);
}
if (classes_string != '') {
classes = classes_string.split(/\s+/);
}
return classes;
} | javascript | function(classes_string) {
var classes = [];
if (Lava.schema.view.VALIDATE_CLASS_NAMES) {
this.assertClassStringValid(classes_string);
}
if (classes_string != '') {
classes = classes_string.split(/\s+/);
}
return classes;
} | [
"function",
"(",
"classes_string",
")",
"{",
"var",
"classes",
"=",
"[",
"]",
";",
"if",
"(",
"Lava",
".",
"schema",
".",
"view",
".",
"VALIDATE_CLASS_NAMES",
")",
"{",
"this",
".",
"assertClassStringValid",
"(",
"classes_string",
")",
";",
"}",
"if",
"(... | Split a string into array of class names
@param {string} classes_string
@returns {Array} | [
"Split",
"a",
"string",
"into",
"array",
"of",
"class",
"names"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L9299-L9315 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(argument, event_args, listener_args) {
var new_classes = this._toClassNames(argument.getValue().toString().trim());
if (this._is_inDOM) {
Firestorm.Element.removeClasses(this.getDOMElement(), this._class_bindings_values[listener_args.name]);
Firestorm.Element.addClasses(this.getDOMElement(), new_c... | javascript | function(argument, event_args, listener_args) {
var new_classes = this._toClassNames(argument.getValue().toString().trim());
if (this._is_inDOM) {
Firestorm.Element.removeClasses(this.getDOMElement(), this._class_bindings_values[listener_args.name]);
Firestorm.Element.addClasses(this.getDOMElement(), new_c... | [
"function",
"(",
"argument",
",",
"event_args",
",",
"listener_args",
")",
"{",
"var",
"new_classes",
"=",
"this",
".",
"_toClassNames",
"(",
"argument",
".",
"getValue",
"(",
")",
".",
"toString",
"(",
")",
".",
"trim",
"(",
")",
")",
";",
"if",
"(",
... | Class binding argument has changed it's value. Refresh internal class values and element's classes
@param {Lava.scope.Argument} argument
@param event_args
@param listener_args | [
"Class",
"binding",
"argument",
"has",
"changed",
"it",
"s",
"value",
".",
"Refresh",
"internal",
"class",
"values",
"and",
"element",
"s",
"classes"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L9323-L9336 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function() {
var resultClasses = this._static_classes.clone(),
name,
value;
for (name in this._class_bindings) {
// do not need to check or convert, cause join() will convert everything to string, and nulls to empty string
resultClasses.push(
this._class_bindings[name].getValue()
);
}
va... | javascript | function() {
var resultClasses = this._static_classes.clone(),
name,
value;
for (name in this._class_bindings) {
// do not need to check or convert, cause join() will convert everything to string, and nulls to empty string
resultClasses.push(
this._class_bindings[name].getValue()
);
}
va... | [
"function",
"(",
")",
"{",
"var",
"resultClasses",
"=",
"this",
".",
"_static_classes",
".",
"clone",
"(",
")",
",",
"name",
",",
"value",
";",
"for",
"(",
"name",
"in",
"this",
".",
"_class_bindings",
")",
"{",
"// do not need to check or convert, cause join(... | Render value of the "class" attribute, including bound classes
@returns {string} | [
"Render",
"value",
"of",
"the",
"class",
"attribute",
"including",
"bound",
"classes"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L9361-L9384 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function() {
var result_styles = [],
name,
value;
for (name in this._static_styles) {
result_styles.push(name + ':' + this._static_styles[name]);
}
for (name in this._style_bindings) {
value = this._style_bindings[name].getValue();
if (value != null) {
result_styles.push(name + ':' + va... | javascript | function() {
var result_styles = [],
name,
value;
for (name in this._static_styles) {
result_styles.push(name + ':' + this._static_styles[name]);
}
for (name in this._style_bindings) {
value = this._style_bindings[name].getValue();
if (value != null) {
result_styles.push(name + ':' + va... | [
"function",
"(",
")",
"{",
"var",
"result_styles",
"=",
"[",
"]",
",",
"name",
",",
"value",
";",
"for",
"(",
"name",
"in",
"this",
".",
"_static_styles",
")",
"{",
"result_styles",
".",
"push",
"(",
"name",
"+",
"':'",
"+",
"this",
".",
"_static_sty... | Render content of the "style" attribute, including bound styles
@returns {string} | [
"Render",
"content",
"of",
"the",
"style",
"attribute",
"including",
"bound",
"styles"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L9390-L9419 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(name, value) {
var result = '';
if (value === true) {
result = ' ' + name + '="' + name + '"';
} else if (value != null && value !== false) {
result = ' ' + name + '="' + this.escapeAttributeValue(value + '') + '"';
}
return result;
} | javascript | function(name, value) {
var result = '';
if (value === true) {
result = ' ' + name + '="' + name + '"';
} else if (value != null && value !== false) {
result = ' ' + name + '="' + this.escapeAttributeValue(value + '') + '"';
}
return result;
} | [
"function",
"(",
"name",
",",
"value",
")",
"{",
"var",
"result",
"=",
"''",
";",
"if",
"(",
"value",
"===",
"true",
")",
"{",
"result",
"=",
"' '",
"+",
"name",
"+",
"'=\"'",
"+",
"name",
"+",
"'\"'",
";",
"}",
"else",
"if",
"(",
"value",
"!="... | Render one attribute
@param {string} name
@param {boolean|null|string} value
@returns {string} | [
"Render",
"one",
"attribute"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L9427-L9443 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function() {
var classes = this._renderClasses(),
style = this._renderStyles(),
properties_string = '',
name;
// see informInDOM_Normal
// this._element = null;
for (name in this._static_properties) {
properties_string += this._renderAttribute(name, this._static_properties[name]);
}
for (n... | javascript | function() {
var classes = this._renderClasses(),
style = this._renderStyles(),
properties_string = '',
name;
// see informInDOM_Normal
// this._element = null;
for (name in this._static_properties) {
properties_string += this._renderAttribute(name, this._static_properties[name]);
}
for (n... | [
"function",
"(",
")",
"{",
"var",
"classes",
"=",
"this",
".",
"_renderClasses",
"(",
")",
",",
"style",
"=",
"this",
".",
"_renderStyles",
"(",
")",
",",
"properties_string",
"=",
"''",
",",
"name",
";",
"// see informInDOM_Normal",
"// this._element = null;"... | Render the opening HTML tag, including all attributes
@returns {string} | [
"Render",
"the",
"opening",
"HTML",
"tag",
"including",
"all",
"attributes"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L9449-L9487 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(html) {
if (Lava.schema.DEBUG && this._is_void) Lava.t('Trying to wrap content in void tag');
// _element is cleared in _renderOpeningTag
return this._renderOpeningTag() + ">" + html + "</" + this._tag_name + ">";
} | javascript | function(html) {
if (Lava.schema.DEBUG && this._is_void) Lava.t('Trying to wrap content in void tag');
// _element is cleared in _renderOpeningTag
return this._renderOpeningTag() + ">" + html + "</" + this._tag_name + ">";
} | [
"function",
"(",
"html",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"this",
".",
"_is_void",
")",
"Lava",
".",
"t",
"(",
"'Trying to wrap content in void tag'",
")",
";",
"// _element is cleared in _renderOpeningTag",
"return",
"this",
".",
... | Render tag and wrap given HTML code inside it
@param {string} html
@returns {string} | [
"Render",
"tag",
"and",
"wrap",
"given",
"HTML",
"code",
"inside",
"it"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L9494-L9500 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(html) {
if (!this._is_inDOM) Lava.t("setHTML: element is not in DOM");
if (this._is_void) Lava.t('setHTML on void tag');
Firestorm.Element.setProperty(this.getDOMElement(), 'html', html);
} | javascript | function(html) {
if (!this._is_inDOM) Lava.t("setHTML: element is not in DOM");
if (this._is_void) Lava.t('setHTML on void tag');
Firestorm.Element.setProperty(this.getDOMElement(), 'html', html);
} | [
"function",
"(",
"html",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_is_inDOM",
")",
"Lava",
".",
"t",
"(",
"\"setHTML: element is not in DOM\"",
")",
";",
"if",
"(",
"this",
".",
"_is_void",
")",
"Lava",
".",
"t",
"(",
"'setHTML on void tag'",
")",
";",
... | Set innerHTML of container's element. Container must be in DOM
@param {string} html | [
"Set",
"innerHTML",
"of",
"container",
"s",
"element",
".",
"Container",
"must",
"be",
"in",
"DOM"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L9518-L9525 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(callback_name, callback_argument) {
var name;
for (name in this._property_bindings) this._property_bindings[name][callback_name](callback_argument);
for (name in this._style_bindings) this._style_bindings[name][callback_name](callback_argument);
for (name in this._class_bindings) this._class_bindin... | javascript | function(callback_name, callback_argument) {
var name;
for (name in this._property_bindings) this._property_bindings[name][callback_name](callback_argument);
for (name in this._style_bindings) this._style_bindings[name][callback_name](callback_argument);
for (name in this._class_bindings) this._class_bindin... | [
"function",
"(",
"callback_name",
",",
"callback_argument",
")",
"{",
"var",
"name",
";",
"for",
"(",
"name",
"in",
"this",
".",
"_property_bindings",
")",
"this",
".",
"_property_bindings",
"[",
"name",
"]",
"[",
"callback_name",
"]",
"(",
"callback_argument"... | Call a method of all binding arguments
@param {string} callback_name Method to call
@param {*} callback_argument Argument for the method | [
"Call",
"a",
"method",
"of",
"all",
"binding",
"arguments"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L9680-L9690 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(element) {
var Element = Firestorm.Element,
name;
if (this._is_inDOM) Lava.t("Can not set duplicate id attribute on elements");
// there must not be ID attribute
if (Element.getProperty(element, 'id')) Lava.t("Target element already has an ID, and could be owned by another container");
if (Eleme... | javascript | function(element) {
var Element = Firestorm.Element,
name;
if (this._is_inDOM) Lava.t("Can not set duplicate id attribute on elements");
// there must not be ID attribute
if (Element.getProperty(element, 'id')) Lava.t("Target element already has an ID, and could be owned by another container");
if (Eleme... | [
"function",
"(",
"element",
")",
"{",
"var",
"Element",
"=",
"Firestorm",
".",
"Element",
",",
"name",
";",
"if",
"(",
"this",
".",
"_is_inDOM",
")",
"Lava",
".",
"t",
"(",
"\"Can not set duplicate id attribute on elements\"",
")",
";",
"// there must not be ID ... | Bind container to existing DOM element. Apply new styles, classes and properties
@param {HTMLElement} element | [
"Bind",
"container",
"to",
"existing",
"DOM",
"element",
".",
"Apply",
"new",
"styles",
"classes",
"and",
"properties"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L9696-L9728 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function() {
var input_element = this.getDOMElement();
Firestorm.Element.removeListener(input_element, "onpropertychange", this._OldIE_property_change_callback);
Firestorm.Element.removeListener(input_element, "selectionchange", this._OldIE_refresh_callback);
Firestorm.Element.removeListener(input_element, "ke... | javascript | function() {
var input_element = this.getDOMElement();
Firestorm.Element.removeListener(input_element, "onpropertychange", this._OldIE_property_change_callback);
Firestorm.Element.removeListener(input_element, "selectionchange", this._OldIE_refresh_callback);
Firestorm.Element.removeListener(input_element, "ke... | [
"function",
"(",
")",
"{",
"var",
"input_element",
"=",
"this",
".",
"getDOMElement",
"(",
")",
";",
"Firestorm",
".",
"Element",
".",
"removeListener",
"(",
"input_element",
",",
"\"onpropertychange\"",
",",
"this",
".",
"_OldIE_property_change_callback",
")",
... | Removes IE listeners | [
"Removes",
"IE",
"listeners"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L9997-L10007 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(view, config, widget) {
this._view = view;
//this._config = config;
this._widget = widget;
this._start_script_id = 'c' + view.guid + 's';
this._end_script_id = 'c' + view.guid + 'e';
} | javascript | function(view, config, widget) {
this._view = view;
//this._config = config;
this._widget = widget;
this._start_script_id = 'c' + view.guid + 's';
this._end_script_id = 'c' + view.guid + 'e';
} | [
"function",
"(",
"view",
",",
"config",
",",
"widget",
")",
"{",
"this",
".",
"_view",
"=",
"view",
";",
"//this._config = config;",
"this",
".",
"_widget",
"=",
"widget",
";",
"this",
".",
"_start_script_id",
"=",
"'c'",
"+",
"view",
".",
"guid",
"+",
... | Create Morph container instance
@param {Lava.view.Abstract} view
@param {Object} config
@param {Lava.widget.Standard} widget | [
"Create",
"Morph",
"container",
"instance"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10091-L10100 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function() {
var start_element = document.getElementById(this._start_script_id),
end_element = document.getElementById(this._end_script_id);
/**
* In some cases, Internet Explorer can create an anonymous node in
* the hierarchy with no tagName. You can create this scenario via:
*
* div = docume... | javascript | function() {
var start_element = document.getElementById(this._start_script_id),
end_element = document.getElementById(this._end_script_id);
/**
* In some cases, Internet Explorer can create an anonymous node in
* the hierarchy with no tagName. You can create this scenario via:
*
* div = docume... | [
"function",
"(",
")",
"{",
"var",
"start_element",
"=",
"document",
".",
"getElementById",
"(",
"this",
".",
"_start_script_id",
")",
",",
"end_element",
"=",
"document",
".",
"getElementById",
"(",
"this",
".",
"_end_script_id",
")",
";",
"/**\n\t\t * In some c... | Retrieve both <script> tags from DOM into local references,
at the same time applying fixes for old browsers | [
"Retrieve",
"both",
"<",
";",
"script>",
";",
"tags",
"from",
"DOM",
"into",
"local",
"references",
"at",
"the",
"same",
"time",
"applying",
"fixes",
"for",
"old",
"browsers"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10106-L10165 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(html) {
if (!this._is_inDOM) Lava.t("setHTML: container is not in DOM");
Firestorm.DOM.clearInnerRange(this.getStartElement(), this.getEndElement());
Firestorm.DOM.insertHTMLBefore(this.getEndElement(), html);
} | javascript | function(html) {
if (!this._is_inDOM) Lava.t("setHTML: container is not in DOM");
Firestorm.DOM.clearInnerRange(this.getStartElement(), this.getEndElement());
Firestorm.DOM.insertHTMLBefore(this.getEndElement(), html);
} | [
"function",
"(",
"html",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_is_inDOM",
")",
"Lava",
".",
"t",
"(",
"\"setHTML: container is not in DOM\"",
")",
";",
"Firestorm",
".",
"DOM",
".",
"clearInnerRange",
"(",
"this",
".",
"getStartElement",
"(",
")",
",",
... | Replace the content between container's tags. Requires container to be in DOM
@param {string} html | [
"Replace",
"the",
"content",
"between",
"container",
"s",
"tags",
".",
"Requires",
"container",
"to",
"be",
"in",
"DOM"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10219-L10226 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(view, config, widget) {
this._view = view;
//this._config = config;
this._widget = widget;
if (('options' in config)) {
if ('appender' in config.options) {
if (Lava.schema.DEBUG && !this['_append' + config.options.appender]) Lava.t('[Emulated container] wrong appender: ' + config.options.appe... | javascript | function(view, config, widget) {
this._view = view;
//this._config = config;
this._widget = widget;
if (('options' in config)) {
if ('appender' in config.options) {
if (Lava.schema.DEBUG && !this['_append' + config.options.appender]) Lava.t('[Emulated container] wrong appender: ' + config.options.appe... | [
"function",
"(",
"view",
",",
"config",
",",
"widget",
")",
"{",
"this",
".",
"_view",
"=",
"view",
";",
"//this._config = config;",
"this",
".",
"_widget",
"=",
"widget",
";",
"if",
"(",
"(",
"'options'",
"in",
"config",
")",
")",
"{",
"if",
"(",
"'... | Create Emulated container instance
@param {Lava.view.Abstract} view
@param {_cEmulatedContainer} config
@param {Lava.widget.Standard} widget | [
"Create",
"Emulated",
"container",
"instance"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10371-L10391 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(config, view, container) {
this._config = config;
this._view = view;
this._container = container;
if (config.get_start_element_callback) {
this._getStartElement = config.get_start_element_callback;
}
if (config.get_end_element_callback) {
this._getEndElement = config.get_end_element_cal... | javascript | function(config, view, container) {
this._config = config;
this._view = view;
this._container = container;
if (config.get_start_element_callback) {
this._getStartElement = config.get_start_element_callback;
}
if (config.get_end_element_callback) {
this._getEndElement = config.get_end_element_cal... | [
"function",
"(",
"config",
",",
"view",
",",
"container",
")",
"{",
"this",
".",
"_config",
"=",
"config",
";",
"this",
".",
"_view",
"=",
"view",
";",
"this",
".",
"_container",
"=",
"container",
";",
"if",
"(",
"config",
".",
"get_start_element_callbac... | Create refresher instance
@param {_cRefresher} config
@param {Lava.view.Abstract} view
@param {_iContainer} container | [
"Create",
"refresher",
"instance"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10601-L10619 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(templates) {
for (var i = 0, count = templates.length; i < count; i++) {
this._remove_queue[templates[i].guid] = templates[i];
}
} | javascript | function(templates) {
for (var i = 0, count = templates.length; i < count; i++) {
this._remove_queue[templates[i].guid] = templates[i];
}
} | [
"function",
"(",
"templates",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"count",
"=",
"templates",
".",
"length",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",
"this",
".",
"_remove_queue",
"[",
"templates",
"[",
"i",
"]",
".",
"guid",... | Queue templates for removal
@param {Array.<Lava.system.Template>} templates | [
"Queue",
"templates",
"for",
"removal"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10625-L10633 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(current_templates) {
var i = 1,
count = current_templates.length,
guid,
previous_template = current_templates[0];
if (previous_template) { // if list is not empty
delete this._remove_queue[previous_template.guid];
// handle first template separately from others
if (!previous_template.... | javascript | function(current_templates) {
var i = 1,
count = current_templates.length,
guid,
previous_template = current_templates[0];
if (previous_template) { // if list is not empty
delete this._remove_queue[previous_template.guid];
// handle first template separately from others
if (!previous_template.... | [
"function",
"(",
"current_templates",
")",
"{",
"var",
"i",
"=",
"1",
",",
"count",
"=",
"current_templates",
".",
"length",
",",
"guid",
",",
"previous_template",
"=",
"current_templates",
"[",
"0",
"]",
";",
"if",
"(",
"previous_template",
")",
"{",
"// ... | Insert new templates into DOM and remove those, which are queued for removal. Reorder existing templates
@param {Array.<Lava.system.Template>} current_templates Templates, that refresher must render and insert into DOM.
Some of them can be already in DOM. | [
"Insert",
"new",
"templates",
"into",
"DOM",
"and",
"remove",
"those",
"which",
"are",
"queued",
"for",
"removal",
".",
"Reorder",
"existing",
"templates"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10640-L10693 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(template) {
this._view.getContainer().prependHTML(template.render());
template.broadcastInDOM();
this._current_templates.unshift(template);
} | javascript | function(template) {
this._view.getContainer().prependHTML(template.render());
template.broadcastInDOM();
this._current_templates.unshift(template);
} | [
"function",
"(",
"template",
")",
"{",
"this",
".",
"_view",
".",
"getContainer",
"(",
")",
".",
"prependHTML",
"(",
"template",
".",
"render",
"(",
")",
")",
";",
"template",
".",
"broadcastInDOM",
"(",
")",
";",
"this",
".",
"_current_templates",
".",
... | Insert template at the top of view's container
@param {Lava.system.Template} template | [
"Insert",
"template",
"at",
"the",
"top",
"of",
"view",
"s",
"container"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10699-L10705 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(current_templates) {
var i = 0,
count = current_templates.length,
guid;
// from templates, which are prepared for removal, filter out those, which should be in DOM
for (; i < count; i++) {
delete this._remove_queue[current_templates[i].guid];
}
for (guid in this._remove_queue) {
if ... | javascript | function(current_templates) {
var i = 0,
count = current_templates.length,
guid;
// from templates, which are prepared for removal, filter out those, which should be in DOM
for (; i < count; i++) {
delete this._remove_queue[current_templates[i].guid];
}
for (guid in this._remove_queue) {
if ... | [
"function",
"(",
"current_templates",
")",
"{",
"var",
"i",
"=",
"0",
",",
"count",
"=",
"current_templates",
".",
"length",
",",
"guid",
";",
"// from templates, which are prepared for removal, filter out those, which should be in DOM",
"for",
"(",
";",
"i",
"<",
"co... | View's render callback
@param {Array.<Lava.system.Template>} current_templates Templates that must be in DOM | [
"View",
"s",
"render",
"callback"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10774-L10803 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function() {
var buffer = '',
i = 0,
count = this._current_templates.length;
for (; i < count; i++) {
buffer += this._current_templates[i].render();
}
return buffer;
} | javascript | function() {
var buffer = '',
i = 0,
count = this._current_templates.length;
for (; i < count; i++) {
buffer += this._current_templates[i].render();
}
return buffer;
} | [
"function",
"(",
")",
"{",
"var",
"buffer",
"=",
"''",
",",
"i",
"=",
"0",
",",
"count",
"=",
"this",
".",
"_current_templates",
".",
"length",
";",
"for",
"(",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",
"buffer",
"+=",
"this",
".",
"_cu... | Render current templates
@returns {string} | [
"Render",
"current",
"templates"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10809-L10823 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(template, previous_template, index) {
Firestorm.DOM.insertHTMLAfter(this._getEndElement(previous_template), template.render());
template.broadcastInDOM();
var previous_index = this._current_templates.indexOf(previous_template);
if (Lava.schema.DEBUG && previous_index == -1) Lava.t();
this._current_... | javascript | function(template, previous_template, index) {
Firestorm.DOM.insertHTMLAfter(this._getEndElement(previous_template), template.render());
template.broadcastInDOM();
var previous_index = this._current_templates.indexOf(previous_template);
if (Lava.schema.DEBUG && previous_index == -1) Lava.t();
this._current_... | [
"function",
"(",
"template",
",",
"previous_template",
",",
"index",
")",
"{",
"Firestorm",
".",
"DOM",
".",
"insertHTMLAfter",
"(",
"this",
".",
"_getEndElement",
"(",
"previous_template",
")",
",",
"template",
".",
"render",
"(",
")",
")",
";",
"template",... | Insert template into DOM
@param {Lava.system.Template} template
@param {Lava.system.Template} previous_template
@param {number} index Index of this template in list of all active templates | [
"Insert",
"template",
"into",
"DOM"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10831-L10840 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(template) {
// save, cause we can not retrieve container's DOM elements after broadcastRemove
var start_element = this._getStartElement(template),
end_element = this._getEndElement(template);
// first, we must inform the template, that it's going to be removed: to allow it's child views to interact
... | javascript | function(template) {
// save, cause we can not retrieve container's DOM elements after broadcastRemove
var start_element = this._getStartElement(template),
end_element = this._getEndElement(template);
// first, we must inform the template, that it's going to be removed: to allow it's child views to interact
... | [
"function",
"(",
"template",
")",
"{",
"// save, cause we can not retrieve container's DOM elements after broadcastRemove",
"var",
"start_element",
"=",
"this",
".",
"_getStartElement",
"(",
"template",
")",
",",
"end_element",
"=",
"this",
".",
"_getEndElement",
"(",
"te... | Remove template from DOM
@param {Lava.system.Template} template | [
"Remove",
"template",
"from",
"DOM"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10846-L10869 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(function_name) {
for (var i = 0, count = this._current_templates.length; i < count; i++) {
this._current_templates[i][function_name]();
}
} | javascript | function(function_name) {
for (var i = 0, count = this._current_templates.length; i < count; i++) {
this._current_templates[i][function_name]();
}
} | [
"function",
"(",
"function_name",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"count",
"=",
"this",
".",
"_current_templates",
".",
"length",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",
"this",
".",
"_current_templates",
"[",
"i",
"]",
"... | Broadcast callback to children
@param {string} function_name | [
"Broadcast",
"callback",
"to",
"children"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L10913-L10921 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(template, previous_template, index, current_templates) {
var animation = this._animations_by_template_guid[template.guid];
if (Lava.schema.DEBUG && animation && !template.isInDOM()) Lava.t();
if (template.isInDOM()) {
// first template does not require moving
previous_template && this._moveTemp... | javascript | function(template, previous_template, index, current_templates) {
var animation = this._animations_by_template_guid[template.guid];
if (Lava.schema.DEBUG && animation && !template.isInDOM()) Lava.t();
if (template.isInDOM()) {
// first template does not require moving
previous_template && this._moveTemp... | [
"function",
"(",
"template",
",",
"previous_template",
",",
"index",
",",
"current_templates",
")",
"{",
"var",
"animation",
"=",
"this",
".",
"_animations_by_template_guid",
"[",
"template",
".",
"guid",
"]",
";",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEB... | Insert the template into DOM and apply corresponding animation
@param {Lava.system.Template} template
@param {Lava.system.Template} previous_template
@param {number} index Index of this template in list of all active templates
@param {Array.<Lava.system.Template>} current_templates | [
"Insert",
"the",
"template",
"into",
"DOM",
"and",
"apply",
"corresponding",
"animation"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11074-L11108 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(template) {
var animation = this._animations_by_template_guid[template.guid];
if (!animation && template.isInDOM()) {
animation = this._createAnimation(template);
}
if (animation) {
animation.reverseDirection();
animation.safeStart();
}
} | javascript | function(template) {
var animation = this._animations_by_template_guid[template.guid];
if (!animation && template.isInDOM()) {
animation = this._createAnimation(template);
}
if (animation) {
animation.reverseDirection();
animation.safeStart();
}
} | [
"function",
"(",
"template",
")",
"{",
"var",
"animation",
"=",
"this",
".",
"_animations_by_template_guid",
"[",
"template",
".",
"guid",
"]",
";",
"if",
"(",
"!",
"animation",
"&&",
"template",
".",
"isInDOM",
"(",
")",
")",
"{",
"animation",
"=",
"thi... | Apply template removal animation and remove element from DOM in the end of it
@param {Lava.system.Template} template | [
"Apply",
"template",
"removal",
"animation",
"and",
"remove",
"element",
"from",
"DOM",
"in",
"the",
"end",
"of",
"it"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11114-L11131 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(animation) {
var template = this._templates_by_animation_guid[animation.guid];
if (animation.isReversed()) {
this._onRemovalComplete(animation, template);
this._fire('removal_complete', template);
} else {
this._onInsertionComplete(animation, template);
this._fire('insertion_complete', t... | javascript | function(animation) {
var template = this._templates_by_animation_guid[animation.guid];
if (animation.isReversed()) {
this._onRemovalComplete(animation, template);
this._fire('removal_complete', template);
} else {
this._onInsertionComplete(animation, template);
this._fire('insertion_complete', t... | [
"function",
"(",
"animation",
")",
"{",
"var",
"template",
"=",
"this",
".",
"_templates_by_animation_guid",
"[",
"animation",
".",
"guid",
"]",
";",
"if",
"(",
"animation",
".",
"isReversed",
"(",
")",
")",
"{",
"this",
".",
"_onRemovalComplete",
"(",
"an... | Cleanup animation instance and update state of it's template
@param {Lava.animation.Abstract} animation | [
"Cleanup",
"animation",
"instance",
"and",
"update",
"state",
"of",
"it",
"s",
"template"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11137-L11156 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(config, widget, parent_view, template, properties) {
var name,
argument,
constructor;
this.guid = Lava.guid++;
if (Lava.schema.DEBUG && config.id && !Lava.isValidId(config.id)) Lava.t();
if ('id' in config) {
this.id = config.id;
}
if ('label' in config) {
this.label = config.label;
... | javascript | function(config, widget, parent_view, template, properties) {
var name,
argument,
constructor;
this.guid = Lava.guid++;
if (Lava.schema.DEBUG && config.id && !Lava.isValidId(config.id)) Lava.t();
if ('id' in config) {
this.id = config.id;
}
if ('label' in config) {
this.label = config.label;
... | [
"function",
"(",
"config",
",",
"widget",
",",
"parent_view",
",",
"template",
",",
"properties",
")",
"{",
"var",
"name",
",",
"argument",
",",
"constructor",
";",
"this",
".",
"guid",
"=",
"Lava",
".",
"guid",
"++",
";",
"if",
"(",
"Lava",
".",
"sc... | Create an instance of the view, including container and assigns; dispatch roles
@param {_cView} config
@param {Lava.widget.Standard} widget
@param {Lava.view.Abstract} parent_view
@param {Lava.system.Template} template
@param {Object} properties | [
"Create",
"an",
"instance",
"of",
"the",
"view",
"including",
"container",
"and",
"assigns",
";",
"dispatch",
"roles"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11398-L11458 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(depth) {
var root = this;
while (depth > 0) {
root = root.getParentView();
if (!root) Lava.t("Error evaluating depth: parent view does not exist");
depth--;
}
return root;
} | javascript | function(depth) {
var root = this;
while (depth > 0) {
root = root.getParentView();
if (!root) Lava.t("Error evaluating depth: parent view does not exist");
depth--;
}
return root;
} | [
"function",
"(",
"depth",
")",
"{",
"var",
"root",
"=",
"this",
";",
"while",
"(",
"depth",
">",
"0",
")",
"{",
"root",
"=",
"root",
".",
"getParentView",
"(",
")",
";",
"if",
"(",
"!",
"root",
")",
"Lava",
".",
"t",
"(",
"\"Error evaluating depth:... | Get N'th parent of the view
@param {number} depth The number of view's parent you want to get
@returns {Lava.view.Abstract} | [
"Get",
"N",
"th",
"parent",
"of",
"the",
"view"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11535-L11551 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function() {
if (this._is_inDOM) {
if (this._container) {
this._is_dirty = true;
if (!this._is_queued_for_refresh) {
Lava.view_manager.scheduleViewRefresh(this);
this._is_queued_for_refresh = true;
}
} else if (this._parent_with_container) {
this._parent_with_container.trySetDi... | javascript | function() {
if (this._is_inDOM) {
if (this._container) {
this._is_dirty = true;
if (!this._is_queued_for_refresh) {
Lava.view_manager.scheduleViewRefresh(this);
this._is_queued_for_refresh = true;
}
} else if (this._parent_with_container) {
this._parent_with_container.trySetDi... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_is_inDOM",
")",
"{",
"if",
"(",
"this",
".",
"_container",
")",
"{",
"this",
".",
"_is_dirty",
"=",
"true",
";",
"if",
"(",
"!",
"this",
".",
"_is_queued_for_refresh",
")",
"{",
"Lava",
".",
"vie... | This view needs to be refreshed. If it has a container - then it can refresh itself independently,
but views without container must ask their parents to refresh them | [
"This",
"view",
"needs",
"to",
"be",
"refreshed",
".",
"If",
"it",
"has",
"a",
"container",
"-",
"then",
"it",
"can",
"refresh",
"itself",
"independently",
"but",
"views",
"without",
"container",
"must",
"ask",
"their",
"parents",
"to",
"refresh",
"them"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11557-L11580 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function() {
var buffer = this._renderContent(),
result;
if (this._container) {
result = this._container.wrap(buffer);
} else {
result = buffer;
}
return result;
} | javascript | function() {
var buffer = this._renderContent(),
result;
if (this._container) {
result = this._container.wrap(buffer);
} else {
result = buffer;
}
return result;
} | [
"function",
"(",
")",
"{",
"var",
"buffer",
"=",
"this",
".",
"_renderContent",
"(",
")",
",",
"result",
";",
"if",
"(",
"this",
".",
"_container",
")",
"{",
"result",
"=",
"this",
".",
"_container",
".",
"wrap",
"(",
"buffer",
")",
";",
"}",
"else... | Render the view, including container and all it's inner content
@returns {string} The HTML representation of the view | [
"Render",
"the",
"view",
"including",
"container",
"and",
"all",
"it",
"s",
"inner",
"content"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11624-L11641 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(id) {
if (Lava.schema.DEBUG && !id) Lava.t();
return Lava.view_manager.getViewById(id);
} | javascript | function(id) {
if (Lava.schema.DEBUG && !id) Lava.t();
return Lava.view_manager.getViewById(id);
} | [
"function",
"(",
"id",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"!",
"id",
")",
"Lava",
".",
"t",
"(",
")",
";",
"return",
"Lava",
".",
"view_manager",
".",
"getViewById",
"(",
"id",
")",
";",
"}"
] | Get a view with given user-defined id
@param {string} id
@returns {Lava.view.Abstract} | [
"Get",
"a",
"view",
"with",
"given",
"user",
"-",
"defined",
"id"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11780-L11786 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(guid) {
if (Lava.schema.DEBUG && !guid) Lava.t();
return Lava.view_manager.getViewByGuid(guid);
} | javascript | function(guid) {
if (Lava.schema.DEBUG && !guid) Lava.t();
return Lava.view_manager.getViewByGuid(guid);
} | [
"function",
"(",
"guid",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"!",
"guid",
")",
"Lava",
".",
"t",
"(",
")",
";",
"return",
"Lava",
".",
"view_manager",
".",
"getViewByGuid",
"(",
"guid",
")",
";",
"}"
] | Get a view by GUID
@param {_tGUID} guid
@returns {Lava.view.Abstract} | [
"Get",
"a",
"view",
"by",
"GUID"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11793-L11799 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(path_config) {
var result = this['locateViewBy' + path_config.locator_type](path_config.locator);
if (Lava.schema.DEBUG && !result) Lava.t("View not found. " + path_config.locator_type + ':' + path_config.locator);
if ('depth' in path_config) {
result = result.getViewByDepth(path_config.depth);
... | javascript | function(path_config) {
var result = this['locateViewBy' + path_config.locator_type](path_config.locator);
if (Lava.schema.DEBUG && !result) Lava.t("View not found. " + path_config.locator_type + ':' + path_config.locator);
if ('depth' in path_config) {
result = result.getViewByDepth(path_config.depth);
... | [
"function",
"(",
"path_config",
")",
"{",
"var",
"result",
"=",
"this",
"[",
"'locateViewBy'",
"+",
"path_config",
".",
"locator_type",
"]",
"(",
"path_config",
".",
"locator",
")",
";",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"!",
"result"... | Find a view in hierarchy of parents by the given route
@param {_cScopeLocator|_cKnownViewLocator} path_config
@returns {Lava.view.Abstract} | [
"Find",
"a",
"view",
"in",
"hierarchy",
"of",
"parents",
"by",
"the",
"given",
"route"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11806-L11820 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(name) {
var view = this;
while (view && !view.isset(name)) {
view = view.getParentView();
}
return view;
} | javascript | function(name) {
var view = this;
while (view && !view.isset(name)) {
view = view.getParentView();
}
return view;
} | [
"function",
"(",
"name",
")",
"{",
"var",
"view",
"=",
"this",
";",
"while",
"(",
"view",
"&&",
"!",
"view",
".",
"isset",
"(",
"name",
")",
")",
"{",
"view",
"=",
"view",
".",
"getParentView",
"(",
")",
";",
"}",
"return",
"view",
";",
"}"
] | Get a parent with property `name` defined
@param {string} name
@returns {Lava.view.Abstract} | [
"Get",
"a",
"parent",
"with",
"property",
"name",
"defined"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11827-L11839 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(path_config) {
var view,
i = 0,
count,
result,
tail = path_config.tail;
if ('property_name' in path_config) {
view = ('locator_type' in path_config) ? this.locateViewByPathConfig(path_config) : this;
view = view.locateViewWithProperty(path_config.property_name);
if (Lava.schema.DE... | javascript | function(path_config) {
var view,
i = 0,
count,
result,
tail = path_config.tail;
if ('property_name' in path_config) {
view = ('locator_type' in path_config) ? this.locateViewByPathConfig(path_config) : this;
view = view.locateViewWithProperty(path_config.property_name);
if (Lava.schema.DE... | [
"function",
"(",
"path_config",
")",
"{",
"var",
"view",
",",
"i",
"=",
"0",
",",
"count",
",",
"result",
",",
"tail",
"=",
"path_config",
".",
"tail",
";",
"if",
"(",
"'property_name'",
"in",
"path_config",
")",
"{",
"view",
"=",
"(",
"'locator_type'"... | Get a scope or property binding by the given route
@param {_cScopeLocator} path_config
@returns {_iValueContainer} | [
"Get",
"a",
"scope",
"or",
"property",
"binding",
"by",
"the",
"given",
"route"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11846-L11890 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(path_config) {
var view,
i = 0,
count,
result,
tail = path_config.tail,
property_name;
if ('property_name' in path_config) {
view = ('locator_type' in path_config) ? this.locateViewByPathConfig(path_config) : this;
view = view.locateViewWithProperty(path_config.property_name);
... | javascript | function(path_config) {
var view,
i = 0,
count,
result,
tail = path_config.tail,
property_name;
if ('property_name' in path_config) {
view = ('locator_type' in path_config) ? this.locateViewByPathConfig(path_config) : this;
view = view.locateViewWithProperty(path_config.property_name);
... | [
"function",
"(",
"path_config",
")",
"{",
"var",
"view",
",",
"i",
"=",
"0",
",",
"count",
",",
"result",
",",
"tail",
"=",
"path_config",
".",
"tail",
",",
"property_name",
";",
"if",
"(",
"'property_name'",
"in",
"path_config",
")",
"{",
"view",
"=",... | Get value of the route without creating scopes
@param {_cScopeLocator} path_config
@returns {*} | [
"Get",
"value",
"of",
"the",
"route",
"without",
"creating",
"scopes"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11897-L11958 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(property_name) {
if (!(property_name in this._property_bindings_by_property)) {
this._property_bindings_by_property[property_name] = new Lava.scope.PropertyBinding(this, property_name);
}
return this._property_bindings_by_property[property_name];
} | javascript | function(property_name) {
if (!(property_name in this._property_bindings_by_property)) {
this._property_bindings_by_property[property_name] = new Lava.scope.PropertyBinding(this, property_name);
}
return this._property_bindings_by_property[property_name];
} | [
"function",
"(",
"property_name",
")",
"{",
"if",
"(",
"!",
"(",
"property_name",
"in",
"this",
".",
"_property_bindings_by_property",
")",
")",
"{",
"this",
".",
"_property_bindings_by_property",
"[",
"property_name",
"]",
"=",
"new",
"Lava",
".",
"scope",
".... | Get a binding to this view's property
@param {string} property_name
@returns {Lava.scope.PropertyBinding} | [
"Get",
"a",
"binding",
"to",
"this",
"view",
"s",
"property"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L11965-L11975 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function() {
var i = 0,
removed_templates = [];
for (; i < this._current_count; i++) {
removed_templates.push(this._current_hash[this._current_uids[i]]);
}
removed_templates.length && this._removeTemplates(removed_templates);
this._current_count = 0;
this._current_hash = {};
this._current_uids... | javascript | function() {
var i = 0,
removed_templates = [];
for (; i < this._current_count; i++) {
removed_templates.push(this._current_hash[this._current_uids[i]]);
}
removed_templates.length && this._removeTemplates(removed_templates);
this._current_count = 0;
this._current_hash = {};
this._current_uids... | [
"function",
"(",
")",
"{",
"var",
"i",
"=",
"0",
",",
"removed_templates",
"=",
"[",
"]",
";",
"for",
"(",
";",
"i",
"<",
"this",
".",
"_current_count",
";",
"i",
"++",
")",
"{",
"removed_templates",
".",
"push",
"(",
"this",
".",
"_current_hash",
... | Scope has created a new instance of Enumerable.
Now all UIDs belong to the old enumerable, so must get rid of all templates | [
"Scope",
"has",
"created",
"a",
"new",
"instance",
"of",
"Enumerable",
".",
"Now",
"all",
"UIDs",
"belong",
"to",
"the",
"old",
"enumerable",
"so",
"must",
"get",
"rid",
"of",
"all",
"templates"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L12377-L12396 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(removed_templates) {
for (var i = 0, removed_count = removed_templates.length; i < removed_count; i++) {
removed_templates[i].destroy();
}
} | javascript | function(removed_templates) {
for (var i = 0, removed_count = removed_templates.length; i < removed_count; i++) {
removed_templates[i].destroy();
}
} | [
"function",
"(",
"removed_templates",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"removed_count",
"=",
"removed_templates",
".",
"length",
";",
"i",
"<",
"removed_count",
";",
"i",
"++",
")",
"{",
"removed_templates",
"[",
"i",
"]",
".",
"destroy",... | Callback that removes templates for removed Enumerable items.
Version without Refresher support.
@param {Array.<Lava.system.Template>} removed_templates | [
"Callback",
"that",
"removes",
"templates",
"for",
"removed",
"Enumerable",
"items",
".",
"Version",
"without",
"Refresher",
"support",
"."
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L12403-L12411 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function() {
var data_source = this._foreach_scope.getValue(),
new_uids = data_source.getUIDs(),
new_uid_to_index_map = data_source.getUIDToIndexMap(),
count = data_source.getCount(),
i = 0,
uid,
template,
removed_templates = [],
child_properties,
current_templates = [];
for (; i < this... | javascript | function() {
var data_source = this._foreach_scope.getValue(),
new_uids = data_source.getUIDs(),
new_uid_to_index_map = data_source.getUIDToIndexMap(),
count = data_source.getCount(),
i = 0,
uid,
template,
removed_templates = [],
child_properties,
current_templates = [];
for (; i < this... | [
"function",
"(",
")",
"{",
"var",
"data_source",
"=",
"this",
".",
"_foreach_scope",
".",
"getValue",
"(",
")",
",",
"new_uids",
"=",
"data_source",
".",
"getUIDs",
"(",
")",
",",
"new_uid_to_index_map",
"=",
"data_source",
".",
"getUIDToIndexMap",
"(",
")",... | Remove old templates, create new | [
"Remove",
"old",
"templates",
"create",
"new"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L12427-L12486 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function() {
if (Lava.schema.DEBUG && (this._argument.isWaitingRefresh() || this._foreach_scope.isWaitingRefresh())) Lava.t("Rendering a view in dirty state");
this._requires_refresh_children && this._refreshChildren();
return this._refresher.render(this._current_templates);
} | javascript | function() {
if (Lava.schema.DEBUG && (this._argument.isWaitingRefresh() || this._foreach_scope.isWaitingRefresh())) Lava.t("Rendering a view in dirty state");
this._requires_refresh_children && this._refreshChildren();
return this._refresher.render(this._current_templates);
} | [
"function",
"(",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"(",
"this",
".",
"_argument",
".",
"isWaitingRefresh",
"(",
")",
"||",
"this",
".",
"_foreach_scope",
".",
"isWaitingRefresh",
"(",
")",
")",
")",
"Lava",
".",
"t",
"("... | Version of `_renderContent` for usage with refresher instance
@returns {string} | [
"Version",
"of",
"_renderContent",
"for",
"usage",
"with",
"refresher",
"instance"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L12533-L12539 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(template) {
var index = this._content.indexOf(template);
if (index == -1) {
if (Lava.schema.DEBUG && template != this._else_content) Lava.t();
this._else_content = null;
} else {
this._content[index] = null;
}
template.destroy();
} | javascript | function(template) {
var index = this._content.indexOf(template);
if (index == -1) {
if (Lava.schema.DEBUG && template != this._else_content) Lava.t();
this._else_content = null;
} else {
this._content[index] = null;
}
template.destroy();
} | [
"function",
"(",
"template",
")",
"{",
"var",
"index",
"=",
"this",
".",
"_content",
".",
"indexOf",
"(",
"template",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"template",
"!=",
... | Branches that are not in DOM are destroyed
@param {Lava.system.Template} template | [
"Branches",
"that",
"are",
"not",
"in",
"DOM",
"are",
"destroyed"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L12836-L12849 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function() {
if (Lava.schema.DEBUG && this._active_argument_index != -1 && this._arguments[this._active_argument_index].isWaitingRefresh()) Lava.t();
this._active_template = this._getActiveTemplate();
return this._refresher.render(this._active_template ? [this._active_template] : []);
} | javascript | function() {
if (Lava.schema.DEBUG && this._active_argument_index != -1 && this._arguments[this._active_argument_index].isWaitingRefresh()) Lava.t();
this._active_template = this._getActiveTemplate();
return this._refresher.render(this._active_template ? [this._active_template] : []);
} | [
"function",
"(",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"this",
".",
"_active_argument_index",
"!=",
"-",
"1",
"&&",
"this",
".",
"_arguments",
"[",
"this",
".",
"_active_argument_index",
"]",
".",
"isWaitingRefresh",
"(",
")",
"... | Version of `_renderContent` which uses created refresher instance
@returns {string} | [
"Version",
"of",
"_renderContent",
"which",
"uses",
"created",
"refresher",
"instance"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L12896-L12902 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(config, widget, parent_view, template, properties) {
var name,
count,
i;
if (Lava.schema.DEBUG && !config.is_extended) Lava.t("Widget was created with partial (unextended) config");
if (Lava.schema.DEBUG) {
for (name in this._property_descriptors) {
if (!(name in this._properties)) Lava.t... | javascript | function(config, widget, parent_view, template, properties) {
var name,
count,
i;
if (Lava.schema.DEBUG && !config.is_extended) Lava.t("Widget was created with partial (unextended) config");
if (Lava.schema.DEBUG) {
for (name in this._property_descriptors) {
if (!(name in this._properties)) Lava.t... | [
"function",
"(",
"config",
",",
"widget",
",",
"parent_view",
",",
"template",
",",
"properties",
")",
"{",
"var",
"name",
",",
"count",
",",
"i",
";",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"!",
"config",
".",
"is_extended",
")",
"Lav... | Create widget instance
@param {_cWidget} config
@param {Lava.widget.Standard} widget
@param {Lava.view.Abstract} parent_view
@param {Lava.system.Template} template
@param {Object} properties | [
"Create",
"widget",
"instance"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L13183-L13212 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(config) {
var locale = Lava.schema.LOCALE,
resource_owner,
component_resource,
resources;
if ('resources_cache' in config) {
resources = config.resources_cache[locale];
}
if ('resource_id' in config) {
resource_owner = this['locateViewBy' + config.resource_id.locator_type](config.r... | javascript | function(config) {
var locale = Lava.schema.LOCALE,
resource_owner,
component_resource,
resources;
if ('resources_cache' in config) {
resources = config.resources_cache[locale];
}
if ('resource_id' in config) {
resource_owner = this['locateViewBy' + config.resource_id.locator_type](config.r... | [
"function",
"(",
"config",
")",
"{",
"var",
"locale",
"=",
"Lava",
".",
"schema",
".",
"LOCALE",
",",
"resource_owner",
",",
"component_resource",
",",
"resources",
";",
"if",
"(",
"'resources_cache'",
"in",
"config",
")",
"{",
"resources",
"=",
"config",
... | Get, merge and prepare resources for this widget
@param {_cWidget} config | [
"Get",
"merge",
"and",
"prepare",
"resources",
"for",
"this",
"widget"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L13236-L13273 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(name, template_arguments) {
var result = null;
if (name in this._include_handlers) {
result = this[this._include_handlers[name]](template_arguments);
} else {
result = this._config.includes[name];
}
return result;
} | javascript | function(name, template_arguments) {
var result = null;
if (name in this._include_handlers) {
result = this[this._include_handlers[name]](template_arguments);
} else {
result = this._config.includes[name];
}
return result;
} | [
"function",
"(",
"name",
",",
"template_arguments",
")",
"{",
"var",
"result",
"=",
"null",
";",
"if",
"(",
"name",
"in",
"this",
".",
"_include_handlers",
")",
"{",
"result",
"=",
"this",
"[",
"this",
".",
"_include_handlers",
"[",
"name",
"]",
"]",
"... | Get view's include
@param {string} name Include name
@param {Array} template_arguments Evaluated argument values from view's template
@returns {?_tTemplate} | [
"Get",
"view",
"s",
"include"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L13281-L13297 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(element, position) {
if (this._is_inDOM) Lava.t("inject: widget is already in DOM");
if (Lava.schema.DEBUG && this._parent_view) Lava.t("Widget: only top-level widgets can be inserted into DOM");
if (Lava.schema.DEBUG && !this._container) Lava.t("Widget: root widgets must have a container");
// Other... | javascript | function(element, position) {
if (this._is_inDOM) Lava.t("inject: widget is already in DOM");
if (Lava.schema.DEBUG && this._parent_view) Lava.t("Widget: only top-level widgets can be inserted into DOM");
if (Lava.schema.DEBUG && !this._container) Lava.t("Widget: root widgets must have a container");
// Other... | [
"function",
"(",
"element",
",",
"position",
")",
"{",
"if",
"(",
"this",
".",
"_is_inDOM",
")",
"Lava",
".",
"t",
"(",
"\"inject: widget is already in DOM\"",
")",
";",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"this",
".",
"_parent_view",
"... | Render and insert the widget instance into DOM
@param {HTMLElement} element
@param {_eInsertPosition} position | [
"Render",
"and",
"insert",
"the",
"widget",
"instance",
"into",
"DOM"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L13328-L13344 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(name, arguments_array) {
if (Lava.schema.DEBUG && !(name in this._modifiers)) Lava.t("Unknown widget modifier: " + name);
return this[this._modifiers[name]].apply(this, arguments_array);
} | javascript | function(name, arguments_array) {
if (Lava.schema.DEBUG && !(name in this._modifiers)) Lava.t("Unknown widget modifier: " + name);
return this[this._modifiers[name]].apply(this, arguments_array);
} | [
"function",
"(",
"name",
",",
"arguments_array",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"!",
"(",
"name",
"in",
"this",
".",
"_modifiers",
")",
")",
"Lava",
".",
"t",
"(",
"\"Unknown widget modifier: \"",
"+",
"name",
")",
";",... | Call a template method
@param {string} name Modifier name
@param {Array} arguments_array Evaluated template arguments
@returns {*} | [
"Call",
"a",
"template",
"method"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L13402-L13408 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(role, view, template_arguments) {
var result = false;
if (role in this._role_handlers) {
this[this._role_handlers[role]](view, template_arguments);
result = true;
}
return result;
} | javascript | function(role, view, template_arguments) {
var result = false;
if (role in this._role_handlers) {
this[this._role_handlers[role]](view, template_arguments);
result = true;
}
return result;
} | [
"function",
"(",
"role",
",",
"view",
",",
"template_arguments",
")",
"{",
"var",
"result",
"=",
"false",
";",
"if",
"(",
"role",
"in",
"this",
".",
"_role_handlers",
")",
"{",
"this",
"[",
"this",
".",
"_role_handlers",
"[",
"role",
"]",
"]",
"(",
"... | Handle a view with a role in this widget
@param {string} role Role name
@param {Lava.view.Abstract} view
@param {Array.<*>} template_arguments
@returns {boolean} <kw>true</kw>, if the role was handled, and <kw>false</kw> otherwise | [
"Handle",
"a",
"view",
"with",
"a",
"role",
"in",
"this",
"widget"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L13439-L13452 | train | |
kogarashisan/LiquidLava | lib/packages/core-classes.js | function(resource_name, locale) {
locale = locale || Lava.schema.LOCALE;
return ((locale in this._resources) && (resource_name in this._resources[locale]))
? this._resources[locale][resource_name]
: null;
} | javascript | function(resource_name, locale) {
locale = locale || Lava.schema.LOCALE;
return ((locale in this._resources) && (resource_name in this._resources[locale]))
? this._resources[locale][resource_name]
: null;
} | [
"function",
"(",
"resource_name",
",",
"locale",
")",
"{",
"locale",
"=",
"locale",
"||",
"Lava",
".",
"schema",
".",
"LOCALE",
";",
"return",
"(",
"(",
"locale",
"in",
"this",
".",
"_resources",
")",
"&&",
"(",
"resource_name",
"in",
"this",
".",
"_re... | Get a resource object by it's name
@param {string} resource_name
@param {string} locale
@returns {*} | [
"Get",
"a",
"resource",
"object",
"by",
"it",
"s",
"name"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L13523-L13531 | train | |
danigb/audio-contour | index.js | Contour | function Contour (ac, options) {
var env = ac.createGain()
var opts = Contour.params(options, env)
var isL = opts.ramp === 'linear'
var tail = ac.createGain()
tail.connect(env)
var head = ac.createGain()
head.connect(tail)
var cv = Voltage(ac)
cv.connect(head)
env.start = function (time) {
tim... | javascript | function Contour (ac, options) {
var env = ac.createGain()
var opts = Contour.params(options, env)
var isL = opts.ramp === 'linear'
var tail = ac.createGain()
tail.connect(env)
var head = ac.createGain()
head.connect(tail)
var cv = Voltage(ac)
cv.connect(head)
env.start = function (time) {
tim... | [
"function",
"Contour",
"(",
"ac",
",",
"options",
")",
"{",
"var",
"env",
"=",
"ac",
".",
"createGain",
"(",
")",
"var",
"opts",
"=",
"Contour",
".",
"params",
"(",
"options",
",",
"env",
")",
"var",
"isL",
"=",
"opts",
".",
"ramp",
"===",
"'linear... | Create an envelope generator.
@param {AudioContext} ac - the audio context
@param {Object} options - (Optional) the envelope options
@return {AudioNode} the envelope generator node | [
"Create",
"an",
"envelope",
"generator",
"."
] | 14c75fe55f747717029c83dd52e9021bb03ef058 | https://github.com/danigb/audio-contour/blob/14c75fe55f747717029c83dd52e9021bb03ef058/index.js#L22-L62 | train |
alexindigo/deeply | mutable.js | mutable | function mutable(/* a[, b[, ...]] */)
{
var args = Array.prototype.slice.call(arguments)
, result = args.shift()
;
while (args.length)
{
result = merge.call(this, result, args.shift());
}
return result;
} | javascript | function mutable(/* a[, b[, ...]] */)
{
var args = Array.prototype.slice.call(arguments)
, result = args.shift()
;
while (args.length)
{
result = merge.call(this, result, args.shift());
}
return result;
} | [
"function",
"mutable",
"(",
"/* a[, b[, ...]] */",
")",
"{",
"var",
"args",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
")",
",",
"result",
"=",
"args",
".",
"shift",
"(",
")",
";",
"while",
"(",
"args",
".",
"length",
... | Deeply merges properties of the provided objects, into the first object.
@param {...mixed} value - values to merge
@returns {mixed} first value with merged in properties from other values | [
"Deeply",
"merges",
"properties",
"of",
"the",
"provided",
"objects",
"into",
"the",
"first",
"object",
"."
] | d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1 | https://github.com/alexindigo/deeply/blob/d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1/mutable.js#L12-L24 | train |
alexindigo/deeply | extra/functions_clone.js | functionsCloneAdapter | function functionsCloneAdapter(to, from, merge)
{
var copy = cloneFunction(from);
// to fully stand up to Ludicrous name
// let's clone prototype chain
copy.prototype = merge(undefined, from.prototype);
// duplicate function's properties
reduceObject(copy, from, merge);
return copy;
} | javascript | function functionsCloneAdapter(to, from, merge)
{
var copy = cloneFunction(from);
// to fully stand up to Ludicrous name
// let's clone prototype chain
copy.prototype = merge(undefined, from.prototype);
// duplicate function's properties
reduceObject(copy, from, merge);
return copy;
} | [
"function",
"functionsCloneAdapter",
"(",
"to",
",",
"from",
",",
"merge",
")",
"{",
"var",
"copy",
"=",
"cloneFunction",
"(",
"from",
")",
";",
"// to fully stand up to Ludicrous name",
"// let's clone prototype chain",
"copy",
".",
"prototype",
"=",
"merge",
"(",
... | Clones provided source function and replaces
target function with the clone.
Also cloning the prototype tree.
@param {function} to - target function to ignore
@param {function} from - function to clone
@param {function} merge - iterator to merge sub elements
@returns {function} - cloned source function | [
"Clones",
"provided",
"source",
"function",
"and",
"replaces",
"target",
"function",
"with",
"the",
"clone",
".",
"Also",
"cloning",
"the",
"prototype",
"tree",
"."
] | d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1 | https://github.com/alexindigo/deeply/blob/d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1/extra/functions_clone.js#L18-L30 | train |
brunnolou/springs | example/index.js | update | function update() {
el.style.transform = 'scale3d(' + s1(x) + ', ' + s2(y) + ', 1)';
requestAnimationFrame(update);
} | javascript | function update() {
el.style.transform = 'scale3d(' + s1(x) + ', ' + s2(y) + ', 1)';
requestAnimationFrame(update);
} | [
"function",
"update",
"(",
")",
"{",
"el",
".",
"style",
".",
"transform",
"=",
"'scale3d('",
"+",
"s1",
"(",
"x",
")",
"+",
"', '",
"+",
"s2",
"(",
"y",
")",
"+",
"', 1)'",
";",
"requestAnimationFrame",
"(",
"update",
")",
";",
"}"
] | Request Animation Frame logic. | [
"Request",
"Animation",
"Frame",
"logic",
"."
] | b48f83004e1564f7f2f21450a5bef3b8419100ca | https://github.com/brunnolou/springs/blob/b48f83004e1564f7f2f21450a5bef3b8419100ca/example/index.js#L33-L37 | train |
alexindigo/deeply | extra/functions_extend.js | functionsExtendAdapter | function functionsExtendAdapter(to, from, merge)
{
var copy = cloneFunction(from);
// keep from.prototype in the prototype chain
copy.prototype = from.prototype;
// duplicate function's properties
reduceObject(copy, from, merge);
return copy;
} | javascript | function functionsExtendAdapter(to, from, merge)
{
var copy = cloneFunction(from);
// keep from.prototype in the prototype chain
copy.prototype = from.prototype;
// duplicate function's properties
reduceObject(copy, from, merge);
return copy;
} | [
"function",
"functionsExtendAdapter",
"(",
"to",
",",
"from",
",",
"merge",
")",
"{",
"var",
"copy",
"=",
"cloneFunction",
"(",
"from",
")",
";",
"// keep from.prototype in the prototype chain",
"copy",
".",
"prototype",
"=",
"from",
".",
"prototype",
";",
"// d... | Clones provided source function and replaces
target function with the clone.
While keeping original prototype in the prototype chain.
@param {function} to - target function to ignore
@param {function} from - function to clone
@param {function} merge - iterator to merge sub elements
@returns {function} - cloned s... | [
"Clones",
"provided",
"source",
"function",
"and",
"replaces",
"target",
"function",
"with",
"the",
"clone",
".",
"While",
"keeping",
"original",
"prototype",
"in",
"the",
"prototype",
"chain",
"."
] | d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1 | https://github.com/alexindigo/deeply/blob/d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1/extra/functions_extend.js#L18-L29 | train |
kogarashisan/LiquidLava | lib/packages/core.js | function() {
this._initGlobal(Lava.schema.system.VIEW_MANAGER_CLASS, 'view_manager');
this._initGlobal(Lava.schema.system.APP_CLASS, 'app');
this._initGlobal(Lava.schema.popover_manager.CLASS, 'popover_manager');
this._initGlobal(Lava.schema.focus_manager.CLASS, 'focus_manager');
} | javascript | function() {
this._initGlobal(Lava.schema.system.VIEW_MANAGER_CLASS, 'view_manager');
this._initGlobal(Lava.schema.system.APP_CLASS, 'app');
this._initGlobal(Lava.schema.popover_manager.CLASS, 'popover_manager');
this._initGlobal(Lava.schema.focus_manager.CLASS, 'focus_manager');
} | [
"function",
"(",
")",
"{",
"this",
".",
"_initGlobal",
"(",
"Lava",
".",
"schema",
".",
"system",
".",
"VIEW_MANAGER_CLASS",
",",
"'view_manager'",
")",
";",
"this",
".",
"_initGlobal",
"(",
"Lava",
".",
"schema",
".",
"system",
".",
"APP_CLASS",
",",
"'... | Create global class instances | [
"Create",
"global",
"class",
"instances"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L246-L253 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(msg) {
if (typeof(window) == 'undefined') throw new Error(msg); // Node environment
if (window.console) {
window.console.error(msg);
}
} | javascript | function(msg) {
if (typeof(window) == 'undefined') throw new Error(msg); // Node environment
if (window.console) {
window.console.error(msg);
}
} | [
"function",
"(",
"msg",
")",
"{",
"if",
"(",
"typeof",
"(",
"window",
")",
"==",
"'undefined'",
")",
"throw",
"new",
"Error",
"(",
"msg",
")",
";",
"// Node environment",
"if",
"(",
"window",
".",
"console",
")",
"{",
"window",
".",
"console",
".",
"... | Log a recoverable error
@param {string} msg | [
"Log",
"a",
"recoverable",
"error"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L290-L298 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(widget_title) {
if (Lava.schema.DEBUG && !(widget_title in this.widgets)) Lava.t("Widget config not found: " + widget_title);
var config = this.widgets[widget_title];
if (!config.is_extended) {
Lava.extenders[config.extender_type](config);
}
return config;
} | javascript | function(widget_title) {
if (Lava.schema.DEBUG && !(widget_title in this.widgets)) Lava.t("Widget config not found: " + widget_title);
var config = this.widgets[widget_title];
if (!config.is_extended) {
Lava.extenders[config.extender_type](config);
}
return config;
} | [
"function",
"(",
"widget_title",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"!",
"(",
"widget_title",
"in",
"this",
".",
"widgets",
")",
")",
"Lava",
".",
"t",
"(",
"\"Widget config not found: \"",
"+",
"widget_title",
")",
";",
"var... | Get extended config of global named widget
@param {string} widget_title
@returns {_cWidget} | [
"Get",
"extended",
"config",
"of",
"global",
"named",
"widget"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L315-L329 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(extends_title, config, properties) {
var widget_config = this.getWidgetConfig(extends_title),
constructor;
if (config) {
if (Lava.schema.DEBUG && config['extends'] && config['extends'] != extends_title) Lava.t("Malformed widget config");
config['extends'] = extends_title;
Lava.extenders[con... | javascript | function(extends_title, config, properties) {
var widget_config = this.getWidgetConfig(extends_title),
constructor;
if (config) {
if (Lava.schema.DEBUG && config['extends'] && config['extends'] != extends_title) Lava.t("Malformed widget config");
config['extends'] = extends_title;
Lava.extenders[con... | [
"function",
"(",
"extends_title",
",",
"config",
",",
"properties",
")",
"{",
"var",
"widget_config",
"=",
"this",
".",
"getWidgetConfig",
"(",
"extends_title",
")",
",",
"constructor",
";",
"if",
"(",
"config",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
... | Create a root widget instance
@param {string} extends_title Name of global parent widget
@param {_cWidget} [config] Partial config for new widget, will be extended with parent's config
@param {Object} [properties] Properties for created widget
@returns {Lava.widget.Standard} Created widget instance | [
"Create",
"a",
"root",
"widget",
"instance"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L338-L361 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(widget_title, widget_config) {
if (!Lava.schema.widget.ALLOW_REDEFINITION && (widget_title in this.widgets))
Lava.t("storeWidgetSchema: widget is already defined: " + widget_title);
this.widgets[widget_title] = widget_config;
if (('sugar' in widget_config) && widget_config.sugar.tag_name) {
thi... | javascript | function(widget_title, widget_config) {
if (!Lava.schema.widget.ALLOW_REDEFINITION && (widget_title in this.widgets))
Lava.t("storeWidgetSchema: widget is already defined: " + widget_title);
this.widgets[widget_title] = widget_config;
if (('sugar' in widget_config) && widget_config.sugar.tag_name) {
thi... | [
"function",
"(",
"widget_title",
",",
"widget_config",
")",
"{",
"if",
"(",
"!",
"Lava",
".",
"schema",
".",
"widget",
".",
"ALLOW_REDEFINITION",
"&&",
"(",
"widget_title",
"in",
"this",
".",
"widgets",
")",
")",
"Lava",
".",
"t",
"(",
"\"storeWidgetSchema... | Register a global widget config
@param {string} widget_title Title for new global widget
@param {_cWidget} widget_config | [
"Register",
"a",
"global",
"widget",
"config"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L464-L477 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function() {
this.init && this.init();
// focus manager must be initialized before any widgets are in DOM, so it could receive the focus event
// which can be fired after insertion
Lava.schema.focus_manager.IS_ENABLED && this.focus_manager && this.focus_manager.enable();
var body = document.body,
app_cl... | javascript | function() {
this.init && this.init();
// focus manager must be initialized before any widgets are in DOM, so it could receive the focus event
// which can be fired after insertion
Lava.schema.focus_manager.IS_ENABLED && this.focus_manager && this.focus_manager.enable();
var body = document.body,
app_cl... | [
"function",
"(",
")",
"{",
"this",
".",
"init",
"&&",
"this",
".",
"init",
"(",
")",
";",
"// focus manager must be initialized before any widgets are in DOM, so it could receive the focus event",
"// which can be fired after insertion",
"Lava",
".",
"schema",
".",
"focus_man... | Parse the page <body> or special "lava-app" regions in the page and replace them with widgets | [
"Parse",
"the",
"page",
"<",
";",
"body>",
";",
"or",
"special",
"lava",
"-",
"app",
"regions",
"in",
"the",
"page",
"and",
"replace",
"them",
"with",
"widgets"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L482-L517 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(element) {
var widget,
raw_template = Lava.TemplateParser.parseRaw(Firestorm.Element.getOuterHTML(element)),
raw_tag,
config,
constructor;
if (Lava.schema.DEBUG && raw_template.length != 1) Lava.t();
raw_tag = raw_template[0];
config = Lava.parsers.Common.toWidget(raw_tag);
config.is_e... | javascript | function(element) {
var widget,
raw_template = Lava.TemplateParser.parseRaw(Firestorm.Element.getOuterHTML(element)),
raw_tag,
config,
constructor;
if (Lava.schema.DEBUG && raw_template.length != 1) Lava.t();
raw_tag = raw_template[0];
config = Lava.parsers.Common.toWidget(raw_tag);
config.is_e... | [
"function",
"(",
"element",
")",
"{",
"var",
"widget",
",",
"raw_template",
"=",
"Lava",
".",
"TemplateParser",
".",
"parseRaw",
"(",
"Firestorm",
".",
"Element",
".",
"getOuterHTML",
"(",
"element",
")",
")",
",",
"raw_tag",
",",
"config",
",",
"construct... | Convert a DOM element to widget instance
@param {HTMLElement} element
@returns {Lava.widget.Standard} | [
"Convert",
"a",
"DOM",
"element",
"to",
"widget",
"instance"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L524-L547 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(script_element) {
var widget,
config,
constructor,
id = Firestorm.Element.getProperty(script_element, 'id'),
class_name = Firestorm.Element.getProperty(script_element, 'lava-app');
config = {
type: 'widget',
is_extended: true,
template: null,
container: {type: 'Morph'}
};
conf... | javascript | function(script_element) {
var widget,
config,
constructor,
id = Firestorm.Element.getProperty(script_element, 'id'),
class_name = Firestorm.Element.getProperty(script_element, 'lava-app');
config = {
type: 'widget',
is_extended: true,
template: null,
container: {type: 'Morph'}
};
conf... | [
"function",
"(",
"script_element",
")",
"{",
"var",
"widget",
",",
"config",
",",
"constructor",
",",
"id",
"=",
"Firestorm",
".",
"Element",
".",
"getProperty",
"(",
"script_element",
",",
"'id'",
")",
",",
"class_name",
"=",
"Firestorm",
".",
"Element",
... | Convert a script DOM element to widget instance
@param {HTMLElement} script_element
@returns {Lava.widget.Standard} | [
"Convert",
"a",
"script",
"DOM",
"element",
"to",
"widget",
"instance"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L554-L582 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(path) {
var class_body = this.classes[path],
i = 0,
count;
if (Lava.schema.DEBUG && !class_body) Lava.t("[Lava::_loadClass] Class does not exists: " + path);
if ('Extends' in class_body) {
if (!this.ClassManager.hasClass(class_body.Extends)) {
this._loadClass(class_body.Extends);
}
}... | javascript | function(path) {
var class_body = this.classes[path],
i = 0,
count;
if (Lava.schema.DEBUG && !class_body) Lava.t("[Lava::_loadClass] Class does not exists: " + path);
if ('Extends' in class_body) {
if (!this.ClassManager.hasClass(class_body.Extends)) {
this._loadClass(class_body.Extends);
}
}... | [
"function",
"(",
"path",
")",
"{",
"var",
"class_body",
"=",
"this",
".",
"classes",
"[",
"path",
"]",
",",
"i",
"=",
"0",
",",
"count",
";",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"!",
"class_body",
")",
"Lava",
".",
"t",
"(",
"... | Recursively define a class, stored in `this.classes`
@param {string} path | [
"Recursively",
"define",
"a",
"class",
"stored",
"in",
"this",
".",
"classes"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L661-L691 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function () {
this.popover_manager && this.popover_manager.destroy();
this.view_manager && this.view_manager.destroy();
this.app.destroy();
this.view_manager.destroy();
} | javascript | function () {
this.popover_manager && this.popover_manager.destroy();
this.view_manager && this.view_manager.destroy();
this.app.destroy();
this.view_manager.destroy();
} | [
"function",
"(",
")",
"{",
"this",
".",
"popover_manager",
"&&",
"this",
".",
"popover_manager",
".",
"destroy",
"(",
")",
";",
"this",
".",
"view_manager",
"&&",
"this",
".",
"view_manager",
".",
"destroy",
"(",
")",
";",
"this",
".",
"app",
".",
"des... | Destroy global objects. Widgets must be destroyed manually, before calling this method. | [
"Destroy",
"global",
"objects",
".",
"Widgets",
"must",
"be",
"destroyed",
"manually",
"before",
"calling",
"this",
"method",
"."
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L846-L853 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(value) {
var result = '';
if (value) {
result = value.toString();
result = result[0].toUpperCase() + result.substr(1);
}
return result;
} | javascript | function(value) {
var result = '';
if (value) {
result = value.toString();
result = result[0].toUpperCase() + result.substr(1);
}
return result;
} | [
"function",
"(",
"value",
")",
"{",
"var",
"result",
"=",
"''",
";",
"if",
"(",
"value",
")",
"{",
"result",
"=",
"value",
".",
"toString",
"(",
")",
";",
"result",
"=",
"result",
"[",
"0",
"]",
".",
"toUpperCase",
"(",
")",
"+",
"result",
".",
... | Upper-case the first letter
@param value
@returns {string} | [
"Upper",
"-",
"case",
"the",
"first",
"letter"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L1120-L1131 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(value) {
if (Lava.schema.DEBUG && typeof(value) != 'boolean') Lava.t("translateBoolean: argument is not boolean type");
return Lava.locales[Lava.schema.LOCALE].booleans[+value];
} | javascript | function(value) {
if (Lava.schema.DEBUG && typeof(value) != 'boolean') Lava.t("translateBoolean: argument is not boolean type");
return Lava.locales[Lava.schema.LOCALE].booleans[+value];
} | [
"function",
"(",
"value",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"typeof",
"(",
"value",
")",
"!=",
"'boolean'",
")",
"Lava",
".",
"t",
"(",
"\"translateBoolean: argument is not boolean type\"",
")",
";",
"return",
"Lava",
".",
"lo... | Translate a boolean type into user language
@param value
@returns {string} | [
"Translate",
"a",
"boolean",
"type",
"into",
"user",
"language"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L1150-L1155 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(widget_title, locale, locale_resources) {
if (Lava.schema.DEBUG && !(widget_title in Lava.widgets)) Lava.t("Widget config not found: " + widget_title);
var config = Lava.widgets[widget_title];
if (config.is_extended) Lava.t("Widget is already extended, can not add resources: " + widget_title);
if (... | javascript | function(widget_title, locale, locale_resources) {
if (Lava.schema.DEBUG && !(widget_title in Lava.widgets)) Lava.t("Widget config not found: " + widget_title);
var config = Lava.widgets[widget_title];
if (config.is_extended) Lava.t("Widget is already extended, can not add resources: " + widget_title);
if (... | [
"function",
"(",
"widget_title",
",",
"locale",
",",
"locale_resources",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"!",
"(",
"widget_title",
"in",
"Lava",
".",
"widgets",
")",
")",
"Lava",
".",
"t",
"(",
"\"Widget config not found: \"... | Attach resources object to global widget definition
@param {string} widget_title The name in {@link Lava#widgets}
@param {string} locale Locale of the resource object
@param {Object} locale_resources The object with resources for given locale | [
"Attach",
"resources",
"object",
"to",
"global",
"widget",
"definition"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L1271-L1287 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(top_resources, bottom_resources) {
var name,
result = Firestorm.Object.copy(top_resources);
for (name in bottom_resources) {
if (name in result) {
if (Lava.schema.DEBUG && result[name].type != bottom_resources[name].type) Lava.t("Resource types mismatch: " + name);
if (bottom_resources[n... | javascript | function(top_resources, bottom_resources) {
var name,
result = Firestorm.Object.copy(top_resources);
for (name in bottom_resources) {
if (name in result) {
if (Lava.schema.DEBUG && result[name].type != bottom_resources[name].type) Lava.t("Resource types mismatch: " + name);
if (bottom_resources[n... | [
"function",
"(",
"top_resources",
",",
"bottom_resources",
")",
"{",
"var",
"name",
",",
"result",
"=",
"Firestorm",
".",
"Object",
".",
"copy",
"(",
"top_resources",
")",
";",
"for",
"(",
"name",
"in",
"bottom_resources",
")",
"{",
"if",
"(",
"name",
"i... | Merge resource objects.
`top_resources` is expected to be a copy or a new empty object.
Properties in `top_resources` have priority over `bottom_resources`
@param {Object} top_resources Child resources
@param {Object} bottom_resources Parent resources | [
"Merge",
"resource",
"objects",
".",
"top_resources",
"is",
"expected",
"to",
"be",
"a",
"copy",
"or",
"a",
"new",
"empty",
"object",
".",
"Properties",
"in",
"top_resources",
"have",
"priority",
"over",
"bottom_resources"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L1297-L1336 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(resource_object) {
for (var name in resource_object) {
if (resource_object[name].type == 'container_stack') {
resource_object[name] = {
type: 'container',
value: this._mergeRootContainerStack(resource_object[name].value)
}
}
}
} | javascript | function(resource_object) {
for (var name in resource_object) {
if (resource_object[name].type == 'container_stack') {
resource_object[name] = {
type: 'container',
value: this._mergeRootContainerStack(resource_object[name].value)
}
}
}
} | [
"function",
"(",
"resource_object",
")",
"{",
"for",
"(",
"var",
"name",
"in",
"resource_object",
")",
"{",
"if",
"(",
"resource_object",
"[",
"name",
"]",
".",
"type",
"==",
"'container_stack'",
")",
"{",
"resource_object",
"[",
"name",
"]",
"=",
"{",
"... | Container operations are stacked until first usage to guarantee correct inheritance
@param {Object} resource_object | [
"Container",
"operations",
"are",
"stacked",
"until",
"first",
"usage",
"to",
"guarantee",
"correct",
"inheritance"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L1342-L1355 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(stack) {
var i = 0,
count = stack.length,
result = {},
operation;
if (Lava.schema.DEBUG && !Array.isArray(stack)) Lava.t();
for (; i < count; i++) {
operation = stack[i];
this[this._container_resources_operations_map[operation.name]](result, operation.name, operation.value);
}
retu... | javascript | function(stack) {
var i = 0,
count = stack.length,
result = {},
operation;
if (Lava.schema.DEBUG && !Array.isArray(stack)) Lava.t();
for (; i < count; i++) {
operation = stack[i];
this[this._container_resources_operations_map[operation.name]](result, operation.name, operation.value);
}
retu... | [
"function",
"(",
"stack",
")",
"{",
"var",
"i",
"=",
"0",
",",
"count",
"=",
"stack",
".",
"length",
",",
"result",
"=",
"{",
"}",
",",
"operation",
";",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"!",
"Array",
".",
"isArray",
"(",
"... | Perform merging of "container_stack" resource into "container" resource
@param {Array} stack
@returns {Object} | [
"Perform",
"merging",
"of",
"container_stack",
"resource",
"into",
"container",
"resource"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L1362-L1378 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(target_object, path, value) {
var path_segments = path.split('.'),
segment,
resource_name = path_segments.pop(),
i = 0,
count = path_segments.length;
if (Lava.schema.DEBUG && /[a-z]/.test(resource_name)) Lava.t("Terminal resource names must be uppercase");
for (; i < count; i++) {
segm... | javascript | function(target_object, path, value) {
var path_segments = path.split('.'),
segment,
resource_name = path_segments.pop(),
i = 0,
count = path_segments.length;
if (Lava.schema.DEBUG && /[a-z]/.test(resource_name)) Lava.t("Terminal resource names must be uppercase");
for (; i < count; i++) {
segm... | [
"function",
"(",
"target_object",
",",
"path",
",",
"value",
")",
"{",
"var",
"path_segments",
"=",
"path",
".",
"split",
"(",
"'.'",
")",
",",
"segment",
",",
"resource_name",
"=",
"path_segments",
".",
"pop",
"(",
")",
",",
"i",
"=",
"0",
",",
"cou... | Helper function which puts the value inside the resources object under given path string.
Used while parsing templates
@param {Object} target_object The resources object which is being parsed
@param {string} path Path inside the resources object
@param {*} value | [
"Helper",
"function",
"which",
"puts",
"the",
"value",
"inside",
"the",
"resources",
"object",
"under",
"given",
"path",
"string",
".",
"Used",
"while",
"parsing",
"templates"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L1434-L1469 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(dest_container, source_container, property_name) {
var name,
dest = dest_container[property_name],
source = source_container[property_name];
for (name in source) {
if (!(name in dest)) {
dest[name] = source[name];
}
}
} | javascript | function(dest_container, source_container, property_name) {
var name,
dest = dest_container[property_name],
source = source_container[property_name];
for (name in source) {
if (!(name in dest)) {
dest[name] = source[name];
}
}
} | [
"function",
"(",
"dest_container",
",",
"source_container",
",",
"property_name",
")",
"{",
"var",
"name",
",",
"dest",
"=",
"dest_container",
"[",
"property_name",
"]",
",",
"source",
"=",
"source_container",
"[",
"property_name",
"]",
";",
"for",
"(",
"name"... | Common property merging algorithm, suitable for most cases
@param {_cWidget} dest_container The child config
@param {_cWidget} source_container The parent config
@param {string} property_name The name of the property to merge | [
"Common",
"property",
"merging",
"algorithm",
"suitable",
"for",
"most",
"cases"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L1874-L1890 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(dest, source, map) {
var name;
for (name in source) {
if (!(name in dest)) {
dest[name] = source[name];
} else if (name in map) {
if (map[name] == true) {
Firestorm.implement(dest[name], source[name]);
} else {
this._mergeWithMap(dest[name], source[name], map[name]);
... | javascript | function(dest, source, map) {
var name;
for (name in source) {
if (!(name in dest)) {
dest[name] = source[name];
} else if (name in map) {
if (map[name] == true) {
Firestorm.implement(dest[name], source[name]);
} else {
this._mergeWithMap(dest[name], source[name], map[name]);
... | [
"function",
"(",
"dest",
",",
"source",
",",
"map",
")",
"{",
"var",
"name",
";",
"for",
"(",
"name",
"in",
"source",
")",
"{",
"if",
"(",
"!",
"(",
"name",
"in",
"dest",
")",
")",
"{",
"dest",
"[",
"name",
"]",
"=",
"source",
"[",
"name",
"]... | Advanced merging algorithm
@param {Object} dest
@param {Object} source
@param {Object} map | [
"Advanced",
"merging",
"algorithm"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L1898-L1924 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(config, parent_config) {
var locale_cache = {};
if ('resources' in config) {
if (Lava.schema.LOCALE in config.resources) {
locale_cache = Lava.resources.mergeResources(locale_cache, config.resources[Lava.schema.LOCALE]);
}
if ('default' in config.resources) {
locale_cache = Lava.resourc... | javascript | function(config, parent_config) {
var locale_cache = {};
if ('resources' in config) {
if (Lava.schema.LOCALE in config.resources) {
locale_cache = Lava.resources.mergeResources(locale_cache, config.resources[Lava.schema.LOCALE]);
}
if ('default' in config.resources) {
locale_cache = Lava.resourc... | [
"function",
"(",
"config",
",",
"parent_config",
")",
"{",
"var",
"locale_cache",
"=",
"{",
"}",
";",
"if",
"(",
"'resources'",
"in",
"config",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
".",
"LOCALE",
"in",
"config",
".",
"resources",
")",
"{",
"lo... | Merge algorithm for resources
@param {_cWidget} config
@param {_cWidget} parent_config | [
"Merge",
"algorithm",
"for",
"resources"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L2008-L2036 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(config) {
var parent_config,
parent_widget_name;
if ('extends' in config) {
parent_widget_name = config['extends'];
// returns already extended configs
parent_config = Lava.getWidgetConfig(parent_widget_name);
for (var name in parent_config) {
if (this._exceptions.indexOf(name) == -... | javascript | function(config) {
var parent_config,
parent_widget_name;
if ('extends' in config) {
parent_widget_name = config['extends'];
// returns already extended configs
parent_config = Lava.getWidgetConfig(parent_widget_name);
for (var name in parent_config) {
if (this._exceptions.indexOf(name) == -... | [
"function",
"(",
"config",
")",
"{",
"var",
"parent_config",
",",
"parent_widget_name",
";",
"if",
"(",
"'extends'",
"in",
"config",
")",
"{",
"parent_widget_name",
"=",
"config",
"[",
"'extends'",
"]",
";",
"// returns already extended configs",
"parent_config",
... | Extend raw widget config
@param {_cWidget} config | [
"Extend",
"raw",
"widget",
"config"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L2054-L2112 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function() {
this._enable = (Firestorm.Environment.requestAnimationFrame && Lava.schema.system.ALLOW_REQUEST_ANIMATION_FRAME)
? this._enable_AnimationFrame
: this._enable_Interval;
} | javascript | function() {
this._enable = (Firestorm.Environment.requestAnimationFrame && Lava.schema.system.ALLOW_REQUEST_ANIMATION_FRAME)
? this._enable_AnimationFrame
: this._enable_Interval;
} | [
"function",
"(",
")",
"{",
"this",
".",
"_enable",
"=",
"(",
"Firestorm",
".",
"Environment",
".",
"requestAnimationFrame",
"&&",
"Lava",
".",
"schema",
".",
"system",
".",
"ALLOW_REQUEST_ANIMATION_FRAME",
")",
"?",
"this",
".",
"_enable_AnimationFrame",
":",
... | Initialize Lava.Cron object | [
"Initialize",
"Lava",
".",
"Cron",
"object"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L2147-L2153 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(event_name) {
var self = this,
freeze_protection = this._freeze_protected_events.indexOf(event_name) != -1;
// I'm not sure about this, but looks like the argument should be specifically named "event"
// http://stackoverflow.com/questions/11188729/jquery-keyup-event-trouble-in-opera
// see also th... | javascript | function(event_name) {
var self = this,
freeze_protection = this._freeze_protected_events.indexOf(event_name) != -1;
// I'm not sure about this, but looks like the argument should be specifically named "event"
// http://stackoverflow.com/questions/11188729/jquery-keyup-event-trouble-in-opera
// see also th... | [
"function",
"(",
"event_name",
")",
"{",
"var",
"self",
"=",
"this",
",",
"freeze_protection",
"=",
"this",
".",
"_freeze_protected_events",
".",
"indexOf",
"(",
"event_name",
")",
"!=",
"-",
"1",
";",
"// I'm not sure about this, but looks like the argument should be... | Used to bind `_onDomEvent` to Core instance
@param {string} event_name DOM event name
@returns {Function} | [
"Used",
"to",
"bind",
"_onDomEvent",
"to",
"Core",
"instance"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L2373-L2400 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(event_name) {
this._event_listeners[event_name] = this._createEventWrapper(event_name);
if ((event_name in this._dom_event_support) && this._dom_event_support[event_name].delegation) {
Firestorm.Element.addDelegation(window, event_name, '*', this._event_listeners[event_name]);
} else {
Firesto... | javascript | function(event_name) {
this._event_listeners[event_name] = this._createEventWrapper(event_name);
if ((event_name in this._dom_event_support) && this._dom_event_support[event_name].delegation) {
Firestorm.Element.addDelegation(window, event_name, '*', this._event_listeners[event_name]);
} else {
Firesto... | [
"function",
"(",
"event_name",
")",
"{",
"this",
".",
"_event_listeners",
"[",
"event_name",
"]",
"=",
"this",
".",
"_createEventWrapper",
"(",
"event_name",
")",
";",
"if",
"(",
"(",
"event_name",
"in",
"this",
".",
"_dom_event_support",
")",
"&&",
"this",
... | Attach a listener to window object, start listening to the event
@param {string} event_name DOM event name | [
"Attach",
"a",
"listener",
"to",
"window",
"object",
"start",
"listening",
"to",
"the",
"event"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L2406-L2420 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(event_name) {
if ((event_name in this._dom_event_support) && this._dom_event_support[event_name].delegation) {
Firestorm.Element.removeDelegation(window, event_name, '*', this._event_listeners[event_name]);
} else {
Firestorm.Element.removeListener(window, event_name, this._event_listeners[event_... | javascript | function(event_name) {
if ((event_name in this._dom_event_support) && this._dom_event_support[event_name].delegation) {
Firestorm.Element.removeDelegation(window, event_name, '*', this._event_listeners[event_name]);
} else {
Firestorm.Element.removeListener(window, event_name, this._event_listeners[event_... | [
"function",
"(",
"event_name",
")",
"{",
"if",
"(",
"(",
"event_name",
"in",
"this",
".",
"_dom_event_support",
")",
"&&",
"this",
".",
"_dom_event_support",
"[",
"event_name",
"]",
".",
"delegation",
")",
"{",
"Firestorm",
".",
"Element",
".",
"removeDelega... | Stop listening to DOM event
@param {string} event_name DOM event name | [
"Stop",
"listening",
"to",
"DOM",
"event"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L2426-L2438 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(target, level) {
if (!this._scope_refresh_queues[level]) {
if (this._min_scope_refresh_level > level) {
this._min_scope_refresh_level = level;
}
this._scope_refresh_queues[level] = [];
}
// It absolutely must be an object, but it has no methods for performance reasons - to stay as lig... | javascript | function(target, level) {
if (!this._scope_refresh_queues[level]) {
if (this._min_scope_refresh_level > level) {
this._min_scope_refresh_level = level;
}
this._scope_refresh_queues[level] = [];
}
// It absolutely must be an object, but it has no methods for performance reasons - to stay as lig... | [
"function",
"(",
"target",
",",
"level",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_scope_refresh_queues",
"[",
"level",
"]",
")",
"{",
"if",
"(",
"this",
".",
"_min_scope_refresh_level",
">",
"level",
")",
"{",
"this",
".",
"_min_scope_refresh_level",
"=",
... | Normal version outside of view refresh cycle - adds scope into refresh queue.
@param {Lava.mixin.Refreshable} target
@param {number} level
@returns {{index: number}} | [
"Normal",
"version",
"outside",
"of",
"view",
"refresh",
"cycle",
"-",
"adds",
"scope",
"into",
"refresh",
"queue",
"."
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L2590-L2609 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(refresh_ticket, level) {
if (Lava.schema.DEBUG && refresh_ticket == null) Lava.t();
this._scope_refresh_queues[level][refresh_ticket.index] = null;
} | javascript | function(refresh_ticket, level) {
if (Lava.schema.DEBUG && refresh_ticket == null) Lava.t();
this._scope_refresh_queues[level][refresh_ticket.index] = null;
} | [
"function",
"(",
"refresh_ticket",
",",
"level",
")",
"{",
"if",
"(",
"Lava",
".",
"schema",
".",
"DEBUG",
"&&",
"refresh_ticket",
"==",
"null",
")",
"Lava",
".",
"t",
"(",
")",
";",
"this",
".",
"_scope_refresh_queues",
"[",
"level",
"]",
"[",
"refres... | Remove a scope from update queue
@param {{index: number}} refresh_ticket
@param {number} level | [
"Remove",
"a",
"scope",
"from",
"update",
"queue"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L2655-L2661 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function() {
if (this._is_refreshing) {
Lava.logError("ScopeManager: recursive call to ScopeManager#refresh()");
return;
}
var count_refresh_cycles = 0,
count_levels = this._scope_refresh_queues.length;
if (count_levels == 0) {
return;
}
this._is_refreshing = true;
this._has_exceptions ... | javascript | function() {
if (this._is_refreshing) {
Lava.logError("ScopeManager: recursive call to ScopeManager#refresh()");
return;
}
var count_refresh_cycles = 0,
count_levels = this._scope_refresh_queues.length;
if (count_levels == 0) {
return;
}
this._is_refreshing = true;
this._has_exceptions ... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_is_refreshing",
")",
"{",
"Lava",
".",
"logError",
"(",
"\"ScopeManager: recursive call to ScopeManager#refresh()\"",
")",
";",
"return",
";",
"}",
"var",
"count_refresh_cycles",
"=",
"0",
",",
"count_levels",
... | The main refresh loop | [
"The",
"main",
"refresh",
"loop"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L2676-L2745 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function() {
var current_level = this._min_scope_refresh_level,
count_levels = this._scope_refresh_queues.length,
current_queue,
i,
count;
for (;current_level < count_levels; current_level++) {
if (current_level in this._scope_refresh_queues) {
current_queue = this._scope_refresh_queues[curre... | javascript | function() {
var current_level = this._min_scope_refresh_level,
count_levels = this._scope_refresh_queues.length,
current_queue,
i,
count;
for (;current_level < count_levels; current_level++) {
if (current_level in this._scope_refresh_queues) {
current_queue = this._scope_refresh_queues[curre... | [
"function",
"(",
")",
"{",
"var",
"current_level",
"=",
"this",
".",
"_min_scope_refresh_level",
",",
"count_levels",
"=",
"this",
".",
"_scope_refresh_queues",
".",
"length",
",",
"current_queue",
",",
"i",
",",
"count",
";",
"for",
"(",
";",
"current_level",... | A refresh cycle that is launched in case of circular scope dependency
It will refresh all dirty scopes one time | [
"A",
"refresh",
"cycle",
"that",
"is",
"launched",
"in",
"case",
"of",
"circular",
"scope",
"dependency",
"It",
"will",
"refresh",
"all",
"dirty",
"scopes",
"one",
"time"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L2828-L2871 | train | |
kogarashisan/LiquidLava | lib/packages/core.js | function(scope) {
var index = this._debug_all_scopes.indexOf(scope);
if (index == -1) Lava.t();
this._debug_all_scopes.splice(index, 1);
} | javascript | function(scope) {
var index = this._debug_all_scopes.indexOf(scope);
if (index == -1) Lava.t();
this._debug_all_scopes.splice(index, 1);
} | [
"function",
"(",
"scope",
")",
"{",
"var",
"index",
"=",
"this",
".",
"_debug_all_scopes",
".",
"indexOf",
"(",
"scope",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"Lava",
".",
"t",
"(",
")",
";",
"this",
".",
"_debug_all_scopes",
".",
"spl... | Remove a scope from `_debug_all_scopes`
@param {Lava.mixin.Refreshable} scope | [
"Remove",
"a",
"scope",
"from",
"_debug_all_scopes"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core.js#L2942-L2948 | train | |
mkay581/build-tools | src/utils.js | function (paths) {
let scope = function (path) {
return process.cwd() + '/' + path;
};
if (typeof paths === 'string') {
return scope(paths);
} else {
return paths.map(function (path) {
return scope(path);
});
}
} | javascript | function (paths) {
let scope = function (path) {
return process.cwd() + '/' + path;
};
if (typeof paths === 'string') {
return scope(paths);
} else {
return paths.map(function (path) {
return scope(path);
});
}
} | [
"function",
"(",
"paths",
")",
"{",
"let",
"scope",
"=",
"function",
"(",
"path",
")",
"{",
"return",
"process",
".",
"cwd",
"(",
")",
"+",
"'/'",
"+",
"path",
";",
"}",
";",
"if",
"(",
"typeof",
"paths",
"===",
"'string'",
")",
"{",
"return",
"s... | Resolves a relative path to the external project.
@param paths | [
"Resolves",
"a",
"relative",
"path",
"to",
"the",
"external",
"project",
"."
] | 005cb840b5db017a33597a8d44d941d156a7a000 | https://github.com/mkay581/build-tools/blob/005cb840b5db017a33597a8d44d941d156a7a000/src/utils.js#L7-L18 | train | |
mkay581/build-tools | src/utils.js | function () {
let rootPath = process.cwd(),
config;
try {
config = require(rootPath + '/bt-config');
} catch (err) {
console.warn("Project has no configuration file for bt command!");
}
return config;
} | javascript | function () {
let rootPath = process.cwd(),
config;
try {
config = require(rootPath + '/bt-config');
} catch (err) {
console.warn("Project has no configuration file for bt command!");
}
return config;
} | [
"function",
"(",
")",
"{",
"let",
"rootPath",
"=",
"process",
".",
"cwd",
"(",
")",
",",
"config",
";",
"try",
"{",
"config",
"=",
"require",
"(",
"rootPath",
"+",
"'/bt-config'",
")",
";",
"}",
"catch",
"(",
"err",
")",
"{",
"console",
".",
"warn"... | Returns the build-tools configuration, whether its as a bt-config file or grunt file.
@returns {undefined|Object} | [
"Returns",
"the",
"build",
"-",
"tools",
"configuration",
"whether",
"its",
"as",
"a",
"bt",
"-",
"config",
"file",
"or",
"grunt",
"file",
"."
] | 005cb840b5db017a33597a8d44d941d156a7a000 | https://github.com/mkay581/build-tools/blob/005cb840b5db017a33597a8d44d941d156a7a000/src/utils.js#L24-L34 | train | |
titon/probe | src/probe.js | mapPrototypes | function mapPrototypes(vendor, protos, funcs) {
var p, f, proto, func;
// Loop over each prototype
for (p = 0; (proto = protos[p]); p++) {
// Loop over each function
for (f = 0; (func = funcs[f]); f++) {
// Skip if the function already exists on the pro... | javascript | function mapPrototypes(vendor, protos, funcs) {
var p, f, proto, func;
// Loop over each prototype
for (p = 0; (proto = protos[p]); p++) {
// Loop over each function
for (f = 0; (func = funcs[f]); f++) {
// Skip if the function already exists on the pro... | [
"function",
"mapPrototypes",
"(",
"vendor",
",",
"protos",
",",
"funcs",
")",
"{",
"var",
"p",
",",
"f",
",",
"proto",
",",
"func",
";",
"// Loop over each prototype",
"for",
"(",
"p",
"=",
"0",
";",
"(",
"proto",
"=",
"protos",
"[",
"p",
"]",
")",
... | Loop over each collection and extend the prototypes.
@param {Object} vendor
@param {Array} protos
@param {Array} funcs | [
"Loop",
"over",
"each",
"collection",
"and",
"extend",
"the",
"prototypes",
"."
] | 86ebdab49fe92405194cf0abfffe1b91d22d7735 | https://github.com/titon/probe/blob/86ebdab49fe92405194cf0abfffe1b91d22d7735/src/probe.js#L21-L45 | train |
titon/probe | src/probe.js | extendPrototype | function extendPrototype(vendor, proto, func) {
proto.prototype[func] = function() {
var args = slice.call(arguments) || [];
args.unshift(this);
return vendor[func].apply(this, args);
};
} | javascript | function extendPrototype(vendor, proto, func) {
proto.prototype[func] = function() {
var args = slice.call(arguments) || [];
args.unshift(this);
return vendor[func].apply(this, args);
};
} | [
"function",
"extendPrototype",
"(",
"vendor",
",",
"proto",
",",
"func",
")",
"{",
"proto",
".",
"prototype",
"[",
"func",
"]",
"=",
"function",
"(",
")",
"{",
"var",
"args",
"=",
"slice",
".",
"call",
"(",
"arguments",
")",
"||",
"[",
"]",
";",
"a... | Extend the prototype with the vendor function.
Prepend the "this" value to the beginning of the arguments.
@param {Object} vendor
@param {Object} proto
@param {Function} func | [
"Extend",
"the",
"prototype",
"with",
"the",
"vendor",
"function",
".",
"Prepend",
"the",
"this",
"value",
"to",
"the",
"beginning",
"of",
"the",
"arguments",
"."
] | 86ebdab49fe92405194cf0abfffe1b91d22d7735 | https://github.com/titon/probe/blob/86ebdab49fe92405194cf0abfffe1b91d22d7735/src/probe.js#L55-L62 | train |
alexindigo/deeply | lib/reduce_object.js | reduceObject | function reduceObject(target, source, merge)
{
// clone exposed properties
Object.keys(source).reduce(function(acc, key)
{
acc[key] = merge(acc[key], source[key]);
return acc;
}, target);
return target;
} | javascript | function reduceObject(target, source, merge)
{
// clone exposed properties
Object.keys(source).reduce(function(acc, key)
{
acc[key] = merge(acc[key], source[key]);
return acc;
}, target);
return target;
} | [
"function",
"reduceObject",
"(",
"target",
",",
"source",
",",
"merge",
")",
"{",
"// clone exposed properties",
"Object",
".",
"keys",
"(",
"source",
")",
".",
"reduce",
"(",
"function",
"(",
"acc",
",",
"key",
")",
"{",
"acc",
"[",
"key",
"]",
"=",
"... | Iterates over own properties of the provided object
and copies then over to the target object.
While recursively running merge on the elements.
@param {mixed} target - target object to modify
@param {mixed} source - source object to read from
@param {function} merge - iterator to merge sub elements
@returns {mix... | [
"Iterates",
"over",
"own",
"properties",
"of",
"the",
"provided",
"object",
"and",
"copies",
"then",
"over",
"to",
"the",
"target",
"object",
".",
"While",
"recursively",
"running",
"merge",
"on",
"the",
"elements",
"."
] | d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1 | https://github.com/alexindigo/deeply/blob/d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1/lib/reduce_object.js#L14-L25 | train |
kogarashisan/LiquidLava | dependencies/jison/lib/jison.js | commonjsMain | function commonjsMain (args) {
var cwd = require("file").path(require("file").cwd());
if (!args[1])
throw new Error('Usage: '+args[0]+' FILE');
var source = cwd.join(args[1]).read({charset: "utf-8"});
exports.parser.parse(source);
} | javascript | function commonjsMain (args) {
var cwd = require("file").path(require("file").cwd());
if (!args[1])
throw new Error('Usage: '+args[0]+' FILE');
var source = cwd.join(args[1]).read({charset: "utf-8"});
exports.parser.parse(source);
} | [
"function",
"commonjsMain",
"(",
"args",
")",
"{",
"var",
"cwd",
"=",
"require",
"(",
"\"file\"",
")",
".",
"path",
"(",
"require",
"(",
"\"file\"",
")",
".",
"cwd",
"(",
")",
")",
";",
"if",
"(",
"!",
"args",
"[",
"1",
"]",
")",
"throw",
"new",
... | default main method for generated commonjs modules | [
"default",
"main",
"method",
"for",
"generated",
"commonjs",
"modules"
] | fb8618821a51fad373106b5cc9247464b0a23cf6 | https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/dependencies/jison/lib/jison.js#L889-L895 | train |
zxjly/reactweb-cli | libs/ask.js | prompt | function prompt (data, key, prompt, done) {
// skip prompts whose when condition is not met
if (prompt.when && !evaluate(prompt.when, data)) {
return done()
}
var promptDefault = prompt.default
if (typeof prompt.default === 'function') {
promptDefault = function () {
return prompt.default.bind(... | javascript | function prompt (data, key, prompt, done) {
// skip prompts whose when condition is not met
if (prompt.when && !evaluate(prompt.when, data)) {
return done()
}
var promptDefault = prompt.default
if (typeof prompt.default === 'function') {
promptDefault = function () {
return prompt.default.bind(... | [
"function",
"prompt",
"(",
"data",
",",
"key",
",",
"prompt",
",",
"done",
")",
"{",
"// skip prompts whose when condition is not met",
"if",
"(",
"prompt",
".",
"when",
"&&",
"!",
"evaluate",
"(",
"prompt",
".",
"when",
",",
"data",
")",
")",
"{",
"return... | Inquirer prompt wrapper.
@param {Object} data
@param {String} key
@param {Object} prompt
@param {Function} done | [
"Inquirer",
"prompt",
"wrapper",
"."
] | f104c295463ab79e9add0f8ca3f01e38393c5498 | https://github.com/zxjly/reactweb-cli/blob/f104c295463ab79e9add0f8ca3f01e38393c5498/libs/ask.js#L34-L67 | train |
mkopit/url-embed | lib/utils.js | function (path) {
let classes = [];
let files = fs.readdirSync(path);
for (let i = 0; i < files.length; i++) {
let clazz = require(path + '/' + files[i]);
classes.push(clazz);
}
return classes;
} | javascript | function (path) {
let classes = [];
let files = fs.readdirSync(path);
for (let i = 0; i < files.length; i++) {
let clazz = require(path + '/' + files[i]);
classes.push(clazz);
}
return classes;
} | [
"function",
"(",
"path",
")",
"{",
"let",
"classes",
"=",
"[",
"]",
";",
"let",
"files",
"=",
"fs",
".",
"readdirSync",
"(",
"path",
")",
";",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"files",
".",
"length",
";",
"i",
"++",
")",
"{",
... | Requires in all class files in a directory
@param {String} [path] - path containing classes | [
"Requires",
"in",
"all",
"class",
"files",
"in",
"a",
"directory"
] | e6038f816abdc25499b5cace4dd97a2ea271889c | https://github.com/mkopit/url-embed/blob/e6038f816abdc25499b5cace4dd97a2ea271889c/lib/utils.js#L14-L24 | train | |
rainforestapp/decaf | src/parser.js | utility | function utility(name, o) {
const {root} = o.scope;
if (root.utilities[name]) {
return root.utilities[name];
}
const ref = root.freeVariable(name);
root.assign(ref, UTILITIES[name](o));
root.utilities[name] = ref;
} | javascript | function utility(name, o) {
const {root} = o.scope;
if (root.utilities[name]) {
return root.utilities[name];
}
const ref = root.freeVariable(name);
root.assign(ref, UTILITIES[name](o));
root.utilities[name] = ref;
} | [
"function",
"utility",
"(",
"name",
",",
"o",
")",
"{",
"const",
"{",
"root",
"}",
"=",
"o",
".",
"scope",
";",
"if",
"(",
"root",
".",
"utilities",
"[",
"name",
"]",
")",
"{",
"return",
"root",
".",
"utilities",
"[",
"name",
"]",
";",
"}",
"co... | Helper for ensuring that utility functions are assigned at the top level. copied from coffee-script compiler | [
"Helper",
"for",
"ensuring",
"that",
"utility",
"functions",
"are",
"assigned",
"at",
"the",
"top",
"level",
".",
"copied",
"from",
"coffee",
"-",
"script",
"compiler"
] | 7f909e3b46d3371ee7d69a9c7e4ac6fb981e0150 | https://github.com/rainforestapp/decaf/blob/7f909e3b46d3371ee7d69a9c7e4ac6fb981e0150/src/parser.js#L1729-L1739 | train |
bvalosek/sticky | lib/Repository.js | Repository | function Repository(T)
{
var mapper = this._mapper = new Mapper(T);
this._toMany = function(x) { return mapper.toMany(x); };
this._toSingle = function(x) { return mapper.toSingle(x); };
// Implementation pointers
this._get = null;
this._getAll = null;
this._query = null;
this._add = null;
this... | javascript | function Repository(T)
{
var mapper = this._mapper = new Mapper(T);
this._toMany = function(x) { return mapper.toMany(x); };
this._toSingle = function(x) { return mapper.toSingle(x); };
// Implementation pointers
this._get = null;
this._getAll = null;
this._query = null;
this._add = null;
this... | [
"function",
"Repository",
"(",
"T",
")",
"{",
"var",
"mapper",
"=",
"this",
".",
"_mapper",
"=",
"new",
"Mapper",
"(",
"T",
")",
";",
"this",
".",
"_toMany",
"=",
"function",
"(",
"x",
")",
"{",
"return",
"mapper",
".",
"toMany",
"(",
"x",
")",
"... | A repository pattern that uses a series of sourced providers that attempt to
fire off CRUD-ish methods. Gaurentees a promise-based API and consistent
arity of return values.
@constructor
@param {Function} T | [
"A",
"repository",
"pattern",
"that",
"uses",
"a",
"series",
"of",
"sourced",
"providers",
"that",
"attempt",
"to",
"fire",
"off",
"CRUD",
"-",
"ish",
"methods",
".",
"Gaurentees",
"a",
"promise",
"-",
"based",
"API",
"and",
"consistent",
"arity",
"of",
"r... | 8cb5fdba05be161e5936f7208558bc4702aae59a | https://github.com/bvalosek/sticky/blob/8cb5fdba05be161e5936f7208558bc4702aae59a/lib/Repository.js#L13-L29 | train |
cqql/rfc6902-json-diff-js | lib/diff.js | matrixToOperations | function matrixToOperations (matrix, i, j) {
if (i === 0 && j === 0) {
return [];
} else if (i === 0) {
return matrixToOperations(matrix, i, j - 1).concat("add");
} else if (j === 0) {
return matrixToOperations(matrix, i - 1, j).concat("remove");
} else {
var left = matrix[i][j - 1];
var up ... | javascript | function matrixToOperations (matrix, i, j) {
if (i === 0 && j === 0) {
return [];
} else if (i === 0) {
return matrixToOperations(matrix, i, j - 1).concat("add");
} else if (j === 0) {
return matrixToOperations(matrix, i - 1, j).concat("remove");
} else {
var left = matrix[i][j - 1];
var up ... | [
"function",
"matrixToOperations",
"(",
"matrix",
",",
"i",
",",
"j",
")",
"{",
"if",
"(",
"i",
"===",
"0",
"&&",
"j",
"===",
"0",
")",
"{",
"return",
"[",
"]",
";",
"}",
"else",
"if",
"(",
"i",
"===",
"0",
")",
"{",
"return",
"matrixToOperations"... | Backtrace an optimal path through a levenshtein distance matrix.
@returns {Array} List of operations | [
"Backtrace",
"an",
"optimal",
"path",
"through",
"a",
"levenshtein",
"distance",
"matrix",
"."
] | ee57be69d5331751cd70c2616535e278581088be | https://github.com/cqql/rfc6902-json-diff-js/blob/ee57be69d5331751cd70c2616535e278581088be/lib/diff.js#L16-L40 | train |
xiaokekeT/react-headrooms | src/index.js | normalizeTolerance | function normalizeTolerance (t) {
return t === Object(t) ? t : { down: t, up: t }
} | javascript | function normalizeTolerance (t) {
return t === Object(t) ? t : { down: t, up: t }
} | [
"function",
"normalizeTolerance",
"(",
"t",
")",
"{",
"return",
"t",
"===",
"Object",
"(",
"t",
")",
"?",
"t",
":",
"{",
"down",
":",
"t",
",",
"up",
":",
"t",
"}",
"}"
] | Helper function for normalizing tolerance option to object format | [
"Helper",
"function",
"for",
"normalizing",
"tolerance",
"option",
"to",
"object",
"format"
] | 94961e6dca7bfb88d24991ca3a0c713841fdd3b1 | https://github.com/xiaokekeT/react-headrooms/blob/94961e6dca7bfb88d24991ca3a0c713841fdd3b1/src/index.js#L9-L11 | train |
hkjels/ntask | lib/pool.js | sortByLabel | function sortByLabel(a, b) {
if (a.sortval > b.sortval) return -1;
else if (a.sortval == b.sortval) return 0;
else return 1;
} | javascript | function sortByLabel(a, b) {
if (a.sortval > b.sortval) return -1;
else if (a.sortval == b.sortval) return 0;
else return 1;
} | [
"function",
"sortByLabel",
"(",
"a",
",",
"b",
")",
"{",
"if",
"(",
"a",
".",
"sortval",
">",
"b",
".",
"sortval",
")",
"return",
"-",
"1",
";",
"else",
"if",
"(",
"a",
".",
"sortval",
"==",
"b",
".",
"sortval",
")",
"return",
"0",
";",
"else",... | Sort by label
Will sort descending by the label specified
Use the reverse flag or function for ascending results | [
"Sort",
"by",
"label"
] | e0552042e743ef9584bc0f911245635df7acd634 | https://github.com/hkjels/ntask/blob/e0552042e743ef9584bc0f911245635df7acd634/lib/pool.js#L154-L158 | train |
waigo/waigo | src/loader.js | function(folder, options) {
options = _.extend({
matchFiles: /.+/ig,
keepExtensions: false,
}, options);
return new Promise(function(resolve, reject) {
var files = {};
var walker = walk(folder, {
followSymlinks: false
});
walker.on('file', function(file, stat) {
var dirname ... | javascript | function(folder, options) {
options = _.extend({
matchFiles: /.+/ig,
keepExtensions: false,
}, options);
return new Promise(function(resolve, reject) {
var files = {};
var walker = walk(folder, {
followSymlinks: false
});
walker.on('file', function(file, stat) {
var dirname ... | [
"function",
"(",
"folder",
",",
"options",
")",
"{",
"options",
"=",
"_",
".",
"extend",
"(",
"{",
"matchFiles",
":",
"/",
".+",
"/",
"ig",
",",
"keepExtensions",
":",
"false",
",",
"}",
",",
"options",
")",
";",
"return",
"new",
"Promise",
"(",
"f... | Walk given folder and its subfolders and return all files.
@param {String} folder Root folder.
@param {Object} [options] Additional options.
@param {String} [options.matchFiles] Filter files by this regex.
@param {String} [options.keepExtensions] If enabled then file names will keep their extensions.
@return {Promise... | [
"Walk",
"given",
"folder",
"and",
"its",
"subfolders",
"and",
"return",
"all",
"files",
"."
] | b2f50cd66b8b19016e2c7de75733330c791c76ff | https://github.com/waigo/waigo/blob/b2f50cd66b8b19016e2c7de75733330c791c76ff/src/loader.js#L68-L102 | train |
Subsets and Splits
SQL Console for semeru/code-text-javascript
Retrieves 20,000 non-null code samples labeled as JavaScript, providing a basic overview of the dataset.