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
|
---|---|---|---|---|---|---|---|---|---|---|---|
43,000 | neyric/webhookit | public/javascripts/yui/event-delegate/event-delegate.js | function (container, type, fn) {
var sType = type,
returnVal = false,
index,
cacheItem;
// Look up the real event--either mouseover or mouseout
if (type == "mouseenter" || type == "mouseleave") {
sType = Event._getType(type);
}
index = Event._getCacheIndex(delegates, container, sType, fn);
if (index >= 0) {
cacheItem = delegates[index];
}
if (container && cacheItem) {
returnVal = Event.removeListener(cacheItem[0], cacheItem[1], cacheItem[3]);
if (returnVal) {
delete delegates[index][2];
delete delegates[index][3];
delegates.splice(index, 1);
}
}
return returnVal;
} | javascript | function (container, type, fn) {
var sType = type,
returnVal = false,
index,
cacheItem;
// Look up the real event--either mouseover or mouseout
if (type == "mouseenter" || type == "mouseleave") {
sType = Event._getType(type);
}
index = Event._getCacheIndex(delegates, container, sType, fn);
if (index >= 0) {
cacheItem = delegates[index];
}
if (container && cacheItem) {
returnVal = Event.removeListener(cacheItem[0], cacheItem[1], cacheItem[3]);
if (returnVal) {
delete delegates[index][2];
delete delegates[index][3];
delegates.splice(index, 1);
}
}
return returnVal;
} | [
"function",
"(",
"container",
",",
"type",
",",
"fn",
")",
"{",
"var",
"sType",
"=",
"type",
",",
"returnVal",
"=",
"false",
",",
"index",
",",
"cacheItem",
";",
"//\tLook up the real event--either mouseover or mouseout",
"if",
"(",
"type",
"==",
"\"mouseenter\"",
"||",
"type",
"==",
"\"mouseleave\"",
")",
"{",
"sType",
"=",
"Event",
".",
"_getType",
"(",
"type",
")",
";",
"}",
"index",
"=",
"Event",
".",
"_getCacheIndex",
"(",
"delegates",
",",
"container",
",",
"sType",
",",
"fn",
")",
";",
"if",
"(",
"index",
">=",
"0",
")",
"{",
"cacheItem",
"=",
"delegates",
"[",
"index",
"]",
";",
"}",
"if",
"(",
"container",
"&&",
"cacheItem",
")",
"{",
"returnVal",
"=",
"Event",
".",
"removeListener",
"(",
"cacheItem",
"[",
"0",
"]",
",",
"cacheItem",
"[",
"1",
"]",
",",
"cacheItem",
"[",
"3",
"]",
")",
";",
"if",
"(",
"returnVal",
")",
"{",
"delete",
"delegates",
"[",
"index",
"]",
"[",
"2",
"]",
";",
"delete",
"delegates",
"[",
"index",
"]",
"[",
"3",
"]",
";",
"delegates",
".",
"splice",
"(",
"index",
",",
"1",
")",
";",
"}",
"}",
"return",
"returnVal",
";",
"}"
]
| Removes a delegated event listener.
@method removeDelegate
@param {String|HTMLElement|Array|NodeList} container An id, an element
reference, or a collection of ids and/or elements to remove
the listener from.
@param {String} type The type of event to remove.
@param {Function} fn The method the event invokes. If fn is
undefined, then all event listeners for the type of event are
removed.
@return {boolean} Returns true if the unbind was successful, false
otherwise.
@static
@for Event | [
"Removes",
"a",
"delegated",
"event",
"listener",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event-delegate/event-delegate.js#L243-L276 |
|
43,001 | neyric/webhookit | public/javascripts/yui/element/element.js | function() {
var val = this.value;
if (this.getter) {
val = this.getter.call(this.owner, this.name, val);
}
return val;
} | javascript | function() {
var val = this.value;
if (this.getter) {
val = this.getter.call(this.owner, this.name, val);
}
return val;
} | [
"function",
"(",
")",
"{",
"var",
"val",
"=",
"this",
".",
"value",
";",
"if",
"(",
"this",
".",
"getter",
")",
"{",
"val",
"=",
"this",
".",
"getter",
".",
"call",
"(",
"this",
".",
"owner",
",",
"this",
".",
"name",
",",
"val",
")",
";",
"}",
"return",
"val",
";",
"}"
]
| Retrieves the current value of the attribute.
@method getValue
@return {any} The current value of the attribute. | [
"Retrieves",
"the",
"current",
"value",
"of",
"the",
"attribute",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L114-L122 |
|
43,002 | neyric/webhookit | public/javascripts/yui/element/element.js | function(value, silent) {
var beforeRetVal,
owner = this.owner,
name = this.name;
var event = {
type: name,
prevValue: this.getValue(),
newValue: value
};
if (this.readOnly || ( this.writeOnce && this._written) ) {
return false; // write not allowed
}
if (this.validator && !this.validator.call(owner, value) ) {
return false; // invalid value
}
if (!silent) {
beforeRetVal = owner.fireBeforeChangeEvent(event);
if (beforeRetVal === false) {
return false;
}
}
if (this.setter) {
value = this.setter.call(owner, value, this.name);
if (value === undefined) {
}
}
if (this.method) {
this.method.call(owner, value, this.name);
}
this.value = value; // TODO: set before calling setter/method?
this._written = true;
event.type = name;
if (!silent) {
this.owner.fireChangeEvent(event);
}
return true;
} | javascript | function(value, silent) {
var beforeRetVal,
owner = this.owner,
name = this.name;
var event = {
type: name,
prevValue: this.getValue(),
newValue: value
};
if (this.readOnly || ( this.writeOnce && this._written) ) {
return false; // write not allowed
}
if (this.validator && !this.validator.call(owner, value) ) {
return false; // invalid value
}
if (!silent) {
beforeRetVal = owner.fireBeforeChangeEvent(event);
if (beforeRetVal === false) {
return false;
}
}
if (this.setter) {
value = this.setter.call(owner, value, this.name);
if (value === undefined) {
}
}
if (this.method) {
this.method.call(owner, value, this.name);
}
this.value = value; // TODO: set before calling setter/method?
this._written = true;
event.type = name;
if (!silent) {
this.owner.fireChangeEvent(event);
}
return true;
} | [
"function",
"(",
"value",
",",
"silent",
")",
"{",
"var",
"beforeRetVal",
",",
"owner",
"=",
"this",
".",
"owner",
",",
"name",
"=",
"this",
".",
"name",
";",
"var",
"event",
"=",
"{",
"type",
":",
"name",
",",
"prevValue",
":",
"this",
".",
"getValue",
"(",
")",
",",
"newValue",
":",
"value",
"}",
";",
"if",
"(",
"this",
".",
"readOnly",
"||",
"(",
"this",
".",
"writeOnce",
"&&",
"this",
".",
"_written",
")",
")",
"{",
"return",
"false",
";",
"// write not allowed",
"}",
"if",
"(",
"this",
".",
"validator",
"&&",
"!",
"this",
".",
"validator",
".",
"call",
"(",
"owner",
",",
"value",
")",
")",
"{",
"return",
"false",
";",
"// invalid value",
"}",
"if",
"(",
"!",
"silent",
")",
"{",
"beforeRetVal",
"=",
"owner",
".",
"fireBeforeChangeEvent",
"(",
"event",
")",
";",
"if",
"(",
"beforeRetVal",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"}",
"if",
"(",
"this",
".",
"setter",
")",
"{",
"value",
"=",
"this",
".",
"setter",
".",
"call",
"(",
"owner",
",",
"value",
",",
"this",
".",
"name",
")",
";",
"if",
"(",
"value",
"===",
"undefined",
")",
"{",
"}",
"}",
"if",
"(",
"this",
".",
"method",
")",
"{",
"this",
".",
"method",
".",
"call",
"(",
"owner",
",",
"value",
",",
"this",
".",
"name",
")",
";",
"}",
"this",
".",
"value",
"=",
"value",
";",
"// TODO: set before calling setter/method?",
"this",
".",
"_written",
"=",
"true",
";",
"event",
".",
"type",
"=",
"name",
";",
"if",
"(",
"!",
"silent",
")",
"{",
"this",
".",
"owner",
".",
"fireChangeEvent",
"(",
"event",
")",
";",
"}",
"return",
"true",
";",
"}"
]
| Sets the value of the attribute and fires beforeChange and change events.
@method setValue
@param {Any} value The value to apply to the attribute.
@param {Boolean} silent If true the change events will not be fired.
@return {Boolean} Whether or not the value was set. | [
"Sets",
"the",
"value",
"of",
"the",
"attribute",
"and",
"fires",
"beforeChange",
"and",
"change",
"events",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L131-L177 |
|
43,003 | neyric/webhookit | public/javascripts/yui/element/element.js | function(map, init) {
map = map || {};
if (init) {
this._written = false; // reset writeOnce
}
this._initialConfig = this._initialConfig || {};
for (var key in map) {
if ( map.hasOwnProperty(key) ) {
this[key] = map[key];
if (init) {
this._initialConfig[key] = map[key];
}
}
}
} | javascript | function(map, init) {
map = map || {};
if (init) {
this._written = false; // reset writeOnce
}
this._initialConfig = this._initialConfig || {};
for (var key in map) {
if ( map.hasOwnProperty(key) ) {
this[key] = map[key];
if (init) {
this._initialConfig[key] = map[key];
}
}
}
} | [
"function",
"(",
"map",
",",
"init",
")",
"{",
"map",
"=",
"map",
"||",
"{",
"}",
";",
"if",
"(",
"init",
")",
"{",
"this",
".",
"_written",
"=",
"false",
";",
"// reset writeOnce",
"}",
"this",
".",
"_initialConfig",
"=",
"this",
".",
"_initialConfig",
"||",
"{",
"}",
";",
"for",
"(",
"var",
"key",
"in",
"map",
")",
"{",
"if",
"(",
"map",
".",
"hasOwnProperty",
"(",
"key",
")",
")",
"{",
"this",
"[",
"key",
"]",
"=",
"map",
"[",
"key",
"]",
";",
"if",
"(",
"init",
")",
"{",
"this",
".",
"_initialConfig",
"[",
"key",
"]",
"=",
"map",
"[",
"key",
"]",
";",
"}",
"}",
"}",
"}"
]
| Allows for configuring the Attribute's properties.
@method configure
@param {Object} map A key-value map of Attribute properties.
@param {Boolean} init Whether or not this should become the initial config. | [
"Allows",
"for",
"configuring",
"the",
"Attribute",
"s",
"properties",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L185-L202 |
|
43,004 | neyric/webhookit | public/javascripts/yui/element/element.js | function(key){
this._configs = this._configs || {};
var config = this._configs[key];
if (!config || !this._configs.hasOwnProperty(key)) {
return null;
}
return config.getValue();
} | javascript | function(key){
this._configs = this._configs || {};
var config = this._configs[key];
if (!config || !this._configs.hasOwnProperty(key)) {
return null;
}
return config.getValue();
} | [
"function",
"(",
"key",
")",
"{",
"this",
".",
"_configs",
"=",
"this",
".",
"_configs",
"||",
"{",
"}",
";",
"var",
"config",
"=",
"this",
".",
"_configs",
"[",
"key",
"]",
";",
"if",
"(",
"!",
"config",
"||",
"!",
"this",
".",
"_configs",
".",
"hasOwnProperty",
"(",
"key",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"config",
".",
"getValue",
"(",
")",
";",
"}"
]
| Returns the current value of the attribute.
@method get
@param {String} key The attribute whose value will be returned.
@return {Any} The current value of the attribute. | [
"Returns",
"the",
"current",
"value",
"of",
"the",
"attribute",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L265-L274 |
|
43,005 | neyric/webhookit | public/javascripts/yui/element/element.js | function(key, value, silent){
this._configs = this._configs || {};
var config = this._configs[key];
if (!config) {
return false;
}
return config.setValue(value, silent);
} | javascript | function(key, value, silent){
this._configs = this._configs || {};
var config = this._configs[key];
if (!config) {
return false;
}
return config.setValue(value, silent);
} | [
"function",
"(",
"key",
",",
"value",
",",
"silent",
")",
"{",
"this",
".",
"_configs",
"=",
"this",
".",
"_configs",
"||",
"{",
"}",
";",
"var",
"config",
"=",
"this",
".",
"_configs",
"[",
"key",
"]",
";",
"if",
"(",
"!",
"config",
")",
"{",
"return",
"false",
";",
"}",
"return",
"config",
".",
"setValue",
"(",
"value",
",",
"silent",
")",
";",
"}"
]
| Sets the value of a config.
@method set
@param {String} key The name of the attribute
@param {Any} value The value to apply to the attribute
@param {Boolean} silent Whether or not to suppress change events
@return {Boolean} Whether or not the value was set. | [
"Sets",
"the",
"value",
"of",
"a",
"config",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L284-L293 |
|
43,006 | neyric/webhookit | public/javascripts/yui/element/element.js | function(){
this._configs = this._configs;
var keys = [], key;
for (key in this._configs) {
if ( Lang.hasOwnProperty(this._configs, key) &&
!Lang.isUndefined(this._configs[key]) ) {
keys[keys.length] = key;
}
}
return keys;
} | javascript | function(){
this._configs = this._configs;
var keys = [], key;
for (key in this._configs) {
if ( Lang.hasOwnProperty(this._configs, key) &&
!Lang.isUndefined(this._configs[key]) ) {
keys[keys.length] = key;
}
}
return keys;
} | [
"function",
"(",
")",
"{",
"this",
".",
"_configs",
"=",
"this",
".",
"_configs",
";",
"var",
"keys",
"=",
"[",
"]",
",",
"key",
";",
"for",
"(",
"key",
"in",
"this",
".",
"_configs",
")",
"{",
"if",
"(",
"Lang",
".",
"hasOwnProperty",
"(",
"this",
".",
"_configs",
",",
"key",
")",
"&&",
"!",
"Lang",
".",
"isUndefined",
"(",
"this",
".",
"_configs",
"[",
"key",
"]",
")",
")",
"{",
"keys",
"[",
"keys",
".",
"length",
"]",
"=",
"key",
";",
"}",
"}",
"return",
"keys",
";",
"}"
]
| Returns an array of attribute names.
@method getAttributeKeys
@return {Array} An array of attribute names. | [
"Returns",
"an",
"array",
"of",
"attribute",
"names",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L300-L312 |
|
43,007 | neyric/webhookit | public/javascripts/yui/element/element.js | function(map, silent){
for (var key in map) {
if ( Lang.hasOwnProperty(map, key) ) {
this.set(key, map[key], silent);
}
}
} | javascript | function(map, silent){
for (var key in map) {
if ( Lang.hasOwnProperty(map, key) ) {
this.set(key, map[key], silent);
}
}
} | [
"function",
"(",
"map",
",",
"silent",
")",
"{",
"for",
"(",
"var",
"key",
"in",
"map",
")",
"{",
"if",
"(",
"Lang",
".",
"hasOwnProperty",
"(",
"map",
",",
"key",
")",
")",
"{",
"this",
".",
"set",
"(",
"key",
",",
"map",
"[",
"key",
"]",
",",
"silent",
")",
";",
"}",
"}",
"}"
]
| Sets multiple attribute values.
@method setAttributes
@param {Object} map A key-value map of attributes
@param {Boolean} silent Whether or not to suppress change events | [
"Sets",
"multiple",
"attribute",
"values",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L320-L326 |
|
43,008 | neyric/webhookit | public/javascripts/yui/element/element.js | function(key, silent){
this._configs = this._configs || {};
if (this._configs[key]) {
this.set(key, this._configs[key]._initialConfig.value, silent);
return true;
}
return false;
} | javascript | function(key, silent){
this._configs = this._configs || {};
if (this._configs[key]) {
this.set(key, this._configs[key]._initialConfig.value, silent);
return true;
}
return false;
} | [
"function",
"(",
"key",
",",
"silent",
")",
"{",
"this",
".",
"_configs",
"=",
"this",
".",
"_configs",
"||",
"{",
"}",
";",
"if",
"(",
"this",
".",
"_configs",
"[",
"key",
"]",
")",
"{",
"this",
".",
"set",
"(",
"key",
",",
"this",
".",
"_configs",
"[",
"key",
"]",
".",
"_initialConfig",
".",
"value",
",",
"silent",
")",
";",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
]
| Resets the specified attribute's value to its initial value.
@method resetValue
@param {String} key The name of the attribute
@param {Boolean} silent Whether or not to suppress change events
@return {Boolean} Whether or not the value was set | [
"Resets",
"the",
"specified",
"attribute",
"s",
"value",
"to",
"its",
"initial",
"value",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L335-L342 |
|
43,009 | neyric/webhookit | public/javascripts/yui/element/element.js | function(key, silent) {
this._configs = this._configs || {};
var configs = this._configs;
key = ( ( Lang.isString(key) ) ? [key] : key ) ||
this.getAttributeKeys();
for (var i = 0, len = key.length; i < len; ++i) {
if (configs.hasOwnProperty(key[i])) {
this._configs[key[i]].refresh(silent);
}
}
} | javascript | function(key, silent) {
this._configs = this._configs || {};
var configs = this._configs;
key = ( ( Lang.isString(key) ) ? [key] : key ) ||
this.getAttributeKeys();
for (var i = 0, len = key.length; i < len; ++i) {
if (configs.hasOwnProperty(key[i])) {
this._configs[key[i]].refresh(silent);
}
}
} | [
"function",
"(",
"key",
",",
"silent",
")",
"{",
"this",
".",
"_configs",
"=",
"this",
".",
"_configs",
"||",
"{",
"}",
";",
"var",
"configs",
"=",
"this",
".",
"_configs",
";",
"key",
"=",
"(",
"(",
"Lang",
".",
"isString",
"(",
"key",
")",
")",
"?",
"[",
"key",
"]",
":",
"key",
")",
"||",
"this",
".",
"getAttributeKeys",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"key",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"if",
"(",
"configs",
".",
"hasOwnProperty",
"(",
"key",
"[",
"i",
"]",
")",
")",
"{",
"this",
".",
"_configs",
"[",
"key",
"[",
"i",
"]",
"]",
".",
"refresh",
"(",
"silent",
")",
";",
"}",
"}",
"}"
]
| Sets the attribute's value to its current value.
@method refresh
@param {String | Array} key The attribute(s) to refresh
@param {Boolean} silent Whether or not to suppress change events | [
"Sets",
"the",
"attribute",
"s",
"value",
"to",
"its",
"current",
"value",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L350-L362 |
|
43,010 | neyric/webhookit | public/javascripts/yui/element/element.js | function(key) {
this._configs = this._configs || {};
var config = this._configs[key] || {};
var map = {}; // returning a copy to prevent overrides
for (key in config) {
if ( Lang.hasOwnProperty(config, key) ) {
map[key] = config[key];
}
}
return map;
} | javascript | function(key) {
this._configs = this._configs || {};
var config = this._configs[key] || {};
var map = {}; // returning a copy to prevent overrides
for (key in config) {
if ( Lang.hasOwnProperty(config, key) ) {
map[key] = config[key];
}
}
return map;
} | [
"function",
"(",
"key",
")",
"{",
"this",
".",
"_configs",
"=",
"this",
".",
"_configs",
"||",
"{",
"}",
";",
"var",
"config",
"=",
"this",
".",
"_configs",
"[",
"key",
"]",
"||",
"{",
"}",
";",
"var",
"map",
"=",
"{",
"}",
";",
"// returning a copy to prevent overrides",
"for",
"(",
"key",
"in",
"config",
")",
"{",
"if",
"(",
"Lang",
".",
"hasOwnProperty",
"(",
"config",
",",
"key",
")",
")",
"{",
"map",
"[",
"key",
"]",
"=",
"config",
"[",
"key",
"]",
";",
"}",
"}",
"return",
"map",
";",
"}"
]
| Returns the attribute's properties.
@method getAttributeConfig
@param {String} key The attribute's name
@private
@return {object} A key-value map containing all of the
attribute's properties. | [
"Returns",
"the",
"attribute",
"s",
"properties",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L385-L397 |
|
43,011 | neyric/webhookit | public/javascripts/yui/element/element.js | function(key, map, init) {
this._configs = this._configs || {};
map = map || {};
if (!this._configs[key]) {
map.name = key;
this._configs[key] = this.createAttribute(map);
} else {
this._configs[key].configure(map, init);
}
} | javascript | function(key, map, init) {
this._configs = this._configs || {};
map = map || {};
if (!this._configs[key]) {
map.name = key;
this._configs[key] = this.createAttribute(map);
} else {
this._configs[key].configure(map, init);
}
} | [
"function",
"(",
"key",
",",
"map",
",",
"init",
")",
"{",
"this",
".",
"_configs",
"=",
"this",
".",
"_configs",
"||",
"{",
"}",
";",
"map",
"=",
"map",
"||",
"{",
"}",
";",
"if",
"(",
"!",
"this",
".",
"_configs",
"[",
"key",
"]",
")",
"{",
"map",
".",
"name",
"=",
"key",
";",
"this",
".",
"_configs",
"[",
"key",
"]",
"=",
"this",
".",
"createAttribute",
"(",
"map",
")",
";",
"}",
"else",
"{",
"this",
".",
"_configs",
"[",
"key",
"]",
".",
"configure",
"(",
"map",
",",
"init",
")",
";",
"}",
"}"
]
| Sets or updates an Attribute instance's properties.
@method setAttributeConfig
@param {String} key The attribute's name.
@param {Object} map A key-value map of attribute properties
@param {Boolean} init Whether or not this should become the intial config. | [
"Sets",
"or",
"updates",
"an",
"Attribute",
"instance",
"s",
"properties",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L406-L415 |
|
43,012 | neyric/webhookit | public/javascripts/yui/element/element.js | function(type, callback) {
this._events = this._events || {};
if ( !(type in this._events) ) {
this._events[type] = this.createEvent(type);
}
YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments);
} | javascript | function(type, callback) {
this._events = this._events || {};
if ( !(type in this._events) ) {
this._events[type] = this.createEvent(type);
}
YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments);
} | [
"function",
"(",
"type",
",",
"callback",
")",
"{",
"this",
".",
"_events",
"=",
"this",
".",
"_events",
"||",
"{",
"}",
";",
"if",
"(",
"!",
"(",
"type",
"in",
"this",
".",
"_events",
")",
")",
"{",
"this",
".",
"_events",
"[",
"type",
"]",
"=",
"this",
".",
"createEvent",
"(",
"type",
")",
";",
"}",
"YAHOO",
".",
"util",
".",
"EventProvider",
".",
"prototype",
".",
"subscribe",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"}"
]
| wrapper for EventProvider.subscribe to create events on the fly | [
"wrapper",
"for",
"EventProvider",
".",
"subscribe",
"to",
"create",
"events",
"on",
"the",
"fly"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L442-L450 |
|
43,013 | neyric/webhookit | public/javascripts/yui/element/element.js | function(e) {
var type = 'before';
type += e.type.charAt(0).toUpperCase() + e.type.substr(1) + 'Change';
e.type = type;
return this.fireEvent(e.type, e);
} | javascript | function(e) {
var type = 'before';
type += e.type.charAt(0).toUpperCase() + e.type.substr(1) + 'Change';
e.type = type;
return this.fireEvent(e.type, e);
} | [
"function",
"(",
"e",
")",
"{",
"var",
"type",
"=",
"'before'",
";",
"type",
"+=",
"e",
".",
"type",
".",
"charAt",
"(",
"0",
")",
".",
"toUpperCase",
"(",
")",
"+",
"e",
".",
"type",
".",
"substr",
"(",
"1",
")",
"+",
"'Change'",
";",
"e",
".",
"type",
"=",
"type",
";",
"return",
"this",
".",
"fireEvent",
"(",
"e",
".",
"type",
",",
"e",
")",
";",
"}"
]
| Fires the attribute's beforeChange event.
@method fireBeforeChangeEvent
@param {String} key The attribute's name.
@param {Obj} e The event object to pass to handlers. | [
"Fires",
"the",
"attribute",
"s",
"beforeChange",
"event",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L466-L471 |
|
43,014 | neyric/webhookit | public/javascripts/yui/element/element.js | function(type, fn, obj, scope) {
scope = scope || this;
var Event = YAHOO.util.Event,
el = this.get('element') || this.get('id'),
self = this;
if (specialTypes[type] && !Event._createMouseDelegate) {
return false;
}
if (!this._events[type]) { // create on the fly
if (el && this.DOM_EVENTS[type]) {
Event.on(el, type, function(e, matchedEl) {
// Supplement IE with target, currentTarget relatedTarget
if (e.srcElement && !e.target) {
e.target = e.srcElement;
}
if ((e.toElement && !e.relatedTarget) || (e.fromElement && !e.relatedTarget)) {
e.relatedTarget = Event.getRelatedTarget(e);
}
if (!e.currentTarget) {
e.currentTarget = el;
}
// Note: matchedEl el is passed back for delegated listeners
self.fireEvent(type, e, matchedEl);
}, obj, scope);
}
this.createEvent(type, {scope: this});
}
return YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments); // notify via customEvent
} | javascript | function(type, fn, obj, scope) {
scope = scope || this;
var Event = YAHOO.util.Event,
el = this.get('element') || this.get('id'),
self = this;
if (specialTypes[type] && !Event._createMouseDelegate) {
return false;
}
if (!this._events[type]) { // create on the fly
if (el && this.DOM_EVENTS[type]) {
Event.on(el, type, function(e, matchedEl) {
// Supplement IE with target, currentTarget relatedTarget
if (e.srcElement && !e.target) {
e.target = e.srcElement;
}
if ((e.toElement && !e.relatedTarget) || (e.fromElement && !e.relatedTarget)) {
e.relatedTarget = Event.getRelatedTarget(e);
}
if (!e.currentTarget) {
e.currentTarget = el;
}
// Note: matchedEl el is passed back for delegated listeners
self.fireEvent(type, e, matchedEl);
}, obj, scope);
}
this.createEvent(type, {scope: this});
}
return YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments); // notify via customEvent
} | [
"function",
"(",
"type",
",",
"fn",
",",
"obj",
",",
"scope",
")",
"{",
"scope",
"=",
"scope",
"||",
"this",
";",
"var",
"Event",
"=",
"YAHOO",
".",
"util",
".",
"Event",
",",
"el",
"=",
"this",
".",
"get",
"(",
"'element'",
")",
"||",
"this",
".",
"get",
"(",
"'id'",
")",
",",
"self",
"=",
"this",
";",
"if",
"(",
"specialTypes",
"[",
"type",
"]",
"&&",
"!",
"Event",
".",
"_createMouseDelegate",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"this",
".",
"_events",
"[",
"type",
"]",
")",
"{",
"// create on the fly",
"if",
"(",
"el",
"&&",
"this",
".",
"DOM_EVENTS",
"[",
"type",
"]",
")",
"{",
"Event",
".",
"on",
"(",
"el",
",",
"type",
",",
"function",
"(",
"e",
",",
"matchedEl",
")",
"{",
"// Supplement IE with target, currentTarget relatedTarget",
"if",
"(",
"e",
".",
"srcElement",
"&&",
"!",
"e",
".",
"target",
")",
"{",
"e",
".",
"target",
"=",
"e",
".",
"srcElement",
";",
"}",
"if",
"(",
"(",
"e",
".",
"toElement",
"&&",
"!",
"e",
".",
"relatedTarget",
")",
"||",
"(",
"e",
".",
"fromElement",
"&&",
"!",
"e",
".",
"relatedTarget",
")",
")",
"{",
"e",
".",
"relatedTarget",
"=",
"Event",
".",
"getRelatedTarget",
"(",
"e",
")",
";",
"}",
"if",
"(",
"!",
"e",
".",
"currentTarget",
")",
"{",
"e",
".",
"currentTarget",
"=",
"el",
";",
"}",
"//\tNote: matchedEl el is passed back for delegated listeners",
"self",
".",
"fireEvent",
"(",
"type",
",",
"e",
",",
"matchedEl",
")",
";",
"}",
",",
"obj",
",",
"scope",
")",
";",
"}",
"this",
".",
"createEvent",
"(",
"type",
",",
"{",
"scope",
":",
"this",
"}",
")",
";",
"}",
"return",
"YAHOO",
".",
"util",
".",
"EventProvider",
".",
"prototype",
".",
"subscribe",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"// notify via customEvent",
"}"
]
| Adds a listener for the given event. These may be DOM or
customEvent listeners. Any event that is fired via fireEvent
can be listened for. All handlers receive an event object.
@method addListener
@param {String} type The name of the event to listen for
@param {Function} fn The handler to call when the event fires
@param {Any} obj A variable to pass to the handler
@param {Object} scope The object to use for the scope of the handler | [
"Adds",
"a",
"listener",
"for",
"the",
"given",
"event",
".",
"These",
"may",
"be",
"DOM",
"or",
"customEvent",
"listeners",
".",
"Any",
"event",
"that",
"is",
"fired",
"via",
"fireEvent",
"can",
"be",
"listened",
"for",
".",
"All",
"handlers",
"receive",
"an",
"event",
"object",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L660-L702 |
|
43,015 | neyric/webhookit | public/javascripts/yui/element/element.js | function() {
var queue = this._queue;
for (var i = 0, len = queue.length; i < len; ++i) {
this[queue[i][0]].apply(this, queue[i][1]);
}
} | javascript | function() {
var queue = this._queue;
for (var i = 0, len = queue.length; i < len; ++i) {
this[queue[i][0]].apply(this, queue[i][1]);
}
} | [
"function",
"(",
")",
"{",
"var",
"queue",
"=",
"this",
".",
"_queue",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"queue",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"this",
"[",
"queue",
"[",
"i",
"]",
"[",
"0",
"]",
"]",
".",
"apply",
"(",
"this",
",",
"queue",
"[",
"i",
"]",
"[",
"1",
"]",
")",
";",
"}",
"}"
]
| Apply any queued set calls.
@method fireQueue | [
"Apply",
"any",
"queued",
"set",
"calls",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L815-L820 |
|
43,016 | neyric/webhookit | public/javascripts/yui/element/element.js | function(parent, before) {
parent = (parent.get) ? parent.get('element') : Dom.get(parent);
this.fireEvent('beforeAppendTo', {
type: 'beforeAppendTo',
target: parent
});
before = (before && before.get) ?
before.get('element') : Dom.get(before);
var element = this.get('element');
if (!element) {
return false;
}
if (!parent) {
return false;
}
if (element.parent != parent) {
if (before) {
parent.insertBefore(element, before);
} else {
parent.appendChild(element);
}
}
this.fireEvent('appendTo', {
type: 'appendTo',
target: parent
});
return element;
} | javascript | function(parent, before) {
parent = (parent.get) ? parent.get('element') : Dom.get(parent);
this.fireEvent('beforeAppendTo', {
type: 'beforeAppendTo',
target: parent
});
before = (before && before.get) ?
before.get('element') : Dom.get(before);
var element = this.get('element');
if (!element) {
return false;
}
if (!parent) {
return false;
}
if (element.parent != parent) {
if (before) {
parent.insertBefore(element, before);
} else {
parent.appendChild(element);
}
}
this.fireEvent('appendTo', {
type: 'appendTo',
target: parent
});
return element;
} | [
"function",
"(",
"parent",
",",
"before",
")",
"{",
"parent",
"=",
"(",
"parent",
".",
"get",
")",
"?",
"parent",
".",
"get",
"(",
"'element'",
")",
":",
"Dom",
".",
"get",
"(",
"parent",
")",
";",
"this",
".",
"fireEvent",
"(",
"'beforeAppendTo'",
",",
"{",
"type",
":",
"'beforeAppendTo'",
",",
"target",
":",
"parent",
"}",
")",
";",
"before",
"=",
"(",
"before",
"&&",
"before",
".",
"get",
")",
"?",
"before",
".",
"get",
"(",
"'element'",
")",
":",
"Dom",
".",
"get",
"(",
"before",
")",
";",
"var",
"element",
"=",
"this",
".",
"get",
"(",
"'element'",
")",
";",
"if",
"(",
"!",
"element",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"parent",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"element",
".",
"parent",
"!=",
"parent",
")",
"{",
"if",
"(",
"before",
")",
"{",
"parent",
".",
"insertBefore",
"(",
"element",
",",
"before",
")",
";",
"}",
"else",
"{",
"parent",
".",
"appendChild",
"(",
"element",
")",
";",
"}",
"}",
"this",
".",
"fireEvent",
"(",
"'appendTo'",
",",
"{",
"type",
":",
"'appendTo'",
",",
"target",
":",
"parent",
"}",
")",
";",
"return",
"element",
";",
"}"
]
| Appends the HTMLElement into either the supplied parentNode.
@method appendTo
@param {HTMLElement | Element} parentNode The node to append to
@param {HTMLElement | Element} before An optional node to insert before
@return {HTMLElement} The appended DOM element. | [
"Appends",
"the",
"HTMLElement",
"into",
"either",
"the",
"supplied",
"parentNode",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L829-L865 |
|
43,017 | neyric/webhookit | public/javascripts/yui/element/element.js | function(key, map) {
var el = this.get('element');
map = map || {};
map.name = key;
map.setter = map.setter || this.DEFAULT_HTML_SETTER;
map.getter = map.getter || this.DEFAULT_HTML_GETTER;
map.value = map.value || el[key];
this._configs[key] = new YAHOO.util.Attribute(map, this);
} | javascript | function(key, map) {
var el = this.get('element');
map = map || {};
map.name = key;
map.setter = map.setter || this.DEFAULT_HTML_SETTER;
map.getter = map.getter || this.DEFAULT_HTML_GETTER;
map.value = map.value || el[key];
this._configs[key] = new YAHOO.util.Attribute(map, this);
} | [
"function",
"(",
"key",
",",
"map",
")",
"{",
"var",
"el",
"=",
"this",
".",
"get",
"(",
"'element'",
")",
";",
"map",
"=",
"map",
"||",
"{",
"}",
";",
"map",
".",
"name",
"=",
"key",
";",
"map",
".",
"setter",
"=",
"map",
".",
"setter",
"||",
"this",
".",
"DEFAULT_HTML_SETTER",
";",
"map",
".",
"getter",
"=",
"map",
".",
"getter",
"||",
"this",
".",
"DEFAULT_HTML_GETTER",
";",
"map",
".",
"value",
"=",
"map",
".",
"value",
"||",
"el",
"[",
"key",
"]",
";",
"this",
".",
"_configs",
"[",
"key",
"]",
"=",
"new",
"YAHOO",
".",
"util",
".",
"Attribute",
"(",
"map",
",",
"this",
")",
";",
"}"
]
| Sets the value of the property and fires beforeChange and change events.
@private
@method _setHTMLAttrConfig
@param {YAHOO.util.Element} element The Element instance to
register the config to.
@param {String} key The name of the config to register
@param {Object} map A key-value map of the config's params | [
"Sets",
"the",
"value",
"of",
"the",
"property",
"and",
"fires",
"beforeChange",
"and",
"change",
"events",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/element/element.js#L1021-L1031 |
|
43,018 | neyric/webhookit | public/javascripts/WireIt/plugins/composable/js/ComposableWiringEditor.js | function(wirings) {
// Reset the internal structure
this.pipes = wirings;
this.pipesByName = {};
// Build the "pipesByName" index
for(var i = 0 ; i < this.pipes.length ; i++) {
this.pipesByName[ this.pipes[i].name] = this.pipes[i];
}
// Customize to display composed module in the left list
this.updateComposedModuleList();
this.updateLoadPanelList();
// Check for autoload param and display the loadPanel otherwise
if(!this.checkAutoLoad()) {
this.loadPanel.show();
}
} | javascript | function(wirings) {
// Reset the internal structure
this.pipes = wirings;
this.pipesByName = {};
// Build the "pipesByName" index
for(var i = 0 ; i < this.pipes.length ; i++) {
this.pipesByName[ this.pipes[i].name] = this.pipes[i];
}
// Customize to display composed module in the left list
this.updateComposedModuleList();
this.updateLoadPanelList();
// Check for autoload param and display the loadPanel otherwise
if(!this.checkAutoLoad()) {
this.loadPanel.show();
}
} | [
"function",
"(",
"wirings",
")",
"{",
"// Reset the internal structure",
"this",
".",
"pipes",
"=",
"wirings",
";",
"this",
".",
"pipesByName",
"=",
"{",
"}",
";",
"// Build the \"pipesByName\" index",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"pipes",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"pipesByName",
"[",
"this",
".",
"pipes",
"[",
"i",
"]",
".",
"name",
"]",
"=",
"this",
".",
"pipes",
"[",
"i",
"]",
";",
"}",
"// Customize to display composed module in the left list",
"this",
".",
"updateComposedModuleList",
"(",
")",
";",
"this",
".",
"updateLoadPanelList",
"(",
")",
";",
"// Check for autoload param and display the loadPanel otherwise",
"if",
"(",
"!",
"this",
".",
"checkAutoLoad",
"(",
")",
")",
"{",
"this",
".",
"loadPanel",
".",
"show",
"(",
")",
";",
"}",
"}"
]
| Customize the load success handler for the composed module list | [
"Customize",
"the",
"load",
"success",
"handler",
"for",
"the",
"composed",
"module",
"list"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/plugins/composable/js/ComposableWiringEditor.js#L75-L97 |
|
43,019 | neyric/webhookit | public/javascripts/inputex/js/fields/StringAvailability.js | function(string) {
// TODO split params ? &
YAHOO.util.Connect.asyncRequest('GET', this.options.uri+'?availabilityRequest='+string, {
success: function(o) {
var obj = lang.JSON.parse(o.responseText);
if(obj === "true" || !!obj){
this.onAvailable();
}
else if(obj === "false" || !obj){
this.onUnavailable();
}
else{
this.failure(o);
}
},
failure: function(o) {
// TODO ?
},
scope: this
});
} | javascript | function(string) {
// TODO split params ? &
YAHOO.util.Connect.asyncRequest('GET', this.options.uri+'?availabilityRequest='+string, {
success: function(o) {
var obj = lang.JSON.parse(o.responseText);
if(obj === "true" || !!obj){
this.onAvailable();
}
else if(obj === "false" || !obj){
this.onUnavailable();
}
else{
this.failure(o);
}
},
failure: function(o) {
// TODO ?
},
scope: this
});
} | [
"function",
"(",
"string",
")",
"{",
"// TODO split params ? &",
"YAHOO",
".",
"util",
".",
"Connect",
".",
"asyncRequest",
"(",
"'GET'",
",",
"this",
".",
"options",
".",
"uri",
"+",
"'?availabilityRequest='",
"+",
"string",
",",
"{",
"success",
":",
"function",
"(",
"o",
")",
"{",
"var",
"obj",
"=",
"lang",
".",
"JSON",
".",
"parse",
"(",
"o",
".",
"responseText",
")",
";",
"if",
"(",
"obj",
"===",
"\"true\"",
"||",
"!",
"!",
"obj",
")",
"{",
"this",
".",
"onAvailable",
"(",
")",
";",
"}",
"else",
"if",
"(",
"obj",
"===",
"\"false\"",
"||",
"!",
"obj",
")",
"{",
"this",
".",
"onUnavailable",
"(",
")",
";",
"}",
"else",
"{",
"this",
".",
"failure",
"(",
"o",
")",
";",
"}",
"}",
",",
"failure",
":",
"function",
"(",
"o",
")",
"{",
"// TODO ?",
"}",
",",
"scope",
":",
"this",
"}",
")",
";",
"}"
]
| Perform the Ajax request | [
"Perform",
"the",
"Ajax",
"request"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/StringAvailability.js#L157-L177 |
|
43,020 | neyric/webhookit | public/javascripts/WireIt/plugins/editor/js/WiringEditor.js | function() {
if(!this.checkAutoLoadOnce) {
var p = window.location.search.substr(1).split('&');
var oP = {};
for(var i = 0 ; i < p.length ; i++) {
var v = p[i].split('=');
oP[v[0]]=window.decodeURIComponent(v[1]);
}
this.checkAutoLoadOnce = true;
if(oP.autoload) {
this.loadPipe(oP.autoload);
return true;
}
}
return false;
} | javascript | function() {
if(!this.checkAutoLoadOnce) {
var p = window.location.search.substr(1).split('&');
var oP = {};
for(var i = 0 ; i < p.length ; i++) {
var v = p[i].split('=');
oP[v[0]]=window.decodeURIComponent(v[1]);
}
this.checkAutoLoadOnce = true;
if(oP.autoload) {
this.loadPipe(oP.autoload);
return true;
}
}
return false;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"checkAutoLoadOnce",
")",
"{",
"var",
"p",
"=",
"window",
".",
"location",
".",
"search",
".",
"substr",
"(",
"1",
")",
".",
"split",
"(",
"'&'",
")",
";",
"var",
"oP",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"v",
"=",
"p",
"[",
"i",
"]",
".",
"split",
"(",
"'='",
")",
";",
"oP",
"[",
"v",
"[",
"0",
"]",
"]",
"=",
"window",
".",
"decodeURIComponent",
"(",
"v",
"[",
"1",
"]",
")",
";",
"}",
"this",
".",
"checkAutoLoadOnce",
"=",
"true",
";",
"if",
"(",
"oP",
".",
"autoload",
")",
"{",
"this",
".",
"loadPipe",
"(",
"oP",
".",
"autoload",
")",
";",
"return",
"true",
";",
"}",
"}",
"return",
"false",
";",
"}"
]
| checkAutoLoad looks for the "autoload" URL parameter and open the pipe.
returns true if it loads a Pipe
@method checkAutoLoad | [
"checkAutoLoad",
"looks",
"for",
"the",
"autoload",
"URL",
"parameter",
"and",
"open",
"the",
"pipe",
".",
"returns",
"true",
"if",
"it",
"loads",
"a",
"Pipe"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/plugins/editor/js/WiringEditor.js#L420-L435 |
|
43,021 | takuhii/PhantomJS-25_Beta | lib/util.js | checkPhantomjsVersion | function checkPhantomjsVersion(phantomPath) {
console.log('Found PhantomJS at', phantomPath, '...verifying')
return kew.nfcall(cp.execFile, phantomPath, ['--version']).then(function (stdout) {
var version = stdout.trim()
if (helper.version == version) {
return true
} else {
console.log('PhantomJS detected, but wrong version', stdout.trim(), '@', phantomPath + '.')
return false
}
}).fail(function (err) {
console.error('Error verifying phantomjs, continuing', err)
return false
})
} | javascript | function checkPhantomjsVersion(phantomPath) {
console.log('Found PhantomJS at', phantomPath, '...verifying')
return kew.nfcall(cp.execFile, phantomPath, ['--version']).then(function (stdout) {
var version = stdout.trim()
if (helper.version == version) {
return true
} else {
console.log('PhantomJS detected, but wrong version', stdout.trim(), '@', phantomPath + '.')
return false
}
}).fail(function (err) {
console.error('Error verifying phantomjs, continuing', err)
return false
})
} | [
"function",
"checkPhantomjsVersion",
"(",
"phantomPath",
")",
"{",
"console",
".",
"log",
"(",
"'Found PhantomJS at'",
",",
"phantomPath",
",",
"'...verifying'",
")",
"return",
"kew",
".",
"nfcall",
"(",
"cp",
".",
"execFile",
",",
"phantomPath",
",",
"[",
"'--version'",
"]",
")",
".",
"then",
"(",
"function",
"(",
"stdout",
")",
"{",
"var",
"version",
"=",
"stdout",
".",
"trim",
"(",
")",
"if",
"(",
"helper",
".",
"version",
"==",
"version",
")",
"{",
"return",
"true",
"}",
"else",
"{",
"console",
".",
"log",
"(",
"'PhantomJS detected, but wrong version'",
",",
"stdout",
".",
"trim",
"(",
")",
",",
"'@'",
",",
"phantomPath",
"+",
"'.'",
")",
"return",
"false",
"}",
"}",
")",
".",
"fail",
"(",
"function",
"(",
"err",
")",
"{",
"console",
".",
"error",
"(",
"'Error verifying phantomjs, continuing'",
",",
"err",
")",
"return",
"false",
"}",
")",
"}"
]
| Check to make sure a given binary is the right version.
@return {kew.Promise.<boolean>} | [
"Check",
"to",
"make",
"sure",
"a",
"given",
"binary",
"is",
"the",
"right",
"version",
"."
]
| 5629951fa99aa54fd0b52102679a254108c3e182 | https://github.com/takuhii/PhantomJS-25_Beta/blob/5629951fa99aa54fd0b52102679a254108c3e182/lib/util.js#L46-L60 |
43,022 | takuhii/PhantomJS-25_Beta | lib/util.js | verifyChecksum | function verifyChecksum(fileName, checksum) {
return kew.resolve(hasha.fromFile(fileName, {algorithm: 'sha256'})).then(function (hash) {
var result = checksum == hash
if (result) {
console.log('Verified checksum of previously downloaded file')
} else {
console.log('Checksum did not match')
}
return result
}).fail(function (err) {
console.error('Failed to verify checksum: ', err)
return false
})
} | javascript | function verifyChecksum(fileName, checksum) {
return kew.resolve(hasha.fromFile(fileName, {algorithm: 'sha256'})).then(function (hash) {
var result = checksum == hash
if (result) {
console.log('Verified checksum of previously downloaded file')
} else {
console.log('Checksum did not match')
}
return result
}).fail(function (err) {
console.error('Failed to verify checksum: ', err)
return false
})
} | [
"function",
"verifyChecksum",
"(",
"fileName",
",",
"checksum",
")",
"{",
"return",
"kew",
".",
"resolve",
"(",
"hasha",
".",
"fromFile",
"(",
"fileName",
",",
"{",
"algorithm",
":",
"'sha256'",
"}",
")",
")",
".",
"then",
"(",
"function",
"(",
"hash",
")",
"{",
"var",
"result",
"=",
"checksum",
"==",
"hash",
"if",
"(",
"result",
")",
"{",
"console",
".",
"log",
"(",
"'Verified checksum of previously downloaded file'",
")",
"}",
"else",
"{",
"console",
".",
"log",
"(",
"'Checksum did not match'",
")",
"}",
"return",
"result",
"}",
")",
".",
"fail",
"(",
"function",
"(",
"err",
")",
"{",
"console",
".",
"error",
"(",
"'Failed to verify checksum: '",
",",
"err",
")",
"return",
"false",
"}",
")",
"}"
]
| Check to make sure that the file matches the checksum.
@param {string} fileName
@param {string} checksum
@return {Promise.<boolean>} | [
"Check",
"to",
"make",
"sure",
"that",
"the",
"file",
"matches",
"the",
"checksum",
"."
]
| 5629951fa99aa54fd0b52102679a254108c3e182 | https://github.com/takuhii/PhantomJS-25_Beta/blob/5629951fa99aa54fd0b52102679a254108c3e182/lib/util.js#L120-L133 |
43,023 | neyric/webhookit | public/javascripts/yui/history/history-debug.js | _storeStates | function _storeStates() {
var moduleName, moduleObj, initialStates = [], currentStates = [];
for (moduleName in _modules) {
if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
moduleObj = _modules[moduleName];
initialStates.push(moduleName + "=" + moduleObj.initialState);
currentStates.push(moduleName + "=" + moduleObj.currentState);
}
}
_stateField.value = initialStates.join("&") + "|" + currentStates.join("&");
if (YAHOO.env.ua.webkit) {
_stateField.value += "|" + _fqstates.join(",");
}
} | javascript | function _storeStates() {
var moduleName, moduleObj, initialStates = [], currentStates = [];
for (moduleName in _modules) {
if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
moduleObj = _modules[moduleName];
initialStates.push(moduleName + "=" + moduleObj.initialState);
currentStates.push(moduleName + "=" + moduleObj.currentState);
}
}
_stateField.value = initialStates.join("&") + "|" + currentStates.join("&");
if (YAHOO.env.ua.webkit) {
_stateField.value += "|" + _fqstates.join(",");
}
} | [
"function",
"_storeStates",
"(",
")",
"{",
"var",
"moduleName",
",",
"moduleObj",
",",
"initialStates",
"=",
"[",
"]",
",",
"currentStates",
"=",
"[",
"]",
";",
"for",
"(",
"moduleName",
"in",
"_modules",
")",
"{",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"hasOwnProperty",
"(",
"_modules",
",",
"moduleName",
")",
")",
"{",
"moduleObj",
"=",
"_modules",
"[",
"moduleName",
"]",
";",
"initialStates",
".",
"push",
"(",
"moduleName",
"+",
"\"=\"",
"+",
"moduleObj",
".",
"initialState",
")",
";",
"currentStates",
".",
"push",
"(",
"moduleName",
"+",
"\"=\"",
"+",
"moduleObj",
".",
"currentState",
")",
";",
"}",
"}",
"_stateField",
".",
"value",
"=",
"initialStates",
".",
"join",
"(",
"\"&\"",
")",
"+",
"\"|\"",
"+",
"currentStates",
".",
"join",
"(",
"\"&\"",
")",
";",
"if",
"(",
"YAHOO",
".",
"env",
".",
"ua",
".",
"webkit",
")",
"{",
"_stateField",
".",
"value",
"+=",
"\"|\"",
"+",
"_fqstates",
".",
"join",
"(",
"\",\"",
")",
";",
"}",
"}"
]
| Stores all the registered modules' initial state and current state.
On Safari, we also store all the fully qualified states visited by
the application within a single browser session. The storage takes
place in the form field specified during initialization.
@method _storeStates
@private | [
"Stores",
"all",
"the",
"registered",
"modules",
"initial",
"state",
"and",
"current",
"state",
".",
"On",
"Safari",
"we",
"also",
"store",
"all",
"the",
"fully",
"qualified",
"states",
"visited",
"by",
"the",
"application",
"within",
"a",
"single",
"browser",
"session",
".",
"The",
"storage",
"takes",
"place",
"in",
"the",
"form",
"field",
"specified",
"during",
"initialization",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/history/history-debug.js#L111-L128 |
43,024 | neyric/webhookit | public/javascripts/yui/history/history-debug.js | _handleFQStateChange | function _handleFQStateChange(fqstate) {
var i, len, moduleName, moduleObj, modules, states, tokens, currentState;
if (!fqstate) {
// Notifies all modules
for (moduleName in _modules) {
if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
moduleObj = _modules[moduleName];
moduleObj.currentState = moduleObj.initialState;
moduleObj.onStateChange(unescape(moduleObj.currentState));
}
}
return;
}
modules = [];
states = fqstate.split("&");
for (i = 0, len = states.length; i < len; i++) {
tokens = states[i].split("=");
if (tokens.length === 2) {
moduleName = tokens[0];
currentState = tokens[1];
modules[moduleName] = currentState;
}
}
for (moduleName in _modules) {
if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
moduleObj = _modules[moduleName];
currentState = modules[moduleName];
if (!currentState || moduleObj.currentState !== currentState) {
moduleObj.currentState = currentState || moduleObj.initialState;
moduleObj.onStateChange(unescape(moduleObj.currentState));
}
}
}
} | javascript | function _handleFQStateChange(fqstate) {
var i, len, moduleName, moduleObj, modules, states, tokens, currentState;
if (!fqstate) {
// Notifies all modules
for (moduleName in _modules) {
if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
moduleObj = _modules[moduleName];
moduleObj.currentState = moduleObj.initialState;
moduleObj.onStateChange(unescape(moduleObj.currentState));
}
}
return;
}
modules = [];
states = fqstate.split("&");
for (i = 0, len = states.length; i < len; i++) {
tokens = states[i].split("=");
if (tokens.length === 2) {
moduleName = tokens[0];
currentState = tokens[1];
modules[moduleName] = currentState;
}
}
for (moduleName in _modules) {
if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
moduleObj = _modules[moduleName];
currentState = modules[moduleName];
if (!currentState || moduleObj.currentState !== currentState) {
moduleObj.currentState = currentState || moduleObj.initialState;
moduleObj.onStateChange(unescape(moduleObj.currentState));
}
}
}
} | [
"function",
"_handleFQStateChange",
"(",
"fqstate",
")",
"{",
"var",
"i",
",",
"len",
",",
"moduleName",
",",
"moduleObj",
",",
"modules",
",",
"states",
",",
"tokens",
",",
"currentState",
";",
"if",
"(",
"!",
"fqstate",
")",
"{",
"// Notifies all modules",
"for",
"(",
"moduleName",
"in",
"_modules",
")",
"{",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"hasOwnProperty",
"(",
"_modules",
",",
"moduleName",
")",
")",
"{",
"moduleObj",
"=",
"_modules",
"[",
"moduleName",
"]",
";",
"moduleObj",
".",
"currentState",
"=",
"moduleObj",
".",
"initialState",
";",
"moduleObj",
".",
"onStateChange",
"(",
"unescape",
"(",
"moduleObj",
".",
"currentState",
")",
")",
";",
"}",
"}",
"return",
";",
"}",
"modules",
"=",
"[",
"]",
";",
"states",
"=",
"fqstate",
".",
"split",
"(",
"\"&\"",
")",
";",
"for",
"(",
"i",
"=",
"0",
",",
"len",
"=",
"states",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"tokens",
"=",
"states",
"[",
"i",
"]",
".",
"split",
"(",
"\"=\"",
")",
";",
"if",
"(",
"tokens",
".",
"length",
"===",
"2",
")",
"{",
"moduleName",
"=",
"tokens",
"[",
"0",
"]",
";",
"currentState",
"=",
"tokens",
"[",
"1",
"]",
";",
"modules",
"[",
"moduleName",
"]",
"=",
"currentState",
";",
"}",
"}",
"for",
"(",
"moduleName",
"in",
"_modules",
")",
"{",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"hasOwnProperty",
"(",
"_modules",
",",
"moduleName",
")",
")",
"{",
"moduleObj",
"=",
"_modules",
"[",
"moduleName",
"]",
";",
"currentState",
"=",
"modules",
"[",
"moduleName",
"]",
";",
"if",
"(",
"!",
"currentState",
"||",
"moduleObj",
".",
"currentState",
"!==",
"currentState",
")",
"{",
"moduleObj",
".",
"currentState",
"=",
"currentState",
"||",
"moduleObj",
".",
"initialState",
";",
"moduleObj",
".",
"onStateChange",
"(",
"unescape",
"(",
"moduleObj",
".",
"currentState",
")",
")",
";",
"}",
"}",
"}",
"}"
]
| Sets the new currentState attribute of all modules depending on the new
fully qualified state. Also notifies the modules which current state has
changed.
@method _handleFQStateChange
@param {string} fqstate Fully qualified state
@private | [
"Sets",
"the",
"new",
"currentState",
"attribute",
"of",
"all",
"modules",
"depending",
"on",
"the",
"new",
"fully",
"qualified",
"state",
".",
"Also",
"notifies",
"the",
"modules",
"which",
"current",
"state",
"has",
"changed",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/history/history-debug.js#L139-L176 |
43,025 | neyric/webhookit | public/javascripts/yui/history/history-debug.js | _updateIFrame | function _updateIFrame (fqstate) {
var html, doc;
html = '<html><body><div id="state">' +
fqstate.replace(/&/g,'&').
replace(/</g,'<').
replace(/>/g,'>').
replace(/"/g,'"') +
'</div></body></html>';
try {
doc = _histFrame.contentWindow.document;
doc.open();
doc.write(html);
doc.close();
return true;
} catch (e) {
return false;
}
} | javascript | function _updateIFrame (fqstate) {
var html, doc;
html = '<html><body><div id="state">' +
fqstate.replace(/&/g,'&').
replace(/</g,'<').
replace(/>/g,'>').
replace(/"/g,'"') +
'</div></body></html>';
try {
doc = _histFrame.contentWindow.document;
doc.open();
doc.write(html);
doc.close();
return true;
} catch (e) {
return false;
}
} | [
"function",
"_updateIFrame",
"(",
"fqstate",
")",
"{",
"var",
"html",
",",
"doc",
";",
"html",
"=",
"'<html><body><div id=\"state\">'",
"+",
"fqstate",
".",
"replace",
"(",
"/",
"&",
"/",
"g",
",",
"'&'",
")",
".",
"replace",
"(",
"/",
"<",
"/",
"g",
",",
"'<'",
")",
".",
"replace",
"(",
"/",
">",
"/",
"g",
",",
"'>'",
")",
".",
"replace",
"(",
"/",
"\"",
"/",
"g",
",",
"'"'",
")",
"+",
"'</div></body></html>'",
";",
"try",
"{",
"doc",
"=",
"_histFrame",
".",
"contentWindow",
".",
"document",
";",
"doc",
".",
"open",
"(",
")",
";",
"doc",
".",
"write",
"(",
"html",
")",
";",
"doc",
".",
"close",
"(",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"return",
"false",
";",
"}",
"}"
]
| Update the IFrame with our new state.
@method _updateIFrame
@private
@return {boolean} true if successful. false otherwise. | [
"Update",
"the",
"IFrame",
"with",
"our",
"new",
"state",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/history/history-debug.js#L185-L205 |
43,026 | neyric/webhookit | public/javascripts/yui/history/history-debug.js | _checkIframeLoaded | function _checkIframeLoaded() {
var doc, elem, fqstate, hash;
if (!_histFrame.contentWindow || !_histFrame.contentWindow.document) {
// Check again in 10 msec...
setTimeout(_checkIframeLoaded, 10);
return;
}
// Start the thread that will have the responsibility to
// periodically check whether a navigate operation has been
// requested on the main window. This will happen when
// YAHOO.util.History.navigate has been called or after
// the user has hit the back/forward button.
doc = _histFrame.contentWindow.document;
elem = doc.getElementById("state");
// We must use innerText, and not innerHTML because our string contains
// the "&" character (which would end up being escaped as "&") and
// the string comparison would fail...
fqstate = elem ? elem.innerText : null;
hash = _getHash();
setInterval(function () {
var newfqstate, states, moduleName, moduleObj, newHash, historyLength;
doc = _histFrame.contentWindow.document;
elem = doc.getElementById("state");
// See my comment above about using innerText instead of innerHTML...
newfqstate = elem ? elem.innerText : null;
newHash = _getHash();
if (newfqstate !== fqstate) {
fqstate = newfqstate;
_handleFQStateChange(fqstate);
if (!fqstate) {
states = [];
for (moduleName in _modules) {
if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
moduleObj = _modules[moduleName];
states.push(moduleName + "=" + moduleObj.initialState);
}
}
newHash = states.join("&");
} else {
newHash = fqstate;
}
// Allow the state to be bookmarked by setting the top window's
// URL fragment identifier. Note that here, we are on IE, and
// IE does not touch the browser history when setting the hash
// (unlike all the other browsers). I used to write:
// top.location.replace( "#" + hash );
// but this had a side effect when the page was not the top frame.
top.location.hash = newHash;
hash = newHash;
_storeStates();
} else if (newHash !== hash) {
// The hash has changed. The user might have clicked on a link,
// or modified the URL directly, or opened the same application
// bookmarked in a specific state using a bookmark. However, we
// know the hash change was not caused by a hit on the back or
// forward buttons, or by a call to navigate() (because it would
// have been handled above) We must handle these cases, which is
// why we also need to keep track of hash changes on IE!
// Note that IE6 has some major issues with this kind of user
// interaction (the history stack gets completely messed up)
// but it seems to work fine on IE7.
hash = newHash;
// Now, store a new history entry. The following will cause the
// code above to execute, doing all the dirty work for us...
_updateIFrame(newHash);
}
}, 50);
_initialized = true;
YAHOO.util.History.onLoadEvent.fire();
} | javascript | function _checkIframeLoaded() {
var doc, elem, fqstate, hash;
if (!_histFrame.contentWindow || !_histFrame.contentWindow.document) {
// Check again in 10 msec...
setTimeout(_checkIframeLoaded, 10);
return;
}
// Start the thread that will have the responsibility to
// periodically check whether a navigate operation has been
// requested on the main window. This will happen when
// YAHOO.util.History.navigate has been called or after
// the user has hit the back/forward button.
doc = _histFrame.contentWindow.document;
elem = doc.getElementById("state");
// We must use innerText, and not innerHTML because our string contains
// the "&" character (which would end up being escaped as "&") and
// the string comparison would fail...
fqstate = elem ? elem.innerText : null;
hash = _getHash();
setInterval(function () {
var newfqstate, states, moduleName, moduleObj, newHash, historyLength;
doc = _histFrame.contentWindow.document;
elem = doc.getElementById("state");
// See my comment above about using innerText instead of innerHTML...
newfqstate = elem ? elem.innerText : null;
newHash = _getHash();
if (newfqstate !== fqstate) {
fqstate = newfqstate;
_handleFQStateChange(fqstate);
if (!fqstate) {
states = [];
for (moduleName in _modules) {
if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
moduleObj = _modules[moduleName];
states.push(moduleName + "=" + moduleObj.initialState);
}
}
newHash = states.join("&");
} else {
newHash = fqstate;
}
// Allow the state to be bookmarked by setting the top window's
// URL fragment identifier. Note that here, we are on IE, and
// IE does not touch the browser history when setting the hash
// (unlike all the other browsers). I used to write:
// top.location.replace( "#" + hash );
// but this had a side effect when the page was not the top frame.
top.location.hash = newHash;
hash = newHash;
_storeStates();
} else if (newHash !== hash) {
// The hash has changed. The user might have clicked on a link,
// or modified the URL directly, or opened the same application
// bookmarked in a specific state using a bookmark. However, we
// know the hash change was not caused by a hit on the back or
// forward buttons, or by a call to navigate() (because it would
// have been handled above) We must handle these cases, which is
// why we also need to keep track of hash changes on IE!
// Note that IE6 has some major issues with this kind of user
// interaction (the history stack gets completely messed up)
// but it seems to work fine on IE7.
hash = newHash;
// Now, store a new history entry. The following will cause the
// code above to execute, doing all the dirty work for us...
_updateIFrame(newHash);
}
}, 50);
_initialized = true;
YAHOO.util.History.onLoadEvent.fire();
} | [
"function",
"_checkIframeLoaded",
"(",
")",
"{",
"var",
"doc",
",",
"elem",
",",
"fqstate",
",",
"hash",
";",
"if",
"(",
"!",
"_histFrame",
".",
"contentWindow",
"||",
"!",
"_histFrame",
".",
"contentWindow",
".",
"document",
")",
"{",
"// Check again in 10 msec...",
"setTimeout",
"(",
"_checkIframeLoaded",
",",
"10",
")",
";",
"return",
";",
"}",
"// Start the thread that will have the responsibility to",
"// periodically check whether a navigate operation has been",
"// requested on the main window. This will happen when",
"// YAHOO.util.History.navigate has been called or after",
"// the user has hit the back/forward button.",
"doc",
"=",
"_histFrame",
".",
"contentWindow",
".",
"document",
";",
"elem",
"=",
"doc",
".",
"getElementById",
"(",
"\"state\"",
")",
";",
"// We must use innerText, and not innerHTML because our string contains",
"// the \"&\" character (which would end up being escaped as \"&\") and",
"// the string comparison would fail...",
"fqstate",
"=",
"elem",
"?",
"elem",
".",
"innerText",
":",
"null",
";",
"hash",
"=",
"_getHash",
"(",
")",
";",
"setInterval",
"(",
"function",
"(",
")",
"{",
"var",
"newfqstate",
",",
"states",
",",
"moduleName",
",",
"moduleObj",
",",
"newHash",
",",
"historyLength",
";",
"doc",
"=",
"_histFrame",
".",
"contentWindow",
".",
"document",
";",
"elem",
"=",
"doc",
".",
"getElementById",
"(",
"\"state\"",
")",
";",
"// See my comment above about using innerText instead of innerHTML...",
"newfqstate",
"=",
"elem",
"?",
"elem",
".",
"innerText",
":",
"null",
";",
"newHash",
"=",
"_getHash",
"(",
")",
";",
"if",
"(",
"newfqstate",
"!==",
"fqstate",
")",
"{",
"fqstate",
"=",
"newfqstate",
";",
"_handleFQStateChange",
"(",
"fqstate",
")",
";",
"if",
"(",
"!",
"fqstate",
")",
"{",
"states",
"=",
"[",
"]",
";",
"for",
"(",
"moduleName",
"in",
"_modules",
")",
"{",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"hasOwnProperty",
"(",
"_modules",
",",
"moduleName",
")",
")",
"{",
"moduleObj",
"=",
"_modules",
"[",
"moduleName",
"]",
";",
"states",
".",
"push",
"(",
"moduleName",
"+",
"\"=\"",
"+",
"moduleObj",
".",
"initialState",
")",
";",
"}",
"}",
"newHash",
"=",
"states",
".",
"join",
"(",
"\"&\"",
")",
";",
"}",
"else",
"{",
"newHash",
"=",
"fqstate",
";",
"}",
"// Allow the state to be bookmarked by setting the top window's",
"// URL fragment identifier. Note that here, we are on IE, and",
"// IE does not touch the browser history when setting the hash",
"// (unlike all the other browsers). I used to write:",
"// top.location.replace( \"#\" + hash );",
"// but this had a side effect when the page was not the top frame.",
"top",
".",
"location",
".",
"hash",
"=",
"newHash",
";",
"hash",
"=",
"newHash",
";",
"_storeStates",
"(",
")",
";",
"}",
"else",
"if",
"(",
"newHash",
"!==",
"hash",
")",
"{",
"// The hash has changed. The user might have clicked on a link,",
"// or modified the URL directly, or opened the same application",
"// bookmarked in a specific state using a bookmark. However, we",
"// know the hash change was not caused by a hit on the back or",
"// forward buttons, or by a call to navigate() (because it would",
"// have been handled above) We must handle these cases, which is",
"// why we also need to keep track of hash changes on IE!",
"// Note that IE6 has some major issues with this kind of user",
"// interaction (the history stack gets completely messed up)",
"// but it seems to work fine on IE7.",
"hash",
"=",
"newHash",
";",
"// Now, store a new history entry. The following will cause the",
"// code above to execute, doing all the dirty work for us...",
"_updateIFrame",
"(",
"newHash",
")",
";",
"}",
"}",
",",
"50",
")",
";",
"_initialized",
"=",
"true",
";",
"YAHOO",
".",
"util",
".",
"History",
".",
"onLoadEvent",
".",
"fire",
"(",
")",
";",
"}"
]
| Periodically checks whether our internal IFrame is ready to be used.
@method _checkIframeLoaded
@private | [
"Periodically",
"checks",
"whether",
"our",
"internal",
"IFrame",
"is",
"ready",
"to",
"be",
"used",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/history/history-debug.js#L213-L303 |
43,027 | neyric/webhookit | public/javascripts/yui/history/history-debug.js | _initialize | function _initialize() {
var i, len, parts, tokens, moduleName, moduleObj, initialStates, initialState, currentStates, currentState, counter, hash;
// Decode the content of our storage field...
parts = _stateField.value.split("|");
if (parts.length > 1) {
initialStates = parts[0].split("&");
for (i = 0, len = initialStates.length; i < len; i++) {
tokens = initialStates[i].split("=");
if (tokens.length === 2) {
moduleName = tokens[0];
initialState = tokens[1];
moduleObj = _modules[moduleName];
if (moduleObj) {
moduleObj.initialState = initialState;
}
}
}
currentStates = parts[1].split("&");
for (i = 0, len = currentStates.length; i < len; i++) {
tokens = currentStates[i].split("=");
if (tokens.length >= 2) {
moduleName = tokens[0];
currentState = tokens[1];
moduleObj = _modules[moduleName];
if (moduleObj) {
moduleObj.currentState = currentState;
}
}
}
}
if (parts.length > 2) {
_fqstates = parts[2].split(",");
}
if (YAHOO.env.ua.ie) {
if (typeof document.documentMode === "undefined" || document.documentMode < 8) {
// IE < 8 or IE8 in quirks mode or IE7 standards mode
_checkIframeLoaded();
} else {
// IE8 in IE8 standards mode
YAHOO.util.Event.on(top, "hashchange",
function () {
var hash = _getHash();
_handleFQStateChange(hash);
_storeStates();
});
_initialized = true;
YAHOO.util.History.onLoadEvent.fire();
}
} else {
// Start the thread that will have the responsibility to
// periodically check whether a navigate operation has been
// requested on the main window. This will happen when
// YAHOO.util.History.navigate has been called or after
// the user has hit the back/forward button.
// On Safari 1.x and 2.0, the only way to catch a back/forward
// operation is to watch history.length... We basically exploit
// what I consider to be a bug (history.length is not supposed
// to change when going back/forward in the history...) This is
// why, in the following thread, we first compare the hash,
// because the hash thing will be fixed in the next major
// version of Safari. So even if they fix the history.length
// bug, all this will still work!
counter = history.length;
// On Gecko and Opera, we just need to watch the hash...
hash = _getHash();
setInterval(function () {
var state, newHash, newCounter;
newHash = _getHash();
newCounter = history.length;
if (newHash !== hash) {
hash = newHash;
counter = newCounter;
_handleFQStateChange(hash);
_storeStates();
} else if (newCounter !== counter && YAHOO.env.ua.webkit) {
hash = newHash;
counter = newCounter;
state = _fqstates[counter - 1];
_handleFQStateChange(state);
_storeStates();
}
}, 50);
_initialized = true;
YAHOO.util.History.onLoadEvent.fire();
}
} | javascript | function _initialize() {
var i, len, parts, tokens, moduleName, moduleObj, initialStates, initialState, currentStates, currentState, counter, hash;
// Decode the content of our storage field...
parts = _stateField.value.split("|");
if (parts.length > 1) {
initialStates = parts[0].split("&");
for (i = 0, len = initialStates.length; i < len; i++) {
tokens = initialStates[i].split("=");
if (tokens.length === 2) {
moduleName = tokens[0];
initialState = tokens[1];
moduleObj = _modules[moduleName];
if (moduleObj) {
moduleObj.initialState = initialState;
}
}
}
currentStates = parts[1].split("&");
for (i = 0, len = currentStates.length; i < len; i++) {
tokens = currentStates[i].split("=");
if (tokens.length >= 2) {
moduleName = tokens[0];
currentState = tokens[1];
moduleObj = _modules[moduleName];
if (moduleObj) {
moduleObj.currentState = currentState;
}
}
}
}
if (parts.length > 2) {
_fqstates = parts[2].split(",");
}
if (YAHOO.env.ua.ie) {
if (typeof document.documentMode === "undefined" || document.documentMode < 8) {
// IE < 8 or IE8 in quirks mode or IE7 standards mode
_checkIframeLoaded();
} else {
// IE8 in IE8 standards mode
YAHOO.util.Event.on(top, "hashchange",
function () {
var hash = _getHash();
_handleFQStateChange(hash);
_storeStates();
});
_initialized = true;
YAHOO.util.History.onLoadEvent.fire();
}
} else {
// Start the thread that will have the responsibility to
// periodically check whether a navigate operation has been
// requested on the main window. This will happen when
// YAHOO.util.History.navigate has been called or after
// the user has hit the back/forward button.
// On Safari 1.x and 2.0, the only way to catch a back/forward
// operation is to watch history.length... We basically exploit
// what I consider to be a bug (history.length is not supposed
// to change when going back/forward in the history...) This is
// why, in the following thread, we first compare the hash,
// because the hash thing will be fixed in the next major
// version of Safari. So even if they fix the history.length
// bug, all this will still work!
counter = history.length;
// On Gecko and Opera, we just need to watch the hash...
hash = _getHash();
setInterval(function () {
var state, newHash, newCounter;
newHash = _getHash();
newCounter = history.length;
if (newHash !== hash) {
hash = newHash;
counter = newCounter;
_handleFQStateChange(hash);
_storeStates();
} else if (newCounter !== counter && YAHOO.env.ua.webkit) {
hash = newHash;
counter = newCounter;
state = _fqstates[counter - 1];
_handleFQStateChange(state);
_storeStates();
}
}, 50);
_initialized = true;
YAHOO.util.History.onLoadEvent.fire();
}
} | [
"function",
"_initialize",
"(",
")",
"{",
"var",
"i",
",",
"len",
",",
"parts",
",",
"tokens",
",",
"moduleName",
",",
"moduleObj",
",",
"initialStates",
",",
"initialState",
",",
"currentStates",
",",
"currentState",
",",
"counter",
",",
"hash",
";",
"// Decode the content of our storage field...",
"parts",
"=",
"_stateField",
".",
"value",
".",
"split",
"(",
"\"|\"",
")",
";",
"if",
"(",
"parts",
".",
"length",
">",
"1",
")",
"{",
"initialStates",
"=",
"parts",
"[",
"0",
"]",
".",
"split",
"(",
"\"&\"",
")",
";",
"for",
"(",
"i",
"=",
"0",
",",
"len",
"=",
"initialStates",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"tokens",
"=",
"initialStates",
"[",
"i",
"]",
".",
"split",
"(",
"\"=\"",
")",
";",
"if",
"(",
"tokens",
".",
"length",
"===",
"2",
")",
"{",
"moduleName",
"=",
"tokens",
"[",
"0",
"]",
";",
"initialState",
"=",
"tokens",
"[",
"1",
"]",
";",
"moduleObj",
"=",
"_modules",
"[",
"moduleName",
"]",
";",
"if",
"(",
"moduleObj",
")",
"{",
"moduleObj",
".",
"initialState",
"=",
"initialState",
";",
"}",
"}",
"}",
"currentStates",
"=",
"parts",
"[",
"1",
"]",
".",
"split",
"(",
"\"&\"",
")",
";",
"for",
"(",
"i",
"=",
"0",
",",
"len",
"=",
"currentStates",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"tokens",
"=",
"currentStates",
"[",
"i",
"]",
".",
"split",
"(",
"\"=\"",
")",
";",
"if",
"(",
"tokens",
".",
"length",
">=",
"2",
")",
"{",
"moduleName",
"=",
"tokens",
"[",
"0",
"]",
";",
"currentState",
"=",
"tokens",
"[",
"1",
"]",
";",
"moduleObj",
"=",
"_modules",
"[",
"moduleName",
"]",
";",
"if",
"(",
"moduleObj",
")",
"{",
"moduleObj",
".",
"currentState",
"=",
"currentState",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"parts",
".",
"length",
">",
"2",
")",
"{",
"_fqstates",
"=",
"parts",
"[",
"2",
"]",
".",
"split",
"(",
"\",\"",
")",
";",
"}",
"if",
"(",
"YAHOO",
".",
"env",
".",
"ua",
".",
"ie",
")",
"{",
"if",
"(",
"typeof",
"document",
".",
"documentMode",
"===",
"\"undefined\"",
"||",
"document",
".",
"documentMode",
"<",
"8",
")",
"{",
"// IE < 8 or IE8 in quirks mode or IE7 standards mode",
"_checkIframeLoaded",
"(",
")",
";",
"}",
"else",
"{",
"// IE8 in IE8 standards mode",
"YAHOO",
".",
"util",
".",
"Event",
".",
"on",
"(",
"top",
",",
"\"hashchange\"",
",",
"function",
"(",
")",
"{",
"var",
"hash",
"=",
"_getHash",
"(",
")",
";",
"_handleFQStateChange",
"(",
"hash",
")",
";",
"_storeStates",
"(",
")",
";",
"}",
")",
";",
"_initialized",
"=",
"true",
";",
"YAHOO",
".",
"util",
".",
"History",
".",
"onLoadEvent",
".",
"fire",
"(",
")",
";",
"}",
"}",
"else",
"{",
"// Start the thread that will have the responsibility to",
"// periodically check whether a navigate operation has been",
"// requested on the main window. This will happen when",
"// YAHOO.util.History.navigate has been called or after",
"// the user has hit the back/forward button.",
"// On Safari 1.x and 2.0, the only way to catch a back/forward",
"// operation is to watch history.length... We basically exploit",
"// what I consider to be a bug (history.length is not supposed",
"// to change when going back/forward in the history...) This is",
"// why, in the following thread, we first compare the hash,",
"// because the hash thing will be fixed in the next major",
"// version of Safari. So even if they fix the history.length",
"// bug, all this will still work!",
"counter",
"=",
"history",
".",
"length",
";",
"// On Gecko and Opera, we just need to watch the hash...",
"hash",
"=",
"_getHash",
"(",
")",
";",
"setInterval",
"(",
"function",
"(",
")",
"{",
"var",
"state",
",",
"newHash",
",",
"newCounter",
";",
"newHash",
"=",
"_getHash",
"(",
")",
";",
"newCounter",
"=",
"history",
".",
"length",
";",
"if",
"(",
"newHash",
"!==",
"hash",
")",
"{",
"hash",
"=",
"newHash",
";",
"counter",
"=",
"newCounter",
";",
"_handleFQStateChange",
"(",
"hash",
")",
";",
"_storeStates",
"(",
")",
";",
"}",
"else",
"if",
"(",
"newCounter",
"!==",
"counter",
"&&",
"YAHOO",
".",
"env",
".",
"ua",
".",
"webkit",
")",
"{",
"hash",
"=",
"newHash",
";",
"counter",
"=",
"newCounter",
";",
"state",
"=",
"_fqstates",
"[",
"counter",
"-",
"1",
"]",
";",
"_handleFQStateChange",
"(",
"state",
")",
";",
"_storeStates",
"(",
")",
";",
"}",
"}",
",",
"50",
")",
";",
"_initialized",
"=",
"true",
";",
"YAHOO",
".",
"util",
".",
"History",
".",
"onLoadEvent",
".",
"fire",
"(",
")",
";",
"}",
"}"
]
| Finish up the initialization of the Browser History Manager.
@method _initialize
@private | [
"Finish",
"up",
"the",
"initialization",
"of",
"the",
"Browser",
"History",
"Manager",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/history/history-debug.js#L311-L418 |
43,028 | neyric/webhookit | public/javascripts/yui/history/history-debug.js | function (fn, obj, overrideContext) {
if (_initialized) {
setTimeout(function () {
var ctx = window;
if (overrideContext) {
if (overrideContext === true) {
ctx = obj;
} else {
ctx = overrideContext;
}
}
fn.call(ctx, "onLoad", [], obj);
}, 0);
} else {
YAHOO.util.History.onLoadEvent.subscribe(fn, obj, overrideContext);
}
} | javascript | function (fn, obj, overrideContext) {
if (_initialized) {
setTimeout(function () {
var ctx = window;
if (overrideContext) {
if (overrideContext === true) {
ctx = obj;
} else {
ctx = overrideContext;
}
}
fn.call(ctx, "onLoad", [], obj);
}, 0);
} else {
YAHOO.util.History.onLoadEvent.subscribe(fn, obj, overrideContext);
}
} | [
"function",
"(",
"fn",
",",
"obj",
",",
"overrideContext",
")",
"{",
"if",
"(",
"_initialized",
")",
"{",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"var",
"ctx",
"=",
"window",
";",
"if",
"(",
"overrideContext",
")",
"{",
"if",
"(",
"overrideContext",
"===",
"true",
")",
"{",
"ctx",
"=",
"obj",
";",
"}",
"else",
"{",
"ctx",
"=",
"overrideContext",
";",
"}",
"}",
"fn",
".",
"call",
"(",
"ctx",
",",
"\"onLoad\"",
",",
"[",
"]",
",",
"obj",
")",
";",
"}",
",",
"0",
")",
";",
"}",
"else",
"{",
"YAHOO",
".",
"util",
".",
"History",
".",
"onLoadEvent",
".",
"subscribe",
"(",
"fn",
",",
"obj",
",",
"overrideContext",
")",
";",
"}",
"}"
]
| Executes the supplied callback when the Browser History Manager is
ready. This will execute immediately if called after the Browser
History Manager onLoad event has fired.
@method onReady
@param {function} fn what to execute when the Browser History Manager is ready.
@param {object} obj an optional object to be passed back as a parameter to fn.
@param {boolean|object} overrideContext If true, the obj passed in becomes fn's execution scope.
@see onLoadEvent | [
"Executes",
"the",
"supplied",
"callback",
"when",
"the",
"Browser",
"History",
"Manager",
"is",
"ready",
".",
"This",
"will",
"execute",
"immediately",
"if",
"called",
"after",
"the",
"Browser",
"History",
"Manager",
"onLoad",
"event",
"has",
"fired",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/history/history-debug.js#L444-L465 |
|
43,029 | neyric/webhookit | public/javascripts/yui/history/history-debug.js | function (module, initialState, onStateChange, obj, overrideContext) {
var scope, wrappedFn;
if (typeof module !== "string" || YAHOO.lang.trim(module) === "" ||
typeof initialState !== "string" ||
typeof onStateChange !== "function") {
throw new Error("Missing or invalid argument");
}
if (_modules[module]) {
// Here, we used to throw an exception. However, users have
// complained about this behavior, so we now just return.
return;
}
// Note: A module CANNOT be registered after calling
// YAHOO.util.History.initialize. Indeed, we set the initial state
// of each registered module in YAHOO.util.History.initialize.
// If you could register a module after initializing the Browser
// History Manager, you would not read the correct state using
// YAHOO.util.History.getCurrentState when coming back to the
// page using the back button.
if (_initialized) {
throw new Error("All modules must be registered before calling YAHOO.util.History.initialize");
}
// Make sure the strings passed in do not contain our separators "," and "|"
module = escape(module);
initialState = escape(initialState);
// If the user chooses to override the scope, we use the
// custom object passed in as the execution scope.
scope = null;
if (overrideContext === true) {
scope = obj;
} else {
scope = overrideContext;
}
wrappedFn = function (state) {
return onStateChange.call(scope, state, obj);
};
_modules[module] = {
name: module,
initialState: initialState,
currentState: initialState,
onStateChange: wrappedFn
};
} | javascript | function (module, initialState, onStateChange, obj, overrideContext) {
var scope, wrappedFn;
if (typeof module !== "string" || YAHOO.lang.trim(module) === "" ||
typeof initialState !== "string" ||
typeof onStateChange !== "function") {
throw new Error("Missing or invalid argument");
}
if (_modules[module]) {
// Here, we used to throw an exception. However, users have
// complained about this behavior, so we now just return.
return;
}
// Note: A module CANNOT be registered after calling
// YAHOO.util.History.initialize. Indeed, we set the initial state
// of each registered module in YAHOO.util.History.initialize.
// If you could register a module after initializing the Browser
// History Manager, you would not read the correct state using
// YAHOO.util.History.getCurrentState when coming back to the
// page using the back button.
if (_initialized) {
throw new Error("All modules must be registered before calling YAHOO.util.History.initialize");
}
// Make sure the strings passed in do not contain our separators "," and "|"
module = escape(module);
initialState = escape(initialState);
// If the user chooses to override the scope, we use the
// custom object passed in as the execution scope.
scope = null;
if (overrideContext === true) {
scope = obj;
} else {
scope = overrideContext;
}
wrappedFn = function (state) {
return onStateChange.call(scope, state, obj);
};
_modules[module] = {
name: module,
initialState: initialState,
currentState: initialState,
onStateChange: wrappedFn
};
} | [
"function",
"(",
"module",
",",
"initialState",
",",
"onStateChange",
",",
"obj",
",",
"overrideContext",
")",
"{",
"var",
"scope",
",",
"wrappedFn",
";",
"if",
"(",
"typeof",
"module",
"!==",
"\"string\"",
"||",
"YAHOO",
".",
"lang",
".",
"trim",
"(",
"module",
")",
"===",
"\"\"",
"||",
"typeof",
"initialState",
"!==",
"\"string\"",
"||",
"typeof",
"onStateChange",
"!==",
"\"function\"",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Missing or invalid argument\"",
")",
";",
"}",
"if",
"(",
"_modules",
"[",
"module",
"]",
")",
"{",
"// Here, we used to throw an exception. However, users have",
"// complained about this behavior, so we now just return.",
"return",
";",
"}",
"// Note: A module CANNOT be registered after calling",
"// YAHOO.util.History.initialize. Indeed, we set the initial state",
"// of each registered module in YAHOO.util.History.initialize.",
"// If you could register a module after initializing the Browser",
"// History Manager, you would not read the correct state using",
"// YAHOO.util.History.getCurrentState when coming back to the",
"// page using the back button.",
"if",
"(",
"_initialized",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"All modules must be registered before calling YAHOO.util.History.initialize\"",
")",
";",
"}",
"// Make sure the strings passed in do not contain our separators \",\" and \"|\"",
"module",
"=",
"escape",
"(",
"module",
")",
";",
"initialState",
"=",
"escape",
"(",
"initialState",
")",
";",
"// If the user chooses to override the scope, we use the",
"// custom object passed in as the execution scope.",
"scope",
"=",
"null",
";",
"if",
"(",
"overrideContext",
"===",
"true",
")",
"{",
"scope",
"=",
"obj",
";",
"}",
"else",
"{",
"scope",
"=",
"overrideContext",
";",
"}",
"wrappedFn",
"=",
"function",
"(",
"state",
")",
"{",
"return",
"onStateChange",
".",
"call",
"(",
"scope",
",",
"state",
",",
"obj",
")",
";",
"}",
";",
"_modules",
"[",
"module",
"]",
"=",
"{",
"name",
":",
"module",
",",
"initialState",
":",
"initialState",
",",
"currentState",
":",
"initialState",
",",
"onStateChange",
":",
"wrappedFn",
"}",
";",
"}"
]
| Registers a new module.
@method register
@param {string} module Non-empty string uniquely identifying the
module you wish to register.
@param {string} initialState The initial state of the specified
module corresponding to its earliest history entry.
@param {function} onStateChange Callback called when the
state of the specified module has changed.
@param {object} obj An arbitrary object that will be passed as a
parameter to the handler.
@param {boolean} overrideContext If true, the obj passed in becomes the
execution scope of the listener. | [
"Registers",
"a",
"new",
"module",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/history/history-debug.js#L482-L532 |
|
43,030 | neyric/webhookit | public/javascripts/yui/history/history-debug.js | function (stateField, histFrame) {
if (_initialized) {
// The browser history manager has already been initialized.
return;
}
if (YAHOO.env.ua.opera && typeof history.navigationMode !== "undefined") {
// Disable Opera's fast back/forward navigation mode and puts
// it in compatible mode. This makes anchor-based history
// navigation work after the page has been navigated away
// from and re-activated, at the cost of slowing down
// back/forward navigation to and from that page.
history.navigationMode = "compatible";
}
if (typeof stateField === "string") {
stateField = document.getElementById(stateField);
}
if (!stateField ||
stateField.tagName.toUpperCase() !== "TEXTAREA" &&
(stateField.tagName.toUpperCase() !== "INPUT" ||
stateField.type !== "hidden" &&
stateField.type !== "text")) {
throw new Error("Missing or invalid argument");
}
_stateField = stateField;
// IE < 8 or IE8 in quirks mode or IE7 standards mode
if (YAHOO.env.ua.ie && (typeof document.documentMode === "undefined" || document.documentMode < 8)) {
if (typeof histFrame === "string") {
histFrame = document.getElementById(histFrame);
}
if (!histFrame || histFrame.tagName.toUpperCase() !== "IFRAME") {
throw new Error("Missing or invalid argument");
}
_histFrame = histFrame;
}
// Note that the event utility MUST be included inline in the page.
// If it gets loaded later (which you may want to do to improve the
// loading speed of your site), the onDOMReady event never fires,
// and the history library never gets fully initialized.
YAHOO.util.Event.onDOMReady(_initialize);
} | javascript | function (stateField, histFrame) {
if (_initialized) {
// The browser history manager has already been initialized.
return;
}
if (YAHOO.env.ua.opera && typeof history.navigationMode !== "undefined") {
// Disable Opera's fast back/forward navigation mode and puts
// it in compatible mode. This makes anchor-based history
// navigation work after the page has been navigated away
// from and re-activated, at the cost of slowing down
// back/forward navigation to and from that page.
history.navigationMode = "compatible";
}
if (typeof stateField === "string") {
stateField = document.getElementById(stateField);
}
if (!stateField ||
stateField.tagName.toUpperCase() !== "TEXTAREA" &&
(stateField.tagName.toUpperCase() !== "INPUT" ||
stateField.type !== "hidden" &&
stateField.type !== "text")) {
throw new Error("Missing or invalid argument");
}
_stateField = stateField;
// IE < 8 or IE8 in quirks mode or IE7 standards mode
if (YAHOO.env.ua.ie && (typeof document.documentMode === "undefined" || document.documentMode < 8)) {
if (typeof histFrame === "string") {
histFrame = document.getElementById(histFrame);
}
if (!histFrame || histFrame.tagName.toUpperCase() !== "IFRAME") {
throw new Error("Missing or invalid argument");
}
_histFrame = histFrame;
}
// Note that the event utility MUST be included inline in the page.
// If it gets loaded later (which you may want to do to improve the
// loading speed of your site), the onDOMReady event never fires,
// and the history library never gets fully initialized.
YAHOO.util.Event.onDOMReady(_initialize);
} | [
"function",
"(",
"stateField",
",",
"histFrame",
")",
"{",
"if",
"(",
"_initialized",
")",
"{",
"// The browser history manager has already been initialized.",
"return",
";",
"}",
"if",
"(",
"YAHOO",
".",
"env",
".",
"ua",
".",
"opera",
"&&",
"typeof",
"history",
".",
"navigationMode",
"!==",
"\"undefined\"",
")",
"{",
"// Disable Opera's fast back/forward navigation mode and puts",
"// it in compatible mode. This makes anchor-based history",
"// navigation work after the page has been navigated away",
"// from and re-activated, at the cost of slowing down",
"// back/forward navigation to and from that page.",
"history",
".",
"navigationMode",
"=",
"\"compatible\"",
";",
"}",
"if",
"(",
"typeof",
"stateField",
"===",
"\"string\"",
")",
"{",
"stateField",
"=",
"document",
".",
"getElementById",
"(",
"stateField",
")",
";",
"}",
"if",
"(",
"!",
"stateField",
"||",
"stateField",
".",
"tagName",
".",
"toUpperCase",
"(",
")",
"!==",
"\"TEXTAREA\"",
"&&",
"(",
"stateField",
".",
"tagName",
".",
"toUpperCase",
"(",
")",
"!==",
"\"INPUT\"",
"||",
"stateField",
".",
"type",
"!==",
"\"hidden\"",
"&&",
"stateField",
".",
"type",
"!==",
"\"text\"",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Missing or invalid argument\"",
")",
";",
"}",
"_stateField",
"=",
"stateField",
";",
"// IE < 8 or IE8 in quirks mode or IE7 standards mode",
"if",
"(",
"YAHOO",
".",
"env",
".",
"ua",
".",
"ie",
"&&",
"(",
"typeof",
"document",
".",
"documentMode",
"===",
"\"undefined\"",
"||",
"document",
".",
"documentMode",
"<",
"8",
")",
")",
"{",
"if",
"(",
"typeof",
"histFrame",
"===",
"\"string\"",
")",
"{",
"histFrame",
"=",
"document",
".",
"getElementById",
"(",
"histFrame",
")",
";",
"}",
"if",
"(",
"!",
"histFrame",
"||",
"histFrame",
".",
"tagName",
".",
"toUpperCase",
"(",
")",
"!==",
"\"IFRAME\"",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Missing or invalid argument\"",
")",
";",
"}",
"_histFrame",
"=",
"histFrame",
";",
"}",
"// Note that the event utility MUST be included inline in the page.",
"// If it gets loaded later (which you may want to do to improve the",
"// loading speed of your site), the onDOMReady event never fires,",
"// and the history library never gets fully initialized.",
"YAHOO",
".",
"util",
".",
"Event",
".",
"onDOMReady",
"(",
"_initialize",
")",
";",
"}"
]
| Initializes the Browser History Manager. Call this method
from a script block located right after the opening body tag.
@method initialize
@param {string|HTML Element} stateField <input type="hidden"> used
to store application states. Must be in the static markup.
@param {string|HTML Element} histFrame IFrame used to store
the history (only required on Internet Explorer)
@public | [
"Initializes",
"the",
"Browser",
"History",
"Manager",
".",
"Call",
"this",
"method",
"from",
"a",
"script",
"block",
"located",
"right",
"after",
"the",
"opening",
"body",
"tag",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/history/history-debug.js#L545-L594 |
|
43,031 | neyric/webhookit | public/javascripts/yui/history/history-debug.js | function (module) {
var moduleObj;
if (typeof module !== "string") {
throw new Error("Missing or invalid argument");
}
if (!_initialized) {
throw new Error("The Browser History Manager is not initialized");
}
moduleObj = _modules[module];
if (!moduleObj) {
throw new Error("No such registered module: " + module);
}
return unescape(moduleObj.currentState);
} | javascript | function (module) {
var moduleObj;
if (typeof module !== "string") {
throw new Error("Missing or invalid argument");
}
if (!_initialized) {
throw new Error("The Browser History Manager is not initialized");
}
moduleObj = _modules[module];
if (!moduleObj) {
throw new Error("No such registered module: " + module);
}
return unescape(moduleObj.currentState);
} | [
"function",
"(",
"module",
")",
"{",
"var",
"moduleObj",
";",
"if",
"(",
"typeof",
"module",
"!==",
"\"string\"",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Missing or invalid argument\"",
")",
";",
"}",
"if",
"(",
"!",
"_initialized",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"The Browser History Manager is not initialized\"",
")",
";",
"}",
"moduleObj",
"=",
"_modules",
"[",
"module",
"]",
";",
"if",
"(",
"!",
"moduleObj",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"No such registered module: \"",
"+",
"module",
")",
";",
"}",
"return",
"unescape",
"(",
"moduleObj",
".",
"currentState",
")",
";",
"}"
]
| Returns the current state of the specified module.
@method getCurrentState
@param {string} module Non-empty string representing your module.
@return {string} The current state of the specified module.
@public | [
"Returns",
"the",
"current",
"state",
"of",
"the",
"specified",
"module",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/history/history-debug.js#L705-L723 |
|
43,032 | neyric/webhookit | public/javascripts/yui/history/history-debug.js | function (module) {
var i, len, idx, hash, states, tokens, moduleName;
if (typeof module !== "string") {
throw new Error("Missing or invalid argument");
}
// Use location.href instead of location.hash which is already
// URL-decoded, which creates problems if the state value
// contained special characters...
idx = top.location.href.indexOf("#");
if (idx >= 0) {
hash = top.location.href.substr(idx + 1);
states = hash.split("&");
for (i = 0, len = states.length; i < len; i++) {
tokens = states[i].split("=");
if (tokens.length === 2) {
moduleName = tokens[0];
if (moduleName === module) {
return unescape(tokens[1]);
}
}
}
}
return null;
} | javascript | function (module) {
var i, len, idx, hash, states, tokens, moduleName;
if (typeof module !== "string") {
throw new Error("Missing or invalid argument");
}
// Use location.href instead of location.hash which is already
// URL-decoded, which creates problems if the state value
// contained special characters...
idx = top.location.href.indexOf("#");
if (idx >= 0) {
hash = top.location.href.substr(idx + 1);
states = hash.split("&");
for (i = 0, len = states.length; i < len; i++) {
tokens = states[i].split("=");
if (tokens.length === 2) {
moduleName = tokens[0];
if (moduleName === module) {
return unescape(tokens[1]);
}
}
}
}
return null;
} | [
"function",
"(",
"module",
")",
"{",
"var",
"i",
",",
"len",
",",
"idx",
",",
"hash",
",",
"states",
",",
"tokens",
",",
"moduleName",
";",
"if",
"(",
"typeof",
"module",
"!==",
"\"string\"",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Missing or invalid argument\"",
")",
";",
"}",
"// Use location.href instead of location.hash which is already",
"// URL-decoded, which creates problems if the state value",
"// contained special characters...",
"idx",
"=",
"top",
".",
"location",
".",
"href",
".",
"indexOf",
"(",
"\"#\"",
")",
";",
"if",
"(",
"idx",
">=",
"0",
")",
"{",
"hash",
"=",
"top",
".",
"location",
".",
"href",
".",
"substr",
"(",
"idx",
"+",
"1",
")",
";",
"states",
"=",
"hash",
".",
"split",
"(",
"\"&\"",
")",
";",
"for",
"(",
"i",
"=",
"0",
",",
"len",
"=",
"states",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"tokens",
"=",
"states",
"[",
"i",
"]",
".",
"split",
"(",
"\"=\"",
")",
";",
"if",
"(",
"tokens",
".",
"length",
"===",
"2",
")",
"{",
"moduleName",
"=",
"tokens",
"[",
"0",
"]",
";",
"if",
"(",
"moduleName",
"===",
"module",
")",
"{",
"return",
"unescape",
"(",
"tokens",
"[",
"1",
"]",
")",
";",
"}",
"}",
"}",
"}",
"return",
"null",
";",
"}"
]
| Returns the state of a module according to the URL fragment
identifier. This method is useful to initialize your modules
if your application was bookmarked from a particular state.
@method getBookmarkedState
@param {string} module Non-empty string representing your module.
@return {string} The bookmarked state of the specified module.
@public | [
"Returns",
"the",
"state",
"of",
"a",
"module",
"according",
"to",
"the",
"URL",
"fragment",
"identifier",
".",
"This",
"method",
"is",
"useful",
"to",
"initialize",
"your",
"modules",
"if",
"your",
"application",
"was",
"bookmarked",
"from",
"a",
"particular",
"state",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/history/history-debug.js#L735-L762 |
|
43,033 | neyric/webhookit | public/javascripts/yui/history/history-debug.js | function (paramName, url) {
var i, len, idx, queryString, params, tokens;
url = url || top.location.href;
idx = url.indexOf("?");
queryString = idx >= 0 ? url.substr(idx + 1) : url;
// Remove the hash if any
idx = queryString.lastIndexOf("#");
queryString = idx >= 0 ? queryString.substr(0, idx) : queryString;
params = queryString.split("&");
for (i = 0, len = params.length; i < len; i++) {
tokens = params[i].split("=");
if (tokens.length >= 2) {
if (tokens[0] === paramName) {
return unescape(tokens[1]);
}
}
}
return null;
} | javascript | function (paramName, url) {
var i, len, idx, queryString, params, tokens;
url = url || top.location.href;
idx = url.indexOf("?");
queryString = idx >= 0 ? url.substr(idx + 1) : url;
// Remove the hash if any
idx = queryString.lastIndexOf("#");
queryString = idx >= 0 ? queryString.substr(0, idx) : queryString;
params = queryString.split("&");
for (i = 0, len = params.length; i < len; i++) {
tokens = params[i].split("=");
if (tokens.length >= 2) {
if (tokens[0] === paramName) {
return unescape(tokens[1]);
}
}
}
return null;
} | [
"function",
"(",
"paramName",
",",
"url",
")",
"{",
"var",
"i",
",",
"len",
",",
"idx",
",",
"queryString",
",",
"params",
",",
"tokens",
";",
"url",
"=",
"url",
"||",
"top",
".",
"location",
".",
"href",
";",
"idx",
"=",
"url",
".",
"indexOf",
"(",
"\"?\"",
")",
";",
"queryString",
"=",
"idx",
">=",
"0",
"?",
"url",
".",
"substr",
"(",
"idx",
"+",
"1",
")",
":",
"url",
";",
"// Remove the hash if any",
"idx",
"=",
"queryString",
".",
"lastIndexOf",
"(",
"\"#\"",
")",
";",
"queryString",
"=",
"idx",
">=",
"0",
"?",
"queryString",
".",
"substr",
"(",
"0",
",",
"idx",
")",
":",
"queryString",
";",
"params",
"=",
"queryString",
".",
"split",
"(",
"\"&\"",
")",
";",
"for",
"(",
"i",
"=",
"0",
",",
"len",
"=",
"params",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"tokens",
"=",
"params",
"[",
"i",
"]",
".",
"split",
"(",
"\"=\"",
")",
";",
"if",
"(",
"tokens",
".",
"length",
">=",
"2",
")",
"{",
"if",
"(",
"tokens",
"[",
"0",
"]",
"===",
"paramName",
")",
"{",
"return",
"unescape",
"(",
"tokens",
"[",
"1",
"]",
")",
";",
"}",
"}",
"}",
"return",
"null",
";",
"}"
]
| Returns the value of the specified query string parameter.
This method is not used internally by the Browser History Manager.
However, it is provided here as a helper since many applications
using the Browser History Manager will want to read the value of
url parameters to initialize themselves.
@method getQueryStringParameter
@param {string} paramName Name of the parameter we want to look up.
@param {string} queryString Optional URL to look at. If not specified,
this method uses the URL in the address bar.
@return {string} The value of the specified parameter, or null.
@public | [
"Returns",
"the",
"value",
"of",
"the",
"specified",
"query",
"string",
"parameter",
".",
"This",
"method",
"is",
"not",
"used",
"internally",
"by",
"the",
"Browser",
"History",
"Manager",
".",
"However",
"it",
"is",
"provided",
"here",
"as",
"a",
"helper",
"since",
"many",
"applications",
"using",
"the",
"Browser",
"History",
"Manager",
"will",
"want",
"to",
"read",
"the",
"value",
"of",
"url",
"parameters",
"to",
"initialize",
"themselves",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/history/history-debug.js#L778-L803 |
|
43,034 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function () {
var ui = Paginator.ui,
name,UIComp;
for (name in ui) {
if (ui.hasOwnProperty(name)) {
UIComp = ui[name];
if (isObject(UIComp) && isFunction(UIComp.init)) {
UIComp.init(this);
}
}
}
} | javascript | function () {
var ui = Paginator.ui,
name,UIComp;
for (name in ui) {
if (ui.hasOwnProperty(name)) {
UIComp = ui[name];
if (isObject(UIComp) && isFunction(UIComp.init)) {
UIComp.init(this);
}
}
}
} | [
"function",
"(",
")",
"{",
"var",
"ui",
"=",
"Paginator",
".",
"ui",
",",
"name",
",",
"UIComp",
";",
"for",
"(",
"name",
"in",
"ui",
")",
"{",
"if",
"(",
"ui",
".",
"hasOwnProperty",
"(",
"name",
")",
")",
"{",
"UIComp",
"=",
"ui",
"[",
"name",
"]",
";",
"if",
"(",
"isObject",
"(",
"UIComp",
")",
"&&",
"isFunction",
"(",
"UIComp",
".",
"init",
")",
")",
"{",
"UIComp",
".",
"init",
"(",
"this",
")",
";",
"}",
"}",
"}",
"}"
]
| Initialize registered ui components onto this instance.
@method initUIComponents
@private | [
"Initialize",
"registered",
"ui",
"components",
"onto",
"this",
"instance",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L390-L401 |
|
43,035 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (e) {
var v = e.newValue,rpp,state;
if (e.prevValue !== v) {
if (v !== Paginator.VALUE_UNLIMITED) {
rpp = this.get('rowsPerPage');
if (rpp && this.get('recordOffset') >= v) {
state = this.getState({
totalRecords : e.prevValue,
recordOffset : this.get('recordOffset')
});
this.set('recordOffset', state.before.recordOffset);
this._firePageChange(state);
}
}
}
} | javascript | function (e) {
var v = e.newValue,rpp,state;
if (e.prevValue !== v) {
if (v !== Paginator.VALUE_UNLIMITED) {
rpp = this.get('rowsPerPage');
if (rpp && this.get('recordOffset') >= v) {
state = this.getState({
totalRecords : e.prevValue,
recordOffset : this.get('recordOffset')
});
this.set('recordOffset', state.before.recordOffset);
this._firePageChange(state);
}
}
}
} | [
"function",
"(",
"e",
")",
"{",
"var",
"v",
"=",
"e",
".",
"newValue",
",",
"rpp",
",",
"state",
";",
"if",
"(",
"e",
".",
"prevValue",
"!==",
"v",
")",
"{",
"if",
"(",
"v",
"!==",
"Paginator",
".",
"VALUE_UNLIMITED",
")",
"{",
"rpp",
"=",
"this",
".",
"get",
"(",
"'rowsPerPage'",
")",
";",
"if",
"(",
"rpp",
"&&",
"this",
".",
"get",
"(",
"'recordOffset'",
")",
">=",
"v",
")",
"{",
"state",
"=",
"this",
".",
"getState",
"(",
"{",
"totalRecords",
":",
"e",
".",
"prevValue",
",",
"recordOffset",
":",
"this",
".",
"get",
"(",
"'recordOffset'",
")",
"}",
")",
";",
"this",
".",
"set",
"(",
"'recordOffset'",
",",
"state",
".",
"before",
".",
"recordOffset",
")",
";",
"this",
".",
"_firePageChange",
"(",
"state",
")",
";",
"}",
"}",
"}",
"}"
]
| Sets recordOffset to the starting index of the previous page when
totalRecords is reduced below the current recordOffset.
@method _syncRecordOffset
@param e {Event} totalRecordsChange event
@protected | [
"Sets",
"recordOffset",
"to",
"the",
"starting",
"index",
"of",
"the",
"previous",
"page",
"when",
"totalRecords",
"is",
"reduced",
"below",
"the",
"current",
"recordOffset",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L490-L507 |
|
43,036 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (e) {
if (e.prevValue !== e.newValue) {
var change = this._state || {},
state;
change[e.type.replace(/Change$/,'')] = e.prevValue;
state = this.getState(change);
if (state.page !== state.before.page) {
if (this._batch) {
this._pageChanged = true;
} else {
this._firePageChange(state);
}
}
}
} | javascript | function (e) {
if (e.prevValue !== e.newValue) {
var change = this._state || {},
state;
change[e.type.replace(/Change$/,'')] = e.prevValue;
state = this.getState(change);
if (state.page !== state.before.page) {
if (this._batch) {
this._pageChanged = true;
} else {
this._firePageChange(state);
}
}
}
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"e",
".",
"prevValue",
"!==",
"e",
".",
"newValue",
")",
"{",
"var",
"change",
"=",
"this",
".",
"_state",
"||",
"{",
"}",
",",
"state",
";",
"change",
"[",
"e",
".",
"type",
".",
"replace",
"(",
"/",
"Change$",
"/",
",",
"''",
")",
"]",
"=",
"e",
".",
"prevValue",
";",
"state",
"=",
"this",
".",
"getState",
"(",
"change",
")",
";",
"if",
"(",
"state",
".",
"page",
"!==",
"state",
".",
"before",
".",
"page",
")",
"{",
"if",
"(",
"this",
".",
"_batch",
")",
"{",
"this",
".",
"_pageChanged",
"=",
"true",
";",
"}",
"else",
"{",
"this",
".",
"_firePageChange",
"(",
"state",
")",
";",
"}",
"}",
"}",
"}"
]
| Fires the pageChange event when the state attributes have changed in
such a way as to locate the current recordOffset on a new page.
@method _handleStateChange
@param e {Event} the attribute change event
@protected | [
"Fires",
"the",
"pageChange",
"event",
"when",
"the",
"state",
"attributes",
"have",
"changed",
"in",
"such",
"a",
"way",
"as",
"to",
"locate",
"the",
"current",
"recordOffset",
"on",
"a",
"new",
"page",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L516-L532 |
|
43,037 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (state) {
if (isObject(state)) {
var current = state.before;
delete state.before;
this.fireEvent('pageChange',{
type : 'pageChange',
prevValue : state.page,
newValue : current.page,
prevState : state,
newState : current
});
}
} | javascript | function (state) {
if (isObject(state)) {
var current = state.before;
delete state.before;
this.fireEvent('pageChange',{
type : 'pageChange',
prevValue : state.page,
newValue : current.page,
prevState : state,
newState : current
});
}
} | [
"function",
"(",
"state",
")",
"{",
"if",
"(",
"isObject",
"(",
"state",
")",
")",
"{",
"var",
"current",
"=",
"state",
".",
"before",
";",
"delete",
"state",
".",
"before",
";",
"this",
".",
"fireEvent",
"(",
"'pageChange'",
",",
"{",
"type",
":",
"'pageChange'",
",",
"prevValue",
":",
"state",
".",
"page",
",",
"newValue",
":",
"current",
".",
"page",
",",
"prevState",
":",
"state",
",",
"newState",
":",
"current",
"}",
")",
";",
"}",
"}"
]
| Fires a pageChange event in the form of a standard attribute change
event with additional properties prevState and newState.
@method _firePageChange
@param state {Object} the result of getState(oldState)
@protected | [
"Fires",
"a",
"pageChange",
"event",
"in",
"the",
"form",
"of",
"a",
"standard",
"attribute",
"change",
"event",
"with",
"additional",
"properties",
"prevState",
"and",
"newState",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L541-L553 |
|
43,038 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function () {
if (this.get('rendered')) {
return this;
}
var template = this.get('template'),
state = this.getState(),
// ex. yui-pg0-1 (first paginator, second container)
id_base = Paginator.ID_BASE + this.get('id') + '-',
i, len;
// Assemble the containers, keeping them hidden
for (i = 0, len = this._containers.length; i < len; ++i) {
this._renderTemplate(this._containers[i],template,id_base+i,true);
}
// Show the containers if appropriate
this.updateVisibility();
// Set render attribute manually to support its readOnly contract
if (this._containers.length) {
this.setAttributeConfig('rendered', { value: true });
this.fireEvent('render', state);
// For backward compatibility
this.fireEvent('rendered', state);
}
return this;
} | javascript | function () {
if (this.get('rendered')) {
return this;
}
var template = this.get('template'),
state = this.getState(),
// ex. yui-pg0-1 (first paginator, second container)
id_base = Paginator.ID_BASE + this.get('id') + '-',
i, len;
// Assemble the containers, keeping them hidden
for (i = 0, len = this._containers.length; i < len; ++i) {
this._renderTemplate(this._containers[i],template,id_base+i,true);
}
// Show the containers if appropriate
this.updateVisibility();
// Set render attribute manually to support its readOnly contract
if (this._containers.length) {
this.setAttributeConfig('rendered', { value: true });
this.fireEvent('render', state);
// For backward compatibility
this.fireEvent('rendered', state);
}
return this;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"get",
"(",
"'rendered'",
")",
")",
"{",
"return",
"this",
";",
"}",
"var",
"template",
"=",
"this",
".",
"get",
"(",
"'template'",
")",
",",
"state",
"=",
"this",
".",
"getState",
"(",
")",
",",
"// ex. yui-pg0-1 (first paginator, second container)",
"id_base",
"=",
"Paginator",
".",
"ID_BASE",
"+",
"this",
".",
"get",
"(",
"'id'",
")",
"+",
"'-'",
",",
"i",
",",
"len",
";",
"// Assemble the containers, keeping them hidden",
"for",
"(",
"i",
"=",
"0",
",",
"len",
"=",
"this",
".",
"_containers",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"this",
".",
"_renderTemplate",
"(",
"this",
".",
"_containers",
"[",
"i",
"]",
",",
"template",
",",
"id_base",
"+",
"i",
",",
"true",
")",
";",
"}",
"// Show the containers if appropriate",
"this",
".",
"updateVisibility",
"(",
")",
";",
"// Set render attribute manually to support its readOnly contract",
"if",
"(",
"this",
".",
"_containers",
".",
"length",
")",
"{",
"this",
".",
"setAttributeConfig",
"(",
"'rendered'",
",",
"{",
"value",
":",
"true",
"}",
")",
";",
"this",
".",
"fireEvent",
"(",
"'render'",
",",
"state",
")",
";",
"// For backward compatibility",
"this",
".",
"fireEvent",
"(",
"'rendered'",
",",
"state",
")",
";",
"}",
"return",
"this",
";",
"}"
]
| Render the pagination controls per the format attribute into the
specified container nodes.
@method render
@return the Paginator instance
@chainable | [
"Render",
"the",
"pagination",
"controls",
"per",
"the",
"format",
"attribute",
"into",
"the",
"specified",
"container",
"nodes",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L562-L591 |
|
43,039 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (container, template, id_base, hide) {
var containerClass = this.get('containerClass'),
markers, i, len;
if (!container) {
return;
}
// Hide the container while its contents are rendered
Dom.setStyle(container,'display','none');
Dom.addClass(container, containerClass);
// Place the template innerHTML, adding marker spans to the template
// html to indicate drop zones for ui components
container.innerHTML = template.replace(/\{([a-z0-9_ \-]+)\}/gi,
'<span class="yui-pg-ui yui-pg-ui-$1"></span>');
// Replace each marker with the ui component's render() output
markers = Dom.getElementsByClassName('yui-pg-ui','span',container);
for (i = 0, len = markers.length; i < len; ++i) {
this.renderUIComponent(markers[i], id_base);
}
if (!hide) {
// Show the container allowing page reflow
Dom.setStyle(container,'display','');
}
} | javascript | function (container, template, id_base, hide) {
var containerClass = this.get('containerClass'),
markers, i, len;
if (!container) {
return;
}
// Hide the container while its contents are rendered
Dom.setStyle(container,'display','none');
Dom.addClass(container, containerClass);
// Place the template innerHTML, adding marker spans to the template
// html to indicate drop zones for ui components
container.innerHTML = template.replace(/\{([a-z0-9_ \-]+)\}/gi,
'<span class="yui-pg-ui yui-pg-ui-$1"></span>');
// Replace each marker with the ui component's render() output
markers = Dom.getElementsByClassName('yui-pg-ui','span',container);
for (i = 0, len = markers.length; i < len; ++i) {
this.renderUIComponent(markers[i], id_base);
}
if (!hide) {
// Show the container allowing page reflow
Dom.setStyle(container,'display','');
}
} | [
"function",
"(",
"container",
",",
"template",
",",
"id_base",
",",
"hide",
")",
"{",
"var",
"containerClass",
"=",
"this",
".",
"get",
"(",
"'containerClass'",
")",
",",
"markers",
",",
"i",
",",
"len",
";",
"if",
"(",
"!",
"container",
")",
"{",
"return",
";",
"}",
"// Hide the container while its contents are rendered",
"Dom",
".",
"setStyle",
"(",
"container",
",",
"'display'",
",",
"'none'",
")",
";",
"Dom",
".",
"addClass",
"(",
"container",
",",
"containerClass",
")",
";",
"// Place the template innerHTML, adding marker spans to the template",
"// html to indicate drop zones for ui components",
"container",
".",
"innerHTML",
"=",
"template",
".",
"replace",
"(",
"/",
"\\{([a-z0-9_ \\-]+)\\}",
"/",
"gi",
",",
"'<span class=\"yui-pg-ui yui-pg-ui-$1\"></span>'",
")",
";",
"// Replace each marker with the ui component's render() output",
"markers",
"=",
"Dom",
".",
"getElementsByClassName",
"(",
"'yui-pg-ui'",
",",
"'span'",
",",
"container",
")",
";",
"for",
"(",
"i",
"=",
"0",
",",
"len",
"=",
"markers",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"this",
".",
"renderUIComponent",
"(",
"markers",
"[",
"i",
"]",
",",
"id_base",
")",
";",
"}",
"if",
"(",
"!",
"hide",
")",
"{",
"// Show the container allowing page reflow",
"Dom",
".",
"setStyle",
"(",
"container",
",",
"'display'",
",",
"''",
")",
";",
"}",
"}"
]
| Creates the individual ui components and renders them into a container.
@method _renderTemplate
@param container {HTMLElement} where to add the ui components
@param template {String} the template to use as a guide for rendering
@param id_base {String} id base for the container's ui components
@param hide {Boolean} leave the container hidden after assembly
@protected | [
"Creates",
"the",
"individual",
"ui",
"components",
"and",
"renders",
"them",
"into",
"a",
"container",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L603-L632 |
|
43,040 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (e) {
var alwaysVisible = this.get('alwaysVisible'),
totalRecords,visible,rpp,rppOptions,i,len;
if (!e || e.type === 'alwaysVisibleChange' || !alwaysVisible) {
totalRecords = this.get('totalRecords');
visible = true;
rpp = this.get('rowsPerPage');
rppOptions = this.get('rowsPerPageOptions');
if (isArray(rppOptions)) {
for (i = 0, len = rppOptions.length; i < len; ++i) {
rpp = Math.min(rpp,rppOptions[i]);
}
}
if (totalRecords !== Paginator.VALUE_UNLIMITED &&
totalRecords <= rpp) {
visible = false;
}
visible = visible || alwaysVisible;
for (i = 0, len = this._containers.length; i < len; ++i) {
Dom.setStyle(this._containers[i],'display',
visible ? '' : 'none');
}
}
} | javascript | function (e) {
var alwaysVisible = this.get('alwaysVisible'),
totalRecords,visible,rpp,rppOptions,i,len;
if (!e || e.type === 'alwaysVisibleChange' || !alwaysVisible) {
totalRecords = this.get('totalRecords');
visible = true;
rpp = this.get('rowsPerPage');
rppOptions = this.get('rowsPerPageOptions');
if (isArray(rppOptions)) {
for (i = 0, len = rppOptions.length; i < len; ++i) {
rpp = Math.min(rpp,rppOptions[i]);
}
}
if (totalRecords !== Paginator.VALUE_UNLIMITED &&
totalRecords <= rpp) {
visible = false;
}
visible = visible || alwaysVisible;
for (i = 0, len = this._containers.length; i < len; ++i) {
Dom.setStyle(this._containers[i],'display',
visible ? '' : 'none');
}
}
} | [
"function",
"(",
"e",
")",
"{",
"var",
"alwaysVisible",
"=",
"this",
".",
"get",
"(",
"'alwaysVisible'",
")",
",",
"totalRecords",
",",
"visible",
",",
"rpp",
",",
"rppOptions",
",",
"i",
",",
"len",
";",
"if",
"(",
"!",
"e",
"||",
"e",
".",
"type",
"===",
"'alwaysVisibleChange'",
"||",
"!",
"alwaysVisible",
")",
"{",
"totalRecords",
"=",
"this",
".",
"get",
"(",
"'totalRecords'",
")",
";",
"visible",
"=",
"true",
";",
"rpp",
"=",
"this",
".",
"get",
"(",
"'rowsPerPage'",
")",
";",
"rppOptions",
"=",
"this",
".",
"get",
"(",
"'rowsPerPageOptions'",
")",
";",
"if",
"(",
"isArray",
"(",
"rppOptions",
")",
")",
"{",
"for",
"(",
"i",
"=",
"0",
",",
"len",
"=",
"rppOptions",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"rpp",
"=",
"Math",
".",
"min",
"(",
"rpp",
",",
"rppOptions",
"[",
"i",
"]",
")",
";",
"}",
"}",
"if",
"(",
"totalRecords",
"!==",
"Paginator",
".",
"VALUE_UNLIMITED",
"&&",
"totalRecords",
"<=",
"rpp",
")",
"{",
"visible",
"=",
"false",
";",
"}",
"visible",
"=",
"visible",
"||",
"alwaysVisible",
";",
"for",
"(",
"i",
"=",
"0",
",",
"len",
"=",
"this",
".",
"_containers",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"Dom",
".",
"setStyle",
"(",
"this",
".",
"_containers",
"[",
"i",
"]",
",",
"'display'",
",",
"visible",
"?",
"''",
":",
"'none'",
")",
";",
"}",
"}",
"}"
]
| Hides the containers if there is only one page of data and attribute
alwaysVisible is false. Conversely, it displays the containers if either
there is more than one page worth of data or alwaysVisible is turned on.
@method updateVisibility | [
"Hides",
"the",
"containers",
"if",
"there",
"is",
"only",
"one",
"page",
"of",
"data",
"and",
"attribute",
"alwaysVisible",
"is",
"false",
".",
"Conversely",
"it",
"displays",
"the",
"containers",
"if",
"either",
"there",
"is",
"more",
"than",
"one",
"page",
"worth",
"of",
"data",
"or",
"alwaysVisible",
"is",
"turned",
"on",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L675-L703 |
|
43,041 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function () {
var records = this.get('totalRecords'),
perPage = this.get('rowsPerPage');
// rowsPerPage not set. Can't calculate
if (!perPage) {
return null;
}
if (records === Paginator.VALUE_UNLIMITED) {
return Paginator.VALUE_UNLIMITED;
}
return Math.ceil(records/perPage);
} | javascript | function () {
var records = this.get('totalRecords'),
perPage = this.get('rowsPerPage');
// rowsPerPage not set. Can't calculate
if (!perPage) {
return null;
}
if (records === Paginator.VALUE_UNLIMITED) {
return Paginator.VALUE_UNLIMITED;
}
return Math.ceil(records/perPage);
} | [
"function",
"(",
")",
"{",
"var",
"records",
"=",
"this",
".",
"get",
"(",
"'totalRecords'",
")",
",",
"perPage",
"=",
"this",
".",
"get",
"(",
"'rowsPerPage'",
")",
";",
"// rowsPerPage not set. Can't calculate",
"if",
"(",
"!",
"perPage",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"records",
"===",
"Paginator",
".",
"VALUE_UNLIMITED",
")",
"{",
"return",
"Paginator",
".",
"VALUE_UNLIMITED",
";",
"}",
"return",
"Math",
".",
"ceil",
"(",
"records",
"/",
"perPage",
")",
";",
"}"
]
| Get the total number of pages in the data set according to the current
rowsPerPage and totalRecords values. If totalRecords is not set, or
set to YAHOO.widget.Paginator.VALUE_UNLIMITED, returns
YAHOO.widget.Paginator.VALUE_UNLIMITED.
@method getTotalPages
@return {number} | [
"Get",
"the",
"total",
"number",
"of",
"pages",
"in",
"the",
"data",
"set",
"according",
"to",
"the",
"current",
"rowsPerPage",
"and",
"totalRecords",
"values",
".",
"If",
"totalRecords",
"is",
"not",
"set",
"or",
"set",
"to",
"YAHOO",
".",
"widget",
".",
"Paginator",
".",
"VALUE_UNLIMITED",
"returns",
"YAHOO",
".",
"widget",
".",
"Paginator",
".",
"VALUE_UNLIMITED",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L725-L739 |
|
43,042 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (page) {
if (!lang.isNumber(page) || page < 1) {
return false;
}
var totalPages = this.getTotalPages();
return (totalPages === Paginator.VALUE_UNLIMITED || totalPages >= page);
} | javascript | function (page) {
if (!lang.isNumber(page) || page < 1) {
return false;
}
var totalPages = this.getTotalPages();
return (totalPages === Paginator.VALUE_UNLIMITED || totalPages >= page);
} | [
"function",
"(",
"page",
")",
"{",
"if",
"(",
"!",
"lang",
".",
"isNumber",
"(",
"page",
")",
"||",
"page",
"<",
"1",
")",
"{",
"return",
"false",
";",
"}",
"var",
"totalPages",
"=",
"this",
".",
"getTotalPages",
"(",
")",
";",
"return",
"(",
"totalPages",
"===",
"Paginator",
".",
"VALUE_UNLIMITED",
"||",
"totalPages",
">=",
"page",
")",
";",
"}"
]
| Does the requested page have any records?
@method hasPage
@param page {number} the page in question
@return {boolean} | [
"Does",
"the",
"requested",
"page",
"have",
"any",
"records?"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L747-L755 |
|
43,043 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function () {
var currentPage = this.getCurrentPage(),
totalPages = this.getTotalPages();
return currentPage && (totalPages === Paginator.VALUE_UNLIMITED || currentPage < totalPages);
} | javascript | function () {
var currentPage = this.getCurrentPage(),
totalPages = this.getTotalPages();
return currentPage && (totalPages === Paginator.VALUE_UNLIMITED || currentPage < totalPages);
} | [
"function",
"(",
")",
"{",
"var",
"currentPage",
"=",
"this",
".",
"getCurrentPage",
"(",
")",
",",
"totalPages",
"=",
"this",
".",
"getTotalPages",
"(",
")",
";",
"return",
"currentPage",
"&&",
"(",
"totalPages",
"===",
"Paginator",
".",
"VALUE_UNLIMITED",
"||",
"currentPage",
"<",
"totalPages",
")",
";",
"}"
]
| Are there records on the next page?
@method hasNextPage
@return {boolean} | [
"Are",
"there",
"records",
"on",
"the",
"next",
"page?"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L775-L780 |
|
43,044 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (page) {
if (!lang.isNumber(page)) {
page = this.getCurrentPage();
}
var perPage = this.get('rowsPerPage'),
records = this.get('totalRecords'),
start, end;
if (!page || !perPage) {
return null;
}
start = (page - 1) * perPage;
if (records !== Paginator.VALUE_UNLIMITED) {
if (start >= records) {
return null;
}
end = Math.min(start + perPage, records) - 1;
} else {
end = start + perPage - 1;
}
return [start,end];
} | javascript | function (page) {
if (!lang.isNumber(page)) {
page = this.getCurrentPage();
}
var perPage = this.get('rowsPerPage'),
records = this.get('totalRecords'),
start, end;
if (!page || !perPage) {
return null;
}
start = (page - 1) * perPage;
if (records !== Paginator.VALUE_UNLIMITED) {
if (start >= records) {
return null;
}
end = Math.min(start + perPage, records) - 1;
} else {
end = start + perPage - 1;
}
return [start,end];
} | [
"function",
"(",
"page",
")",
"{",
"if",
"(",
"!",
"lang",
".",
"isNumber",
"(",
"page",
")",
")",
"{",
"page",
"=",
"this",
".",
"getCurrentPage",
"(",
")",
";",
"}",
"var",
"perPage",
"=",
"this",
".",
"get",
"(",
"'rowsPerPage'",
")",
",",
"records",
"=",
"this",
".",
"get",
"(",
"'totalRecords'",
")",
",",
"start",
",",
"end",
";",
"if",
"(",
"!",
"page",
"||",
"!",
"perPage",
")",
"{",
"return",
"null",
";",
"}",
"start",
"=",
"(",
"page",
"-",
"1",
")",
"*",
"perPage",
";",
"if",
"(",
"records",
"!==",
"Paginator",
".",
"VALUE_UNLIMITED",
")",
"{",
"if",
"(",
"start",
">=",
"records",
")",
"{",
"return",
"null",
";",
"}",
"end",
"=",
"Math",
".",
"min",
"(",
"start",
"+",
"perPage",
",",
"records",
")",
"-",
"1",
";",
"}",
"else",
"{",
"end",
"=",
"start",
"+",
"perPage",
"-",
"1",
";",
"}",
"return",
"[",
"start",
",",
"end",
"]",
";",
"}"
]
| Get the start and end record indexes of the specified page.
@method getPageRecords
@param page {number} (optional) The page (current page if not specified)
@return {Array} [start_index, end_index] | [
"Get",
"the",
"start",
"and",
"end",
"record",
"indexes",
"of",
"the",
"specified",
"page",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L817-L841 |
|
43,045 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (page,silent) {
if (this.hasPage(page) && page !== this.getCurrentPage()) {
if (this.get('updateOnChange') || silent) {
this.set('recordOffset', (page - 1) * this.get('rowsPerPage'));
} else {
this.fireEvent('changeRequest',this.getState({'page':page}));
}
}
} | javascript | function (page,silent) {
if (this.hasPage(page) && page !== this.getCurrentPage()) {
if (this.get('updateOnChange') || silent) {
this.set('recordOffset', (page - 1) * this.get('rowsPerPage'));
} else {
this.fireEvent('changeRequest',this.getState({'page':page}));
}
}
} | [
"function",
"(",
"page",
",",
"silent",
")",
"{",
"if",
"(",
"this",
".",
"hasPage",
"(",
"page",
")",
"&&",
"page",
"!==",
"this",
".",
"getCurrentPage",
"(",
")",
")",
"{",
"if",
"(",
"this",
".",
"get",
"(",
"'updateOnChange'",
")",
"||",
"silent",
")",
"{",
"this",
".",
"set",
"(",
"'recordOffset'",
",",
"(",
"page",
"-",
"1",
")",
"*",
"this",
".",
"get",
"(",
"'rowsPerPage'",
")",
")",
";",
"}",
"else",
"{",
"this",
".",
"fireEvent",
"(",
"'changeRequest'",
",",
"this",
".",
"getState",
"(",
"{",
"'page'",
":",
"page",
"}",
")",
")",
";",
"}",
"}",
"}"
]
| Set the current page to the provided page number if possible.
@method setPage
@param newPage {number} the new page number
@param silent {boolean} whether to forcibly avoid firing the
changeRequest event | [
"Set",
"the",
"current",
"page",
"to",
"the",
"provided",
"page",
"number",
"if",
"possible",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L850-L858 |
|
43,046 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (rpp,silent) {
if (Paginator.isNumeric(rpp) && +rpp > 0 &&
+rpp !== this.get('rowsPerPage')) {
if (this.get('updateOnChange') || silent) {
this.set('rowsPerPage',rpp);
} else {
this.fireEvent('changeRequest',
this.getState({'rowsPerPage':+rpp}));
}
}
} | javascript | function (rpp,silent) {
if (Paginator.isNumeric(rpp) && +rpp > 0 &&
+rpp !== this.get('rowsPerPage')) {
if (this.get('updateOnChange') || silent) {
this.set('rowsPerPage',rpp);
} else {
this.fireEvent('changeRequest',
this.getState({'rowsPerPage':+rpp}));
}
}
} | [
"function",
"(",
"rpp",
",",
"silent",
")",
"{",
"if",
"(",
"Paginator",
".",
"isNumeric",
"(",
"rpp",
")",
"&&",
"+",
"rpp",
">",
"0",
"&&",
"+",
"rpp",
"!==",
"this",
".",
"get",
"(",
"'rowsPerPage'",
")",
")",
"{",
"if",
"(",
"this",
".",
"get",
"(",
"'updateOnChange'",
")",
"||",
"silent",
")",
"{",
"this",
".",
"set",
"(",
"'rowsPerPage'",
",",
"rpp",
")",
";",
"}",
"else",
"{",
"this",
".",
"fireEvent",
"(",
"'changeRequest'",
",",
"this",
".",
"getState",
"(",
"{",
"'rowsPerPage'",
":",
"+",
"rpp",
"}",
")",
")",
";",
"}",
"}",
"}"
]
| Set the number of rows per page.
@method setRowsPerPage
@param rpp {number} the new number of rows per page
@param silent {boolean} whether to forcibly avoid firing the
changeRequest event | [
"Set",
"the",
"number",
"of",
"rows",
"per",
"page",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L876-L886 |
|
43,047 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (total,silent) {
if (Paginator.isNumeric(total) && +total >= 0 &&
+total !== this.get('totalRecords')) {
if (this.get('updateOnChange') || silent) {
this.set('totalRecords',total);
} else {
this.fireEvent('changeRequest',
this.getState({'totalRecords':+total}));
}
}
} | javascript | function (total,silent) {
if (Paginator.isNumeric(total) && +total >= 0 &&
+total !== this.get('totalRecords')) {
if (this.get('updateOnChange') || silent) {
this.set('totalRecords',total);
} else {
this.fireEvent('changeRequest',
this.getState({'totalRecords':+total}));
}
}
} | [
"function",
"(",
"total",
",",
"silent",
")",
"{",
"if",
"(",
"Paginator",
".",
"isNumeric",
"(",
"total",
")",
"&&",
"+",
"total",
">=",
"0",
"&&",
"+",
"total",
"!==",
"this",
".",
"get",
"(",
"'totalRecords'",
")",
")",
"{",
"if",
"(",
"this",
".",
"get",
"(",
"'updateOnChange'",
")",
"||",
"silent",
")",
"{",
"this",
".",
"set",
"(",
"'totalRecords'",
",",
"total",
")",
";",
"}",
"else",
"{",
"this",
".",
"fireEvent",
"(",
"'changeRequest'",
",",
"this",
".",
"getState",
"(",
"{",
"'totalRecords'",
":",
"+",
"total",
"}",
")",
")",
";",
"}",
"}",
"}"
]
| Set the total number of records.
@method setTotalRecords
@param total {number} the new total number of records
@param silent {boolean} whether to forcibly avoid firing the changeRequest event | [
"Set",
"the",
"total",
"number",
"of",
"records",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L903-L913 |
|
43,048 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (offset,silent) {
if (Paginator.isNumeric(offset) && +offset >= 0 &&
+offset !== this.get('recordOffset')) {
if (this.get('updateOnChange') || silent) {
this.set('recordOffset',offset);
} else {
this.fireEvent('changeRequest',
this.getState({'recordOffset':+offset}));
}
}
} | javascript | function (offset,silent) {
if (Paginator.isNumeric(offset) && +offset >= 0 &&
+offset !== this.get('recordOffset')) {
if (this.get('updateOnChange') || silent) {
this.set('recordOffset',offset);
} else {
this.fireEvent('changeRequest',
this.getState({'recordOffset':+offset}));
}
}
} | [
"function",
"(",
"offset",
",",
"silent",
")",
"{",
"if",
"(",
"Paginator",
".",
"isNumeric",
"(",
"offset",
")",
"&&",
"+",
"offset",
">=",
"0",
"&&",
"+",
"offset",
"!==",
"this",
".",
"get",
"(",
"'recordOffset'",
")",
")",
"{",
"if",
"(",
"this",
".",
"get",
"(",
"'updateOnChange'",
")",
"||",
"silent",
")",
"{",
"this",
".",
"set",
"(",
"'recordOffset'",
",",
"offset",
")",
";",
"}",
"else",
"{",
"this",
".",
"fireEvent",
"(",
"'changeRequest'",
",",
"this",
".",
"getState",
"(",
"{",
"'recordOffset'",
":",
"+",
"offset",
"}",
")",
")",
";",
"}",
"}",
"}"
]
| Move the record offset to a new starting index. This will likely cause
the calculated current page to change. You should probably use setPage.
@method setStartIndex
@param offset {number} the new record offset
@param silent {boolean} whether to forcibly avoid firing the changeRequest event | [
"Move",
"the",
"record",
"offset",
"to",
"a",
"new",
"starting",
"index",
".",
"This",
"will",
"likely",
"cause",
"the",
"calculated",
"current",
"page",
"to",
"change",
".",
"You",
"should",
"probably",
"use",
"setPage",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L931-L941 |
|
43,049 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (state) {
if (isObject(state)) {
// get flux state based on current state with before state as well
this._state = this.getState({});
// use just the state props from the input obj
state = {
page : state.page,
rowsPerPage : state.rowsPerPage,
totalRecords : state.totalRecords,
recordOffset : state.recordOffset
};
// calculate recordOffset from page if recordOffset not specified.
// not using lang.isNumber for support of numeric strings
if (state.page && state.recordOffset === undefined) {
state.recordOffset = (state.page - 1) *
(state.rowsPerPage || this.get('rowsPerPage'));
}
this._batch = true;
this._pageChanged = false;
for (var k in state) {
if (state.hasOwnProperty(k) && this._configs.hasOwnProperty(k)) {
this.set(k,state[k]);
}
}
this._batch = false;
if (this._pageChanged) {
this._pageChanged = false;
this._firePageChange(this.getState(this._state));
}
}
} | javascript | function (state) {
if (isObject(state)) {
// get flux state based on current state with before state as well
this._state = this.getState({});
// use just the state props from the input obj
state = {
page : state.page,
rowsPerPage : state.rowsPerPage,
totalRecords : state.totalRecords,
recordOffset : state.recordOffset
};
// calculate recordOffset from page if recordOffset not specified.
// not using lang.isNumber for support of numeric strings
if (state.page && state.recordOffset === undefined) {
state.recordOffset = (state.page - 1) *
(state.rowsPerPage || this.get('rowsPerPage'));
}
this._batch = true;
this._pageChanged = false;
for (var k in state) {
if (state.hasOwnProperty(k) && this._configs.hasOwnProperty(k)) {
this.set(k,state[k]);
}
}
this._batch = false;
if (this._pageChanged) {
this._pageChanged = false;
this._firePageChange(this.getState(this._state));
}
}
} | [
"function",
"(",
"state",
")",
"{",
"if",
"(",
"isObject",
"(",
"state",
")",
")",
"{",
"// get flux state based on current state with before state as well",
"this",
".",
"_state",
"=",
"this",
".",
"getState",
"(",
"{",
"}",
")",
";",
"// use just the state props from the input obj",
"state",
"=",
"{",
"page",
":",
"state",
".",
"page",
",",
"rowsPerPage",
":",
"state",
".",
"rowsPerPage",
",",
"totalRecords",
":",
"state",
".",
"totalRecords",
",",
"recordOffset",
":",
"state",
".",
"recordOffset",
"}",
";",
"// calculate recordOffset from page if recordOffset not specified.",
"// not using lang.isNumber for support of numeric strings",
"if",
"(",
"state",
".",
"page",
"&&",
"state",
".",
"recordOffset",
"===",
"undefined",
")",
"{",
"state",
".",
"recordOffset",
"=",
"(",
"state",
".",
"page",
"-",
"1",
")",
"*",
"(",
"state",
".",
"rowsPerPage",
"||",
"this",
".",
"get",
"(",
"'rowsPerPage'",
")",
")",
";",
"}",
"this",
".",
"_batch",
"=",
"true",
";",
"this",
".",
"_pageChanged",
"=",
"false",
";",
"for",
"(",
"var",
"k",
"in",
"state",
")",
"{",
"if",
"(",
"state",
".",
"hasOwnProperty",
"(",
"k",
")",
"&&",
"this",
".",
"_configs",
".",
"hasOwnProperty",
"(",
"k",
")",
")",
"{",
"this",
".",
"set",
"(",
"k",
",",
"state",
"[",
"k",
"]",
")",
";",
"}",
"}",
"this",
".",
"_batch",
"=",
"false",
";",
"if",
"(",
"this",
".",
"_pageChanged",
")",
"{",
"this",
".",
"_pageChanged",
"=",
"false",
";",
"this",
".",
"_firePageChange",
"(",
"this",
".",
"getState",
"(",
"this",
".",
"_state",
")",
")",
";",
"}",
"}",
"}"
]
| Convenience method to facilitate setting state attributes rowsPerPage,
totalRecords, recordOffset in batch. Also supports calculating
recordOffset from state.page if state.recordOffset is not provided.
Fires only a single pageChange event, if appropriate.
This will not fire a changeRequest event.
@method setState
@param state {Object} Object literal of attribute:value pairs to set | [
"Convenience",
"method",
"to",
"facilitate",
"setting",
"state",
"attributes",
"rowsPerPage",
"totalRecords",
"recordOffset",
"in",
"batch",
".",
"Also",
"supports",
"calculating",
"recordOffset",
"from",
"state",
".",
"page",
"if",
"state",
".",
"recordOffset",
"is",
"not",
"provided",
".",
"Fires",
"only",
"a",
"single",
"pageChange",
"event",
"if",
"appropriate",
".",
"This",
"will",
"not",
"fire",
"a",
"changeRequest",
"event",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L1048-L1085 |
|
43,050 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (id_base) {
this.span = document.createElement('span');
this.span.id = id_base + '-page-report';
this.span.className = this.paginator.get('pageReportClass');
this.update();
return this.span;
} | javascript | function (id_base) {
this.span = document.createElement('span');
this.span.id = id_base + '-page-report';
this.span.className = this.paginator.get('pageReportClass');
this.update();
return this.span;
} | [
"function",
"(",
"id_base",
")",
"{",
"this",
".",
"span",
"=",
"document",
".",
"createElement",
"(",
"'span'",
")",
";",
"this",
".",
"span",
".",
"id",
"=",
"id_base",
"+",
"'-page-report'",
";",
"this",
".",
"span",
".",
"className",
"=",
"this",
".",
"paginator",
".",
"get",
"(",
"'pageReportClass'",
")",
";",
"this",
".",
"update",
"(",
")",
";",
"return",
"this",
".",
"span",
";",
"}"
]
| Generate the span containing info formatted per the pageReportTemplate
attribute.
@method render
@param id_base {string} used to create unique ids for generated nodes
@return {HTMLElement} | [
"Generate",
"the",
"span",
"containing",
"info",
"formatted",
"per",
"the",
"pageReportTemplate",
"attribute",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L1220-L1227 |
|
43,051 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
this.span.innerHTML = Paginator.ui.CurrentPageReport.sprintf(
this.paginator.get('pageReportTemplate'),
this.paginator.get('pageReportValueGenerator')(this.paginator));
} | javascript | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
this.span.innerHTML = Paginator.ui.CurrentPageReport.sprintf(
this.paginator.get('pageReportTemplate'),
this.paginator.get('pageReportValueGenerator')(this.paginator));
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"e",
"&&",
"e",
".",
"prevValue",
"===",
"e",
".",
"newValue",
")",
"{",
"return",
";",
"}",
"this",
".",
"span",
".",
"innerHTML",
"=",
"Paginator",
".",
"ui",
".",
"CurrentPageReport",
".",
"sprintf",
"(",
"this",
".",
"paginator",
".",
"get",
"(",
"'pageReportTemplate'",
")",
",",
"this",
".",
"paginator",
".",
"get",
"(",
"'pageReportValueGenerator'",
")",
"(",
"this",
".",
"paginator",
")",
")",
";",
"}"
]
| Regenerate the content of the span if appropriate. Calls
CurrentPageReport.sprintf with the value of the pageReportTemplate
attribute and the value map returned from pageReportValueGenerator
function.
@method update
@param e {CustomEvent} The calling change event | [
"Regenerate",
"the",
"content",
"of",
"the",
"span",
"if",
"appropriate",
".",
"Calls",
"CurrentPageReport",
".",
"sprintf",
"with",
"the",
"value",
"of",
"the",
"pageReportTemplate",
"attribute",
"and",
"the",
"value",
"map",
"returned",
"from",
"pageReportValueGenerator",
"function",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L1237-L1245 |
|
43,052 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (id_base) {
var p = this.paginator;
// Set up container
this.container = document.createElement('span');
this.container.id = id_base + '-pages';
this.container.className = p.get('pageLinksContainerClass');
YAHOO.util.Event.on(this.container,'click',this.onClick,this,true);
// Call update, flagging a need to rebuild
this.update({newValue : null, rebuild : true});
return this.container;
} | javascript | function (id_base) {
var p = this.paginator;
// Set up container
this.container = document.createElement('span');
this.container.id = id_base + '-pages';
this.container.className = p.get('pageLinksContainerClass');
YAHOO.util.Event.on(this.container,'click',this.onClick,this,true);
// Call update, flagging a need to rebuild
this.update({newValue : null, rebuild : true});
return this.container;
} | [
"function",
"(",
"id_base",
")",
"{",
"var",
"p",
"=",
"this",
".",
"paginator",
";",
"// Set up container",
"this",
".",
"container",
"=",
"document",
".",
"createElement",
"(",
"'span'",
")",
";",
"this",
".",
"container",
".",
"id",
"=",
"id_base",
"+",
"'-pages'",
";",
"this",
".",
"container",
".",
"className",
"=",
"p",
".",
"get",
"(",
"'pageLinksContainerClass'",
")",
";",
"YAHOO",
".",
"util",
".",
"Event",
".",
"on",
"(",
"this",
".",
"container",
",",
"'click'",
",",
"this",
".",
"onClick",
",",
"this",
",",
"true",
")",
";",
"// Call update, flagging a need to rebuild",
"this",
".",
"update",
"(",
"{",
"newValue",
":",
"null",
",",
"rebuild",
":",
"true",
"}",
")",
";",
"return",
"this",
".",
"container",
";",
"}"
]
| Generate the nodes and return the container node containing page links
appropriate to the current pagination state.
@method render
@param id_base {string} used to create unique ids for generated nodes
@return {HTMLElement} | [
"Generate",
"the",
"nodes",
"and",
"return",
"the",
"container",
"node",
"containing",
"page",
"links",
"appropriate",
"to",
"the",
"current",
"pagination",
"state",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L1422-L1435 |
|
43,053 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
var p = this.paginator,
currentPage = p.getCurrentPage();
// Replace content if there's been a change
if (this.current !== currentPage || !currentPage || e.rebuild) {
var labelBuilder = p.get('pageLabelBuilder'),
range = Paginator.ui.PageLinks.calculateRange(
currentPage,
p.getTotalPages(),
p.get('pageLinks')),
start = range[0],
end = range[1],
content = '',
linkTemplate,i;
linkTemplate = '<a href="#" class="' + p.get('pageLinkClass') +
'" page="';
for (i = start; i <= end; ++i) {
if (i === currentPage) {
content +=
'<span class="' + p.get('currentPageClass') + ' ' +
p.get('pageLinkClass') + '">' +
labelBuilder(i,p) + '</span>';
} else {
content +=
linkTemplate + i + '">' + labelBuilder(i,p) + '</a>';
}
}
this.container.innerHTML = content;
}
} | javascript | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
var p = this.paginator,
currentPage = p.getCurrentPage();
// Replace content if there's been a change
if (this.current !== currentPage || !currentPage || e.rebuild) {
var labelBuilder = p.get('pageLabelBuilder'),
range = Paginator.ui.PageLinks.calculateRange(
currentPage,
p.getTotalPages(),
p.get('pageLinks')),
start = range[0],
end = range[1],
content = '',
linkTemplate,i;
linkTemplate = '<a href="#" class="' + p.get('pageLinkClass') +
'" page="';
for (i = start; i <= end; ++i) {
if (i === currentPage) {
content +=
'<span class="' + p.get('currentPageClass') + ' ' +
p.get('pageLinkClass') + '">' +
labelBuilder(i,p) + '</span>';
} else {
content +=
linkTemplate + i + '">' + labelBuilder(i,p) + '</a>';
}
}
this.container.innerHTML = content;
}
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"e",
"&&",
"e",
".",
"prevValue",
"===",
"e",
".",
"newValue",
")",
"{",
"return",
";",
"}",
"var",
"p",
"=",
"this",
".",
"paginator",
",",
"currentPage",
"=",
"p",
".",
"getCurrentPage",
"(",
")",
";",
"// Replace content if there's been a change",
"if",
"(",
"this",
".",
"current",
"!==",
"currentPage",
"||",
"!",
"currentPage",
"||",
"e",
".",
"rebuild",
")",
"{",
"var",
"labelBuilder",
"=",
"p",
".",
"get",
"(",
"'pageLabelBuilder'",
")",
",",
"range",
"=",
"Paginator",
".",
"ui",
".",
"PageLinks",
".",
"calculateRange",
"(",
"currentPage",
",",
"p",
".",
"getTotalPages",
"(",
")",
",",
"p",
".",
"get",
"(",
"'pageLinks'",
")",
")",
",",
"start",
"=",
"range",
"[",
"0",
"]",
",",
"end",
"=",
"range",
"[",
"1",
"]",
",",
"content",
"=",
"''",
",",
"linkTemplate",
",",
"i",
";",
"linkTemplate",
"=",
"'<a href=\"#\" class=\"'",
"+",
"p",
".",
"get",
"(",
"'pageLinkClass'",
")",
"+",
"'\" page=\"'",
";",
"for",
"(",
"i",
"=",
"start",
";",
"i",
"<=",
"end",
";",
"++",
"i",
")",
"{",
"if",
"(",
"i",
"===",
"currentPage",
")",
"{",
"content",
"+=",
"'<span class=\"'",
"+",
"p",
".",
"get",
"(",
"'currentPageClass'",
")",
"+",
"' '",
"+",
"p",
".",
"get",
"(",
"'pageLinkClass'",
")",
"+",
"'\">'",
"+",
"labelBuilder",
"(",
"i",
",",
"p",
")",
"+",
"'</span>'",
";",
"}",
"else",
"{",
"content",
"+=",
"linkTemplate",
"+",
"i",
"+",
"'\">'",
"+",
"labelBuilder",
"(",
"i",
",",
"p",
")",
"+",
"'</a>'",
";",
"}",
"}",
"this",
".",
"container",
".",
"innerHTML",
"=",
"content",
";",
"}",
"}"
]
| Update the links if appropriate
@method update
@param e {CustomEvent} The calling change event | [
"Update",
"the",
"links",
"if",
"appropriate"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L1442-L1478 |
|
43,054 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function () {
YAHOO.util.Event.purgeElement(this.container,true);
this.container.parentNode.removeChild(this.container);
this.container = null;
} | javascript | function () {
YAHOO.util.Event.purgeElement(this.container,true);
this.container.parentNode.removeChild(this.container);
this.container = null;
} | [
"function",
"(",
")",
"{",
"YAHOO",
".",
"util",
".",
"Event",
".",
"purgeElement",
"(",
"this",
".",
"container",
",",
"true",
")",
";",
"this",
".",
"container",
".",
"parentNode",
".",
"removeChild",
"(",
"this",
".",
"container",
")",
";",
"this",
".",
"container",
"=",
"null",
";",
"}"
]
| Removes the page links container node and clears event listeners
@method destroy
@private | [
"Removes",
"the",
"page",
"links",
"container",
"node",
"and",
"clears",
"event",
"listeners"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L1495-L1499 |
|
43,055 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (e) {
var t = YAHOO.util.Event.getTarget(e);
if (t && YAHOO.util.Dom.hasClass(t,
this.paginator.get('pageLinkClass'))) {
YAHOO.util.Event.stopEvent(e);
this.paginator.setPage(parseInt(t.getAttribute('page'),10));
}
} | javascript | function (e) {
var t = YAHOO.util.Event.getTarget(e);
if (t && YAHOO.util.Dom.hasClass(t,
this.paginator.get('pageLinkClass'))) {
YAHOO.util.Event.stopEvent(e);
this.paginator.setPage(parseInt(t.getAttribute('page'),10));
}
} | [
"function",
"(",
"e",
")",
"{",
"var",
"t",
"=",
"YAHOO",
".",
"util",
".",
"Event",
".",
"getTarget",
"(",
"e",
")",
";",
"if",
"(",
"t",
"&&",
"YAHOO",
".",
"util",
".",
"Dom",
".",
"hasClass",
"(",
"t",
",",
"this",
".",
"paginator",
".",
"get",
"(",
"'pageLinkClass'",
")",
")",
")",
"{",
"YAHOO",
".",
"util",
".",
"Event",
".",
"stopEvent",
"(",
"e",
")",
";",
"this",
".",
"paginator",
".",
"setPage",
"(",
"parseInt",
"(",
"t",
".",
"getAttribute",
"(",
"'page'",
")",
",",
"10",
")",
")",
";",
"}",
"}"
]
| Listener for the container's onclick event. Looks for qualifying link
clicks, and pulls the page number from the link's page attribute.
Sends link's page attribute to the Paginator's setPage method.
@method onClick
@param e {DOMEvent} The click event | [
"Listener",
"for",
"the",
"container",
"s",
"onclick",
"event",
".",
"Looks",
"for",
"qualifying",
"link",
"clicks",
"and",
"pulls",
"the",
"page",
"number",
"from",
"the",
"link",
"s",
"page",
"attribute",
".",
"Sends",
"link",
"s",
"page",
"attribute",
"to",
"the",
"Paginator",
"s",
"setPage",
"method",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L1508-L1517 |
|
43,056 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
var par = this.current ? this.current.parentNode : null,
after = this.link;
if (par) {
switch (this.paginator.getTotalPages()) {
case Paginator.VALUE_UNLIMITED :
after = this.na; break;
case this.paginator.getCurrentPage() :
after = this.span; break;
}
if (this.current !== after) {
par.replaceChild(after,this.current);
this.current = after;
}
}
} | javascript | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
var par = this.current ? this.current.parentNode : null,
after = this.link;
if (par) {
switch (this.paginator.getTotalPages()) {
case Paginator.VALUE_UNLIMITED :
after = this.na; break;
case this.paginator.getCurrentPage() :
after = this.span; break;
}
if (this.current !== after) {
par.replaceChild(after,this.current);
this.current = after;
}
}
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"e",
"&&",
"e",
".",
"prevValue",
"===",
"e",
".",
"newValue",
")",
"{",
"return",
";",
"}",
"var",
"par",
"=",
"this",
".",
"current",
"?",
"this",
".",
"current",
".",
"parentNode",
":",
"null",
",",
"after",
"=",
"this",
".",
"link",
";",
"if",
"(",
"par",
")",
"{",
"switch",
"(",
"this",
".",
"paginator",
".",
"getTotalPages",
"(",
")",
")",
"{",
"case",
"Paginator",
".",
"VALUE_UNLIMITED",
":",
"after",
"=",
"this",
".",
"na",
";",
"break",
";",
"case",
"this",
".",
"paginator",
".",
"getCurrentPage",
"(",
")",
":",
"after",
"=",
"this",
".",
"span",
";",
"break",
";",
"}",
"if",
"(",
"this",
".",
"current",
"!==",
"after",
")",
"{",
"par",
".",
"replaceChild",
"(",
"after",
",",
"this",
".",
"current",
")",
";",
"this",
".",
"current",
"=",
"after",
";",
"}",
"}",
"}"
]
| Swap the link, span, and na nodes if appropriate.
@method update
@param e {CustomEvent} The calling change event (ignored) | [
"Swap",
"the",
"link",
"span",
"and",
"na",
"nodes",
"if",
"appropriate",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L1824-L1845 |
|
43,057 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (id_base) {
var p = this.paginator,
c = p.get('nextPageLinkClass'),
label = p.get('nextPageLinkLabel'),
last = p.getTotalPages();
this.link = document.createElement('a');
this.span = document.createElement('span');
this.link.id = id_base + '-next-link';
this.link.href = '#';
this.link.className = c;
this.link.innerHTML = label;
YAHOO.util.Event.on(this.link,'click',this.onClick,this,true);
this.span.id = id_base + '-next-span';
this.span.className = c;
this.span.innerHTML = label;
this.current = p.getCurrentPage() === last ? this.span : this.link;
return this.current;
} | javascript | function (id_base) {
var p = this.paginator,
c = p.get('nextPageLinkClass'),
label = p.get('nextPageLinkLabel'),
last = p.getTotalPages();
this.link = document.createElement('a');
this.span = document.createElement('span');
this.link.id = id_base + '-next-link';
this.link.href = '#';
this.link.className = c;
this.link.innerHTML = label;
YAHOO.util.Event.on(this.link,'click',this.onClick,this,true);
this.span.id = id_base + '-next-span';
this.span.className = c;
this.span.innerHTML = label;
this.current = p.getCurrentPage() === last ? this.span : this.link;
return this.current;
} | [
"function",
"(",
"id_base",
")",
"{",
"var",
"p",
"=",
"this",
".",
"paginator",
",",
"c",
"=",
"p",
".",
"get",
"(",
"'nextPageLinkClass'",
")",
",",
"label",
"=",
"p",
".",
"get",
"(",
"'nextPageLinkLabel'",
")",
",",
"last",
"=",
"p",
".",
"getTotalPages",
"(",
")",
";",
"this",
".",
"link",
"=",
"document",
".",
"createElement",
"(",
"'a'",
")",
";",
"this",
".",
"span",
"=",
"document",
".",
"createElement",
"(",
"'span'",
")",
";",
"this",
".",
"link",
".",
"id",
"=",
"id_base",
"+",
"'-next-link'",
";",
"this",
".",
"link",
".",
"href",
"=",
"'#'",
";",
"this",
".",
"link",
".",
"className",
"=",
"c",
";",
"this",
".",
"link",
".",
"innerHTML",
"=",
"label",
";",
"YAHOO",
".",
"util",
".",
"Event",
".",
"on",
"(",
"this",
".",
"link",
",",
"'click'",
",",
"this",
".",
"onClick",
",",
"this",
",",
"true",
")",
";",
"this",
".",
"span",
".",
"id",
"=",
"id_base",
"+",
"'-next-span'",
";",
"this",
".",
"span",
".",
"className",
"=",
"c",
";",
"this",
".",
"span",
".",
"innerHTML",
"=",
"label",
";",
"this",
".",
"current",
"=",
"p",
".",
"getCurrentPage",
"(",
")",
"===",
"last",
"?",
"this",
".",
"span",
":",
"this",
".",
"link",
";",
"return",
"this",
".",
"current",
";",
"}"
]
| Generate the nodes and return the appropriate node given the current
pagination state.
@method render
@param id_base {string} used to create unique ids for generated nodes
@return {HTMLElement} | [
"Generate",
"the",
"nodes",
"and",
"return",
"the",
"appropriate",
"node",
"given",
"the",
"current",
"pagination",
"state",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L1962-L1984 |
|
43,058 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
var last = this.paginator.getTotalPages(),
par = this.current ? this.current.parentNode : null;
if (this.paginator.getCurrentPage() !== last) {
if (par && this.current === this.span) {
par.replaceChild(this.link,this.current);
this.current = this.link;
}
} else if (this.current === this.link) {
if (par) {
par.replaceChild(this.span,this.current);
this.current = this.span;
}
}
} | javascript | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
var last = this.paginator.getTotalPages(),
par = this.current ? this.current.parentNode : null;
if (this.paginator.getCurrentPage() !== last) {
if (par && this.current === this.span) {
par.replaceChild(this.link,this.current);
this.current = this.link;
}
} else if (this.current === this.link) {
if (par) {
par.replaceChild(this.span,this.current);
this.current = this.span;
}
}
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"e",
"&&",
"e",
".",
"prevValue",
"===",
"e",
".",
"newValue",
")",
"{",
"return",
";",
"}",
"var",
"last",
"=",
"this",
".",
"paginator",
".",
"getTotalPages",
"(",
")",
",",
"par",
"=",
"this",
".",
"current",
"?",
"this",
".",
"current",
".",
"parentNode",
":",
"null",
";",
"if",
"(",
"this",
".",
"paginator",
".",
"getCurrentPage",
"(",
")",
"!==",
"last",
")",
"{",
"if",
"(",
"par",
"&&",
"this",
".",
"current",
"===",
"this",
".",
"span",
")",
"{",
"par",
".",
"replaceChild",
"(",
"this",
".",
"link",
",",
"this",
".",
"current",
")",
";",
"this",
".",
"current",
"=",
"this",
".",
"link",
";",
"}",
"}",
"else",
"if",
"(",
"this",
".",
"current",
"===",
"this",
".",
"link",
")",
"{",
"if",
"(",
"par",
")",
"{",
"par",
".",
"replaceChild",
"(",
"this",
".",
"span",
",",
"this",
".",
"current",
")",
";",
"this",
".",
"current",
"=",
"this",
".",
"span",
";",
"}",
"}",
"}"
]
| Swap the link and span nodes if appropriate.
@method update
@param e {CustomEvent} The calling change event | [
"Swap",
"the",
"link",
"and",
"span",
"nodes",
"if",
"appropriate",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L1991-L2010 |
|
43,059 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
var rpp = this.paginator.get('rowsPerPage')+'',
options = this.select.options,
i,len;
for (i = 0, len = options.length; i < len; ++i) {
if (options[i].value === rpp) {
options[i].selected = true;
break;
}
}
} | javascript | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
var rpp = this.paginator.get('rowsPerPage')+'',
options = this.select.options,
i,len;
for (i = 0, len = options.length; i < len; ++i) {
if (options[i].value === rpp) {
options[i].selected = true;
break;
}
}
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"e",
"&&",
"e",
".",
"prevValue",
"===",
"e",
".",
"newValue",
")",
"{",
"return",
";",
"}",
"var",
"rpp",
"=",
"this",
".",
"paginator",
".",
"get",
"(",
"'rowsPerPage'",
")",
"+",
"''",
",",
"options",
"=",
"this",
".",
"select",
".",
"options",
",",
"i",
",",
"len",
";",
"for",
"(",
"i",
"=",
"0",
",",
"len",
"=",
"options",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"if",
"(",
"options",
"[",
"i",
"]",
".",
"value",
"===",
"rpp",
")",
"{",
"options",
"[",
"i",
"]",
".",
"selected",
"=",
"true",
";",
"break",
";",
"}",
"}",
"}"
]
| Select the appropriate option if changed.
@method update
@param e {CustomEvent} The calling change event | [
"Select",
"the",
"appropriate",
"option",
"if",
"changed",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L2334-L2349 |
|
43,060 | neyric/webhookit | public/javascripts/yui/paginator/paginator-debug.js | function () {
YAHOO.util.Event.purgeElement(this.select);
this.select.parentNode.removeChild(this.select);
this.select = null;
} | javascript | function () {
YAHOO.util.Event.purgeElement(this.select);
this.select.parentNode.removeChild(this.select);
this.select = null;
} | [
"function",
"(",
")",
"{",
"YAHOO",
".",
"util",
".",
"Event",
".",
"purgeElement",
"(",
"this",
".",
"select",
")",
";",
"this",
".",
"select",
".",
"parentNode",
".",
"removeChild",
"(",
"this",
".",
"select",
")",
";",
"this",
".",
"select",
"=",
"null",
";",
"}"
]
| Removes the select node and clears event listeners
@method destroy
@private | [
"Removes",
"the",
"select",
"node",
"and",
"clears",
"event",
"listeners"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/paginator/paginator-debug.js#L2385-L2389 |
|
43,061 | neyric/webhookit | public/javascripts/WireIt/plugins/grouping/examples/sawire/ExecutionFrame.js | function(wiringConfig, frameLevel, parentFrame, parentIndex) {
// save the initial config
this.wiringConfig = wiringConfig;
// save the parent frame
this.frameLevel = frameLevel || 0;
this.parentFrame = parentFrame;
this.parentIndex = parentIndex;
// Will contains the execution values (this.execValues[module][outputName] = the value)
this.execValues = {};
} | javascript | function(wiringConfig, frameLevel, parentFrame, parentIndex) {
// save the initial config
this.wiringConfig = wiringConfig;
// save the parent frame
this.frameLevel = frameLevel || 0;
this.parentFrame = parentFrame;
this.parentIndex = parentIndex;
// Will contains the execution values (this.execValues[module][outputName] = the value)
this.execValues = {};
} | [
"function",
"(",
"wiringConfig",
",",
"frameLevel",
",",
"parentFrame",
",",
"parentIndex",
")",
"{",
"// save the initial config",
"this",
".",
"wiringConfig",
"=",
"wiringConfig",
";",
"// save the parent frame",
"this",
".",
"frameLevel",
"=",
"frameLevel",
"||",
"0",
";",
"this",
".",
"parentFrame",
"=",
"parentFrame",
";",
"this",
".",
"parentIndex",
"=",
"parentIndex",
";",
"// Will contains the execution values (this.execValues[module][outputName] = the value)",
"this",
".",
"execValues",
"=",
"{",
"}",
";",
"}"
]
| An "ExecutionFrame" is the equivalent to the jsBox layer.
It contains a set module instances and a set of wires linking them.
@class ExecutionFrame
@constructor
@param {Object} wiringConfig The wiring config | [
"An",
"ExecutionFrame",
"is",
"the",
"equivalent",
"to",
"the",
"jsBox",
"layer",
".",
"It",
"contains",
"a",
"set",
"module",
"instances",
"and",
"a",
"set",
"of",
"wires",
"linking",
"them",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/plugins/grouping/examples/sawire/ExecutionFrame.js#L8-L21 |
|
43,062 | mozilla-b2g/npm-mirror | lib/download.js | function(url, callback) {
if (this.cache[url]) {
return callback && callback(null, this.cache[url]);
}
debug('GET ' + url);
var protocol = this._getProtocol(url);
protocol.get(url, function(res) {
if (res.statusCode !== 200) {
return callback && callback(
new Error('Bad status ' + res.statusCode + ' for ' + url));
}
res.setEncoding('utf-8');
var result = '';
res.on('data', function(data) {
result += data;
});
res.on('end', function() {
this.cache[url] = result;
return callback && callback(null, result);
}.bind(this));
}.bind(this)).on('error', function(e) {
return callback && callback(e);
});
} | javascript | function(url, callback) {
if (this.cache[url]) {
return callback && callback(null, this.cache[url]);
}
debug('GET ' + url);
var protocol = this._getProtocol(url);
protocol.get(url, function(res) {
if (res.statusCode !== 200) {
return callback && callback(
new Error('Bad status ' + res.statusCode + ' for ' + url));
}
res.setEncoding('utf-8');
var result = '';
res.on('data', function(data) {
result += data;
});
res.on('end', function() {
this.cache[url] = result;
return callback && callback(null, result);
}.bind(this));
}.bind(this)).on('error', function(e) {
return callback && callback(e);
});
} | [
"function",
"(",
"url",
",",
"callback",
")",
"{",
"if",
"(",
"this",
".",
"cache",
"[",
"url",
"]",
")",
"{",
"return",
"callback",
"&&",
"callback",
"(",
"null",
",",
"this",
".",
"cache",
"[",
"url",
"]",
")",
";",
"}",
"debug",
"(",
"'GET '",
"+",
"url",
")",
";",
"var",
"protocol",
"=",
"this",
".",
"_getProtocol",
"(",
"url",
")",
";",
"protocol",
".",
"get",
"(",
"url",
",",
"function",
"(",
"res",
")",
"{",
"if",
"(",
"res",
".",
"statusCode",
"!==",
"200",
")",
"{",
"return",
"callback",
"&&",
"callback",
"(",
"new",
"Error",
"(",
"'Bad status '",
"+",
"res",
".",
"statusCode",
"+",
"' for '",
"+",
"url",
")",
")",
";",
"}",
"res",
".",
"setEncoding",
"(",
"'utf-8'",
")",
";",
"var",
"result",
"=",
"''",
";",
"res",
".",
"on",
"(",
"'data'",
",",
"function",
"(",
"data",
")",
"{",
"result",
"+=",
"data",
";",
"}",
")",
";",
"res",
".",
"on",
"(",
"'end'",
",",
"function",
"(",
")",
"{",
"this",
".",
"cache",
"[",
"url",
"]",
"=",
"result",
";",
"return",
"callback",
"&&",
"callback",
"(",
"null",
",",
"result",
")",
";",
"}",
".",
"bind",
"(",
"this",
")",
")",
";",
"}",
".",
"bind",
"(",
"this",
")",
")",
".",
"on",
"(",
"'error'",
",",
"function",
"(",
"e",
")",
"{",
"return",
"callback",
"&&",
"callback",
"(",
"e",
")",
";",
"}",
")",
";",
"}"
]
| Download http response to memory.
@param {string} url to fetch.
@param {Function} callback invoke when done. | [
"Download",
"http",
"response",
"to",
"memory",
"."
]
| b405e97d369d916db163c2fe9139955a37e9fad8 | https://github.com/mozilla-b2g/npm-mirror/blob/b405e97d369d916db163c2fe9139955a37e9fad8/lib/download.js#L44-L69 |
|
43,063 | mozilla-b2g/npm-mirror | lib/download.js | function(url, dest, callback, count) {
if (isNaN(count)) {
count = 10;
}
if (this.cache[url]) {
return fs.writeFile(dest, this.cache[url], callback);
}
fs.exists(dest, function(exists) {
if (exists) {
// No need to download :).
return callback && callback();
}
var stream = fs.createWriteStream(dest);
debug('GET ' + url);
var protocol = this._getProtocol(url);
protocol.get(url, function(res) {
if (res.statusCode !== 200) {
debug('Bad status ' + res.statusCode + ' for ' + url + '... ' +
'will try ' + count + ' more times');
if (count === 0) {
return callback && callback(
new Error('Bad status ' + res.statusCode + ' for ' + url));
}
return Download.inst.downloadToDisk(url, dest, callback, count - 1);
}
res.pipe(stream);
stream.on('finish', callback);
});
}.bind(this));
} | javascript | function(url, dest, callback, count) {
if (isNaN(count)) {
count = 10;
}
if (this.cache[url]) {
return fs.writeFile(dest, this.cache[url], callback);
}
fs.exists(dest, function(exists) {
if (exists) {
// No need to download :).
return callback && callback();
}
var stream = fs.createWriteStream(dest);
debug('GET ' + url);
var protocol = this._getProtocol(url);
protocol.get(url, function(res) {
if (res.statusCode !== 200) {
debug('Bad status ' + res.statusCode + ' for ' + url + '... ' +
'will try ' + count + ' more times');
if (count === 0) {
return callback && callback(
new Error('Bad status ' + res.statusCode + ' for ' + url));
}
return Download.inst.downloadToDisk(url, dest, callback, count - 1);
}
res.pipe(stream);
stream.on('finish', callback);
});
}.bind(this));
} | [
"function",
"(",
"url",
",",
"dest",
",",
"callback",
",",
"count",
")",
"{",
"if",
"(",
"isNaN",
"(",
"count",
")",
")",
"{",
"count",
"=",
"10",
";",
"}",
"if",
"(",
"this",
".",
"cache",
"[",
"url",
"]",
")",
"{",
"return",
"fs",
".",
"writeFile",
"(",
"dest",
",",
"this",
".",
"cache",
"[",
"url",
"]",
",",
"callback",
")",
";",
"}",
"fs",
".",
"exists",
"(",
"dest",
",",
"function",
"(",
"exists",
")",
"{",
"if",
"(",
"exists",
")",
"{",
"// No need to download :).",
"return",
"callback",
"&&",
"callback",
"(",
")",
";",
"}",
"var",
"stream",
"=",
"fs",
".",
"createWriteStream",
"(",
"dest",
")",
";",
"debug",
"(",
"'GET '",
"+",
"url",
")",
";",
"var",
"protocol",
"=",
"this",
".",
"_getProtocol",
"(",
"url",
")",
";",
"protocol",
".",
"get",
"(",
"url",
",",
"function",
"(",
"res",
")",
"{",
"if",
"(",
"res",
".",
"statusCode",
"!==",
"200",
")",
"{",
"debug",
"(",
"'Bad status '",
"+",
"res",
".",
"statusCode",
"+",
"' for '",
"+",
"url",
"+",
"'... '",
"+",
"'will try '",
"+",
"count",
"+",
"' more times'",
")",
";",
"if",
"(",
"count",
"===",
"0",
")",
"{",
"return",
"callback",
"&&",
"callback",
"(",
"new",
"Error",
"(",
"'Bad status '",
"+",
"res",
".",
"statusCode",
"+",
"' for '",
"+",
"url",
")",
")",
";",
"}",
"return",
"Download",
".",
"inst",
".",
"downloadToDisk",
"(",
"url",
",",
"dest",
",",
"callback",
",",
"count",
"-",
"1",
")",
";",
"}",
"res",
".",
"pipe",
"(",
"stream",
")",
";",
"stream",
".",
"on",
"(",
"'finish'",
",",
"callback",
")",
";",
"}",
")",
";",
"}",
".",
"bind",
"(",
"this",
")",
")",
";",
"}"
]
| Download http response and save to disk.
@param {string} url to fetch.
@param {string} dest where to write the tarball.
@param {Function} callback invoke when done. | [
"Download",
"http",
"response",
"and",
"save",
"to",
"disk",
"."
]
| b405e97d369d916db163c2fe9139955a37e9fad8 | https://github.com/mozilla-b2g/npm-mirror/blob/b405e97d369d916db163c2fe9139955a37e9fad8/lib/download.js#L78-L112 |
|
43,064 | mozilla-b2g/npm-mirror | lib/download.js | function(url) {
var protocol;
if (url.indexOf('http://') !== -1) {
protocol = http;
} else if (url.indexOf('https://') !== -1) {
protocol = https;
} else {
throw new Error('unsupported protocol :' + url);
}
return protocol;
} | javascript | function(url) {
var protocol;
if (url.indexOf('http://') !== -1) {
protocol = http;
} else if (url.indexOf('https://') !== -1) {
protocol = https;
} else {
throw new Error('unsupported protocol :' + url);
}
return protocol;
} | [
"function",
"(",
"url",
")",
"{",
"var",
"protocol",
";",
"if",
"(",
"url",
".",
"indexOf",
"(",
"'http://'",
")",
"!==",
"-",
"1",
")",
"{",
"protocol",
"=",
"http",
";",
"}",
"else",
"if",
"(",
"url",
".",
"indexOf",
"(",
"'https://'",
")",
"!==",
"-",
"1",
")",
"{",
"protocol",
"=",
"https",
";",
"}",
"else",
"{",
"throw",
"new",
"Error",
"(",
"'unsupported protocol :'",
"+",
"url",
")",
";",
"}",
"return",
"protocol",
";",
"}"
]
| Choose a protocol for the url.
@param {string} url some url.
@return {Object} http or https. | [
"Choose",
"a",
"protocol",
"for",
"the",
"url",
"."
]
| b405e97d369d916db163c2fe9139955a37e9fad8 | https://github.com/mozilla-b2g/npm-mirror/blob/b405e97d369d916db163c2fe9139955a37e9fad8/lib/download.js#L120-L131 |
|
43,065 | neyric/webhookit | public/javascripts/yui/logger/logger.js | LogReader | function LogReader(elContainer, oConfigs) {
this._sName = LogReader._index;
LogReader._index++;
this._init.apply(this,arguments);
/**
* Render the LogReader immediately upon instantiation. If set to false,
* you must call myLogReader.render() to generate the UI.
*
* @property autoRender
* @type {Boolean}
* @default true
*/
if (this.autoRender !== false) {
this.render();
}
} | javascript | function LogReader(elContainer, oConfigs) {
this._sName = LogReader._index;
LogReader._index++;
this._init.apply(this,arguments);
/**
* Render the LogReader immediately upon instantiation. If set to false,
* you must call myLogReader.render() to generate the UI.
*
* @property autoRender
* @type {Boolean}
* @default true
*/
if (this.autoRender !== false) {
this.render();
}
} | [
"function",
"LogReader",
"(",
"elContainer",
",",
"oConfigs",
")",
"{",
"this",
".",
"_sName",
"=",
"LogReader",
".",
"_index",
";",
"LogReader",
".",
"_index",
"++",
";",
"this",
".",
"_init",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"/**\n * Render the LogReader immediately upon instantiation. If set to false,\n * you must call myLogReader.render() to generate the UI.\n * \n * @property autoRender\n * @type {Boolean}\n * @default true\n */",
"if",
"(",
"this",
".",
"autoRender",
"!==",
"false",
")",
"{",
"this",
".",
"render",
"(",
")",
";",
"}",
"}"
]
| The LogReader class provides UI to read messages logged to YAHOO.widget.Logger.
@class LogReader
@constructor
@param elContainer {HTMLElement} (optional) DOM element reference of an existing DIV.
@param elContainer {String} (optional) String ID of an existing DIV.
@param oConfigs {Object} (optional) Object literal of configuration params. | [
"The",
"LogReader",
"class",
"provides",
"UI",
"to",
"read",
"messages",
"logged",
"to",
"YAHOO",
".",
"widget",
".",
"Logger",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L671-L688 |
43,066 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function() {
this._elConsole.style.display = "none";
if(this._elFt) {
this._elFt.style.display = "none";
}
this._btnCollapse.value = "Expand";
this.isCollapsed = true;
} | javascript | function() {
this._elConsole.style.display = "none";
if(this._elFt) {
this._elFt.style.display = "none";
}
this._btnCollapse.value = "Expand";
this.isCollapsed = true;
} | [
"function",
"(",
")",
"{",
"this",
".",
"_elConsole",
".",
"style",
".",
"display",
"=",
"\"none\"",
";",
"if",
"(",
"this",
".",
"_elFt",
")",
"{",
"this",
".",
"_elFt",
".",
"style",
".",
"display",
"=",
"\"none\"",
";",
"}",
"this",
".",
"_btnCollapse",
".",
"value",
"=",
"\"Expand\"",
";",
"this",
".",
"isCollapsed",
"=",
"true",
";",
"}"
]
| Collapses UI of LogReader. Logging functionality is not disrupted.
@method collapse | [
"Collapses",
"UI",
"of",
"LogReader",
".",
"Logging",
"functionality",
"is",
"not",
"disrupted",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1026-L1033 |
|
43,067 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function() {
this._elConsole.style.display = "block";
if(this._elFt) {
this._elFt.style.display = "block";
}
this._btnCollapse.value = "Collapse";
this.isCollapsed = false;
} | javascript | function() {
this._elConsole.style.display = "block";
if(this._elFt) {
this._elFt.style.display = "block";
}
this._btnCollapse.value = "Collapse";
this.isCollapsed = false;
} | [
"function",
"(",
")",
"{",
"this",
".",
"_elConsole",
".",
"style",
".",
"display",
"=",
"\"block\"",
";",
"if",
"(",
"this",
".",
"_elFt",
")",
"{",
"this",
".",
"_elFt",
".",
"style",
".",
"display",
"=",
"\"block\"",
";",
"}",
"this",
".",
"_btnCollapse",
".",
"value",
"=",
"\"Collapse\"",
";",
"this",
".",
"isCollapsed",
"=",
"false",
";",
"}"
]
| Expands UI of LogReader. Logging functionality is not disrupted.
@method expand | [
"Expands",
"UI",
"of",
"LogReader",
".",
"Logging",
"functionality",
"is",
"not",
"disrupted",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1040-L1047 |
|
43,068 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function(sCategory) {
var filtersArray = this._categoryFilters;
// Don't do anything if category is already enabled
// Use Array.indexOf if available...
if(filtersArray.indexOf) {
if(filtersArray.indexOf(sCategory) > -1) {
return;
}
}
// ...or do it the old-fashioned way
else {
for(var i=0; i<filtersArray.length; i++) {
if(filtersArray[i] === sCategory){
return;
}
}
}
this._categoryFilters.push(sCategory);
this._filterLogs();
var elCheckbox = this.getCheckbox(sCategory);
if(elCheckbox) {
elCheckbox.checked = true;
}
} | javascript | function(sCategory) {
var filtersArray = this._categoryFilters;
// Don't do anything if category is already enabled
// Use Array.indexOf if available...
if(filtersArray.indexOf) {
if(filtersArray.indexOf(sCategory) > -1) {
return;
}
}
// ...or do it the old-fashioned way
else {
for(var i=0; i<filtersArray.length; i++) {
if(filtersArray[i] === sCategory){
return;
}
}
}
this._categoryFilters.push(sCategory);
this._filterLogs();
var elCheckbox = this.getCheckbox(sCategory);
if(elCheckbox) {
elCheckbox.checked = true;
}
} | [
"function",
"(",
"sCategory",
")",
"{",
"var",
"filtersArray",
"=",
"this",
".",
"_categoryFilters",
";",
"// Don't do anything if category is already enabled",
"// Use Array.indexOf if available...",
"if",
"(",
"filtersArray",
".",
"indexOf",
")",
"{",
"if",
"(",
"filtersArray",
".",
"indexOf",
"(",
"sCategory",
")",
">",
"-",
"1",
")",
"{",
"return",
";",
"}",
"}",
"// ...or do it the old-fashioned way",
"else",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"filtersArray",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"filtersArray",
"[",
"i",
"]",
"===",
"sCategory",
")",
"{",
"return",
";",
"}",
"}",
"}",
"this",
".",
"_categoryFilters",
".",
"push",
"(",
"sCategory",
")",
";",
"this",
".",
"_filterLogs",
"(",
")",
";",
"var",
"elCheckbox",
"=",
"this",
".",
"getCheckbox",
"(",
"sCategory",
")",
";",
"if",
"(",
"elCheckbox",
")",
"{",
"elCheckbox",
".",
"checked",
"=",
"true",
";",
"}",
"}"
]
| Shows log messages associated with given category.
@method showCategory
@param {String} Category name. | [
"Shows",
"log",
"messages",
"associated",
"with",
"given",
"category",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1076-L1100 |
|
43,069 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function(sCategory) {
var filtersArray = this._categoryFilters;
for(var i=0; i<filtersArray.length; i++) {
if(sCategory == filtersArray[i]) {
filtersArray.splice(i, 1);
break;
}
}
this._filterLogs();
var elCheckbox = this.getCheckbox(sCategory);
if(elCheckbox) {
elCheckbox.checked = false;
}
} | javascript | function(sCategory) {
var filtersArray = this._categoryFilters;
for(var i=0; i<filtersArray.length; i++) {
if(sCategory == filtersArray[i]) {
filtersArray.splice(i, 1);
break;
}
}
this._filterLogs();
var elCheckbox = this.getCheckbox(sCategory);
if(elCheckbox) {
elCheckbox.checked = false;
}
} | [
"function",
"(",
"sCategory",
")",
"{",
"var",
"filtersArray",
"=",
"this",
".",
"_categoryFilters",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"filtersArray",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"sCategory",
"==",
"filtersArray",
"[",
"i",
"]",
")",
"{",
"filtersArray",
".",
"splice",
"(",
"i",
",",
"1",
")",
";",
"break",
";",
"}",
"}",
"this",
".",
"_filterLogs",
"(",
")",
";",
"var",
"elCheckbox",
"=",
"this",
".",
"getCheckbox",
"(",
"sCategory",
")",
";",
"if",
"(",
"elCheckbox",
")",
"{",
"elCheckbox",
".",
"checked",
"=",
"false",
";",
"}",
"}"
]
| Hides log messages associated with given category.
@method hideCategory
@param {String} Category name. | [
"Hides",
"log",
"messages",
"associated",
"with",
"given",
"category",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1108-L1121 |
|
43,070 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function(sSource) {
var filtersArray = this._sourceFilters;
// Don't do anything if category is already enabled
// Use Array.indexOf if available...
if(filtersArray.indexOf) {
if(filtersArray.indexOf(sSource) > -1) {
return;
}
}
// ...or do it the old-fashioned way
else {
for(var i=0; i<filtersArray.length; i++) {
if(sSource == filtersArray[i]){
return;
}
}
}
filtersArray.push(sSource);
this._filterLogs();
var elCheckbox = this.getCheckbox(sSource);
if(elCheckbox) {
elCheckbox.checked = true;
}
} | javascript | function(sSource) {
var filtersArray = this._sourceFilters;
// Don't do anything if category is already enabled
// Use Array.indexOf if available...
if(filtersArray.indexOf) {
if(filtersArray.indexOf(sSource) > -1) {
return;
}
}
// ...or do it the old-fashioned way
else {
for(var i=0; i<filtersArray.length; i++) {
if(sSource == filtersArray[i]){
return;
}
}
}
filtersArray.push(sSource);
this._filterLogs();
var elCheckbox = this.getCheckbox(sSource);
if(elCheckbox) {
elCheckbox.checked = true;
}
} | [
"function",
"(",
"sSource",
")",
"{",
"var",
"filtersArray",
"=",
"this",
".",
"_sourceFilters",
";",
"// Don't do anything if category is already enabled",
"// Use Array.indexOf if available...",
"if",
"(",
"filtersArray",
".",
"indexOf",
")",
"{",
"if",
"(",
"filtersArray",
".",
"indexOf",
"(",
"sSource",
")",
">",
"-",
"1",
")",
"{",
"return",
";",
"}",
"}",
"// ...or do it the old-fashioned way",
"else",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"filtersArray",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"sSource",
"==",
"filtersArray",
"[",
"i",
"]",
")",
"{",
"return",
";",
"}",
"}",
"}",
"filtersArray",
".",
"push",
"(",
"sSource",
")",
";",
"this",
".",
"_filterLogs",
"(",
")",
";",
"var",
"elCheckbox",
"=",
"this",
".",
"getCheckbox",
"(",
"sSource",
")",
";",
"if",
"(",
"elCheckbox",
")",
"{",
"elCheckbox",
".",
"checked",
"=",
"true",
";",
"}",
"}"
]
| Shows log messages associated with given source.
@method showSource
@param {String} Source name. | [
"Shows",
"log",
"messages",
"associated",
"with",
"given",
"source",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1139-L1162 |
|
43,071 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function(sSource) {
var filtersArray = this._sourceFilters;
for(var i=0; i<filtersArray.length; i++) {
if(sSource == filtersArray[i]) {
filtersArray.splice(i, 1);
break;
}
}
this._filterLogs();
var elCheckbox = this.getCheckbox(sSource);
if(elCheckbox) {
elCheckbox.checked = false;
}
} | javascript | function(sSource) {
var filtersArray = this._sourceFilters;
for(var i=0; i<filtersArray.length; i++) {
if(sSource == filtersArray[i]) {
filtersArray.splice(i, 1);
break;
}
}
this._filterLogs();
var elCheckbox = this.getCheckbox(sSource);
if(elCheckbox) {
elCheckbox.checked = false;
}
} | [
"function",
"(",
"sSource",
")",
"{",
"var",
"filtersArray",
"=",
"this",
".",
"_sourceFilters",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"filtersArray",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"sSource",
"==",
"filtersArray",
"[",
"i",
"]",
")",
"{",
"filtersArray",
".",
"splice",
"(",
"i",
",",
"1",
")",
";",
"break",
";",
"}",
"}",
"this",
".",
"_filterLogs",
"(",
")",
";",
"var",
"elCheckbox",
"=",
"this",
".",
"getCheckbox",
"(",
"sSource",
")",
";",
"if",
"(",
"elCheckbox",
")",
"{",
"elCheckbox",
".",
"checked",
"=",
"false",
";",
"}",
"}"
]
| Hides log messages associated with given source.
@method hideSource
@param {String} Source name. | [
"Hides",
"log",
"messages",
"associated",
"with",
"given",
"source",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1170-L1183 |
|
43,072 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function() {
// Default the container if unset or not a div
if(!this._elContainer || !/div$/i.test(this._elContainer.tagName)) {
this._elContainer = d.body.insertBefore(make("div"),d.body.firstChild);
// Only position absolutely if an in-DOM element is not supplied
Dom.addClass(this._elContainer,"yui-log-container");
}
Dom.addClass(this._elContainer,"yui-log");
// If implementer has provided container values, trust and set those
var style = this._elContainer.style,
styleProps = ['width','right','top','fontSize'],
prop,i;
for (i = styleProps.length - 1; i >= 0; --i) {
prop = styleProps[i];
if (this[prop]){
style[prop] = this[prop];
}
}
if(this.left) {
style.left = this.left;
style.right = "auto";
}
if(this.bottom) {
style.bottom = this.bottom;
style.top = "auto";
}
// Opera needs a little prodding to reflow sometimes
if (YAHOO.env.ua.opera) {
d.body.style += '';
}
} | javascript | function() {
// Default the container if unset or not a div
if(!this._elContainer || !/div$/i.test(this._elContainer.tagName)) {
this._elContainer = d.body.insertBefore(make("div"),d.body.firstChild);
// Only position absolutely if an in-DOM element is not supplied
Dom.addClass(this._elContainer,"yui-log-container");
}
Dom.addClass(this._elContainer,"yui-log");
// If implementer has provided container values, trust and set those
var style = this._elContainer.style,
styleProps = ['width','right','top','fontSize'],
prop,i;
for (i = styleProps.length - 1; i >= 0; --i) {
prop = styleProps[i];
if (this[prop]){
style[prop] = this[prop];
}
}
if(this.left) {
style.left = this.left;
style.right = "auto";
}
if(this.bottom) {
style.bottom = this.bottom;
style.top = "auto";
}
// Opera needs a little prodding to reflow sometimes
if (YAHOO.env.ua.opera) {
d.body.style += '';
}
} | [
"function",
"(",
")",
"{",
"// Default the container if unset or not a div",
"if",
"(",
"!",
"this",
".",
"_elContainer",
"||",
"!",
"/",
"div$",
"/",
"i",
".",
"test",
"(",
"this",
".",
"_elContainer",
".",
"tagName",
")",
")",
"{",
"this",
".",
"_elContainer",
"=",
"d",
".",
"body",
".",
"insertBefore",
"(",
"make",
"(",
"\"div\"",
")",
",",
"d",
".",
"body",
".",
"firstChild",
")",
";",
"// Only position absolutely if an in-DOM element is not supplied",
"Dom",
".",
"addClass",
"(",
"this",
".",
"_elContainer",
",",
"\"yui-log-container\"",
")",
";",
"}",
"Dom",
".",
"addClass",
"(",
"this",
".",
"_elContainer",
",",
"\"yui-log\"",
")",
";",
"// If implementer has provided container values, trust and set those",
"var",
"style",
"=",
"this",
".",
"_elContainer",
".",
"style",
",",
"styleProps",
"=",
"[",
"'width'",
",",
"'right'",
",",
"'top'",
",",
"'fontSize'",
"]",
",",
"prop",
",",
"i",
";",
"for",
"(",
"i",
"=",
"styleProps",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"--",
"i",
")",
"{",
"prop",
"=",
"styleProps",
"[",
"i",
"]",
";",
"if",
"(",
"this",
"[",
"prop",
"]",
")",
"{",
"style",
"[",
"prop",
"]",
"=",
"this",
"[",
"prop",
"]",
";",
"}",
"}",
"if",
"(",
"this",
".",
"left",
")",
"{",
"style",
".",
"left",
"=",
"this",
".",
"left",
";",
"style",
".",
"right",
"=",
"\"auto\"",
";",
"}",
"if",
"(",
"this",
".",
"bottom",
")",
"{",
"style",
".",
"bottom",
"=",
"this",
".",
"bottom",
";",
"style",
".",
"top",
"=",
"\"auto\"",
";",
"}",
"// Opera needs a little prodding to reflow sometimes",
"if",
"(",
"YAHOO",
".",
"env",
".",
"ua",
".",
"opera",
")",
"{",
"d",
".",
"body",
".",
"style",
"+=",
"''",
";",
"}",
"}"
]
| Initializes the primary container element.
@method _initContainerEl
@private | [
"Initializes",
"the",
"primary",
"container",
"element",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1525-L1562 |
|
43,073 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function() {
// Destroy header if present
if(this._elHd) {
// Unhook DOM events
Event.purgeElement(this._elHd, true);
// Remove DOM elements
this._elHd.innerHTML = "";
}
// Create header
// TODO: refactor this into an innerHTML
this._elHd = make("div",{
id: 'yui-log-hd' + this._sName,
className: "yui-log-hd"
});
this._elCollapse = make("div",{ className: 'yui-log-btns' });
this._btnCollapse = make("input",{
type: 'button',
className: 'yui-log-button',
value: 'Collapse'
});
Event.on(this._btnCollapse,'click',this._onClickCollapseBtn,this);
this._title = make("h4",{ innerHTML : "Logger Console" });
this._elCollapse.appendChild(this._btnCollapse);
this._elHd.appendChild(this._elCollapse);
this._elHd.appendChild(this._title);
this._elContainer.appendChild(this._elHd);
} | javascript | function() {
// Destroy header if present
if(this._elHd) {
// Unhook DOM events
Event.purgeElement(this._elHd, true);
// Remove DOM elements
this._elHd.innerHTML = "";
}
// Create header
// TODO: refactor this into an innerHTML
this._elHd = make("div",{
id: 'yui-log-hd' + this._sName,
className: "yui-log-hd"
});
this._elCollapse = make("div",{ className: 'yui-log-btns' });
this._btnCollapse = make("input",{
type: 'button',
className: 'yui-log-button',
value: 'Collapse'
});
Event.on(this._btnCollapse,'click',this._onClickCollapseBtn,this);
this._title = make("h4",{ innerHTML : "Logger Console" });
this._elCollapse.appendChild(this._btnCollapse);
this._elHd.appendChild(this._elCollapse);
this._elHd.appendChild(this._title);
this._elContainer.appendChild(this._elHd);
} | [
"function",
"(",
")",
"{",
"// Destroy header if present",
"if",
"(",
"this",
".",
"_elHd",
")",
"{",
"// Unhook DOM events",
"Event",
".",
"purgeElement",
"(",
"this",
".",
"_elHd",
",",
"true",
")",
";",
"// Remove DOM elements",
"this",
".",
"_elHd",
".",
"innerHTML",
"=",
"\"\"",
";",
"}",
"// Create header",
"// TODO: refactor this into an innerHTML",
"this",
".",
"_elHd",
"=",
"make",
"(",
"\"div\"",
",",
"{",
"id",
":",
"'yui-log-hd'",
"+",
"this",
".",
"_sName",
",",
"className",
":",
"\"yui-log-hd\"",
"}",
")",
";",
"this",
".",
"_elCollapse",
"=",
"make",
"(",
"\"div\"",
",",
"{",
"className",
":",
"'yui-log-btns'",
"}",
")",
";",
"this",
".",
"_btnCollapse",
"=",
"make",
"(",
"\"input\"",
",",
"{",
"type",
":",
"'button'",
",",
"className",
":",
"'yui-log-button'",
",",
"value",
":",
"'Collapse'",
"}",
")",
";",
"Event",
".",
"on",
"(",
"this",
".",
"_btnCollapse",
",",
"'click'",
",",
"this",
".",
"_onClickCollapseBtn",
",",
"this",
")",
";",
"this",
".",
"_title",
"=",
"make",
"(",
"\"h4\"",
",",
"{",
"innerHTML",
":",
"\"Logger Console\"",
"}",
")",
";",
"this",
".",
"_elCollapse",
".",
"appendChild",
"(",
"this",
".",
"_btnCollapse",
")",
";",
"this",
".",
"_elHd",
".",
"appendChild",
"(",
"this",
".",
"_elCollapse",
")",
";",
"this",
".",
"_elHd",
".",
"appendChild",
"(",
"this",
".",
"_title",
")",
";",
"this",
".",
"_elContainer",
".",
"appendChild",
"(",
"this",
".",
"_elHd",
")",
";",
"}"
]
| Initializes the header element.
@method _initHeaderEl
@private | [
"Initializes",
"the",
"header",
"element",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1570-L1603 |
|
43,074 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function() {
// Destroy console
if(this._elConsole) {
// Unhook DOM events
Event.purgeElement(this._elConsole, true);
// Remove DOM elements
this._elConsole.innerHTML = "";
}
// Ceate console
this._elConsole = make("div", { className: "yui-log-bd" });
// If implementer has provided console, trust and set those
if(this.height) {
this._elConsole.style.height = this.height;
}
this._elContainer.appendChild(this._elConsole);
} | javascript | function() {
// Destroy console
if(this._elConsole) {
// Unhook DOM events
Event.purgeElement(this._elConsole, true);
// Remove DOM elements
this._elConsole.innerHTML = "";
}
// Ceate console
this._elConsole = make("div", { className: "yui-log-bd" });
// If implementer has provided console, trust and set those
if(this.height) {
this._elConsole.style.height = this.height;
}
this._elContainer.appendChild(this._elConsole);
} | [
"function",
"(",
")",
"{",
"// Destroy console",
"if",
"(",
"this",
".",
"_elConsole",
")",
"{",
"// Unhook DOM events",
"Event",
".",
"purgeElement",
"(",
"this",
".",
"_elConsole",
",",
"true",
")",
";",
"// Remove DOM elements",
"this",
".",
"_elConsole",
".",
"innerHTML",
"=",
"\"\"",
";",
"}",
"// Ceate console",
"this",
".",
"_elConsole",
"=",
"make",
"(",
"\"div\"",
",",
"{",
"className",
":",
"\"yui-log-bd\"",
"}",
")",
";",
"// If implementer has provided console, trust and set those",
"if",
"(",
"this",
".",
"height",
")",
"{",
"this",
".",
"_elConsole",
".",
"style",
".",
"height",
"=",
"this",
".",
"height",
";",
"}",
"this",
".",
"_elContainer",
".",
"appendChild",
"(",
"this",
".",
"_elConsole",
")",
";",
"}"
]
| Initializes the console element.
@method _initConsoleEl
@private | [
"Initializes",
"the",
"console",
"element",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1611-L1630 |
|
43,075 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function() {
// If Drag and Drop utility is available...
// ...and draggable is true...
// ...then make the header draggable
if(u.DD && this.draggable && this._elHd) {
var ylog_dd = new u.DD(this._elContainer);
ylog_dd.setHandleElId(this._elHd.id);
//TODO: use class name
this._elHd.style.cursor = "move";
}
} | javascript | function() {
// If Drag and Drop utility is available...
// ...and draggable is true...
// ...then make the header draggable
if(u.DD && this.draggable && this._elHd) {
var ylog_dd = new u.DD(this._elContainer);
ylog_dd.setHandleElId(this._elHd.id);
//TODO: use class name
this._elHd.style.cursor = "move";
}
} | [
"function",
"(",
")",
"{",
"// If Drag and Drop utility is available...",
"// ...and draggable is true...",
"// ...then make the header draggable",
"if",
"(",
"u",
".",
"DD",
"&&",
"this",
".",
"draggable",
"&&",
"this",
".",
"_elHd",
")",
"{",
"var",
"ylog_dd",
"=",
"new",
"u",
".",
"DD",
"(",
"this",
".",
"_elContainer",
")",
";",
"ylog_dd",
".",
"setHandleElId",
"(",
"this",
".",
"_elHd",
".",
"id",
")",
";",
"//TODO: use class name",
"this",
".",
"_elHd",
".",
"style",
".",
"cursor",
"=",
"\"move\"",
";",
"}",
"}"
]
| Initializes Drag and Drop on the header element.
@method _initDragDrop
@private | [
"Initializes",
"Drag",
"and",
"Drop",
"on",
"the",
"header",
"element",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1687-L1697 |
|
43,076 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function() {
// Initialize category filters
this._categoryFilters = [];
var aInitialCategories = Logger.categories;
for(var j=0; j < aInitialCategories.length; j++) {
var sCategory = aInitialCategories[j];
// Add category to the internal array of filters
this._categoryFilters.push(sCategory);
// Add checkbox element if UI is enabled
if(this._elCategoryFilters) {
this._createCategoryCheckbox(sCategory);
}
}
} | javascript | function() {
// Initialize category filters
this._categoryFilters = [];
var aInitialCategories = Logger.categories;
for(var j=0; j < aInitialCategories.length; j++) {
var sCategory = aInitialCategories[j];
// Add category to the internal array of filters
this._categoryFilters.push(sCategory);
// Add checkbox element if UI is enabled
if(this._elCategoryFilters) {
this._createCategoryCheckbox(sCategory);
}
}
} | [
"function",
"(",
")",
"{",
"// Initialize category filters",
"this",
".",
"_categoryFilters",
"=",
"[",
"]",
";",
"var",
"aInitialCategories",
"=",
"Logger",
".",
"categories",
";",
"for",
"(",
"var",
"j",
"=",
"0",
";",
"j",
"<",
"aInitialCategories",
".",
"length",
";",
"j",
"++",
")",
"{",
"var",
"sCategory",
"=",
"aInitialCategories",
"[",
"j",
"]",
";",
"// Add category to the internal array of filters",
"this",
".",
"_categoryFilters",
".",
"push",
"(",
"sCategory",
")",
";",
"// Add checkbox element if UI is enabled",
"if",
"(",
"this",
".",
"_elCategoryFilters",
")",
"{",
"this",
".",
"_createCategoryCheckbox",
"(",
"sCategory",
")",
";",
"}",
"}",
"}"
]
| Initializes category filters.
@method _initCategories
@private | [
"Initializes",
"category",
"filters",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1705-L1721 |
|
43,077 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function() {
// Initialize source filters
this._sourceFilters = [];
var aInitialSources = Logger.sources;
for(var j=0; j < aInitialSources.length; j++) {
var sSource = aInitialSources[j];
// Add source to the internal array of filters
this._sourceFilters.push(sSource);
// Add checkbox element if UI is enabled
if(this._elSourceFilters) {
this._createSourceCheckbox(sSource);
}
}
} | javascript | function() {
// Initialize source filters
this._sourceFilters = [];
var aInitialSources = Logger.sources;
for(var j=0; j < aInitialSources.length; j++) {
var sSource = aInitialSources[j];
// Add source to the internal array of filters
this._sourceFilters.push(sSource);
// Add checkbox element if UI is enabled
if(this._elSourceFilters) {
this._createSourceCheckbox(sSource);
}
}
} | [
"function",
"(",
")",
"{",
"// Initialize source filters",
"this",
".",
"_sourceFilters",
"=",
"[",
"]",
";",
"var",
"aInitialSources",
"=",
"Logger",
".",
"sources",
";",
"for",
"(",
"var",
"j",
"=",
"0",
";",
"j",
"<",
"aInitialSources",
".",
"length",
";",
"j",
"++",
")",
"{",
"var",
"sSource",
"=",
"aInitialSources",
"[",
"j",
"]",
";",
"// Add source to the internal array of filters",
"this",
".",
"_sourceFilters",
".",
"push",
"(",
"sSource",
")",
";",
"// Add checkbox element if UI is enabled",
"if",
"(",
"this",
".",
"_elSourceFilters",
")",
"{",
"this",
".",
"_createSourceCheckbox",
"(",
"sSource",
")",
";",
"}",
"}",
"}"
]
| Initializes source filters.
@method _initSources
@private | [
"Initializes",
"source",
"filters",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1729-L1745 |
|
43,078 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function(sCategory) {
if(this._elFt) {
var filter = make("span",{ className: "yui-log-filtergrp" }),
check = make("input", {
id: "yui-log-filter-" + sCategory + this._sName,
className: "yui-log-filter-" + sCategory,
type: "checkbox",
category: sCategory
}),
label = make("label", {
htmlFor: check.id,
className: sCategory,
innerHTML: sCategory
});
// Subscribe to the click event
Event.on(check,'click',this._onCheckCategory,this);
this._filterCheckboxes[sCategory] = check;
// Append el at the end so IE 5.5 can set "type" attribute
// and THEN set checked property
filter.appendChild(check);
filter.appendChild(label);
this._elCategoryFilters.appendChild(filter);
check.checked = true;
}
} | javascript | function(sCategory) {
if(this._elFt) {
var filter = make("span",{ className: "yui-log-filtergrp" }),
check = make("input", {
id: "yui-log-filter-" + sCategory + this._sName,
className: "yui-log-filter-" + sCategory,
type: "checkbox",
category: sCategory
}),
label = make("label", {
htmlFor: check.id,
className: sCategory,
innerHTML: sCategory
});
// Subscribe to the click event
Event.on(check,'click',this._onCheckCategory,this);
this._filterCheckboxes[sCategory] = check;
// Append el at the end so IE 5.5 can set "type" attribute
// and THEN set checked property
filter.appendChild(check);
filter.appendChild(label);
this._elCategoryFilters.appendChild(filter);
check.checked = true;
}
} | [
"function",
"(",
"sCategory",
")",
"{",
"if",
"(",
"this",
".",
"_elFt",
")",
"{",
"var",
"filter",
"=",
"make",
"(",
"\"span\"",
",",
"{",
"className",
":",
"\"yui-log-filtergrp\"",
"}",
")",
",",
"check",
"=",
"make",
"(",
"\"input\"",
",",
"{",
"id",
":",
"\"yui-log-filter-\"",
"+",
"sCategory",
"+",
"this",
".",
"_sName",
",",
"className",
":",
"\"yui-log-filter-\"",
"+",
"sCategory",
",",
"type",
":",
"\"checkbox\"",
",",
"category",
":",
"sCategory",
"}",
")",
",",
"label",
"=",
"make",
"(",
"\"label\"",
",",
"{",
"htmlFor",
":",
"check",
".",
"id",
",",
"className",
":",
"sCategory",
",",
"innerHTML",
":",
"sCategory",
"}",
")",
";",
"// Subscribe to the click event",
"Event",
".",
"on",
"(",
"check",
",",
"'click'",
",",
"this",
".",
"_onCheckCategory",
",",
"this",
")",
";",
"this",
".",
"_filterCheckboxes",
"[",
"sCategory",
"]",
"=",
"check",
";",
"// Append el at the end so IE 5.5 can set \"type\" attribute",
"// and THEN set checked property",
"filter",
".",
"appendChild",
"(",
"check",
")",
";",
"filter",
".",
"appendChild",
"(",
"label",
")",
";",
"this",
".",
"_elCategoryFilters",
".",
"appendChild",
"(",
"filter",
")",
";",
"check",
".",
"checked",
"=",
"true",
";",
"}",
"}"
]
| Creates the UI for a category filter in the LogReader footer element.
@method _createCategoryCheckbox
@param sCategory {String} Category name.
@private | [
"Creates",
"the",
"UI",
"for",
"a",
"category",
"filter",
"in",
"the",
"LogReader",
"footer",
"element",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1754-L1782 |
|
43,079 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function(sSource) {
if(this._elFt) {
var filter = make("span",{ className: "yui-log-filtergrp" }),
check = make("input", {
id: "yui-log-filter-" + sSource + this._sName,
className: "yui-log-filter-" + sSource,
type: "checkbox",
source: sSource
}),
label = make("label", {
htmlFor: check.id,
className: sSource,
innerHTML: sSource
});
// Subscribe to the click event
Event.on(check,'click',this._onCheckSource,this);
this._filterCheckboxes[sSource] = check;
// Append el at the end so IE 5.5 can set "type" attribute
// and THEN set checked property
filter.appendChild(check);
filter.appendChild(label);
this._elSourceFilters.appendChild(filter);
check.checked = true;
}
} | javascript | function(sSource) {
if(this._elFt) {
var filter = make("span",{ className: "yui-log-filtergrp" }),
check = make("input", {
id: "yui-log-filter-" + sSource + this._sName,
className: "yui-log-filter-" + sSource,
type: "checkbox",
source: sSource
}),
label = make("label", {
htmlFor: check.id,
className: sSource,
innerHTML: sSource
});
// Subscribe to the click event
Event.on(check,'click',this._onCheckSource,this);
this._filterCheckboxes[sSource] = check;
// Append el at the end so IE 5.5 can set "type" attribute
// and THEN set checked property
filter.appendChild(check);
filter.appendChild(label);
this._elSourceFilters.appendChild(filter);
check.checked = true;
}
} | [
"function",
"(",
"sSource",
")",
"{",
"if",
"(",
"this",
".",
"_elFt",
")",
"{",
"var",
"filter",
"=",
"make",
"(",
"\"span\"",
",",
"{",
"className",
":",
"\"yui-log-filtergrp\"",
"}",
")",
",",
"check",
"=",
"make",
"(",
"\"input\"",
",",
"{",
"id",
":",
"\"yui-log-filter-\"",
"+",
"sSource",
"+",
"this",
".",
"_sName",
",",
"className",
":",
"\"yui-log-filter-\"",
"+",
"sSource",
",",
"type",
":",
"\"checkbox\"",
",",
"source",
":",
"sSource",
"}",
")",
",",
"label",
"=",
"make",
"(",
"\"label\"",
",",
"{",
"htmlFor",
":",
"check",
".",
"id",
",",
"className",
":",
"sSource",
",",
"innerHTML",
":",
"sSource",
"}",
")",
";",
"// Subscribe to the click event",
"Event",
".",
"on",
"(",
"check",
",",
"'click'",
",",
"this",
".",
"_onCheckSource",
",",
"this",
")",
";",
"this",
".",
"_filterCheckboxes",
"[",
"sSource",
"]",
"=",
"check",
";",
"// Append el at the end so IE 5.5 can set \"type\" attribute",
"// and THEN set checked property",
"filter",
".",
"appendChild",
"(",
"check",
")",
";",
"filter",
".",
"appendChild",
"(",
"label",
")",
";",
"this",
".",
"_elSourceFilters",
".",
"appendChild",
"(",
"filter",
")",
";",
"check",
".",
"checked",
"=",
"true",
";",
"}",
"}"
]
| Creates a checkbox in the LogReader footer element to filter by source.
@method _createSourceCheckbox
@param sSource {String} Source name.
@private | [
"Creates",
"a",
"checkbox",
"in",
"the",
"LogReader",
"footer",
"element",
"to",
"filter",
"by",
"source",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1791-L1819 |
|
43,080 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function() {
this._timeout = null;
if(this._elConsole !== null) {
var thresholdMax = this.thresholdMax;
thresholdMax = (thresholdMax && !isNaN(thresholdMax)) ? thresholdMax : 500;
if(this._consoleMsgCount < thresholdMax) {
var entries = [];
for (var i=0; i<this._buffer.length; i++) {
entries[i] = this._buffer[i];
}
this._buffer = [];
this._printToConsole(entries);
}
else {
this._filterLogs();
}
if(!this.newestOnTop) {
this._elConsole.scrollTop = this._elConsole.scrollHeight;
}
}
} | javascript | function() {
this._timeout = null;
if(this._elConsole !== null) {
var thresholdMax = this.thresholdMax;
thresholdMax = (thresholdMax && !isNaN(thresholdMax)) ? thresholdMax : 500;
if(this._consoleMsgCount < thresholdMax) {
var entries = [];
for (var i=0; i<this._buffer.length; i++) {
entries[i] = this._buffer[i];
}
this._buffer = [];
this._printToConsole(entries);
}
else {
this._filterLogs();
}
if(!this.newestOnTop) {
this._elConsole.scrollTop = this._elConsole.scrollHeight;
}
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"_timeout",
"=",
"null",
";",
"if",
"(",
"this",
".",
"_elConsole",
"!==",
"null",
")",
"{",
"var",
"thresholdMax",
"=",
"this",
".",
"thresholdMax",
";",
"thresholdMax",
"=",
"(",
"thresholdMax",
"&&",
"!",
"isNaN",
"(",
"thresholdMax",
")",
")",
"?",
"thresholdMax",
":",
"500",
";",
"if",
"(",
"this",
".",
"_consoleMsgCount",
"<",
"thresholdMax",
")",
"{",
"var",
"entries",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"_buffer",
".",
"length",
";",
"i",
"++",
")",
"{",
"entries",
"[",
"i",
"]",
"=",
"this",
".",
"_buffer",
"[",
"i",
"]",
";",
"}",
"this",
".",
"_buffer",
"=",
"[",
"]",
";",
"this",
".",
"_printToConsole",
"(",
"entries",
")",
";",
"}",
"else",
"{",
"this",
".",
"_filterLogs",
"(",
")",
";",
"}",
"if",
"(",
"!",
"this",
".",
"newestOnTop",
")",
"{",
"this",
".",
"_elConsole",
".",
"scrollTop",
"=",
"this",
".",
"_elConsole",
".",
"scrollHeight",
";",
"}",
"}",
"}"
]
| Sends buffer of log messages to output and clears buffer.
@method _printBuffer
@private | [
"Sends",
"buffer",
"of",
"log",
"messages",
"to",
"output",
"and",
"clears",
"buffer",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1841-L1863 |
|
43,081 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function(aEntries) {
// Manage the number of messages displayed in the console
var entriesLen = aEntries.length,
df = d.createDocumentFragment(),
msgHTML = [],
thresholdMin = this.thresholdMin,
sourceFiltersLen = this._sourceFilters.length,
categoryFiltersLen = this._categoryFilters.length,
entriesStartIndex,
i, j, msg, before;
if(isNaN(thresholdMin) || (thresholdMin > this.thresholdMax)) {
thresholdMin = 0;
}
entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0;
// Iterate through all log entries
for(i=entriesStartIndex; i<entriesLen; i++) {
// Print only the ones that filter through
var okToPrint = false,
okToFilterCats = false,
entry = aEntries[i],
source = entry.source,
category = entry.category;
for(j=0; j<sourceFiltersLen; j++) {
if(source == this._sourceFilters[j]) {
okToFilterCats = true;
break;
}
}
if(okToFilterCats) {
for(j=0; j<categoryFiltersLen; j++) {
if(category == this._categoryFilters[j]) {
okToPrint = true;
break;
}
}
}
if(okToPrint) {
// Start from 0ms elapsed time
if (this._consoleMsgCount === 0) {
this._lastTime = entry.time.getTime();
}
msg = this.formatMsg(entry);
if (typeof msg === 'string') {
msgHTML[msgHTML.length] = msg;
} else {
df.insertBefore(msg, this.newestOnTop ?
df.firstChild || null : null);
}
this._consoleMsgCount++;
this._lastTime = entry.time.getTime();
}
}
if (msgHTML.length) {
msgHTML.splice(0,0,this._elConsole.innerHTML);
this._elConsole.innerHTML = this.newestOnTop ?
msgHTML.reverse().join('') :
msgHTML.join('');
} else if (df.firstChild) {
this._elConsole.insertBefore(df, this.newestOnTop ?
this._elConsole.firstChild || null : null);
}
} | javascript | function(aEntries) {
// Manage the number of messages displayed in the console
var entriesLen = aEntries.length,
df = d.createDocumentFragment(),
msgHTML = [],
thresholdMin = this.thresholdMin,
sourceFiltersLen = this._sourceFilters.length,
categoryFiltersLen = this._categoryFilters.length,
entriesStartIndex,
i, j, msg, before;
if(isNaN(thresholdMin) || (thresholdMin > this.thresholdMax)) {
thresholdMin = 0;
}
entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0;
// Iterate through all log entries
for(i=entriesStartIndex; i<entriesLen; i++) {
// Print only the ones that filter through
var okToPrint = false,
okToFilterCats = false,
entry = aEntries[i],
source = entry.source,
category = entry.category;
for(j=0; j<sourceFiltersLen; j++) {
if(source == this._sourceFilters[j]) {
okToFilterCats = true;
break;
}
}
if(okToFilterCats) {
for(j=0; j<categoryFiltersLen; j++) {
if(category == this._categoryFilters[j]) {
okToPrint = true;
break;
}
}
}
if(okToPrint) {
// Start from 0ms elapsed time
if (this._consoleMsgCount === 0) {
this._lastTime = entry.time.getTime();
}
msg = this.formatMsg(entry);
if (typeof msg === 'string') {
msgHTML[msgHTML.length] = msg;
} else {
df.insertBefore(msg, this.newestOnTop ?
df.firstChild || null : null);
}
this._consoleMsgCount++;
this._lastTime = entry.time.getTime();
}
}
if (msgHTML.length) {
msgHTML.splice(0,0,this._elConsole.innerHTML);
this._elConsole.innerHTML = this.newestOnTop ?
msgHTML.reverse().join('') :
msgHTML.join('');
} else if (df.firstChild) {
this._elConsole.insertBefore(df, this.newestOnTop ?
this._elConsole.firstChild || null : null);
}
} | [
"function",
"(",
"aEntries",
")",
"{",
"// Manage the number of messages displayed in the console",
"var",
"entriesLen",
"=",
"aEntries",
".",
"length",
",",
"df",
"=",
"d",
".",
"createDocumentFragment",
"(",
")",
",",
"msgHTML",
"=",
"[",
"]",
",",
"thresholdMin",
"=",
"this",
".",
"thresholdMin",
",",
"sourceFiltersLen",
"=",
"this",
".",
"_sourceFilters",
".",
"length",
",",
"categoryFiltersLen",
"=",
"this",
".",
"_categoryFilters",
".",
"length",
",",
"entriesStartIndex",
",",
"i",
",",
"j",
",",
"msg",
",",
"before",
";",
"if",
"(",
"isNaN",
"(",
"thresholdMin",
")",
"||",
"(",
"thresholdMin",
">",
"this",
".",
"thresholdMax",
")",
")",
"{",
"thresholdMin",
"=",
"0",
";",
"}",
"entriesStartIndex",
"=",
"(",
"entriesLen",
">",
"thresholdMin",
")",
"?",
"(",
"entriesLen",
"-",
"thresholdMin",
")",
":",
"0",
";",
"// Iterate through all log entries ",
"for",
"(",
"i",
"=",
"entriesStartIndex",
";",
"i",
"<",
"entriesLen",
";",
"i",
"++",
")",
"{",
"// Print only the ones that filter through",
"var",
"okToPrint",
"=",
"false",
",",
"okToFilterCats",
"=",
"false",
",",
"entry",
"=",
"aEntries",
"[",
"i",
"]",
",",
"source",
"=",
"entry",
".",
"source",
",",
"category",
"=",
"entry",
".",
"category",
";",
"for",
"(",
"j",
"=",
"0",
";",
"j",
"<",
"sourceFiltersLen",
";",
"j",
"++",
")",
"{",
"if",
"(",
"source",
"==",
"this",
".",
"_sourceFilters",
"[",
"j",
"]",
")",
"{",
"okToFilterCats",
"=",
"true",
";",
"break",
";",
"}",
"}",
"if",
"(",
"okToFilterCats",
")",
"{",
"for",
"(",
"j",
"=",
"0",
";",
"j",
"<",
"categoryFiltersLen",
";",
"j",
"++",
")",
"{",
"if",
"(",
"category",
"==",
"this",
".",
"_categoryFilters",
"[",
"j",
"]",
")",
"{",
"okToPrint",
"=",
"true",
";",
"break",
";",
"}",
"}",
"}",
"if",
"(",
"okToPrint",
")",
"{",
"// Start from 0ms elapsed time",
"if",
"(",
"this",
".",
"_consoleMsgCount",
"===",
"0",
")",
"{",
"this",
".",
"_lastTime",
"=",
"entry",
".",
"time",
".",
"getTime",
"(",
")",
";",
"}",
"msg",
"=",
"this",
".",
"formatMsg",
"(",
"entry",
")",
";",
"if",
"(",
"typeof",
"msg",
"===",
"'string'",
")",
"{",
"msgHTML",
"[",
"msgHTML",
".",
"length",
"]",
"=",
"msg",
";",
"}",
"else",
"{",
"df",
".",
"insertBefore",
"(",
"msg",
",",
"this",
".",
"newestOnTop",
"?",
"df",
".",
"firstChild",
"||",
"null",
":",
"null",
")",
";",
"}",
"this",
".",
"_consoleMsgCount",
"++",
";",
"this",
".",
"_lastTime",
"=",
"entry",
".",
"time",
".",
"getTime",
"(",
")",
";",
"}",
"}",
"if",
"(",
"msgHTML",
".",
"length",
")",
"{",
"msgHTML",
".",
"splice",
"(",
"0",
",",
"0",
",",
"this",
".",
"_elConsole",
".",
"innerHTML",
")",
";",
"this",
".",
"_elConsole",
".",
"innerHTML",
"=",
"this",
".",
"newestOnTop",
"?",
"msgHTML",
".",
"reverse",
"(",
")",
".",
"join",
"(",
"''",
")",
":",
"msgHTML",
".",
"join",
"(",
"''",
")",
";",
"}",
"else",
"if",
"(",
"df",
".",
"firstChild",
")",
"{",
"this",
".",
"_elConsole",
".",
"insertBefore",
"(",
"df",
",",
"this",
".",
"newestOnTop",
"?",
"this",
".",
"_elConsole",
".",
"firstChild",
"||",
"null",
":",
"null",
")",
";",
"}",
"}"
]
| Cycles through an array of log messages, and outputs each one to the console
if its category has not been filtered out.
@method _printToConsole
@param aEntries {Object[]} Array of LogMsg objects to output to console.
@private | [
"Cycles",
"through",
"an",
"array",
"of",
"log",
"messages",
"and",
"outputs",
"each",
"one",
"to",
"the",
"console",
"if",
"its",
"category",
"has",
"not",
"been",
"filtered",
"out",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1873-L1939 |
|
43,082 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function(sType, aArgs, oSelf) {
var source = aArgs[0];
// Add source to the internal array of filters
oSelf._sourceFilters.push(source);
if(oSelf._elFt) {
oSelf._createSourceCheckbox(source);
}
} | javascript | function(sType, aArgs, oSelf) {
var source = aArgs[0];
// Add source to the internal array of filters
oSelf._sourceFilters.push(source);
if(oSelf._elFt) {
oSelf._createSourceCheckbox(source);
}
} | [
"function",
"(",
"sType",
",",
"aArgs",
",",
"oSelf",
")",
"{",
"var",
"source",
"=",
"aArgs",
"[",
"0",
"]",
";",
"// Add source to the internal array of filters",
"oSelf",
".",
"_sourceFilters",
".",
"push",
"(",
"source",
")",
";",
"if",
"(",
"oSelf",
".",
"_elFt",
")",
"{",
"oSelf",
".",
"_createSourceCheckbox",
"(",
"source",
")",
";",
"}",
"}"
]
| Handles Logger's sourceCreateEvent.
@method _onSourceCreate
@param sType {String} The event.
@param aArgs {Object[]} Data passed from event firer.
@param oSelf {Object} The LogReader instance.
@private | [
"Handles",
"Logger",
"s",
"sourceCreateEvent",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L1976-L1985 |
|
43,083 | neyric/webhookit | public/javascripts/yui/logger/logger.js | function(sType, aArgs, oSelf) {
var logEntry = aArgs[0];
oSelf._buffer.push(logEntry);
if (oSelf.logReaderEnabled === true && oSelf._timeout === null) {
oSelf._timeout = setTimeout(function(){oSelf._printBuffer();}, oSelf.outputBuffer);
}
} | javascript | function(sType, aArgs, oSelf) {
var logEntry = aArgs[0];
oSelf._buffer.push(logEntry);
if (oSelf.logReaderEnabled === true && oSelf._timeout === null) {
oSelf._timeout = setTimeout(function(){oSelf._printBuffer();}, oSelf.outputBuffer);
}
} | [
"function",
"(",
"sType",
",",
"aArgs",
",",
"oSelf",
")",
"{",
"var",
"logEntry",
"=",
"aArgs",
"[",
"0",
"]",
";",
"oSelf",
".",
"_buffer",
".",
"push",
"(",
"logEntry",
")",
";",
"if",
"(",
"oSelf",
".",
"logReaderEnabled",
"===",
"true",
"&&",
"oSelf",
".",
"_timeout",
"===",
"null",
")",
"{",
"oSelf",
".",
"_timeout",
"=",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"oSelf",
".",
"_printBuffer",
"(",
")",
";",
"}",
",",
"oSelf",
".",
"outputBuffer",
")",
";",
"}",
"}"
]
| Handles Logger's newLogEvent.
@method _onNewLog
@param sType {String} The event.
@param aArgs {Object[]} Data passed from event firer.
@param oSelf {Object} The LogReader instance.
@private | [
"Handles",
"Logger",
"s",
"newLogEvent",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/logger/logger.js#L2078-L2085 |
|
43,084 | neyric/webhookit | public/javascripts/inputex/js/fields/KeyValueField-beta.js | function() {
inputEx.KeyValueField.superclass.initEvents.call(this);
this.inputs[0].updatedEvt.subscribe(this.onSelectFieldChange, this, true);
} | javascript | function() {
inputEx.KeyValueField.superclass.initEvents.call(this);
this.inputs[0].updatedEvt.subscribe(this.onSelectFieldChange, this, true);
} | [
"function",
"(",
")",
"{",
"inputEx",
".",
"KeyValueField",
".",
"superclass",
".",
"initEvents",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"inputs",
"[",
"0",
"]",
".",
"updatedEvt",
".",
"subscribe",
"(",
"this",
".",
"onSelectFieldChange",
",",
"this",
",",
"true",
")",
";",
"}"
]
| Subscribe the updatedEvt on the key selector | [
"Subscribe",
"the",
"updatedEvt",
"on",
"the",
"key",
"selector"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/KeyValueField-beta.js#L17-L21 |
|
43,085 | neyric/webhookit | public/javascripts/inputex/js/fields/KeyValueField-beta.js | function(e, params) {
var value = params[0];
var f = this.nameIndex[value];
var lastInput = this.inputs[this.inputs.length-1];
var next = this.divEl.childNodes[inputEx.indexOf(lastInput.getEl(), this.divEl.childNodes)+1];
lastInput.destroy();
this.inputs.pop();
var field = this.renderField(f);
var fieldEl = field.getEl();
YAHOO.util.Dom.setStyle(fieldEl, 'float', 'left');
this.divEl.insertBefore(fieldEl, next);
} | javascript | function(e, params) {
var value = params[0];
var f = this.nameIndex[value];
var lastInput = this.inputs[this.inputs.length-1];
var next = this.divEl.childNodes[inputEx.indexOf(lastInput.getEl(), this.divEl.childNodes)+1];
lastInput.destroy();
this.inputs.pop();
var field = this.renderField(f);
var fieldEl = field.getEl();
YAHOO.util.Dom.setStyle(fieldEl, 'float', 'left');
this.divEl.insertBefore(fieldEl, next);
} | [
"function",
"(",
"e",
",",
"params",
")",
"{",
"var",
"value",
"=",
"params",
"[",
"0",
"]",
";",
"var",
"f",
"=",
"this",
".",
"nameIndex",
"[",
"value",
"]",
";",
"var",
"lastInput",
"=",
"this",
".",
"inputs",
"[",
"this",
".",
"inputs",
".",
"length",
"-",
"1",
"]",
";",
"var",
"next",
"=",
"this",
".",
"divEl",
".",
"childNodes",
"[",
"inputEx",
".",
"indexOf",
"(",
"lastInput",
".",
"getEl",
"(",
")",
",",
"this",
".",
"divEl",
".",
"childNodes",
")",
"+",
"1",
"]",
";",
"lastInput",
".",
"destroy",
"(",
")",
";",
"this",
".",
"inputs",
".",
"pop",
"(",
")",
";",
"var",
"field",
"=",
"this",
".",
"renderField",
"(",
"f",
")",
";",
"var",
"fieldEl",
"=",
"field",
".",
"getEl",
"(",
")",
";",
"YAHOO",
".",
"util",
".",
"Dom",
".",
"setStyle",
"(",
"fieldEl",
",",
"'float'",
",",
"'left'",
")",
";",
"this",
".",
"divEl",
".",
"insertBefore",
"(",
"fieldEl",
",",
"next",
")",
";",
"}"
]
| Rebuild the value field | [
"Rebuild",
"the",
"value",
"field"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/KeyValueField-beta.js#L74-L86 |
|
43,086 | mozilla-b2g/npm-mirror | lib/maybemkdir.js | maybeMkdir | function maybeMkdir(path, opts, callback) {
if (typeof opts === 'function') {
callback = opts;
opts = null;
}
fs.exists(path, function(exists) {
if (opts && opts.purge) {
rimraf.sync(path);
} else {
if (exists) {
return callback && callback();
}
}
(function tryMkdir() {
fs.mkdir(path, function(err) {
if (err) {
// TODO(gaye): Eventually we should give up.
debug('error maybeMkdir, will try again ' + path + ': ' + err);
return tryMkdir();
}
return callback(null);
});
})();
});
} | javascript | function maybeMkdir(path, opts, callback) {
if (typeof opts === 'function') {
callback = opts;
opts = null;
}
fs.exists(path, function(exists) {
if (opts && opts.purge) {
rimraf.sync(path);
} else {
if (exists) {
return callback && callback();
}
}
(function tryMkdir() {
fs.mkdir(path, function(err) {
if (err) {
// TODO(gaye): Eventually we should give up.
debug('error maybeMkdir, will try again ' + path + ': ' + err);
return tryMkdir();
}
return callback(null);
});
})();
});
} | [
"function",
"maybeMkdir",
"(",
"path",
",",
"opts",
",",
"callback",
")",
"{",
"if",
"(",
"typeof",
"opts",
"===",
"'function'",
")",
"{",
"callback",
"=",
"opts",
";",
"opts",
"=",
"null",
";",
"}",
"fs",
".",
"exists",
"(",
"path",
",",
"function",
"(",
"exists",
")",
"{",
"if",
"(",
"opts",
"&&",
"opts",
".",
"purge",
")",
"{",
"rimraf",
".",
"sync",
"(",
"path",
")",
";",
"}",
"else",
"{",
"if",
"(",
"exists",
")",
"{",
"return",
"callback",
"&&",
"callback",
"(",
")",
";",
"}",
"}",
"(",
"function",
"tryMkdir",
"(",
")",
"{",
"fs",
".",
"mkdir",
"(",
"path",
",",
"function",
"(",
"err",
")",
"{",
"if",
"(",
"err",
")",
"{",
"// TODO(gaye): Eventually we should give up.",
"debug",
"(",
"'error maybeMkdir, will try again '",
"+",
"path",
"+",
"': '",
"+",
"err",
")",
";",
"return",
"tryMkdir",
"(",
")",
";",
"}",
"return",
"callback",
"(",
"null",
")",
";",
"}",
")",
";",
"}",
")",
"(",
")",
";",
"}",
")",
";",
"}"
]
| Make the directory if it doesn't exist.
@param {string} path to directory.
@param {Object} opts optional args.
purge (boolean) - whether or not to purge existing files.
@param {Function} callback invoke when done. | [
"Make",
"the",
"directory",
"if",
"it",
"doesn",
"t",
"exist",
"."
]
| b405e97d369d916db163c2fe9139955a37e9fad8 | https://github.com/mozilla-b2g/npm-mirror/blob/b405e97d369d916db163c2fe9139955a37e9fad8/lib/maybemkdir.js#L14-L41 |
43,087 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function() {
if (this._shimActive) {
YAHOO.log('Sizing Shim', 'info', 'DragDropMgr');
var s = this._shim;
s.style.height = Dom.getDocumentHeight() + 'px';
s.style.width = Dom.getDocumentWidth() + 'px';
s.style.top = '0';
s.style.left = '0';
}
} | javascript | function() {
if (this._shimActive) {
YAHOO.log('Sizing Shim', 'info', 'DragDropMgr');
var s = this._shim;
s.style.height = Dom.getDocumentHeight() + 'px';
s.style.width = Dom.getDocumentWidth() + 'px';
s.style.top = '0';
s.style.left = '0';
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_shimActive",
")",
"{",
"YAHOO",
".",
"log",
"(",
"'Sizing Shim'",
",",
"'info'",
",",
"'DragDropMgr'",
")",
";",
"var",
"s",
"=",
"this",
".",
"_shim",
";",
"s",
".",
"style",
".",
"height",
"=",
"Dom",
".",
"getDocumentHeight",
"(",
")",
"+",
"'px'",
";",
"s",
".",
"style",
".",
"width",
"=",
"Dom",
".",
"getDocumentWidth",
"(",
")",
"+",
"'px'",
";",
"s",
".",
"style",
".",
"top",
"=",
"'0'",
";",
"s",
".",
"style",
".",
"left",
"=",
"'0'",
";",
"}",
"}"
]
| This method will size the shim, called from activate and on window scroll event
@private
@method _sizeShim
@static | [
"This",
"method",
"will",
"size",
"the",
"shim",
"called",
"from",
"activate",
"and",
"on",
"window",
"scroll",
"event"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L99-L108 |
|
43,088 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function() {
if (this.useShim) {
YAHOO.log('Activating Shim', 'info', 'DragDropMgr');
if (!this._shim) {
this._createShim();
}
this._shimActive = true;
var s = this._shim,
o = '0';
if (this._debugShim) {
o = '.5';
}
Dom.setStyle(s, 'opacity', o);
this._sizeShim();
s.style.display = 'block';
}
} | javascript | function() {
if (this.useShim) {
YAHOO.log('Activating Shim', 'info', 'DragDropMgr');
if (!this._shim) {
this._createShim();
}
this._shimActive = true;
var s = this._shim,
o = '0';
if (this._debugShim) {
o = '.5';
}
Dom.setStyle(s, 'opacity', o);
this._sizeShim();
s.style.display = 'block';
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"useShim",
")",
"{",
"YAHOO",
".",
"log",
"(",
"'Activating Shim'",
",",
"'info'",
",",
"'DragDropMgr'",
")",
";",
"if",
"(",
"!",
"this",
".",
"_shim",
")",
"{",
"this",
".",
"_createShim",
"(",
")",
";",
"}",
"this",
".",
"_shimActive",
"=",
"true",
";",
"var",
"s",
"=",
"this",
".",
"_shim",
",",
"o",
"=",
"'0'",
";",
"if",
"(",
"this",
".",
"_debugShim",
")",
"{",
"o",
"=",
"'.5'",
";",
"}",
"Dom",
".",
"setStyle",
"(",
"s",
",",
"'opacity'",
",",
"o",
")",
";",
"this",
".",
"_sizeShim",
"(",
")",
";",
"s",
".",
"style",
".",
"display",
"=",
"'block'",
";",
"}",
"}"
]
| This method will create the shim element if needed, then show the shim element, size the element and set the _shimActive property to true
@private
@method _activateShim
@static | [
"This",
"method",
"will",
"create",
"the",
"shim",
"element",
"if",
"needed",
"then",
"show",
"the",
"shim",
"element",
"size",
"the",
"element",
"and",
"set",
"the",
"_shimActive",
"property",
"to",
"true"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L115-L131 |
|
43,089 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function(sMethod, args) {
for (var i in this.ids) {
for (var j in this.ids[i]) {
var oDD = this.ids[i][j];
if (! this.isTypeOfDD(oDD)) {
continue;
}
oDD[sMethod].apply(oDD, args);
}
}
} | javascript | function(sMethod, args) {
for (var i in this.ids) {
for (var j in this.ids[i]) {
var oDD = this.ids[i][j];
if (! this.isTypeOfDD(oDD)) {
continue;
}
oDD[sMethod].apply(oDD, args);
}
}
} | [
"function",
"(",
"sMethod",
",",
"args",
")",
"{",
"for",
"(",
"var",
"i",
"in",
"this",
".",
"ids",
")",
"{",
"for",
"(",
"var",
"j",
"in",
"this",
".",
"ids",
"[",
"i",
"]",
")",
"{",
"var",
"oDD",
"=",
"this",
".",
"ids",
"[",
"i",
"]",
"[",
"j",
"]",
";",
"if",
"(",
"!",
"this",
".",
"isTypeOfDD",
"(",
"oDD",
")",
")",
"{",
"continue",
";",
"}",
"oDD",
"[",
"sMethod",
"]",
".",
"apply",
"(",
"oDD",
",",
"args",
")",
";",
"}",
"}",
"}"
]
| Runs method on all drag and drop objects
@method _execOnAll
@private
@static | [
"Runs",
"method",
"on",
"all",
"drag",
"and",
"drop",
"objects"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L323-L333 |
|
43,090 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function() {
this.init();
YAHOO.log("DragDropMgr onload", "info", "DragDropMgr");
Event.on(document, "mouseup", this.handleMouseUp, this, true);
Event.on(document, "mousemove", this.handleMouseMove, this, true);
Event.on(window, "unload", this._onUnload, this, true);
Event.on(window, "resize", this._onResize, this, true);
// Event.on(window, "mouseout", this._test);
} | javascript | function() {
this.init();
YAHOO.log("DragDropMgr onload", "info", "DragDropMgr");
Event.on(document, "mouseup", this.handleMouseUp, this, true);
Event.on(document, "mousemove", this.handleMouseMove, this, true);
Event.on(window, "unload", this._onUnload, this, true);
Event.on(window, "resize", this._onResize, this, true);
// Event.on(window, "mouseout", this._test);
} | [
"function",
"(",
")",
"{",
"this",
".",
"init",
"(",
")",
";",
"YAHOO",
".",
"log",
"(",
"\"DragDropMgr onload\"",
",",
"\"info\"",
",",
"\"DragDropMgr\"",
")",
";",
"Event",
".",
"on",
"(",
"document",
",",
"\"mouseup\"",
",",
"this",
".",
"handleMouseUp",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"on",
"(",
"document",
",",
"\"mousemove\"",
",",
"this",
".",
"handleMouseMove",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"on",
"(",
"window",
",",
"\"unload\"",
",",
"this",
".",
"_onUnload",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"on",
"(",
"window",
",",
"\"resize\"",
",",
"this",
".",
"_onResize",
",",
"this",
",",
"true",
")",
";",
"// Event.on(window, \"mouseout\", this._test);",
"}"
]
| Drag and drop initialization. Sets up the global event handlers
@method _onLoad
@private
@static | [
"Drag",
"and",
"drop",
"initialization",
".",
"Sets",
"up",
"the",
"global",
"event",
"handlers"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L341-L352 |
|
43,091 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function(oDD, sGroup) {
if (!this.ids[sGroup]) {
this.ids[sGroup] = {};
}
var obj = this.ids[sGroup];
if (obj && obj[oDD.id]) {
delete obj[oDD.id];
}
} | javascript | function(oDD, sGroup) {
if (!this.ids[sGroup]) {
this.ids[sGroup] = {};
}
var obj = this.ids[sGroup];
if (obj && obj[oDD.id]) {
delete obj[oDD.id];
}
} | [
"function",
"(",
"oDD",
",",
"sGroup",
")",
"{",
"if",
"(",
"!",
"this",
".",
"ids",
"[",
"sGroup",
"]",
")",
"{",
"this",
".",
"ids",
"[",
"sGroup",
"]",
"=",
"{",
"}",
";",
"}",
"var",
"obj",
"=",
"this",
".",
"ids",
"[",
"sGroup",
"]",
";",
"if",
"(",
"obj",
"&&",
"obj",
"[",
"oDD",
".",
"id",
"]",
")",
"{",
"delete",
"obj",
"[",
"oDD",
".",
"id",
"]",
";",
"}",
"}"
]
| Removes the supplied dd instance from the supplied group. Executed
by DragDrop.removeFromGroup, so don't call this function directly.
@method removeDDFromGroup
@private
@static | [
"Removes",
"the",
"supplied",
"dd",
"instance",
"from",
"the",
"supplied",
"group",
".",
"Executed",
"by",
"DragDrop",
".",
"removeFromGroup",
"so",
"don",
"t",
"call",
"this",
"function",
"directly",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L496-L505 |
|
43,092 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function(oDD) {
for (var g in oDD.groups) {
if (g) {
var item = this.ids[g];
if (item && item[oDD.id]) {
delete item[oDD.id];
}
}
}
delete this.handleIds[oDD.id];
} | javascript | function(oDD) {
for (var g in oDD.groups) {
if (g) {
var item = this.ids[g];
if (item && item[oDD.id]) {
delete item[oDD.id];
}
}
}
delete this.handleIds[oDD.id];
} | [
"function",
"(",
"oDD",
")",
"{",
"for",
"(",
"var",
"g",
"in",
"oDD",
".",
"groups",
")",
"{",
"if",
"(",
"g",
")",
"{",
"var",
"item",
"=",
"this",
".",
"ids",
"[",
"g",
"]",
";",
"if",
"(",
"item",
"&&",
"item",
"[",
"oDD",
".",
"id",
"]",
")",
"{",
"delete",
"item",
"[",
"oDD",
".",
"id",
"]",
";",
"}",
"}",
"}",
"delete",
"this",
".",
"handleIds",
"[",
"oDD",
".",
"id",
"]",
";",
"}"
]
| Unregisters a drag and drop item. This is executed in
DragDrop.unreg, use that method instead of calling this directly.
@method _remove
@private
@static | [
"Unregisters",
"a",
"drag",
"and",
"drop",
"item",
".",
"This",
"is",
"executed",
"in",
"DragDrop",
".",
"unreg",
"use",
"that",
"method",
"instead",
"of",
"calling",
"this",
"directly",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L514-L525 |
|
43,093 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function(p_oDD, bTargetsOnly) {
var oDDs = [];
for (var i in p_oDD.groups) {
for (var j in this.ids[i]) {
var dd = this.ids[i][j];
if (! this.isTypeOfDD(dd)) {
continue;
}
if (!bTargetsOnly || dd.isTarget) {
oDDs[oDDs.length] = dd;
}
}
}
return oDDs;
} | javascript | function(p_oDD, bTargetsOnly) {
var oDDs = [];
for (var i in p_oDD.groups) {
for (var j in this.ids[i]) {
var dd = this.ids[i][j];
if (! this.isTypeOfDD(dd)) {
continue;
}
if (!bTargetsOnly || dd.isTarget) {
oDDs[oDDs.length] = dd;
}
}
}
return oDDs;
} | [
"function",
"(",
"p_oDD",
",",
"bTargetsOnly",
")",
"{",
"var",
"oDDs",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"in",
"p_oDD",
".",
"groups",
")",
"{",
"for",
"(",
"var",
"j",
"in",
"this",
".",
"ids",
"[",
"i",
"]",
")",
"{",
"var",
"dd",
"=",
"this",
".",
"ids",
"[",
"i",
"]",
"[",
"j",
"]",
";",
"if",
"(",
"!",
"this",
".",
"isTypeOfDD",
"(",
"dd",
")",
")",
"{",
"continue",
";",
"}",
"if",
"(",
"!",
"bTargetsOnly",
"||",
"dd",
".",
"isTarget",
")",
"{",
"oDDs",
"[",
"oDDs",
".",
"length",
"]",
"=",
"dd",
";",
"}",
"}",
"}",
"return",
"oDDs",
";",
"}"
]
| Returns the drag and drop instances that are in all groups the
passed in instance belongs to.
@method getRelated
@param {DragDrop} p_oDD the obj to get related data for
@param {boolean} bTargetsOnly if true, only return targetable objs
@return {DragDrop[]} the related instances
@static | [
"Returns",
"the",
"drag",
"and",
"drop",
"instances",
"that",
"are",
"in",
"all",
"groups",
"the",
"passed",
"in",
"instance",
"belongs",
"to",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L565-L580 |
|
43,094 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function (oDD, oTargetDD) {
var targets = this.getRelated(oDD, true);
for (var i=0, len=targets.length;i<len;++i) {
if (targets[i].id == oTargetDD.id) {
return true;
}
}
return false;
} | javascript | function (oDD, oTargetDD) {
var targets = this.getRelated(oDD, true);
for (var i=0, len=targets.length;i<len;++i) {
if (targets[i].id == oTargetDD.id) {
return true;
}
}
return false;
} | [
"function",
"(",
"oDD",
",",
"oTargetDD",
")",
"{",
"var",
"targets",
"=",
"this",
".",
"getRelated",
"(",
"oDD",
",",
"true",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"targets",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"if",
"(",
"targets",
"[",
"i",
"]",
".",
"id",
"==",
"oTargetDD",
".",
"id",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
"false",
";",
"}"
]
| Returns true if the specified dd target is a legal target for
the specifice drag obj
@method isLegalTarget
@param {DragDrop} the drag obj
@param {DragDrop} the target
@return {boolean} true if the target is a legal target for the
dd obj
@static | [
"Returns",
"true",
"if",
"the",
"specified",
"dd",
"target",
"is",
"a",
"legal",
"target",
"for",
"the",
"specifice",
"drag",
"obj"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L592-L601 |
|
43,095 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function(id) {
for (var i in this.ids) {
if (this.ids[i][id]) {
return this.ids[i][id];
}
}
return null;
} | javascript | function(id) {
for (var i in this.ids) {
if (this.ids[i][id]) {
return this.ids[i][id];
}
}
return null;
} | [
"function",
"(",
"id",
")",
"{",
"for",
"(",
"var",
"i",
"in",
"this",
".",
"ids",
")",
"{",
"if",
"(",
"this",
".",
"ids",
"[",
"i",
"]",
"[",
"id",
"]",
")",
"{",
"return",
"this",
".",
"ids",
"[",
"i",
"]",
"[",
"id",
"]",
";",
"}",
"}",
"return",
"null",
";",
"}"
]
| Returns the DragDrop instance for a given id
@method getDDById
@param {String} id the id of the DragDrop object
@return {DragDrop} the drag drop object, null if it is not found
@static | [
"Returns",
"the",
"DragDrop",
"instance",
"for",
"a",
"given",
"id"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L639-L646 |
|
43,096 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function(e, oDD) {
//this._activateShim();
this.currentTarget = YAHOO.util.Event.getTarget(e);
this.dragCurrent = oDD;
var el = oDD.getEl();
// track start position
this.startX = YAHOO.util.Event.getPageX(e);
this.startY = YAHOO.util.Event.getPageY(e);
this.deltaX = this.startX - el.offsetLeft;
this.deltaY = this.startY - el.offsetTop;
this.dragThreshMet = false;
this.clickTimeout = setTimeout(
function() {
var DDM = YAHOO.util.DDM;
DDM.startDrag(DDM.startX, DDM.startY);
DDM.fromTimeout = true;
},
this.clickTimeThresh );
} | javascript | function(e, oDD) {
//this._activateShim();
this.currentTarget = YAHOO.util.Event.getTarget(e);
this.dragCurrent = oDD;
var el = oDD.getEl();
// track start position
this.startX = YAHOO.util.Event.getPageX(e);
this.startY = YAHOO.util.Event.getPageY(e);
this.deltaX = this.startX - el.offsetLeft;
this.deltaY = this.startY - el.offsetTop;
this.dragThreshMet = false;
this.clickTimeout = setTimeout(
function() {
var DDM = YAHOO.util.DDM;
DDM.startDrag(DDM.startX, DDM.startY);
DDM.fromTimeout = true;
},
this.clickTimeThresh );
} | [
"function",
"(",
"e",
",",
"oDD",
")",
"{",
"//this._activateShim();",
"this",
".",
"currentTarget",
"=",
"YAHOO",
".",
"util",
".",
"Event",
".",
"getTarget",
"(",
"e",
")",
";",
"this",
".",
"dragCurrent",
"=",
"oDD",
";",
"var",
"el",
"=",
"oDD",
".",
"getEl",
"(",
")",
";",
"// track start position",
"this",
".",
"startX",
"=",
"YAHOO",
".",
"util",
".",
"Event",
".",
"getPageX",
"(",
"e",
")",
";",
"this",
".",
"startY",
"=",
"YAHOO",
".",
"util",
".",
"Event",
".",
"getPageY",
"(",
"e",
")",
";",
"this",
".",
"deltaX",
"=",
"this",
".",
"startX",
"-",
"el",
".",
"offsetLeft",
";",
"this",
".",
"deltaY",
"=",
"this",
".",
"startY",
"-",
"el",
".",
"offsetTop",
";",
"this",
".",
"dragThreshMet",
"=",
"false",
";",
"this",
".",
"clickTimeout",
"=",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"var",
"DDM",
"=",
"YAHOO",
".",
"util",
".",
"DDM",
";",
"DDM",
".",
"startDrag",
"(",
"DDM",
".",
"startX",
",",
"DDM",
".",
"startY",
")",
";",
"DDM",
".",
"fromTimeout",
"=",
"true",
";",
"}",
",",
"this",
".",
"clickTimeThresh",
")",
";",
"}"
]
| Fired after a registered DragDrop object gets the mousedown event.
Sets up the events required to track the object being dragged
@method handleMouseDown
@param {Event} e the event
@param oDD the DragDrop object being dragged
@private
@static | [
"Fired",
"after",
"a",
"registered",
"DragDrop",
"object",
"gets",
"the",
"mousedown",
"event",
".",
"Sets",
"up",
"the",
"events",
"required",
"to",
"track",
"the",
"object",
"being",
"dragged"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L657-L682 |
|
43,097 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function(x, y) {
if (this.dragCurrent && this.dragCurrent.useShim) {
this._shimState = this.useShim;
this.useShim = true;
}
this._activateShim();
YAHOO.log("firing drag start events", "info", "DragDropMgr");
clearTimeout(this.clickTimeout);
var dc = this.dragCurrent;
if (dc && dc.events.b4StartDrag) {
dc.b4StartDrag(x, y);
dc.fireEvent('b4StartDragEvent', { x: x, y: y });
}
if (dc && dc.events.startDrag) {
dc.startDrag(x, y);
dc.fireEvent('startDragEvent', { x: x, y: y });
}
this.dragThreshMet = true;
} | javascript | function(x, y) {
if (this.dragCurrent && this.dragCurrent.useShim) {
this._shimState = this.useShim;
this.useShim = true;
}
this._activateShim();
YAHOO.log("firing drag start events", "info", "DragDropMgr");
clearTimeout(this.clickTimeout);
var dc = this.dragCurrent;
if (dc && dc.events.b4StartDrag) {
dc.b4StartDrag(x, y);
dc.fireEvent('b4StartDragEvent', { x: x, y: y });
}
if (dc && dc.events.startDrag) {
dc.startDrag(x, y);
dc.fireEvent('startDragEvent', { x: x, y: y });
}
this.dragThreshMet = true;
} | [
"function",
"(",
"x",
",",
"y",
")",
"{",
"if",
"(",
"this",
".",
"dragCurrent",
"&&",
"this",
".",
"dragCurrent",
".",
"useShim",
")",
"{",
"this",
".",
"_shimState",
"=",
"this",
".",
"useShim",
";",
"this",
".",
"useShim",
"=",
"true",
";",
"}",
"this",
".",
"_activateShim",
"(",
")",
";",
"YAHOO",
".",
"log",
"(",
"\"firing drag start events\"",
",",
"\"info\"",
",",
"\"DragDropMgr\"",
")",
";",
"clearTimeout",
"(",
"this",
".",
"clickTimeout",
")",
";",
"var",
"dc",
"=",
"this",
".",
"dragCurrent",
";",
"if",
"(",
"dc",
"&&",
"dc",
".",
"events",
".",
"b4StartDrag",
")",
"{",
"dc",
".",
"b4StartDrag",
"(",
"x",
",",
"y",
")",
";",
"dc",
".",
"fireEvent",
"(",
"'b4StartDragEvent'",
",",
"{",
"x",
":",
"x",
",",
"y",
":",
"y",
"}",
")",
";",
"}",
"if",
"(",
"dc",
"&&",
"dc",
".",
"events",
".",
"startDrag",
")",
"{",
"dc",
".",
"startDrag",
"(",
"x",
",",
"y",
")",
";",
"dc",
".",
"fireEvent",
"(",
"'startDragEvent'",
",",
"{",
"x",
":",
"x",
",",
"y",
":",
"y",
"}",
")",
";",
"}",
"this",
".",
"dragThreshMet",
"=",
"true",
";",
"}"
]
| Fired when either the drag pixel threshold or the mousedown hold
time threshold has been met.
@method startDrag
@param x {int} the X position of the original mousedown
@param y {int} the Y position of the original mousedown
@static | [
"Fired",
"when",
"either",
"the",
"drag",
"pixel",
"threshold",
"or",
"the",
"mousedown",
"hold",
"time",
"threshold",
"has",
"been",
"met",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L692-L710 |
|
43,098 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function(e) {
if (this.dragCurrent) {
clearTimeout(this.clickTimeout);
if (this.dragThreshMet) {
YAHOO.log("mouseup detected - completing drag", "info", "DragDropMgr");
if (this.fromTimeout) {
YAHOO.log('fromTimeout is true (mouse didn\'t move), call handleMouseMove so we can get the dragOver event', 'info', 'DragDropMgr');
this.fromTimeout = false;
this.handleMouseMove(e);
}
this.fromTimeout = false;
this.fireEvents(e, true);
} else {
YAHOO.log("drag threshold not met", "info", "DragDropMgr");
}
this.stopDrag(e);
this.stopEvent(e);
}
} | javascript | function(e) {
if (this.dragCurrent) {
clearTimeout(this.clickTimeout);
if (this.dragThreshMet) {
YAHOO.log("mouseup detected - completing drag", "info", "DragDropMgr");
if (this.fromTimeout) {
YAHOO.log('fromTimeout is true (mouse didn\'t move), call handleMouseMove so we can get the dragOver event', 'info', 'DragDropMgr');
this.fromTimeout = false;
this.handleMouseMove(e);
}
this.fromTimeout = false;
this.fireEvents(e, true);
} else {
YAHOO.log("drag threshold not met", "info", "DragDropMgr");
}
this.stopDrag(e);
this.stopEvent(e);
}
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"this",
".",
"dragCurrent",
")",
"{",
"clearTimeout",
"(",
"this",
".",
"clickTimeout",
")",
";",
"if",
"(",
"this",
".",
"dragThreshMet",
")",
"{",
"YAHOO",
".",
"log",
"(",
"\"mouseup detected - completing drag\"",
",",
"\"info\"",
",",
"\"DragDropMgr\"",
")",
";",
"if",
"(",
"this",
".",
"fromTimeout",
")",
"{",
"YAHOO",
".",
"log",
"(",
"'fromTimeout is true (mouse didn\\'t move), call handleMouseMove so we can get the dragOver event'",
",",
"'info'",
",",
"'DragDropMgr'",
")",
";",
"this",
".",
"fromTimeout",
"=",
"false",
";",
"this",
".",
"handleMouseMove",
"(",
"e",
")",
";",
"}",
"this",
".",
"fromTimeout",
"=",
"false",
";",
"this",
".",
"fireEvents",
"(",
"e",
",",
"true",
")",
";",
"}",
"else",
"{",
"YAHOO",
".",
"log",
"(",
"\"drag threshold not met\"",
",",
"\"info\"",
",",
"\"DragDropMgr\"",
")",
";",
"}",
"this",
".",
"stopDrag",
"(",
"e",
")",
";",
"this",
".",
"stopEvent",
"(",
"e",
")",
";",
"}",
"}"
]
| Internal function to handle the mouseup event. Will be invoked
from the context of the document.
@method handleMouseUp
@param {Event} e the event
@private
@static | [
"Internal",
"function",
"to",
"handle",
"the",
"mouseup",
"event",
".",
"Will",
"be",
"invoked",
"from",
"the",
"context",
"of",
"the",
"document",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L720-L741 |
|
43,099 | neyric/webhookit | public/javascripts/yui/dragdrop/dragdrop-debug.js | function(e) {
if (this.stopPropagation) {
YAHOO.util.Event.stopPropagation(e);
}
if (this.preventDefault) {
YAHOO.util.Event.preventDefault(e);
}
} | javascript | function(e) {
if (this.stopPropagation) {
YAHOO.util.Event.stopPropagation(e);
}
if (this.preventDefault) {
YAHOO.util.Event.preventDefault(e);
}
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"this",
".",
"stopPropagation",
")",
"{",
"YAHOO",
".",
"util",
".",
"Event",
".",
"stopPropagation",
"(",
"e",
")",
";",
"}",
"if",
"(",
"this",
".",
"preventDefault",
")",
"{",
"YAHOO",
".",
"util",
".",
"Event",
".",
"preventDefault",
"(",
"e",
")",
";",
"}",
"}"
]
| Utility to stop event propagation and event default, if these
features are turned on.
@method stopEvent
@param {Event} e the event as returned by this.getEvent()
@static | [
"Utility",
"to",
"stop",
"event",
"propagation",
"and",
"event",
"default",
"if",
"these",
"features",
"are",
"turned",
"on",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/dragdrop/dragdrop-debug.js#L750-L758 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.