id
int32 0
58k
| repo
stringlengths 5
67
| path
stringlengths 4
116
| func_name
stringlengths 0
58
| original_string
stringlengths 52
373k
| language
stringclasses 1
value | code
stringlengths 52
373k
| code_tokens
list | docstring
stringlengths 4
11.8k
| docstring_tokens
list | sha
stringlengths 40
40
| url
stringlengths 86
226
|
---|---|---|---|---|---|---|---|---|---|---|---|
42,700 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function () {
var i, length, radioInput;
for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {
radioInput = this.choicesList[i].node.firstChild;
if (radioInput.checked) {
// if "any" option checked
if (this.radioAny && this.radioAny == radioInput) {
return this.anyField.getValue() === '';
} else {
return false;
}
}
}
return true;
} | javascript | function () {
var i, length, radioInput;
for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {
radioInput = this.choicesList[i].node.firstChild;
if (radioInput.checked) {
// if "any" option checked
if (this.radioAny && this.radioAny == radioInput) {
return this.anyField.getValue() === '';
} else {
return false;
}
}
}
return true;
} | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"length",
",",
"radioInput",
";",
"for",
"(",
"i",
"=",
"0",
",",
"length",
"=",
"this",
".",
"choicesList",
".",
"length",
";",
"i",
"<",
"length",
";",
"i",
"+=",
"1",
")",
"{",
"radioInput",
"=",
"this",
".",
"choicesList",
"[",
"i",
"]",
".",
"node",
".",
"firstChild",
";",
"if",
"(",
"radioInput",
".",
"checked",
")",
"{",
"// if \"any\" option checked",
"if",
"(",
"this",
".",
"radioAny",
"&&",
"this",
".",
"radioAny",
"==",
"radioInput",
")",
"{",
"return",
"this",
".",
"anyField",
".",
"getValue",
"(",
")",
"===",
"''",
";",
"}",
"else",
"{",
"return",
"false",
";",
"}",
"}",
"}",
"return",
"true",
";",
"}"
]
| Should return true if empty | [
"Should",
"return",
"true",
"if",
"empty"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5986-L6011 |
|
42,701 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function () {
var i, length;
for (i = 0, length = this.choicesList.length; i < length; i += 1) {
this.disableChoice(this.choicesList[i], false);
}
} | javascript | function () {
var i, length;
for (i = 0, length = this.choicesList.length; i < length; i += 1) {
this.disableChoice(this.choicesList[i], false);
}
} | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"length",
";",
"for",
"(",
"i",
"=",
"0",
",",
"length",
"=",
"this",
".",
"choicesList",
".",
"length",
";",
"i",
"<",
"length",
";",
"i",
"+=",
"1",
")",
"{",
"this",
".",
"disableChoice",
"(",
"this",
".",
"choicesList",
"[",
"i",
"]",
",",
"false",
")",
";",
"}",
"}"
]
| Disable the field | [
"Disable",
"the",
"field"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L6040-L6048 |
|
42,702 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function () {
var i, length;
for (i = 0, length = this.choicesList.length; i < length; i += 1) {
this.enableChoice(this.choicesList[i]);
}
} | javascript | function () {
var i, length;
for (i = 0, length = this.choicesList.length; i < length; i += 1) {
this.enableChoice(this.choicesList[i]);
}
} | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"length",
";",
"for",
"(",
"i",
"=",
"0",
",",
"length",
"=",
"this",
".",
"choicesList",
".",
"length",
";",
"i",
"<",
"length",
";",
"i",
"+=",
"1",
")",
"{",
"this",
".",
"enableChoice",
"(",
"this",
".",
"choicesList",
"[",
"i",
"]",
")",
";",
"}",
"}"
]
| Enable the field | [
"Enable",
"the",
"field"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L6053-L6061 |
|
42,703 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(val, sendUpdatedEvt) {
this.value = val;
inputEx.renderVisu(this.options.visu, val, this.fieldContainer);
inputEx.UneditableField.superclass.setValue.call(this, val, sendUpdatedEvt);
} | javascript | function(val, sendUpdatedEvt) {
this.value = val;
inputEx.renderVisu(this.options.visu, val, this.fieldContainer);
inputEx.UneditableField.superclass.setValue.call(this, val, sendUpdatedEvt);
} | [
"function",
"(",
"val",
",",
"sendUpdatedEvt",
")",
"{",
"this",
".",
"value",
"=",
"val",
";",
"inputEx",
".",
"renderVisu",
"(",
"this",
".",
"options",
".",
"visu",
",",
"val",
",",
"this",
".",
"fieldContainer",
")",
";",
"inputEx",
".",
"UneditableField",
".",
"superclass",
".",
"setValue",
".",
"call",
"(",
"this",
",",
"val",
",",
"sendUpdatedEvt",
")",
";",
"}"
]
| Store the value and update the visu
@param {Any} val The value that will be sent to the visu
@param {boolean} [sendUpdatedEvt] (optional) Wether this setValue should fire the updatedEvt or not (default is true, pass false to NOT send the event) | [
"Store",
"the",
"value",
"and",
"update",
"the",
"visu"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L6834-L6840 |
|
42,704 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(x, y) {
// make the proxy look like the source element
var dragEl = this.getDragEl();
var clickEl = this.getEl();
Dom.setStyle(clickEl, "visibility", "hidden");
this._originalIndex = inputEx.indexOf(clickEl ,clickEl.parentNode.childNodes);
dragEl.className = clickEl.className;
dragEl.innerHTML = clickEl.innerHTML;
} | javascript | function(x, y) {
// make the proxy look like the source element
var dragEl = this.getDragEl();
var clickEl = this.getEl();
Dom.setStyle(clickEl, "visibility", "hidden");
this._originalIndex = inputEx.indexOf(clickEl ,clickEl.parentNode.childNodes);
dragEl.className = clickEl.className;
dragEl.innerHTML = clickEl.innerHTML;
} | [
"function",
"(",
"x",
",",
"y",
")",
"{",
"// make the proxy look like the source element",
"var",
"dragEl",
"=",
"this",
".",
"getDragEl",
"(",
")",
";",
"var",
"clickEl",
"=",
"this",
".",
"getEl",
"(",
")",
";",
"Dom",
".",
"setStyle",
"(",
"clickEl",
",",
"\"visibility\"",
",",
"\"hidden\"",
")",
";",
"this",
".",
"_originalIndex",
"=",
"inputEx",
".",
"indexOf",
"(",
"clickEl",
",",
"clickEl",
".",
"parentNode",
".",
"childNodes",
")",
";",
"dragEl",
".",
"className",
"=",
"clickEl",
".",
"className",
";",
"dragEl",
".",
"innerHTML",
"=",
"clickEl",
".",
"innerHTML",
";",
"}"
]
| Create the proxy element | [
"Create",
"the",
"proxy",
"element"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L6984-L6992 |
|
42,705 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(e) {
Dom.setStyle(this.id, "visibility", "");
// Fire the reordered event if position in list has changed
var clickEl = this.getEl();
var newIndex = inputEx.indexOf(clickEl ,clickEl.parentNode.childNodes);
if(this._originalIndex != newIndex) {
this._list.onReordered(this._originalIndex, newIndex);
}
} | javascript | function(e) {
Dom.setStyle(this.id, "visibility", "");
// Fire the reordered event if position in list has changed
var clickEl = this.getEl();
var newIndex = inputEx.indexOf(clickEl ,clickEl.parentNode.childNodes);
if(this._originalIndex != newIndex) {
this._list.onReordered(this._originalIndex, newIndex);
}
} | [
"function",
"(",
"e",
")",
"{",
"Dom",
".",
"setStyle",
"(",
"this",
".",
"id",
",",
"\"visibility\"",
",",
"\"\"",
")",
";",
"// Fire the reordered event if position in list has changed",
"var",
"clickEl",
"=",
"this",
".",
"getEl",
"(",
")",
";",
"var",
"newIndex",
"=",
"inputEx",
".",
"indexOf",
"(",
"clickEl",
",",
"clickEl",
".",
"parentNode",
".",
"childNodes",
")",
";",
"if",
"(",
"this",
".",
"_originalIndex",
"!=",
"newIndex",
")",
"{",
"this",
".",
"_list",
".",
"onReordered",
"(",
"this",
".",
"_originalIndex",
",",
"newIndex",
")",
";",
"}",
"}"
]
| Handle the endDrag and eventually fire the listReordered event | [
"Handle",
"the",
"endDrag",
"and",
"eventually",
"fire",
"the",
"listReordered",
"event"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L6997-L7006 |
|
42,706 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(e) {
var y = Event.getPageY(e);
if (y < this.lastY) {
this.goingUp = true;
} else if (y > this.lastY) {
this.goingUp = false;
}
this.lastY = y;
} | javascript | function(e) {
var y = Event.getPageY(e);
if (y < this.lastY) {
this.goingUp = true;
} else if (y > this.lastY) {
this.goingUp = false;
}
this.lastY = y;
} | [
"function",
"(",
"e",
")",
"{",
"var",
"y",
"=",
"Event",
".",
"getPageY",
"(",
"e",
")",
";",
"if",
"(",
"y",
"<",
"this",
".",
"lastY",
")",
"{",
"this",
".",
"goingUp",
"=",
"true",
";",
"}",
"else",
"if",
"(",
"y",
">",
"this",
".",
"lastY",
")",
"{",
"this",
".",
"goingUp",
"=",
"false",
";",
"}",
"this",
".",
"lastY",
"=",
"y",
";",
"}"
]
| Keep track of the direction of the drag for use during onDragOver | [
"Keep",
"track",
"of",
"the",
"direction",
"of",
"the",
"drag",
"for",
"use",
"during",
"onDragOver"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L7042-L7052 |
|
42,707 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(i) {
var itemValue = this.items[i];
this.ul.removeChild(this.ul.childNodes[i]);
this.items[i] = null;
this.items = inputEx.compactArray(this.items);
return itemValue;
} | javascript | function(i) {
var itemValue = this.items[i];
this.ul.removeChild(this.ul.childNodes[i]);
this.items[i] = null;
this.items = inputEx.compactArray(this.items);
return itemValue;
} | [
"function",
"(",
"i",
")",
"{",
"var",
"itemValue",
"=",
"this",
".",
"items",
"[",
"i",
"]",
";",
"this",
".",
"ul",
".",
"removeChild",
"(",
"this",
".",
"ul",
".",
"childNodes",
"[",
"i",
"]",
")",
";",
"this",
".",
"items",
"[",
"i",
"]",
"=",
"null",
";",
"this",
".",
"items",
"=",
"inputEx",
".",
"compactArray",
"(",
"this",
".",
"items",
")",
";",
"return",
"itemValue",
";",
"}"
]
| private method to remove an item
@param {Integer} index index of item to be removed
@private | [
"private",
"method",
"to",
"remove",
"an",
"item"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L7173-L7183 |
|
42,708 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(originalIndex, newIndex) {
if(originalIndex < newIndex) {
this.items.splice(newIndex+1,0, this.items[originalIndex]);
this.items[originalIndex] = null;
}
else {
this.items.splice(newIndex,0, this.items[originalIndex]);
this.items[originalIndex+1] = null;
}
this.items = inputEx.compactArray(this.items);
this.listReorderedEvt.fire();
} | javascript | function(originalIndex, newIndex) {
if(originalIndex < newIndex) {
this.items.splice(newIndex+1,0, this.items[originalIndex]);
this.items[originalIndex] = null;
}
else {
this.items.splice(newIndex,0, this.items[originalIndex]);
this.items[originalIndex+1] = null;
}
this.items = inputEx.compactArray(this.items);
this.listReorderedEvt.fire();
} | [
"function",
"(",
"originalIndex",
",",
"newIndex",
")",
"{",
"if",
"(",
"originalIndex",
"<",
"newIndex",
")",
"{",
"this",
".",
"items",
".",
"splice",
"(",
"newIndex",
"+",
"1",
",",
"0",
",",
"this",
".",
"items",
"[",
"originalIndex",
"]",
")",
";",
"this",
".",
"items",
"[",
"originalIndex",
"]",
"=",
"null",
";",
"}",
"else",
"{",
"this",
".",
"items",
".",
"splice",
"(",
"newIndex",
",",
"0",
",",
"this",
".",
"items",
"[",
"originalIndex",
"]",
")",
";",
"this",
".",
"items",
"[",
"originalIndex",
"+",
"1",
"]",
"=",
"null",
";",
"}",
"this",
".",
"items",
"=",
"inputEx",
".",
"compactArray",
"(",
"this",
".",
"items",
")",
";",
"this",
".",
"listReorderedEvt",
".",
"fire",
"(",
")",
";",
"}"
]
| Called by the DDListItem when an item as been moved | [
"Called",
"by",
"the",
"DDListItem",
"when",
"an",
"item",
"as",
"been",
"moved"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L7199-L7211 |
|
42,709 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(index, item) {
this.items[index] = (typeof item == "object") ? item.value : item;
this.ul.childNodes[index].childNodes[0].innerHTML = (typeof item == "object") ? item.label : item;
} | javascript | function(index, item) {
this.items[index] = (typeof item == "object") ? item.value : item;
this.ul.childNodes[index].childNodes[0].innerHTML = (typeof item == "object") ? item.label : item;
} | [
"function",
"(",
"index",
",",
"item",
")",
"{",
"this",
".",
"items",
"[",
"index",
"]",
"=",
"(",
"typeof",
"item",
"==",
"\"object\"",
")",
"?",
"item",
".",
"value",
":",
"item",
";",
"this",
".",
"ul",
".",
"childNodes",
"[",
"index",
"]",
".",
"childNodes",
"[",
"0",
"]",
".",
"innerHTML",
"=",
"(",
"typeof",
"item",
"==",
"\"object\"",
")",
"?",
"item",
".",
"label",
":",
"item",
";",
"}"
]
| Update the value of a given item
@param {Integer} index Item index
@param {Any} value New value | [
"Update",
"the",
"value",
"of",
"a",
"given",
"item"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L7226-L7229 |
|
42,710 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
var value, position, choice;
if (this.el.selectedIndex !== 0) {
// Get the selector value
value = inputEx.MultiSelectField.superclass.getValue.call(this);
position = this.getChoicePosition({ value : value });
choice = this.choicesList[position];
this.ddlist.addItem({ value: value, label: choice.label });
// hide choice that has just been selected (+ select first choice)
this.hideChoice({ position : position });
this.el.selectedIndex = 0;
this.fireUpdatedEvt();
}
} | javascript | function() {
var value, position, choice;
if (this.el.selectedIndex !== 0) {
// Get the selector value
value = inputEx.MultiSelectField.superclass.getValue.call(this);
position = this.getChoicePosition({ value : value });
choice = this.choicesList[position];
this.ddlist.addItem({ value: value, label: choice.label });
// hide choice that has just been selected (+ select first choice)
this.hideChoice({ position : position });
this.el.selectedIndex = 0;
this.fireUpdatedEvt();
}
} | [
"function",
"(",
")",
"{",
"var",
"value",
",",
"position",
",",
"choice",
";",
"if",
"(",
"this",
".",
"el",
".",
"selectedIndex",
"!==",
"0",
")",
"{",
"// Get the selector value",
"value",
"=",
"inputEx",
".",
"MultiSelectField",
".",
"superclass",
".",
"getValue",
".",
"call",
"(",
"this",
")",
";",
"position",
"=",
"this",
".",
"getChoicePosition",
"(",
"{",
"value",
":",
"value",
"}",
")",
";",
"choice",
"=",
"this",
".",
"choicesList",
"[",
"position",
"]",
";",
"this",
".",
"ddlist",
".",
"addItem",
"(",
"{",
"value",
":",
"value",
",",
"label",
":",
"choice",
".",
"label",
"}",
")",
";",
"// hide choice that has just been selected (+ select first choice)",
"this",
".",
"hideChoice",
"(",
"{",
"position",
":",
"position",
"}",
")",
";",
"this",
".",
"el",
".",
"selectedIndex",
"=",
"0",
";",
"this",
".",
"fireUpdatedEvt",
"(",
")",
";",
"}",
"}"
]
| Add an item to the list when the select changed | [
"Add",
"an",
"item",
"to",
"the",
"list",
"when",
"the",
"select",
"changed"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L7315-L7336 |
|
42,711 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(sType, aArgs) {
var aData = aArgs[2];
var value = lang.isFunction(this.options.returnValue) ? this.options.returnValue(aData) : aData[0];
var label = lang.isFunction(this.options.returnLabel) ? this.options.returnLabel(aData) : value;
this.ddlist.addItem({label: label, value: value});
this.el.value = "";
this.fireUpdatedEvt();
} | javascript | function(sType, aArgs) {
var aData = aArgs[2];
var value = lang.isFunction(this.options.returnValue) ? this.options.returnValue(aData) : aData[0];
var label = lang.isFunction(this.options.returnLabel) ? this.options.returnLabel(aData) : value;
this.ddlist.addItem({label: label, value: value});
this.el.value = "";
this.fireUpdatedEvt();
} | [
"function",
"(",
"sType",
",",
"aArgs",
")",
"{",
"var",
"aData",
"=",
"aArgs",
"[",
"2",
"]",
";",
"var",
"value",
"=",
"lang",
".",
"isFunction",
"(",
"this",
".",
"options",
".",
"returnValue",
")",
"?",
"this",
".",
"options",
".",
"returnValue",
"(",
"aData",
")",
":",
"aData",
"[",
"0",
"]",
";",
"var",
"label",
"=",
"lang",
".",
"isFunction",
"(",
"this",
".",
"options",
".",
"returnLabel",
")",
"?",
"this",
".",
"options",
".",
"returnLabel",
"(",
"aData",
")",
":",
"value",
";",
"this",
".",
"ddlist",
".",
"addItem",
"(",
"{",
"label",
":",
"label",
",",
"value",
":",
"value",
"}",
")",
";",
"this",
".",
"el",
".",
"value",
"=",
"\"\"",
";",
"this",
".",
"fireUpdatedEvt",
"(",
")",
";",
"}"
]
| Handle item selection in the autocompleter to add it to the list | [
"Handle",
"item",
"selection",
"in",
"the",
"autocompleter",
"to",
"add",
"it",
"to",
"the",
"list"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L7632-L7639 |
|
42,712 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(options) {
inputEx.SliderField.superclass.setOptions.call(this, options);
this.options.className = options.className ? options.className : 'inputEx-SliderField';
this.options.minValue = lang.isUndefined(options.minValue) ? 0 : options.minValue;
this.options.maxValue = lang.isUndefined(options.maxValue) ? 100 : options.maxValue;
this.options.displayValue = lang.isUndefined(options.displayValue) ? true : options.displayValue;
} | javascript | function(options) {
inputEx.SliderField.superclass.setOptions.call(this, options);
this.options.className = options.className ? options.className : 'inputEx-SliderField';
this.options.minValue = lang.isUndefined(options.minValue) ? 0 : options.minValue;
this.options.maxValue = lang.isUndefined(options.maxValue) ? 100 : options.maxValue;
this.options.displayValue = lang.isUndefined(options.displayValue) ? true : options.displayValue;
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"SliderField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"?",
"options",
".",
"className",
":",
"'inputEx-SliderField'",
";",
"this",
".",
"options",
".",
"minValue",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"minValue",
")",
"?",
"0",
":",
"options",
".",
"minValue",
";",
"this",
".",
"options",
".",
"maxValue",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"maxValue",
")",
"?",
"100",
":",
"options",
".",
"maxValue",
";",
"this",
".",
"options",
".",
"displayValue",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"displayValue",
")",
"?",
"true",
":",
"options",
".",
"displayValue",
";",
"}"
]
| Set the classname to 'inputEx-SliderField'
@param {Object} options Options object as passed to the constructor | [
"Set",
"the",
"classname",
"to",
"inputEx",
"-",
"SliderField"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L7773-L7782 |
|
42,713 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
this.sliderbg = inputEx.cn('div', {id: YAHOO.util.Dom.generateId(), className: 'inputEx-SliderField-bg'});
this.sliderthumb = inputEx.cn('div', {className: 'inputEx-SliderField-thumb'} );
this.sliderbg.appendChild(this.sliderthumb);
this.fieldContainer.appendChild(this.sliderbg);
if(this.options.displayValue) {
this.valueDisplay = inputEx.cn('div', {className: 'inputEx-SliderField-value'}, null, String(this.options.minValue) );
this.fieldContainer.appendChild(this.valueDisplay);
}
this.fieldContainer.appendChild( inputEx.cn('div',null,{clear: 'both'}) );
this.slider = YAHOO.widget.Slider.getHorizSlider(this.sliderbg, this.sliderthumb, 0,100);
} | javascript | function() {
this.sliderbg = inputEx.cn('div', {id: YAHOO.util.Dom.generateId(), className: 'inputEx-SliderField-bg'});
this.sliderthumb = inputEx.cn('div', {className: 'inputEx-SliderField-thumb'} );
this.sliderbg.appendChild(this.sliderthumb);
this.fieldContainer.appendChild(this.sliderbg);
if(this.options.displayValue) {
this.valueDisplay = inputEx.cn('div', {className: 'inputEx-SliderField-value'}, null, String(this.options.minValue) );
this.fieldContainer.appendChild(this.valueDisplay);
}
this.fieldContainer.appendChild( inputEx.cn('div',null,{clear: 'both'}) );
this.slider = YAHOO.widget.Slider.getHorizSlider(this.sliderbg, this.sliderthumb, 0,100);
} | [
"function",
"(",
")",
"{",
"this",
".",
"sliderbg",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"id",
":",
"YAHOO",
".",
"util",
".",
"Dom",
".",
"generateId",
"(",
")",
",",
"className",
":",
"'inputEx-SliderField-bg'",
"}",
")",
";",
"this",
".",
"sliderthumb",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-SliderField-thumb'",
"}",
")",
";",
"this",
".",
"sliderbg",
".",
"appendChild",
"(",
"this",
".",
"sliderthumb",
")",
";",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"sliderbg",
")",
";",
"if",
"(",
"this",
".",
"options",
".",
"displayValue",
")",
"{",
"this",
".",
"valueDisplay",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-SliderField-value'",
"}",
",",
"null",
",",
"String",
"(",
"this",
".",
"options",
".",
"minValue",
")",
")",
";",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"valueDisplay",
")",
";",
"}",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"null",
",",
"{",
"clear",
":",
"'both'",
"}",
")",
")",
";",
"this",
".",
"slider",
"=",
"YAHOO",
".",
"widget",
".",
"Slider",
".",
"getHorizSlider",
"(",
"this",
".",
"sliderbg",
",",
"this",
".",
"sliderthumb",
",",
"0",
",",
"100",
")",
";",
"}"
]
| render a slider widget | [
"render",
"a",
"slider",
"widget"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L7787-L7802 |
|
42,714 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
var val = Math.floor(this.options.minValue+(this.options.maxValue-this.options.minValue)*this.slider.getValue()/100);
return val;
} | javascript | function() {
var val = Math.floor(this.options.minValue+(this.options.maxValue-this.options.minValue)*this.slider.getValue()/100);
return val;
} | [
"function",
"(",
")",
"{",
"var",
"val",
"=",
"Math",
".",
"floor",
"(",
"this",
".",
"options",
".",
"minValue",
"+",
"(",
"this",
".",
"options",
".",
"maxValue",
"-",
"this",
".",
"options",
".",
"minValue",
")",
"*",
"this",
".",
"slider",
".",
"getValue",
"(",
")",
"/",
"100",
")",
";",
"return",
"val",
";",
"}"
]
| Get the value from the slider
@return {int} The integer value | [
"Get",
"the",
"value",
"from",
"the",
"slider"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L7845-L7848 |
|
42,715 | neyric/webhookit | public/javascripts/yui/tabview/tabview.js | function(attr) {
TabView.superclass.initAttributes.call(this, attr);
if (!attr.orientation) {
attr.orientation = 'top';
}
var el = this.get(ELEMENT);
if (!Dom.hasClass(el, this.CLASSNAME)) {
Dom.addClass(el, this.CLASSNAME);
}
/**
* The Tabs belonging to the TabView instance.
* @attribute tabs
* @type Array
*/
this.setAttributeConfig('tabs', {
value: [],
readOnly: true
});
/**
* The container of the tabView's label elements.
* @property _tabParent
* @private
* @type HTMLElement
*/
this._tabParent =
this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,
'ul' )[0] || this._createTabParent();
/**
* The container of the tabView's content elements.
* @property _contentParent
* @type HTMLElement
* @private
*/
this._contentParent =
this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,
'div')[0] || this._createContentParent();
/**
* How the Tabs should be oriented relative to the TabView.
* @attribute orientation
* @type String
* @default "top"
*/
this.setAttributeConfig('orientation', {
value: attr.orientation,
method: function(value) {
var current = this.get('orientation');
this.addClass('yui-navset-' + value);
if (current != value) {
this.removeClass('yui-navset-' + current);
}
if (value === 'bottom') {
this.appendChild(this._tabParent);
}
}
});
/**
* The index of the tab currently active.
* @attribute activeIndex
* @type Int
*/
this.setAttributeConfig(ACTIVE_INDEX, {
value: attr.activeIndex,
validator: function(value) {
var ret = true;
if (value && this.getTab(value).get('disabled')) { // cannot activate if disabled
ret = false;
}
return ret;
}
});
/**
* The tab currently active.
* @attribute activeTab
* @type YAHOO.widget.Tab
*/
this.setAttributeConfig(ACTIVE_TAB, {
value: attr.activeTab,
method: function(tab) {
var activeTab = this.get(ACTIVE_TAB);
if (tab) {
tab.set(ACTIVE, true);
}
if (activeTab && activeTab !== tab) {
activeTab.set(ACTIVE, false);
}
if (activeTab && tab !== activeTab) { // no transition if only 1
this.contentTransition(tab, activeTab);
} else if (tab) {
tab.set('contentVisible', true);
}
},
validator: function(value) {
var ret = true;
if (value && value.get('disabled')) { // cannot activate if disabled
ret = false;
}
return ret;
}
});
this.on('activeTabChange', this._onActiveTabChange);
this.on('activeIndexChange', this._onActiveIndexChange);
if ( this._tabParent ) {
this._initTabs();
}
// Due to delegation we add all DOM_EVENTS to the TabView container
// but IE will leak when unsupported events are added, so remove these
this.DOM_EVENTS.submit = false;
this.DOM_EVENTS.focus = false;
this.DOM_EVENTS.blur = false;
for (var type in this.DOM_EVENTS) {
if ( YAHOO.lang.hasOwnProperty(this.DOM_EVENTS, type) ) {
this.addListener.call(this, type, this.DOMEventHandler);
}
}
} | javascript | function(attr) {
TabView.superclass.initAttributes.call(this, attr);
if (!attr.orientation) {
attr.orientation = 'top';
}
var el = this.get(ELEMENT);
if (!Dom.hasClass(el, this.CLASSNAME)) {
Dom.addClass(el, this.CLASSNAME);
}
/**
* The Tabs belonging to the TabView instance.
* @attribute tabs
* @type Array
*/
this.setAttributeConfig('tabs', {
value: [],
readOnly: true
});
/**
* The container of the tabView's label elements.
* @property _tabParent
* @private
* @type HTMLElement
*/
this._tabParent =
this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,
'ul' )[0] || this._createTabParent();
/**
* The container of the tabView's content elements.
* @property _contentParent
* @type HTMLElement
* @private
*/
this._contentParent =
this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,
'div')[0] || this._createContentParent();
/**
* How the Tabs should be oriented relative to the TabView.
* @attribute orientation
* @type String
* @default "top"
*/
this.setAttributeConfig('orientation', {
value: attr.orientation,
method: function(value) {
var current = this.get('orientation');
this.addClass('yui-navset-' + value);
if (current != value) {
this.removeClass('yui-navset-' + current);
}
if (value === 'bottom') {
this.appendChild(this._tabParent);
}
}
});
/**
* The index of the tab currently active.
* @attribute activeIndex
* @type Int
*/
this.setAttributeConfig(ACTIVE_INDEX, {
value: attr.activeIndex,
validator: function(value) {
var ret = true;
if (value && this.getTab(value).get('disabled')) { // cannot activate if disabled
ret = false;
}
return ret;
}
});
/**
* The tab currently active.
* @attribute activeTab
* @type YAHOO.widget.Tab
*/
this.setAttributeConfig(ACTIVE_TAB, {
value: attr.activeTab,
method: function(tab) {
var activeTab = this.get(ACTIVE_TAB);
if (tab) {
tab.set(ACTIVE, true);
}
if (activeTab && activeTab !== tab) {
activeTab.set(ACTIVE, false);
}
if (activeTab && tab !== activeTab) { // no transition if only 1
this.contentTransition(tab, activeTab);
} else if (tab) {
tab.set('contentVisible', true);
}
},
validator: function(value) {
var ret = true;
if (value && value.get('disabled')) { // cannot activate if disabled
ret = false;
}
return ret;
}
});
this.on('activeTabChange', this._onActiveTabChange);
this.on('activeIndexChange', this._onActiveIndexChange);
if ( this._tabParent ) {
this._initTabs();
}
// Due to delegation we add all DOM_EVENTS to the TabView container
// but IE will leak when unsupported events are added, so remove these
this.DOM_EVENTS.submit = false;
this.DOM_EVENTS.focus = false;
this.DOM_EVENTS.blur = false;
for (var type in this.DOM_EVENTS) {
if ( YAHOO.lang.hasOwnProperty(this.DOM_EVENTS, type) ) {
this.addListener.call(this, type, this.DOMEventHandler);
}
}
} | [
"function",
"(",
"attr",
")",
"{",
"TabView",
".",
"superclass",
".",
"initAttributes",
".",
"call",
"(",
"this",
",",
"attr",
")",
";",
"if",
"(",
"!",
"attr",
".",
"orientation",
")",
"{",
"attr",
".",
"orientation",
"=",
"'top'",
";",
"}",
"var",
"el",
"=",
"this",
".",
"get",
"(",
"ELEMENT",
")",
";",
"if",
"(",
"!",
"Dom",
".",
"hasClass",
"(",
"el",
",",
"this",
".",
"CLASSNAME",
")",
")",
"{",
"Dom",
".",
"addClass",
"(",
"el",
",",
"this",
".",
"CLASSNAME",
")",
";",
"}",
"/**\n * The Tabs belonging to the TabView instance.\n * @attribute tabs\n * @type Array\n */",
"this",
".",
"setAttributeConfig",
"(",
"'tabs'",
",",
"{",
"value",
":",
"[",
"]",
",",
"readOnly",
":",
"true",
"}",
")",
";",
"/**\n * The container of the tabView's label elements.\n * @property _tabParent\n * @private\n * @type HTMLElement\n */",
"this",
".",
"_tabParent",
"=",
"this",
".",
"getElementsByClassName",
"(",
"this",
".",
"TAB_PARENT_CLASSNAME",
",",
"'ul'",
")",
"[",
"0",
"]",
"||",
"this",
".",
"_createTabParent",
"(",
")",
";",
"/**\n * The container of the tabView's content elements.\n * @property _contentParent\n * @type HTMLElement\n * @private\n */",
"this",
".",
"_contentParent",
"=",
"this",
".",
"getElementsByClassName",
"(",
"this",
".",
"CONTENT_PARENT_CLASSNAME",
",",
"'div'",
")",
"[",
"0",
"]",
"||",
"this",
".",
"_createContentParent",
"(",
")",
";",
"/**\n * How the Tabs should be oriented relative to the TabView.\n * @attribute orientation\n * @type String\n * @default \"top\"\n */",
"this",
".",
"setAttributeConfig",
"(",
"'orientation'",
",",
"{",
"value",
":",
"attr",
".",
"orientation",
",",
"method",
":",
"function",
"(",
"value",
")",
"{",
"var",
"current",
"=",
"this",
".",
"get",
"(",
"'orientation'",
")",
";",
"this",
".",
"addClass",
"(",
"'yui-navset-'",
"+",
"value",
")",
";",
"if",
"(",
"current",
"!=",
"value",
")",
"{",
"this",
".",
"removeClass",
"(",
"'yui-navset-'",
"+",
"current",
")",
";",
"}",
"if",
"(",
"value",
"===",
"'bottom'",
")",
"{",
"this",
".",
"appendChild",
"(",
"this",
".",
"_tabParent",
")",
";",
"}",
"}",
"}",
")",
";",
"/**\n * The index of the tab currently active.\n * @attribute activeIndex\n * @type Int\n */",
"this",
".",
"setAttributeConfig",
"(",
"ACTIVE_INDEX",
",",
"{",
"value",
":",
"attr",
".",
"activeIndex",
",",
"validator",
":",
"function",
"(",
"value",
")",
"{",
"var",
"ret",
"=",
"true",
";",
"if",
"(",
"value",
"&&",
"this",
".",
"getTab",
"(",
"value",
")",
".",
"get",
"(",
"'disabled'",
")",
")",
"{",
"// cannot activate if disabled",
"ret",
"=",
"false",
";",
"}",
"return",
"ret",
";",
"}",
"}",
")",
";",
"/**\n * The tab currently active.\n * @attribute activeTab\n * @type YAHOO.widget.Tab\n */",
"this",
".",
"setAttributeConfig",
"(",
"ACTIVE_TAB",
",",
"{",
"value",
":",
"attr",
".",
"activeTab",
",",
"method",
":",
"function",
"(",
"tab",
")",
"{",
"var",
"activeTab",
"=",
"this",
".",
"get",
"(",
"ACTIVE_TAB",
")",
";",
"if",
"(",
"tab",
")",
"{",
"tab",
".",
"set",
"(",
"ACTIVE",
",",
"true",
")",
";",
"}",
"if",
"(",
"activeTab",
"&&",
"activeTab",
"!==",
"tab",
")",
"{",
"activeTab",
".",
"set",
"(",
"ACTIVE",
",",
"false",
")",
";",
"}",
"if",
"(",
"activeTab",
"&&",
"tab",
"!==",
"activeTab",
")",
"{",
"// no transition if only 1",
"this",
".",
"contentTransition",
"(",
"tab",
",",
"activeTab",
")",
";",
"}",
"else",
"if",
"(",
"tab",
")",
"{",
"tab",
".",
"set",
"(",
"'contentVisible'",
",",
"true",
")",
";",
"}",
"}",
",",
"validator",
":",
"function",
"(",
"value",
")",
"{",
"var",
"ret",
"=",
"true",
";",
"if",
"(",
"value",
"&&",
"value",
".",
"get",
"(",
"'disabled'",
")",
")",
"{",
"// cannot activate if disabled",
"ret",
"=",
"false",
";",
"}",
"return",
"ret",
";",
"}",
"}",
")",
";",
"this",
".",
"on",
"(",
"'activeTabChange'",
",",
"this",
".",
"_onActiveTabChange",
")",
";",
"this",
".",
"on",
"(",
"'activeIndexChange'",
",",
"this",
".",
"_onActiveIndexChange",
")",
";",
"if",
"(",
"this",
".",
"_tabParent",
")",
"{",
"this",
".",
"_initTabs",
"(",
")",
";",
"}",
"// Due to delegation we add all DOM_EVENTS to the TabView container",
"// but IE will leak when unsupported events are added, so remove these",
"this",
".",
"DOM_EVENTS",
".",
"submit",
"=",
"false",
";",
"this",
".",
"DOM_EVENTS",
".",
"focus",
"=",
"false",
";",
"this",
".",
"DOM_EVENTS",
".",
"blur",
"=",
"false",
";",
"for",
"(",
"var",
"type",
"in",
"this",
".",
"DOM_EVENTS",
")",
"{",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"hasOwnProperty",
"(",
"this",
".",
"DOM_EVENTS",
",",
"type",
")",
")",
"{",
"this",
".",
"addListener",
".",
"call",
"(",
"this",
",",
"type",
",",
"this",
".",
"DOMEventHandler",
")",
";",
"}",
"}",
"}"
]
| setAttributeConfigs TabView specific properties.
@method initAttributes
@param {Object} attr Hash of initial attributes | [
"setAttributeConfigs",
"TabView",
"specific",
"properties",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/tabview/tabview.js#L260-L392 |
|
42,716 | neyric/webhookit | public/javascripts/yui/animation/animation-debug.js | function() {
var el = this.getEl() || {};
var id = el.id || el.tagName;
return (this.constructor.NAME + ': ' + id);
} | javascript | function() {
var el = this.getEl() || {};
var id = el.id || el.tagName;
return (this.constructor.NAME + ': ' + id);
} | [
"function",
"(",
")",
"{",
"var",
"el",
"=",
"this",
".",
"getEl",
"(",
")",
"||",
"{",
"}",
";",
"var",
"id",
"=",
"el",
".",
"id",
"||",
"el",
".",
"tagName",
";",
"return",
"(",
"this",
".",
"constructor",
".",
"NAME",
"+",
"': '",
"+",
"id",
")",
";",
"}"
]
| Provides a readable name for the Anim instance.
@method toString
@return {String} | [
"Provides",
"a",
"readable",
"name",
"for",
"the",
"Anim",
"instance",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/animation/animation-debug.js#L59-L63 |
|
42,717 | neyric/webhookit | public/javascripts/yui/animation/animation-debug.js | function(attr, val, unit) {
var el = this.getEl();
if ( this.patterns.noNegatives.test(attr) ) {
val = (val > 0) ? val : 0;
}
if (attr in el && !('style' in el && attr in el.style)) {
el[attr] = val;
} else {
Y.Dom.setStyle(el, attr, val + unit);
}
} | javascript | function(attr, val, unit) {
var el = this.getEl();
if ( this.patterns.noNegatives.test(attr) ) {
val = (val > 0) ? val : 0;
}
if (attr in el && !('style' in el && attr in el.style)) {
el[attr] = val;
} else {
Y.Dom.setStyle(el, attr, val + unit);
}
} | [
"function",
"(",
"attr",
",",
"val",
",",
"unit",
")",
"{",
"var",
"el",
"=",
"this",
".",
"getEl",
"(",
")",
";",
"if",
"(",
"this",
".",
"patterns",
".",
"noNegatives",
".",
"test",
"(",
"attr",
")",
")",
"{",
"val",
"=",
"(",
"val",
">",
"0",
")",
"?",
"val",
":",
"0",
";",
"}",
"if",
"(",
"attr",
"in",
"el",
"&&",
"!",
"(",
"'style'",
"in",
"el",
"&&",
"attr",
"in",
"el",
".",
"style",
")",
")",
"{",
"el",
"[",
"attr",
"]",
"=",
"val",
";",
"}",
"else",
"{",
"Y",
".",
"Dom",
".",
"setStyle",
"(",
"el",
",",
"attr",
",",
"val",
"+",
"unit",
")",
";",
"}",
"}"
]
| Applies a value to an attribute.
@method setAttribute
@param {String} attr The name of the attribute.
@param {Number} val The value to be applied to the attribute.
@param {String} unit The unit ('px', '%', etc.) of the value. | [
"Applies",
"a",
"value",
"to",
"an",
"attribute",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/animation/animation-debug.js#L91-L102 |
|
42,718 | neyric/webhookit | public/javascripts/yui/animation/animation-debug.js | function(attr) {
var el = this.getEl();
var val = Y.Dom.getStyle(el, attr);
if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) {
return parseFloat(val);
}
var a = this.patterns.offsetAttribute.exec(attr) || [];
var pos = !!( a[3] ); // top or left
var box = !!( a[2] ); // width or height
if ('style' in el) {
// use offsets for width/height and abs pos top/left
if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) {
val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
} else { // default to zero for other 'auto'
val = 0;
}
} else if (attr in el) {
val = el[attr];
}
return val;
} | javascript | function(attr) {
var el = this.getEl();
var val = Y.Dom.getStyle(el, attr);
if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) {
return parseFloat(val);
}
var a = this.patterns.offsetAttribute.exec(attr) || [];
var pos = !!( a[3] ); // top or left
var box = !!( a[2] ); // width or height
if ('style' in el) {
// use offsets for width/height and abs pos top/left
if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) {
val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
} else { // default to zero for other 'auto'
val = 0;
}
} else if (attr in el) {
val = el[attr];
}
return val;
} | [
"function",
"(",
"attr",
")",
"{",
"var",
"el",
"=",
"this",
".",
"getEl",
"(",
")",
";",
"var",
"val",
"=",
"Y",
".",
"Dom",
".",
"getStyle",
"(",
"el",
",",
"attr",
")",
";",
"if",
"(",
"val",
"!==",
"'auto'",
"&&",
"!",
"this",
".",
"patterns",
".",
"offsetUnit",
".",
"test",
"(",
"val",
")",
")",
"{",
"return",
"parseFloat",
"(",
"val",
")",
";",
"}",
"var",
"a",
"=",
"this",
".",
"patterns",
".",
"offsetAttribute",
".",
"exec",
"(",
"attr",
")",
"||",
"[",
"]",
";",
"var",
"pos",
"=",
"!",
"!",
"(",
"a",
"[",
"3",
"]",
")",
";",
"// top or left",
"var",
"box",
"=",
"!",
"!",
"(",
"a",
"[",
"2",
"]",
")",
";",
"// width or height",
"if",
"(",
"'style'",
"in",
"el",
")",
"{",
"// use offsets for width/height and abs pos top/left",
"if",
"(",
"box",
"||",
"(",
"Y",
".",
"Dom",
".",
"getStyle",
"(",
"el",
",",
"'position'",
")",
"==",
"'absolute'",
"&&",
"pos",
")",
")",
"{",
"val",
"=",
"el",
"[",
"'offset'",
"+",
"a",
"[",
"0",
"]",
".",
"charAt",
"(",
"0",
")",
".",
"toUpperCase",
"(",
")",
"+",
"a",
"[",
"0",
"]",
".",
"substr",
"(",
"1",
")",
"]",
";",
"}",
"else",
"{",
"// default to zero for other 'auto'",
"val",
"=",
"0",
";",
"}",
"}",
"else",
"if",
"(",
"attr",
"in",
"el",
")",
"{",
"val",
"=",
"el",
"[",
"attr",
"]",
";",
"}",
"return",
"val",
";",
"}"
]
| Returns current value of the attribute.
@method getAttribute
@param {String} attr The name of the attribute.
@return {Number} val The current value of the attribute. | [
"Returns",
"current",
"value",
"of",
"the",
"attribute",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/animation/animation-debug.js#L110-L134 |
|
42,719 | neyric/webhookit | public/javascripts/yui/animation/animation-debug.js | function(attr) {
var start;
var end;
var attributes = this.attributes;
this.runtimeAttributes[attr] = {};
var isset = function(prop) {
return (typeof prop !== 'undefined');
};
if ( !isset(attributes[attr]['to']) && !isset(attributes[attr]['by']) ) {
return false; // note return; nothing to animate to
}
start = ( isset(attributes[attr]['from']) ) ? attributes[attr]['from'] : this.getAttribute(attr);
// To beats by, per SMIL 2.1 spec
if ( isset(attributes[attr]['to']) ) {
end = attributes[attr]['to'];
} else if ( isset(attributes[attr]['by']) ) {
if (start.constructor == Array) {
end = [];
for (var i = 0, len = start.length; i < len; ++i) {
end[i] = start[i] + attributes[attr]['by'][i] * 1; // times 1 to cast "by"
}
} else {
end = start + attributes[attr]['by'] * 1;
}
}
this.runtimeAttributes[attr].start = start;
this.runtimeAttributes[attr].end = end;
// set units if needed
this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ?
attributes[attr]['unit'] : this.getDefaultUnit(attr);
return true;
} | javascript | function(attr) {
var start;
var end;
var attributes = this.attributes;
this.runtimeAttributes[attr] = {};
var isset = function(prop) {
return (typeof prop !== 'undefined');
};
if ( !isset(attributes[attr]['to']) && !isset(attributes[attr]['by']) ) {
return false; // note return; nothing to animate to
}
start = ( isset(attributes[attr]['from']) ) ? attributes[attr]['from'] : this.getAttribute(attr);
// To beats by, per SMIL 2.1 spec
if ( isset(attributes[attr]['to']) ) {
end = attributes[attr]['to'];
} else if ( isset(attributes[attr]['by']) ) {
if (start.constructor == Array) {
end = [];
for (var i = 0, len = start.length; i < len; ++i) {
end[i] = start[i] + attributes[attr]['by'][i] * 1; // times 1 to cast "by"
}
} else {
end = start + attributes[attr]['by'] * 1;
}
}
this.runtimeAttributes[attr].start = start;
this.runtimeAttributes[attr].end = end;
// set units if needed
this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ?
attributes[attr]['unit'] : this.getDefaultUnit(attr);
return true;
} | [
"function",
"(",
"attr",
")",
"{",
"var",
"start",
";",
"var",
"end",
";",
"var",
"attributes",
"=",
"this",
".",
"attributes",
";",
"this",
".",
"runtimeAttributes",
"[",
"attr",
"]",
"=",
"{",
"}",
";",
"var",
"isset",
"=",
"function",
"(",
"prop",
")",
"{",
"return",
"(",
"typeof",
"prop",
"!==",
"'undefined'",
")",
";",
"}",
";",
"if",
"(",
"!",
"isset",
"(",
"attributes",
"[",
"attr",
"]",
"[",
"'to'",
"]",
")",
"&&",
"!",
"isset",
"(",
"attributes",
"[",
"attr",
"]",
"[",
"'by'",
"]",
")",
")",
"{",
"return",
"false",
";",
"// note return; nothing to animate to",
"}",
"start",
"=",
"(",
"isset",
"(",
"attributes",
"[",
"attr",
"]",
"[",
"'from'",
"]",
")",
")",
"?",
"attributes",
"[",
"attr",
"]",
"[",
"'from'",
"]",
":",
"this",
".",
"getAttribute",
"(",
"attr",
")",
";",
"// To beats by, per SMIL 2.1 spec",
"if",
"(",
"isset",
"(",
"attributes",
"[",
"attr",
"]",
"[",
"'to'",
"]",
")",
")",
"{",
"end",
"=",
"attributes",
"[",
"attr",
"]",
"[",
"'to'",
"]",
";",
"}",
"else",
"if",
"(",
"isset",
"(",
"attributes",
"[",
"attr",
"]",
"[",
"'by'",
"]",
")",
")",
"{",
"if",
"(",
"start",
".",
"constructor",
"==",
"Array",
")",
"{",
"end",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"start",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"end",
"[",
"i",
"]",
"=",
"start",
"[",
"i",
"]",
"+",
"attributes",
"[",
"attr",
"]",
"[",
"'by'",
"]",
"[",
"i",
"]",
"*",
"1",
";",
"// times 1 to cast \"by\" ",
"}",
"}",
"else",
"{",
"end",
"=",
"start",
"+",
"attributes",
"[",
"attr",
"]",
"[",
"'by'",
"]",
"*",
"1",
";",
"}",
"}",
"this",
".",
"runtimeAttributes",
"[",
"attr",
"]",
".",
"start",
"=",
"start",
";",
"this",
".",
"runtimeAttributes",
"[",
"attr",
"]",
".",
"end",
"=",
"end",
";",
"// set units if needed",
"this",
".",
"runtimeAttributes",
"[",
"attr",
"]",
".",
"unit",
"=",
"(",
"isset",
"(",
"attributes",
"[",
"attr",
"]",
".",
"unit",
")",
")",
"?",
"attributes",
"[",
"attr",
"]",
"[",
"'unit'",
"]",
":",
"this",
".",
"getDefaultUnit",
"(",
"attr",
")",
";",
"return",
"true",
";",
"}"
]
| Sets the actual values to be used during the animation. Should only be needed for subclass use.
@method setRuntimeAttribute
@param {Object} attr The attribute object
@private | [
"Sets",
"the",
"actual",
"values",
"to",
"be",
"used",
"during",
"the",
"animation",
".",
"Should",
"only",
"be",
"needed",
"for",
"subclass",
"use",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/animation/animation-debug.js#L156-L194 |
|
42,720 | neyric/webhookit | public/javascripts/yui/animation/animation-debug.js | function(tween) {
var frames = tween.totalFrames;
var frame = tween.currentFrame;
var expected = (tween.currentFrame * tween.duration * 1000 / tween.totalFrames);
var elapsed = (new Date() - tween.getStartTime());
var tweak = 0;
if (elapsed < tween.duration * 1000) { // check if falling behind
tweak = Math.round((elapsed / expected - 1) * tween.currentFrame);
} else { // went over duration, so jump to end
tweak = frames - (frame + 1);
}
if (tweak > 0 && isFinite(tweak)) { // adjust if needed
if (tween.currentFrame + tweak >= frames) {// dont go past last frame
tweak = frames - (frame + 1);
}
tween.currentFrame += tweak;
}
} | javascript | function(tween) {
var frames = tween.totalFrames;
var frame = tween.currentFrame;
var expected = (tween.currentFrame * tween.duration * 1000 / tween.totalFrames);
var elapsed = (new Date() - tween.getStartTime());
var tweak = 0;
if (elapsed < tween.duration * 1000) { // check if falling behind
tweak = Math.round((elapsed / expected - 1) * tween.currentFrame);
} else { // went over duration, so jump to end
tweak = frames - (frame + 1);
}
if (tweak > 0 && isFinite(tweak)) { // adjust if needed
if (tween.currentFrame + tweak >= frames) {// dont go past last frame
tweak = frames - (frame + 1);
}
tween.currentFrame += tweak;
}
} | [
"function",
"(",
"tween",
")",
"{",
"var",
"frames",
"=",
"tween",
".",
"totalFrames",
";",
"var",
"frame",
"=",
"tween",
".",
"currentFrame",
";",
"var",
"expected",
"=",
"(",
"tween",
".",
"currentFrame",
"*",
"tween",
".",
"duration",
"*",
"1000",
"/",
"tween",
".",
"totalFrames",
")",
";",
"var",
"elapsed",
"=",
"(",
"new",
"Date",
"(",
")",
"-",
"tween",
".",
"getStartTime",
"(",
")",
")",
";",
"var",
"tweak",
"=",
"0",
";",
"if",
"(",
"elapsed",
"<",
"tween",
".",
"duration",
"*",
"1000",
")",
"{",
"// check if falling behind",
"tweak",
"=",
"Math",
".",
"round",
"(",
"(",
"elapsed",
"/",
"expected",
"-",
"1",
")",
"*",
"tween",
".",
"currentFrame",
")",
";",
"}",
"else",
"{",
"// went over duration, so jump to end",
"tweak",
"=",
"frames",
"-",
"(",
"frame",
"+",
"1",
")",
";",
"}",
"if",
"(",
"tweak",
">",
"0",
"&&",
"isFinite",
"(",
"tweak",
")",
")",
"{",
"// adjust if needed",
"if",
"(",
"tween",
".",
"currentFrame",
"+",
"tweak",
">=",
"frames",
")",
"{",
"// dont go past last frame",
"tweak",
"=",
"frames",
"-",
"(",
"frame",
"+",
"1",
")",
";",
"}",
"tween",
".",
"currentFrame",
"+=",
"tweak",
";",
"}",
"}"
]
| On the fly frame correction to keep animation on time.
@method correctFrame
@private
@param {Object} tween The Anim instance being corrected. | [
"On",
"the",
"fly",
"frame",
"correction",
"to",
"keep",
"animation",
"on",
"time",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/animation/animation-debug.js#L635-L654 |
|
42,721 | neyric/webhookit | public/javascripts/yui/animation/animation-debug.js | function (t, b, c, d) {
return c - YAHOO.util.Easing.bounceOut(d-t, 0, c, d) + b;
} | javascript | function (t, b, c, d) {
return c - YAHOO.util.Easing.bounceOut(d-t, 0, c, d) + b;
} | [
"function",
"(",
"t",
",",
"b",
",",
"c",
",",
"d",
")",
"{",
"return",
"c",
"-",
"YAHOO",
".",
"util",
".",
"Easing",
".",
"bounceOut",
"(",
"d",
"-",
"t",
",",
"0",
",",
"c",
",",
"d",
")",
"+",
"b",
";",
"}"
]
| Bounce off of start.
@method bounceIn
@param {Number} t Time value used to compute current value
@param {Number} b Starting value
@param {Number} c Delta between start and end values
@param {Number} d Total length of animation
@return {Number} The computed value for the current animation frame | [
"Bounce",
"off",
"of",
"start",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/animation/animation-debug.js#L1124-L1126 |
|
42,722 | neyric/webhookit | public/javascripts/yui/animation/animation-debug.js | function (t, b, c, d) {
if (t < d/2) {
return YAHOO.util.Easing.bounceIn(t*2, 0, c, d) * .5 + b;
}
return YAHOO.util.Easing.bounceOut(t*2-d, 0, c, d) * .5 + c*.5 + b;
} | javascript | function (t, b, c, d) {
if (t < d/2) {
return YAHOO.util.Easing.bounceIn(t*2, 0, c, d) * .5 + b;
}
return YAHOO.util.Easing.bounceOut(t*2-d, 0, c, d) * .5 + c*.5 + b;
} | [
"function",
"(",
"t",
",",
"b",
",",
"c",
",",
"d",
")",
"{",
"if",
"(",
"t",
"<",
"d",
"/",
"2",
")",
"{",
"return",
"YAHOO",
".",
"util",
".",
"Easing",
".",
"bounceIn",
"(",
"t",
"*",
"2",
",",
"0",
",",
"c",
",",
"d",
")",
"*",
".5",
"+",
"b",
";",
"}",
"return",
"YAHOO",
".",
"util",
".",
"Easing",
".",
"bounceOut",
"(",
"t",
"*",
"2",
"-",
"d",
",",
"0",
",",
"c",
",",
"d",
")",
"*",
".5",
"+",
"c",
"*",
".5",
"+",
"b",
";",
"}"
]
| Bounces off start and end.
@method bounceBoth
@param {Number} t Time value used to compute current value
@param {Number} b Starting value
@param {Number} c Delta between start and end values
@param {Number} d Total length of animation
@return {Number} The computed value for the current animation frame | [
"Bounces",
"off",
"start",
"and",
"end",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/animation/animation-debug.js#L1157-L1162 |
|
42,723 | neyric/webhookit | public/javascripts/yui/profilerviewer/profilerviewer.js | function(n) {
var a = (n === Math.floor(n)) ? n : (Math.round(n*1000))/1000;
return (a + " " + YAHOO.widget.ProfilerViewer.STRINGS.millisecondsAbbrev);
} | javascript | function(n) {
var a = (n === Math.floor(n)) ? n : (Math.round(n*1000))/1000;
return (a + " " + YAHOO.widget.ProfilerViewer.STRINGS.millisecondsAbbrev);
} | [
"function",
"(",
"n",
")",
"{",
"var",
"a",
"=",
"(",
"n",
"===",
"Math",
".",
"floor",
"(",
"n",
")",
")",
"?",
"n",
":",
"(",
"Math",
".",
"round",
"(",
"n",
"*",
"1000",
")",
")",
"/",
"1000",
";",
"return",
"(",
"a",
"+",
"\" \"",
"+",
"YAHOO",
".",
"widget",
".",
"ProfilerViewer",
".",
"STRINGS",
".",
"millisecondsAbbrev",
")",
";",
"}"
]
| Function used to format numbers in milliseconds
for chart; must be publicly accessible, per Charts spec.
@static
@property timeAxisLabelFunction
@type function
@private | [
"Function",
"used",
"to",
"format",
"numbers",
"in",
"milliseconds",
"for",
"chart",
";",
"must",
"be",
"publicly",
"accessible",
"per",
"Charts",
"spec",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profilerviewer/profilerviewer.js#L169-L172 |
|
42,724 | neyric/webhookit | public/javascripts/yui/profilerviewer/profilerviewer.js | function(n) {
var a = (n === Math.floor(n)) ? n : (Math.round(n*100))/100;
return (a + "%");
} | javascript | function(n) {
var a = (n === Math.floor(n)) ? n : (Math.round(n*100))/100;
return (a + "%");
} | [
"function",
"(",
"n",
")",
"{",
"var",
"a",
"=",
"(",
"n",
"===",
"Math",
".",
"floor",
"(",
"n",
")",
")",
"?",
"n",
":",
"(",
"Math",
".",
"round",
"(",
"n",
"*",
"100",
")",
")",
"/",
"100",
";",
"return",
"(",
"a",
"+",
"\"%\"",
")",
";",
"}"
]
| Function used to format percent numbers for chart; must
be publicly accessible, per Charts spec.
@static
@property percentAxisLabelFunction
@type function
@private | [
"Function",
"used",
"to",
"format",
"percent",
"numbers",
"for",
"chart",
";",
"must",
"be",
"publicly",
"accessible",
"per",
"Charts",
"spec",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profilerviewer/profilerviewer.js#L182-L185 |
|
42,725 | neyric/webhookit | public/javascripts/yui/profilerviewer/profilerviewer.js | function(arr){
var ct = 0;
for(var i = 0; i < arr.length; ct+=arr[i++]){}
return ct;
} | javascript | function(arr){
var ct = 0;
for(var i = 0; i < arr.length; ct+=arr[i++]){}
return ct;
} | [
"function",
"(",
"arr",
")",
"{",
"var",
"ct",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"arr",
".",
"length",
";",
"ct",
"+=",
"arr",
"[",
"i",
"++",
"]",
")",
"{",
"}",
"return",
"ct",
";",
"}"
]
| Utility function for array sums.
@method _arraySum
@private | [
"Utility",
"function",
"for",
"array",
"sums",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profilerviewer/profilerviewer.js#L599-L603 |
|
42,726 | neyric/webhookit | public/javascripts/yui/profilerviewer/profilerviewer.js | function(elCell, oRecord, oColumn, oData) {
var a = (oData === Math.floor(oData)) ? oData : (Math.round(oData*1000))/1000;
elCell.innerHTML = a + " " + PV.STRINGS.millisecondsAbbrev;
} | javascript | function(elCell, oRecord, oColumn, oData) {
var a = (oData === Math.floor(oData)) ? oData : (Math.round(oData*1000))/1000;
elCell.innerHTML = a + " " + PV.STRINGS.millisecondsAbbrev;
} | [
"function",
"(",
"elCell",
",",
"oRecord",
",",
"oColumn",
",",
"oData",
")",
"{",
"var",
"a",
"=",
"(",
"oData",
"===",
"Math",
".",
"floor",
"(",
"oData",
")",
")",
"?",
"oData",
":",
"(",
"Math",
".",
"round",
"(",
"oData",
"*",
"1000",
")",
")",
"/",
"1000",
";",
"elCell",
".",
"innerHTML",
"=",
"a",
"+",
"\" \"",
"+",
"PV",
".",
"STRINGS",
".",
"millisecondsAbbrev",
";",
"}"
]
| Set up the DataTable. | [
"Set",
"up",
"the",
"DataTable",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profilerviewer/profilerviewer.js#L680-L683 |
|
42,727 | neyric/webhookit | public/javascripts/inputex/js/rpc/yql.js | function(yql, callback) {
var ud = 'yqlexecuteconsole'+(inputEx.YQL.query_index)++,
API = 'http://query.yahooapis.com/v1/public/yql?q=',
url = API + window.encodeURIComponent(yql) + '&format=json&diagnostics=true&callback=' + ud;
window[ud]= function(o){ callback && callback(o); };
document.body.appendChild((function(){
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = url;
return s;
})());
} | javascript | function(yql, callback) {
var ud = 'yqlexecuteconsole'+(inputEx.YQL.query_index)++,
API = 'http://query.yahooapis.com/v1/public/yql?q=',
url = API + window.encodeURIComponent(yql) + '&format=json&diagnostics=true&callback=' + ud;
window[ud]= function(o){ callback && callback(o); };
document.body.appendChild((function(){
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = url;
return s;
})());
} | [
"function",
"(",
"yql",
",",
"callback",
")",
"{",
"var",
"ud",
"=",
"'yqlexecuteconsole'",
"+",
"(",
"inputEx",
".",
"YQL",
".",
"query_index",
")",
"++",
",",
"API",
"=",
"'http://query.yahooapis.com/v1/public/yql?q='",
",",
"url",
"=",
"API",
"+",
"window",
".",
"encodeURIComponent",
"(",
"yql",
")",
"+",
"'&format=json&diagnostics=true&callback='",
"+",
"ud",
";",
"window",
"[",
"ud",
"]",
"=",
"function",
"(",
"o",
")",
"{",
"callback",
"&&",
"callback",
"(",
"o",
")",
";",
"}",
";",
"document",
".",
"body",
".",
"appendChild",
"(",
"(",
"function",
"(",
")",
"{",
"var",
"s",
"=",
"document",
".",
"createElement",
"(",
"'script'",
")",
";",
"s",
".",
"type",
"=",
"'text/javascript'",
";",
"s",
".",
"src",
"=",
"url",
";",
"return",
"s",
";",
"}",
")",
"(",
")",
")",
";",
"}"
]
| Generate the jsonp request to YQL
@param {String} yql YQL query string
@param {Function} callback Callback function | [
"Generate",
"the",
"jsonp",
"request",
"to",
"YQL"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/rpc/yql.js#L25-L36 |
|
42,728 | neyric/webhookit | public/javascripts/inputex/js/rpc/yql.js | function(codeUrl, callback) {
var url = ("http://javascript.neyric.com/yql/js.php?url="+window.encodeURIComponent(codeUrl)).replace(new RegExp("'","g"),"\\'");
var yql = "use '"+url+"' as yqlexconsole; select * from yqlexconsole;";
inputEx.YQL.query(yql,callback);
} | javascript | function(codeUrl, callback) {
var url = ("http://javascript.neyric.com/yql/js.php?url="+window.encodeURIComponent(codeUrl)).replace(new RegExp("'","g"),"\\'");
var yql = "use '"+url+"' as yqlexconsole; select * from yqlexconsole;";
inputEx.YQL.query(yql,callback);
} | [
"function",
"(",
"codeUrl",
",",
"callback",
")",
"{",
"var",
"url",
"=",
"(",
"\"http://javascript.neyric.com/yql/js.php?url=\"",
"+",
"window",
".",
"encodeURIComponent",
"(",
"codeUrl",
")",
")",
".",
"replace",
"(",
"new",
"RegExp",
"(",
"\"'\"",
",",
"\"g\"",
")",
",",
"\"\\\\'\"",
")",
";",
"var",
"yql",
"=",
"\"use '\"",
"+",
"url",
"+",
"\"' as yqlexconsole; select * from yqlexconsole;\"",
";",
"inputEx",
".",
"YQL",
".",
"query",
"(",
"yql",
",",
"callback",
")",
";",
"}"
]
| Dynamically build a XML from a URL and generate a dummy request for YQL
@param {String} codeUrl Url to a YQL-execute javascript file
@param {Function} callback Callback function | [
"Dynamically",
"build",
"a",
"XML",
"from",
"a",
"URL",
"and",
"generate",
"a",
"dummy",
"request",
"for",
"YQL"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/rpc/yql.js#L54-L58 |
|
42,729 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(r, s) {
if (!s||!r) {
throw new Error("Augment failed, verify dependencies.");
}
//var a=[].concat(arguments);
var a=[r.prototype,s.prototype], i;
for (i=2;i<arguments.length;i=i+1) {
a.push(arguments[i]);
}
L.augmentObject.apply(this, a);
} | javascript | function(r, s) {
if (!s||!r) {
throw new Error("Augment failed, verify dependencies.");
}
//var a=[].concat(arguments);
var a=[r.prototype,s.prototype], i;
for (i=2;i<arguments.length;i=i+1) {
a.push(arguments[i]);
}
L.augmentObject.apply(this, a);
} | [
"function",
"(",
"r",
",",
"s",
")",
"{",
"if",
"(",
"!",
"s",
"||",
"!",
"r",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Augment failed, verify dependencies.\"",
")",
";",
"}",
"//var a=[].concat(arguments);",
"var",
"a",
"=",
"[",
"r",
".",
"prototype",
",",
"s",
".",
"prototype",
"]",
",",
"i",
";",
"for",
"(",
"i",
"=",
"2",
";",
"i",
"<",
"arguments",
".",
"length",
";",
"i",
"=",
"i",
"+",
"1",
")",
"{",
"a",
".",
"push",
"(",
"arguments",
"[",
"i",
"]",
")",
";",
"}",
"L",
".",
"augmentObject",
".",
"apply",
"(",
"this",
",",
"a",
")",
";",
"}"
]
| Same as YAHOO.lang.augmentObject, except it only applies prototype properties
@see YAHOO.lang.augmentObject
@method augmentProto
@static
@param {Function} r the object to receive the augmentation
@param {Function} s the object that supplies the properties to augment
@param {String*|boolean} arguments zero or more properties methods
to augment the receiver with. If none specified, everything
in the supplier will be used unless it would overwrite an existing
property in the receiver. if true is specified as the third
parameter, all properties will be applied and will overwrite an
existing property in the receiver | [
"Same",
"as",
"YAHOO",
".",
"lang",
".",
"augmentObject",
"except",
"it",
"only",
"applies",
"prototype",
"properties"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L705-L715 |
|
42,730 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(o, d) {
var i,len,s=[],OBJ="{...}",FUN="f(){...}",
COMMA=', ', ARROW=' => ';
// Cast non-objects to string
// Skip dates because the std toString is what we want
// Skip HTMLElement-like objects because trying to dump
// an element will cause an unhandled exception in FF 2.x
if (!L.isObject(o)) {
return o + "";
} else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
return o;
} else if (L.isFunction(o)) {
return FUN;
}
// dig into child objects the depth specifed. Default 3
d = (L.isNumber(d)) ? d : 3;
// arrays [1, 2, 3]
if (L.isArray(o)) {
s.push("[");
for (i=0,len=o.length;i<len;i=i+1) {
if (L.isObject(o[i])) {
s.push((d > 0) ? L.dump(o[i], d-1) : OBJ);
} else {
s.push(o[i]);
}
s.push(COMMA);
}
if (s.length > 1) {
s.pop();
}
s.push("]");
// objects {k1 => v1, k2 => v2}
} else {
s.push("{");
for (i in o) {
if (L.hasOwnProperty(o, i)) {
s.push(i + ARROW);
if (L.isObject(o[i])) {
s.push((d > 0) ? L.dump(o[i], d-1) : OBJ);
} else {
s.push(o[i]);
}
s.push(COMMA);
}
}
if (s.length > 1) {
s.pop();
}
s.push("}");
}
return s.join("");
} | javascript | function(o, d) {
var i,len,s=[],OBJ="{...}",FUN="f(){...}",
COMMA=', ', ARROW=' => ';
// Cast non-objects to string
// Skip dates because the std toString is what we want
// Skip HTMLElement-like objects because trying to dump
// an element will cause an unhandled exception in FF 2.x
if (!L.isObject(o)) {
return o + "";
} else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
return o;
} else if (L.isFunction(o)) {
return FUN;
}
// dig into child objects the depth specifed. Default 3
d = (L.isNumber(d)) ? d : 3;
// arrays [1, 2, 3]
if (L.isArray(o)) {
s.push("[");
for (i=0,len=o.length;i<len;i=i+1) {
if (L.isObject(o[i])) {
s.push((d > 0) ? L.dump(o[i], d-1) : OBJ);
} else {
s.push(o[i]);
}
s.push(COMMA);
}
if (s.length > 1) {
s.pop();
}
s.push("]");
// objects {k1 => v1, k2 => v2}
} else {
s.push("{");
for (i in o) {
if (L.hasOwnProperty(o, i)) {
s.push(i + ARROW);
if (L.isObject(o[i])) {
s.push((d > 0) ? L.dump(o[i], d-1) : OBJ);
} else {
s.push(o[i]);
}
s.push(COMMA);
}
}
if (s.length > 1) {
s.pop();
}
s.push("}");
}
return s.join("");
} | [
"function",
"(",
"o",
",",
"d",
")",
"{",
"var",
"i",
",",
"len",
",",
"s",
"=",
"[",
"]",
",",
"OBJ",
"=",
"\"{...}\"",
",",
"FUN",
"=",
"\"f(){...}\"",
",",
"COMMA",
"=",
"', '",
",",
"ARROW",
"=",
"' => '",
";",
"// Cast non-objects to string",
"// Skip dates because the std toString is what we want",
"// Skip HTMLElement-like objects because trying to dump ",
"// an element will cause an unhandled exception in FF 2.x",
"if",
"(",
"!",
"L",
".",
"isObject",
"(",
"o",
")",
")",
"{",
"return",
"o",
"+",
"\"\"",
";",
"}",
"else",
"if",
"(",
"o",
"instanceof",
"Date",
"||",
"(",
"\"nodeType\"",
"in",
"o",
"&&",
"\"tagName\"",
"in",
"o",
")",
")",
"{",
"return",
"o",
";",
"}",
"else",
"if",
"(",
"L",
".",
"isFunction",
"(",
"o",
")",
")",
"{",
"return",
"FUN",
";",
"}",
"// dig into child objects the depth specifed. Default 3",
"d",
"=",
"(",
"L",
".",
"isNumber",
"(",
"d",
")",
")",
"?",
"d",
":",
"3",
";",
"// arrays [1, 2, 3]",
"if",
"(",
"L",
".",
"isArray",
"(",
"o",
")",
")",
"{",
"s",
".",
"push",
"(",
"\"[\"",
")",
";",
"for",
"(",
"i",
"=",
"0",
",",
"len",
"=",
"o",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"=",
"i",
"+",
"1",
")",
"{",
"if",
"(",
"L",
".",
"isObject",
"(",
"o",
"[",
"i",
"]",
")",
")",
"{",
"s",
".",
"push",
"(",
"(",
"d",
">",
"0",
")",
"?",
"L",
".",
"dump",
"(",
"o",
"[",
"i",
"]",
",",
"d",
"-",
"1",
")",
":",
"OBJ",
")",
";",
"}",
"else",
"{",
"s",
".",
"push",
"(",
"o",
"[",
"i",
"]",
")",
";",
"}",
"s",
".",
"push",
"(",
"COMMA",
")",
";",
"}",
"if",
"(",
"s",
".",
"length",
">",
"1",
")",
"{",
"s",
".",
"pop",
"(",
")",
";",
"}",
"s",
".",
"push",
"(",
"\"]\"",
")",
";",
"// objects {k1 => v1, k2 => v2}",
"}",
"else",
"{",
"s",
".",
"push",
"(",
"\"{\"",
")",
";",
"for",
"(",
"i",
"in",
"o",
")",
"{",
"if",
"(",
"L",
".",
"hasOwnProperty",
"(",
"o",
",",
"i",
")",
")",
"{",
"s",
".",
"push",
"(",
"i",
"+",
"ARROW",
")",
";",
"if",
"(",
"L",
".",
"isObject",
"(",
"o",
"[",
"i",
"]",
")",
")",
"{",
"s",
".",
"push",
"(",
"(",
"d",
">",
"0",
")",
"?",
"L",
".",
"dump",
"(",
"o",
"[",
"i",
"]",
",",
"d",
"-",
"1",
")",
":",
"OBJ",
")",
";",
"}",
"else",
"{",
"s",
".",
"push",
"(",
"o",
"[",
"i",
"]",
")",
";",
"}",
"s",
".",
"push",
"(",
"COMMA",
")",
";",
"}",
"}",
"if",
"(",
"s",
".",
"length",
">",
"1",
")",
"{",
"s",
".",
"pop",
"(",
")",
";",
"}",
"s",
".",
"push",
"(",
"\"}\"",
")",
";",
"}",
"return",
"s",
".",
"join",
"(",
"\"\"",
")",
";",
"}"
]
| Returns a simple string representation of the object or array.
Other types of objects will be returned unprocessed. Arrays
are expected to be indexed. Use object notation for
associative arrays.
@method dump
@since 2.3.0
@param o {Object} The object to dump
@param d {int} How deep to recurse child objects, default 3
@return {String} the dump result | [
"Returns",
"a",
"simple",
"string",
"representation",
"of",
"the",
"object",
"or",
"array",
".",
"Other",
"types",
"of",
"objects",
"will",
"be",
"returned",
"unprocessed",
".",
"Arrays",
"are",
"expected",
"to",
"be",
"indexed",
".",
"Use",
"object",
"notation",
"for",
"associative",
"arrays",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L729-L784 |
|
42,731 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function() {
var o={}, a=arguments, l=a.length, i;
for (i=0; i<l; i=i+1) {
L.augmentObject(o, a[i], true);
}
return o;
} | javascript | function() {
var o={}, a=arguments, l=a.length, i;
for (i=0; i<l; i=i+1) {
L.augmentObject(o, a[i], true);
}
return o;
} | [
"function",
"(",
")",
"{",
"var",
"o",
"=",
"{",
"}",
",",
"a",
"=",
"arguments",
",",
"l",
"=",
"a",
".",
"length",
",",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"l",
";",
"i",
"=",
"i",
"+",
"1",
")",
"{",
"L",
".",
"augmentObject",
"(",
"o",
",",
"a",
"[",
"i",
"]",
",",
"true",
")",
";",
"}",
"return",
"o",
";",
"}"
]
| Returns a new object containing all of the properties of
all the supplied objects. The properties from later objects
will overwrite those in earlier objects.
@method merge
@since 2.3.0
@param arguments {Object*} the objects to merge
@return the new merged object | [
"Returns",
"a",
"new",
"object",
"containing",
"all",
"of",
"the",
"properties",
"of",
"all",
"the",
"supplied",
"objects",
".",
"The",
"properties",
"from",
"later",
"objects",
"will",
"overwrite",
"those",
"in",
"earlier",
"objects",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L912-L918 |
|
42,732 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(when, o, fn, data, periodic) {
when = when || 0;
o = o || {};
var m=fn, d=data, f, r;
if (L.isString(fn)) {
m = o[fn];
}
if (!m) {
throw new TypeError("method undefined");
}
if (d && !L.isArray(d)) {
d = [data];
}
f = function() {
m.apply(o, d || NOTHING);
};
r = (periodic) ? setInterval(f, when) : setTimeout(f, when);
return {
interval: periodic,
cancel: function() {
if (this.interval) {
clearInterval(r);
} else {
clearTimeout(r);
}
}
};
} | javascript | function(when, o, fn, data, periodic) {
when = when || 0;
o = o || {};
var m=fn, d=data, f, r;
if (L.isString(fn)) {
m = o[fn];
}
if (!m) {
throw new TypeError("method undefined");
}
if (d && !L.isArray(d)) {
d = [data];
}
f = function() {
m.apply(o, d || NOTHING);
};
r = (periodic) ? setInterval(f, when) : setTimeout(f, when);
return {
interval: periodic,
cancel: function() {
if (this.interval) {
clearInterval(r);
} else {
clearTimeout(r);
}
}
};
} | [
"function",
"(",
"when",
",",
"o",
",",
"fn",
",",
"data",
",",
"periodic",
")",
"{",
"when",
"=",
"when",
"||",
"0",
";",
"o",
"=",
"o",
"||",
"{",
"}",
";",
"var",
"m",
"=",
"fn",
",",
"d",
"=",
"data",
",",
"f",
",",
"r",
";",
"if",
"(",
"L",
".",
"isString",
"(",
"fn",
")",
")",
"{",
"m",
"=",
"o",
"[",
"fn",
"]",
";",
"}",
"if",
"(",
"!",
"m",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"\"method undefined\"",
")",
";",
"}",
"if",
"(",
"d",
"&&",
"!",
"L",
".",
"isArray",
"(",
"d",
")",
")",
"{",
"d",
"=",
"[",
"data",
"]",
";",
"}",
"f",
"=",
"function",
"(",
")",
"{",
"m",
".",
"apply",
"(",
"o",
",",
"d",
"||",
"NOTHING",
")",
";",
"}",
";",
"r",
"=",
"(",
"periodic",
")",
"?",
"setInterval",
"(",
"f",
",",
"when",
")",
":",
"setTimeout",
"(",
"f",
",",
"when",
")",
";",
"return",
"{",
"interval",
":",
"periodic",
",",
"cancel",
":",
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"interval",
")",
"{",
"clearInterval",
"(",
"r",
")",
";",
"}",
"else",
"{",
"clearTimeout",
"(",
"r",
")",
";",
"}",
"}",
"}",
";",
"}"
]
| Executes the supplied function in the context of the supplied
object 'when' milliseconds later. Executes the function a
single time unless periodic is set to true.
@method later
@since 2.4.0
@param when {int} the number of milliseconds to wait until the fn
is executed
@param o the context object
@param fn {Function|String} the function to execute or the name of
the method in the 'o' object to execute
@param data [Array] data that is provided to the function. This accepts
either a single item or an array. If an array is provided, the
function is executed with one parameter for each array item. If
you need to pass a single array parameter, it needs to be wrapped in
an array [myarray]
@param periodic {boolean} if true, executes continuously at supplied
interval until canceled
@return a timer object. Call the cancel() method on this object to
stop the timer. | [
"Executes",
"the",
"supplied",
"function",
"in",
"the",
"context",
"of",
"the",
"supplied",
"object",
"when",
"milliseconds",
"later",
".",
"Executes",
"the",
"function",
"a",
"single",
"time",
"unless",
"periodic",
"is",
"set",
"to",
"true",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L941-L974 |
|
42,733 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(type, attr, win) {
var w = win || window, d=w.document, n=d.createElement(type);
for (var i in attr) {
if (attr[i] && YAHOO.lang.hasOwnProperty(attr, i)) {
n.setAttribute(i, attr[i]);
}
}
return n;
} | javascript | function(type, attr, win) {
var w = win || window, d=w.document, n=d.createElement(type);
for (var i in attr) {
if (attr[i] && YAHOO.lang.hasOwnProperty(attr, i)) {
n.setAttribute(i, attr[i]);
}
}
return n;
} | [
"function",
"(",
"type",
",",
"attr",
",",
"win",
")",
"{",
"var",
"w",
"=",
"win",
"||",
"window",
",",
"d",
"=",
"w",
".",
"document",
",",
"n",
"=",
"d",
".",
"createElement",
"(",
"type",
")",
";",
"for",
"(",
"var",
"i",
"in",
"attr",
")",
"{",
"if",
"(",
"attr",
"[",
"i",
"]",
"&&",
"YAHOO",
".",
"lang",
".",
"hasOwnProperty",
"(",
"attr",
",",
"i",
")",
")",
"{",
"n",
".",
"setAttribute",
"(",
"i",
",",
"attr",
"[",
"i",
"]",
")",
";",
"}",
"}",
"return",
"n",
";",
"}"
]
| Generates an HTML element, this is not appended to a document
@method _node
@param type {string} the type of element
@param attr {string} the attributes
@param win {Window} optional window to create the element in
@return {HTMLElement} the generated node
@private | [
"Generates",
"an",
"HTML",
"element",
"this",
"is",
"not",
"appended",
"to",
"a",
"document"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L1139-L1149 |
|
42,734 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(url, win, attributes) {
var o = {
id: "yui__dyn_" + (nidx++),
type: "text/css",
rel: "stylesheet",
href: url
};
if (attributes) {
lang.augmentObject(o, attributes);
}
return _node("link", o, win);
} | javascript | function(url, win, attributes) {
var o = {
id: "yui__dyn_" + (nidx++),
type: "text/css",
rel: "stylesheet",
href: url
};
if (attributes) {
lang.augmentObject(o, attributes);
}
return _node("link", o, win);
} | [
"function",
"(",
"url",
",",
"win",
",",
"attributes",
")",
"{",
"var",
"o",
"=",
"{",
"id",
":",
"\"yui__dyn_\"",
"+",
"(",
"nidx",
"++",
")",
",",
"type",
":",
"\"text/css\"",
",",
"rel",
":",
"\"stylesheet\"",
",",
"href",
":",
"url",
"}",
";",
"if",
"(",
"attributes",
")",
"{",
"lang",
".",
"augmentObject",
"(",
"o",
",",
"attributes",
")",
";",
"}",
"return",
"_node",
"(",
"\"link\"",
",",
"o",
",",
"win",
")",
";",
"}"
]
| Generates a link node
@method _linkNode
@param url {string} the url for the css file
@param win {Window} optional window to create the node in
@return {HTMLElement} the generated node
@private | [
"Generates",
"a",
"link",
"node"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L1159-L1173 |
|
42,735 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(url, win, attributes) {
var o = {
id: "yui__dyn_" + (nidx++),
type: "text/javascript",
src: url
};
if (attributes) {
lang.augmentObject(o, attributes);
}
return _node("script", o, win);
} | javascript | function(url, win, attributes) {
var o = {
id: "yui__dyn_" + (nidx++),
type: "text/javascript",
src: url
};
if (attributes) {
lang.augmentObject(o, attributes);
}
return _node("script", o, win);
} | [
"function",
"(",
"url",
",",
"win",
",",
"attributes",
")",
"{",
"var",
"o",
"=",
"{",
"id",
":",
"\"yui__dyn_\"",
"+",
"(",
"nidx",
"++",
")",
",",
"type",
":",
"\"text/javascript\"",
",",
"src",
":",
"url",
"}",
";",
"if",
"(",
"attributes",
")",
"{",
"lang",
".",
"augmentObject",
"(",
"o",
",",
"attributes",
")",
";",
"}",
"return",
"_node",
"(",
"\"script\"",
",",
"o",
",",
"win",
")",
";",
"}"
]
| Generates a script node
@method _scriptNode
@param url {string} the url for the script file
@param win {Window} optional window to create the node in
@return {HTMLElement} the generated node
@private | [
"Generates",
"a",
"script",
"node"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L1183-L1195 |
|
42,736 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(q, msg) {
return {
tId: q.tId,
win: q.win,
data: q.data,
nodes: q.nodes,
msg: msg,
purge: function() {
_purge(this.tId);
}
};
} | javascript | function(q, msg) {
return {
tId: q.tId,
win: q.win,
data: q.data,
nodes: q.nodes,
msg: msg,
purge: function() {
_purge(this.tId);
}
};
} | [
"function",
"(",
"q",
",",
"msg",
")",
"{",
"return",
"{",
"tId",
":",
"q",
".",
"tId",
",",
"win",
":",
"q",
".",
"win",
",",
"data",
":",
"q",
".",
"data",
",",
"nodes",
":",
"q",
".",
"nodes",
",",
"msg",
":",
"msg",
",",
"purge",
":",
"function",
"(",
")",
"{",
"_purge",
"(",
"this",
".",
"tId",
")",
";",
"}",
"}",
";",
"}"
]
| Returns the data payload for callback functions
@method _returnData
@private | [
"Returns",
"the",
"data",
"payload",
"for",
"callback",
"functions"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L1202-L1213 |
|
42,737 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(id) {
var q = queues[id];
q.finished = true;
if (q.aborted) {
var msg = "transaction " + id + " was aborted";
_fail(id, msg);
return;
}
// execute success callback
if (q.onSuccess) {
var sc=q.scope || q.win;
q.onSuccess.call(sc, _returnData(q));
}
} | javascript | function(id) {
var q = queues[id];
q.finished = true;
if (q.aborted) {
var msg = "transaction " + id + " was aborted";
_fail(id, msg);
return;
}
// execute success callback
if (q.onSuccess) {
var sc=q.scope || q.win;
q.onSuccess.call(sc, _returnData(q));
}
} | [
"function",
"(",
"id",
")",
"{",
"var",
"q",
"=",
"queues",
"[",
"id",
"]",
";",
"q",
".",
"finished",
"=",
"true",
";",
"if",
"(",
"q",
".",
"aborted",
")",
"{",
"var",
"msg",
"=",
"\"transaction \"",
"+",
"id",
"+",
"\" was aborted\"",
";",
"_fail",
"(",
"id",
",",
"msg",
")",
";",
"return",
";",
"}",
"// execute success callback",
"if",
"(",
"q",
".",
"onSuccess",
")",
"{",
"var",
"sc",
"=",
"q",
".",
"scope",
"||",
"q",
".",
"win",
";",
"q",
".",
"onSuccess",
".",
"call",
"(",
"sc",
",",
"_returnData",
"(",
"q",
")",
")",
";",
"}",
"}"
]
| The request is complete, so executing the requester's callback
@method _finish
@param id {string} the id of the request
@private | [
"The",
"request",
"is",
"complete",
"so",
"executing",
"the",
"requester",
"s",
"callback"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L1248-L1263 |
|
42,738 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(id, loaded) {
var q = queues[id];
if (q.timer) {
// Y.log('cancel timer');
q.timer.cancel();
}
if (q.aborted) {
var msg = "transaction " + id + " was aborted";
_fail(id, msg);
return;
}
if (loaded) {
q.url.shift();
if (q.varName) {
q.varName.shift();
}
} else {
// This is the first pass: make sure the url is an array
q.url = (lang.isString(q.url)) ? [q.url] : q.url;
if (q.varName) {
q.varName = (lang.isString(q.varName)) ? [q.varName] : q.varName;
}
}
var w=q.win, d=w.document, h=d.getElementsByTagName("head")[0], n;
if (q.url.length === 0) {
// Safari 2.x workaround - There is no way to know when
// a script is ready in versions of Safari prior to 3.x.
// Adding an extra node reduces the problem, but doesn't
// eliminate it completely because the browser executes
// them asynchronously.
if (q.type === "script" && ua.webkit && ua.webkit < 420 &&
!q.finalpass && !q.varName) {
// Add another script node. This does not guarantee that the
// scripts will execute in order, but it does appear to fix the
// problem on fast connections more effectively than using an
// arbitrary timeout. It is possible that the browser does
// block subsequent script execution in this case for a limited
// time.
var extra = _scriptNode(null, q.win, q.attributes);
extra.innerHTML='YAHOO.util.Get._finalize("' + id + '");';
q.nodes.push(extra); h.appendChild(extra);
} else {
_finish(id);
}
return;
}
var url = q.url[0];
// if the url is undefined, this is probably a trailing comma problem in IE
if (!url) {
q.url.shift();
return _next(id);
}
if (q.timeout) {
// Y.log('create timer');
q.timer = lang.later(q.timeout, q, _timeout, id);
}
if (q.type === "script") {
n = _scriptNode(url, w, q.attributes);
} else {
n = _linkNode(url, w, q.attributes);
}
// track this node's load progress
_track(q.type, n, id, url, w, q.url.length);
// add the node to the queue so we can return it to the user supplied callback
q.nodes.push(n);
// add it to the head or insert it before 'insertBefore'
if (q.insertBefore) {
var s = _get(q.insertBefore, id);
if (s) {
s.parentNode.insertBefore(n, s);
}
} else {
h.appendChild(n);
}
// FireFox does not support the onload event for link nodes, so there is
// no way to make the css requests synchronous. This means that the css
// rules in multiple files could be applied out of order in this browser
// if a later request returns before an earlier one. Safari too.
if ((ua.webkit || ua.gecko) && q.type === "css") {
_next(id, url);
}
} | javascript | function(id, loaded) {
var q = queues[id];
if (q.timer) {
// Y.log('cancel timer');
q.timer.cancel();
}
if (q.aborted) {
var msg = "transaction " + id + " was aborted";
_fail(id, msg);
return;
}
if (loaded) {
q.url.shift();
if (q.varName) {
q.varName.shift();
}
} else {
// This is the first pass: make sure the url is an array
q.url = (lang.isString(q.url)) ? [q.url] : q.url;
if (q.varName) {
q.varName = (lang.isString(q.varName)) ? [q.varName] : q.varName;
}
}
var w=q.win, d=w.document, h=d.getElementsByTagName("head")[0], n;
if (q.url.length === 0) {
// Safari 2.x workaround - There is no way to know when
// a script is ready in versions of Safari prior to 3.x.
// Adding an extra node reduces the problem, but doesn't
// eliminate it completely because the browser executes
// them asynchronously.
if (q.type === "script" && ua.webkit && ua.webkit < 420 &&
!q.finalpass && !q.varName) {
// Add another script node. This does not guarantee that the
// scripts will execute in order, but it does appear to fix the
// problem on fast connections more effectively than using an
// arbitrary timeout. It is possible that the browser does
// block subsequent script execution in this case for a limited
// time.
var extra = _scriptNode(null, q.win, q.attributes);
extra.innerHTML='YAHOO.util.Get._finalize("' + id + '");';
q.nodes.push(extra); h.appendChild(extra);
} else {
_finish(id);
}
return;
}
var url = q.url[0];
// if the url is undefined, this is probably a trailing comma problem in IE
if (!url) {
q.url.shift();
return _next(id);
}
if (q.timeout) {
// Y.log('create timer');
q.timer = lang.later(q.timeout, q, _timeout, id);
}
if (q.type === "script") {
n = _scriptNode(url, w, q.attributes);
} else {
n = _linkNode(url, w, q.attributes);
}
// track this node's load progress
_track(q.type, n, id, url, w, q.url.length);
// add the node to the queue so we can return it to the user supplied callback
q.nodes.push(n);
// add it to the head or insert it before 'insertBefore'
if (q.insertBefore) {
var s = _get(q.insertBefore, id);
if (s) {
s.parentNode.insertBefore(n, s);
}
} else {
h.appendChild(n);
}
// FireFox does not support the onload event for link nodes, so there is
// no way to make the css requests synchronous. This means that the css
// rules in multiple files could be applied out of order in this browser
// if a later request returns before an earlier one. Safari too.
if ((ua.webkit || ua.gecko) && q.type === "css") {
_next(id, url);
}
} | [
"function",
"(",
"id",
",",
"loaded",
")",
"{",
"var",
"q",
"=",
"queues",
"[",
"id",
"]",
";",
"if",
"(",
"q",
".",
"timer",
")",
"{",
"// Y.log('cancel timer');",
"q",
".",
"timer",
".",
"cancel",
"(",
")",
";",
"}",
"if",
"(",
"q",
".",
"aborted",
")",
"{",
"var",
"msg",
"=",
"\"transaction \"",
"+",
"id",
"+",
"\" was aborted\"",
";",
"_fail",
"(",
"id",
",",
"msg",
")",
";",
"return",
";",
"}",
"if",
"(",
"loaded",
")",
"{",
"q",
".",
"url",
".",
"shift",
"(",
")",
";",
"if",
"(",
"q",
".",
"varName",
")",
"{",
"q",
".",
"varName",
".",
"shift",
"(",
")",
";",
"}",
"}",
"else",
"{",
"// This is the first pass: make sure the url is an array",
"q",
".",
"url",
"=",
"(",
"lang",
".",
"isString",
"(",
"q",
".",
"url",
")",
")",
"?",
"[",
"q",
".",
"url",
"]",
":",
"q",
".",
"url",
";",
"if",
"(",
"q",
".",
"varName",
")",
"{",
"q",
".",
"varName",
"=",
"(",
"lang",
".",
"isString",
"(",
"q",
".",
"varName",
")",
")",
"?",
"[",
"q",
".",
"varName",
"]",
":",
"q",
".",
"varName",
";",
"}",
"}",
"var",
"w",
"=",
"q",
".",
"win",
",",
"d",
"=",
"w",
".",
"document",
",",
"h",
"=",
"d",
".",
"getElementsByTagName",
"(",
"\"head\"",
")",
"[",
"0",
"]",
",",
"n",
";",
"if",
"(",
"q",
".",
"url",
".",
"length",
"===",
"0",
")",
"{",
"// Safari 2.x workaround - There is no way to know when ",
"// a script is ready in versions of Safari prior to 3.x.",
"// Adding an extra node reduces the problem, but doesn't",
"// eliminate it completely because the browser executes",
"// them asynchronously. ",
"if",
"(",
"q",
".",
"type",
"===",
"\"script\"",
"&&",
"ua",
".",
"webkit",
"&&",
"ua",
".",
"webkit",
"<",
"420",
"&&",
"!",
"q",
".",
"finalpass",
"&&",
"!",
"q",
".",
"varName",
")",
"{",
"// Add another script node. This does not guarantee that the",
"// scripts will execute in order, but it does appear to fix the",
"// problem on fast connections more effectively than using an",
"// arbitrary timeout. It is possible that the browser does",
"// block subsequent script execution in this case for a limited",
"// time.",
"var",
"extra",
"=",
"_scriptNode",
"(",
"null",
",",
"q",
".",
"win",
",",
"q",
".",
"attributes",
")",
";",
"extra",
".",
"innerHTML",
"=",
"'YAHOO.util.Get._finalize(\"'",
"+",
"id",
"+",
"'\");'",
";",
"q",
".",
"nodes",
".",
"push",
"(",
"extra",
")",
";",
"h",
".",
"appendChild",
"(",
"extra",
")",
";",
"}",
"else",
"{",
"_finish",
"(",
"id",
")",
";",
"}",
"return",
";",
"}",
"var",
"url",
"=",
"q",
".",
"url",
"[",
"0",
"]",
";",
"// if the url is undefined, this is probably a trailing comma problem in IE",
"if",
"(",
"!",
"url",
")",
"{",
"q",
".",
"url",
".",
"shift",
"(",
")",
";",
"return",
"_next",
"(",
"id",
")",
";",
"}",
"if",
"(",
"q",
".",
"timeout",
")",
"{",
"// Y.log('create timer');",
"q",
".",
"timer",
"=",
"lang",
".",
"later",
"(",
"q",
".",
"timeout",
",",
"q",
",",
"_timeout",
",",
"id",
")",
";",
"}",
"if",
"(",
"q",
".",
"type",
"===",
"\"script\"",
")",
"{",
"n",
"=",
"_scriptNode",
"(",
"url",
",",
"w",
",",
"q",
".",
"attributes",
")",
";",
"}",
"else",
"{",
"n",
"=",
"_linkNode",
"(",
"url",
",",
"w",
",",
"q",
".",
"attributes",
")",
";",
"}",
"// track this node's load progress",
"_track",
"(",
"q",
".",
"type",
",",
"n",
",",
"id",
",",
"url",
",",
"w",
",",
"q",
".",
"url",
".",
"length",
")",
";",
"// add the node to the queue so we can return it to the user supplied callback",
"q",
".",
"nodes",
".",
"push",
"(",
"n",
")",
";",
"// add it to the head or insert it before 'insertBefore'",
"if",
"(",
"q",
".",
"insertBefore",
")",
"{",
"var",
"s",
"=",
"_get",
"(",
"q",
".",
"insertBefore",
",",
"id",
")",
";",
"if",
"(",
"s",
")",
"{",
"s",
".",
"parentNode",
".",
"insertBefore",
"(",
"n",
",",
"s",
")",
";",
"}",
"}",
"else",
"{",
"h",
".",
"appendChild",
"(",
"n",
")",
";",
"}",
"// FireFox does not support the onload event for link nodes, so there is",
"// no way to make the css requests synchronous. This means that the css ",
"// rules in multiple files could be applied out of order in this browser",
"// if a later request returns before an earlier one. Safari too.",
"if",
"(",
"(",
"ua",
".",
"webkit",
"||",
"ua",
".",
"gecko",
")",
"&&",
"q",
".",
"type",
"===",
"\"css\"",
")",
"{",
"_next",
"(",
"id",
",",
"url",
")",
";",
"}",
"}"
]
| Loads the next item for a given request
@method _next
@param id {string} the id of the request
@param loaded {string} the url that was just loaded, if any
@private | [
"Loads",
"the",
"next",
"item",
"for",
"a",
"given",
"request"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L1286-L1385 |
|
42,739 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function() {
if (purging) {
return;
}
purging = true;
for (var i in queues) {
var q = queues[i];
if (q.autopurge && q.finished) {
_purge(q.tId);
delete queues[i];
}
}
purging = false;
} | javascript | function() {
if (purging) {
return;
}
purging = true;
for (var i in queues) {
var q = queues[i];
if (q.autopurge && q.finished) {
_purge(q.tId);
delete queues[i];
}
}
purging = false;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"purging",
")",
"{",
"return",
";",
"}",
"purging",
"=",
"true",
";",
"for",
"(",
"var",
"i",
"in",
"queues",
")",
"{",
"var",
"q",
"=",
"queues",
"[",
"i",
"]",
";",
"if",
"(",
"q",
".",
"autopurge",
"&&",
"q",
".",
"finished",
")",
"{",
"_purge",
"(",
"q",
".",
"tId",
")",
";",
"delete",
"queues",
"[",
"i",
"]",
";",
"}",
"}",
"purging",
"=",
"false",
";",
"}"
]
| Removes processed queues and corresponding nodes
@method _autoPurge
@private | [
"Removes",
"processed",
"queues",
"and",
"corresponding",
"nodes"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L1392-L1408 |
|
42,740 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(tId) {
if (queues[tId]) {
var q = queues[tId],
nodes = q.nodes,
l = nodes.length,
d = q.win.document,
h = d.getElementsByTagName("head")[0],
sib, i, node, attr;
if (q.insertBefore) {
sib = _get(q.insertBefore, tId);
if (sib) {
h = sib.parentNode;
}
}
for (i=0; i<l; i=i+1) {
node = nodes[i];
if (node.clearAttributes) {
node.clearAttributes();
} else {
for (attr in node) {
delete node[attr];
}
}
h.removeChild(node);
}
q.nodes = [];
}
} | javascript | function(tId) {
if (queues[tId]) {
var q = queues[tId],
nodes = q.nodes,
l = nodes.length,
d = q.win.document,
h = d.getElementsByTagName("head")[0],
sib, i, node, attr;
if (q.insertBefore) {
sib = _get(q.insertBefore, tId);
if (sib) {
h = sib.parentNode;
}
}
for (i=0; i<l; i=i+1) {
node = nodes[i];
if (node.clearAttributes) {
node.clearAttributes();
} else {
for (attr in node) {
delete node[attr];
}
}
h.removeChild(node);
}
q.nodes = [];
}
} | [
"function",
"(",
"tId",
")",
"{",
"if",
"(",
"queues",
"[",
"tId",
"]",
")",
"{",
"var",
"q",
"=",
"queues",
"[",
"tId",
"]",
",",
"nodes",
"=",
"q",
".",
"nodes",
",",
"l",
"=",
"nodes",
".",
"length",
",",
"d",
"=",
"q",
".",
"win",
".",
"document",
",",
"h",
"=",
"d",
".",
"getElementsByTagName",
"(",
"\"head\"",
")",
"[",
"0",
"]",
",",
"sib",
",",
"i",
",",
"node",
",",
"attr",
";",
"if",
"(",
"q",
".",
"insertBefore",
")",
"{",
"sib",
"=",
"_get",
"(",
"q",
".",
"insertBefore",
",",
"tId",
")",
";",
"if",
"(",
"sib",
")",
"{",
"h",
"=",
"sib",
".",
"parentNode",
";",
"}",
"}",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"l",
";",
"i",
"=",
"i",
"+",
"1",
")",
"{",
"node",
"=",
"nodes",
"[",
"i",
"]",
";",
"if",
"(",
"node",
".",
"clearAttributes",
")",
"{",
"node",
".",
"clearAttributes",
"(",
")",
";",
"}",
"else",
"{",
"for",
"(",
"attr",
"in",
"node",
")",
"{",
"delete",
"node",
"[",
"attr",
"]",
";",
"}",
"}",
"h",
".",
"removeChild",
"(",
"node",
")",
";",
"}",
"q",
".",
"nodes",
"=",
"[",
"]",
";",
"}",
"}"
]
| Removes the nodes for the specified queue
@method _purge
@private | [
"Removes",
"the",
"nodes",
"for",
"the",
"specified",
"queue"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L1415-L1447 |
|
42,741 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(type, url, opts) {
var id = "q" + (qidx++);
opts = opts || {};
if (qidx % YAHOO.util.Get.PURGE_THRESH === 0) {
_autoPurge();
}
queues[id] = lang.merge(opts, {
tId: id,
type: type,
url: url,
finished: false,
aborted: false,
nodes: []
});
var q = queues[id];
q.win = q.win || window;
q.scope = q.scope || q.win;
q.autopurge = ("autopurge" in q) ? q.autopurge :
(type === "script") ? true : false;
if (opts.charset) {
q.attributes = q.attributes || {};
q.attributes.charset = opts.charset;
}
lang.later(0, q, _next, id);
return {
tId: id
};
} | javascript | function(type, url, opts) {
var id = "q" + (qidx++);
opts = opts || {};
if (qidx % YAHOO.util.Get.PURGE_THRESH === 0) {
_autoPurge();
}
queues[id] = lang.merge(opts, {
tId: id,
type: type,
url: url,
finished: false,
aborted: false,
nodes: []
});
var q = queues[id];
q.win = q.win || window;
q.scope = q.scope || q.win;
q.autopurge = ("autopurge" in q) ? q.autopurge :
(type === "script") ? true : false;
if (opts.charset) {
q.attributes = q.attributes || {};
q.attributes.charset = opts.charset;
}
lang.later(0, q, _next, id);
return {
tId: id
};
} | [
"function",
"(",
"type",
",",
"url",
",",
"opts",
")",
"{",
"var",
"id",
"=",
"\"q\"",
"+",
"(",
"qidx",
"++",
")",
";",
"opts",
"=",
"opts",
"||",
"{",
"}",
";",
"if",
"(",
"qidx",
"%",
"YAHOO",
".",
"util",
".",
"Get",
".",
"PURGE_THRESH",
"===",
"0",
")",
"{",
"_autoPurge",
"(",
")",
";",
"}",
"queues",
"[",
"id",
"]",
"=",
"lang",
".",
"merge",
"(",
"opts",
",",
"{",
"tId",
":",
"id",
",",
"type",
":",
"type",
",",
"url",
":",
"url",
",",
"finished",
":",
"false",
",",
"aborted",
":",
"false",
",",
"nodes",
":",
"[",
"]",
"}",
")",
";",
"var",
"q",
"=",
"queues",
"[",
"id",
"]",
";",
"q",
".",
"win",
"=",
"q",
".",
"win",
"||",
"window",
";",
"q",
".",
"scope",
"=",
"q",
".",
"scope",
"||",
"q",
".",
"win",
";",
"q",
".",
"autopurge",
"=",
"(",
"\"autopurge\"",
"in",
"q",
")",
"?",
"q",
".",
"autopurge",
":",
"(",
"type",
"===",
"\"script\"",
")",
"?",
"true",
":",
"false",
";",
"if",
"(",
"opts",
".",
"charset",
")",
"{",
"q",
".",
"attributes",
"=",
"q",
".",
"attributes",
"||",
"{",
"}",
";",
"q",
".",
"attributes",
".",
"charset",
"=",
"opts",
".",
"charset",
";",
"}",
"lang",
".",
"later",
"(",
"0",
",",
"q",
",",
"_next",
",",
"id",
")",
";",
"return",
"{",
"tId",
":",
"id",
"}",
";",
"}"
]
| Saves the state for the request and begins loading
the requested urls
@method queue
@param type {string} the type of node to insert
@param url {string} the url to load
@param opts the hash of options for this request
@private | [
"Saves",
"the",
"state",
"for",
"the",
"request",
"and",
"begins",
"loading",
"the",
"requested",
"urls"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L1458-L1492 |
|
42,742 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(type, n, id, url, win, qlength, trackfn) {
var f = trackfn || _next;
// IE supports the readystatechange event for script and css nodes
if (ua.ie) {
n.onreadystatechange = function() {
var rs = this.readyState;
if ("loaded" === rs || "complete" === rs) {
n.onreadystatechange = null;
f(id, url);
}
};
// webkit prior to 3.x is problemmatic
} else if (ua.webkit) {
if (type === "script") {
// Safari 3.x supports the load event for script nodes (DOM2)
if (ua.webkit >= 420) {
n.addEventListener("load", function() {
f(id, url);
});
// Nothing can be done with Safari < 3.x except to pause and hope
// for the best, particularly after last script is inserted. The
// scripts will always execute in the order they arrive, not
// necessarily the order in which they were inserted. To support
// script nodes with complete reliability in these browsers, script
// nodes either need to invoke a function in the window once they
// are loaded or the implementer needs to provide a well-known
// property that the utility can poll for.
} else {
// Poll for the existence of the named variable, if it
// was supplied.
var q = queues[id];
if (q.varName) {
var freq=YAHOO.util.Get.POLL_FREQ;
q.maxattempts = YAHOO.util.Get.TIMEOUT/freq;
q.attempts = 0;
q._cache = q.varName[0].split(".");
q.timer = lang.later(freq, q, function(o) {
var a=this._cache, l=a.length, w=this.win, i;
for (i=0; i<l; i=i+1) {
w = w[a[i]];
if (!w) {
// if we have exausted our attempts, give up
this.attempts++;
if (this.attempts++ > this.maxattempts) {
var msg = "Over retry limit, giving up";
q.timer.cancel();
_fail(id, msg);
} else {
}
return;
}
}
q.timer.cancel();
f(id, url);
}, null, true);
} else {
lang.later(YAHOO.util.Get.POLL_FREQ, null, f, [id, url]);
}
}
}
// FireFox and Opera support onload (but not DOM2 in FF) handlers for
// script nodes. Opera, but not FF, supports the onload event for link
// nodes.
} else {
n.onload = function() {
f(id, url);
};
}
} | javascript | function(type, n, id, url, win, qlength, trackfn) {
var f = trackfn || _next;
// IE supports the readystatechange event for script and css nodes
if (ua.ie) {
n.onreadystatechange = function() {
var rs = this.readyState;
if ("loaded" === rs || "complete" === rs) {
n.onreadystatechange = null;
f(id, url);
}
};
// webkit prior to 3.x is problemmatic
} else if (ua.webkit) {
if (type === "script") {
// Safari 3.x supports the load event for script nodes (DOM2)
if (ua.webkit >= 420) {
n.addEventListener("load", function() {
f(id, url);
});
// Nothing can be done with Safari < 3.x except to pause and hope
// for the best, particularly after last script is inserted. The
// scripts will always execute in the order they arrive, not
// necessarily the order in which they were inserted. To support
// script nodes with complete reliability in these browsers, script
// nodes either need to invoke a function in the window once they
// are loaded or the implementer needs to provide a well-known
// property that the utility can poll for.
} else {
// Poll for the existence of the named variable, if it
// was supplied.
var q = queues[id];
if (q.varName) {
var freq=YAHOO.util.Get.POLL_FREQ;
q.maxattempts = YAHOO.util.Get.TIMEOUT/freq;
q.attempts = 0;
q._cache = q.varName[0].split(".");
q.timer = lang.later(freq, q, function(o) {
var a=this._cache, l=a.length, w=this.win, i;
for (i=0; i<l; i=i+1) {
w = w[a[i]];
if (!w) {
// if we have exausted our attempts, give up
this.attempts++;
if (this.attempts++ > this.maxattempts) {
var msg = "Over retry limit, giving up";
q.timer.cancel();
_fail(id, msg);
} else {
}
return;
}
}
q.timer.cancel();
f(id, url);
}, null, true);
} else {
lang.later(YAHOO.util.Get.POLL_FREQ, null, f, [id, url]);
}
}
}
// FireFox and Opera support onload (but not DOM2 in FF) handlers for
// script nodes. Opera, but not FF, supports the onload event for link
// nodes.
} else {
n.onload = function() {
f(id, url);
};
}
} | [
"function",
"(",
"type",
",",
"n",
",",
"id",
",",
"url",
",",
"win",
",",
"qlength",
",",
"trackfn",
")",
"{",
"var",
"f",
"=",
"trackfn",
"||",
"_next",
";",
"// IE supports the readystatechange event for script and css nodes",
"if",
"(",
"ua",
".",
"ie",
")",
"{",
"n",
".",
"onreadystatechange",
"=",
"function",
"(",
")",
"{",
"var",
"rs",
"=",
"this",
".",
"readyState",
";",
"if",
"(",
"\"loaded\"",
"===",
"rs",
"||",
"\"complete\"",
"===",
"rs",
")",
"{",
"n",
".",
"onreadystatechange",
"=",
"null",
";",
"f",
"(",
"id",
",",
"url",
")",
";",
"}",
"}",
";",
"// webkit prior to 3.x is problemmatic",
"}",
"else",
"if",
"(",
"ua",
".",
"webkit",
")",
"{",
"if",
"(",
"type",
"===",
"\"script\"",
")",
"{",
"// Safari 3.x supports the load event for script nodes (DOM2)",
"if",
"(",
"ua",
".",
"webkit",
">=",
"420",
")",
"{",
"n",
".",
"addEventListener",
"(",
"\"load\"",
",",
"function",
"(",
")",
"{",
"f",
"(",
"id",
",",
"url",
")",
";",
"}",
")",
";",
"// Nothing can be done with Safari < 3.x except to pause and hope",
"// for the best, particularly after last script is inserted. The",
"// scripts will always execute in the order they arrive, not",
"// necessarily the order in which they were inserted. To support",
"// script nodes with complete reliability in these browsers, script",
"// nodes either need to invoke a function in the window once they",
"// are loaded or the implementer needs to provide a well-known",
"// property that the utility can poll for.",
"}",
"else",
"{",
"// Poll for the existence of the named variable, if it",
"// was supplied.",
"var",
"q",
"=",
"queues",
"[",
"id",
"]",
";",
"if",
"(",
"q",
".",
"varName",
")",
"{",
"var",
"freq",
"=",
"YAHOO",
".",
"util",
".",
"Get",
".",
"POLL_FREQ",
";",
"q",
".",
"maxattempts",
"=",
"YAHOO",
".",
"util",
".",
"Get",
".",
"TIMEOUT",
"/",
"freq",
";",
"q",
".",
"attempts",
"=",
"0",
";",
"q",
".",
"_cache",
"=",
"q",
".",
"varName",
"[",
"0",
"]",
".",
"split",
"(",
"\".\"",
")",
";",
"q",
".",
"timer",
"=",
"lang",
".",
"later",
"(",
"freq",
",",
"q",
",",
"function",
"(",
"o",
")",
"{",
"var",
"a",
"=",
"this",
".",
"_cache",
",",
"l",
"=",
"a",
".",
"length",
",",
"w",
"=",
"this",
".",
"win",
",",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"l",
";",
"i",
"=",
"i",
"+",
"1",
")",
"{",
"w",
"=",
"w",
"[",
"a",
"[",
"i",
"]",
"]",
";",
"if",
"(",
"!",
"w",
")",
"{",
"// if we have exausted our attempts, give up",
"this",
".",
"attempts",
"++",
";",
"if",
"(",
"this",
".",
"attempts",
"++",
">",
"this",
".",
"maxattempts",
")",
"{",
"var",
"msg",
"=",
"\"Over retry limit, giving up\"",
";",
"q",
".",
"timer",
".",
"cancel",
"(",
")",
";",
"_fail",
"(",
"id",
",",
"msg",
")",
";",
"}",
"else",
"{",
"}",
"return",
";",
"}",
"}",
"q",
".",
"timer",
".",
"cancel",
"(",
")",
";",
"f",
"(",
"id",
",",
"url",
")",
";",
"}",
",",
"null",
",",
"true",
")",
";",
"}",
"else",
"{",
"lang",
".",
"later",
"(",
"YAHOO",
".",
"util",
".",
"Get",
".",
"POLL_FREQ",
",",
"null",
",",
"f",
",",
"[",
"id",
",",
"url",
"]",
")",
";",
"}",
"}",
"}",
"// FireFox and Opera support onload (but not DOM2 in FF) handlers for",
"// script nodes. Opera, but not FF, supports the onload event for link",
"// nodes.",
"}",
"else",
"{",
"n",
".",
"onload",
"=",
"function",
"(",
")",
"{",
"f",
"(",
"id",
",",
"url",
")",
";",
"}",
";",
"}",
"}"
]
| Detects when a node has been loaded. In the case of
script nodes, this does not guarantee that contained
script is ready to use.
@method _track
@param type {string} the type of node to track
@param n {HTMLElement} the node to track
@param id {string} the id of the request
@param url {string} the url that is being loaded
@param win {Window} the targeted window
@param qlength the number of remaining items in the queue,
including this one
@param trackfn {Function} function to execute when finished
the default is _next
@private | [
"Detects",
"when",
"a",
"node",
"has",
"been",
"loaded",
".",
"In",
"the",
"case",
"of",
"script",
"nodes",
"this",
"does",
"not",
"guarantee",
"that",
"contained",
"script",
"is",
"ready",
"to",
"use",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L1510-L1588 |
|
42,743 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(mm) {
if (!done[mm]) {
// Y.log(name + ' provides worker trying: ' + mm);
done[mm] = true;
// we always want the return value normal behavior
// (provides) for superseded modules.
lang.augmentObject(o, me.getProvides(mm));
}
// else {
// Y.log(name + ' provides worker skipping done: ' + mm);
// }
} | javascript | function(mm) {
if (!done[mm]) {
// Y.log(name + ' provides worker trying: ' + mm);
done[mm] = true;
// we always want the return value normal behavior
// (provides) for superseded modules.
lang.augmentObject(o, me.getProvides(mm));
}
// else {
// Y.log(name + ' provides worker skipping done: ' + mm);
// }
} | [
"function",
"(",
"mm",
")",
"{",
"if",
"(",
"!",
"done",
"[",
"mm",
"]",
")",
"{",
"// Y.log(name + ' provides worker trying: ' + mm);",
"done",
"[",
"mm",
"]",
"=",
"true",
";",
"// we always want the return value normal behavior ",
"// (provides) for superseded modules.",
"lang",
".",
"augmentObject",
"(",
"o",
",",
"me",
".",
"getProvides",
"(",
"mm",
")",
")",
";",
"}",
"// else {",
"// Y.log(name + ' provides worker skipping done: ' + mm);",
"// }",
"}"
]
| use worker to break cycles | [
"use",
"worker",
"to",
"break",
"cycles"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L2881-L2893 |
|
42,744 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(o) {
if (o || this.dirty) {
this._config(o);
this._setup();
this._explode();
// this._skin(); // deprecated
if (this.allowRollup) {
this._rollup();
}
this._reduce();
this._sort();
// Y.log("after calculate: " + lang.dump(this.required));
this.dirty = false;
}
} | javascript | function(o) {
if (o || this.dirty) {
this._config(o);
this._setup();
this._explode();
// this._skin(); // deprecated
if (this.allowRollup) {
this._rollup();
}
this._reduce();
this._sort();
// Y.log("after calculate: " + lang.dump(this.required));
this.dirty = false;
}
} | [
"function",
"(",
"o",
")",
"{",
"if",
"(",
"o",
"||",
"this",
".",
"dirty",
")",
"{",
"this",
".",
"_config",
"(",
"o",
")",
";",
"this",
".",
"_setup",
"(",
")",
";",
"this",
".",
"_explode",
"(",
")",
";",
"// this._skin(); // deprecated",
"if",
"(",
"this",
".",
"allowRollup",
")",
"{",
"this",
".",
"_rollup",
"(",
")",
";",
"}",
"this",
".",
"_reduce",
"(",
")",
";",
"this",
".",
"_sort",
"(",
")",
";",
"// Y.log(\"after calculate: \" + lang.dump(this.required));",
"this",
".",
"dirty",
"=",
"false",
";",
"}",
"}"
]
| Calculates the dependency tree, the result is stored in the sorted
property
@method calculate
@param o optional options object | [
"Calculates",
"the",
"dependency",
"tree",
"the",
"result",
"is",
"stored",
"in",
"the",
"sorted",
"property"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L2921-L2937 |
|
42,745 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(aa, bb) {
var mm=info[aa];
if (loaded[bb] || !mm) {
return false;
}
var ii,
rr = mm.expanded,
after = mm.after,
other = info[bb],
optional = mm.optional;
// check if this module requires the other directly
if (rr && YUI.ArrayUtil.indexOf(rr, bb) > -1) {
return true;
}
// check if this module should be sorted after the other
if (after && YUI.ArrayUtil.indexOf(after, bb) > -1) {
return true;
}
// if loadOptional is not specified, optional dependencies still
// must be sorted correctly when present.
if (checkOptional && optional && YUI.ArrayUtil.indexOf(optional, bb) > -1) {
return true;
}
// check if this module requires one the other supersedes
var ss=info[bb] && info[bb].supersedes;
if (ss) {
for (ii=0; ii<ss.length; ii=ii+1) {
if (requires(aa, ss[ii])) {
return true;
}
}
}
// var ss=me.getProvides(bb, true);
// if (ss) {
// for (ii in ss) {
// if (requires(aa, ii)) {
// return true;
// }
// }
// }
// external css files should be sorted below yui css
if (mm.ext && mm.type == 'css' && !other.ext && other.type == 'css') {
return true;
}
return false;
} | javascript | function(aa, bb) {
var mm=info[aa];
if (loaded[bb] || !mm) {
return false;
}
var ii,
rr = mm.expanded,
after = mm.after,
other = info[bb],
optional = mm.optional;
// check if this module requires the other directly
if (rr && YUI.ArrayUtil.indexOf(rr, bb) > -1) {
return true;
}
// check if this module should be sorted after the other
if (after && YUI.ArrayUtil.indexOf(after, bb) > -1) {
return true;
}
// if loadOptional is not specified, optional dependencies still
// must be sorted correctly when present.
if (checkOptional && optional && YUI.ArrayUtil.indexOf(optional, bb) > -1) {
return true;
}
// check if this module requires one the other supersedes
var ss=info[bb] && info[bb].supersedes;
if (ss) {
for (ii=0; ii<ss.length; ii=ii+1) {
if (requires(aa, ss[ii])) {
return true;
}
}
}
// var ss=me.getProvides(bb, true);
// if (ss) {
// for (ii in ss) {
// if (requires(aa, ii)) {
// return true;
// }
// }
// }
// external css files should be sorted below yui css
if (mm.ext && mm.type == 'css' && !other.ext && other.type == 'css') {
return true;
}
return false;
} | [
"function",
"(",
"aa",
",",
"bb",
")",
"{",
"var",
"mm",
"=",
"info",
"[",
"aa",
"]",
";",
"if",
"(",
"loaded",
"[",
"bb",
"]",
"||",
"!",
"mm",
")",
"{",
"return",
"false",
";",
"}",
"var",
"ii",
",",
"rr",
"=",
"mm",
".",
"expanded",
",",
"after",
"=",
"mm",
".",
"after",
",",
"other",
"=",
"info",
"[",
"bb",
"]",
",",
"optional",
"=",
"mm",
".",
"optional",
";",
"// check if this module requires the other directly",
"if",
"(",
"rr",
"&&",
"YUI",
".",
"ArrayUtil",
".",
"indexOf",
"(",
"rr",
",",
"bb",
")",
">",
"-",
"1",
")",
"{",
"return",
"true",
";",
"}",
"// check if this module should be sorted after the other",
"if",
"(",
"after",
"&&",
"YUI",
".",
"ArrayUtil",
".",
"indexOf",
"(",
"after",
",",
"bb",
")",
">",
"-",
"1",
")",
"{",
"return",
"true",
";",
"}",
"// if loadOptional is not specified, optional dependencies still",
"// must be sorted correctly when present.",
"if",
"(",
"checkOptional",
"&&",
"optional",
"&&",
"YUI",
".",
"ArrayUtil",
".",
"indexOf",
"(",
"optional",
",",
"bb",
")",
">",
"-",
"1",
")",
"{",
"return",
"true",
";",
"}",
"// check if this module requires one the other supersedes",
"var",
"ss",
"=",
"info",
"[",
"bb",
"]",
"&&",
"info",
"[",
"bb",
"]",
".",
"supersedes",
";",
"if",
"(",
"ss",
")",
"{",
"for",
"(",
"ii",
"=",
"0",
";",
"ii",
"<",
"ss",
".",
"length",
";",
"ii",
"=",
"ii",
"+",
"1",
")",
"{",
"if",
"(",
"requires",
"(",
"aa",
",",
"ss",
"[",
"ii",
"]",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"}",
"// var ss=me.getProvides(bb, true);",
"// if (ss) {",
"// for (ii in ss) {",
"// if (requires(aa, ii)) {",
"// return true;",
"// }",
"// }",
"// }",
"// external css files should be sorted below yui css",
"if",
"(",
"mm",
".",
"ext",
"&&",
"mm",
".",
"type",
"==",
"'css'",
"&&",
"!",
"other",
".",
"ext",
"&&",
"other",
".",
"type",
"==",
"'css'",
")",
"{",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
]
| returns true if b is not loaded, and is required directly or by means of modules it supersedes. | [
"returns",
"true",
"if",
"b",
"is",
"not",
"loaded",
"and",
"is",
"required",
"directly",
"or",
"by",
"means",
"of",
"modules",
"it",
"supersedes",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L3276-L3332 |
|
42,746 | neyric/webhookit | public/javascripts/yui/yuiloader/yuiloader.js | function(str) {
var f = this.filter;
return (f) ? str.replace(new RegExp(f.searchExp, 'g'), f.replaceStr) : str;
} | javascript | function(str) {
var f = this.filter;
return (f) ? str.replace(new RegExp(f.searchExp, 'g'), f.replaceStr) : str;
} | [
"function",
"(",
"str",
")",
"{",
"var",
"f",
"=",
"this",
".",
"filter",
";",
"return",
"(",
"f",
")",
"?",
"str",
".",
"replace",
"(",
"new",
"RegExp",
"(",
"f",
".",
"searchExp",
",",
"'g'",
")",
",",
"f",
".",
"replaceStr",
")",
":",
"str",
";",
"}"
]
| Applies filter
method _filter
@return {string} the filtered string
@private | [
"Applies",
"filter",
"method",
"_filter"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/yuiloader/yuiloader.js#L3859-L3862 |
|
42,747 | neyric/webhookit | public/javascripts/inputex/js/fields/SelectTwiceField.js | function () {
var i, j, ilength, jlength, currentSubChoices, currentSubChoice, currentValue,
testValue, isDuplicateChoice, secondSelectChoices;
// object used in updateSecondSelectChoices
//
// * key : string representing a value in 1st select
// * value : array of values available in 2nd select when key is selected in first select
//
this.valuesMatching = {};
// helper to filter 2nd select choices to find duplicates
isDuplicateChoice = function(elt, arrElt) {
elt = lang.isObject(elt) ? elt.value : elt;
arrElt = lang.isObject(arrElt) ? arrElt.value : arrElt;
return elt === arrElt;
};
// collect 2nd level choices + ensure uniqueness of values
secondSelectChoices = [];
for (i = 0, ilength = this.options.choices.length; i < ilength; i += 1) {
currentValue = lang.isObject(this.options.choices[i]) ? this.options.choices[i].value : this.options.choices[i];
currentSubChoices = this.options.choices[i].choices;
this.valuesMatching[currentValue] = [];
// maybe no sub choices ???
if (currentSubChoices) {
for (j = 0, jlength = currentSubChoices.length; j < jlength; j += 1) {
currentSubChoice = currentSubChoices[j];
testValue = lang.isObject(currentSubChoice) ? currentSubChoice.value : currentSubChoice;
this.valuesMatching[currentValue].push(testValue);
if (inputEx.indexOf(testValue, secondSelectChoices, isDuplicateChoice) === -1) {
secondSelectChoices.push(currentSubChoices[j]);
}
}
}
}
// create and store selects
this.selects = [];
this.selects.push(new inputEx.SelectField({ choices: this.options.choices }));
this.selects.push(new inputEx.SelectField({ choices: secondSelectChoices }));
// append <select>s to DOM tree
this.fieldContainer.appendChild(this.selects[0].getEl());
this.fieldContainer.appendChild(this.selects[1].getEl());
} | javascript | function () {
var i, j, ilength, jlength, currentSubChoices, currentSubChoice, currentValue,
testValue, isDuplicateChoice, secondSelectChoices;
// object used in updateSecondSelectChoices
//
// * key : string representing a value in 1st select
// * value : array of values available in 2nd select when key is selected in first select
//
this.valuesMatching = {};
// helper to filter 2nd select choices to find duplicates
isDuplicateChoice = function(elt, arrElt) {
elt = lang.isObject(elt) ? elt.value : elt;
arrElt = lang.isObject(arrElt) ? arrElt.value : arrElt;
return elt === arrElt;
};
// collect 2nd level choices + ensure uniqueness of values
secondSelectChoices = [];
for (i = 0, ilength = this.options.choices.length; i < ilength; i += 1) {
currentValue = lang.isObject(this.options.choices[i]) ? this.options.choices[i].value : this.options.choices[i];
currentSubChoices = this.options.choices[i].choices;
this.valuesMatching[currentValue] = [];
// maybe no sub choices ???
if (currentSubChoices) {
for (j = 0, jlength = currentSubChoices.length; j < jlength; j += 1) {
currentSubChoice = currentSubChoices[j];
testValue = lang.isObject(currentSubChoice) ? currentSubChoice.value : currentSubChoice;
this.valuesMatching[currentValue].push(testValue);
if (inputEx.indexOf(testValue, secondSelectChoices, isDuplicateChoice) === -1) {
secondSelectChoices.push(currentSubChoices[j]);
}
}
}
}
// create and store selects
this.selects = [];
this.selects.push(new inputEx.SelectField({ choices: this.options.choices }));
this.selects.push(new inputEx.SelectField({ choices: secondSelectChoices }));
// append <select>s to DOM tree
this.fieldContainer.appendChild(this.selects[0].getEl());
this.fieldContainer.appendChild(this.selects[1].getEl());
} | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"j",
",",
"ilength",
",",
"jlength",
",",
"currentSubChoices",
",",
"currentSubChoice",
",",
"currentValue",
",",
"testValue",
",",
"isDuplicateChoice",
",",
"secondSelectChoices",
";",
"// object used in updateSecondSelectChoices",
"//",
"// * key : string representing a value in 1st select",
"// * value : array of values available in 2nd select when key is selected in first select",
"//",
"this",
".",
"valuesMatching",
"=",
"{",
"}",
";",
"// helper to filter 2nd select choices to find duplicates",
"isDuplicateChoice",
"=",
"function",
"(",
"elt",
",",
"arrElt",
")",
"{",
"elt",
"=",
"lang",
".",
"isObject",
"(",
"elt",
")",
"?",
"elt",
".",
"value",
":",
"elt",
";",
"arrElt",
"=",
"lang",
".",
"isObject",
"(",
"arrElt",
")",
"?",
"arrElt",
".",
"value",
":",
"arrElt",
";",
"return",
"elt",
"===",
"arrElt",
";",
"}",
";",
"// collect 2nd level choices + ensure uniqueness of values",
"secondSelectChoices",
"=",
"[",
"]",
";",
"for",
"(",
"i",
"=",
"0",
",",
"ilength",
"=",
"this",
".",
"options",
".",
"choices",
".",
"length",
";",
"i",
"<",
"ilength",
";",
"i",
"+=",
"1",
")",
"{",
"currentValue",
"=",
"lang",
".",
"isObject",
"(",
"this",
".",
"options",
".",
"choices",
"[",
"i",
"]",
")",
"?",
"this",
".",
"options",
".",
"choices",
"[",
"i",
"]",
".",
"value",
":",
"this",
".",
"options",
".",
"choices",
"[",
"i",
"]",
";",
"currentSubChoices",
"=",
"this",
".",
"options",
".",
"choices",
"[",
"i",
"]",
".",
"choices",
";",
"this",
".",
"valuesMatching",
"[",
"currentValue",
"]",
"=",
"[",
"]",
";",
"// maybe no sub choices ???",
"if",
"(",
"currentSubChoices",
")",
"{",
"for",
"(",
"j",
"=",
"0",
",",
"jlength",
"=",
"currentSubChoices",
".",
"length",
";",
"j",
"<",
"jlength",
";",
"j",
"+=",
"1",
")",
"{",
"currentSubChoice",
"=",
"currentSubChoices",
"[",
"j",
"]",
";",
"testValue",
"=",
"lang",
".",
"isObject",
"(",
"currentSubChoice",
")",
"?",
"currentSubChoice",
".",
"value",
":",
"currentSubChoice",
";",
"this",
".",
"valuesMatching",
"[",
"currentValue",
"]",
".",
"push",
"(",
"testValue",
")",
";",
"if",
"(",
"inputEx",
".",
"indexOf",
"(",
"testValue",
",",
"secondSelectChoices",
",",
"isDuplicateChoice",
")",
"===",
"-",
"1",
")",
"{",
"secondSelectChoices",
".",
"push",
"(",
"currentSubChoices",
"[",
"j",
"]",
")",
";",
"}",
"}",
"}",
"}",
"// create and store selects",
"this",
".",
"selects",
"=",
"[",
"]",
";",
"this",
".",
"selects",
".",
"push",
"(",
"new",
"inputEx",
".",
"SelectField",
"(",
"{",
"choices",
":",
"this",
".",
"options",
".",
"choices",
"}",
")",
")",
";",
"this",
".",
"selects",
".",
"push",
"(",
"new",
"inputEx",
".",
"SelectField",
"(",
"{",
"choices",
":",
"secondSelectChoices",
"}",
")",
")",
";",
"// append <select>s to DOM tree",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"selects",
"[",
"0",
"]",
".",
"getEl",
"(",
")",
")",
";",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"selects",
"[",
"1",
"]",
".",
"getEl",
"(",
")",
")",
";",
"}"
]
| Build two select fields | [
"Build",
"two",
"select",
"fields"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/SelectTwiceField.js#L46-L106 |
|
42,748 | neyric/webhookit | public/javascripts/inputex/js/fields/SelectTwiceField.js | function() {
var i, length, choicesList, secondSelectValues, testValue;
// allowed values in second select
secondSelectValues = this.valuesMatching[this.selects[0].getValue()];
// all choices in second select
choicesList = this.selects[1].choicesList;
for (i = 0, length = choicesList.length; i < length; i += 1) {
testValue = choicesList[i].value;
if (inputEx.indexOf(testValue, secondSelectValues) === -1) {
this.selects[1].hideChoice({ position: i }, false); // no updatedEvt in case of clear (because multiple clear could happen...)
} else {
this.selects[1].showChoice({ position: i });
}
}
} | javascript | function() {
var i, length, choicesList, secondSelectValues, testValue;
// allowed values in second select
secondSelectValues = this.valuesMatching[this.selects[0].getValue()];
// all choices in second select
choicesList = this.selects[1].choicesList;
for (i = 0, length = choicesList.length; i < length; i += 1) {
testValue = choicesList[i].value;
if (inputEx.indexOf(testValue, secondSelectValues) === -1) {
this.selects[1].hideChoice({ position: i }, false); // no updatedEvt in case of clear (because multiple clear could happen...)
} else {
this.selects[1].showChoice({ position: i });
}
}
} | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"length",
",",
"choicesList",
",",
"secondSelectValues",
",",
"testValue",
";",
"// allowed values in second select",
"secondSelectValues",
"=",
"this",
".",
"valuesMatching",
"[",
"this",
".",
"selects",
"[",
"0",
"]",
".",
"getValue",
"(",
")",
"]",
";",
"// all choices in second select",
"choicesList",
"=",
"this",
".",
"selects",
"[",
"1",
"]",
".",
"choicesList",
";",
"for",
"(",
"i",
"=",
"0",
",",
"length",
"=",
"choicesList",
".",
"length",
";",
"i",
"<",
"length",
";",
"i",
"+=",
"1",
")",
"{",
"testValue",
"=",
"choicesList",
"[",
"i",
"]",
".",
"value",
";",
"if",
"(",
"inputEx",
".",
"indexOf",
"(",
"testValue",
",",
"secondSelectValues",
")",
"===",
"-",
"1",
")",
"{",
"this",
".",
"selects",
"[",
"1",
"]",
".",
"hideChoice",
"(",
"{",
"position",
":",
"i",
"}",
",",
"false",
")",
";",
"// no updatedEvt in case of clear (because multiple clear could happen...)",
"}",
"else",
"{",
"this",
".",
"selects",
"[",
"1",
"]",
".",
"showChoice",
"(",
"{",
"position",
":",
"i",
"}",
")",
";",
"}",
"}",
"}"
]
| adapt choices of 2nd select relatively to 1st select value | [
"adapt",
"choices",
"of",
"2nd",
"select",
"relatively",
"to",
"1st",
"select",
"value"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/SelectTwiceField.js#L137-L159 |
|
42,749 | neyric/webhookit | public/javascripts/inputex/js/fields/SelectTwiceField.js | function() {
// if the field is empty :
if( this.getValue() === this.options.valueSeparator ) {
return this.options.required ? inputEx.stateRequired : inputEx.stateEmpty;
}
return this.validate() ? inputEx.stateValid : inputEx.stateInvalid;
} | javascript | function() {
// if the field is empty :
if( this.getValue() === this.options.valueSeparator ) {
return this.options.required ? inputEx.stateRequired : inputEx.stateEmpty;
}
return this.validate() ? inputEx.stateValid : inputEx.stateInvalid;
} | [
"function",
"(",
")",
"{",
"// if the field is empty :",
"if",
"(",
"this",
".",
"getValue",
"(",
")",
"===",
"this",
".",
"options",
".",
"valueSeparator",
")",
"{",
"return",
"this",
".",
"options",
".",
"required",
"?",
"inputEx",
".",
"stateRequired",
":",
"inputEx",
".",
"stateEmpty",
";",
"}",
"return",
"this",
".",
"validate",
"(",
")",
"?",
"inputEx",
".",
"stateValid",
":",
"inputEx",
".",
"stateInvalid",
";",
"}"
]
| HACK because empty state value is this.options.valueSeparator | [
"HACK",
"because",
"empty",
"state",
"value",
"is",
"this",
".",
"options",
".",
"valueSeparator"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/SelectTwiceField.js#L193-L199 |
|
42,750 | 3rd-Eden/licenses | index.js | parse | function parse(name, options, fn) {
if ('function' === typeof options) {
fn = options;
options = null;
}
//
// Fix circular require.
//
if (!Registry) Registry = require('npm-registry');
options = options || {};
options.githulk = options.githulk || null;
options.order = options.order || ['registry', 'github', 'content'];
options.registry = options.registry || Registry.mirrors.nodejitsu;
options.npmjs = 'string' !== typeof options.registry
? options.registry
: new Registry({
registry: options.registry || Registry.mirrors.nodejitsu,
githulk: options.githulk
});
async.waterfall([
//
// Make sure that we have the correct contents to start searching for
// license information.
//
function fetch(next) {
if ('string' !== typeof name) return next(undefined, name);
options.npmjs.packages.get(name, next);
},
//
// Search for the correct way of parsing out the license information.
//
function search(data, next) {
if (!options.order.length) return next();
if (Array.isArray(data)) data = data[0];
debug('searching for licensing information for %s', data.name);
var parser, result, name;
async.doWhilst(function does(next) {
name = options.order.shift();
parser = parse.parsers[name];
if (!parser.supported(data)) return next();
debug('attempting to extract the license information using: %s', name);
parser.parse(data, options, function parsed(err, license) {
if (err) return next();
result = license;
if (result) debug('parsing with %s was successful', name);
next();
});
}, function select() {
return !result && options.order.length;
}, function cleanup(err) {
options = null;
next(err, result, name);
});
}
], fn);
} | javascript | function parse(name, options, fn) {
if ('function' === typeof options) {
fn = options;
options = null;
}
//
// Fix circular require.
//
if (!Registry) Registry = require('npm-registry');
options = options || {};
options.githulk = options.githulk || null;
options.order = options.order || ['registry', 'github', 'content'];
options.registry = options.registry || Registry.mirrors.nodejitsu;
options.npmjs = 'string' !== typeof options.registry
? options.registry
: new Registry({
registry: options.registry || Registry.mirrors.nodejitsu,
githulk: options.githulk
});
async.waterfall([
//
// Make sure that we have the correct contents to start searching for
// license information.
//
function fetch(next) {
if ('string' !== typeof name) return next(undefined, name);
options.npmjs.packages.get(name, next);
},
//
// Search for the correct way of parsing out the license information.
//
function search(data, next) {
if (!options.order.length) return next();
if (Array.isArray(data)) data = data[0];
debug('searching for licensing information for %s', data.name);
var parser, result, name;
async.doWhilst(function does(next) {
name = options.order.shift();
parser = parse.parsers[name];
if (!parser.supported(data)) return next();
debug('attempting to extract the license information using: %s', name);
parser.parse(data, options, function parsed(err, license) {
if (err) return next();
result = license;
if (result) debug('parsing with %s was successful', name);
next();
});
}, function select() {
return !result && options.order.length;
}, function cleanup(err) {
options = null;
next(err, result, name);
});
}
], fn);
} | [
"function",
"parse",
"(",
"name",
",",
"options",
",",
"fn",
")",
"{",
"if",
"(",
"'function'",
"===",
"typeof",
"options",
")",
"{",
"fn",
"=",
"options",
";",
"options",
"=",
"null",
";",
"}",
"//",
"// Fix circular require.",
"//",
"if",
"(",
"!",
"Registry",
")",
"Registry",
"=",
"require",
"(",
"'npm-registry'",
")",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"options",
".",
"githulk",
"=",
"options",
".",
"githulk",
"||",
"null",
";",
"options",
".",
"order",
"=",
"options",
".",
"order",
"||",
"[",
"'registry'",
",",
"'github'",
",",
"'content'",
"]",
";",
"options",
".",
"registry",
"=",
"options",
".",
"registry",
"||",
"Registry",
".",
"mirrors",
".",
"nodejitsu",
";",
"options",
".",
"npmjs",
"=",
"'string'",
"!==",
"typeof",
"options",
".",
"registry",
"?",
"options",
".",
"registry",
":",
"new",
"Registry",
"(",
"{",
"registry",
":",
"options",
".",
"registry",
"||",
"Registry",
".",
"mirrors",
".",
"nodejitsu",
",",
"githulk",
":",
"options",
".",
"githulk",
"}",
")",
";",
"async",
".",
"waterfall",
"(",
"[",
"//",
"// Make sure that we have the correct contents to start searching for",
"// license information.",
"//",
"function",
"fetch",
"(",
"next",
")",
"{",
"if",
"(",
"'string'",
"!==",
"typeof",
"name",
")",
"return",
"next",
"(",
"undefined",
",",
"name",
")",
";",
"options",
".",
"npmjs",
".",
"packages",
".",
"get",
"(",
"name",
",",
"next",
")",
";",
"}",
",",
"//",
"// Search for the correct way of parsing out the license information.",
"//",
"function",
"search",
"(",
"data",
",",
"next",
")",
"{",
"if",
"(",
"!",
"options",
".",
"order",
".",
"length",
")",
"return",
"next",
"(",
")",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"data",
")",
")",
"data",
"=",
"data",
"[",
"0",
"]",
";",
"debug",
"(",
"'searching for licensing information for %s'",
",",
"data",
".",
"name",
")",
";",
"var",
"parser",
",",
"result",
",",
"name",
";",
"async",
".",
"doWhilst",
"(",
"function",
"does",
"(",
"next",
")",
"{",
"name",
"=",
"options",
".",
"order",
".",
"shift",
"(",
")",
";",
"parser",
"=",
"parse",
".",
"parsers",
"[",
"name",
"]",
";",
"if",
"(",
"!",
"parser",
".",
"supported",
"(",
"data",
")",
")",
"return",
"next",
"(",
")",
";",
"debug",
"(",
"'attempting to extract the license information using: %s'",
",",
"name",
")",
";",
"parser",
".",
"parse",
"(",
"data",
",",
"options",
",",
"function",
"parsed",
"(",
"err",
",",
"license",
")",
"{",
"if",
"(",
"err",
")",
"return",
"next",
"(",
")",
";",
"result",
"=",
"license",
";",
"if",
"(",
"result",
")",
"debug",
"(",
"'parsing with %s was successful'",
",",
"name",
")",
";",
"next",
"(",
")",
";",
"}",
")",
";",
"}",
",",
"function",
"select",
"(",
")",
"{",
"return",
"!",
"result",
"&&",
"options",
".",
"order",
".",
"length",
";",
"}",
",",
"function",
"cleanup",
"(",
"err",
")",
"{",
"options",
"=",
"null",
";",
"next",
"(",
"err",
",",
"result",
",",
"name",
")",
";",
"}",
")",
";",
"}",
"]",
",",
"fn",
")",
";",
"}"
]
| Start searching for license information for the given module name.
Options:
- githulk: A pre-configured githulk instance.
- order: The order of resolving license information.
- npmjs: A pre-configured npm-registry instance.
- registry: A registry to use for the npmjs instance.
@param {Mixed} name The module name or the package.json contents.
@param {Object} options Configuration of the parse process.
@param {Function} fn Callback.
@api public | [
"Start",
"searching",
"for",
"license",
"information",
"for",
"the",
"given",
"module",
"name",
"."
]
| 8f58b7700fd03de0e095cc408852fa12d1379c3f | https://github.com/3rd-Eden/licenses/blob/8f58b7700fd03de0e095cc408852fa12d1379c3f/index.js#L25-L93 |
42,751 | 3rd-Eden/licenses | index.js | fetch | function fetch(next) {
if ('string' !== typeof name) return next(undefined, name);
options.npmjs.packages.get(name, next);
} | javascript | function fetch(next) {
if ('string' !== typeof name) return next(undefined, name);
options.npmjs.packages.get(name, next);
} | [
"function",
"fetch",
"(",
"next",
")",
"{",
"if",
"(",
"'string'",
"!==",
"typeof",
"name",
")",
"return",
"next",
"(",
"undefined",
",",
"name",
")",
";",
"options",
".",
"npmjs",
".",
"packages",
".",
"get",
"(",
"name",
",",
"next",
")",
";",
"}"
]
| Make sure that we have the correct contents to start searching for license information. | [
"Make",
"sure",
"that",
"we",
"have",
"the",
"correct",
"contents",
"to",
"start",
"searching",
"for",
"license",
"information",
"."
]
| 8f58b7700fd03de0e095cc408852fa12d1379c3f | https://github.com/3rd-Eden/licenses/blob/8f58b7700fd03de0e095cc408852fa12d1379c3f/index.js#L52-L56 |
42,752 | 3rd-Eden/licenses | index.js | search | function search(data, next) {
if (!options.order.length) return next();
if (Array.isArray(data)) data = data[0];
debug('searching for licensing information for %s', data.name);
var parser, result, name;
async.doWhilst(function does(next) {
name = options.order.shift();
parser = parse.parsers[name];
if (!parser.supported(data)) return next();
debug('attempting to extract the license information using: %s', name);
parser.parse(data, options, function parsed(err, license) {
if (err) return next();
result = license;
if (result) debug('parsing with %s was successful', name);
next();
});
}, function select() {
return !result && options.order.length;
}, function cleanup(err) {
options = null;
next(err, result, name);
});
} | javascript | function search(data, next) {
if (!options.order.length) return next();
if (Array.isArray(data)) data = data[0];
debug('searching for licensing information for %s', data.name);
var parser, result, name;
async.doWhilst(function does(next) {
name = options.order.shift();
parser = parse.parsers[name];
if (!parser.supported(data)) return next();
debug('attempting to extract the license information using: %s', name);
parser.parse(data, options, function parsed(err, license) {
if (err) return next();
result = license;
if (result) debug('parsing with %s was successful', name);
next();
});
}, function select() {
return !result && options.order.length;
}, function cleanup(err) {
options = null;
next(err, result, name);
});
} | [
"function",
"search",
"(",
"data",
",",
"next",
")",
"{",
"if",
"(",
"!",
"options",
".",
"order",
".",
"length",
")",
"return",
"next",
"(",
")",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"data",
")",
")",
"data",
"=",
"data",
"[",
"0",
"]",
";",
"debug",
"(",
"'searching for licensing information for %s'",
",",
"data",
".",
"name",
")",
";",
"var",
"parser",
",",
"result",
",",
"name",
";",
"async",
".",
"doWhilst",
"(",
"function",
"does",
"(",
"next",
")",
"{",
"name",
"=",
"options",
".",
"order",
".",
"shift",
"(",
")",
";",
"parser",
"=",
"parse",
".",
"parsers",
"[",
"name",
"]",
";",
"if",
"(",
"!",
"parser",
".",
"supported",
"(",
"data",
")",
")",
"return",
"next",
"(",
")",
";",
"debug",
"(",
"'attempting to extract the license information using: %s'",
",",
"name",
")",
";",
"parser",
".",
"parse",
"(",
"data",
",",
"options",
",",
"function",
"parsed",
"(",
"err",
",",
"license",
")",
"{",
"if",
"(",
"err",
")",
"return",
"next",
"(",
")",
";",
"result",
"=",
"license",
";",
"if",
"(",
"result",
")",
"debug",
"(",
"'parsing with %s was successful'",
",",
"name",
")",
";",
"next",
"(",
")",
";",
"}",
")",
";",
"}",
",",
"function",
"select",
"(",
")",
"{",
"return",
"!",
"result",
"&&",
"options",
".",
"order",
".",
"length",
";",
"}",
",",
"function",
"cleanup",
"(",
"err",
")",
"{",
"options",
"=",
"null",
";",
"next",
"(",
"err",
",",
"result",
",",
"name",
")",
";",
"}",
")",
";",
"}"
]
| Search for the correct way of parsing out the license information. | [
"Search",
"for",
"the",
"correct",
"way",
"of",
"parsing",
"out",
"the",
"license",
"information",
"."
]
| 8f58b7700fd03de0e095cc408852fa12d1379c3f | https://github.com/3rd-Eden/licenses/blob/8f58b7700fd03de0e095cc408852fa12d1379c3f/index.js#L61-L91 |
42,753 | neyric/webhookit | public/javascripts/yui/dom/dom.js | function() {
var scrollHeight = (document[COMPAT_MODE] != CSS1_COMPAT || isSafari) ? document.body.scrollHeight : documentElement.scrollHeight,
h = Math.max(scrollHeight, Y.Dom.getViewportHeight());
return h;
} | javascript | function() {
var scrollHeight = (document[COMPAT_MODE] != CSS1_COMPAT || isSafari) ? document.body.scrollHeight : documentElement.scrollHeight,
h = Math.max(scrollHeight, Y.Dom.getViewportHeight());
return h;
} | [
"function",
"(",
")",
"{",
"var",
"scrollHeight",
"=",
"(",
"document",
"[",
"COMPAT_MODE",
"]",
"!=",
"CSS1_COMPAT",
"||",
"isSafari",
")",
"?",
"document",
".",
"body",
".",
"scrollHeight",
":",
"documentElement",
".",
"scrollHeight",
",",
"h",
"=",
"Math",
".",
"max",
"(",
"scrollHeight",
",",
"Y",
".",
"Dom",
".",
"getViewportHeight",
"(",
")",
")",
";",
"return",
"h",
";",
"}"
]
| Returns the height of the document.
@method getDocumentHeight
@return {Int} The height of the actual document (which includes the body and its margin). | [
"Returns",
"the",
"height",
"of",
"the",
"document",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dom/dom.js#L900-L905 |
|
42,754 | neyric/webhookit | public/javascripts/yui/dom/dom.js | function() {
var scrollWidth = (document[COMPAT_MODE] != CSS1_COMPAT || isSafari) ? document.body.scrollWidth : documentElement.scrollWidth,
w = Math.max(scrollWidth, Y.Dom.getViewportWidth());
return w;
} | javascript | function() {
var scrollWidth = (document[COMPAT_MODE] != CSS1_COMPAT || isSafari) ? document.body.scrollWidth : documentElement.scrollWidth,
w = Math.max(scrollWidth, Y.Dom.getViewportWidth());
return w;
} | [
"function",
"(",
")",
"{",
"var",
"scrollWidth",
"=",
"(",
"document",
"[",
"COMPAT_MODE",
"]",
"!=",
"CSS1_COMPAT",
"||",
"isSafari",
")",
"?",
"document",
".",
"body",
".",
"scrollWidth",
":",
"documentElement",
".",
"scrollWidth",
",",
"w",
"=",
"Math",
".",
"max",
"(",
"scrollWidth",
",",
"Y",
".",
"Dom",
".",
"getViewportWidth",
"(",
")",
")",
";",
"return",
"w",
";",
"}"
]
| Returns the width of the document.
@method getDocumentWidth
@return {Int} The width of the actual document (which includes the body and its margin). | [
"Returns",
"the",
"width",
"of",
"the",
"document",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dom/dom.js#L912-L916 |
|
42,755 | neyric/webhookit | public/javascripts/yui/dom/dom.js | function() {
var width = self.innerWidth, // Safari
mode = document[COMPAT_MODE];
if (mode || isIE) { // IE, Gecko, Opera
width = (mode == CSS1_COMPAT) ?
documentElement.clientWidth : // Standards
document.body.clientWidth; // Quirks
}
return width;
} | javascript | function() {
var width = self.innerWidth, // Safari
mode = document[COMPAT_MODE];
if (mode || isIE) { // IE, Gecko, Opera
width = (mode == CSS1_COMPAT) ?
documentElement.clientWidth : // Standards
document.body.clientWidth; // Quirks
}
return width;
} | [
"function",
"(",
")",
"{",
"var",
"width",
"=",
"self",
".",
"innerWidth",
",",
"// Safari",
"mode",
"=",
"document",
"[",
"COMPAT_MODE",
"]",
";",
"if",
"(",
"mode",
"||",
"isIE",
")",
"{",
"// IE, Gecko, Opera",
"width",
"=",
"(",
"mode",
"==",
"CSS1_COMPAT",
")",
"?",
"documentElement",
".",
"clientWidth",
":",
"// Standards",
"document",
".",
"body",
".",
"clientWidth",
";",
"// Quirks",
"}",
"return",
"width",
";",
"}"
]
| Returns the current width of the viewport.
@method getViewportWidth
@return {Int} The width of the viewable area of the page (excludes scrollbars). | [
"Returns",
"the",
"current",
"width",
"of",
"the",
"viewport",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dom/dom.js#L942-L952 |
|
42,756 | neyric/webhookit | public/javascripts/yui/dom/dom.js | function(node, className) {
node = Y.Dom.get(node);
if (!node) {
return null;
}
var method = function(el) { return Y.Dom.hasClass(el, className); };
return Y.Dom.getAncestorBy(node, method);
} | javascript | function(node, className) {
node = Y.Dom.get(node);
if (!node) {
return null;
}
var method = function(el) { return Y.Dom.hasClass(el, className); };
return Y.Dom.getAncestorBy(node, method);
} | [
"function",
"(",
"node",
",",
"className",
")",
"{",
"node",
"=",
"Y",
".",
"Dom",
".",
"get",
"(",
"node",
")",
";",
"if",
"(",
"!",
"node",
")",
"{",
"return",
"null",
";",
"}",
"var",
"method",
"=",
"function",
"(",
"el",
")",
"{",
"return",
"Y",
".",
"Dom",
".",
"hasClass",
"(",
"el",
",",
"className",
")",
";",
"}",
";",
"return",
"Y",
".",
"Dom",
".",
"getAncestorBy",
"(",
"node",
",",
"method",
")",
";",
"}"
]
| Returns the nearest ancestor with the given className.
@method getAncestorByClassName
@param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point
@param {String} className
@return {Object} HTMLElement | [
"Returns",
"the",
"nearest",
"ancestor",
"with",
"the",
"given",
"className",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dom/dom.js#L979-L986 |
|
42,757 | neyric/webhookit | public/javascripts/yui/dom/dom.js | function(node, tagName) {
node = Y.Dom.get(node);
if (!node) {
return null;
}
var method = function(el) {
return el[TAG_NAME] && el[TAG_NAME].toUpperCase() == tagName.toUpperCase();
};
return Y.Dom.getAncestorBy(node, method);
} | javascript | function(node, tagName) {
node = Y.Dom.get(node);
if (!node) {
return null;
}
var method = function(el) {
return el[TAG_NAME] && el[TAG_NAME].toUpperCase() == tagName.toUpperCase();
};
return Y.Dom.getAncestorBy(node, method);
} | [
"function",
"(",
"node",
",",
"tagName",
")",
"{",
"node",
"=",
"Y",
".",
"Dom",
".",
"get",
"(",
"node",
")",
";",
"if",
"(",
"!",
"node",
")",
"{",
"return",
"null",
";",
"}",
"var",
"method",
"=",
"function",
"(",
"el",
")",
"{",
"return",
"el",
"[",
"TAG_NAME",
"]",
"&&",
"el",
"[",
"TAG_NAME",
"]",
".",
"toUpperCase",
"(",
")",
"==",
"tagName",
".",
"toUpperCase",
"(",
")",
";",
"}",
";",
"return",
"Y",
".",
"Dom",
".",
"getAncestorBy",
"(",
"node",
",",
"method",
")",
";",
"}"
]
| Returns the nearest ancestor with the given tagName.
@method getAncestorByTagName
@param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point
@param {String} tagName
@return {Object} HTMLElement | [
"Returns",
"the",
"nearest",
"ancestor",
"with",
"the",
"given",
"tagName",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dom/dom.js#L995-L1005 |
|
42,758 | neyric/webhookit | public/javascripts/yui/dom/dom.js | function(newNode, referenceNode) {
newNode = Y.Dom.get(newNode);
referenceNode = Y.Dom.get(referenceNode);
if (!newNode || !referenceNode || !referenceNode[PARENT_NODE]) {
return null;
}
return referenceNode[PARENT_NODE].insertBefore(newNode, referenceNode);
} | javascript | function(newNode, referenceNode) {
newNode = Y.Dom.get(newNode);
referenceNode = Y.Dom.get(referenceNode);
if (!newNode || !referenceNode || !referenceNode[PARENT_NODE]) {
return null;
}
return referenceNode[PARENT_NODE].insertBefore(newNode, referenceNode);
} | [
"function",
"(",
"newNode",
",",
"referenceNode",
")",
"{",
"newNode",
"=",
"Y",
".",
"Dom",
".",
"get",
"(",
"newNode",
")",
";",
"referenceNode",
"=",
"Y",
".",
"Dom",
".",
"get",
"(",
"referenceNode",
")",
";",
"if",
"(",
"!",
"newNode",
"||",
"!",
"referenceNode",
"||",
"!",
"referenceNode",
"[",
"PARENT_NODE",
"]",
")",
"{",
"return",
"null",
";",
"}",
"return",
"referenceNode",
"[",
"PARENT_NODE",
"]",
".",
"insertBefore",
"(",
"newNode",
",",
"referenceNode",
")",
";",
"}"
]
| Inserts the new node as the previous sibling of the reference node
@method insertBefore
@param {String | HTMLElement} newNode The node to be inserted
@param {String | HTMLElement} referenceNode The node to insert the new node before
@return {HTMLElement} The node that was inserted (or null if insert fails) | [
"Inserts",
"the",
"new",
"node",
"as",
"the",
"previous",
"sibling",
"of",
"the",
"reference",
"node"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dom/dom.js#L1196-L1205 |
|
42,759 | neyric/webhookit | public/javascripts/yui/stylesheet/stylesheet.js | function (sel) {
var rule,css;
if (lang.isString(sel)) {
// IE's addRule doesn't support multiple comma delimited
// selectors so rules are mapped internally by atomic selectors
rule = cssRules[sel.split(/\s*,\s*/)[0]];
return rule ? rule.style.cssText : null;
} else {
css = [];
for (sel in cssRules) {
if (cssRules.hasOwnProperty(sel)) {
rule = cssRules[sel];
css.push(rule.selectorText+" {"+rule.style.cssText+"}");
}
}
return css.join("\n");
}
} | javascript | function (sel) {
var rule,css;
if (lang.isString(sel)) {
// IE's addRule doesn't support multiple comma delimited
// selectors so rules are mapped internally by atomic selectors
rule = cssRules[sel.split(/\s*,\s*/)[0]];
return rule ? rule.style.cssText : null;
} else {
css = [];
for (sel in cssRules) {
if (cssRules.hasOwnProperty(sel)) {
rule = cssRules[sel];
css.push(rule.selectorText+" {"+rule.style.cssText+"}");
}
}
return css.join("\n");
}
} | [
"function",
"(",
"sel",
")",
"{",
"var",
"rule",
",",
"css",
";",
"if",
"(",
"lang",
".",
"isString",
"(",
"sel",
")",
")",
"{",
"// IE's addRule doesn't support multiple comma delimited",
"// selectors so rules are mapped internally by atomic selectors",
"rule",
"=",
"cssRules",
"[",
"sel",
".",
"split",
"(",
"/",
"\\s*,\\s*",
"/",
")",
"[",
"0",
"]",
"]",
";",
"return",
"rule",
"?",
"rule",
".",
"style",
".",
"cssText",
":",
"null",
";",
"}",
"else",
"{",
"css",
"=",
"[",
"]",
";",
"for",
"(",
"sel",
"in",
"cssRules",
")",
"{",
"if",
"(",
"cssRules",
".",
"hasOwnProperty",
"(",
"sel",
")",
")",
"{",
"rule",
"=",
"cssRules",
"[",
"sel",
"]",
";",
"css",
".",
"push",
"(",
"rule",
".",
"selectorText",
"+",
"\" {\"",
"+",
"rule",
".",
"style",
".",
"cssText",
"+",
"\"}\"",
")",
";",
"}",
"}",
"return",
"css",
".",
"join",
"(",
"\"\\n\"",
")",
";",
"}",
"}"
]
| Get the current cssText for a rule or the entire sheet. If the
selector param is supplied, only the cssText for that rule will be
returned, if found. If the selector string targets multiple
selectors separated by commas, the cssText of the first rule only
will be returned. If no selector string, the stylesheet's full
cssText will be returned.
@method getCssText
@param sel {String} Selector string
@return {String} | [
"Get",
"the",
"current",
"cssText",
"for",
"a",
"rule",
"or",
"the",
"entire",
"sheet",
".",
"If",
"the",
"selector",
"param",
"is",
"supplied",
"only",
"the",
"cssText",
"for",
"that",
"rule",
"will",
"be",
"returned",
"if",
"found",
".",
"If",
"the",
"selector",
"string",
"targets",
"multiple",
"selectors",
"separated",
"by",
"commas",
"the",
"cssText",
"of",
"the",
"first",
"rule",
"only",
"will",
"be",
"returned",
".",
"If",
"no",
"selector",
"string",
"the",
"stylesheet",
"s",
"full",
"cssText",
"will",
"be",
"returned",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/stylesheet/stylesheet.js#L406-L425 |
|
42,760 | neyric/webhookit | public/javascripts/yui/stylesheet/stylesheet.js | function (name,sheet) {
return !!(name && sheet instanceof StyleSheet &&
!sheets[name] && (sheets[name] = sheet));
} | javascript | function (name,sheet) {
return !!(name && sheet instanceof StyleSheet &&
!sheets[name] && (sheets[name] = sheet));
} | [
"function",
"(",
"name",
",",
"sheet",
")",
"{",
"return",
"!",
"!",
"(",
"name",
"&&",
"sheet",
"instanceof",
"StyleSheet",
"&&",
"!",
"sheets",
"[",
"name",
"]",
"&&",
"(",
"sheets",
"[",
"name",
"]",
"=",
"sheet",
")",
")",
";",
"}"
]
| Registers a StyleSheet instance in the static registry by the given name
@method StyleSheet.register
@param name {String} the name to assign the StyleSheet in the registry
@param sheet {StyleSheet} The StyleSheet instance
@return {Boolean} false if no name or sheet is not a StyleSheet
instance. true otherwise.
@static | [
"Registers",
"a",
"StyleSheet",
"instance",
"in",
"the",
"static",
"registry",
"by",
"the",
"given",
"name"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/stylesheet/stylesheet.js#L502-L505 |
|
42,761 | neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function(el, node) {
this.logger.log("animating expand");
if (this._expandAnim && this._animCount < this.maxAnim) {
// this.locked = true;
var tree = this;
var a = Widget.TVAnim.getAnim(this._expandAnim, el,
function() { tree.expandComplete(node); });
if (a) {
++this._animCount;
this.fireEvent("animStart", {
"node": node,
"type": "expand"
});
a.animate();
}
return true;
}
return false;
} | javascript | function(el, node) {
this.logger.log("animating expand");
if (this._expandAnim && this._animCount < this.maxAnim) {
// this.locked = true;
var tree = this;
var a = Widget.TVAnim.getAnim(this._expandAnim, el,
function() { tree.expandComplete(node); });
if (a) {
++this._animCount;
this.fireEvent("animStart", {
"node": node,
"type": "expand"
});
a.animate();
}
return true;
}
return false;
} | [
"function",
"(",
"el",
",",
"node",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"animating expand\"",
")",
";",
"if",
"(",
"this",
".",
"_expandAnim",
"&&",
"this",
".",
"_animCount",
"<",
"this",
".",
"maxAnim",
")",
"{",
"// this.locked = true;",
"var",
"tree",
"=",
"this",
";",
"var",
"a",
"=",
"Widget",
".",
"TVAnim",
".",
"getAnim",
"(",
"this",
".",
"_expandAnim",
",",
"el",
",",
"function",
"(",
")",
"{",
"tree",
".",
"expandComplete",
"(",
"node",
")",
";",
"}",
")",
";",
"if",
"(",
"a",
")",
"{",
"++",
"this",
".",
"_animCount",
";",
"this",
".",
"fireEvent",
"(",
"\"animStart\"",
",",
"{",
"\"node\"",
":",
"node",
",",
"\"type\"",
":",
"\"expand\"",
"}",
")",
";",
"a",
".",
"animate",
"(",
")",
";",
"}",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
]
| Perform the expand animation if configured, or just show the
element if not configured or too many animations are in progress
@method animateExpand
@param el {HTMLElement} the element to animate
@param node {YAHOO.util.Node} the node that was expanded
@return {boolean} true if animation could be invoked, false otherwise | [
"Perform",
"the",
"expand",
"animation",
"if",
"configured",
"or",
"just",
"show",
"the",
"element",
"if",
"not",
"configured",
"or",
"too",
"many",
"animations",
"are",
"in",
"progress"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L182-L203 |
|
42,762 | neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function(el, node) {
this.logger.log("animating collapse");
if (this._collapseAnim && this._animCount < this.maxAnim) {
// this.locked = true;
var tree = this;
var a = Widget.TVAnim.getAnim(this._collapseAnim, el,
function() { tree.collapseComplete(node); });
if (a) {
++this._animCount;
this.fireEvent("animStart", {
"node": node,
"type": "collapse"
});
a.animate();
}
return true;
}
return false;
} | javascript | function(el, node) {
this.logger.log("animating collapse");
if (this._collapseAnim && this._animCount < this.maxAnim) {
// this.locked = true;
var tree = this;
var a = Widget.TVAnim.getAnim(this._collapseAnim, el,
function() { tree.collapseComplete(node); });
if (a) {
++this._animCount;
this.fireEvent("animStart", {
"node": node,
"type": "collapse"
});
a.animate();
}
return true;
}
return false;
} | [
"function",
"(",
"el",
",",
"node",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"animating collapse\"",
")",
";",
"if",
"(",
"this",
".",
"_collapseAnim",
"&&",
"this",
".",
"_animCount",
"<",
"this",
".",
"maxAnim",
")",
"{",
"// this.locked = true;",
"var",
"tree",
"=",
"this",
";",
"var",
"a",
"=",
"Widget",
".",
"TVAnim",
".",
"getAnim",
"(",
"this",
".",
"_collapseAnim",
",",
"el",
",",
"function",
"(",
")",
"{",
"tree",
".",
"collapseComplete",
"(",
"node",
")",
";",
"}",
")",
";",
"if",
"(",
"a",
")",
"{",
"++",
"this",
".",
"_animCount",
";",
"this",
".",
"fireEvent",
"(",
"\"animStart\"",
",",
"{",
"\"node\"",
":",
"node",
",",
"\"type\"",
":",
"\"collapse\"",
"}",
")",
";",
"a",
".",
"animate",
"(",
")",
";",
"}",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
]
| Perform the collapse animation if configured, or just show the
element if not configured or too many animations are in progress
@method animateCollapse
@param el {HTMLElement} the element to animate
@param node {YAHOO.util.Node} the node that was expanded
@return {boolean} true if animation could be invoked, false otherwise | [
"Perform",
"the",
"collapse",
"animation",
"if",
"configured",
"or",
"just",
"show",
"the",
"element",
"if",
"not",
"configured",
"or",
"too",
"many",
"animations",
"are",
"in",
"progress"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L213-L234 |
|
42,763 | neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function(node) {
if (node.expanded) {
// wait until the animation is complete before deleting to
// avoid javascript errors
if (this._collapseAnim) {
this.subscribe("animComplete",
this._removeChildren_animComplete, this, true);
Widget.Node.prototype.collapse.call(node);
return;
}
node.collapse();
}
this.logger.log("Removing children for " + node);
while (node.children.length) {
this._deleteNode(node.children[0]);
}
if (node.isRoot()) {
Widget.Node.prototype.expand.call(node);
}
node.childrenRendered = false;
node.dynamicLoadComplete = false;
node.updateIcon();
} | javascript | function(node) {
if (node.expanded) {
// wait until the animation is complete before deleting to
// avoid javascript errors
if (this._collapseAnim) {
this.subscribe("animComplete",
this._removeChildren_animComplete, this, true);
Widget.Node.prototype.collapse.call(node);
return;
}
node.collapse();
}
this.logger.log("Removing children for " + node);
while (node.children.length) {
this._deleteNode(node.children[0]);
}
if (node.isRoot()) {
Widget.Node.prototype.expand.call(node);
}
node.childrenRendered = false;
node.dynamicLoadComplete = false;
node.updateIcon();
} | [
"function",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"expanded",
")",
"{",
"// wait until the animation is complete before deleting to",
"// avoid javascript errors",
"if",
"(",
"this",
".",
"_collapseAnim",
")",
"{",
"this",
".",
"subscribe",
"(",
"\"animComplete\"",
",",
"this",
".",
"_removeChildren_animComplete",
",",
"this",
",",
"true",
")",
";",
"Widget",
".",
"Node",
".",
"prototype",
".",
"collapse",
".",
"call",
"(",
"node",
")",
";",
"return",
";",
"}",
"node",
".",
"collapse",
"(",
")",
";",
"}",
"this",
".",
"logger",
".",
"log",
"(",
"\"Removing children for \"",
"+",
"node",
")",
";",
"while",
"(",
"node",
".",
"children",
".",
"length",
")",
"{",
"this",
".",
"_deleteNode",
"(",
"node",
".",
"children",
"[",
"0",
"]",
")",
";",
"}",
"if",
"(",
"node",
".",
"isRoot",
"(",
")",
")",
"{",
"Widget",
".",
"Node",
".",
"prototype",
".",
"expand",
".",
"call",
"(",
"node",
")",
";",
"}",
"node",
".",
"childrenRendered",
"=",
"false",
";",
"node",
".",
"dynamicLoadComplete",
"=",
"false",
";",
"node",
".",
"updateIcon",
"(",
")",
";",
"}"
]
| Deletes this nodes child collection, recursively. Also collapses
the node, and resets the dynamic load flag. The primary use for
this method is to purge a node and allow it to fetch its data
dynamically again.
@method removeChildren
@param {Node} node the node to purge | [
"Deletes",
"this",
"nodes",
"child",
"collection",
"recursively",
".",
"Also",
"collapses",
"the",
"node",
"and",
"resets",
"the",
"dynamic",
"load",
"flag",
".",
"The",
"primary",
"use",
"for",
"this",
"method",
"is",
"to",
"purge",
"a",
"node",
"and",
"allow",
"it",
"to",
"fetch",
"its",
"data",
"dynamically",
"again",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L1130-L1158 |
|
42,764 | neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function(node) {
this.logger.log("insertAfter: " + node);
var p = node.parent;
if (p) {
if (this.tree) {
this.tree.popNode(this);
}
var refIndex = node.isChildOf(p);
this.logger.log(refIndex);
if (!node.nextSibling) {
this.nextSibling = null;
return this.appendTo(p);
}
p.children.splice(refIndex + 1, 0, this);
node.nextSibling.previousSibling = this;
this.previousSibling = node;
this.nextSibling = node.nextSibling;
node.nextSibling = this;
this.applyParent(p);
}
return this;
} | javascript | function(node) {
this.logger.log("insertAfter: " + node);
var p = node.parent;
if (p) {
if (this.tree) {
this.tree.popNode(this);
}
var refIndex = node.isChildOf(p);
this.logger.log(refIndex);
if (!node.nextSibling) {
this.nextSibling = null;
return this.appendTo(p);
}
p.children.splice(refIndex + 1, 0, this);
node.nextSibling.previousSibling = this;
this.previousSibling = node;
this.nextSibling = node.nextSibling;
node.nextSibling = this;
this.applyParent(p);
}
return this;
} | [
"function",
"(",
"node",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"insertAfter: \"",
"+",
"node",
")",
";",
"var",
"p",
"=",
"node",
".",
"parent",
";",
"if",
"(",
"p",
")",
"{",
"if",
"(",
"this",
".",
"tree",
")",
"{",
"this",
".",
"tree",
".",
"popNode",
"(",
"this",
")",
";",
"}",
"var",
"refIndex",
"=",
"node",
".",
"isChildOf",
"(",
"p",
")",
";",
"this",
".",
"logger",
".",
"log",
"(",
"refIndex",
")",
";",
"if",
"(",
"!",
"node",
".",
"nextSibling",
")",
"{",
"this",
".",
"nextSibling",
"=",
"null",
";",
"return",
"this",
".",
"appendTo",
"(",
"p",
")",
";",
"}",
"p",
".",
"children",
".",
"splice",
"(",
"refIndex",
"+",
"1",
",",
"0",
",",
"this",
")",
";",
"node",
".",
"nextSibling",
".",
"previousSibling",
"=",
"this",
";",
"this",
".",
"previousSibling",
"=",
"node",
";",
"this",
".",
"nextSibling",
"=",
"node",
".",
"nextSibling",
";",
"node",
".",
"nextSibling",
"=",
"this",
";",
"this",
".",
"applyParent",
"(",
"p",
")",
";",
"}",
"return",
"this",
";",
"}"
]
| Inserts this node after the supplied node
@method insertAfter
@param node {Node} the node to insert after
@return {Node} the inserted node | [
"Inserts",
"this",
"node",
"after",
"the",
"supplied",
"node"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L1836-L1864 |
|
42,765 | neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function() {
// this.logger.log("No children, " + " isDyanmic: " + this.isDynamic() + " expanded: " + this.expanded);
if (this.isLoading) {
this.logger.log("returning the loading icon");
return "ygtvloading";
} else {
// location top or bottom, middle nodes also get the top style
var loc = (this.nextSibling) ? "t" : "l";
// type p=plus(expand), m=minus(collapase), n=none(no children)
var type = "n";
if (this.hasChildren(true) || (this.isDynamic() && !this.getIconMode())) {
// if (this.hasChildren(true)) {
type = (this.expanded) ? "m" : "p";
}
// this.logger.log("ygtv" + loc + type);
return "ygtv" + loc + type;
}
} | javascript | function() {
// this.logger.log("No children, " + " isDyanmic: " + this.isDynamic() + " expanded: " + this.expanded);
if (this.isLoading) {
this.logger.log("returning the loading icon");
return "ygtvloading";
} else {
// location top or bottom, middle nodes also get the top style
var loc = (this.nextSibling) ? "t" : "l";
// type p=plus(expand), m=minus(collapase), n=none(no children)
var type = "n";
if (this.hasChildren(true) || (this.isDynamic() && !this.getIconMode())) {
// if (this.hasChildren(true)) {
type = (this.expanded) ? "m" : "p";
}
// this.logger.log("ygtv" + loc + type);
return "ygtv" + loc + type;
}
} | [
"function",
"(",
")",
"{",
"// this.logger.log(\"No children, \" + \" isDyanmic: \" + this.isDynamic() + \" expanded: \" + this.expanded);",
"if",
"(",
"this",
".",
"isLoading",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"returning the loading icon\"",
")",
";",
"return",
"\"ygtvloading\"",
";",
"}",
"else",
"{",
"// location top or bottom, middle nodes also get the top style",
"var",
"loc",
"=",
"(",
"this",
".",
"nextSibling",
")",
"?",
"\"t\"",
":",
"\"l\"",
";",
"// type p=plus(expand), m=minus(collapase), n=none(no children)",
"var",
"type",
"=",
"\"n\"",
";",
"if",
"(",
"this",
".",
"hasChildren",
"(",
"true",
")",
"||",
"(",
"this",
".",
"isDynamic",
"(",
")",
"&&",
"!",
"this",
".",
"getIconMode",
"(",
")",
")",
")",
"{",
"// if (this.hasChildren(true)) {",
"type",
"=",
"(",
"this",
".",
"expanded",
")",
"?",
"\"m\"",
":",
"\"p\"",
";",
"}",
"// this.logger.log(\"ygtv\" + loc + type);",
"return",
"\"ygtv\"",
"+",
"loc",
"+",
"type",
";",
"}",
"}"
]
| Returns the css style name for the toggle
@method getStyle
@return {string} the css class for this node's toggle | [
"Returns",
"the",
"css",
"style",
"name",
"for",
"the",
"toggle"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L2154-L2173 |
|
42,766 | neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function() {
this.logger.log("rendering children for " + this.index);
var node = this;
if (this.isDynamic() && !this.dynamicLoadComplete) {
this.isLoading = true;
this.tree.locked = true;
if (this.dataLoader) {
this.logger.log("Using dynamic loader defined for this node");
setTimeout(
function() {
node.dataLoader(node,
function() {
node.loadComplete();
});
}, 10);
} else if (this.tree.root.dataLoader) {
this.logger.log("Using the tree-level dynamic loader");
setTimeout(
function() {
node.tree.root.dataLoader(node,
function() {
node.loadComplete();
});
}, 10);
} else {
this.logger.log("no loader found");
return "Error: data loader not found or not specified.";
}
return "";
} else {
return this.completeRender();
}
} | javascript | function() {
this.logger.log("rendering children for " + this.index);
var node = this;
if (this.isDynamic() && !this.dynamicLoadComplete) {
this.isLoading = true;
this.tree.locked = true;
if (this.dataLoader) {
this.logger.log("Using dynamic loader defined for this node");
setTimeout(
function() {
node.dataLoader(node,
function() {
node.loadComplete();
});
}, 10);
} else if (this.tree.root.dataLoader) {
this.logger.log("Using the tree-level dynamic loader");
setTimeout(
function() {
node.tree.root.dataLoader(node,
function() {
node.loadComplete();
});
}, 10);
} else {
this.logger.log("no loader found");
return "Error: data loader not found or not specified.";
}
return "";
} else {
return this.completeRender();
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"rendering children for \"",
"+",
"this",
".",
"index",
")",
";",
"var",
"node",
"=",
"this",
";",
"if",
"(",
"this",
".",
"isDynamic",
"(",
")",
"&&",
"!",
"this",
".",
"dynamicLoadComplete",
")",
"{",
"this",
".",
"isLoading",
"=",
"true",
";",
"this",
".",
"tree",
".",
"locked",
"=",
"true",
";",
"if",
"(",
"this",
".",
"dataLoader",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"Using dynamic loader defined for this node\"",
")",
";",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"node",
".",
"dataLoader",
"(",
"node",
",",
"function",
"(",
")",
"{",
"node",
".",
"loadComplete",
"(",
")",
";",
"}",
")",
";",
"}",
",",
"10",
")",
";",
"}",
"else",
"if",
"(",
"this",
".",
"tree",
".",
"root",
".",
"dataLoader",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"Using the tree-level dynamic loader\"",
")",
";",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"node",
".",
"tree",
".",
"root",
".",
"dataLoader",
"(",
"node",
",",
"function",
"(",
")",
"{",
"node",
".",
"loadComplete",
"(",
")",
";",
"}",
")",
";",
"}",
",",
"10",
")",
";",
"}",
"else",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"no loader found\"",
")",
";",
"return",
"\"Error: data loader not found or not specified.\"",
";",
"}",
"return",
"\"\"",
";",
"}",
"else",
"{",
"return",
"this",
".",
"completeRender",
"(",
")",
";",
"}",
"}"
]
| Generates the markup for the child nodes. This is not done until the node
is expanded.
@method renderChildren
@return {string} the html for this node's children
@private | [
"Generates",
"the",
"markup",
"for",
"the",
"child",
"nodes",
".",
"This",
"is",
"not",
"done",
"until",
"the",
"node",
"is",
"expanded",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L2373-L2415 |
|
42,767 | neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function() {
this.logger.log(this.index + " loadComplete, children: " + this.children.length);
this.getChildrenEl().innerHTML = this.completeRender();
if (this.propagateHighlightDown) {
if (this.highlightState === 1 && !this.tree.singleNodeHighlight) {
for (var i = 0; i < this.children.length; i++) {
this.children[i].highlight(true);
}
} else if (this.highlightState === 0 || this.tree.singleNodeHighlight) {
for (i = 0; i < this.children.length; i++) {
this.children[i].unhighlight(true);
}
} // if (highlighState == 2) leave child nodes with whichever highlight state they are set
}
this.dynamicLoadComplete = true;
this.isLoading = false;
this.expand(true);
this.tree.locked = false;
} | javascript | function() {
this.logger.log(this.index + " loadComplete, children: " + this.children.length);
this.getChildrenEl().innerHTML = this.completeRender();
if (this.propagateHighlightDown) {
if (this.highlightState === 1 && !this.tree.singleNodeHighlight) {
for (var i = 0; i < this.children.length; i++) {
this.children[i].highlight(true);
}
} else if (this.highlightState === 0 || this.tree.singleNodeHighlight) {
for (i = 0; i < this.children.length; i++) {
this.children[i].unhighlight(true);
}
} // if (highlighState == 2) leave child nodes with whichever highlight state they are set
}
this.dynamicLoadComplete = true;
this.isLoading = false;
this.expand(true);
this.tree.locked = false;
} | [
"function",
"(",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"this",
".",
"index",
"+",
"\" loadComplete, children: \"",
"+",
"this",
".",
"children",
".",
"length",
")",
";",
"this",
".",
"getChildrenEl",
"(",
")",
".",
"innerHTML",
"=",
"this",
".",
"completeRender",
"(",
")",
";",
"if",
"(",
"this",
".",
"propagateHighlightDown",
")",
"{",
"if",
"(",
"this",
".",
"highlightState",
"===",
"1",
"&&",
"!",
"this",
".",
"tree",
".",
"singleNodeHighlight",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"children",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"children",
"[",
"i",
"]",
".",
"highlight",
"(",
"true",
")",
";",
"}",
"}",
"else",
"if",
"(",
"this",
".",
"highlightState",
"===",
"0",
"||",
"this",
".",
"tree",
".",
"singleNodeHighlight",
")",
"{",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"children",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"children",
"[",
"i",
"]",
".",
"unhighlight",
"(",
"true",
")",
";",
"}",
"}",
"// if (highlighState == 2) leave child nodes with whichever highlight state they are set",
"}",
"this",
".",
"dynamicLoadComplete",
"=",
"true",
";",
"this",
".",
"isLoading",
"=",
"false",
";",
"this",
".",
"expand",
"(",
"true",
")",
";",
"this",
".",
"tree",
".",
"locked",
"=",
"false",
";",
"}"
]
| Load complete is the callback function we pass to the data provider
in dynamic load situations.
@method loadComplete | [
"Load",
"complete",
"is",
"the",
"callback",
"function",
"we",
"pass",
"to",
"the",
"data",
"provider",
"in",
"dynamic",
"load",
"situations",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L2441-L2460 |
|
42,768 | neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function() {
this.logger.log("Generating html");
var sb = [];
sb[sb.length] = '<table id="ygtvtableel' + this.index + '" border="0" cellpadding="0" cellspacing="0" class="ygtvtable ygtvdepth' + this.depth;
if (this.enableHighlight) {
sb[sb.length] = ' ygtv-highlight' + this.highlightState;
}
if (this.className) {
sb[sb.length] = ' ' + this.className;
}
sb[sb.length] = '"><tr class="ygtvrow">';
for (var i=0;i<this.depth;++i) {
sb[sb.length] = '<td class="ygtvcell ' + this.getDepthStyle(i) + '"><div class="ygtvspacer"></div></td>';
}
if (this.hasIcon) {
sb[sb.length] = '<td id="' + this.getToggleElId();
sb[sb.length] = '" class="ygtvcell ';
sb[sb.length] = this.getStyle() ;
sb[sb.length] = '"><a href="#" class="ygtvspacer"> </a></td>';
}
sb[sb.length] = '<td id="' + this.contentElId;
sb[sb.length] = '" class="ygtvcell ';
sb[sb.length] = this.contentStyle + ' ygtvcontent" ';
sb[sb.length] = (this.nowrap) ? ' nowrap="nowrap" ' : '';
sb[sb.length] = ' >';
sb[sb.length] = this.getContentHtml();
sb[sb.length] = '</td></tr></table>';
return sb.join("");
} | javascript | function() {
this.logger.log("Generating html");
var sb = [];
sb[sb.length] = '<table id="ygtvtableel' + this.index + '" border="0" cellpadding="0" cellspacing="0" class="ygtvtable ygtvdepth' + this.depth;
if (this.enableHighlight) {
sb[sb.length] = ' ygtv-highlight' + this.highlightState;
}
if (this.className) {
sb[sb.length] = ' ' + this.className;
}
sb[sb.length] = '"><tr class="ygtvrow">';
for (var i=0;i<this.depth;++i) {
sb[sb.length] = '<td class="ygtvcell ' + this.getDepthStyle(i) + '"><div class="ygtvspacer"></div></td>';
}
if (this.hasIcon) {
sb[sb.length] = '<td id="' + this.getToggleElId();
sb[sb.length] = '" class="ygtvcell ';
sb[sb.length] = this.getStyle() ;
sb[sb.length] = '"><a href="#" class="ygtvspacer"> </a></td>';
}
sb[sb.length] = '<td id="' + this.contentElId;
sb[sb.length] = '" class="ygtvcell ';
sb[sb.length] = this.contentStyle + ' ygtvcontent" ';
sb[sb.length] = (this.nowrap) ? ' nowrap="nowrap" ' : '';
sb[sb.length] = ' >';
sb[sb.length] = this.getContentHtml();
sb[sb.length] = '</td></tr></table>';
return sb.join("");
} | [
"function",
"(",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"Generating html\"",
")",
";",
"var",
"sb",
"=",
"[",
"]",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'<table id=\"ygtvtableel'",
"+",
"this",
".",
"index",
"+",
"'\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"ygtvtable ygtvdepth'",
"+",
"this",
".",
"depth",
";",
"if",
"(",
"this",
".",
"enableHighlight",
")",
"{",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"' ygtv-highlight'",
"+",
"this",
".",
"highlightState",
";",
"}",
"if",
"(",
"this",
".",
"className",
")",
"{",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"' '",
"+",
"this",
".",
"className",
";",
"}",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'\"><tr class=\"ygtvrow\">'",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"depth",
";",
"++",
"i",
")",
"{",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'<td class=\"ygtvcell '",
"+",
"this",
".",
"getDepthStyle",
"(",
"i",
")",
"+",
"'\"><div class=\"ygtvspacer\"></div></td>'",
";",
"}",
"if",
"(",
"this",
".",
"hasIcon",
")",
"{",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'<td id=\"'",
"+",
"this",
".",
"getToggleElId",
"(",
")",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'\" class=\"ygtvcell '",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"this",
".",
"getStyle",
"(",
")",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'\"><a href=\"#\" class=\"ygtvspacer\"> </a></td>'",
";",
"}",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'<td id=\"'",
"+",
"this",
".",
"contentElId",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'\" class=\"ygtvcell '",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"this",
".",
"contentStyle",
"+",
"' ygtvcontent\" '",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"(",
"this",
".",
"nowrap",
")",
"?",
"' nowrap=\"nowrap\" '",
":",
"''",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"' >'",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"this",
".",
"getContentHtml",
"(",
")",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'</td></tr></table>'",
";",
"return",
"sb",
".",
"join",
"(",
"\"\"",
")",
";",
"}"
]
| Get the markup for the node. This may be overrided so that we can
support different types of nodes.
@method getNodeHtml
@return {string} The HTML that will render this node. | [
"Get",
"the",
"markup",
"for",
"the",
"node",
".",
"This",
"may",
"be",
"overrided",
"so",
"that",
"we",
"can",
"support",
"different",
"types",
"of",
"nodes",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L2503-L2537 |
|
42,769 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(r, g, b) {
if (isArray(r)) {
return this.rgb2hex.apply(this, r);
}
var f=this.dec2hex;
return f(r) + f(g) + f(b);
} | javascript | function(r, g, b) {
if (isArray(r)) {
return this.rgb2hex.apply(this, r);
}
var f=this.dec2hex;
return f(r) + f(g) + f(b);
} | [
"function",
"(",
"r",
",",
"g",
",",
"b",
")",
"{",
"if",
"(",
"isArray",
"(",
"r",
")",
")",
"{",
"return",
"this",
".",
"rgb2hex",
".",
"apply",
"(",
"this",
",",
"r",
")",
";",
"}",
"var",
"f",
"=",
"this",
".",
"dec2hex",
";",
"return",
"f",
"(",
"r",
")",
"+",
"f",
"(",
"g",
")",
"+",
"f",
"(",
"b",
")",
";",
"}"
]
| Converts decimal rgb values into a hex string
255,255,255 -> FFFFFF
@method rgb2hex
@param r {int|[int, int, int]} the red value, or an
array containing all three parameters
@param g {int} the green value
@param b {int} the blue value
@return {string} the hex string | [
"Converts",
"decimal",
"rgb",
"values",
"into",
"a",
"hex",
"string",
"255",
"255",
"255",
"-",
">",
"FFFFFF"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L121-L128 |
|
42,770 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(n) {
n = parseInt(n,10)|0;
n = (n > 255 || n < 0) ? 0 : n;
return (ZERO+n.toString(16)).slice(-2).toUpperCase();
} | javascript | function(n) {
n = parseInt(n,10)|0;
n = (n > 255 || n < 0) ? 0 : n;
return (ZERO+n.toString(16)).slice(-2).toUpperCase();
} | [
"function",
"(",
"n",
")",
"{",
"n",
"=",
"parseInt",
"(",
"n",
",",
"10",
")",
"|",
"0",
";",
"n",
"=",
"(",
"n",
">",
"255",
"||",
"n",
"<",
"0",
")",
"?",
"0",
":",
"n",
";",
"return",
"(",
"ZERO",
"+",
"n",
".",
"toString",
"(",
"16",
")",
")",
".",
"slice",
"(",
"-",
"2",
")",
".",
"toUpperCase",
"(",
")",
";",
"}"
]
| Converts an int 0...255 to hex pair 00...FF
@method dec2hex
@param n {int} the number to convert
@return {string} the hex equivalent | [
"Converts",
"an",
"int",
"0",
"...",
"255",
"to",
"hex",
"pair",
"00",
"...",
"FF"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L136-L141 |
|
42,771 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(s) {
var f = this.hex2dec;
return [f(s.slice(0, 2)), f(s.slice(2, 4)), f(s.slice(4, 6))];
} | javascript | function(s) {
var f = this.hex2dec;
return [f(s.slice(0, 2)), f(s.slice(2, 4)), f(s.slice(4, 6))];
} | [
"function",
"(",
"s",
")",
"{",
"var",
"f",
"=",
"this",
".",
"hex2dec",
";",
"return",
"[",
"f",
"(",
"s",
".",
"slice",
"(",
"0",
",",
"2",
")",
")",
",",
"f",
"(",
"s",
".",
"slice",
"(",
"2",
",",
"4",
")",
")",
",",
"f",
"(",
"s",
".",
"slice",
"(",
"4",
",",
"6",
")",
")",
"]",
";",
"}"
]
| Converts a hex string to rgb
@method hex2rgb
@param str {string} the hex string
@return {[int, int, int]} an array containing the rgb values | [
"Converts",
"a",
"hex",
"string",
"to",
"rgb"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L159-L162 |
|
42,772 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(r, g, b) {
if (isArray(r)) {
return this.websafe.apply(this, r);
}
// returns the closest match [0, 51, 102, 153, 204, 255]
var f = function(v) {
if (isNumber(v)) {
v = Math.min(Math.max(0, v), 255);
var i, next;
for (i=0; i<256; i=i+51) {
next = i+51;
if (v >= i && v <= next) {
return (v-i > 25) ? next : i;
}
}
}
return v;
};
return [f(r), f(g), f(b)];
} | javascript | function(r, g, b) {
if (isArray(r)) {
return this.websafe.apply(this, r);
}
// returns the closest match [0, 51, 102, 153, 204, 255]
var f = function(v) {
if (isNumber(v)) {
v = Math.min(Math.max(0, v), 255);
var i, next;
for (i=0; i<256; i=i+51) {
next = i+51;
if (v >= i && v <= next) {
return (v-i > 25) ? next : i;
}
}
}
return v;
};
return [f(r), f(g), f(b)];
} | [
"function",
"(",
"r",
",",
"g",
",",
"b",
")",
"{",
"if",
"(",
"isArray",
"(",
"r",
")",
")",
"{",
"return",
"this",
".",
"websafe",
".",
"apply",
"(",
"this",
",",
"r",
")",
";",
"}",
"// returns the closest match [0, 51, 102, 153, 204, 255]",
"var",
"f",
"=",
"function",
"(",
"v",
")",
"{",
"if",
"(",
"isNumber",
"(",
"v",
")",
")",
"{",
"v",
"=",
"Math",
".",
"min",
"(",
"Math",
".",
"max",
"(",
"0",
",",
"v",
")",
",",
"255",
")",
";",
"var",
"i",
",",
"next",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"256",
";",
"i",
"=",
"i",
"+",
"51",
")",
"{",
"next",
"=",
"i",
"+",
"51",
";",
"if",
"(",
"v",
">=",
"i",
"&&",
"v",
"<=",
"next",
")",
"{",
"return",
"(",
"v",
"-",
"i",
">",
"25",
")",
"?",
"next",
":",
"i",
";",
"}",
"}",
"}",
"return",
"v",
";",
"}",
";",
"return",
"[",
"f",
"(",
"r",
")",
",",
"f",
"(",
"g",
")",
",",
"f",
"(",
"b",
")",
"]",
";",
"}"
]
| Returns the closest websafe color to the supplied rgb value.
@method websafe
@param r {int|[int, int, int]} the red value, or an
array containing all three parameters
@param g {int} the green value
@param b {int} the blue value
@return {[int, int, int]} an array containing the closes
websafe rgb colors. | [
"Returns",
"the",
"closest",
"websafe",
"color",
"to",
"the",
"supplied",
"rgb",
"value",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L174-L197 |
|
42,773 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | ColorPicker | function ColorPicker(el, attr) {
_pickercount = _pickercount + 1;
attr = attr || {};
if (arguments.length === 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
attr = el; // treat first arg as attr object
el = attr.element || null;
}
if (!el && !attr.element) { // create if we dont have one
el = this._createHostElement(attr);
}
ColorPicker.superclass.constructor.call(this, el, attr);
this.initPicker();
} | javascript | function ColorPicker(el, attr) {
_pickercount = _pickercount + 1;
attr = attr || {};
if (arguments.length === 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
attr = el; // treat first arg as attr object
el = attr.element || null;
}
if (!el && !attr.element) { // create if we dont have one
el = this._createHostElement(attr);
}
ColorPicker.superclass.constructor.call(this, el, attr);
this.initPicker();
} | [
"function",
"ColorPicker",
"(",
"el",
",",
"attr",
")",
"{",
"_pickercount",
"=",
"_pickercount",
"+",
"1",
";",
"attr",
"=",
"attr",
"||",
"{",
"}",
";",
"if",
"(",
"arguments",
".",
"length",
"===",
"1",
"&&",
"!",
"YAHOO",
".",
"lang",
".",
"isString",
"(",
"el",
")",
"&&",
"!",
"el",
".",
"nodeName",
")",
"{",
"attr",
"=",
"el",
";",
"// treat first arg as attr object",
"el",
"=",
"attr",
".",
"element",
"||",
"null",
";",
"}",
"if",
"(",
"!",
"el",
"&&",
"!",
"attr",
".",
"element",
")",
"{",
"// create if we dont have one",
"el",
"=",
"this",
".",
"_createHostElement",
"(",
"attr",
")",
";",
"}",
"ColorPicker",
".",
"superclass",
".",
"constructor",
".",
"call",
"(",
"this",
",",
"el",
",",
"attr",
")",
";",
"this",
".",
"initPicker",
"(",
")",
";",
"}"
]
| A widget to select colors
@namespace YAHOO.widget
@class YAHOO.widget.ColorPicker
@extends YAHOO.util.Element
@constructor
@param {HTMLElement | String | Object} el(optional) The html
element that represents the colorpicker, or the attribute object to use.
An element will be created if none provided.
@param {Object} attr (optional) A key map of the colorpicker's
initial attributes. Ignored if first arg is attributes object. | [
"A",
"widget",
"to",
"select",
"colors"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L233-L248 |
42,774 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function () {
var el = document.createElement('div');
if (this.CSS.BASE) {
el.className = this.CSS.BASE;
}
return el;
} | javascript | function () {
var el = document.createElement('div');
if (this.CSS.BASE) {
el.className = this.CSS.BASE;
}
return el;
} | [
"function",
"(",
")",
"{",
"var",
"el",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"if",
"(",
"this",
".",
"CSS",
".",
"BASE",
")",
"{",
"el",
".",
"className",
"=",
"this",
".",
"CSS",
".",
"BASE",
";",
"}",
"return",
"el",
";",
"}"
]
| Creates the host element if it doesn't exist
@method _createHostElement
@protected | [
"Creates",
"the",
"host",
"element",
"if",
"it",
"doesn",
"t",
"exist"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L545-L553 |
|
42,775 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(rgb, silent) {
silent = (silent) || false;
this.set(this.OPT.RGB, rgb, silent);
this._updateSliders();
} | javascript | function(rgb, silent) {
silent = (silent) || false;
this.set(this.OPT.RGB, rgb, silent);
this._updateSliders();
} | [
"function",
"(",
"rgb",
",",
"silent",
")",
"{",
"silent",
"=",
"(",
"silent",
")",
"||",
"false",
";",
"this",
".",
"set",
"(",
"this",
".",
"OPT",
".",
"RGB",
",",
"rgb",
",",
"silent",
")",
";",
"this",
".",
"_updateSliders",
"(",
")",
";",
"}"
]
| Sets the control to the specified rgb value and
moves the sliders to the proper positions
@method setValue
@param rgb {[int, int, int]} the rgb value
@param silent {boolean} whether or not to fire the change event | [
"Sets",
"the",
"control",
"to",
"the",
"specified",
"rgb",
"value",
"and",
"moves",
"the",
"sliders",
"to",
"the",
"proper",
"positions"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L614-L618 |
|
42,776 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function() {
var rgb = this.get(this.OPT.RGB),
websafe = this.get(this.OPT.WEBSAFE),
el = this.getElement(this.ID.SWATCH),
color = rgb.join(","),
txt = this.get(this.OPT.TXT);
Dom.setStyle(el, "background-color", "rgb(" + color + ")");
el.title = sub(txt.CURRENT_COLOR, {
"rgb": "#" + this.get(this.OPT.HEX)
});
el = this.getElement(this.ID.WEBSAFE_SWATCH);
color = websafe.join(",");
Dom.setStyle(el, "background-color", "rgb(" + color + ")");
el.title = sub(txt.CLOSEST_WEBSAFE, {
"rgb": "#" + Color.rgb2hex(websafe)
});
} | javascript | function() {
var rgb = this.get(this.OPT.RGB),
websafe = this.get(this.OPT.WEBSAFE),
el = this.getElement(this.ID.SWATCH),
color = rgb.join(","),
txt = this.get(this.OPT.TXT);
Dom.setStyle(el, "background-color", "rgb(" + color + ")");
el.title = sub(txt.CURRENT_COLOR, {
"rgb": "#" + this.get(this.OPT.HEX)
});
el = this.getElement(this.ID.WEBSAFE_SWATCH);
color = websafe.join(",");
Dom.setStyle(el, "background-color", "rgb(" + color + ")");
el.title = sub(txt.CLOSEST_WEBSAFE, {
"rgb": "#" + Color.rgb2hex(websafe)
});
} | [
"function",
"(",
")",
"{",
"var",
"rgb",
"=",
"this",
".",
"get",
"(",
"this",
".",
"OPT",
".",
"RGB",
")",
",",
"websafe",
"=",
"this",
".",
"get",
"(",
"this",
".",
"OPT",
".",
"WEBSAFE",
")",
",",
"el",
"=",
"this",
".",
"getElement",
"(",
"this",
".",
"ID",
".",
"SWATCH",
")",
",",
"color",
"=",
"rgb",
".",
"join",
"(",
"\",\"",
")",
",",
"txt",
"=",
"this",
".",
"get",
"(",
"this",
".",
"OPT",
".",
"TXT",
")",
";",
"Dom",
".",
"setStyle",
"(",
"el",
",",
"\"background-color\"",
",",
"\"rgb(\"",
"+",
"color",
"+",
"\")\"",
")",
";",
"el",
".",
"title",
"=",
"sub",
"(",
"txt",
".",
"CURRENT_COLOR",
",",
"{",
"\"rgb\"",
":",
"\"#\"",
"+",
"this",
".",
"get",
"(",
"this",
".",
"OPT",
".",
"HEX",
")",
"}",
")",
";",
"el",
"=",
"this",
".",
"getElement",
"(",
"this",
".",
"ID",
".",
"WEBSAFE_SWATCH",
")",
";",
"color",
"=",
"websafe",
".",
"join",
"(",
"\",\"",
")",
";",
"Dom",
".",
"setStyle",
"(",
"el",
",",
"\"background-color\"",
",",
"\"rgb(\"",
"+",
"color",
"+",
"\")\"",
")",
";",
"el",
".",
"title",
"=",
"sub",
"(",
"txt",
".",
"CLOSEST_WEBSAFE",
",",
"{",
"\"rgb\"",
":",
"\"#\"",
"+",
"Color",
".",
"rgb2hex",
"(",
"websafe",
")",
"}",
")",
";",
"}"
]
| Updates the background of the swatch with the current rbg value.
Also updates the websafe swatch to the closest websafe color
@method _updateSwatch
@protected | [
"Updates",
"the",
"background",
"of",
"the",
"swatch",
"with",
"the",
"current",
"rbg",
"value",
".",
"Also",
"updates",
"the",
"websafe",
"swatch",
"to",
"the",
"closest",
"websafe",
"color"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L675-L696 |
|
42,777 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(e) {
var c = Event.getCharCode(e);
//alert(Event.getCharCode(e) + ", " + e.keyCode + ", " + e.charCode);
// special keys
if (c === 38) { // up arrow
return 3;
} else if (c === 13) { // return
return 6;
} else if (c === 40) { // down array
return 4;
} else if (c >= 48 && c<=57) { // 0-9
return 1;
} else if (c >= 97 && c<=102) { // a-f
return 2;
} else if (c >= 65 && c<=70) { // A-F
return 2;
//} else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 ||
// (c >= 112 && c <=123)) { // including F-keys
// tab, delete, return, escape, left, right or ctrl/meta sequences
} else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 ||
e.ctrlKey || e.metaKey) { // special chars
return 5;
} else { // something we probably don't want
return 0;
}
} | javascript | function(e) {
var c = Event.getCharCode(e);
//alert(Event.getCharCode(e) + ", " + e.keyCode + ", " + e.charCode);
// special keys
if (c === 38) { // up arrow
return 3;
} else if (c === 13) { // return
return 6;
} else if (c === 40) { // down array
return 4;
} else if (c >= 48 && c<=57) { // 0-9
return 1;
} else if (c >= 97 && c<=102) { // a-f
return 2;
} else if (c >= 65 && c<=70) { // A-F
return 2;
//} else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 ||
// (c >= 112 && c <=123)) { // including F-keys
// tab, delete, return, escape, left, right or ctrl/meta sequences
} else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 ||
e.ctrlKey || e.metaKey) { // special chars
return 5;
} else { // something we probably don't want
return 0;
}
} | [
"function",
"(",
"e",
")",
"{",
"var",
"c",
"=",
"Event",
".",
"getCharCode",
"(",
"e",
")",
";",
"//alert(Event.getCharCode(e) + \", \" + e.keyCode + \", \" + e.charCode);",
"// special keys",
"if",
"(",
"c",
"===",
"38",
")",
"{",
"// up arrow",
"return",
"3",
";",
"}",
"else",
"if",
"(",
"c",
"===",
"13",
")",
"{",
"// return",
"return",
"6",
";",
"}",
"else",
"if",
"(",
"c",
"===",
"40",
")",
"{",
"// down array",
"return",
"4",
";",
"}",
"else",
"if",
"(",
"c",
">=",
"48",
"&&",
"c",
"<=",
"57",
")",
"{",
"// 0-9",
"return",
"1",
";",
"}",
"else",
"if",
"(",
"c",
">=",
"97",
"&&",
"c",
"<=",
"102",
")",
"{",
"// a-f",
"return",
"2",
";",
"}",
"else",
"if",
"(",
"c",
">=",
"65",
"&&",
"c",
"<=",
"70",
")",
"{",
"// A-F",
"return",
"2",
";",
"//} else if (\"8, 9, 13, 27, 37, 39\".indexOf(c) > -1 || ",
"// (c >= 112 && c <=123)) { // including F-keys",
"// tab, delete, return, escape, left, right or ctrl/meta sequences",
"}",
"else",
"if",
"(",
"\"8, 9, 13, 27, 37, 39\"",
".",
"indexOf",
"(",
"c",
")",
">",
"-",
"1",
"||",
"e",
".",
"ctrlKey",
"||",
"e",
".",
"metaKey",
")",
"{",
"// special chars",
"return",
"5",
";",
"}",
"else",
"{",
"// something we probably don't want",
"return",
"0",
";",
"}",
"}"
]
| Key map to well-known commands for txt field input
@method _getCommand
@param e {Event} the keypress or keydown event
@return {int} a command code
<ul>
<li>0 = not a number, letter in range, or special key</li>
<li>1 = number</li>
<li>2 = a-fA-F</li>
<li>3 = increment (up arrow)</li>
<li>4 = decrement (down arrow)</li>
<li>5 = special key (tab, delete, return, escape, left, right)</li>
<li>6 = return</li>
</ul>
@protected | [
"Key",
"map",
"to",
"well",
"-",
"known",
"commands",
"for",
"txt",
"field",
"input"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L790-L817 |
|
42,778 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(e, el, prop) {
var val = el.value;
if (prop !== this.OPT.HEX) {
val = parseInt(val, 10);
}
if (val !== this.get(prop)) {
this.set(prop, val);
}
} | javascript | function(e, el, prop) {
var val = el.value;
if (prop !== this.OPT.HEX) {
val = parseInt(val, 10);
}
if (val !== this.get(prop)) {
this.set(prop, val);
}
} | [
"function",
"(",
"e",
",",
"el",
",",
"prop",
")",
"{",
"var",
"val",
"=",
"el",
".",
"value",
";",
"if",
"(",
"prop",
"!==",
"this",
".",
"OPT",
".",
"HEX",
")",
"{",
"val",
"=",
"parseInt",
"(",
"val",
",",
"10",
")",
";",
"}",
"if",
"(",
"val",
"!==",
"this",
".",
"get",
"(",
"prop",
")",
")",
"{",
"this",
".",
"set",
"(",
"prop",
",",
"val",
")",
";",
"}",
"}"
]
| Use the value of the text field to update the control
@method _useFieldValue
@param e {Event} an event
@param el {HTMLElement} the field
@param prop {string} the key to the linked property
@protected | [
"Use",
"the",
"value",
"of",
"the",
"text",
"field",
"to",
"update",
"the",
"control"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L827-L837 |
|
42,779 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(e, el, prop) {
var command = this._getCommand(e),
inc = (e.shiftKey) ? 10 : 1;
switch (command) {
case 6: // return, update the value
this._useFieldValue.apply(this, arguments);
break;
case 3: // up arrow, increment
this.set(prop, Math.min(this.get(prop)+inc, 255));
this._updateFormFields();
//Event.stopEvent(e);
break;
case 4: // down arrow, decrement
this.set(prop, Math.max(this.get(prop)-inc, 0));
this._updateFormFields();
//Event.stopEvent(e);
break;
default:
}
} | javascript | function(e, el, prop) {
var command = this._getCommand(e),
inc = (e.shiftKey) ? 10 : 1;
switch (command) {
case 6: // return, update the value
this._useFieldValue.apply(this, arguments);
break;
case 3: // up arrow, increment
this.set(prop, Math.min(this.get(prop)+inc, 255));
this._updateFormFields();
//Event.stopEvent(e);
break;
case 4: // down arrow, decrement
this.set(prop, Math.max(this.get(prop)-inc, 0));
this._updateFormFields();
//Event.stopEvent(e);
break;
default:
}
} | [
"function",
"(",
"e",
",",
"el",
",",
"prop",
")",
"{",
"var",
"command",
"=",
"this",
".",
"_getCommand",
"(",
"e",
")",
",",
"inc",
"=",
"(",
"e",
".",
"shiftKey",
")",
"?",
"10",
":",
"1",
";",
"switch",
"(",
"command",
")",
"{",
"case",
"6",
":",
"// return, update the value",
"this",
".",
"_useFieldValue",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"break",
";",
"case",
"3",
":",
"// up arrow, increment",
"this",
".",
"set",
"(",
"prop",
",",
"Math",
".",
"min",
"(",
"this",
".",
"get",
"(",
"prop",
")",
"+",
"inc",
",",
"255",
")",
")",
";",
"this",
".",
"_updateFormFields",
"(",
")",
";",
"//Event.stopEvent(e);",
"break",
";",
"case",
"4",
":",
"// down arrow, decrement",
"this",
".",
"set",
"(",
"prop",
",",
"Math",
".",
"max",
"(",
"this",
".",
"get",
"(",
"prop",
")",
"-",
"inc",
",",
"0",
")",
")",
";",
"this",
".",
"_updateFormFields",
"(",
")",
";",
"//Event.stopEvent(e);",
"break",
";",
"default",
":",
"}",
"}"
]
| Handle keypress on one of the rgb or hsv fields.
@method _rgbFieldKeypress
@param e {Event} the keypress event
@param el {HTMLElement} the field
@param prop {string} the key to the linked property
@protected | [
"Handle",
"keypress",
"on",
"one",
"of",
"the",
"rgb",
"or",
"hsv",
"fields",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L847-L869 |
|
42,780 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(e, el, prop) {
var command = this._getCommand(e);
if (command === 6) { // return, update the value
this._useFieldValue.apply(this, arguments);
}
} | javascript | function(e, el, prop) {
var command = this._getCommand(e);
if (command === 6) { // return, update the value
this._useFieldValue.apply(this, arguments);
}
} | [
"function",
"(",
"e",
",",
"el",
",",
"prop",
")",
"{",
"var",
"command",
"=",
"this",
".",
"_getCommand",
"(",
"e",
")",
";",
"if",
"(",
"command",
"===",
"6",
")",
"{",
"// return, update the value",
"this",
".",
"_useFieldValue",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"}",
"}"
]
| Handle keydown on the hex field
@method _hexFieldKeypress
@param e {Event} the keypress event
@param el {HTMLElement} the field
@param prop {string} the key to the linked property
@protected | [
"Handle",
"keydown",
"on",
"the",
"hex",
"field"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L879-L884 |
|
42,781 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(e, numbersOnly) {
var command = this._getCommand(e);
switch (command) {
case 6: // return
case 5: // special char
case 1: // number
break;
case 2: // hex char (a-f)
if (numbersOnly !== true) {
break;
}
// fallthrough is intentional
default: // prevent alpha and punctuation
Event.stopEvent(e);
return false;
}
} | javascript | function(e, numbersOnly) {
var command = this._getCommand(e);
switch (command) {
case 6: // return
case 5: // special char
case 1: // number
break;
case 2: // hex char (a-f)
if (numbersOnly !== true) {
break;
}
// fallthrough is intentional
default: // prevent alpha and punctuation
Event.stopEvent(e);
return false;
}
} | [
"function",
"(",
"e",
",",
"numbersOnly",
")",
"{",
"var",
"command",
"=",
"this",
".",
"_getCommand",
"(",
"e",
")",
";",
"switch",
"(",
"command",
")",
"{",
"case",
"6",
":",
"// return",
"case",
"5",
":",
"// special char",
"case",
"1",
":",
"// number",
"break",
";",
"case",
"2",
":",
"// hex char (a-f)",
"if",
"(",
"numbersOnly",
"!==",
"true",
")",
"{",
"break",
";",
"}",
"// fallthrough is intentional",
"default",
":",
"// prevent alpha and punctuation",
"Event",
".",
"stopEvent",
"(",
"e",
")",
";",
"return",
"false",
";",
"}",
"}"
]
| Allows numbers and special chars, and by default allows a-f.
Used for the hex field keypress handler.
@method _hexOnly
@param e {Event} the event
@param numbersOnly omits a-f if set to true
@protected
@return {boolean} false if we are canceling the event | [
"Allows",
"numbers",
"and",
"special",
"chars",
"and",
"by",
"default",
"allows",
"a",
"-",
"f",
".",
"Used",
"for",
"the",
"hex",
"field",
"keypress",
"handler",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L895-L913 |
|
42,782 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function () {
var ID = this.ID,
O = this.OPT;
this.hueSlider.subscribe("change",
this._onHueSliderChange, this, true);
this.pickerSlider.subscribe("change",
this._onPickerSliderChange, this, true);
Event.on(this.getElement(ID.WEBSAFE_SWATCH), "click", function(e) {
this.setValue(this.get(O.WEBSAFE));
}, this, true);
Event.on(this.getElement(ID.CONTROLS_LABEL), "click", function(e) {
this.set(O.SHOW_CONTROLS, !this.get(O.SHOW_CONTROLS));
Event.preventDefault(e);
}, this, true);
this._attachRGBHSV(ID.R, O.RED);
this._attachRGBHSV(ID.G, O.GREEN);
this._attachRGBHSV(ID.B, O.BLUE);
this._attachRGBHSV(ID.H, O.HUE);
this._attachRGBHSV(ID.S, O.SATURATION);
this._attachRGBHSV(ID.V, O.VALUE);
Event.on(this.getElement(ID.HEX), "keydown", function(e, me) {
me._hexFieldKeypress(e, this, O.HEX);
}, this);
Event.on(this.getElement(this.ID.HEX), "keypress",
this._hexOnly, this,true);
Event.on(this.getElement(this.ID.HEX), "blur", function(e, me) {
me._useFieldValue(e, this, O.HEX);
}, this);
} | javascript | function () {
var ID = this.ID,
O = this.OPT;
this.hueSlider.subscribe("change",
this._onHueSliderChange, this, true);
this.pickerSlider.subscribe("change",
this._onPickerSliderChange, this, true);
Event.on(this.getElement(ID.WEBSAFE_SWATCH), "click", function(e) {
this.setValue(this.get(O.WEBSAFE));
}, this, true);
Event.on(this.getElement(ID.CONTROLS_LABEL), "click", function(e) {
this.set(O.SHOW_CONTROLS, !this.get(O.SHOW_CONTROLS));
Event.preventDefault(e);
}, this, true);
this._attachRGBHSV(ID.R, O.RED);
this._attachRGBHSV(ID.G, O.GREEN);
this._attachRGBHSV(ID.B, O.BLUE);
this._attachRGBHSV(ID.H, O.HUE);
this._attachRGBHSV(ID.S, O.SATURATION);
this._attachRGBHSV(ID.V, O.VALUE);
Event.on(this.getElement(ID.HEX), "keydown", function(e, me) {
me._hexFieldKeypress(e, this, O.HEX);
}, this);
Event.on(this.getElement(this.ID.HEX), "keypress",
this._hexOnly, this,true);
Event.on(this.getElement(this.ID.HEX), "blur", function(e, me) {
me._useFieldValue(e, this, O.HEX);
}, this);
} | [
"function",
"(",
")",
"{",
"var",
"ID",
"=",
"this",
".",
"ID",
",",
"O",
"=",
"this",
".",
"OPT",
";",
"this",
".",
"hueSlider",
".",
"subscribe",
"(",
"\"change\"",
",",
"this",
".",
"_onHueSliderChange",
",",
"this",
",",
"true",
")",
";",
"this",
".",
"pickerSlider",
".",
"subscribe",
"(",
"\"change\"",
",",
"this",
".",
"_onPickerSliderChange",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"on",
"(",
"this",
".",
"getElement",
"(",
"ID",
".",
"WEBSAFE_SWATCH",
")",
",",
"\"click\"",
",",
"function",
"(",
"e",
")",
"{",
"this",
".",
"setValue",
"(",
"this",
".",
"get",
"(",
"O",
".",
"WEBSAFE",
")",
")",
";",
"}",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"on",
"(",
"this",
".",
"getElement",
"(",
"ID",
".",
"CONTROLS_LABEL",
")",
",",
"\"click\"",
",",
"function",
"(",
"e",
")",
"{",
"this",
".",
"set",
"(",
"O",
".",
"SHOW_CONTROLS",
",",
"!",
"this",
".",
"get",
"(",
"O",
".",
"SHOW_CONTROLS",
")",
")",
";",
"Event",
".",
"preventDefault",
"(",
"e",
")",
";",
"}",
",",
"this",
",",
"true",
")",
";",
"this",
".",
"_attachRGBHSV",
"(",
"ID",
".",
"R",
",",
"O",
".",
"RED",
")",
";",
"this",
".",
"_attachRGBHSV",
"(",
"ID",
".",
"G",
",",
"O",
".",
"GREEN",
")",
";",
"this",
".",
"_attachRGBHSV",
"(",
"ID",
".",
"B",
",",
"O",
".",
"BLUE",
")",
";",
"this",
".",
"_attachRGBHSV",
"(",
"ID",
".",
"H",
",",
"O",
".",
"HUE",
")",
";",
"this",
".",
"_attachRGBHSV",
"(",
"ID",
".",
"S",
",",
"O",
".",
"SATURATION",
")",
";",
"this",
".",
"_attachRGBHSV",
"(",
"ID",
".",
"V",
",",
"O",
".",
"VALUE",
")",
";",
"Event",
".",
"on",
"(",
"this",
".",
"getElement",
"(",
"ID",
".",
"HEX",
")",
",",
"\"keydown\"",
",",
"function",
"(",
"e",
",",
"me",
")",
"{",
"me",
".",
"_hexFieldKeypress",
"(",
"e",
",",
"this",
",",
"O",
".",
"HEX",
")",
";",
"}",
",",
"this",
")",
";",
"Event",
".",
"on",
"(",
"this",
".",
"getElement",
"(",
"this",
".",
"ID",
".",
"HEX",
")",
",",
"\"keypress\"",
",",
"this",
".",
"_hexOnly",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"on",
"(",
"this",
".",
"getElement",
"(",
"this",
".",
"ID",
".",
"HEX",
")",
",",
"\"blur\"",
",",
"function",
"(",
"e",
",",
"me",
")",
"{",
"me",
".",
"_useFieldValue",
"(",
"e",
",",
"this",
",",
"O",
".",
"HEX",
")",
";",
"}",
",",
"this",
")",
";",
"}"
]
| Adds event listeners to Sliders and UI elements. Wires everything
up.
@method _bindUI
@protected | [
"Adds",
"event",
"listeners",
"to",
"Sliders",
"and",
"UI",
"elements",
".",
"Wires",
"everything",
"up",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L1305-L1339 |
|
42,783 | neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(id, on) {
var el = (lang.isString(id) ? this.getElement(id) : id);
Dom.setStyle(el, "display", (on) ? "" : "none");
} | javascript | function(id, on) {
var el = (lang.isString(id) ? this.getElement(id) : id);
Dom.setStyle(el, "display", (on) ? "" : "none");
} | [
"function",
"(",
"id",
",",
"on",
")",
"{",
"var",
"el",
"=",
"(",
"lang",
".",
"isString",
"(",
"id",
")",
"?",
"this",
".",
"getElement",
"(",
"id",
")",
":",
"id",
")",
";",
"Dom",
".",
"setStyle",
"(",
"el",
",",
"\"display\"",
",",
"(",
"on",
")",
"?",
"\"\"",
":",
"\"none\"",
")",
";",
"}"
]
| Returns the cached element reference. If the id is not a string, it
is assumed that it is an element and this is returned.
@param id {string|HTMLElement} the element key, id, or ref
@param on {boolean} hide or show. If true, show
@protected | [
"Returns",
"the",
"cached",
"element",
"reference",
".",
"If",
"the",
"id",
"is",
"not",
"a",
"string",
"it",
"is",
"assumed",
"that",
"it",
"is",
"an",
"element",
"and",
"this",
"is",
"returned",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L1413-L1416 |
|
42,784 | jacoborus/node-filesaver | src/Filesaver.js | function (options) {
var x;
options = options || {};
// Store folders
this.folders = options.folders || {};
this.safenames = options.safenames || false;
// check for existing folders
for (x in this.folders) {
if (!fs.existsSync( this.folders[x] )){
// create folder if not exists
mkdirp( this.folders[x] );
}
}
} | javascript | function (options) {
var x;
options = options || {};
// Store folders
this.folders = options.folders || {};
this.safenames = options.safenames || false;
// check for existing folders
for (x in this.folders) {
if (!fs.existsSync( this.folders[x] )){
// create folder if not exists
mkdirp( this.folders[x] );
}
}
} | [
"function",
"(",
"options",
")",
"{",
"var",
"x",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"// Store folders",
"this",
".",
"folders",
"=",
"options",
".",
"folders",
"||",
"{",
"}",
";",
"this",
".",
"safenames",
"=",
"options",
".",
"safenames",
"||",
"false",
";",
"// check for existing folders",
"for",
"(",
"x",
"in",
"this",
".",
"folders",
")",
"{",
"if",
"(",
"!",
"fs",
".",
"existsSync",
"(",
"this",
".",
"folders",
"[",
"x",
"]",
")",
")",
"{",
"// create folder if not exists",
"mkdirp",
"(",
"this",
".",
"folders",
"[",
"x",
"]",
")",
";",
"}",
"}",
"}"
]
| Filesaver constructor.
Options:
- folders: *Object* with folder routes
- safename: *Boolean* use safe name for files
Example:
```js
var folders = {
images: './images',
books: './books'
}
var filesaver = new Filesaver({
folders: folders,
safenames: true
});
```
@param {Object} options folders and safenames | [
"Filesaver",
"constructor",
"."
]
| 14a6868b1e6e094c3c4a26b471fde4eb63198423 | https://github.com/jacoborus/node-filesaver/blob/14a6868b1e6e094c3c4a26b471fde4eb63198423/src/Filesaver.js#L102-L116 |
|
42,785 | neyric/webhookit | public/javascripts/inputex/js/widgets/Dialog.js | function (callback) {
var fn, scope;
fn = callback.fn;
scope = callback.scope;
if (this.formAvailable) {
fn.call(scope);
} else {
this.formAvailableEvt.subscribe(fn, scope, true);
}
} | javascript | function (callback) {
var fn, scope;
fn = callback.fn;
scope = callback.scope;
if (this.formAvailable) {
fn.call(scope);
} else {
this.formAvailableEvt.subscribe(fn, scope, true);
}
} | [
"function",
"(",
"callback",
")",
"{",
"var",
"fn",
",",
"scope",
";",
"fn",
"=",
"callback",
".",
"fn",
";",
"scope",
"=",
"callback",
".",
"scope",
";",
"if",
"(",
"this",
".",
"formAvailable",
")",
"{",
"fn",
".",
"call",
"(",
"scope",
")",
";",
"}",
"else",
"{",
"this",
".",
"formAvailableEvt",
".",
"subscribe",
"(",
"fn",
",",
"scope",
",",
"true",
")",
";",
"}",
"}"
]
| Execute a callback as soon as the form is available
@param {Object} callback An object like {fn: my_function, scope: my_scope} | [
"Execute",
"a",
"callback",
"as",
"soon",
"as",
"the",
"form",
"is",
"available"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/widgets/Dialog.js#L115-L128 |
|
42,786 | neyric/webhookit | public/javascripts/yui/container/container-debug.js | function (key, value, silent) {
var property;
key = key.toLowerCase();
YAHOO.log("setProperty: " + key + "=" + value, "info", "Config");
if (this.queueInProgress && ! silent) {
// Currently running through a queue...
this.queueProperty(key,value);
return true;
} else {
property = this.config[key];
if (property && property.event) {
if (property.validator && !property.validator(value)) {
return false;
} else {
property.value = value;
if (! silent) {
this.fireEvent(key, value);
this.configChangedEvent.fire([key, value]);
}
return true;
}
} else {
return false;
}
}
} | javascript | function (key, value, silent) {
var property;
key = key.toLowerCase();
YAHOO.log("setProperty: " + key + "=" + value, "info", "Config");
if (this.queueInProgress && ! silent) {
// Currently running through a queue...
this.queueProperty(key,value);
return true;
} else {
property = this.config[key];
if (property && property.event) {
if (property.validator && !property.validator(value)) {
return false;
} else {
property.value = value;
if (! silent) {
this.fireEvent(key, value);
this.configChangedEvent.fire([key, value]);
}
return true;
}
} else {
return false;
}
}
} | [
"function",
"(",
"key",
",",
"value",
",",
"silent",
")",
"{",
"var",
"property",
";",
"key",
"=",
"key",
".",
"toLowerCase",
"(",
")",
";",
"YAHOO",
".",
"log",
"(",
"\"setProperty: \"",
"+",
"key",
"+",
"\"=\"",
"+",
"value",
",",
"\"info\"",
",",
"\"Config\"",
")",
";",
"if",
"(",
"this",
".",
"queueInProgress",
"&&",
"!",
"silent",
")",
"{",
"// Currently running through a queue... ",
"this",
".",
"queueProperty",
"(",
"key",
",",
"value",
")",
";",
"return",
"true",
";",
"}",
"else",
"{",
"property",
"=",
"this",
".",
"config",
"[",
"key",
"]",
";",
"if",
"(",
"property",
"&&",
"property",
".",
"event",
")",
"{",
"if",
"(",
"property",
".",
"validator",
"&&",
"!",
"property",
".",
"validator",
"(",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"property",
".",
"value",
"=",
"value",
";",
"if",
"(",
"!",
"silent",
")",
"{",
"this",
".",
"fireEvent",
"(",
"key",
",",
"value",
")",
";",
"this",
".",
"configChangedEvent",
".",
"fire",
"(",
"[",
"key",
",",
"value",
"]",
")",
";",
"}",
"return",
"true",
";",
"}",
"}",
"else",
"{",
"return",
"false",
";",
"}",
"}",
"}"
]
| Sets the value of a property. If the silent property is passed as
true, the property's event will not be fired.
@method setProperty
@param {String} key The name of the property
@param {String} value The value to set the property to
@param {Boolean} silent Whether the value should be set silently,
without firing the property event.
@return {Boolean} True, if the set was successful, false if it failed. | [
"Sets",
"the",
"value",
"of",
"a",
"property",
".",
"If",
"the",
"silent",
"property",
"is",
"passed",
"as",
"true",
"the",
"property",
"s",
"event",
"will",
"not",
"be",
"fired",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container-debug.js#L274-L303 |
|
42,787 | neyric/webhookit | public/javascripts/yui/container/container-debug.js | function (key, value) {
key = key.toLowerCase();
YAHOO.log("queueProperty: " + key + "=" + value, "info", "Config");
var property = this.config[key],
foundDuplicate = false,
iLen,
queueItem,
queueItemKey,
queueItemValue,
sLen,
supercedesCheck,
qLen,
queueItemCheck,
queueItemCheckKey,
queueItemCheckValue,
i,
s,
q;
if (property && property.event) {
if (!Lang.isUndefined(value) && property.validator &&
!property.validator(value)) { // validator
return false;
} else {
if (!Lang.isUndefined(value)) {
property.value = value;
} else {
value = property.value;
}
foundDuplicate = false;
iLen = this.eventQueue.length;
for (i = 0; i < iLen; i++) {
queueItem = this.eventQueue[i];
if (queueItem) {
queueItemKey = queueItem[0];
queueItemValue = queueItem[1];
if (queueItemKey == key) {
/*
found a dupe... push to end of queue, null
current item, and break
*/
this.eventQueue[i] = null;
this.eventQueue.push(
[key, (!Lang.isUndefined(value) ?
value : queueItemValue)]);
foundDuplicate = true;
break;
}
}
}
// this is a refire, or a new property in the queue
if (! foundDuplicate && !Lang.isUndefined(value)) {
this.eventQueue.push([key, value]);
}
}
if (property.supercedes) {
sLen = property.supercedes.length;
for (s = 0; s < sLen; s++) {
supercedesCheck = property.supercedes[s];
qLen = this.eventQueue.length;
for (q = 0; q < qLen; q++) {
queueItemCheck = this.eventQueue[q];
if (queueItemCheck) {
queueItemCheckKey = queueItemCheck[0];
queueItemCheckValue = queueItemCheck[1];
if (queueItemCheckKey ==
supercedesCheck.toLowerCase() ) {
this.eventQueue.push([queueItemCheckKey,
queueItemCheckValue]);
this.eventQueue[q] = null;
break;
}
}
}
}
}
YAHOO.log("Config event queue: " + this.outputEventQueue(), "info", "Config");
return true;
} else {
return false;
}
} | javascript | function (key, value) {
key = key.toLowerCase();
YAHOO.log("queueProperty: " + key + "=" + value, "info", "Config");
var property = this.config[key],
foundDuplicate = false,
iLen,
queueItem,
queueItemKey,
queueItemValue,
sLen,
supercedesCheck,
qLen,
queueItemCheck,
queueItemCheckKey,
queueItemCheckValue,
i,
s,
q;
if (property && property.event) {
if (!Lang.isUndefined(value) && property.validator &&
!property.validator(value)) { // validator
return false;
} else {
if (!Lang.isUndefined(value)) {
property.value = value;
} else {
value = property.value;
}
foundDuplicate = false;
iLen = this.eventQueue.length;
for (i = 0; i < iLen; i++) {
queueItem = this.eventQueue[i];
if (queueItem) {
queueItemKey = queueItem[0];
queueItemValue = queueItem[1];
if (queueItemKey == key) {
/*
found a dupe... push to end of queue, null
current item, and break
*/
this.eventQueue[i] = null;
this.eventQueue.push(
[key, (!Lang.isUndefined(value) ?
value : queueItemValue)]);
foundDuplicate = true;
break;
}
}
}
// this is a refire, or a new property in the queue
if (! foundDuplicate && !Lang.isUndefined(value)) {
this.eventQueue.push([key, value]);
}
}
if (property.supercedes) {
sLen = property.supercedes.length;
for (s = 0; s < sLen; s++) {
supercedesCheck = property.supercedes[s];
qLen = this.eventQueue.length;
for (q = 0; q < qLen; q++) {
queueItemCheck = this.eventQueue[q];
if (queueItemCheck) {
queueItemCheckKey = queueItemCheck[0];
queueItemCheckValue = queueItemCheck[1];
if (queueItemCheckKey ==
supercedesCheck.toLowerCase() ) {
this.eventQueue.push([queueItemCheckKey,
queueItemCheckValue]);
this.eventQueue[q] = null;
break;
}
}
}
}
}
YAHOO.log("Config event queue: " + this.outputEventQueue(), "info", "Config");
return true;
} else {
return false;
}
} | [
"function",
"(",
"key",
",",
"value",
")",
"{",
"key",
"=",
"key",
".",
"toLowerCase",
"(",
")",
";",
"YAHOO",
".",
"log",
"(",
"\"queueProperty: \"",
"+",
"key",
"+",
"\"=\"",
"+",
"value",
",",
"\"info\"",
",",
"\"Config\"",
")",
";",
"var",
"property",
"=",
"this",
".",
"config",
"[",
"key",
"]",
",",
"foundDuplicate",
"=",
"false",
",",
"iLen",
",",
"queueItem",
",",
"queueItemKey",
",",
"queueItemValue",
",",
"sLen",
",",
"supercedesCheck",
",",
"qLen",
",",
"queueItemCheck",
",",
"queueItemCheckKey",
",",
"queueItemCheckValue",
",",
"i",
",",
"s",
",",
"q",
";",
"if",
"(",
"property",
"&&",
"property",
".",
"event",
")",
"{",
"if",
"(",
"!",
"Lang",
".",
"isUndefined",
"(",
"value",
")",
"&&",
"property",
".",
"validator",
"&&",
"!",
"property",
".",
"validator",
"(",
"value",
")",
")",
"{",
"// validator",
"return",
"false",
";",
"}",
"else",
"{",
"if",
"(",
"!",
"Lang",
".",
"isUndefined",
"(",
"value",
")",
")",
"{",
"property",
".",
"value",
"=",
"value",
";",
"}",
"else",
"{",
"value",
"=",
"property",
".",
"value",
";",
"}",
"foundDuplicate",
"=",
"false",
";",
"iLen",
"=",
"this",
".",
"eventQueue",
".",
"length",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"iLen",
";",
"i",
"++",
")",
"{",
"queueItem",
"=",
"this",
".",
"eventQueue",
"[",
"i",
"]",
";",
"if",
"(",
"queueItem",
")",
"{",
"queueItemKey",
"=",
"queueItem",
"[",
"0",
"]",
";",
"queueItemValue",
"=",
"queueItem",
"[",
"1",
"]",
";",
"if",
"(",
"queueItemKey",
"==",
"key",
")",
"{",
"/*\n found a dupe... push to end of queue, null \n current item, and break\n */",
"this",
".",
"eventQueue",
"[",
"i",
"]",
"=",
"null",
";",
"this",
".",
"eventQueue",
".",
"push",
"(",
"[",
"key",
",",
"(",
"!",
"Lang",
".",
"isUndefined",
"(",
"value",
")",
"?",
"value",
":",
"queueItemValue",
")",
"]",
")",
";",
"foundDuplicate",
"=",
"true",
";",
"break",
";",
"}",
"}",
"}",
"// this is a refire, or a new property in the queue",
"if",
"(",
"!",
"foundDuplicate",
"&&",
"!",
"Lang",
".",
"isUndefined",
"(",
"value",
")",
")",
"{",
"this",
".",
"eventQueue",
".",
"push",
"(",
"[",
"key",
",",
"value",
"]",
")",
";",
"}",
"}",
"if",
"(",
"property",
".",
"supercedes",
")",
"{",
"sLen",
"=",
"property",
".",
"supercedes",
".",
"length",
";",
"for",
"(",
"s",
"=",
"0",
";",
"s",
"<",
"sLen",
";",
"s",
"++",
")",
"{",
"supercedesCheck",
"=",
"property",
".",
"supercedes",
"[",
"s",
"]",
";",
"qLen",
"=",
"this",
".",
"eventQueue",
".",
"length",
";",
"for",
"(",
"q",
"=",
"0",
";",
"q",
"<",
"qLen",
";",
"q",
"++",
")",
"{",
"queueItemCheck",
"=",
"this",
".",
"eventQueue",
"[",
"q",
"]",
";",
"if",
"(",
"queueItemCheck",
")",
"{",
"queueItemCheckKey",
"=",
"queueItemCheck",
"[",
"0",
"]",
";",
"queueItemCheckValue",
"=",
"queueItemCheck",
"[",
"1",
"]",
";",
"if",
"(",
"queueItemCheckKey",
"==",
"supercedesCheck",
".",
"toLowerCase",
"(",
")",
")",
"{",
"this",
".",
"eventQueue",
".",
"push",
"(",
"[",
"queueItemCheckKey",
",",
"queueItemCheckValue",
"]",
")",
";",
"this",
".",
"eventQueue",
"[",
"q",
"]",
"=",
"null",
";",
"break",
";",
"}",
"}",
"}",
"}",
"}",
"YAHOO",
".",
"log",
"(",
"\"Config event queue: \"",
"+",
"this",
".",
"outputEventQueue",
"(",
")",
",",
"\"info\"",
",",
"\"Config\"",
")",
";",
"return",
"true",
";",
"}",
"else",
"{",
"return",
"false",
";",
"}",
"}"
]
| Sets the value of a property and queues its event to execute. If the
event is already scheduled to execute, it is
moved from its current position to the end of the queue.
@method queueProperty
@param {String} key The name of the property
@param {String} value The value to set the property to
@return {Boolean} true, if the set was successful, false if
it failed. | [
"Sets",
"the",
"value",
"of",
"a",
"property",
"and",
"queues",
"its",
"event",
"to",
"execute",
".",
"If",
"the",
"event",
"is",
"already",
"scheduled",
"to",
"execute",
"it",
"is",
"moved",
"from",
"its",
"current",
"position",
"to",
"the",
"end",
"of",
"the",
"queue",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container-debug.js#L315-L422 |
|
42,788 | neyric/webhookit | public/javascripts/yui/container/container-debug.js | function (type, args, obj) {
var pos = args[0],
x = pos[0],
y = pos[1];
this.cfg.setProperty("x", x);
this.cfg.setProperty("y", y);
this.beforeMoveEvent.fire([x, y]);
x = this.cfg.getProperty("x");
y = this.cfg.getProperty("y");
YAHOO.log(("xy: " + [x, y]), "iframe");
this.cfg.refireEvent("iframe");
this.moveEvent.fire([x, y]);
} | javascript | function (type, args, obj) {
var pos = args[0],
x = pos[0],
y = pos[1];
this.cfg.setProperty("x", x);
this.cfg.setProperty("y", y);
this.beforeMoveEvent.fire([x, y]);
x = this.cfg.getProperty("x");
y = this.cfg.getProperty("y");
YAHOO.log(("xy: " + [x, y]), "iframe");
this.cfg.refireEvent("iframe");
this.moveEvent.fire([x, y]);
} | [
"function",
"(",
"type",
",",
"args",
",",
"obj",
")",
"{",
"var",
"pos",
"=",
"args",
"[",
"0",
"]",
",",
"x",
"=",
"pos",
"[",
"0",
"]",
",",
"y",
"=",
"pos",
"[",
"1",
"]",
";",
"this",
".",
"cfg",
".",
"setProperty",
"(",
"\"x\"",
",",
"x",
")",
";",
"this",
".",
"cfg",
".",
"setProperty",
"(",
"\"y\"",
",",
"y",
")",
";",
"this",
".",
"beforeMoveEvent",
".",
"fire",
"(",
"[",
"x",
",",
"y",
"]",
")",
";",
"x",
"=",
"this",
".",
"cfg",
".",
"getProperty",
"(",
"\"x\"",
")",
";",
"y",
"=",
"this",
".",
"cfg",
".",
"getProperty",
"(",
"\"y\"",
")",
";",
"YAHOO",
".",
"log",
"(",
"(",
"\"xy: \"",
"+",
"[",
"x",
",",
"y",
"]",
")",
",",
"\"iframe\"",
")",
";",
"this",
".",
"cfg",
".",
"refireEvent",
"(",
"\"iframe\"",
")",
";",
"this",
".",
"moveEvent",
".",
"fire",
"(",
"[",
"x",
",",
"y",
"]",
")",
";",
"}"
]
| The default event handler fired when the "xy" property is changed.
@method configXY
@param {String} type The CustomEvent type (usually the property name)
@param {Object[]} args The CustomEvent arguments. For configuration
handlers, args[0] will equal the newly applied value for the property.
@param {Object} obj The scope object. For configuration handlers,
this will usually equal the owner. | [
"The",
"default",
"event",
"handler",
"fired",
"when",
"the",
"xy",
"property",
"is",
"changed",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container-debug.js#L3058-L3076 |
|
42,789 | neyric/webhookit | public/javascripts/yui/container/container-debug.js | function () {
var me = this;
me.logger.log("Setting hide tooltip timeout", "time");
return setTimeout(function () {
me.logger.log("Hide tooltip", "time");
me.hide();
}, this.cfg.getProperty("autodismissdelay"));
} | javascript | function () {
var me = this;
me.logger.log("Setting hide tooltip timeout", "time");
return setTimeout(function () {
me.logger.log("Hide tooltip", "time");
me.hide();
}, this.cfg.getProperty("autodismissdelay"));
} | [
"function",
"(",
")",
"{",
"var",
"me",
"=",
"this",
";",
"me",
".",
"logger",
".",
"log",
"(",
"\"Setting hide tooltip timeout\"",
",",
"\"time\"",
")",
";",
"return",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"me",
".",
"logger",
".",
"log",
"(",
"\"Hide tooltip\"",
",",
"\"time\"",
")",
";",
"me",
".",
"hide",
"(",
")",
";",
"}",
",",
"this",
".",
"cfg",
".",
"getProperty",
"(",
"\"autodismissdelay\"",
")",
")",
";",
"}"
]
| Sets the timeout for the auto-dismiss delay, which by default is 5
seconds, meaning that a tooltip will automatically dismiss itself
after 5 seconds of being displayed.
@method doHide | [
"Sets",
"the",
"timeout",
"for",
"the",
"auto",
"-",
"dismiss",
"delay",
"which",
"by",
"default",
"is",
"5",
"seconds",
"meaning",
"that",
"a",
"tooltip",
"will",
"automatically",
"dismiss",
"itself",
"after",
"5",
"seconds",
"of",
"being",
"displayed",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container-debug.js#L5436-L5449 |
|
42,790 | neyric/webhookit | public/javascripts/yui/container/container-debug.js | function (pageX, pageY) {
var height = this.element.offsetHeight,
mousePoint = new YAHOO.util.Point(pageX, pageY),
elementRegion = Dom.getRegion(this.element);
elementRegion.top -= 5;
elementRegion.left -= 5;
elementRegion.right += 5;
elementRegion.bottom += 5;
this.logger.log("context " + elementRegion, "ttip");
this.logger.log("mouse " + mousePoint, "ttip");
if (elementRegion.contains(mousePoint)) {
this.logger.log("OVERLAP", "warn");
this.cfg.setProperty("y", (pageY - height - 5));
}
} | javascript | function (pageX, pageY) {
var height = this.element.offsetHeight,
mousePoint = new YAHOO.util.Point(pageX, pageY),
elementRegion = Dom.getRegion(this.element);
elementRegion.top -= 5;
elementRegion.left -= 5;
elementRegion.right += 5;
elementRegion.bottom += 5;
this.logger.log("context " + elementRegion, "ttip");
this.logger.log("mouse " + mousePoint, "ttip");
if (elementRegion.contains(mousePoint)) {
this.logger.log("OVERLAP", "warn");
this.cfg.setProperty("y", (pageY - height - 5));
}
} | [
"function",
"(",
"pageX",
",",
"pageY",
")",
"{",
"var",
"height",
"=",
"this",
".",
"element",
".",
"offsetHeight",
",",
"mousePoint",
"=",
"new",
"YAHOO",
".",
"util",
".",
"Point",
"(",
"pageX",
",",
"pageY",
")",
",",
"elementRegion",
"=",
"Dom",
".",
"getRegion",
"(",
"this",
".",
"element",
")",
";",
"elementRegion",
".",
"top",
"-=",
"5",
";",
"elementRegion",
".",
"left",
"-=",
"5",
";",
"elementRegion",
".",
"right",
"+=",
"5",
";",
"elementRegion",
".",
"bottom",
"+=",
"5",
";",
"this",
".",
"logger",
".",
"log",
"(",
"\"context \"",
"+",
"elementRegion",
",",
"\"ttip\"",
")",
";",
"this",
".",
"logger",
".",
"log",
"(",
"\"mouse \"",
"+",
"mousePoint",
",",
"\"ttip\"",
")",
";",
"if",
"(",
"elementRegion",
".",
"contains",
"(",
"mousePoint",
")",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"OVERLAP\"",
",",
"\"warn\"",
")",
";",
"this",
".",
"cfg",
".",
"setProperty",
"(",
"\"y\"",
",",
"(",
"pageY",
"-",
"height",
"-",
"5",
")",
")",
";",
"}",
"}"
]
| Fired when the Tooltip is moved, this event handler is used to
prevent the Tooltip from overlapping with its context element.
@method preventOverlay
@param {Number} pageX The x coordinate position of the mouse pointer
@param {Number} pageY The y coordinate position of the mouse pointer | [
"Fired",
"when",
"the",
"Tooltip",
"is",
"moved",
"this",
"event",
"handler",
"is",
"used",
"to",
"prevent",
"the",
"Tooltip",
"from",
"overlapping",
"with",
"its",
"context",
"element",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container-debug.js#L5458-L5476 |
|
42,791 | neyric/webhookit | public/javascripts/yui/profiler/profiler.js | function(name, method){
//create instrumented version of function
var newMethod = function () {
var start = new Date(),
retval = method.apply(this, arguments),
stop = new Date();
saveDataPoint(name, stop-start);
return retval;
};
//copy the function properties over
lang.augmentObject(newMethod, method);
//assign prototype and flag as being profiled
newMethod.__yuiProfiled = true;
newMethod.prototype = method.prototype;
//store original method
container[name] = method;
container[name].__yuiFuncName = name;
//create the report
createReport(name);
//return the new method
return newMethod;
} | javascript | function(name, method){
//create instrumented version of function
var newMethod = function () {
var start = new Date(),
retval = method.apply(this, arguments),
stop = new Date();
saveDataPoint(name, stop-start);
return retval;
};
//copy the function properties over
lang.augmentObject(newMethod, method);
//assign prototype and flag as being profiled
newMethod.__yuiProfiled = true;
newMethod.prototype = method.prototype;
//store original method
container[name] = method;
container[name].__yuiFuncName = name;
//create the report
createReport(name);
//return the new method
return newMethod;
} | [
"function",
"(",
"name",
",",
"method",
")",
"{",
"//create instrumented version of function",
"var",
"newMethod",
"=",
"function",
"(",
")",
"{",
"var",
"start",
"=",
"new",
"Date",
"(",
")",
",",
"retval",
"=",
"method",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
",",
"stop",
"=",
"new",
"Date",
"(",
")",
";",
"saveDataPoint",
"(",
"name",
",",
"stop",
"-",
"start",
")",
";",
"return",
"retval",
";",
"}",
";",
"//copy the function properties over",
"lang",
".",
"augmentObject",
"(",
"newMethod",
",",
"method",
")",
";",
"//assign prototype and flag as being profiled",
"newMethod",
".",
"__yuiProfiled",
"=",
"true",
";",
"newMethod",
".",
"prototype",
"=",
"method",
".",
"prototype",
";",
"//store original method",
"container",
"[",
"name",
"]",
"=",
"method",
";",
"container",
"[",
"name",
"]",
".",
"__yuiFuncName",
"=",
"name",
";",
"//create the report",
"createReport",
"(",
"name",
")",
";",
"//return the new method",
"return",
"newMethod",
";",
"}"
]
| Instruments a method to have profiling calls.
@param {String} name The name of the report for the function.
@param {Function} method The function to instrument.
@return {Function} An instrumented version of the function.
@method instrument
@static | [
"Instruments",
"a",
"method",
"to",
"have",
"profiling",
"calls",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profiler/profiler.js#L142-L173 |
|
42,792 | neyric/webhookit | public/javascripts/yui/profiler/profiler.js | function () {
var start = new Date(),
retval = method.apply(this, arguments),
stop = new Date();
saveDataPoint(name, stop-start);
return retval;
} | javascript | function () {
var start = new Date(),
retval = method.apply(this, arguments),
stop = new Date();
saveDataPoint(name, stop-start);
return retval;
} | [
"function",
"(",
")",
"{",
"var",
"start",
"=",
"new",
"Date",
"(",
")",
",",
"retval",
"=",
"method",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
",",
"stop",
"=",
"new",
"Date",
"(",
")",
";",
"saveDataPoint",
"(",
"name",
",",
"stop",
"-",
"start",
")",
";",
"return",
"retval",
";",
"}"
]
| create instrumented version of function | [
"create",
"instrumented",
"version",
"of",
"function"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profiler/profiler.js#L145-L155 |
|
42,793 | neyric/webhookit | public/javascripts/yui/profiler/profiler.js | function(name){
if(container[name]){
throw new Error("Cannot use '" + name + "' for profiling through start(), name is already in use.");
} else {
//create report if necessary
if (!report[name]){
createReport(name);
}
//create stopwatch object if necessary
if (!stopwatches[name]){
stopwatches[name] = {
state: WATCH_STOPPED,
start: 0,
total: 0
};
}
if (stopwatches[name].state == WATCH_STOPPED){
stopwatches[name].state = WATCH_STARTED;
stopwatches[name].start = new Date();
}
}
} | javascript | function(name){
if(container[name]){
throw new Error("Cannot use '" + name + "' for profiling through start(), name is already in use.");
} else {
//create report if necessary
if (!report[name]){
createReport(name);
}
//create stopwatch object if necessary
if (!stopwatches[name]){
stopwatches[name] = {
state: WATCH_STOPPED,
start: 0,
total: 0
};
}
if (stopwatches[name].state == WATCH_STOPPED){
stopwatches[name].state = WATCH_STARTED;
stopwatches[name].start = new Date();
}
}
} | [
"function",
"(",
"name",
")",
"{",
"if",
"(",
"container",
"[",
"name",
"]",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Cannot use '\"",
"+",
"name",
"+",
"\"' for profiling through start(), name is already in use.\"",
")",
";",
"}",
"else",
"{",
"//create report if necessary",
"if",
"(",
"!",
"report",
"[",
"name",
"]",
")",
"{",
"createReport",
"(",
"name",
")",
";",
"}",
"//create stopwatch object if necessary",
"if",
"(",
"!",
"stopwatches",
"[",
"name",
"]",
")",
"{",
"stopwatches",
"[",
"name",
"]",
"=",
"{",
"state",
":",
"WATCH_STOPPED",
",",
"start",
":",
"0",
",",
"total",
":",
"0",
"}",
";",
"}",
"if",
"(",
"stopwatches",
"[",
"name",
"]",
".",
"state",
"==",
"WATCH_STOPPED",
")",
"{",
"stopwatches",
"[",
"name",
"]",
".",
"state",
"=",
"WATCH_STARTED",
";",
"stopwatches",
"[",
"name",
"]",
".",
"start",
"=",
"new",
"Date",
"(",
")",
";",
"}",
"}",
"}"
]
| Start profiling information for a given name. The name cannot be the name
of a registered function or object. This is used to start timing for a
particular block of code rather than instrumenting the entire function.
@param {String} name The name of the data point.
@return {Void}
@method start
@static | [
"Start",
"profiling",
"information",
"for",
"a",
"given",
"name",
".",
"The",
"name",
"cannot",
"be",
"the",
"name",
"of",
"a",
"registered",
"function",
"or",
"object",
".",
"This",
"is",
"used",
"to",
"start",
"timing",
"for",
"a",
"particular",
"block",
"of",
"code",
"rather",
"than",
"instrumenting",
"the",
"entire",
"function",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profiler/profiler.js#L207-L232 |
|
42,794 | neyric/webhookit | public/javascripts/yui/profiler/profiler.js | function(name){
var now = new Date(),
stopwatch = stopwatches[name];
if (stopwatch){
if (stopwatch.state == WATCH_STARTED){
saveDataPoint(name, stopwatch.total + (now - stopwatch.start));
} else if (stopwatch.state == WATCH_PAUSED){
saveDataPoint(name, stopwatch.total);
}
//reset stopwatch information
stopwatch.start = 0;
stopwatch.total = 0;
stopwatch.state = WATCH_STOPPED;
}
} | javascript | function(name){
var now = new Date(),
stopwatch = stopwatches[name];
if (stopwatch){
if (stopwatch.state == WATCH_STARTED){
saveDataPoint(name, stopwatch.total + (now - stopwatch.start));
} else if (stopwatch.state == WATCH_PAUSED){
saveDataPoint(name, stopwatch.total);
}
//reset stopwatch information
stopwatch.start = 0;
stopwatch.total = 0;
stopwatch.state = WATCH_STOPPED;
}
} | [
"function",
"(",
"name",
")",
"{",
"var",
"now",
"=",
"new",
"Date",
"(",
")",
",",
"stopwatch",
"=",
"stopwatches",
"[",
"name",
"]",
";",
"if",
"(",
"stopwatch",
")",
"{",
"if",
"(",
"stopwatch",
".",
"state",
"==",
"WATCH_STARTED",
")",
"{",
"saveDataPoint",
"(",
"name",
",",
"stopwatch",
".",
"total",
"+",
"(",
"now",
"-",
"stopwatch",
".",
"start",
")",
")",
";",
"}",
"else",
"if",
"(",
"stopwatch",
".",
"state",
"==",
"WATCH_PAUSED",
")",
"{",
"saveDataPoint",
"(",
"name",
",",
"stopwatch",
".",
"total",
")",
";",
"}",
"//reset stopwatch information",
"stopwatch",
".",
"start",
"=",
"0",
";",
"stopwatch",
".",
"total",
"=",
"0",
";",
"stopwatch",
".",
"state",
"=",
"WATCH_STOPPED",
";",
"}",
"}"
]
| Stops profiling information for a given name.
@param {String} name The name of the data point.
@return {Void}
@method stop
@static | [
"Stops",
"profiling",
"information",
"for",
"a",
"given",
"name",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profiler/profiler.js#L241-L257 |
|
42,795 | neyric/webhookit | public/javascripts/yui/profiler/profiler.js | function(name /*:String*/, owner /*:Object*/, registerPrototype /*:Boolean*/) /*:Void*/{
//figure out the function name without namespacing
var funcName = (name.indexOf(".") > -1 ?
name.substring(name.lastIndexOf(".")+1) : name),
method,
prototype;
//if owner isn't an object, try to find it from the name
if (!lang.isObject(owner)){
owner = eval(name.substring(0, name.lastIndexOf(".")));
}
//get the method and prototype
method = owner[funcName];
prototype = method.prototype;
//see if the method has already been registered
if (lang.isFunction(method) && !method.__yuiProfiled){
//replace the function with the profiling one
owner[funcName] = this.instrument(name, method);
/*
* Store original function information. We store the actual
* function as well as the owner and the name used to identify
* the function so it can be restored later.
*/
container[name].__yuiOwner = owner;
container[name].__yuiFuncName = funcName; //overwrite with less-specific name
//register prototype if necessary
if (registerPrototype) {
this.registerObject(name + ".prototype", prototype);
}
}
} | javascript | function(name /*:String*/, owner /*:Object*/, registerPrototype /*:Boolean*/) /*:Void*/{
//figure out the function name without namespacing
var funcName = (name.indexOf(".") > -1 ?
name.substring(name.lastIndexOf(".")+1) : name),
method,
prototype;
//if owner isn't an object, try to find it from the name
if (!lang.isObject(owner)){
owner = eval(name.substring(0, name.lastIndexOf(".")));
}
//get the method and prototype
method = owner[funcName];
prototype = method.prototype;
//see if the method has already been registered
if (lang.isFunction(method) && !method.__yuiProfiled){
//replace the function with the profiling one
owner[funcName] = this.instrument(name, method);
/*
* Store original function information. We store the actual
* function as well as the owner and the name used to identify
* the function so it can be restored later.
*/
container[name].__yuiOwner = owner;
container[name].__yuiFuncName = funcName; //overwrite with less-specific name
//register prototype if necessary
if (registerPrototype) {
this.registerObject(name + ".prototype", prototype);
}
}
} | [
"function",
"(",
"name",
"/*:String*/",
",",
"owner",
"/*:Object*/",
",",
"registerPrototype",
"/*:Boolean*/",
")",
"/*:Void*/",
"{",
"//figure out the function name without namespacing",
"var",
"funcName",
"=",
"(",
"name",
".",
"indexOf",
"(",
"\".\"",
")",
">",
"-",
"1",
"?",
"name",
".",
"substring",
"(",
"name",
".",
"lastIndexOf",
"(",
"\".\"",
")",
"+",
"1",
")",
":",
"name",
")",
",",
"method",
",",
"prototype",
";",
"//if owner isn't an object, try to find it from the name",
"if",
"(",
"!",
"lang",
".",
"isObject",
"(",
"owner",
")",
")",
"{",
"owner",
"=",
"eval",
"(",
"name",
".",
"substring",
"(",
"0",
",",
"name",
".",
"lastIndexOf",
"(",
"\".\"",
")",
")",
")",
";",
"}",
"//get the method and prototype",
"method",
"=",
"owner",
"[",
"funcName",
"]",
";",
"prototype",
"=",
"method",
".",
"prototype",
";",
"//see if the method has already been registered",
"if",
"(",
"lang",
".",
"isFunction",
"(",
"method",
")",
"&&",
"!",
"method",
".",
"__yuiProfiled",
")",
"{",
"//replace the function with the profiling one",
"owner",
"[",
"funcName",
"]",
"=",
"this",
".",
"instrument",
"(",
"name",
",",
"method",
")",
";",
"/*\n * Store original function information. We store the actual\n * function as well as the owner and the name used to identify\n * the function so it can be restored later.\n */",
"container",
"[",
"name",
"]",
".",
"__yuiOwner",
"=",
"owner",
";",
"container",
"[",
"name",
"]",
".",
"__yuiFuncName",
"=",
"funcName",
";",
"//overwrite with less-specific name",
"//register prototype if necessary",
"if",
"(",
"registerPrototype",
")",
"{",
"this",
".",
"registerObject",
"(",
"name",
"+",
"\".prototype\"",
",",
"prototype",
")",
";",
"}",
"}",
"}"
]
| Sets up a function for profiling. It essentially overwrites the function with one
that has instrumentation data. This method also creates an entry for the function
in the profile report. The original function is stored on the container object.
@param {String} name The full name of the function including namespacing. This
is the name of the function that is stored in the report.
@param {Object} owner (Optional) The object that owns the function. If the function
isn't global then this argument is required. This could be the namespace that
the function belongs to, such as YAHOO.util.Dom, or the object on which it's
a method.
@param {Boolean} registerPrototype (Optional) Indicates that the prototype should
also be instrumented. Setting to true has the same effect as calling
registerConstructor().
@return {Void}
@method registerFunction
@static | [
"Sets",
"up",
"a",
"function",
"for",
"profiling",
".",
"It",
"essentially",
"overwrites",
"the",
"function",
"with",
"one",
"that",
"has",
"instrumentation",
"data",
".",
"This",
"method",
"also",
"creates",
"an",
"entry",
"for",
"the",
"function",
"in",
"the",
"profile",
"report",
".",
"The",
"original",
"function",
"is",
"stored",
"on",
"the",
"container",
"object",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profiler/profiler.js#L396-L434 |
|
42,796 | neyric/webhookit | lib/controllers/users.js | get_user_collection | function get_user_collection(req, res, next) {
app.db.collection('users', function(error, user_collection) {
if(error) { throw error; }
else {
req.user_collection = user_collection;
next();
}
});
} | javascript | function get_user_collection(req, res, next) {
app.db.collection('users', function(error, user_collection) {
if(error) { throw error; }
else {
req.user_collection = user_collection;
next();
}
});
} | [
"function",
"get_user_collection",
"(",
"req",
",",
"res",
",",
"next",
")",
"{",
"app",
".",
"db",
".",
"collection",
"(",
"'users'",
",",
"function",
"(",
"error",
",",
"user_collection",
")",
"{",
"if",
"(",
"error",
")",
"{",
"throw",
"error",
";",
"}",
"else",
"{",
"req",
".",
"user_collection",
"=",
"user_collection",
";",
"next",
"(",
")",
";",
"}",
"}",
")",
";",
"}"
]
| store the user collection into req.user_collection | [
"store",
"the",
"user",
"collection",
"into",
"req",
".",
"user_collection"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/lib/controllers/users.js#L4-L12 |
42,797 | neyric/webhookit | public/javascripts/inputex/js/fields/SerializeField-beta.js | function() {
this.subfieldWrapper = inputEx.cn('div', {className: "inputEx-SerializedField-SubFieldWrapper"});
this.fieldContainer.appendChild( this.subfieldWrapper );
var config = {parentEl: this.subfieldWrapper};
lang.augmentObject(config, this.options.subfield);
this.subField = inputEx( config, this);
} | javascript | function() {
this.subfieldWrapper = inputEx.cn('div', {className: "inputEx-SerializedField-SubFieldWrapper"});
this.fieldContainer.appendChild( this.subfieldWrapper );
var config = {parentEl: this.subfieldWrapper};
lang.augmentObject(config, this.options.subfield);
this.subField = inputEx( config, this);
} | [
"function",
"(",
")",
"{",
"this",
".",
"subfieldWrapper",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"\"inputEx-SerializedField-SubFieldWrapper\"",
"}",
")",
";",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"subfieldWrapper",
")",
";",
"var",
"config",
"=",
"{",
"parentEl",
":",
"this",
".",
"subfieldWrapper",
"}",
";",
"lang",
".",
"augmentObject",
"(",
"config",
",",
"this",
".",
"options",
".",
"subfield",
")",
";",
"this",
".",
"subField",
"=",
"inputEx",
"(",
"config",
",",
"this",
")",
";",
"}"
]
| Render the subfield | [
"Render",
"the",
"subfield"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/SerializeField-beta.js#L34-L42 |
|
42,798 | neyric/webhookit | public/javascripts/inputex/js/fields/SerializeField-beta.js | function() {
inputEx.SerializeField.superclass.initEvents.call(this);
this.subField.updatedEvt.subscribe(this.fireUpdatedEvt, this, true);
} | javascript | function() {
inputEx.SerializeField.superclass.initEvents.call(this);
this.subField.updatedEvt.subscribe(this.fireUpdatedEvt, this, true);
} | [
"function",
"(",
")",
"{",
"inputEx",
".",
"SerializeField",
".",
"superclass",
".",
"initEvents",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"subField",
".",
"updatedEvt",
".",
"subscribe",
"(",
"this",
".",
"fireUpdatedEvt",
",",
"this",
",",
"true",
")",
";",
"}"
]
| Subscribe the subField | [
"Subscribe",
"the",
"subField"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/SerializeField-beta.js#L47-L50 |
|
42,799 | neyric/webhookit | public/javascripts/inputex/js/fields/SerializeField-beta.js | function(o) {
if(!XML || !YAHOO.lang.isFunction(XML.ObjTree) ) {
alert("ObjTree.js not loaded.");
return null;
}
var xotree = new XML.ObjTree();
return xotree.writeXML(o);
} | javascript | function(o) {
if(!XML || !YAHOO.lang.isFunction(XML.ObjTree) ) {
alert("ObjTree.js not loaded.");
return null;
}
var xotree = new XML.ObjTree();
return xotree.writeXML(o);
} | [
"function",
"(",
"o",
")",
"{",
"if",
"(",
"!",
"XML",
"||",
"!",
"YAHOO",
".",
"lang",
".",
"isFunction",
"(",
"XML",
".",
"ObjTree",
")",
")",
"{",
"alert",
"(",
"\"ObjTree.js not loaded.\"",
")",
";",
"return",
"null",
";",
"}",
"var",
"xotree",
"=",
"new",
"XML",
".",
"ObjTree",
"(",
")",
";",
"return",
"xotree",
".",
"writeXML",
"(",
"o",
")",
";",
"}"
]
| serialize to XML
@static | [
"serialize",
"to",
"XML"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/SerializeField-beta.js#L131-L138 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.