id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
42,400
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(name, value) { //we must jsonify this because Flash Player versions below 9.0.60 don't handle //complex ExternalInterface parsing correctly value = YAHOO.lang.JSON.stringify(value); this._swf.setStyle(name, value); }
javascript
function(name, value) { //we must jsonify this because Flash Player versions below 9.0.60 don't handle //complex ExternalInterface parsing correctly value = YAHOO.lang.JSON.stringify(value); this._swf.setStyle(name, value); }
[ "function", "(", "name", ",", "value", ")", "{", "//we must jsonify this because Flash Player versions below 9.0.60 don't handle", "//complex ExternalInterface parsing correctly", "value", "=", "YAHOO", ".", "lang", ".", "JSON", ".", "stringify", "(", "value", ")", ";", "this", ".", "_swf", ".", "setStyle", "(", "name", ",", "value", ")", ";", "}" ]
Sets a single style value on the Chart instance. @method setStyle @param name {String} Name of the Chart style value to change. @param value {Object} New value to pass to the Chart style.
[ "Sets", "a", "single", "style", "value", "on", "the", "Chart", "instance", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L256-L262
42,401
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(styles) { //we must jsonify this because Flash Player versions below 9.0.60 don't handle //complex ExternalInterface parsing correctly styles = YAHOO.lang.JSON.stringify(styles); this._swf.setStyles(styles); }
javascript
function(styles) { //we must jsonify this because Flash Player versions below 9.0.60 don't handle //complex ExternalInterface parsing correctly styles = YAHOO.lang.JSON.stringify(styles); this._swf.setStyles(styles); }
[ "function", "(", "styles", ")", "{", "//we must jsonify this because Flash Player versions below 9.0.60 don't handle", "//complex ExternalInterface parsing correctly", "styles", "=", "YAHOO", ".", "lang", ".", "JSON", ".", "stringify", "(", "styles", ")", ";", "this", ".", "_swf", ".", "setStyles", "(", "styles", ")", ";", "}" ]
Resets all styles on the Chart instance. @method setStyles @param styles {Object} Initializer for all Chart styles.
[ "Resets", "all", "styles", "on", "the", "Chart", "instance", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L270-L276
42,402
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(styles) { //we must jsonify this because Flash Player versions below 9.0.60 don't handle //complex ExternalInterface parsing correctly for(var i = 0; i < styles.length; i++) { styles[i] = YAHOO.lang.JSON.stringify(styles[i]); } this._swf.setSeriesStyles(styles); }
javascript
function(styles) { //we must jsonify this because Flash Player versions below 9.0.60 don't handle //complex ExternalInterface parsing correctly for(var i = 0; i < styles.length; i++) { styles[i] = YAHOO.lang.JSON.stringify(styles[i]); } this._swf.setSeriesStyles(styles); }
[ "function", "(", "styles", ")", "{", "//we must jsonify this because Flash Player versions below 9.0.60 don't handle", "//complex ExternalInterface parsing correctly", "for", "(", "var", "i", "=", "0", ";", "i", "<", "styles", ".", "length", ";", "i", "++", ")", "{", "styles", "[", "i", "]", "=", "YAHOO", ".", "lang", ".", "JSON", ".", "stringify", "(", "styles", "[", "i", "]", ")", ";", "}", "this", ".", "_swf", ".", "setSeriesStyles", "(", "styles", ")", ";", "}" ]
Sets the styles on all series in the Chart. @method setSeriesStyles @param styles {Array} Initializer for all Chart series styles.
[ "Sets", "the", "styles", "on", "all", "series", "in", "the", "Chart", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L284-L293
42,403
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(request, response, error) { if(this._swf) { if(error) { } else { var i; if(this._seriesFunctions) { var count = this._seriesFunctions.length; for(i = 0; i < count; i++) { YAHOO.widget.Chart.removeProxyFunction(this._seriesFunctions[i]); } this._seriesFunctions = null; } this._seriesFunctions = []; //make a copy of the series definitions so that we aren't //editing them directly. var dataProvider = []; var seriesCount = 0; var currentSeries = null; if(this._seriesDefs !== null) { seriesCount = this._seriesDefs.length; for(i = 0; i < seriesCount; i++) { currentSeries = this._seriesDefs[i]; var clonedSeries = {}; for(var prop in currentSeries) { if(YAHOO.lang.hasOwnProperty(currentSeries, prop)) { if(prop == "style") { if(currentSeries.style !== null) { clonedSeries.style = YAHOO.lang.JSON.stringify(currentSeries.style); } } else if(prop == "labelFunction") { if(currentSeries.labelFunction !== null) { clonedSeries.labelFunction = YAHOO.widget.Chart.getFunctionReference(currentSeries.labelFunction); this._seriesFunctions.push(clonedSeries.labelFunction); } } else if(prop == "dataTipFunction") { if(currentSeries.dataTipFunction !== null) { clonedSeries.dataTipFunction = YAHOO.widget.Chart.getFunctionReference(currentSeries.dataTipFunction); this._seriesFunctions.push(clonedSeries.dataTipFunction); } } else if(prop == "legendLabelFunction") { if(currentSeries.legendLabelFunction !== null) { clonedSeries.legendLabelFunction = YAHOO.widget.Chart.getFunctionReference(currentSeries.legendLabelFunction); this._seriesFunctions.push(clonedSeries.legendLabelFunction); } } else { clonedSeries[prop] = currentSeries[prop]; } } } dataProvider.push(clonedSeries); } } if(seriesCount > 0) { for(i = 0; i < seriesCount; i++) { currentSeries = dataProvider[i]; if(!currentSeries.type) { currentSeries.type = this._type; } currentSeries.dataProvider = response.results; } } else { var series = {type: this._type, dataProvider: response.results}; dataProvider.push(series); } try { if(this._swf.setDataProvider) this._swf.setDataProvider(dataProvider); } catch(e) { this._swf.setDataProvider(dataProvider); } } } }
javascript
function(request, response, error) { if(this._swf) { if(error) { } else { var i; if(this._seriesFunctions) { var count = this._seriesFunctions.length; for(i = 0; i < count; i++) { YAHOO.widget.Chart.removeProxyFunction(this._seriesFunctions[i]); } this._seriesFunctions = null; } this._seriesFunctions = []; //make a copy of the series definitions so that we aren't //editing them directly. var dataProvider = []; var seriesCount = 0; var currentSeries = null; if(this._seriesDefs !== null) { seriesCount = this._seriesDefs.length; for(i = 0; i < seriesCount; i++) { currentSeries = this._seriesDefs[i]; var clonedSeries = {}; for(var prop in currentSeries) { if(YAHOO.lang.hasOwnProperty(currentSeries, prop)) { if(prop == "style") { if(currentSeries.style !== null) { clonedSeries.style = YAHOO.lang.JSON.stringify(currentSeries.style); } } else if(prop == "labelFunction") { if(currentSeries.labelFunction !== null) { clonedSeries.labelFunction = YAHOO.widget.Chart.getFunctionReference(currentSeries.labelFunction); this._seriesFunctions.push(clonedSeries.labelFunction); } } else if(prop == "dataTipFunction") { if(currentSeries.dataTipFunction !== null) { clonedSeries.dataTipFunction = YAHOO.widget.Chart.getFunctionReference(currentSeries.dataTipFunction); this._seriesFunctions.push(clonedSeries.dataTipFunction); } } else if(prop == "legendLabelFunction") { if(currentSeries.legendLabelFunction !== null) { clonedSeries.legendLabelFunction = YAHOO.widget.Chart.getFunctionReference(currentSeries.legendLabelFunction); this._seriesFunctions.push(clonedSeries.legendLabelFunction); } } else { clonedSeries[prop] = currentSeries[prop]; } } } dataProvider.push(clonedSeries); } } if(seriesCount > 0) { for(i = 0; i < seriesCount; i++) { currentSeries = dataProvider[i]; if(!currentSeries.type) { currentSeries.type = this._type; } currentSeries.dataProvider = response.results; } } else { var series = {type: this._type, dataProvider: response.results}; dataProvider.push(series); } try { if(this._swf.setDataProvider) this._swf.setDataProvider(dataProvider); } catch(e) { this._swf.setDataProvider(dataProvider); } } } }
[ "function", "(", "request", ",", "response", ",", "error", ")", "{", "if", "(", "this", ".", "_swf", ")", "{", "if", "(", "error", ")", "{", "}", "else", "{", "var", "i", ";", "if", "(", "this", ".", "_seriesFunctions", ")", "{", "var", "count", "=", "this", ".", "_seriesFunctions", ".", "length", ";", "for", "(", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "YAHOO", ".", "widget", ".", "Chart", ".", "removeProxyFunction", "(", "this", ".", "_seriesFunctions", "[", "i", "]", ")", ";", "}", "this", ".", "_seriesFunctions", "=", "null", ";", "}", "this", ".", "_seriesFunctions", "=", "[", "]", ";", "//make a copy of the series definitions so that we aren't", "//editing them directly.", "var", "dataProvider", "=", "[", "]", ";", "var", "seriesCount", "=", "0", ";", "var", "currentSeries", "=", "null", ";", "if", "(", "this", ".", "_seriesDefs", "!==", "null", ")", "{", "seriesCount", "=", "this", ".", "_seriesDefs", ".", "length", ";", "for", "(", "i", "=", "0", ";", "i", "<", "seriesCount", ";", "i", "++", ")", "{", "currentSeries", "=", "this", ".", "_seriesDefs", "[", "i", "]", ";", "var", "clonedSeries", "=", "{", "}", ";", "for", "(", "var", "prop", "in", "currentSeries", ")", "{", "if", "(", "YAHOO", ".", "lang", ".", "hasOwnProperty", "(", "currentSeries", ",", "prop", ")", ")", "{", "if", "(", "prop", "==", "\"style\"", ")", "{", "if", "(", "currentSeries", ".", "style", "!==", "null", ")", "{", "clonedSeries", ".", "style", "=", "YAHOO", ".", "lang", ".", "JSON", ".", "stringify", "(", "currentSeries", ".", "style", ")", ";", "}", "}", "else", "if", "(", "prop", "==", "\"labelFunction\"", ")", "{", "if", "(", "currentSeries", ".", "labelFunction", "!==", "null", ")", "{", "clonedSeries", ".", "labelFunction", "=", "YAHOO", ".", "widget", ".", "Chart", ".", "getFunctionReference", "(", "currentSeries", ".", "labelFunction", ")", ";", "this", ".", "_seriesFunctions", ".", "push", "(", "clonedSeries", ".", "labelFunction", ")", ";", "}", "}", "else", "if", "(", "prop", "==", "\"dataTipFunction\"", ")", "{", "if", "(", "currentSeries", ".", "dataTipFunction", "!==", "null", ")", "{", "clonedSeries", ".", "dataTipFunction", "=", "YAHOO", ".", "widget", ".", "Chart", ".", "getFunctionReference", "(", "currentSeries", ".", "dataTipFunction", ")", ";", "this", ".", "_seriesFunctions", ".", "push", "(", "clonedSeries", ".", "dataTipFunction", ")", ";", "}", "}", "else", "if", "(", "prop", "==", "\"legendLabelFunction\"", ")", "{", "if", "(", "currentSeries", ".", "legendLabelFunction", "!==", "null", ")", "{", "clonedSeries", ".", "legendLabelFunction", "=", "YAHOO", ".", "widget", ".", "Chart", ".", "getFunctionReference", "(", "currentSeries", ".", "legendLabelFunction", ")", ";", "this", ".", "_seriesFunctions", ".", "push", "(", "clonedSeries", ".", "legendLabelFunction", ")", ";", "}", "}", "else", "{", "clonedSeries", "[", "prop", "]", "=", "currentSeries", "[", "prop", "]", ";", "}", "}", "}", "dataProvider", ".", "push", "(", "clonedSeries", ")", ";", "}", "}", "if", "(", "seriesCount", ">", "0", ")", "{", "for", "(", "i", "=", "0", ";", "i", "<", "seriesCount", ";", "i", "++", ")", "{", "currentSeries", "=", "dataProvider", "[", "i", "]", ";", "if", "(", "!", "currentSeries", ".", "type", ")", "{", "currentSeries", ".", "type", "=", "this", ".", "_type", ";", "}", "currentSeries", ".", "dataProvider", "=", "response", ".", "results", ";", "}", "}", "else", "{", "var", "series", "=", "{", "type", ":", "this", ".", "_type", ",", "dataProvider", ":", "response", ".", "results", "}", ";", "dataProvider", ".", "push", "(", "series", ")", ";", "}", "try", "{", "if", "(", "this", ".", "_swf", ".", "setDataProvider", ")", "this", ".", "_swf", ".", "setDataProvider", "(", "dataProvider", ")", ";", "}", "catch", "(", "e", ")", "{", "this", ".", "_swf", ".", "setDataProvider", "(", "dataProvider", ")", ";", "}", "}", "}", "}" ]
Called when the DataSource receives new data. The series definitions are used to build a data provider for the SWF chart. @method _loadDataHandler @private
[ "Called", "when", "the", "DataSource", "receives", "new", "data", ".", "The", "series", "definitions", "are", "used", "to", "build", "a", "data", "provider", "for", "the", "SWF", "chart", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L565-L674
42,404
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(value) { if(this._dataTipFunction) { YAHOO.widget.Chart.removeProxyFunction(this._dataTipFunction); } if(value) { this._dataTipFunction = value = YAHOO.widget.Chart.getFunctionReference(value); } this._swf.setDataTipFunction(value); }
javascript
function(value) { if(this._dataTipFunction) { YAHOO.widget.Chart.removeProxyFunction(this._dataTipFunction); } if(value) { this._dataTipFunction = value = YAHOO.widget.Chart.getFunctionReference(value); } this._swf.setDataTipFunction(value); }
[ "function", "(", "value", ")", "{", "if", "(", "this", ".", "_dataTipFunction", ")", "{", "YAHOO", ".", "widget", ".", "Chart", ".", "removeProxyFunction", "(", "this", ".", "_dataTipFunction", ")", ";", "}", "if", "(", "value", ")", "{", "this", ".", "_dataTipFunction", "=", "value", "=", "YAHOO", ".", "widget", ".", "Chart", ".", "getFunctionReference", "(", "value", ")", ";", "}", "this", ".", "_swf", ".", "setDataTipFunction", "(", "value", ")", ";", "}" ]
Setter for the dataTipFunction attribute. @method _setDataTipFunction @private
[ "Setter", "for", "the", "dataTipFunction", "attribute", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L797-L809
42,405
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(value) { if(this._legendLabelFunction) { YAHOO.widget.Chart.removeProxyFunction(this._legendLabelFunction); } if(value) { this._legendLabelFunction = value = YAHOO.widget.Chart.getFunctionReference(value); } this._swf.setLegendLabelFunction(value); }
javascript
function(value) { if(this._legendLabelFunction) { YAHOO.widget.Chart.removeProxyFunction(this._legendLabelFunction); } if(value) { this._legendLabelFunction = value = YAHOO.widget.Chart.getFunctionReference(value); } this._swf.setLegendLabelFunction(value); }
[ "function", "(", "value", ")", "{", "if", "(", "this", ".", "_legendLabelFunction", ")", "{", "YAHOO", ".", "widget", ".", "Chart", ".", "removeProxyFunction", "(", "this", ".", "_legendLabelFunction", ")", ";", "}", "if", "(", "value", ")", "{", "this", ".", "_legendLabelFunction", "=", "value", "=", "YAHOO", ".", "widget", ".", "Chart", ".", "getFunctionReference", "(", "value", ")", ";", "}", "this", ".", "_swf", ".", "setLegendLabelFunction", "(", "value", ")", ";", "}" ]
Setter for the legendLabelFunction attribute. @method _setLegendLabelFunction @private
[ "Setter", "for", "the", "legendLabelFunction", "attribute", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L817-L829
42,406
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(value) { var clonedAxis = {}; for(var prop in value) { if(prop == "labelFunction") { if(value.labelFunction && value.labelFunction !== null) { clonedAxis.labelFunction = YAHOO.widget.Chart.getFunctionReference(value.labelFunction); } } else { clonedAxis[prop] = value[prop]; } } return clonedAxis; }
javascript
function(value) { var clonedAxis = {}; for(var prop in value) { if(prop == "labelFunction") { if(value.labelFunction && value.labelFunction !== null) { clonedAxis.labelFunction = YAHOO.widget.Chart.getFunctionReference(value.labelFunction); } } else { clonedAxis[prop] = value[prop]; } } return clonedAxis; }
[ "function", "(", "value", ")", "{", "var", "clonedAxis", "=", "{", "}", ";", "for", "(", "var", "prop", "in", "value", ")", "{", "if", "(", "prop", "==", "\"labelFunction\"", ")", "{", "if", "(", "value", ".", "labelFunction", "&&", "value", ".", "labelFunction", "!==", "null", ")", "{", "clonedAxis", ".", "labelFunction", "=", "YAHOO", ".", "widget", ".", "Chart", ".", "getFunctionReference", "(", "value", ".", "labelFunction", ")", ";", "}", "}", "else", "{", "clonedAxis", "[", "prop", "]", "=", "value", "[", "prop", "]", ";", "}", "}", "return", "clonedAxis", ";", "}" ]
Receives an axis object, creates a proxy function for the labelFunction and returns the updated object. @method _getClonedAxis @private
[ "Receives", "an", "axis", "object", "creates", "a", "proxy", "function", "for", "the", "labelFunction", "and", "returns", "the", "updated", "object", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L1316-L1334
42,407
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(axisFunctions) { if(axisFunctions && axisFunctions.length > 0) { var len = axisFunctions.length; for(var i = 0; i < len; i++) { if(axisFunctions[i] !== null) { YAHOO.widget.Chart.removeProxyFunction(axisFunctions[i]); } } axisFunctions = []; } }
javascript
function(axisFunctions) { if(axisFunctions && axisFunctions.length > 0) { var len = axisFunctions.length; for(var i = 0; i < len; i++) { if(axisFunctions[i] !== null) { YAHOO.widget.Chart.removeProxyFunction(axisFunctions[i]); } } axisFunctions = []; } }
[ "function", "(", "axisFunctions", ")", "{", "if", "(", "axisFunctions", "&&", "axisFunctions", ".", "length", ">", "0", ")", "{", "var", "len", "=", "axisFunctions", ".", "length", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "axisFunctions", "[", "i", "]", "!==", "null", ")", "{", "YAHOO", ".", "widget", ".", "Chart", ".", "removeProxyFunction", "(", "axisFunctions", "[", "i", "]", ")", ";", "}", "}", "axisFunctions", "=", "[", "]", ";", "}", "}" ]
Removes axis functions contained in an array @method _removeAxisFunctions @private
[ "Removes", "axis", "functions", "contained", "in", "an", "array" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L1342-L1356
42,408
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(value) { if(value.position != "bottom" && value.position != "top") value.position = "bottom"; this._removeAxisFunctions(this._xAxisLabelFunctions); value = this._getClonedAxis(value); this._xAxisLabelFunctions.push(value.labelFunction); this._swf.setHorizontalAxis(value); }
javascript
function(value) { if(value.position != "bottom" && value.position != "top") value.position = "bottom"; this._removeAxisFunctions(this._xAxisLabelFunctions); value = this._getClonedAxis(value); this._xAxisLabelFunctions.push(value.labelFunction); this._swf.setHorizontalAxis(value); }
[ "function", "(", "value", ")", "{", "if", "(", "value", ".", "position", "!=", "\"bottom\"", "&&", "value", ".", "position", "!=", "\"top\"", ")", "value", ".", "position", "=", "\"bottom\"", ";", "this", ".", "_removeAxisFunctions", "(", "this", ".", "_xAxisLabelFunctions", ")", ";", "value", "=", "this", ".", "_getClonedAxis", "(", "value", ")", ";", "this", ".", "_xAxisLabelFunctions", ".", "push", "(", "value", ".", "labelFunction", ")", ";", "this", ".", "_swf", ".", "setHorizontalAxis", "(", "value", ")", ";", "}" ]
Setter for the xAxis attribute. @method _setXAxis @private
[ "Setter", "for", "the", "xAxis", "attribute", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L1364-L1371
42,409
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(value) { this._removeAxisFunctions(this._xAxisLabelFunctions); var len = value.length; for(var i = 0; i < len; i++) { if(value[i].position == "left") value[i].position = "bottom"; value[i] = this._getClonedAxis(value[i]); if(value[i].labelFunction) this._xAxisLabelFunctions.push(value[i].labelFunction); this._swf.setHorizontalAxis(value[i]); } }
javascript
function(value) { this._removeAxisFunctions(this._xAxisLabelFunctions); var len = value.length; for(var i = 0; i < len; i++) { if(value[i].position == "left") value[i].position = "bottom"; value[i] = this._getClonedAxis(value[i]); if(value[i].labelFunction) this._xAxisLabelFunctions.push(value[i].labelFunction); this._swf.setHorizontalAxis(value[i]); } }
[ "function", "(", "value", ")", "{", "this", ".", "_removeAxisFunctions", "(", "this", ".", "_xAxisLabelFunctions", ")", ";", "var", "len", "=", "value", ".", "length", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "value", "[", "i", "]", ".", "position", "==", "\"left\"", ")", "value", "[", "i", "]", ".", "position", "=", "\"bottom\"", ";", "value", "[", "i", "]", "=", "this", ".", "_getClonedAxis", "(", "value", "[", "i", "]", ")", ";", "if", "(", "value", "[", "i", "]", ".", "labelFunction", ")", "this", ".", "_xAxisLabelFunctions", ".", "push", "(", "value", "[", "i", "]", ".", "labelFunction", ")", ";", "this", ".", "_swf", ".", "setHorizontalAxis", "(", "value", "[", "i", "]", ")", ";", "}", "}" ]
Setter for the xAxes attribute @method _setXAxes @private
[ "Setter", "for", "the", "xAxes", "attribute" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L1379-L1390
42,410
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(value) { this._removeAxisFunctions(this._yAxisLabelFunctions); value = this._getClonedAxis(value); this._yAxisLabelFunctions.push(value.labelFunction); this._swf.setVerticalAxis(value); }
javascript
function(value) { this._removeAxisFunctions(this._yAxisLabelFunctions); value = this._getClonedAxis(value); this._yAxisLabelFunctions.push(value.labelFunction); this._swf.setVerticalAxis(value); }
[ "function", "(", "value", ")", "{", "this", ".", "_removeAxisFunctions", "(", "this", ".", "_yAxisLabelFunctions", ")", ";", "value", "=", "this", ".", "_getClonedAxis", "(", "value", ")", ";", "this", ".", "_yAxisLabelFunctions", ".", "push", "(", "value", ".", "labelFunction", ")", ";", "this", ".", "_swf", ".", "setVerticalAxis", "(", "value", ")", ";", "}" ]
Setter for the yAxis attribute. @method _setYAxis @private
[ "Setter", "for", "the", "yAxis", "attribute", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L1398-L1404
42,411
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(value) { this._removeAxisFunctions(this._yAxisLabelFunctions); var len = value.length; for(var i = 0; i < len; i++) { value[i] = this._getClonedAxis(value[i]); if(value[i].labelFunction) this._yAxisLabelFunctions.push(value[i].labelFunction); this._swf.setVerticalAxis(value[i]); } }
javascript
function(value) { this._removeAxisFunctions(this._yAxisLabelFunctions); var len = value.length; for(var i = 0; i < len; i++) { value[i] = this._getClonedAxis(value[i]); if(value[i].labelFunction) this._yAxisLabelFunctions.push(value[i].labelFunction); this._swf.setVerticalAxis(value[i]); } }
[ "function", "(", "value", ")", "{", "this", ".", "_removeAxisFunctions", "(", "this", ".", "_yAxisLabelFunctions", ")", ";", "var", "len", "=", "value", ".", "length", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "value", "[", "i", "]", "=", "this", ".", "_getClonedAxis", "(", "value", "[", "i", "]", ")", ";", "if", "(", "value", "[", "i", "]", ".", "labelFunction", ")", "this", ".", "_yAxisLabelFunctions", ".", "push", "(", "value", "[", "i", "]", ".", "labelFunction", ")", ";", "this", ".", "_swf", ".", "setVerticalAxis", "(", "value", "[", "i", "]", ")", ";", "}", "}" ]
Setter for the yAxes attribute. @method _setYAxes @private
[ "Setter", "for", "the", "yAxes", "attribute", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L1412-L1422
42,412
neyric/webhookit
public/javascripts/yui/charts/charts.js
function(index, style) { style = YAHOO.lang.JSON.stringify(style); if(this._swf && this._swf.setSeriesStylesByIndex) this._swf.setSeriesStylesByIndex(index, style); }
javascript
function(index, style) { style = YAHOO.lang.JSON.stringify(style); if(this._swf && this._swf.setSeriesStylesByIndex) this._swf.setSeriesStylesByIndex(index, style); }
[ "function", "(", "index", ",", "style", ")", "{", "style", "=", "YAHOO", ".", "lang", ".", "JSON", ".", "stringify", "(", "style", ")", ";", "if", "(", "this", ".", "_swf", "&&", "this", ".", "_swf", ".", "setSeriesStylesByIndex", ")", "this", ".", "_swf", ".", "setSeriesStylesByIndex", "(", "index", ",", "style", ")", ";", "}" ]
Sets the style object for a single series based on its index @method setSeriesStylesByIndex @param index {Number} The position within the series definition to apply the style @param style {object} Style object to be applied to the selected series
[ "Sets", "the", "style", "object", "for", "a", "single", "series", "based", "on", "its", "index" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/charts/charts.js#L1442-L1446
42,413
No9/chrome-fs
chrome.js
function (err, length, data) { if (err) { if (self.autoClose) { self.destroy() } self.emit('error', err) } self.push(data) // self.once('finish', self.close) }
javascript
function (err, length, data) { if (err) { if (self.autoClose) { self.destroy() } self.emit('error', err) } self.push(data) // self.once('finish', self.close) }
[ "function", "(", "err", ",", "length", ",", "data", ")", "{", "if", "(", "err", ")", "{", "if", "(", "self", ".", "autoClose", ")", "{", "self", ".", "destroy", "(", ")", "}", "self", ".", "emit", "(", "'error'", ",", "err", ")", "}", "self", ".", "push", "(", "data", ")", "// self.once('finish', self.close)", "}" ]
Sketchy implementation that pushes the whole file to the stream But maybe fd has a size that we can iterate to?
[ "Sketchy", "implementation", "that", "pushes", "the", "whole", "file", "to", "the", "stream", "But", "maybe", "fd", "has", "a", "size", "that", "we", "can", "iterate", "to?" ]
8662960c39945a5bdf32a61513bf05a8b51f9daf
https://github.com/No9/chrome-fs/blob/8662960c39945a5bdf32a61513bf05a8b51f9daf/chrome.js#L1047-L1056
42,414
neyric/webhookit
public/javascripts/yui/progressbar/progressbar.js
function(oConfigs) { Prog.superclass.constructor.call(this, document.createElement('div') , oConfigs); this._init(oConfigs); }
javascript
function(oConfigs) { Prog.superclass.constructor.call(this, document.createElement('div') , oConfigs); this._init(oConfigs); }
[ "function", "(", "oConfigs", ")", "{", "Prog", ".", "superclass", ".", "constructor", ".", "call", "(", "this", ",", "document", ".", "createElement", "(", "'div'", ")", ",", "oConfigs", ")", ";", "this", ".", "_init", "(", "oConfigs", ")", ";", "}" ]
The ProgressBar widget provides an easy way to draw a bar depicting progress of an operation, a level meter, rating or any such simple linear measure. It allows for highly customized styles including animation, vertical or horizontal and forward or reverse. @namespace YAHOO.widget @class ProgressBar @extends YAHOO.util.Element @param oConfigs {object} An object containing any configuration attributes to be set @constructor
[ "The", "ProgressBar", "widget", "provides", "an", "easy", "way", "to", "draw", "a", "bar", "depicting", "progress", "of", "an", "operation", "a", "level", "meter", "rating", "or", "any", "such", "simple", "linear", "measure", ".", "It", "allows", "for", "highly", "customized", "styles", "including", "animation", "vertical", "or", "horizontal", "and", "forward", "or", "reverse", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/progressbar/progressbar.js#L59-L64
42,415
neyric/webhookit
public/javascripts/yui/progressbar/progressbar.js
function(parent,before) { if (this._rendered) { return; } this._rendered = true; var direction = this.get(DIRECTION); // If the developer set a className attribute on initialization, // Element would have wiped out my own classNames // So I need to insist on them, plus add the one for direction. this.addClass(CLASS_PROGBAR); this.addClass(CLASS_PROGBAR + '-' + direction); var container = this.get('element'); container.tabIndex = 0; container.setAttribute('role','progressbar'); container.setAttribute('aria-valuemin',this.get(MIN_VALUE)); container.setAttribute('aria-valuemax',this.get(MAX_VALUE)); this.appendTo(parent,before); // I need to use the non-animated bar resizing function for initial redraw this._barSizeFunction = this._barSizeFunctions[0][direction]; this.redraw(); this._previousValue = this.get(VALUE); this._fixEdges(); // I can now set the correct bar resizer if (this.get(ANIM)) { this._barSizeFunction = this._barSizeFunctions[1][direction]; } this.on('minValueChange',this.redraw); this.on('maxValueChange',this.redraw); return this; }
javascript
function(parent,before) { if (this._rendered) { return; } this._rendered = true; var direction = this.get(DIRECTION); // If the developer set a className attribute on initialization, // Element would have wiped out my own classNames // So I need to insist on them, plus add the one for direction. this.addClass(CLASS_PROGBAR); this.addClass(CLASS_PROGBAR + '-' + direction); var container = this.get('element'); container.tabIndex = 0; container.setAttribute('role','progressbar'); container.setAttribute('aria-valuemin',this.get(MIN_VALUE)); container.setAttribute('aria-valuemax',this.get(MAX_VALUE)); this.appendTo(parent,before); // I need to use the non-animated bar resizing function for initial redraw this._barSizeFunction = this._barSizeFunctions[0][direction]; this.redraw(); this._previousValue = this.get(VALUE); this._fixEdges(); // I can now set the correct bar resizer if (this.get(ANIM)) { this._barSizeFunction = this._barSizeFunctions[1][direction]; } this.on('minValueChange',this.redraw); this.on('maxValueChange',this.redraw); return this; }
[ "function", "(", "parent", ",", "before", ")", "{", "if", "(", "this", ".", "_rendered", ")", "{", "return", ";", "}", "this", ".", "_rendered", "=", "true", ";", "var", "direction", "=", "this", ".", "get", "(", "DIRECTION", ")", ";", "// If the developer set a className attribute on initialization, ", "// Element would have wiped out my own classNames", "// So I need to insist on them, plus add the one for direction.", "this", ".", "addClass", "(", "CLASS_PROGBAR", ")", ";", "this", ".", "addClass", "(", "CLASS_PROGBAR", "+", "'-'", "+", "direction", ")", ";", "var", "container", "=", "this", ".", "get", "(", "'element'", ")", ";", "container", ".", "tabIndex", "=", "0", ";", "container", ".", "setAttribute", "(", "'role'", ",", "'progressbar'", ")", ";", "container", ".", "setAttribute", "(", "'aria-valuemin'", ",", "this", ".", "get", "(", "MIN_VALUE", ")", ")", ";", "container", ".", "setAttribute", "(", "'aria-valuemax'", ",", "this", ".", "get", "(", "MAX_VALUE", ")", ")", ";", "this", ".", "appendTo", "(", "parent", ",", "before", ")", ";", "// I need to use the non-animated bar resizing function for initial redraw", "this", ".", "_barSizeFunction", "=", "this", ".", "_barSizeFunctions", "[", "0", "]", "[", "direction", "]", ";", "this", ".", "redraw", "(", ")", ";", "this", ".", "_previousValue", "=", "this", ".", "get", "(", "VALUE", ")", ";", "this", ".", "_fixEdges", "(", ")", ";", "// I can now set the correct bar resizer", "if", "(", "this", ".", "get", "(", "ANIM", ")", ")", "{", "this", ".", "_barSizeFunction", "=", "this", ".", "_barSizeFunctions", "[", "1", "]", "[", "direction", "]", ";", "}", "this", ".", "on", "(", "'minValueChange'", ",", "this", ".", "redraw", ")", ";", "this", ".", "on", "(", "'maxValueChange'", ",", "this", ".", "redraw", ")", ";", "return", "this", ";", "}" ]
Renders the ProgressBar into the given container. If the container has other content, the ProgressBar will be appended to it. If the second argument is provided, the ProgressBar will be inserted before the given child. The method is chainable since it returns a reference to this instance. @method render @param el {HTML Element} HTML element that will contain the ProgressBar @param before {HTML Element} (optional) If present, the ProgressBar will be inserted before this element. @return {YAHOO.widget.ProgressBar} @chainable
[ "Renders", "the", "ProgressBar", "into", "the", "given", "container", ".", "If", "the", "container", "has", "other", "content", "the", "ProgressBar", "will", "be", "appended", "to", "it", ".", "If", "the", "second", "argument", "is", "provided", "the", "ProgressBar", "will", "be", "inserted", "before", "the", "given", "child", ".", "The", "method", "is", "chainable", "since", "it", "returns", "a", "reference", "to", "this", "instance", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/progressbar/progressbar.js#L334-L370
42,416
neyric/webhookit
public/javascripts/yui/progressbar/progressbar.js
function() { this.set(ANIM,false); this.unsubscribeAll(); var el = this.get('element'); if (el.parentNode) { el.parentNode.removeChild(el); } }
javascript
function() { this.set(ANIM,false); this.unsubscribeAll(); var el = this.get('element'); if (el.parentNode) { el.parentNode.removeChild(el); } }
[ "function", "(", ")", "{", "this", ".", "set", "(", "ANIM", ",", "false", ")", ";", "this", ".", "unsubscribeAll", "(", ")", ";", "var", "el", "=", "this", ".", "get", "(", "'element'", ")", ";", "if", "(", "el", ".", "parentNode", ")", "{", "el", ".", "parentNode", ".", "removeChild", "(", "el", ")", ";", "}", "}" ]
Destroys the ProgressBar, related objects and unsubscribes from all events @method destroy @return void
[ "Destroys", "the", "ProgressBar", "related", "objects", "and", "unsubscribes", "from", "all", "events" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/progressbar/progressbar.js#L387-L392
42,417
neyric/webhookit
public/javascripts/yui/progressbar/progressbar.js
function() { var barEl = this.get(BAR_EL); switch (this.get(DIRECTION)) { case DIRECTION_LTR: case DIRECTION_RTL: this._barSpace = parseInt(this.get(WIDTH),10) - (parseInt(Dom.getStyle(barEl,'marginLeft'),10) || 0) - (parseInt(Dom.getStyle(barEl,'marginRight'),10) || 0); break; case DIRECTION_TTB: case DIRECTION_BTT: this._barSpace = parseInt(this.get(HEIGHT),10) - (parseInt(Dom.getStyle(barEl,'marginTop'),10) || 0)- (parseInt(Dom.getStyle(barEl,'marginBottom'),10) || 0); break; } this._barFactor = this._barSpace / (this.get(MAX_VALUE) - (this.get(MIN_VALUE) || 0)) || 1; }
javascript
function() { var barEl = this.get(BAR_EL); switch (this.get(DIRECTION)) { case DIRECTION_LTR: case DIRECTION_RTL: this._barSpace = parseInt(this.get(WIDTH),10) - (parseInt(Dom.getStyle(barEl,'marginLeft'),10) || 0) - (parseInt(Dom.getStyle(barEl,'marginRight'),10) || 0); break; case DIRECTION_TTB: case DIRECTION_BTT: this._barSpace = parseInt(this.get(HEIGHT),10) - (parseInt(Dom.getStyle(barEl,'marginTop'),10) || 0)- (parseInt(Dom.getStyle(barEl,'marginBottom'),10) || 0); break; } this._barFactor = this._barSpace / (this.get(MAX_VALUE) - (this.get(MIN_VALUE) || 0)) || 1; }
[ "function", "(", ")", "{", "var", "barEl", "=", "this", ".", "get", "(", "BAR_EL", ")", ";", "switch", "(", "this", ".", "get", "(", "DIRECTION", ")", ")", "{", "case", "DIRECTION_LTR", ":", "case", "DIRECTION_RTL", ":", "this", ".", "_barSpace", "=", "parseInt", "(", "this", ".", "get", "(", "WIDTH", ")", ",", "10", ")", "-", "(", "parseInt", "(", "Dom", ".", "getStyle", "(", "barEl", ",", "'marginLeft'", ")", ",", "10", ")", "||", "0", ")", "-", "(", "parseInt", "(", "Dom", ".", "getStyle", "(", "barEl", ",", "'marginRight'", ")", ",", "10", ")", "||", "0", ")", ";", "break", ";", "case", "DIRECTION_TTB", ":", "case", "DIRECTION_BTT", ":", "this", ".", "_barSpace", "=", "parseInt", "(", "this", ".", "get", "(", "HEIGHT", ")", ",", "10", ")", "-", "(", "parseInt", "(", "Dom", ".", "getStyle", "(", "barEl", ",", "'marginTop'", ")", ",", "10", ")", "||", "0", ")", "-", "(", "parseInt", "(", "Dom", ".", "getStyle", "(", "barEl", ",", "'marginBottom'", ")", ",", "10", ")", "||", "0", ")", ";", "break", ";", "}", "this", ".", "_barFactor", "=", "this", ".", "_barSpace", "/", "(", "this", ".", "get", "(", "MAX_VALUE", ")", "-", "(", "this", ".", "get", "(", "MIN_VALUE", ")", "||", "0", ")", ")", "||", "1", ";", "}" ]
Calculates some auxiliary values to make the rendering faster @method _recalculateConstants @return void @private
[ "Calculates", "some", "auxiliary", "values", "to", "make", "the", "rendering", "faster" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/progressbar/progressbar.js#L504-L522
42,418
neyric/webhookit
public/javascripts/yui/progressbar/progressbar.js
function(value) { var container = this.get('element'), text = Lang.substitute(this.get(ARIA_TEXT_TEMPLATE),{ value:value, minValue:this.get(MIN_VALUE), maxValue:this.get(MAX_VALUE) }); container.setAttribute('aria-valuenow',value); container.setAttribute('aria-valuetext',text); }
javascript
function(value) { var container = this.get('element'), text = Lang.substitute(this.get(ARIA_TEXT_TEMPLATE),{ value:value, minValue:this.get(MIN_VALUE), maxValue:this.get(MAX_VALUE) }); container.setAttribute('aria-valuenow',value); container.setAttribute('aria-valuetext',text); }
[ "function", "(", "value", ")", "{", "var", "container", "=", "this", ".", "get", "(", "'element'", ")", ",", "text", "=", "Lang", ".", "substitute", "(", "this", ".", "get", "(", "ARIA_TEXT_TEMPLATE", ")", ",", "{", "value", ":", "value", ",", "minValue", ":", "this", ".", "get", "(", "MIN_VALUE", ")", ",", "maxValue", ":", "this", ".", "get", "(", "MAX_VALUE", ")", "}", ")", ";", "container", ".", "setAttribute", "(", "'aria-valuenow'", ",", "value", ")", ";", "container", ".", "setAttribute", "(", "'aria-valuetext'", ",", "text", ")", ";", "}" ]
Utility method to set the ARIA value attributes @method _setAriaText @return void @private
[ "Utility", "method", "to", "set", "the", "ARIA", "value", "attributes" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/progressbar/progressbar.js#L616-L626
42,419
neyric/webhookit
public/javascripts/yui/datasource/datasource.js
function (needle) { var path = null, keys = [], i = 0; if (needle) { // Strip the ["string keys"] and [1] array indexes needle = needle. replace(/\[(['"])(.*?)\1\]/g, function (x,$1,$2) {keys[i]=$2;return '.@'+(i++);}). replace(/\[(\d+)\]/g, function (x,$1) {keys[i]=parseInt($1,10)|0;return '.@'+(i++);}). replace(/^\./,''); // remove leading dot // If the cleaned needle contains invalid characters, the // path is invalid if (!/[^\w\.\$@]/.test(needle)) { path = needle.split('.'); for (i=path.length-1; i >= 0; --i) { if (path[i].charAt(0) === '@') { path[i] = keys[parseInt(path[i].substr(1),10)]; } } } else { } } return path; }
javascript
function (needle) { var path = null, keys = [], i = 0; if (needle) { // Strip the ["string keys"] and [1] array indexes needle = needle. replace(/\[(['"])(.*?)\1\]/g, function (x,$1,$2) {keys[i]=$2;return '.@'+(i++);}). replace(/\[(\d+)\]/g, function (x,$1) {keys[i]=parseInt($1,10)|0;return '.@'+(i++);}). replace(/^\./,''); // remove leading dot // If the cleaned needle contains invalid characters, the // path is invalid if (!/[^\w\.\$@]/.test(needle)) { path = needle.split('.'); for (i=path.length-1; i >= 0; --i) { if (path[i].charAt(0) === '@') { path[i] = keys[parseInt(path[i].substr(1),10)]; } } } else { } } return path; }
[ "function", "(", "needle", ")", "{", "var", "path", "=", "null", ",", "keys", "=", "[", "]", ",", "i", "=", "0", ";", "if", "(", "needle", ")", "{", "// Strip the [\"string keys\"] and [1] array indexes", "needle", "=", "needle", ".", "replace", "(", "/", "\\[(['\"])(.*?)\\1\\]", "/", "g", ",", "function", "(", "x", ",", "$1", ",", "$2", ")", "{", "keys", "[", "i", "]", "=", "$2", ";", "return", "'.@'", "+", "(", "i", "++", ")", ";", "}", ")", ".", "replace", "(", "/", "\\[(\\d+)\\]", "/", "g", ",", "function", "(", "x", ",", "$1", ")", "{", "keys", "[", "i", "]", "=", "parseInt", "(", "$1", ",", "10", ")", "|", "0", ";", "return", "'.@'", "+", "(", "i", "++", ")", ";", "}", ")", ".", "replace", "(", "/", "^\\.", "/", ",", "''", ")", ";", "// remove leading dot", "// If the cleaned needle contains invalid characters, the", "// path is invalid", "if", "(", "!", "/", "[^\\w\\.\\$@]", "/", ".", "test", "(", "needle", ")", ")", "{", "path", "=", "needle", ".", "split", "(", "'.'", ")", ";", "for", "(", "i", "=", "path", ".", "length", "-", "1", ";", "i", ">=", "0", ";", "--", "i", ")", "{", "if", "(", "path", "[", "i", "]", ".", "charAt", "(", "0", ")", "===", "'@'", ")", "{", "path", "[", "i", "]", "=", "keys", "[", "parseInt", "(", "path", "[", "i", "]", ".", "substr", "(", "1", ")", ",", "10", ")", "]", ";", "}", "}", "}", "else", "{", "}", "}", "return", "path", ";", "}" ]
Function to convert the schema's fields into walk paths
[ "Function", "to", "convert", "the", "schema", "s", "fields", "into", "walk", "paths" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datasource/datasource.js#L1551-L1576
42,420
neyric/webhookit
public/javascripts/yui/datasource/datasource.js
function(oRequest, oFullResponse) { var bError = false; var elTable = oFullResponse; var fields = this.responseSchema.fields; var oParsedResponse = {results:[]}; if(lang.isArray(fields)) { // Iterate through each TBODY for(var i=0; i<elTable.tBodies.length; i++) { var elTbody = elTable.tBodies[i]; // Iterate through each TR for(var j=elTbody.rows.length-1; j>-1; j--) { var elRow = elTbody.rows[j]; var oResult = {}; for(var k=fields.length-1; k>-1; k--) { var field = fields[k]; var key = (lang.isValue(field.key)) ? field.key : field; var data = elRow.cells[k].innerHTML; // Backward compatibility if(!field.parser && field.converter) { field.parser = field.converter; } var parser = (typeof field.parser === 'function') ? field.parser : DS.Parser[field.parser+'']; if(parser) { data = parser.call(this, data); } // Safety measure if(data === undefined) { data = null; } oResult[key] = data; } oParsedResponse.results[j] = oResult; } } } else { bError = true; } if(bError) { oParsedResponse.error = true; } else { } return oParsedResponse; }
javascript
function(oRequest, oFullResponse) { var bError = false; var elTable = oFullResponse; var fields = this.responseSchema.fields; var oParsedResponse = {results:[]}; if(lang.isArray(fields)) { // Iterate through each TBODY for(var i=0; i<elTable.tBodies.length; i++) { var elTbody = elTable.tBodies[i]; // Iterate through each TR for(var j=elTbody.rows.length-1; j>-1; j--) { var elRow = elTbody.rows[j]; var oResult = {}; for(var k=fields.length-1; k>-1; k--) { var field = fields[k]; var key = (lang.isValue(field.key)) ? field.key : field; var data = elRow.cells[k].innerHTML; // Backward compatibility if(!field.parser && field.converter) { field.parser = field.converter; } var parser = (typeof field.parser === 'function') ? field.parser : DS.Parser[field.parser+'']; if(parser) { data = parser.call(this, data); } // Safety measure if(data === undefined) { data = null; } oResult[key] = data; } oParsedResponse.results[j] = oResult; } } } else { bError = true; } if(bError) { oParsedResponse.error = true; } else { } return oParsedResponse; }
[ "function", "(", "oRequest", ",", "oFullResponse", ")", "{", "var", "bError", "=", "false", ";", "var", "elTable", "=", "oFullResponse", ";", "var", "fields", "=", "this", ".", "responseSchema", ".", "fields", ";", "var", "oParsedResponse", "=", "{", "results", ":", "[", "]", "}", ";", "if", "(", "lang", ".", "isArray", "(", "fields", ")", ")", "{", "// Iterate through each TBODY", "for", "(", "var", "i", "=", "0", ";", "i", "<", "elTable", ".", "tBodies", ".", "length", ";", "i", "++", ")", "{", "var", "elTbody", "=", "elTable", ".", "tBodies", "[", "i", "]", ";", "// Iterate through each TR", "for", "(", "var", "j", "=", "elTbody", ".", "rows", ".", "length", "-", "1", ";", "j", ">", "-", "1", ";", "j", "--", ")", "{", "var", "elRow", "=", "elTbody", ".", "rows", "[", "j", "]", ";", "var", "oResult", "=", "{", "}", ";", "for", "(", "var", "k", "=", "fields", ".", "length", "-", "1", ";", "k", ">", "-", "1", ";", "k", "--", ")", "{", "var", "field", "=", "fields", "[", "k", "]", ";", "var", "key", "=", "(", "lang", ".", "isValue", "(", "field", ".", "key", ")", ")", "?", "field", ".", "key", ":", "field", ";", "var", "data", "=", "elRow", ".", "cells", "[", "k", "]", ".", "innerHTML", ";", "// Backward compatibility", "if", "(", "!", "field", ".", "parser", "&&", "field", ".", "converter", ")", "{", "field", ".", "parser", "=", "field", ".", "converter", ";", "}", "var", "parser", "=", "(", "typeof", "field", ".", "parser", "===", "'function'", ")", "?", "field", ".", "parser", ":", "DS", ".", "Parser", "[", "field", ".", "parser", "+", "''", "]", ";", "if", "(", "parser", ")", "{", "data", "=", "parser", ".", "call", "(", "this", ",", "data", ")", ";", "}", "// Safety measure", "if", "(", "data", "===", "undefined", ")", "{", "data", "=", "null", ";", "}", "oResult", "[", "key", "]", "=", "data", ";", "}", "oParsedResponse", ".", "results", "[", "j", "]", "=", "oResult", ";", "}", "}", "}", "else", "{", "bError", "=", "true", ";", "}", "if", "(", "bError", ")", "{", "oParsedResponse", ".", "error", "=", "true", ";", "}", "else", "{", "}", "return", "oParsedResponse", ";", "}" ]
Overridable method parses an HTML TABLE element reference into a response object. Data is parsed out of TR elements from all TBODY elements. @method parseHTMLTableData @param oRequest {Object} Request object. @param oFullResponse {Object} The full HTML element reference from the live database. @return {Object} Parsed response object with the following properties<br> - results (Array) Array of parsed data results<br> - error (Boolean) True if there was an error
[ "Overridable", "method", "parses", "an", "HTML", "TABLE", "element", "reference", "into", "a", "response", "object", ".", "Data", "is", "parsed", "out", "of", "TR", "elements", "from", "all", "TBODY", "elements", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datasource/datasource.js#L1701-L1752
42,421
neyric/webhookit
public/javascripts/yui/datasource/datasource.js
function(oRequest, oCallback, oCaller) { var tId = DS._nTransactionId++; this.fireEvent("requestEvent", {tId:tId,request:oRequest,callback:oCallback,caller:oCaller}); // If there are no global pending requests, it is safe to purge global callback stack and global counter if(util.ScriptNodeDataSource._nPending === 0) { util.ScriptNodeDataSource.callbacks = []; util.ScriptNodeDataSource._nId = 0; } // ID for this request var id = util.ScriptNodeDataSource._nId; util.ScriptNodeDataSource._nId++; // Dynamically add handler function with a closure to the callback stack var oSelf = this; util.ScriptNodeDataSource.callbacks[id] = function(oRawResponse) { if((oSelf.asyncMode !== "ignoreStaleResponses")|| (id === util.ScriptNodeDataSource.callbacks.length-1)) { // Must ignore stale responses // Try to sniff data type if it has not been defined if(oSelf.responseType === DS.TYPE_UNKNOWN) { if(YAHOO.lang.isArray(oRawResponse)) { // array oSelf.responseType = DS.TYPE_JSARRAY; } // xml else if(oRawResponse.nodeType && oRawResponse.nodeType == 9) { oSelf.responseType = DS.TYPE_XML; } else if(oRawResponse.nodeName && (oRawResponse.nodeName.toLowerCase() == "table")) { // table oSelf.responseType = DS.TYPE_HTMLTABLE; } else if(YAHOO.lang.isObject(oRawResponse)) { // json oSelf.responseType = DS.TYPE_JSON; } else if(YAHOO.lang.isString(oRawResponse)) { // text oSelf.responseType = DS.TYPE_TEXT; } } oSelf.handleResponse(oRequest, oRawResponse, oCallback, oCaller, tId); } else { } delete util.ScriptNodeDataSource.callbacks[id]; }; // We are now creating a request util.ScriptNodeDataSource._nPending++; var sUri = this.liveData + oRequest + this.generateRequestCallback(id); sUri = this.doBeforeGetScriptNode(sUri); this.getUtility.script(sUri, {autopurge: true, onsuccess: util.ScriptNodeDataSource._bumpPendingDown, onfail: util.ScriptNodeDataSource._bumpPendingDown}); return tId; }
javascript
function(oRequest, oCallback, oCaller) { var tId = DS._nTransactionId++; this.fireEvent("requestEvent", {tId:tId,request:oRequest,callback:oCallback,caller:oCaller}); // If there are no global pending requests, it is safe to purge global callback stack and global counter if(util.ScriptNodeDataSource._nPending === 0) { util.ScriptNodeDataSource.callbacks = []; util.ScriptNodeDataSource._nId = 0; } // ID for this request var id = util.ScriptNodeDataSource._nId; util.ScriptNodeDataSource._nId++; // Dynamically add handler function with a closure to the callback stack var oSelf = this; util.ScriptNodeDataSource.callbacks[id] = function(oRawResponse) { if((oSelf.asyncMode !== "ignoreStaleResponses")|| (id === util.ScriptNodeDataSource.callbacks.length-1)) { // Must ignore stale responses // Try to sniff data type if it has not been defined if(oSelf.responseType === DS.TYPE_UNKNOWN) { if(YAHOO.lang.isArray(oRawResponse)) { // array oSelf.responseType = DS.TYPE_JSARRAY; } // xml else if(oRawResponse.nodeType && oRawResponse.nodeType == 9) { oSelf.responseType = DS.TYPE_XML; } else if(oRawResponse.nodeName && (oRawResponse.nodeName.toLowerCase() == "table")) { // table oSelf.responseType = DS.TYPE_HTMLTABLE; } else if(YAHOO.lang.isObject(oRawResponse)) { // json oSelf.responseType = DS.TYPE_JSON; } else if(YAHOO.lang.isString(oRawResponse)) { // text oSelf.responseType = DS.TYPE_TEXT; } } oSelf.handleResponse(oRequest, oRawResponse, oCallback, oCaller, tId); } else { } delete util.ScriptNodeDataSource.callbacks[id]; }; // We are now creating a request util.ScriptNodeDataSource._nPending++; var sUri = this.liveData + oRequest + this.generateRequestCallback(id); sUri = this.doBeforeGetScriptNode(sUri); this.getUtility.script(sUri, {autopurge: true, onsuccess: util.ScriptNodeDataSource._bumpPendingDown, onfail: util.ScriptNodeDataSource._bumpPendingDown}); return tId; }
[ "function", "(", "oRequest", ",", "oCallback", ",", "oCaller", ")", "{", "var", "tId", "=", "DS", ".", "_nTransactionId", "++", ";", "this", ".", "fireEvent", "(", "\"requestEvent\"", ",", "{", "tId", ":", "tId", ",", "request", ":", "oRequest", ",", "callback", ":", "oCallback", ",", "caller", ":", "oCaller", "}", ")", ";", "// If there are no global pending requests, it is safe to purge global callback stack and global counter", "if", "(", "util", ".", "ScriptNodeDataSource", ".", "_nPending", "===", "0", ")", "{", "util", ".", "ScriptNodeDataSource", ".", "callbacks", "=", "[", "]", ";", "util", ".", "ScriptNodeDataSource", ".", "_nId", "=", "0", ";", "}", "// ID for this request", "var", "id", "=", "util", ".", "ScriptNodeDataSource", ".", "_nId", ";", "util", ".", "ScriptNodeDataSource", ".", "_nId", "++", ";", "// Dynamically add handler function with a closure to the callback stack", "var", "oSelf", "=", "this", ";", "util", ".", "ScriptNodeDataSource", ".", "callbacks", "[", "id", "]", "=", "function", "(", "oRawResponse", ")", "{", "if", "(", "(", "oSelf", ".", "asyncMode", "!==", "\"ignoreStaleResponses\"", ")", "||", "(", "id", "===", "util", ".", "ScriptNodeDataSource", ".", "callbacks", ".", "length", "-", "1", ")", ")", "{", "// Must ignore stale responses", "// Try to sniff data type if it has not been defined", "if", "(", "oSelf", ".", "responseType", "===", "DS", ".", "TYPE_UNKNOWN", ")", "{", "if", "(", "YAHOO", ".", "lang", ".", "isArray", "(", "oRawResponse", ")", ")", "{", "// array", "oSelf", ".", "responseType", "=", "DS", ".", "TYPE_JSARRAY", ";", "}", "// xml", "else", "if", "(", "oRawResponse", ".", "nodeType", "&&", "oRawResponse", ".", "nodeType", "==", "9", ")", "{", "oSelf", ".", "responseType", "=", "DS", ".", "TYPE_XML", ";", "}", "else", "if", "(", "oRawResponse", ".", "nodeName", "&&", "(", "oRawResponse", ".", "nodeName", ".", "toLowerCase", "(", ")", "==", "\"table\"", ")", ")", "{", "// table", "oSelf", ".", "responseType", "=", "DS", ".", "TYPE_HTMLTABLE", ";", "}", "else", "if", "(", "YAHOO", ".", "lang", ".", "isObject", "(", "oRawResponse", ")", ")", "{", "// json", "oSelf", ".", "responseType", "=", "DS", ".", "TYPE_JSON", ";", "}", "else", "if", "(", "YAHOO", ".", "lang", ".", "isString", "(", "oRawResponse", ")", ")", "{", "// text", "oSelf", ".", "responseType", "=", "DS", ".", "TYPE_TEXT", ";", "}", "}", "oSelf", ".", "handleResponse", "(", "oRequest", ",", "oRawResponse", ",", "oCallback", ",", "oCaller", ",", "tId", ")", ";", "}", "else", "{", "}", "delete", "util", ".", "ScriptNodeDataSource", ".", "callbacks", "[", "id", "]", ";", "}", ";", "// We are now creating a request", "util", ".", "ScriptNodeDataSource", ".", "_nPending", "++", ";", "var", "sUri", "=", "this", ".", "liveData", "+", "oRequest", "+", "this", ".", "generateRequestCallback", "(", "id", ")", ";", "sUri", "=", "this", ".", "doBeforeGetScriptNode", "(", "sUri", ")", ";", "this", ".", "getUtility", ".", "script", "(", "sUri", ",", "{", "autopurge", ":", "true", ",", "onsuccess", ":", "util", ".", "ScriptNodeDataSource", ".", "_bumpPendingDown", ",", "onfail", ":", "util", ".", "ScriptNodeDataSource", ".", "_bumpPendingDown", "}", ")", ";", "return", "tId", ";", "}" ]
Overriding method passes query to Get Utility. The returned response is then forwarded to the handleResponse function. @method makeConnection @param oRequest {Object} Request object. @param oCallback {Object} Callback object literal. @param oCaller {Object} (deprecated) Use oCallback.scope. @return {Number} Transaction ID.
[ "Overriding", "method", "passes", "query", "to", "Get", "Utility", ".", "The", "returned", "response", "is", "then", "forwarded", "to", "the", "handleResponse", "function", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datasource/datasource.js#L2044-L2102
42,422
neyric/webhookit
public/javascripts/inputex/js/fields/MenuField.js
function() { // Div to display the invite, then the selected text this.el = inputEx.cn('div', {className:'inputEx-Result'}, null, this.options.typeInvite); YAHOO.util.Dom.addClass(this.el, (this.options.menuPosition[1] == "tr") ? "inputEx-RightArrow" : "inputEx-DownArrow"); this.fieldContainer.appendChild(this.el); // Keep selected value in a hidden field this.hiddenEl = inputEx.cn('input', {type: 'hidden', name: this.options.name || '', value: this.options.value || ''}); this.fieldContainer.appendChild(this.hiddenEl); // Init Menu this.initMenu(); }
javascript
function() { // Div to display the invite, then the selected text this.el = inputEx.cn('div', {className:'inputEx-Result'}, null, this.options.typeInvite); YAHOO.util.Dom.addClass(this.el, (this.options.menuPosition[1] == "tr") ? "inputEx-RightArrow" : "inputEx-DownArrow"); this.fieldContainer.appendChild(this.el); // Keep selected value in a hidden field this.hiddenEl = inputEx.cn('input', {type: 'hidden', name: this.options.name || '', value: this.options.value || ''}); this.fieldContainer.appendChild(this.hiddenEl); // Init Menu this.initMenu(); }
[ "function", "(", ")", "{", "// Div to display the invite, then the selected text", "this", ".", "el", "=", "inputEx", ".", "cn", "(", "'div'", ",", "{", "className", ":", "'inputEx-Result'", "}", ",", "null", ",", "this", ".", "options", ".", "typeInvite", ")", ";", "YAHOO", ".", "util", ".", "Dom", ".", "addClass", "(", "this", ".", "el", ",", "(", "this", ".", "options", ".", "menuPosition", "[", "1", "]", "==", "\"tr\"", ")", "?", "\"inputEx-RightArrow\"", ":", "\"inputEx-DownArrow\"", ")", ";", "this", ".", "fieldContainer", ".", "appendChild", "(", "this", ".", "el", ")", ";", "// Keep selected value in a hidden field", "this", ".", "hiddenEl", "=", "inputEx", ".", "cn", "(", "'input'", ",", "{", "type", ":", "'hidden'", ",", "name", ":", "this", ".", "options", ".", "name", "||", "''", ",", "value", ":", "this", ".", "options", ".", "value", "||", "''", "}", ")", ";", "this", ".", "fieldContainer", ".", "appendChild", "(", "this", ".", "hiddenEl", ")", ";", "// Init Menu", "this", ".", "initMenu", "(", ")", ";", "}" ]
Build a menu
[ "Build", "a", "menu" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/MenuField.js#L48-L61
42,423
neyric/webhookit
public/javascripts/inputex/js/fields/MenuField.js
function() { // Keep corresponding text for each value selectable in the menu // -> will be used to display selection after click this._textFromValue = {}; var that = this; /* * Recursive function to edit a level of menuItems * * args : * -> conf : an array of menuItems * -> level : how deeply nested are these menuItems (4 is max) */ var levelInit = function (conf,level) { if (level>4) throw new Error("MenuField : too much recursion, menuItems property should be 5 level deep at most."); var item; for (var i=0, length = conf.length; i < length; i++) { item = conf[i]; if (YAHOO.lang.isUndefined(item.text) && !YAHOO.lang.isUndefined(item.value)) { item.text = item.value; } if (YAHOO.lang.isUndefined(item.value) && !YAHOO.lang.isUndefined(item.text)) { item.value = item.text; } // item with submenu // -> explore deeper if (!YAHOO.lang.isUndefined(item.submenu)) { // ensure there is an id on submenu (else submenu is not created) if (YAHOO.lang.isUndefined(item.submenu.id)) { item.submenu.id = YAHOO.util.Dom.generateId(); } // continue one level deeper levelInit(item.submenu.itemdata,level+1); // item without submenu // -> add click listener to this item // -> pass selected value to the listener (as the 3rd argument) } else { that._textFromValue[item.value] = item.text; item.onclick = {fn:function() {that.onItemClick.apply(that,arguments);},obj:item.value}; } } }; levelInit(this.options.menuItems,0); }
javascript
function() { // Keep corresponding text for each value selectable in the menu // -> will be used to display selection after click this._textFromValue = {}; var that = this; /* * Recursive function to edit a level of menuItems * * args : * -> conf : an array of menuItems * -> level : how deeply nested are these menuItems (4 is max) */ var levelInit = function (conf,level) { if (level>4) throw new Error("MenuField : too much recursion, menuItems property should be 5 level deep at most."); var item; for (var i=0, length = conf.length; i < length; i++) { item = conf[i]; if (YAHOO.lang.isUndefined(item.text) && !YAHOO.lang.isUndefined(item.value)) { item.text = item.value; } if (YAHOO.lang.isUndefined(item.value) && !YAHOO.lang.isUndefined(item.text)) { item.value = item.text; } // item with submenu // -> explore deeper if (!YAHOO.lang.isUndefined(item.submenu)) { // ensure there is an id on submenu (else submenu is not created) if (YAHOO.lang.isUndefined(item.submenu.id)) { item.submenu.id = YAHOO.util.Dom.generateId(); } // continue one level deeper levelInit(item.submenu.itemdata,level+1); // item without submenu // -> add click listener to this item // -> pass selected value to the listener (as the 3rd argument) } else { that._textFromValue[item.value] = item.text; item.onclick = {fn:function() {that.onItemClick.apply(that,arguments);},obj:item.value}; } } }; levelInit(this.options.menuItems,0); }
[ "function", "(", ")", "{", "// Keep corresponding text for each value selectable in the menu", "// -> will be used to display selection after click", "this", ".", "_textFromValue", "=", "{", "}", ";", "var", "that", "=", "this", ";", "/*\n\t * Recursive function to edit a level of menuItems\n\t *\n\t * args :\n\t * -> conf : an array of menuItems\n\t * -> level : how deeply nested are these menuItems (4 is max)\n\t */", "var", "levelInit", "=", "function", "(", "conf", ",", "level", ")", "{", "if", "(", "level", ">", "4", ")", "throw", "new", "Error", "(", "\"MenuField : too much recursion, menuItems property should be 5 level deep at most.\"", ")", ";", "var", "item", ";", "for", "(", "var", "i", "=", "0", ",", "length", "=", "conf", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "item", "=", "conf", "[", "i", "]", ";", "if", "(", "YAHOO", ".", "lang", ".", "isUndefined", "(", "item", ".", "text", ")", "&&", "!", "YAHOO", ".", "lang", ".", "isUndefined", "(", "item", ".", "value", ")", ")", "{", "item", ".", "text", "=", "item", ".", "value", ";", "}", "if", "(", "YAHOO", ".", "lang", ".", "isUndefined", "(", "item", ".", "value", ")", "&&", "!", "YAHOO", ".", "lang", ".", "isUndefined", "(", "item", ".", "text", ")", ")", "{", "item", ".", "value", "=", "item", ".", "text", ";", "}", "// item with submenu", "// -> explore deeper", "if", "(", "!", "YAHOO", ".", "lang", ".", "isUndefined", "(", "item", ".", "submenu", ")", ")", "{", "// ensure there is an id on submenu (else submenu is not created)", "if", "(", "YAHOO", ".", "lang", ".", "isUndefined", "(", "item", ".", "submenu", ".", "id", ")", ")", "{", "item", ".", "submenu", ".", "id", "=", "YAHOO", ".", "util", ".", "Dom", ".", "generateId", "(", ")", ";", "}", "// continue one level deeper", "levelInit", "(", "item", ".", "submenu", ".", "itemdata", ",", "level", "+", "1", ")", ";", "// item without submenu", "// -> add click listener to this item", "// -> pass selected value to the listener (as the 3rd argument)", "}", "else", "{", "that", ".", "_textFromValue", "[", "item", ".", "value", "]", "=", "item", ".", "text", ";", "item", ".", "onclick", "=", "{", "fn", ":", "function", "(", ")", "{", "that", ".", "onItemClick", ".", "apply", "(", "that", ",", "arguments", ")", ";", "}", ",", "obj", ":", "item", ".", "value", "}", ";", "}", "}", "}", ";", "levelInit", "(", "this", ".", "options", ".", "menuItems", ",", "0", ")", ";", "}" ]
Parse menuItems option to add ids, listeners, etc.
[ "Parse", "menuItems", "option", "to", "add", "ids", "listeners", "etc", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/MenuField.js#L65-L117
42,424
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function(fn, obj, overrideContext) { if (!fn) { throw new Error("Invalid callback for subscriber to '" + this.type + "'"); } if (this.subscribeEvent) { this.subscribeEvent.fire(fn, obj, overrideContext); } var s = new YAHOO.util.Subscriber(fn, obj, overrideContext); if (this.fireOnce && this.fired) { this.notify(s, this.firedWith); } else { this.subscribers.push(s); } }
javascript
function(fn, obj, overrideContext) { if (!fn) { throw new Error("Invalid callback for subscriber to '" + this.type + "'"); } if (this.subscribeEvent) { this.subscribeEvent.fire(fn, obj, overrideContext); } var s = new YAHOO.util.Subscriber(fn, obj, overrideContext); if (this.fireOnce && this.fired) { this.notify(s, this.firedWith); } else { this.subscribers.push(s); } }
[ "function", "(", "fn", ",", "obj", ",", "overrideContext", ")", "{", "if", "(", "!", "fn", ")", "{", "throw", "new", "Error", "(", "\"Invalid callback for subscriber to '\"", "+", "this", ".", "type", "+", "\"'\"", ")", ";", "}", "if", "(", "this", ".", "subscribeEvent", ")", "{", "this", ".", "subscribeEvent", ".", "fire", "(", "fn", ",", "obj", ",", "overrideContext", ")", ";", "}", "var", "s", "=", "new", "YAHOO", ".", "util", ".", "Subscriber", "(", "fn", ",", "obj", ",", "overrideContext", ")", ";", "if", "(", "this", ".", "fireOnce", "&&", "this", ".", "fired", ")", "{", "this", ".", "notify", "(", "s", ",", "this", ".", "firedWith", ")", ";", "}", "else", "{", "this", ".", "subscribers", ".", "push", "(", "s", ")", ";", "}", "}" ]
Subscribes the caller to this event @method subscribe @param {Function} fn The function to execute @param {Object} obj An object to be passed along when the event fires. overrideContext <boolean|Object> If true, the obj passed in becomes the execution context of the listener. If an object, that object becomes the execution context.
[ "Subscribes", "the", "caller", "to", "this", "event" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L184-L201
42,425
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function(fn, obj) { if (!fn) { return this.unsubscribeAll(); } var found = false; for (var i=0, len=this.subscribers.length; i<len; ++i) { var s = this.subscribers[i]; if (s && s.contains(fn, obj)) { this._delete(i); found = true; } } return found; }
javascript
function(fn, obj) { if (!fn) { return this.unsubscribeAll(); } var found = false; for (var i=0, len=this.subscribers.length; i<len; ++i) { var s = this.subscribers[i]; if (s && s.contains(fn, obj)) { this._delete(i); found = true; } } return found; }
[ "function", "(", "fn", ",", "obj", ")", "{", "if", "(", "!", "fn", ")", "{", "return", "this", ".", "unsubscribeAll", "(", ")", ";", "}", "var", "found", "=", "false", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "this", ".", "subscribers", ".", "length", ";", "i", "<", "len", ";", "++", "i", ")", "{", "var", "s", "=", "this", ".", "subscribers", "[", "i", "]", ";", "if", "(", "s", "&&", "s", ".", "contains", "(", "fn", ",", "obj", ")", ")", "{", "this", ".", "_delete", "(", "i", ")", ";", "found", "=", "true", ";", "}", "}", "return", "found", ";", "}" ]
Unsubscribes subscribers. @method unsubscribe @param {Function} fn The subscribed function to remove, if not supplied all will be removed @param {Object} obj The custom object passed to subscribe. This is optional, but if supplied will be used to disambiguate multiple listeners that are the same (e.g., you subscribe many object using a function that lives on the prototype) @return {boolean} True if the subscriber was found and detached.
[ "Unsubscribes", "subscribers", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L215-L231
42,426
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function() { var l = this.subscribers.length, i; for (i=l-1; i>-1; i--) { this._delete(i); } this.subscribers=[]; return l; }
javascript
function() { var l = this.subscribers.length, i; for (i=l-1; i>-1; i--) { this._delete(i); } this.subscribers=[]; return l; }
[ "function", "(", ")", "{", "var", "l", "=", "this", ".", "subscribers", ".", "length", ",", "i", ";", "for", "(", "i", "=", "l", "-", "1", ";", "i", ">", "-", "1", ";", "i", "--", ")", "{", "this", ".", "_delete", "(", "i", ")", ";", "}", "this", ".", "subscribers", "=", "[", "]", ";", "return", "l", ";", "}" ]
Removes all listeners @method unsubscribeAll @return {int} The number of listeners unsubscribed
[ "Removes", "all", "listeners" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L352-L361
42,427
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function(e) { return fn.call(context, YAHOO.util.Event.getEvent(e, el), obj); }
javascript
function(e) { return fn.call(context, YAHOO.util.Event.getEvent(e, el), obj); }
[ "function", "(", "e", ")", "{", "return", "fn", ".", "call", "(", "context", ",", "YAHOO", ".", "util", ".", "Event", ".", "getEvent", "(", "e", ",", "el", ")", ",", "obj", ")", ";", "}" ]
wrap the function so we can return the obj object when the event fires;
[ "wrap", "the", "function", "so", "we", "can", "return", "the", "obj", "object", "when", "the", "event", "fires", ";" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L990-L993
42,428
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function (el, fn, obj, overrideContext) { return this.on(el, FOCUSOUT, fn, obj, overrideContext); }
javascript
function (el, fn, obj, overrideContext) { return this.on(el, FOCUSOUT, fn, obj, overrideContext); }
[ "function", "(", "el", ",", "fn", ",", "obj", ",", "overrideContext", ")", "{", "return", "this", ".", "on", "(", "el", ",", "FOCUSOUT", ",", "fn", ",", "obj", ",", "overrideContext", ")", ";", "}" ]
Attaches a focusout event listener to the specified element for the purpose of listening for the blur event on the element's descendants. @method addBlurListener @param {String|HTMLElement|Array|NodeList} el An id, an element reference, or a collection of ids and/or elements to assign the listener to. @param {Function} fn The method the event invokes @param {Object} obj An arbitrary object that will be passed as a parameter to the handler @param {Boolean|object} overrideContext If true, the obj passed in becomes the execution context of the listener. If an object, this object becomes the execution context. @return {Boolean} True if the action was successful or defered, false if one or more of the elements could not have the listener attached, or if the operation throws an exception. @static @deprecated use YAHOO.util.Event.on and specify "focusout" as the event type.
[ "Attaches", "a", "focusout", "event", "listener", "to", "the", "specified", "element", "for", "the", "purpose", "of", "listening", "for", "the", "blur", "event", "on", "the", "element", "s", "descendants", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L1136-L1138
42,429
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function(ev) { var x = ev.pageX; if (!x && 0 !== x) { x = ev.clientX || 0; if ( this.isIE ) { x += this._getScrollLeft(); } } return x; }
javascript
function(ev) { var x = ev.pageX; if (!x && 0 !== x) { x = ev.clientX || 0; if ( this.isIE ) { x += this._getScrollLeft(); } } return x; }
[ "function", "(", "ev", ")", "{", "var", "x", "=", "ev", ".", "pageX", ";", "if", "(", "!", "x", "&&", "0", "!==", "x", ")", "{", "x", "=", "ev", ".", "clientX", "||", "0", ";", "if", "(", "this", ".", "isIE", ")", "{", "x", "+=", "this", ".", "_getScrollLeft", "(", ")", ";", "}", "}", "return", "x", ";", "}" ]
Returns the event's pageX @method getPageX @param {Event} ev the event @return {int} the event's pageX @static
[ "Returns", "the", "event", "s", "pageX" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L1303-L1314
42,430
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function(ev) { var y = ev.pageY; if (!y && 0 !== y) { y = ev.clientY || 0; if ( this.isIE ) { y += this._getScrollTop(); } } return y; }
javascript
function(ev) { var y = ev.pageY; if (!y && 0 !== y) { y = ev.clientY || 0; if ( this.isIE ) { y += this._getScrollTop(); } } return y; }
[ "function", "(", "ev", ")", "{", "var", "y", "=", "ev", ".", "pageY", ";", "if", "(", "!", "y", "&&", "0", "!==", "y", ")", "{", "y", "=", "ev", ".", "clientY", "||", "0", ";", "if", "(", "this", ".", "isIE", ")", "{", "y", "+=", "this", ".", "_getScrollTop", "(", ")", ";", "}", "}", "return", "y", ";", "}" ]
Returns the event's pageY @method getPageY @param {Event} ev the event @return {int} the event's pageY @static
[ "Returns", "the", "event", "s", "pageY" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L1323-L1335
42,431
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function(ev) { var t = ev.relatedTarget; if (!t) { if (ev.type == "mouseout") { t = ev.toElement; } else if (ev.type == "mouseover") { t = ev.fromElement; } } return this.resolveTextNode(t); }
javascript
function(ev) { var t = ev.relatedTarget; if (!t) { if (ev.type == "mouseout") { t = ev.toElement; } else if (ev.type == "mouseover") { t = ev.fromElement; } } return this.resolveTextNode(t); }
[ "function", "(", "ev", ")", "{", "var", "t", "=", "ev", ".", "relatedTarget", ";", "if", "(", "!", "t", ")", "{", "if", "(", "ev", ".", "type", "==", "\"mouseout\"", ")", "{", "t", "=", "ev", ".", "toElement", ";", "}", "else", "if", "(", "ev", ".", "type", "==", "\"mouseover\"", ")", "{", "t", "=", "ev", ".", "fromElement", ";", "}", "}", "return", "this", ".", "resolveTextNode", "(", "t", ")", ";", "}" ]
Returns the event's related target @method getRelatedTarget @param {Event} ev the event @return {HTMLElement} the event's relatedTarget @static
[ "Returns", "the", "event", "s", "related", "target" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L1355-L1366
42,432
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function(ev) { if (!ev.time) { var t = new Date().getTime(); try { ev.time = t; } catch(ex) { this.lastError = ex; return t; } } return ev.time; }
javascript
function(ev) { if (!ev.time) { var t = new Date().getTime(); try { ev.time = t; } catch(ex) { this.lastError = ex; return t; } } return ev.time; }
[ "function", "(", "ev", ")", "{", "if", "(", "!", "ev", ".", "time", ")", "{", "var", "t", "=", "new", "Date", "(", ")", ".", "getTime", "(", ")", ";", "try", "{", "ev", ".", "time", "=", "t", ";", "}", "catch", "(", "ex", ")", "{", "this", ".", "lastError", "=", "ex", ";", "return", "t", ";", "}", "}", "return", "ev", ".", "time", ";", "}" ]
Returns the time of the event. If the time is not included, the event is modified using the current time. @method getTime @param {Event} ev the event @return {Date} the time of the event @static
[ "Returns", "the", "time", "of", "the", "event", ".", "If", "the", "time", "is", "not", "included", "the", "event", "is", "modified", "using", "the", "current", "time", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L1376-L1388
42,433
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function(ev) { var code = ev.keyCode || ev.charCode || 0; // webkit key normalization if (YAHOO.env.ua.webkit && (code in webkitKeymap)) { code = webkitKeymap[code]; } return code; }
javascript
function(ev) { var code = ev.keyCode || ev.charCode || 0; // webkit key normalization if (YAHOO.env.ua.webkit && (code in webkitKeymap)) { code = webkitKeymap[code]; } return code; }
[ "function", "(", "ev", ")", "{", "var", "code", "=", "ev", ".", "keyCode", "||", "ev", ".", "charCode", "||", "0", ";", "// webkit key normalization", "if", "(", "YAHOO", ".", "env", ".", "ua", ".", "webkit", "&&", "(", "code", "in", "webkitKeymap", ")", ")", "{", "code", "=", "webkitKeymap", "[", "code", "]", ";", "}", "return", "code", ";", "}" ]
Returns the charcode for an event @method getCharCode @param {Event} ev the event @return {int} the event's charCode @static
[ "Returns", "the", "charcode", "for", "an", "event" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L1465-L1473
42,434
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function(e) { var EU = YAHOO.util.Event; if (!EU.DOMReady) { EU.DOMReady=true; // Fire the content ready custom event EU.DOMReadyEvent.fire(); // Remove the DOMContentLoaded (FF/Opera) EU._simpleRemove(document, "DOMContentLoaded", EU._ready); } }
javascript
function(e) { var EU = YAHOO.util.Event; if (!EU.DOMReady) { EU.DOMReady=true; // Fire the content ready custom event EU.DOMReadyEvent.fire(); // Remove the DOMContentLoaded (FF/Opera) EU._simpleRemove(document, "DOMContentLoaded", EU._ready); } }
[ "function", "(", "e", ")", "{", "var", "EU", "=", "YAHOO", ".", "util", ".", "Event", ";", "if", "(", "!", "EU", ".", "DOMReady", ")", "{", "EU", ".", "DOMReady", "=", "true", ";", "// Fire the content ready custom event", "EU", ".", "DOMReadyEvent", ".", "fire", "(", ")", ";", "// Remove the DOMContentLoaded (FF/Opera)", "EU", ".", "_simpleRemove", "(", "document", ",", "\"DOMContentLoaded\"", ",", "EU", ".", "_ready", ")", ";", "}", "}" ]
Fires the DOMReady event listeners the first time the document is usable. @method _ready @static @private
[ "Fires", "the", "DOMReady", "event", "listeners", "the", "first", "time", "the", "document", "is", "usable", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L1612-L1623
42,435
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function() { var dd = document.documentElement, db = document.body; if (dd && (dd.scrollTop || dd.scrollLeft)) { return [dd.scrollTop, dd.scrollLeft]; } else if (db) { return [db.scrollTop, db.scrollLeft]; } else { return [0, 0]; } }
javascript
function() { var dd = document.documentElement, db = document.body; if (dd && (dd.scrollTop || dd.scrollLeft)) { return [dd.scrollTop, dd.scrollLeft]; } else if (db) { return [db.scrollTop, db.scrollLeft]; } else { return [0, 0]; } }
[ "function", "(", ")", "{", "var", "dd", "=", "document", ".", "documentElement", ",", "db", "=", "document", ".", "body", ";", "if", "(", "dd", "&&", "(", "dd", ".", "scrollTop", "||", "dd", ".", "scrollLeft", ")", ")", "{", "return", "[", "dd", ".", "scrollTop", ",", "dd", ".", "scrollLeft", "]", ";", "}", "else", "if", "(", "db", ")", "{", "return", "[", "db", ".", "scrollTop", ",", "db", ".", "scrollLeft", "]", ";", "}", "else", "{", "return", "[", "0", ",", "0", "]", ";", "}", "}" ]
Returns the scrollTop and scrollLeft. Used to calculate the pageX and pageY in Internet Explorer @method _getScroll @static @private
[ "Returns", "the", "scrollTop", "and", "scrollLeft", ".", "Used", "to", "calculate", "the", "pageX", "and", "pageY", "in", "Internet", "Explorer" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L1900-L1909
42,436
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function(p_type, p_fn, p_obj, overrideContext) { this.__yui_events = this.__yui_events || {}; var ce = this.__yui_events[p_type]; if (ce) { ce.subscribe(p_fn, p_obj, overrideContext); } else { this.__yui_subscribers = this.__yui_subscribers || {}; var subs = this.__yui_subscribers; if (!subs[p_type]) { subs[p_type] = []; } subs[p_type].push( { fn: p_fn, obj: p_obj, overrideContext: overrideContext } ); } }
javascript
function(p_type, p_fn, p_obj, overrideContext) { this.__yui_events = this.__yui_events || {}; var ce = this.__yui_events[p_type]; if (ce) { ce.subscribe(p_fn, p_obj, overrideContext); } else { this.__yui_subscribers = this.__yui_subscribers || {}; var subs = this.__yui_subscribers; if (!subs[p_type]) { subs[p_type] = []; } subs[p_type].push( { fn: p_fn, obj: p_obj, overrideContext: overrideContext } ); } }
[ "function", "(", "p_type", ",", "p_fn", ",", "p_obj", ",", "overrideContext", ")", "{", "this", ".", "__yui_events", "=", "this", ".", "__yui_events", "||", "{", "}", ";", "var", "ce", "=", "this", ".", "__yui_events", "[", "p_type", "]", ";", "if", "(", "ce", ")", "{", "ce", ".", "subscribe", "(", "p_fn", ",", "p_obj", ",", "overrideContext", ")", ";", "}", "else", "{", "this", ".", "__yui_subscribers", "=", "this", ".", "__yui_subscribers", "||", "{", "}", ";", "var", "subs", "=", "this", ".", "__yui_subscribers", ";", "if", "(", "!", "subs", "[", "p_type", "]", ")", "{", "subs", "[", "p_type", "]", "=", "[", "]", ";", "}", "subs", "[", "p_type", "]", ".", "push", "(", "{", "fn", ":", "p_fn", ",", "obj", ":", "p_obj", ",", "overrideContext", ":", "overrideContext", "}", ")", ";", "}", "}" ]
Subscribe to a CustomEvent by event type @method subscribe @param p_type {string} the type, or name of the event @param p_fn {function} the function to exectute when the event fires @param p_obj {Object} An object to be passed along when the event fires @param overrideContext {boolean} If true, the obj passed in becomes the execution scope of the listener
[ "Subscribe", "to", "a", "CustomEvent", "by", "event", "type" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L2109-L2125
42,437
neyric/webhookit
public/javascripts/yui/event/event-debug.js
function(p_type, p_fn, p_obj) { this.__yui_events = this.__yui_events || {}; var evts = this.__yui_events; if (p_type) { var ce = evts[p_type]; if (ce) { return ce.unsubscribe(p_fn, p_obj); } } else { var ret = true; for (var i in evts) { if (YAHOO.lang.hasOwnProperty(evts, i)) { ret = ret && evts[i].unsubscribe(p_fn, p_obj); } } return ret; } return false; }
javascript
function(p_type, p_fn, p_obj) { this.__yui_events = this.__yui_events || {}; var evts = this.__yui_events; if (p_type) { var ce = evts[p_type]; if (ce) { return ce.unsubscribe(p_fn, p_obj); } } else { var ret = true; for (var i in evts) { if (YAHOO.lang.hasOwnProperty(evts, i)) { ret = ret && evts[i].unsubscribe(p_fn, p_obj); } } return ret; } return false; }
[ "function", "(", "p_type", ",", "p_fn", ",", "p_obj", ")", "{", "this", ".", "__yui_events", "=", "this", ".", "__yui_events", "||", "{", "}", ";", "var", "evts", "=", "this", ".", "__yui_events", ";", "if", "(", "p_type", ")", "{", "var", "ce", "=", "evts", "[", "p_type", "]", ";", "if", "(", "ce", ")", "{", "return", "ce", ".", "unsubscribe", "(", "p_fn", ",", "p_obj", ")", ";", "}", "}", "else", "{", "var", "ret", "=", "true", ";", "for", "(", "var", "i", "in", "evts", ")", "{", "if", "(", "YAHOO", ".", "lang", ".", "hasOwnProperty", "(", "evts", ",", "i", ")", ")", "{", "ret", "=", "ret", "&&", "evts", "[", "i", "]", ".", "unsubscribe", "(", "p_fn", ",", "p_obj", ")", ";", "}", "}", "return", "ret", ";", "}", "return", "false", ";", "}" ]
Unsubscribes one or more listeners the from the specified event @method unsubscribe @param p_type {string} The type, or name of the event. If the type is not specified, it will attempt to remove the listener from all hosted events. @param p_fn {Function} The subscribed function to unsubscribe, if not supplied, all subscribers will be removed. @param p_obj {Object} The custom object passed to subscribe. This is optional, but if supplied will be used to disambiguate multiple listeners that are the same (e.g., you subscribe many object using a function that lives on the prototype) @return {boolean} true if the subscriber was found and detached.
[ "Unsubscribes", "one", "or", "more", "listeners", "the", "from", "the", "specified", "event" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L2142-L2161
42,438
neyric/webhookit
public/javascripts/yui/event/event-debug.js
handleKeyPress
function handleKeyPress(e, obj) { if (! keyData.shift) { keyData.shift = false; } if (! keyData.alt) { keyData.alt = false; } if (! keyData.ctrl) { keyData.ctrl = false; } // check held down modifying keys first if (e.shiftKey == keyData.shift && e.altKey == keyData.alt && e.ctrlKey == keyData.ctrl) { // if we pass this, all modifiers match var dataItem, keys = keyData.keys, key; if (YAHOO.lang.isArray(keys)) { for (var i=0;i<keys.length;i++) { dataItem = keys[i]; key = Event.getCharCode(e); if (dataItem == key) { keyEvent.fire(key, e); break; } } } else { key = Event.getCharCode(e); if (keys == key ) { keyEvent.fire(key, e); } } } }
javascript
function handleKeyPress(e, obj) { if (! keyData.shift) { keyData.shift = false; } if (! keyData.alt) { keyData.alt = false; } if (! keyData.ctrl) { keyData.ctrl = false; } // check held down modifying keys first if (e.shiftKey == keyData.shift && e.altKey == keyData.alt && e.ctrlKey == keyData.ctrl) { // if we pass this, all modifiers match var dataItem, keys = keyData.keys, key; if (YAHOO.lang.isArray(keys)) { for (var i=0;i<keys.length;i++) { dataItem = keys[i]; key = Event.getCharCode(e); if (dataItem == key) { keyEvent.fire(key, e); break; } } } else { key = Event.getCharCode(e); if (keys == key ) { keyEvent.fire(key, e); } } } }
[ "function", "handleKeyPress", "(", "e", ",", "obj", ")", "{", "if", "(", "!", "keyData", ".", "shift", ")", "{", "keyData", ".", "shift", "=", "false", ";", "}", "if", "(", "!", "keyData", ".", "alt", ")", "{", "keyData", ".", "alt", "=", "false", ";", "}", "if", "(", "!", "keyData", ".", "ctrl", ")", "{", "keyData", ".", "ctrl", "=", "false", ";", "}", "// check held down modifying keys first", "if", "(", "e", ".", "shiftKey", "==", "keyData", ".", "shift", "&&", "e", ".", "altKey", "==", "keyData", ".", "alt", "&&", "e", ".", "ctrlKey", "==", "keyData", ".", "ctrl", ")", "{", "// if we pass this, all modifiers match", "var", "dataItem", ",", "keys", "=", "keyData", ".", "keys", ",", "key", ";", "if", "(", "YAHOO", ".", "lang", ".", "isArray", "(", "keys", ")", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "i", "++", ")", "{", "dataItem", "=", "keys", "[", "i", "]", ";", "key", "=", "Event", ".", "getCharCode", "(", "e", ")", ";", "if", "(", "dataItem", "==", "key", ")", "{", "keyEvent", ".", "fire", "(", "key", ",", "e", ")", ";", "break", ";", "}", "}", "}", "else", "{", "key", "=", "Event", ".", "getCharCode", "(", "e", ")", ";", "if", "(", "keys", "==", "key", ")", "{", "keyEvent", ".", "fire", "(", "key", ",", "e", ")", ";", "}", "}", "}", "}" ]
Handles the key event when a key is pressed. @method handleKeyPress @param {DOMEvent} e The keypress DOM event @param {Object} obj The DOM event scope object @private
[ "Handles", "the", "key", "event", "when", "a", "key", "is", "pressed", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/event/event-debug.js#L2391-L2426
42,439
donmccurdy/aframe-proxy-controls
lib/overlay.js
function (pairCode, linkUrl, includeStyles) { /** @type {string} Pair code. */ this.pairCode = pairCode; /** @type {string} URL for 'Connect' button. */ this.linkUrl = linkUrl; /** @type {Element} Overlay element. */ this.el = document.createElement('div'); /** @type {Element} Overlay stylesheet. */ this.stylesheet = null; if (includeStyles) { this.stylesheet = document.createElement('style'); this.appendStyles(); } this.render(); }
javascript
function (pairCode, linkUrl, includeStyles) { /** @type {string} Pair code. */ this.pairCode = pairCode; /** @type {string} URL for 'Connect' button. */ this.linkUrl = linkUrl; /** @type {Element} Overlay element. */ this.el = document.createElement('div'); /** @type {Element} Overlay stylesheet. */ this.stylesheet = null; if (includeStyles) { this.stylesheet = document.createElement('style'); this.appendStyles(); } this.render(); }
[ "function", "(", "pairCode", ",", "linkUrl", ",", "includeStyles", ")", "{", "/** @type {string} Pair code. */", "this", ".", "pairCode", "=", "pairCode", ";", "/** @type {string} URL for 'Connect' button. */", "this", ".", "linkUrl", "=", "linkUrl", ";", "/** @type {Element} Overlay element. */", "this", ".", "el", "=", "document", ".", "createElement", "(", "'div'", ")", ";", "/** @type {Element} Overlay stylesheet. */", "this", ".", "stylesheet", "=", "null", ";", "if", "(", "includeStyles", ")", "{", "this", ".", "stylesheet", "=", "document", ".", "createElement", "(", "'style'", ")", ";", "this", ".", "appendStyles", "(", ")", ";", "}", "this", ".", "render", "(", ")", ";", "}" ]
Helper class for the canvas overlay, which has to be rendered and styled in JavaScript, just because. @param {string} pairCode * @param {string} linkUrl @param {boolean} includeStyles
[ "Helper", "class", "for", "the", "canvas", "overlay", "which", "has", "to", "be", "rendered", "and", "styled", "in", "JavaScript", "just", "because", "." ]
82aa99f52e17c8ad179ab0907afdf4135e0762d6
https://github.com/donmccurdy/aframe-proxy-controls/blob/82aa99f52e17c8ad179ab0907afdf4135e0762d6/lib/overlay.js#L65-L84
42,440
neyric/webhookit
public/javascripts/WireIt/plugins/grouping/examples/sawire/modules.js
function(codeText) { this.textarea = WireIt.cn('textarea', null, {width: "90%", height: "70px", border: "0", padding: "5px"}, codeText); this.setBody(this.textarea); YAHOO.util.Event.addListener(this.textarea, 'change', this.createTerminals, this, true); }
javascript
function(codeText) { this.textarea = WireIt.cn('textarea', null, {width: "90%", height: "70px", border: "0", padding: "5px"}, codeText); this.setBody(this.textarea); YAHOO.util.Event.addListener(this.textarea, 'change', this.createTerminals, this, true); }
[ "function", "(", "codeText", ")", "{", "this", ".", "textarea", "=", "WireIt", ".", "cn", "(", "'textarea'", ",", "null", ",", "{", "width", ":", "\"90%\"", ",", "height", ":", "\"70px\"", ",", "border", ":", "\"0\"", ",", "padding", ":", "\"5px\"", "}", ",", "codeText", ")", ";", "this", ".", "setBody", "(", "this", ".", "textarea", ")", ";", "YAHOO", ".", "util", ".", "Event", ".", "addListener", "(", "this", ".", "textarea", ",", "'change'", ",", "this", ".", "createTerminals", ",", "this", ",", "true", ")", ";", "}" ]
Create the textarea for the javascript code @method buildTextArea @param {String} codeText
[ "Create", "the", "textarea", "for", "the", "javascript", "code" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/plugins/grouping/examples/sawire/modules.js#L275-L282
42,441
neyric/webhookit
public/javascripts/WireIt/plugins/grouping/examples/sawire/modules.js
function() { var width = WireIt.getIntStyle(this.el, "width"); var inputsIntervall = Math.floor(width/(this.nParams+1)); for(var i = 1 ; i < this.terminals.length ; i++) { var term = this.terminals[i]; YAHOO.util.Dom.setStyle(term.el, "left", (inputsIntervall*(i))-15+"px" ); for(var j = 0 ; j < term.wires.length ; j++) { term.wires[j].redraw(); } } // Output terminal WireIt.sn(this.outputTerminal.el, null, {position: "absolute", bottom: "-15px", left: (Math.floor(width/2)-15)+"px"}); for(var j = 0 ; j < this.outputTerminal.wires.length ; j++) { this.outputTerminal.wires[j].redraw(); } }
javascript
function() { var width = WireIt.getIntStyle(this.el, "width"); var inputsIntervall = Math.floor(width/(this.nParams+1)); for(var i = 1 ; i < this.terminals.length ; i++) { var term = this.terminals[i]; YAHOO.util.Dom.setStyle(term.el, "left", (inputsIntervall*(i))-15+"px" ); for(var j = 0 ; j < term.wires.length ; j++) { term.wires[j].redraw(); } } // Output terminal WireIt.sn(this.outputTerminal.el, null, {position: "absolute", bottom: "-15px", left: (Math.floor(width/2)-15)+"px"}); for(var j = 0 ; j < this.outputTerminal.wires.length ; j++) { this.outputTerminal.wires[j].redraw(); } }
[ "function", "(", ")", "{", "var", "width", "=", "WireIt", ".", "getIntStyle", "(", "this", ".", "el", ",", "\"width\"", ")", ";", "var", "inputsIntervall", "=", "Math", ".", "floor", "(", "width", "/", "(", "this", ".", "nParams", "+", "1", ")", ")", ";", "for", "(", "var", "i", "=", "1", ";", "i", "<", "this", ".", "terminals", ".", "length", ";", "i", "++", ")", "{", "var", "term", "=", "this", ".", "terminals", "[", "i", "]", ";", "YAHOO", ".", "util", ".", "Dom", ".", "setStyle", "(", "term", ".", "el", ",", "\"left\"", ",", "(", "inputsIntervall", "*", "(", "i", ")", ")", "-", "15", "+", "\"px\"", ")", ";", "for", "(", "var", "j", "=", "0", ";", "j", "<", "term", ".", "wires", ".", "length", ";", "j", "++", ")", "{", "term", ".", "wires", "[", "j", "]", ".", "redraw", "(", ")", ";", "}", "}", "// Output terminal", "WireIt", ".", "sn", "(", "this", ".", "outputTerminal", ".", "el", ",", "null", ",", "{", "position", ":", "\"absolute\"", ",", "bottom", ":", "\"-15px\"", ",", "left", ":", "(", "Math", ".", "floor", "(", "width", "/", "2", ")", "-", "15", ")", "+", "\"px\"", "}", ")", ";", "for", "(", "var", "j", "=", "0", ";", "j", "<", "this", ".", "outputTerminal", ".", "wires", ".", "length", ";", "j", "++", ")", "{", "this", ".", "outputTerminal", ".", "wires", "[", "j", "]", ".", "redraw", "(", ")", ";", "}", "}" ]
Reposition the terminals @method positionTerminals
[ "Reposition", "the", "terminals" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/plugins/grouping/examples/sawire/modules.js#L331-L349
42,442
neyric/webhookit
public/javascripts/WireIt/plugins/grouping/examples/sawire/modules.js
function() { var obj = jsBox.Container.superclass.getConfig.call(this); obj.codeText = this.textarea.value; return obj; }
javascript
function() { var obj = jsBox.Container.superclass.getConfig.call(this); obj.codeText = this.textarea.value; return obj; }
[ "function", "(", ")", "{", "var", "obj", "=", "jsBox", ".", "Container", ".", "superclass", ".", "getConfig", ".", "call", "(", "this", ")", ";", "obj", ".", "codeText", "=", "this", ".", "textarea", ".", "value", ";", "return", "obj", ";", "}" ]
Extend the getConfig to add the "codeText" property @method getConfig
[ "Extend", "the", "getConfig", "to", "add", "the", "codeText", "property" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/plugins/grouping/examples/sawire/modules.js#L355-L359
42,443
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function () { // Grab the first callback in the queue var c = this.q[0], fn; // If there is no callback in the queue or the Chain is currently // in an execution mode, return if (!c) { this.fireEvent('end'); return this; } else if (this.id) { return this; } fn = c.method || c; if (typeof fn === 'function') { var o = c.scope || {}, args = c.argument || [], ms = c.timeout || 0, me = this; if (!(args instanceof Array)) { args = [args]; } // Execute immediately if the callback timeout is negative. if (ms < 0) { this.id = ms; if (c.until) { for (;!c.until();) { // Execute the callback from scope, with argument fn.apply(o,args); } } else if (c.iterations) { for (;c.iterations-- > 0;) { fn.apply(o,args); } } else { fn.apply(o,args); } this.q.shift(); this.id = 0; return this.run(); } else { // If the until condition is set, check if we're done if (c.until) { if (c.until()) { // Shift this callback from the queue and execute the next // callback this.q.shift(); return this.run(); } // Otherwise if either iterations is not set or we're // executing the last iteration, shift callback from the queue } else if (!c.iterations || !--c.iterations) { this.q.shift(); } // Otherwise set to execute after the configured timeout this.id = setTimeout(function () { // Execute the callback from scope, with argument fn.apply(o,args); // Check if the Chain was not paused from inside the callback if (me.id) { // Indicate ready to run state me.id = 0; // Start the fun all over again me.run(); } },ms); } } return this; }
javascript
function () { // Grab the first callback in the queue var c = this.q[0], fn; // If there is no callback in the queue or the Chain is currently // in an execution mode, return if (!c) { this.fireEvent('end'); return this; } else if (this.id) { return this; } fn = c.method || c; if (typeof fn === 'function') { var o = c.scope || {}, args = c.argument || [], ms = c.timeout || 0, me = this; if (!(args instanceof Array)) { args = [args]; } // Execute immediately if the callback timeout is negative. if (ms < 0) { this.id = ms; if (c.until) { for (;!c.until();) { // Execute the callback from scope, with argument fn.apply(o,args); } } else if (c.iterations) { for (;c.iterations-- > 0;) { fn.apply(o,args); } } else { fn.apply(o,args); } this.q.shift(); this.id = 0; return this.run(); } else { // If the until condition is set, check if we're done if (c.until) { if (c.until()) { // Shift this callback from the queue and execute the next // callback this.q.shift(); return this.run(); } // Otherwise if either iterations is not set or we're // executing the last iteration, shift callback from the queue } else if (!c.iterations || !--c.iterations) { this.q.shift(); } // Otherwise set to execute after the configured timeout this.id = setTimeout(function () { // Execute the callback from scope, with argument fn.apply(o,args); // Check if the Chain was not paused from inside the callback if (me.id) { // Indicate ready to run state me.id = 0; // Start the fun all over again me.run(); } },ms); } } return this; }
[ "function", "(", ")", "{", "// Grab the first callback in the queue", "var", "c", "=", "this", ".", "q", "[", "0", "]", ",", "fn", ";", "// If there is no callback in the queue or the Chain is currently", "// in an execution mode, return", "if", "(", "!", "c", ")", "{", "this", ".", "fireEvent", "(", "'end'", ")", ";", "return", "this", ";", "}", "else", "if", "(", "this", ".", "id", ")", "{", "return", "this", ";", "}", "fn", "=", "c", ".", "method", "||", "c", ";", "if", "(", "typeof", "fn", "===", "'function'", ")", "{", "var", "o", "=", "c", ".", "scope", "||", "{", "}", ",", "args", "=", "c", ".", "argument", "||", "[", "]", ",", "ms", "=", "c", ".", "timeout", "||", "0", ",", "me", "=", "this", ";", "if", "(", "!", "(", "args", "instanceof", "Array", ")", ")", "{", "args", "=", "[", "args", "]", ";", "}", "// Execute immediately if the callback timeout is negative.", "if", "(", "ms", "<", "0", ")", "{", "this", ".", "id", "=", "ms", ";", "if", "(", "c", ".", "until", ")", "{", "for", "(", ";", "!", "c", ".", "until", "(", ")", ";", ")", "{", "// Execute the callback from scope, with argument", "fn", ".", "apply", "(", "o", ",", "args", ")", ";", "}", "}", "else", "if", "(", "c", ".", "iterations", ")", "{", "for", "(", ";", "c", ".", "iterations", "--", ">", "0", ";", ")", "{", "fn", ".", "apply", "(", "o", ",", "args", ")", ";", "}", "}", "else", "{", "fn", ".", "apply", "(", "o", ",", "args", ")", ";", "}", "this", ".", "q", ".", "shift", "(", ")", ";", "this", ".", "id", "=", "0", ";", "return", "this", ".", "run", "(", ")", ";", "}", "else", "{", "// If the until condition is set, check if we're done", "if", "(", "c", ".", "until", ")", "{", "if", "(", "c", ".", "until", "(", ")", ")", "{", "// Shift this callback from the queue and execute the next", "// callback", "this", ".", "q", ".", "shift", "(", ")", ";", "return", "this", ".", "run", "(", ")", ";", "}", "// Otherwise if either iterations is not set or we're", "// executing the last iteration, shift callback from the queue", "}", "else", "if", "(", "!", "c", ".", "iterations", "||", "!", "--", "c", ".", "iterations", ")", "{", "this", ".", "q", ".", "shift", "(", ")", ";", "}", "// Otherwise set to execute after the configured timeout", "this", ".", "id", "=", "setTimeout", "(", "function", "(", ")", "{", "// Execute the callback from scope, with argument", "fn", ".", "apply", "(", "o", ",", "args", ")", ";", "// Check if the Chain was not paused from inside the callback", "if", "(", "me", ".", "id", ")", "{", "// Indicate ready to run state", "me", ".", "id", "=", "0", ";", "// Start the fun all over again", "me", ".", "run", "(", ")", ";", "}", "}", ",", "ms", ")", ";", "}", "}", "return", "this", ";", "}" ]
Begin executing the chain, or resume execution from the last paused position. @method run @return {Chain} the Chain instance
[ "Begin", "executing", "the", "chain", "or", "resume", "execution", "from", "the", "last", "paused", "position", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L54-L129
42,444
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(tree) { var maxRowDepth = 1; var currentRow; var currentColumn; // Calculate the max depth of descendants for this row var countMaxRowDepth = function(row, tmpRowDepth) { tmpRowDepth = tmpRowDepth || 1; for(var n=0; n<row.length; n++) { var col = row[n]; // Column has children, so keep counting if(YAHOO.lang.isArray(col.children)) { tmpRowDepth++; countMaxRowDepth(col.children, tmpRowDepth); tmpRowDepth--; } // No children, is it the max depth? else { if(tmpRowDepth > maxRowDepth) { maxRowDepth = tmpRowDepth; } } } }; // Count max row depth for each row for(var m=0; m<tree.length; m++) { currentRow = tree[m]; countMaxRowDepth(currentRow); // Assign the right ROWSPAN values to each Column in the row for(var p=0; p<currentRow.length; p++) { currentColumn = currentRow[p]; if(!YAHOO.lang.isArray(currentColumn.children)) { currentColumn._nRowspan = maxRowDepth; } else { currentColumn._nRowspan = 1; } } // Reset counter for next row maxRowDepth = 1; } }
javascript
function(tree) { var maxRowDepth = 1; var currentRow; var currentColumn; // Calculate the max depth of descendants for this row var countMaxRowDepth = function(row, tmpRowDepth) { tmpRowDepth = tmpRowDepth || 1; for(var n=0; n<row.length; n++) { var col = row[n]; // Column has children, so keep counting if(YAHOO.lang.isArray(col.children)) { tmpRowDepth++; countMaxRowDepth(col.children, tmpRowDepth); tmpRowDepth--; } // No children, is it the max depth? else { if(tmpRowDepth > maxRowDepth) { maxRowDepth = tmpRowDepth; } } } }; // Count max row depth for each row for(var m=0; m<tree.length; m++) { currentRow = tree[m]; countMaxRowDepth(currentRow); // Assign the right ROWSPAN values to each Column in the row for(var p=0; p<currentRow.length; p++) { currentColumn = currentRow[p]; if(!YAHOO.lang.isArray(currentColumn.children)) { currentColumn._nRowspan = maxRowDepth; } else { currentColumn._nRowspan = 1; } } // Reset counter for next row maxRowDepth = 1; } }
[ "function", "(", "tree", ")", "{", "var", "maxRowDepth", "=", "1", ";", "var", "currentRow", ";", "var", "currentColumn", ";", "// Calculate the max depth of descendants for this row", "var", "countMaxRowDepth", "=", "function", "(", "row", ",", "tmpRowDepth", ")", "{", "tmpRowDepth", "=", "tmpRowDepth", "||", "1", ";", "for", "(", "var", "n", "=", "0", ";", "n", "<", "row", ".", "length", ";", "n", "++", ")", "{", "var", "col", "=", "row", "[", "n", "]", ";", "// Column has children, so keep counting", "if", "(", "YAHOO", ".", "lang", ".", "isArray", "(", "col", ".", "children", ")", ")", "{", "tmpRowDepth", "++", ";", "countMaxRowDepth", "(", "col", ".", "children", ",", "tmpRowDepth", ")", ";", "tmpRowDepth", "--", ";", "}", "// No children, is it the max depth?", "else", "{", "if", "(", "tmpRowDepth", ">", "maxRowDepth", ")", "{", "maxRowDepth", "=", "tmpRowDepth", ";", "}", "}", "}", "}", ";", "// Count max row depth for each row", "for", "(", "var", "m", "=", "0", ";", "m", "<", "tree", ".", "length", ";", "m", "++", ")", "{", "currentRow", "=", "tree", "[", "m", "]", ";", "countMaxRowDepth", "(", "currentRow", ")", ";", "// Assign the right ROWSPAN values to each Column in the row", "for", "(", "var", "p", "=", "0", ";", "p", "<", "currentRow", ".", "length", ";", "p", "++", ")", "{", "currentColumn", "=", "currentRow", "[", "p", "]", ";", "if", "(", "!", "YAHOO", ".", "lang", ".", "isArray", "(", "currentColumn", ".", "children", ")", ")", "{", "currentColumn", ".", "_nRowspan", "=", "maxRowDepth", ";", "}", "else", "{", "currentColumn", ".", "_nRowspan", "=", "1", ";", "}", "}", "// Reset counter for next row", "maxRowDepth", "=", "1", ";", "}", "}" ]
Determine ROWSPAN value for each Column in the tree
[ "Determine", "ROWSPAN", "value", "for", "each", "Column", "in", "the", "tree" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L439-L485
42,445
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(row, tmpRowDepth) { tmpRowDepth = tmpRowDepth || 1; for(var n=0; n<row.length; n++) { var col = row[n]; // Column has children, so keep counting if(YAHOO.lang.isArray(col.children)) { tmpRowDepth++; countMaxRowDepth(col.children, tmpRowDepth); tmpRowDepth--; } // No children, is it the max depth? else { if(tmpRowDepth > maxRowDepth) { maxRowDepth = tmpRowDepth; } } } }
javascript
function(row, tmpRowDepth) { tmpRowDepth = tmpRowDepth || 1; for(var n=0; n<row.length; n++) { var col = row[n]; // Column has children, so keep counting if(YAHOO.lang.isArray(col.children)) { tmpRowDepth++; countMaxRowDepth(col.children, tmpRowDepth); tmpRowDepth--; } // No children, is it the max depth? else { if(tmpRowDepth > maxRowDepth) { maxRowDepth = tmpRowDepth; } } } }
[ "function", "(", "row", ",", "tmpRowDepth", ")", "{", "tmpRowDepth", "=", "tmpRowDepth", "||", "1", ";", "for", "(", "var", "n", "=", "0", ";", "n", "<", "row", ".", "length", ";", "n", "++", ")", "{", "var", "col", "=", "row", "[", "n", "]", ";", "// Column has children, so keep counting", "if", "(", "YAHOO", ".", "lang", ".", "isArray", "(", "col", ".", "children", ")", ")", "{", "tmpRowDepth", "++", ";", "countMaxRowDepth", "(", "col", ".", "children", ",", "tmpRowDepth", ")", ";", "tmpRowDepth", "--", ";", "}", "// No children, is it the max depth?", "else", "{", "if", "(", "tmpRowDepth", ">", "maxRowDepth", ")", "{", "maxRowDepth", "=", "tmpRowDepth", ";", "}", "}", "}", "}" ]
Calculate the max depth of descendants for this row
[ "Calculate", "the", "max", "depth", "of", "descendants", "for", "this", "row" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L445-L464
42,446
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(i, oColumn) { headers[i].push(oColumn.getSanitizedKey()); if(oColumn._oParent) { recurseAncestorsForHeaders(i, oColumn._oParent); } }
javascript
function(i, oColumn) { headers[i].push(oColumn.getSanitizedKey()); if(oColumn._oParent) { recurseAncestorsForHeaders(i, oColumn._oParent); } }
[ "function", "(", "i", ",", "oColumn", ")", "{", "headers", "[", "i", "]", ".", "push", "(", "oColumn", ".", "getSanitizedKey", "(", ")", ")", ";", "if", "(", "oColumn", ".", "_oParent", ")", "{", "recurseAncestorsForHeaders", "(", "i", ",", "oColumn", ".", "_oParent", ")", ";", "}", "}" ]
Store header relationships in an array for HEADERS attribute
[ "Store", "header", "relationships", "in", "an", "array", "for", "HEADERS", "attribute" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L494-L499
42,447
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { var aDefinitions = this._aDefinitions; // Internal recursive function to define Column instances var parseColumns = function(nodeList, oSelf) { // Parse each node at this depth for attributes and any children for(var j=0; j<nodeList.length; j++) { var currentNode = nodeList[j]; // Get the Column for each node var oColumn = oSelf.getColumnById(currentNode.yuiColumnId); if(oColumn) { // Update the current values var oDefinition = oColumn.getDefinition(); for(var name in oDefinition) { if(YAHOO.lang.hasOwnProperty(oDefinition, name)) { currentNode[name] = oDefinition[name]; } } } // The Column has descendants if(YAHOO.lang.isArray(currentNode.children)) { // The children themselves must also be parsed for Column instances parseColumns(currentNode.children, oSelf); } } }; parseColumns(aDefinitions, this); this._aDefinitions = aDefinitions; return aDefinitions; }
javascript
function() { var aDefinitions = this._aDefinitions; // Internal recursive function to define Column instances var parseColumns = function(nodeList, oSelf) { // Parse each node at this depth for attributes and any children for(var j=0; j<nodeList.length; j++) { var currentNode = nodeList[j]; // Get the Column for each node var oColumn = oSelf.getColumnById(currentNode.yuiColumnId); if(oColumn) { // Update the current values var oDefinition = oColumn.getDefinition(); for(var name in oDefinition) { if(YAHOO.lang.hasOwnProperty(oDefinition, name)) { currentNode[name] = oDefinition[name]; } } } // The Column has descendants if(YAHOO.lang.isArray(currentNode.children)) { // The children themselves must also be parsed for Column instances parseColumns(currentNode.children, oSelf); } } }; parseColumns(aDefinitions, this); this._aDefinitions = aDefinitions; return aDefinitions; }
[ "function", "(", ")", "{", "var", "aDefinitions", "=", "this", ".", "_aDefinitions", ";", "// Internal recursive function to define Column instances", "var", "parseColumns", "=", "function", "(", "nodeList", ",", "oSelf", ")", "{", "// Parse each node at this depth for attributes and any children", "for", "(", "var", "j", "=", "0", ";", "j", "<", "nodeList", ".", "length", ";", "j", "++", ")", "{", "var", "currentNode", "=", "nodeList", "[", "j", "]", ";", "// Get the Column for each node", "var", "oColumn", "=", "oSelf", ".", "getColumnById", "(", "currentNode", ".", "yuiColumnId", ")", ";", "if", "(", "oColumn", ")", "{", "// Update the current values", "var", "oDefinition", "=", "oColumn", ".", "getDefinition", "(", ")", ";", "for", "(", "var", "name", "in", "oDefinition", ")", "{", "if", "(", "YAHOO", ".", "lang", ".", "hasOwnProperty", "(", "oDefinition", ",", "name", ")", ")", "{", "currentNode", "[", "name", "]", "=", "oDefinition", "[", "name", "]", ";", "}", "}", "}", "// The Column has descendants", "if", "(", "YAHOO", ".", "lang", ".", "isArray", "(", "currentNode", ".", "children", ")", ")", "{", "// The children themselves must also be parsed for Column instances", "parseColumns", "(", "currentNode", ".", "children", ",", "oSelf", ")", ";", "}", "}", "}", ";", "parseColumns", "(", "aDefinitions", ",", "this", ")", ";", "this", ".", "_aDefinitions", "=", "aDefinitions", ";", "return", "aDefinitions", ";", "}" ]
Public accessor to the definitions array. @method getDefinitions @return {Object[]} Array of object literal Column definitions.
[ "Public", "accessor", "to", "the", "definitions", "array", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L548-L581
42,448
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(column) { if(YAHOO.lang.isString(column)) { var allColumns = this.flat; for(var i=allColumns.length-1; i>-1; i--) { if(allColumns[i]._sId === column) { return allColumns[i]; } } } return null; }
javascript
function(column) { if(YAHOO.lang.isString(column)) { var allColumns = this.flat; for(var i=allColumns.length-1; i>-1; i--) { if(allColumns[i]._sId === column) { return allColumns[i]; } } } return null; }
[ "function", "(", "column", ")", "{", "if", "(", "YAHOO", ".", "lang", ".", "isString", "(", "column", ")", ")", "{", "var", "allColumns", "=", "this", ".", "flat", ";", "for", "(", "var", "i", "=", "allColumns", ".", "length", "-", "1", ";", "i", ">", "-", "1", ";", "i", "--", ")", "{", "if", "(", "allColumns", "[", "i", "]", ".", "_sId", "===", "column", ")", "{", "return", "allColumns", "[", "i", "]", ";", "}", "}", "}", "return", "null", ";", "}" ]
Returns Column instance with given ID. @method getColumnById @param column {String} Column ID. @return {YAHOO.widget.Column} Column instance.
[ "Returns", "Column", "instance", "with", "given", "ID", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L591-L601
42,449
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(column) { if(YAHOO.lang.isNumber(column) && this.keys[column]) { return this.keys[column]; } else if(YAHOO.lang.isString(column)) { var allColumns = this.flat; var aColumns = []; for(var i=0; i<allColumns.length; i++) { if(allColumns[i].key === column) { aColumns.push(allColumns[i]); } } if(aColumns.length === 1) { return aColumns[0]; } else if(aColumns.length > 1) { return aColumns; } } return null; }
javascript
function(column) { if(YAHOO.lang.isNumber(column) && this.keys[column]) { return this.keys[column]; } else if(YAHOO.lang.isString(column)) { var allColumns = this.flat; var aColumns = []; for(var i=0; i<allColumns.length; i++) { if(allColumns[i].key === column) { aColumns.push(allColumns[i]); } } if(aColumns.length === 1) { return aColumns[0]; } else if(aColumns.length > 1) { return aColumns; } } return null; }
[ "function", "(", "column", ")", "{", "if", "(", "YAHOO", ".", "lang", ".", "isNumber", "(", "column", ")", "&&", "this", ".", "keys", "[", "column", "]", ")", "{", "return", "this", ".", "keys", "[", "column", "]", ";", "}", "else", "if", "(", "YAHOO", ".", "lang", ".", "isString", "(", "column", ")", ")", "{", "var", "allColumns", "=", "this", ".", "flat", ";", "var", "aColumns", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "allColumns", ".", "length", ";", "i", "++", ")", "{", "if", "(", "allColumns", "[", "i", "]", ".", "key", "===", "column", ")", "{", "aColumns", ".", "push", "(", "allColumns", "[", "i", "]", ")", ";", "}", "}", "if", "(", "aColumns", ".", "length", "===", "1", ")", "{", "return", "aColumns", "[", "0", "]", ";", "}", "else", "if", "(", "aColumns", ".", "length", ">", "1", ")", "{", "return", "aColumns", ";", "}", "}", "return", "null", ";", "}" ]
Returns Column instance with given key or ColumnSet key index. @method getColumn @param column {String | Number} Column key or ColumnSet key index. @return {YAHOO.widget.Column} Column instance.
[ "Returns", "Column", "instance", "with", "given", "key", "or", "ColumnSet", "key", "index", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L611-L631
42,450
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { var oDefinition = {}; // Update the definition oDefinition.abbr = this.abbr; oDefinition.className = this.className; oDefinition.editor = this.editor; oDefinition.editorOptions = this.editorOptions; //TODO: deprecated oDefinition.field = this.field; oDefinition.formatter = this.formatter; oDefinition.hidden = this.hidden; oDefinition.key = this.key; oDefinition.label = this.label; oDefinition.minWidth = this.minWidth; oDefinition.maxAutoWidth = this.maxAutoWidth; oDefinition.resizeable = this.resizeable; oDefinition.selected = this.selected; oDefinition.sortable = this.sortable; oDefinition.sortOptions = this.sortOptions; oDefinition.width = this.width; return oDefinition; }
javascript
function() { var oDefinition = {}; // Update the definition oDefinition.abbr = this.abbr; oDefinition.className = this.className; oDefinition.editor = this.editor; oDefinition.editorOptions = this.editorOptions; //TODO: deprecated oDefinition.field = this.field; oDefinition.formatter = this.formatter; oDefinition.hidden = this.hidden; oDefinition.key = this.key; oDefinition.label = this.label; oDefinition.minWidth = this.minWidth; oDefinition.maxAutoWidth = this.maxAutoWidth; oDefinition.resizeable = this.resizeable; oDefinition.selected = this.selected; oDefinition.sortable = this.sortable; oDefinition.sortOptions = this.sortOptions; oDefinition.width = this.width; return oDefinition; }
[ "function", "(", ")", "{", "var", "oDefinition", "=", "{", "}", ";", "// Update the definition", "oDefinition", ".", "abbr", "=", "this", ".", "abbr", ";", "oDefinition", ".", "className", "=", "this", ".", "className", ";", "oDefinition", ".", "editor", "=", "this", ".", "editor", ";", "oDefinition", ".", "editorOptions", "=", "this", ".", "editorOptions", ";", "//TODO: deprecated", "oDefinition", ".", "field", "=", "this", ".", "field", ";", "oDefinition", ".", "formatter", "=", "this", ".", "formatter", ";", "oDefinition", ".", "hidden", "=", "this", ".", "hidden", ";", "oDefinition", ".", "key", "=", "this", ".", "key", ";", "oDefinition", ".", "label", "=", "this", ".", "label", ";", "oDefinition", ".", "minWidth", "=", "this", ".", "minWidth", ";", "oDefinition", ".", "maxAutoWidth", "=", "this", ".", "maxAutoWidth", ";", "oDefinition", ".", "resizeable", "=", "this", ".", "resizeable", ";", "oDefinition", ".", "selected", "=", "this", ".", "selected", ";", "oDefinition", ".", "sortable", "=", "this", ".", "sortable", ";", "oDefinition", ".", "sortOptions", "=", "this", ".", "sortOptions", ";", "oDefinition", ".", "width", "=", "this", ".", "width", ";", "return", "oDefinition", ";", "}" ]
Returns object literal definition. @method getDefinition @return {Object} Object literal definition.
[ "Returns", "object", "literal", "definition", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L1115-L1137
42,451
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(e) { this.startWidth = this.headCellLiner.offsetWidth; this.startX = YAHOO.util.Event.getXY(e)[0]; this.nLinerPadding = (parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingLeft"),10)|0) + (parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingRight"),10)|0); }
javascript
function(e) { this.startWidth = this.headCellLiner.offsetWidth; this.startX = YAHOO.util.Event.getXY(e)[0]; this.nLinerPadding = (parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingLeft"),10)|0) + (parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingRight"),10)|0); }
[ "function", "(", "e", ")", "{", "this", ".", "startWidth", "=", "this", ".", "headCellLiner", ".", "offsetWidth", ";", "this", ".", "startX", "=", "YAHOO", ".", "util", ".", "Event", ".", "getXY", "(", "e", ")", "[", "0", "]", ";", "this", ".", "nLinerPadding", "=", "(", "parseInt", "(", "YAHOO", ".", "util", ".", "Dom", ".", "getStyle", "(", "this", ".", "headCellLiner", ",", "\"paddingLeft\"", ")", ",", "10", ")", "|", "0", ")", "+", "(", "parseInt", "(", "YAHOO", ".", "util", ".", "Dom", ".", "getStyle", "(", "this", ".", "headCellLiner", ",", "\"paddingRight\"", ")", ",", "10", ")", "|", "0", ")", ";", "}" ]
Handles mousedown events on the Column resizer. @method onMouseDown @param e {string} The mousedown event
[ "Handles", "mousedown", "events", "on", "the", "Column", "resizer", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L1562-L1567
42,452
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { // Shrinks height of all resizer els to not hold open TH els var allKeys = this.datatable.getColumnSet().keys, thisKey = this.column.getKeyIndex(), col; for(var i=0, len=allKeys.length; i<len; i++) { col = allKeys[i]; if(col._ddResizer) { YAHOO.util.Dom.get(col._ddResizer.handleElId).style.height = "1em"; } } }
javascript
function() { // Shrinks height of all resizer els to not hold open TH els var allKeys = this.datatable.getColumnSet().keys, thisKey = this.column.getKeyIndex(), col; for(var i=0, len=allKeys.length; i<len; i++) { col = allKeys[i]; if(col._ddResizer) { YAHOO.util.Dom.get(col._ddResizer.handleElId).style.height = "1em"; } } }
[ "function", "(", ")", "{", "// Shrinks height of all resizer els to not hold open TH els", "var", "allKeys", "=", "this", ".", "datatable", ".", "getColumnSet", "(", ")", ".", "keys", ",", "thisKey", "=", "this", ".", "column", ".", "getKeyIndex", "(", ")", ",", "col", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "allKeys", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "col", "=", "allKeys", "[", "i", "]", ";", "if", "(", "col", ".", "_ddResizer", ")", "{", "YAHOO", ".", "util", ".", "Dom", ".", "get", "(", "col", ".", "_ddResizer", ".", "handleElId", ")", ".", "style", ".", "height", "=", "\"1em\"", ";", "}", "}", "}" ]
Handles start drag on the Column resizer. @method startDrag @param e {string} The drag event
[ "Handles", "start", "drag", "on", "the", "Column", "resizer", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L1591-L1602
42,453
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(e) { var newX = YAHOO.util.Event.getXY(e)[0]; if(newX > YAHOO.util.Dom.getX(this.headCellLiner)) { var offsetX = newX - this.startX; var newWidth = this.startWidth + offsetX - this.nLinerPadding; if(newWidth > 0) { this.datatable.setColumnWidth(this.column, newWidth); } } }
javascript
function(e) { var newX = YAHOO.util.Event.getXY(e)[0]; if(newX > YAHOO.util.Dom.getX(this.headCellLiner)) { var offsetX = newX - this.startX; var newWidth = this.startWidth + offsetX - this.nLinerPadding; if(newWidth > 0) { this.datatable.setColumnWidth(this.column, newWidth); } } }
[ "function", "(", "e", ")", "{", "var", "newX", "=", "YAHOO", ".", "util", ".", "Event", ".", "getXY", "(", "e", ")", "[", "0", "]", ";", "if", "(", "newX", ">", "YAHOO", ".", "util", ".", "Dom", ".", "getX", "(", "this", ".", "headCellLiner", ")", ")", "{", "var", "offsetX", "=", "newX", "-", "this", ".", "startX", ";", "var", "newWidth", "=", "this", ".", "startWidth", "+", "offsetX", "-", "this", ".", "nLinerPadding", ";", "if", "(", "newWidth", ">", "0", ")", "{", "this", ".", "datatable", ".", "setColumnWidth", "(", "this", ".", "column", ",", "newWidth", ")", ";", "}", "}", "}" ]
Handles drag events on the Column resizer. @method onDrag @param e {string} The drag event
[ "Handles", "drag", "events", "on", "the", "Column", "resizer", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L1610-L1619
42,454
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(index, range) { if(!lang.isNumber(range) || (range < 0)) { range = 1; } this._records.splice(index, range); //this._length = this._length - range; }
javascript
function(index, range) { if(!lang.isNumber(range) || (range < 0)) { range = 1; } this._records.splice(index, range); //this._length = this._length - range; }
[ "function", "(", "index", ",", "range", ")", "{", "if", "(", "!", "lang", ".", "isNumber", "(", "range", ")", "||", "(", "range", "<", "0", ")", ")", "{", "range", "=", "1", ";", "}", "this", ".", "_records", ".", "splice", "(", "index", ",", "range", ")", ";", "//this._length = this._length - range;", "}" ]
Deletes Records from the RecordSet at the given index. If range is null, then only one Record is deleted. @method _deleteRecord @param index {Number} Position index. @param range {Number} (optional) How many Records to delete @private
[ "Deletes", "Records", "from", "the", "RecordSet", "at", "the", "given", "index", ".", "If", "range", "is", "null", "then", "only", "one", "Record", "is", "deleted", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L1784-L1790
42,455
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(record) { var i; if(record instanceof widget.Record) { for(i=0; i<this._records.length; i++) { if(this._records[i] && (this._records[i]._sId === record._sId)) { return record; } } } else if(lang.isNumber(record)) { if((record > -1) && (record < this.getLength())) { return this._records[record]; } } else if(lang.isString(record)) { for(i=0; i<this._records.length; i++) { if(this._records[i] && (this._records[i]._sId === record)) { return this._records[i]; } } } // Not a valid Record for this RecordSet return null; }
javascript
function(record) { var i; if(record instanceof widget.Record) { for(i=0; i<this._records.length; i++) { if(this._records[i] && (this._records[i]._sId === record._sId)) { return record; } } } else if(lang.isNumber(record)) { if((record > -1) && (record < this.getLength())) { return this._records[record]; } } else if(lang.isString(record)) { for(i=0; i<this._records.length; i++) { if(this._records[i] && (this._records[i]._sId === record)) { return this._records[i]; } } } // Not a valid Record for this RecordSet return null; }
[ "function", "(", "record", ")", "{", "var", "i", ";", "if", "(", "record", "instanceof", "widget", ".", "Record", ")", "{", "for", "(", "i", "=", "0", ";", "i", "<", "this", ".", "_records", ".", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "_records", "[", "i", "]", "&&", "(", "this", ".", "_records", "[", "i", "]", ".", "_sId", "===", "record", ".", "_sId", ")", ")", "{", "return", "record", ";", "}", "}", "}", "else", "if", "(", "lang", ".", "isNumber", "(", "record", ")", ")", "{", "if", "(", "(", "record", ">", "-", "1", ")", "&&", "(", "record", "<", "this", ".", "getLength", "(", ")", ")", ")", "{", "return", "this", ".", "_records", "[", "record", "]", ";", "}", "}", "else", "if", "(", "lang", ".", "isString", "(", "record", ")", ")", "{", "for", "(", "i", "=", "0", ";", "i", "<", "this", ".", "_records", ".", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "_records", "[", "i", "]", "&&", "(", "this", ".", "_records", "[", "i", "]", ".", "_sId", "===", "record", ")", ")", "{", "return", "this", ".", "_records", "[", "i", "]", ";", "}", "}", "}", "// Not a valid Record for this RecordSet", "return", "null", ";", "}" ]
Returns Record by ID or RecordSet position index. @method getRecord @param record {YAHOO.widget.Record | Number | String} Record instance, RecordSet position index, or Record ID. @return {YAHOO.widget.Record} Record object.
[ "Returns", "Record", "by", "ID", "or", "RecordSet", "position", "index", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L1837-L1861
42,456
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(index, range) { if(!lang.isNumber(index)) { return this._records; } if(!lang.isNumber(range)) { return this._records.slice(index); } return this._records.slice(index, index+range); }
javascript
function(index, range) { if(!lang.isNumber(index)) { return this._records; } if(!lang.isNumber(range)) { return this._records.slice(index); } return this._records.slice(index, index+range); }
[ "function", "(", "index", ",", "range", ")", "{", "if", "(", "!", "lang", ".", "isNumber", "(", "index", ")", ")", "{", "return", "this", ".", "_records", ";", "}", "if", "(", "!", "lang", ".", "isNumber", "(", "range", ")", ")", "{", "return", "this", ".", "_records", ".", "slice", "(", "index", ")", ";", "}", "return", "this", ".", "_records", ".", "slice", "(", "index", ",", "index", "+", "range", ")", ";", "}" ]
Returns an array of Records from the RecordSet. @method getRecords @param index {Number} (optional) Recordset position index of which Record to start at. @param range {Number} (optional) Number of Records to get. @return {YAHOO.widget.Record[]} Array of Records starting at given index and length equal to given range. If index is not given, all Records are returned.
[ "Returns", "an", "array", "of", "Records", "from", "the", "RecordSet", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L1873-L1881
42,457
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function (index, range) { var recs = this.getRecords(index,range); for (var i = 0; i < range; ++i) { if (typeof recs[i] === 'undefined') { return false; } } return true; }
javascript
function (index, range) { var recs = this.getRecords(index,range); for (var i = 0; i < range; ++i) { if (typeof recs[i] === 'undefined') { return false; } } return true; }
[ "function", "(", "index", ",", "range", ")", "{", "var", "recs", "=", "this", ".", "getRecords", "(", "index", ",", "range", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "range", ";", "++", "i", ")", "{", "if", "(", "typeof", "recs", "[", "i", "]", "===", "'undefined'", ")", "{", "return", "false", ";", "}", "}", "return", "true", ";", "}" ]
Returns a boolean indicating whether Records exist in the RecordSet at the specified index range. Returns true if and only if a Record exists at each index in the range. @method hasRecords @param index @param range @return {Boolean} true if all indices are populated in the RecordSet
[ "Returns", "a", "boolean", "indicating", "whether", "Records", "exist", "in", "the", "RecordSet", "at", "the", "specified", "index", "range", ".", "Returns", "true", "if", "and", "only", "if", "a", "Record", "exists", "at", "each", "index", "in", "the", "range", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L1892-L1900
42,458
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(oRecord) { if(oRecord) { for(var i=this._records.length-1; i>-1; i--) { if(this._records[i] && oRecord.getId() === this._records[i].getId()) { return i; } } } return null; }
javascript
function(oRecord) { if(oRecord) { for(var i=this._records.length-1; i>-1; i--) { if(this._records[i] && oRecord.getId() === this._records[i].getId()) { return i; } } } return null; }
[ "function", "(", "oRecord", ")", "{", "if", "(", "oRecord", ")", "{", "for", "(", "var", "i", "=", "this", ".", "_records", ".", "length", "-", "1", ";", "i", ">", "-", "1", ";", "i", "--", ")", "{", "if", "(", "this", ".", "_records", "[", "i", "]", "&&", "oRecord", ".", "getId", "(", ")", "===", "this", ".", "_records", "[", "i", "]", ".", "getId", "(", ")", ")", "{", "return", "i", ";", "}", "}", "}", "return", "null", ";", "}" ]
Returns current position index for the given Record. @method getRecordIndex @param oRecord {YAHOO.widget.Record} Record instance. @return {Number} Record's RecordSet position index.
[ "Returns", "current", "position", "index", "for", "the", "given", "Record", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L1910-L1920
42,459
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(aData, index) { if(lang.isArray(aData)) { var newRecords = [], idx,i,len; index = lang.isNumber(index) ? index : this._records.length; idx = index; // Can't go backwards bc we need to preserve order for(i=0,len=aData.length; i<len; ++i) { if(lang.isObject(aData[i])) { var record = this._addRecord(aData[i], idx++); newRecords.push(record); } } this.fireEvent("recordsAddEvent",{records:newRecords,data:aData}); return newRecords; } else if(lang.isObject(aData)) { var oRecord = this._addRecord(aData); this.fireEvent("recordsAddEvent",{records:[oRecord],data:aData}); return oRecord; } else { return null; } }
javascript
function(aData, index) { if(lang.isArray(aData)) { var newRecords = [], idx,i,len; index = lang.isNumber(index) ? index : this._records.length; idx = index; // Can't go backwards bc we need to preserve order for(i=0,len=aData.length; i<len; ++i) { if(lang.isObject(aData[i])) { var record = this._addRecord(aData[i], idx++); newRecords.push(record); } } this.fireEvent("recordsAddEvent",{records:newRecords,data:aData}); return newRecords; } else if(lang.isObject(aData)) { var oRecord = this._addRecord(aData); this.fireEvent("recordsAddEvent",{records:[oRecord],data:aData}); return oRecord; } else { return null; } }
[ "function", "(", "aData", ",", "index", ")", "{", "if", "(", "lang", ".", "isArray", "(", "aData", ")", ")", "{", "var", "newRecords", "=", "[", "]", ",", "idx", ",", "i", ",", "len", ";", "index", "=", "lang", ".", "isNumber", "(", "index", ")", "?", "index", ":", "this", ".", "_records", ".", "length", ";", "idx", "=", "index", ";", "// Can't go backwards bc we need to preserve order", "for", "(", "i", "=", "0", ",", "len", "=", "aData", ".", "length", ";", "i", "<", "len", ";", "++", "i", ")", "{", "if", "(", "lang", ".", "isObject", "(", "aData", "[", "i", "]", ")", ")", "{", "var", "record", "=", "this", ".", "_addRecord", "(", "aData", "[", "i", "]", ",", "idx", "++", ")", ";", "newRecords", ".", "push", "(", "record", ")", ";", "}", "}", "this", ".", "fireEvent", "(", "\"recordsAddEvent\"", ",", "{", "records", ":", "newRecords", ",", "data", ":", "aData", "}", ")", ";", "return", "newRecords", ";", "}", "else", "if", "(", "lang", ".", "isObject", "(", "aData", ")", ")", "{", "var", "oRecord", "=", "this", ".", "_addRecord", "(", "aData", ")", ";", "this", ".", "fireEvent", "(", "\"recordsAddEvent\"", ",", "{", "records", ":", "[", "oRecord", "]", ",", "data", ":", "aData", "}", ")", ";", "return", "oRecord", ";", "}", "else", "{", "return", "null", ";", "}", "}" ]
Adds multiple Records at once to the RecordSet at the given index with the given object literal data. If index is null, then the new Records are added to the end of the RecordSet. @method addRecords @param aData {Object[]} An object literal data or an array of data object literals. @param index {Number} (optional) Position index. @return {YAHOO.widget.Record[]} An array of Record instances.
[ "Adds", "multiple", "Records", "at", "once", "to", "the", "RecordSet", "at", "the", "given", "index", "with", "the", "given", "object", "literal", "data", ".", "If", "index", "is", "null", "then", "the", "new", "Records", "are", "added", "to", "the", "end", "of", "the", "RecordSet", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L1952-L1978
42,460
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(fnSort, desc, field) { return this._records.sort(function(a, b) {return fnSort(a, b, desc, field);}); }
javascript
function(fnSort, desc, field) { return this._records.sort(function(a, b) {return fnSort(a, b, desc, field);}); }
[ "function", "(", "fnSort", ",", "desc", ",", "field", ")", "{", "return", "this", ".", "_records", ".", "sort", "(", "function", "(", "a", ",", "b", ")", "{", "return", "fnSort", "(", "a", ",", "b", ",", "desc", ",", "field", ")", ";", "}", ")", ";", "}" ]
Sorts all Records by given function. Records keep their unique IDs but will have new RecordSet position indexes. @method sortRecords @param fnSort {Function} Reference to a sort function. @param desc {Boolean} True if sort direction is descending, false if sort direction is ascending. @param field {String} The field to sort by, from sortOptions.field @return {YAHOO.widget.Record[]} Sorted array of Records.
[ "Sorts", "all", "Records", "by", "given", "function", ".", "Records", "keep", "their", "unique", "IDs", "but", "will", "have", "new", "RecordSet", "position", "indexes", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L2131-L2133
42,461
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { if(DT._elColumnDragTarget) { var el = DT._elColumnDragTarget; YAHOO.util.Event.purgeElement(el); el.parentNode.removeChild(el); DT._elColumnDragTarget = null; } }
javascript
function() { if(DT._elColumnDragTarget) { var el = DT._elColumnDragTarget; YAHOO.util.Event.purgeElement(el); el.parentNode.removeChild(el); DT._elColumnDragTarget = null; } }
[ "function", "(", ")", "{", "if", "(", "DT", ".", "_elColumnDragTarget", ")", "{", "var", "el", "=", "DT", ".", "_elColumnDragTarget", ";", "YAHOO", ".", "util", ".", "Event", ".", "purgeElement", "(", "el", ")", ";", "el", ".", "parentNode", ".", "removeChild", "(", "el", ")", ";", "DT", ".", "_elColumnDragTarget", "=", "null", ";", "}", "}" ]
Destroys shared Column drag target. @method DataTable._destroyColumnDragTargetEl @private @static
[ "Destroys", "shared", "Column", "drag", "target", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3128-L3136
42,462
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { if(!DT._elColumnDragTarget) { // Attach Column drag target element as first child of body var elColumnDragTarget = document.createElement('div'); elColumnDragTarget.className = DT.CLASS_COLTARGET; elColumnDragTarget.style.display = "none"; document.body.insertBefore(elColumnDragTarget, document.body.firstChild); // Internal tracker of Column drag target DT._elColumnDragTarget = elColumnDragTarget; } return DT._elColumnDragTarget; }
javascript
function() { if(!DT._elColumnDragTarget) { // Attach Column drag target element as first child of body var elColumnDragTarget = document.createElement('div'); elColumnDragTarget.className = DT.CLASS_COLTARGET; elColumnDragTarget.style.display = "none"; document.body.insertBefore(elColumnDragTarget, document.body.firstChild); // Internal tracker of Column drag target DT._elColumnDragTarget = elColumnDragTarget; } return DT._elColumnDragTarget; }
[ "function", "(", ")", "{", "if", "(", "!", "DT", ".", "_elColumnDragTarget", ")", "{", "// Attach Column drag target element as first child of body", "var", "elColumnDragTarget", "=", "document", ".", "createElement", "(", "'div'", ")", ";", "elColumnDragTarget", ".", "className", "=", "DT", ".", "CLASS_COLTARGET", ";", "elColumnDragTarget", ".", "style", ".", "display", "=", "\"none\"", ";", "document", ".", "body", ".", "insertBefore", "(", "elColumnDragTarget", ",", "document", ".", "body", ".", "firstChild", ")", ";", "// Internal tracker of Column drag target", "DT", ".", "_elColumnDragTarget", "=", "elColumnDragTarget", ";", "}", "return", "DT", ".", "_elColumnDragTarget", ";", "}" ]
Creates HTML markup for shared Column drag target. @method DataTable._initColumnDragTargetEl @return {HTMLElement} Reference to Column drag target. @private @static
[ "Creates", "HTML", "markup", "for", "shared", "Column", "drag", "target", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3146-L3159
42,463
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { if(!DT._elColumnResizerProxy) { // Attach Column resizer element as first child of body var elColumnResizerProxy = document.createElement("div"); elColumnResizerProxy.id = "yui-dt-colresizerproxy"; // Needed for ColumnResizer elColumnResizerProxy.className = DT.CLASS_RESIZERPROXY; document.body.insertBefore(elColumnResizerProxy, document.body.firstChild); // Internal tracker of Column resizer proxy DT._elColumnResizerProxy = elColumnResizerProxy; } return DT._elColumnResizerProxy; }
javascript
function() { if(!DT._elColumnResizerProxy) { // Attach Column resizer element as first child of body var elColumnResizerProxy = document.createElement("div"); elColumnResizerProxy.id = "yui-dt-colresizerproxy"; // Needed for ColumnResizer elColumnResizerProxy.className = DT.CLASS_RESIZERPROXY; document.body.insertBefore(elColumnResizerProxy, document.body.firstChild); // Internal tracker of Column resizer proxy DT._elColumnResizerProxy = elColumnResizerProxy; } return DT._elColumnResizerProxy; }
[ "function", "(", ")", "{", "if", "(", "!", "DT", ".", "_elColumnResizerProxy", ")", "{", "// Attach Column resizer element as first child of body", "var", "elColumnResizerProxy", "=", "document", ".", "createElement", "(", "\"div\"", ")", ";", "elColumnResizerProxy", ".", "id", "=", "\"yui-dt-colresizerproxy\"", ";", "// Needed for ColumnResizer", "elColumnResizerProxy", ".", "className", "=", "DT", ".", "CLASS_RESIZERPROXY", ";", "document", ".", "body", ".", "insertBefore", "(", "elColumnResizerProxy", ",", "document", ".", "body", ".", "firstChild", ")", ";", "// Internal tracker of Column resizer proxy", "DT", ".", "_elColumnResizerProxy", "=", "elColumnResizerProxy", ";", "}", "return", "DT", ".", "_elColumnResizerProxy", ";", "}" ]
Creates HTML markup for shared Column resizer proxy. @method DataTable._initColumnResizerProxyEl @return {HTMLElement} Reference to Column resizer proxy. @private @static
[ "Creates", "HTML", "markup", "for", "shared", "Column", "resizer", "proxy", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3186-L3198
42,464
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(el, oRecord, oColumn, oData) { var sValue = lang.isValue(oData) ? oData : "Click"; //TODO: support YAHOO.widget.Button //if(YAHOO.widget.Button) { //} //else { el.innerHTML = "<button type=\"button\" class=\""+ DT.CLASS_BUTTON + "\">" + sValue + "</button>"; //} }
javascript
function(el, oRecord, oColumn, oData) { var sValue = lang.isValue(oData) ? oData : "Click"; //TODO: support YAHOO.widget.Button //if(YAHOO.widget.Button) { //} //else { el.innerHTML = "<button type=\"button\" class=\""+ DT.CLASS_BUTTON + "\">" + sValue + "</button>"; //} }
[ "function", "(", "el", ",", "oRecord", ",", "oColumn", ",", "oData", ")", "{", "var", "sValue", "=", "lang", ".", "isValue", "(", "oData", ")", "?", "oData", ":", "\"Click\"", ";", "//TODO: support YAHOO.widget.Button", "//if(YAHOO.widget.Button) {", "//}", "//else {", "el", ".", "innerHTML", "=", "\"<button type=\\\"button\\\" class=\\\"\"", "+", "DT", ".", "CLASS_BUTTON", "+", "\"\\\">\"", "+", "sValue", "+", "\"</button>\"", ";", "//}", "}" ]
Formats a BUTTON element. @method DataTable.formatButton @param el {HTMLElement} The element to format with markup. @param oRecord {YAHOO.widget.Record} Record instance. @param oColumn {YAHOO.widget.Column} Column instance. @param oData {Object | Boolean} Data value for the cell. By default, the value is what gets written to the BUTTON. @static
[ "Formats", "a", "BUTTON", "element", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3211-L3221
42,465
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(el, oRecord, oColumn, oData) { var bChecked = oData; bChecked = (bChecked) ? " checked=\"checked\"" : ""; el.innerHTML = "<input type=\"checkbox\"" + bChecked + " class=\"" + DT.CLASS_CHECKBOX + "\" />"; }
javascript
function(el, oRecord, oColumn, oData) { var bChecked = oData; bChecked = (bChecked) ? " checked=\"checked\"" : ""; el.innerHTML = "<input type=\"checkbox\"" + bChecked + " class=\"" + DT.CLASS_CHECKBOX + "\" />"; }
[ "function", "(", "el", ",", "oRecord", ",", "oColumn", ",", "oData", ")", "{", "var", "bChecked", "=", "oData", ";", "bChecked", "=", "(", "bChecked", ")", "?", "\" checked=\\\"checked\\\"\"", ":", "\"\"", ";", "el", ".", "innerHTML", "=", "\"<input type=\\\"checkbox\\\"\"", "+", "bChecked", "+", "\" class=\\\"\"", "+", "DT", ".", "CLASS_CHECKBOX", "+", "\"\\\" />\"", ";", "}" ]
Formats a CHECKBOX element. @method DataTable.formatCheckbox @param el {HTMLElement} The element to format with markup. @param oRecord {YAHOO.widget.Record} Record instance. @param oColumn {YAHOO.widget.Column} Column instance. @param oData {Object | Boolean} Data value for the cell. Can be a simple Boolean to indicate whether checkbox is checked or not. Can be object literal {checked:bBoolean, label:sLabel}. Other forms of oData require a custom formatter. @static
[ "Formats", "a", "CHECKBOX", "element", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3236-L3241
42,466
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(el, oRecord, oColumn, oData) { var oConfig = oColumn.dateOptions || this.get("dateOptions"); el.innerHTML = util.Date.format(oData, oConfig, oConfig.locale); }
javascript
function(el, oRecord, oColumn, oData) { var oConfig = oColumn.dateOptions || this.get("dateOptions"); el.innerHTML = util.Date.format(oData, oConfig, oConfig.locale); }
[ "function", "(", "el", ",", "oRecord", ",", "oColumn", ",", "oData", ")", "{", "var", "oConfig", "=", "oColumn", ".", "dateOptions", "||", "this", ".", "get", "(", "\"dateOptions\"", ")", ";", "el", ".", "innerHTML", "=", "util", ".", "Date", ".", "format", "(", "oData", ",", "oConfig", ",", "oConfig", ".", "locale", ")", ";", "}" ]
Formats JavaScript Dates. @method DataTable.formatDate @param el {HTMLElement} The element to format with markup. @param oRecord {YAHOO.widget.Record} Record instance. @param oColumn {YAHOO.widget.Column} Column instance. @param oData {Object} Data value for the cell, or null. @static
[ "Formats", "JavaScript", "Dates", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3267-L3270
42,467
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(el, oRecord, oColumn, oData) { var selectedValue = (lang.isValue(oData)) ? oData : oRecord.getData(oColumn.field), options = (lang.isArray(oColumn.dropdownOptions)) ? oColumn.dropdownOptions : null, selectEl, collection = el.getElementsByTagName("select"); // Create the form element only once, so we can attach the onChange listener if(collection.length === 0) { // Create SELECT element selectEl = document.createElement("select"); selectEl.className = DT.CLASS_DROPDOWN; selectEl = el.appendChild(selectEl); // Add event listener Ev.addListener(selectEl,"change",this._onDropdownChange,this); } selectEl = collection[0]; // Update the form element if(selectEl) { // Clear out previous options selectEl.innerHTML = ""; // We have options to populate if(options) { // Create OPTION elements for(var i=0; i<options.length; i++) { var option = options[i]; var optionEl = document.createElement("option"); optionEl.value = (lang.isValue(option.value)) ? option.value : option; // Bug 2334323: Support legacy text, support label for consistency with DropdownCellEditor optionEl.innerHTML = (lang.isValue(option.text)) ? option.text : (lang.isValue(option.label)) ? option.label : option; optionEl = selectEl.appendChild(optionEl); if (optionEl.value == selectedValue) { optionEl.selected = true; } } } // Selected value is our only option else { selectEl.innerHTML = "<option selected value=\"" + selectedValue + "\">" + selectedValue + "</option>"; } } else { el.innerHTML = lang.isValue(oData) ? oData : ""; } }
javascript
function(el, oRecord, oColumn, oData) { var selectedValue = (lang.isValue(oData)) ? oData : oRecord.getData(oColumn.field), options = (lang.isArray(oColumn.dropdownOptions)) ? oColumn.dropdownOptions : null, selectEl, collection = el.getElementsByTagName("select"); // Create the form element only once, so we can attach the onChange listener if(collection.length === 0) { // Create SELECT element selectEl = document.createElement("select"); selectEl.className = DT.CLASS_DROPDOWN; selectEl = el.appendChild(selectEl); // Add event listener Ev.addListener(selectEl,"change",this._onDropdownChange,this); } selectEl = collection[0]; // Update the form element if(selectEl) { // Clear out previous options selectEl.innerHTML = ""; // We have options to populate if(options) { // Create OPTION elements for(var i=0; i<options.length; i++) { var option = options[i]; var optionEl = document.createElement("option"); optionEl.value = (lang.isValue(option.value)) ? option.value : option; // Bug 2334323: Support legacy text, support label for consistency with DropdownCellEditor optionEl.innerHTML = (lang.isValue(option.text)) ? option.text : (lang.isValue(option.label)) ? option.label : option; optionEl = selectEl.appendChild(optionEl); if (optionEl.value == selectedValue) { optionEl.selected = true; } } } // Selected value is our only option else { selectEl.innerHTML = "<option selected value=\"" + selectedValue + "\">" + selectedValue + "</option>"; } } else { el.innerHTML = lang.isValue(oData) ? oData : ""; } }
[ "function", "(", "el", ",", "oRecord", ",", "oColumn", ",", "oData", ")", "{", "var", "selectedValue", "=", "(", "lang", ".", "isValue", "(", "oData", ")", ")", "?", "oData", ":", "oRecord", ".", "getData", "(", "oColumn", ".", "field", ")", ",", "options", "=", "(", "lang", ".", "isArray", "(", "oColumn", ".", "dropdownOptions", ")", ")", "?", "oColumn", ".", "dropdownOptions", ":", "null", ",", "selectEl", ",", "collection", "=", "el", ".", "getElementsByTagName", "(", "\"select\"", ")", ";", "// Create the form element only once, so we can attach the onChange listener", "if", "(", "collection", ".", "length", "===", "0", ")", "{", "// Create SELECT element", "selectEl", "=", "document", ".", "createElement", "(", "\"select\"", ")", ";", "selectEl", ".", "className", "=", "DT", ".", "CLASS_DROPDOWN", ";", "selectEl", "=", "el", ".", "appendChild", "(", "selectEl", ")", ";", "// Add event listener", "Ev", ".", "addListener", "(", "selectEl", ",", "\"change\"", ",", "this", ".", "_onDropdownChange", ",", "this", ")", ";", "}", "selectEl", "=", "collection", "[", "0", "]", ";", "// Update the form element", "if", "(", "selectEl", ")", "{", "// Clear out previous options", "selectEl", ".", "innerHTML", "=", "\"\"", ";", "// We have options to populate", "if", "(", "options", ")", "{", "// Create OPTION elements", "for", "(", "var", "i", "=", "0", ";", "i", "<", "options", ".", "length", ";", "i", "++", ")", "{", "var", "option", "=", "options", "[", "i", "]", ";", "var", "optionEl", "=", "document", ".", "createElement", "(", "\"option\"", ")", ";", "optionEl", ".", "value", "=", "(", "lang", ".", "isValue", "(", "option", ".", "value", ")", ")", "?", "option", ".", "value", ":", "option", ";", "// Bug 2334323: Support legacy text, support label for consistency with DropdownCellEditor", "optionEl", ".", "innerHTML", "=", "(", "lang", ".", "isValue", "(", "option", ".", "text", ")", ")", "?", "option", ".", "text", ":", "(", "lang", ".", "isValue", "(", "option", ".", "label", ")", ")", "?", "option", ".", "label", ":", "option", ";", "optionEl", "=", "selectEl", ".", "appendChild", "(", "optionEl", ")", ";", "if", "(", "optionEl", ".", "value", "==", "selectedValue", ")", "{", "optionEl", ".", "selected", "=", "true", ";", "}", "}", "}", "// Selected value is our only option", "else", "{", "selectEl", ".", "innerHTML", "=", "\"<option selected value=\\\"\"", "+", "selectedValue", "+", "\"\\\">\"", "+", "selectedValue", "+", "\"</option>\"", ";", "}", "}", "else", "{", "el", ".", "innerHTML", "=", "lang", ".", "isValue", "(", "oData", ")", "?", "oData", ":", "\"\"", ";", "}", "}" ]
Formats SELECT elements. @method DataTable.formatDropdown @param el {HTMLElement} The element to format with markup. @param oRecord {YAHOO.widget.Record} Record instance. @param oColumn {YAHOO.widget.Column} Column instance. @param oData {Object} Data value for the cell, or null. @static
[ "Formats", "SELECT", "elements", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3282-L3333
42,468
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(el, oRecord, oColumn, oData) { if(lang.isString(oData)) { el.innerHTML = "<a href=\"mailto:" + oData + "\">" + oData + "</a>"; } else { el.innerHTML = lang.isValue(oData) ? oData : ""; } }
javascript
function(el, oRecord, oColumn, oData) { if(lang.isString(oData)) { el.innerHTML = "<a href=\"mailto:" + oData + "\">" + oData + "</a>"; } else { el.innerHTML = lang.isValue(oData) ? oData : ""; } }
[ "function", "(", "el", ",", "oRecord", ",", "oColumn", ",", "oData", ")", "{", "if", "(", "lang", ".", "isString", "(", "oData", ")", ")", "{", "el", ".", "innerHTML", "=", "\"<a href=\\\"mailto:\"", "+", "oData", "+", "\"\\\">\"", "+", "oData", "+", "\"</a>\"", ";", "}", "else", "{", "el", ".", "innerHTML", "=", "lang", ".", "isValue", "(", "oData", ")", "?", "oData", ":", "\"\"", ";", "}", "}" ]
Formats emails. @method DataTable.formatEmail @param el {HTMLElement} The element to format with markup. @param oRecord {YAHOO.widget.Record} Record instance. @param oColumn {YAHOO.widget.Column} Column instance. @param oData {Object} Data value for the cell, or null. @static
[ "Formats", "emails", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3345-L3352
42,469
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(el, oRecord, oColumn, oData) { el.innerHTML = util.Number.format(oData, oColumn.numberOptions || this.get("numberOptions")); }
javascript
function(el, oRecord, oColumn, oData) { el.innerHTML = util.Number.format(oData, oColumn.numberOptions || this.get("numberOptions")); }
[ "function", "(", "el", ",", "oRecord", ",", "oColumn", ",", "oData", ")", "{", "el", ".", "innerHTML", "=", "util", ".", "Number", ".", "format", "(", "oData", ",", "oColumn", ".", "numberOptions", "||", "this", ".", "get", "(", "\"numberOptions\"", ")", ")", ";", "}" ]
Formats numbers. @method DataTable.formatNumber @param el {HTMLElement} The element to format with markup. @param oRecord {YAHOO.widget.Record} Record instance. @param oColumn {YAHOO.widget.Column} Column instance. @param oData {Object} Data value for the cell, or null. @static
[ "Formats", "numbers", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3383-L3385
42,470
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(el, oRecord, oColumn, oData) { var bChecked = oData; bChecked = (bChecked) ? " checked=\"checked\"" : ""; el.innerHTML = "<input type=\"radio\"" + bChecked + " name=\""+this.getId()+"-col-" + oColumn.getSanitizedKey() + "\"" + " class=\"" + DT.CLASS_RADIO+ "\" />"; }
javascript
function(el, oRecord, oColumn, oData) { var bChecked = oData; bChecked = (bChecked) ? " checked=\"checked\"" : ""; el.innerHTML = "<input type=\"radio\"" + bChecked + " name=\""+this.getId()+"-col-" + oColumn.getSanitizedKey() + "\"" + " class=\"" + DT.CLASS_RADIO+ "\" />"; }
[ "function", "(", "el", ",", "oRecord", ",", "oColumn", ",", "oData", ")", "{", "var", "bChecked", "=", "oData", ";", "bChecked", "=", "(", "bChecked", ")", "?", "\" checked=\\\"checked\\\"\"", ":", "\"\"", ";", "el", ".", "innerHTML", "=", "\"<input type=\\\"radio\\\"\"", "+", "bChecked", "+", "\" name=\\\"\"", "+", "this", ".", "getId", "(", ")", "+", "\"-col-\"", "+", "oColumn", ".", "getSanitizedKey", "(", ")", "+", "\"\\\"\"", "+", "\" class=\\\"\"", "+", "DT", ".", "CLASS_RADIO", "+", "\"\\\" />\"", ";", "}" ]
Formats INPUT TYPE=RADIO elements. @method DataTable.formatRadio @param el {HTMLElement} The element to format with markup. @param oRecord {YAHOO.widget.Record} Record instance. @param oColumn {YAHOO.widget.Column} Column instance. @param oData {Object} (Optional) Data value for the cell. @static
[ "Formats", "INPUT", "TYPE", "=", "RADIO", "elements", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3397-L3403
42,471
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(el, oRecord, oColumn, oData) { var value = (lang.isValue(oData)) ? oData : ""; //TODO: move to util function el.innerHTML = value.toString().replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;"); }
javascript
function(el, oRecord, oColumn, oData) { var value = (lang.isValue(oData)) ? oData : ""; //TODO: move to util function el.innerHTML = value.toString().replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;"); }
[ "function", "(", "el", ",", "oRecord", ",", "oColumn", ",", "oData", ")", "{", "var", "value", "=", "(", "lang", ".", "isValue", "(", "oData", ")", ")", "?", "oData", ":", "\"\"", ";", "//TODO: move to util function", "el", ".", "innerHTML", "=", "value", ".", "toString", "(", ")", ".", "replace", "(", "/", "&", "/", "g", ",", "\"&#38;\"", ")", ".", "replace", "(", "/", "<", "/", "g", ",", "\"&#60;\"", ")", ".", "replace", "(", "/", ">", "/", "g", ",", "\"&#62;\"", ")", ";", "}" ]
Formats text strings. @method DataTable.formatText @param el {HTMLElement} The element to format with markup. @param oRecord {YAHOO.widget.Record} Record instance. @param oColumn {YAHOO.widget.Column} Column instance. @param oData {Object} (Optional) Data value for the cell. @static
[ "Formats", "text", "strings", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3415-L3419
42,472
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(el, oRecord, oColumn, oData) { var value = (lang.isValue(oData)) ? oData : "", markup = "<textarea>" + value + "</textarea>"; el.innerHTML = markup; }
javascript
function(el, oRecord, oColumn, oData) { var value = (lang.isValue(oData)) ? oData : "", markup = "<textarea>" + value + "</textarea>"; el.innerHTML = markup; }
[ "function", "(", "el", ",", "oRecord", ",", "oColumn", ",", "oData", ")", "{", "var", "value", "=", "(", "lang", ".", "isValue", "(", "oData", ")", ")", "?", "oData", ":", "\"\"", ",", "markup", "=", "\"<textarea>\"", "+", "value", "+", "\"</textarea>\"", ";", "el", ".", "innerHTML", "=", "markup", ";", "}" ]
Formats TEXTAREA elements. @method DataTable.formatTextarea @param el {HTMLElement} The element to format with markup. @param oRecord {YAHOO.widget.Record} Record instance. @param oColumn {YAHOO.widget.Column} Column instance. @param oData {Object} (Optional) Data value for the cell. @static
[ "Formats", "TEXTAREA", "elements", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3431-L3435
42,473
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(el, oRecord, oColumn, oData) { el.innerHTML = oData === undefined || oData === null || (typeof oData === 'number' && isNaN(oData)) ? "&#160;" : oData.toString(); }
javascript
function(el, oRecord, oColumn, oData) { el.innerHTML = oData === undefined || oData === null || (typeof oData === 'number' && isNaN(oData)) ? "&#160;" : oData.toString(); }
[ "function", "(", "el", ",", "oRecord", ",", "oColumn", ",", "oData", ")", "{", "el", ".", "innerHTML", "=", "oData", "===", "undefined", "||", "oData", "===", "null", "||", "(", "typeof", "oData", "===", "'number'", "&&", "isNaN", "(", "oData", ")", ")", "?", "\"&#160;\"", ":", "oData", ".", "toString", "(", ")", ";", "}" ]
Default cell formatter @method DataTable.formatDefault @param el {HTMLElement} The element to format with markup. @param oRecord {YAHOO.widget.Record} Record instance. @param oColumn {YAHOO.widget.Column} Column instance. @param oData {Object} (Optional) Data value for the cell. @static
[ "Default", "cell", "formatter" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L3463-L3468
42,474
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(aColumnDefs) { var oColumn, i, len; if(this._oColumnSet) { // First clear _oDynStyles for existing ColumnSet and // uregister CellEditor Custom Events for(i=0, len=this._oColumnSet.keys.length; i<len; i++) { oColumn = this._oColumnSet.keys[i]; DT._oDynStyles["."+this.getId()+"-col-"+oColumn.getSanitizedKey()+" ."+DT.CLASS_LINER] = undefined; if(oColumn.editor && oColumn.editor.unsubscribeAll) { // Backward compatibility oColumn.editor.unsubscribeAll(); } } this._oColumnSet = null; this._clearTrTemplateEl(); } if(lang.isArray(aColumnDefs)) { this._oColumnSet = new YAHOO.widget.ColumnSet(aColumnDefs); } // Backward compatibility else if(aColumnDefs instanceof YAHOO.widget.ColumnSet) { this._oColumnSet = aColumnDefs; } // Register CellEditor Custom Events var allKeys = this._oColumnSet.keys; for(i=0, len=allKeys.length; i<len; i++) { oColumn = allKeys[i]; if(oColumn.editor && oColumn.editor.subscribe) { // Backward incompatibility oColumn.editor.subscribe("showEvent", this._onEditorShowEvent, this, true); oColumn.editor.subscribe("keydownEvent", this._onEditorKeydownEvent, this, true); oColumn.editor.subscribe("revertEvent", this._onEditorRevertEvent, this, true); oColumn.editor.subscribe("saveEvent", this._onEditorSaveEvent, this, true); oColumn.editor.subscribe("cancelEvent", this._onEditorCancelEvent, this, true); oColumn.editor.subscribe("blurEvent", this._onEditorBlurEvent, this, true); oColumn.editor.subscribe("blockEvent", this._onEditorBlockEvent, this, true); oColumn.editor.subscribe("unblockEvent", this._onEditorUnblockEvent, this, true); } } }
javascript
function(aColumnDefs) { var oColumn, i, len; if(this._oColumnSet) { // First clear _oDynStyles for existing ColumnSet and // uregister CellEditor Custom Events for(i=0, len=this._oColumnSet.keys.length; i<len; i++) { oColumn = this._oColumnSet.keys[i]; DT._oDynStyles["."+this.getId()+"-col-"+oColumn.getSanitizedKey()+" ."+DT.CLASS_LINER] = undefined; if(oColumn.editor && oColumn.editor.unsubscribeAll) { // Backward compatibility oColumn.editor.unsubscribeAll(); } } this._oColumnSet = null; this._clearTrTemplateEl(); } if(lang.isArray(aColumnDefs)) { this._oColumnSet = new YAHOO.widget.ColumnSet(aColumnDefs); } // Backward compatibility else if(aColumnDefs instanceof YAHOO.widget.ColumnSet) { this._oColumnSet = aColumnDefs; } // Register CellEditor Custom Events var allKeys = this._oColumnSet.keys; for(i=0, len=allKeys.length; i<len; i++) { oColumn = allKeys[i]; if(oColumn.editor && oColumn.editor.subscribe) { // Backward incompatibility oColumn.editor.subscribe("showEvent", this._onEditorShowEvent, this, true); oColumn.editor.subscribe("keydownEvent", this._onEditorKeydownEvent, this, true); oColumn.editor.subscribe("revertEvent", this._onEditorRevertEvent, this, true); oColumn.editor.subscribe("saveEvent", this._onEditorSaveEvent, this, true); oColumn.editor.subscribe("cancelEvent", this._onEditorCancelEvent, this, true); oColumn.editor.subscribe("blurEvent", this._onEditorBlurEvent, this, true); oColumn.editor.subscribe("blockEvent", this._onEditorBlockEvent, this, true); oColumn.editor.subscribe("unblockEvent", this._onEditorUnblockEvent, this, true); } } }
[ "function", "(", "aColumnDefs", ")", "{", "var", "oColumn", ",", "i", ",", "len", ";", "if", "(", "this", ".", "_oColumnSet", ")", "{", "// First clear _oDynStyles for existing ColumnSet and", "// uregister CellEditor Custom Events", "for", "(", "i", "=", "0", ",", "len", "=", "this", ".", "_oColumnSet", ".", "keys", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "oColumn", "=", "this", ".", "_oColumnSet", ".", "keys", "[", "i", "]", ";", "DT", ".", "_oDynStyles", "[", "\".\"", "+", "this", ".", "getId", "(", ")", "+", "\"-col-\"", "+", "oColumn", ".", "getSanitizedKey", "(", ")", "+", "\" .\"", "+", "DT", ".", "CLASS_LINER", "]", "=", "undefined", ";", "if", "(", "oColumn", ".", "editor", "&&", "oColumn", ".", "editor", ".", "unsubscribeAll", ")", "{", "// Backward compatibility", "oColumn", ".", "editor", ".", "unsubscribeAll", "(", ")", ";", "}", "}", "this", ".", "_oColumnSet", "=", "null", ";", "this", ".", "_clearTrTemplateEl", "(", ")", ";", "}", "if", "(", "lang", ".", "isArray", "(", "aColumnDefs", ")", ")", "{", "this", ".", "_oColumnSet", "=", "new", "YAHOO", ".", "widget", ".", "ColumnSet", "(", "aColumnDefs", ")", ";", "}", "// Backward compatibility", "else", "if", "(", "aColumnDefs", "instanceof", "YAHOO", ".", "widget", ".", "ColumnSet", ")", "{", "this", ".", "_oColumnSet", "=", "aColumnDefs", ";", "}", "// Register CellEditor Custom Events", "var", "allKeys", "=", "this", ".", "_oColumnSet", ".", "keys", ";", "for", "(", "i", "=", "0", ",", "len", "=", "allKeys", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "oColumn", "=", "allKeys", "[", "i", "]", ";", "if", "(", "oColumn", ".", "editor", "&&", "oColumn", ".", "editor", ".", "subscribe", ")", "{", "// Backward incompatibility", "oColumn", ".", "editor", ".", "subscribe", "(", "\"showEvent\"", ",", "this", ".", "_onEditorShowEvent", ",", "this", ",", "true", ")", ";", "oColumn", ".", "editor", ".", "subscribe", "(", "\"keydownEvent\"", ",", "this", ".", "_onEditorKeydownEvent", ",", "this", ",", "true", ")", ";", "oColumn", ".", "editor", ".", "subscribe", "(", "\"revertEvent\"", ",", "this", ".", "_onEditorRevertEvent", ",", "this", ",", "true", ")", ";", "oColumn", ".", "editor", ".", "subscribe", "(", "\"saveEvent\"", ",", "this", ".", "_onEditorSaveEvent", ",", "this", ",", "true", ")", ";", "oColumn", ".", "editor", ".", "subscribe", "(", "\"cancelEvent\"", ",", "this", ".", "_onEditorCancelEvent", ",", "this", ",", "true", ")", ";", "oColumn", ".", "editor", ".", "subscribe", "(", "\"blurEvent\"", ",", "this", ".", "_onEditorBlurEvent", ",", "this", ",", "true", ")", ";", "oColumn", ".", "editor", ".", "subscribe", "(", "\"blockEvent\"", ",", "this", ".", "_onEditorBlockEvent", ",", "this", ",", "true", ")", ";", "oColumn", ".", "editor", ".", "subscribe", "(", "\"unblockEvent\"", ",", "this", ".", "_onEditorUnblockEvent", ",", "this", ",", "true", ")", ";", "}", "}", "}" ]
Initializes ColumnSet. @method _initColumnSet @param aColumnDefs {Object[]} Array of object literal Column definitions. @private
[ "Initializes", "ColumnSet", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4376-L4417
42,475
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(elContainer) { Dom.removeClass(elContainer, DT.CLASS_DATATABLE); Ev.purgeElement(elContainer, true); elContainer.innerHTML = ""; this._elContainer = null; this._elColgroup = null; this._elThead = null; this._elTbody = null; }
javascript
function(elContainer) { Dom.removeClass(elContainer, DT.CLASS_DATATABLE); Ev.purgeElement(elContainer, true); elContainer.innerHTML = ""; this._elContainer = null; this._elColgroup = null; this._elThead = null; this._elTbody = null; }
[ "function", "(", "elContainer", ")", "{", "Dom", ".", "removeClass", "(", "elContainer", ",", "DT", ".", "CLASS_DATATABLE", ")", ";", "Ev", ".", "purgeElement", "(", "elContainer", ",", "true", ")", ";", "elContainer", ".", "innerHTML", "=", "\"\"", ";", "this", ".", "_elContainer", "=", "null", ";", "this", ".", "_elColgroup", "=", "null", ";", "this", ".", "_elThead", "=", "null", ";", "this", ".", "_elTbody", "=", "null", ";", "}" ]
Destroy's the DataTable outer container element, if available. @method _destroyContainerEl @param elContainer {HTMLElement} Reference to the container element. @private
[ "Destroy", "s", "the", "DataTable", "outer", "container", "element", "if", "available", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4514-L4523
42,476
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(elContainer) { // Validate container elContainer = Dom.get(elContainer); if(elContainer && elContainer.nodeName && (elContainer.nodeName.toLowerCase() == "div")) { // Destroy previous this._destroyContainerEl(elContainer); Dom.addClass(elContainer, DT.CLASS_DATATABLE); Ev.addListener(elContainer, "focus", this._onTableFocus, this); Ev.addListener(elContainer, "dblclick", this._onTableDblclick, this); this._elContainer = elContainer; var elMask = document.createElement("div"); elMask.className = DT.CLASS_MASK; elMask.style.display = "none"; this._elMask = elContainer.appendChild(elMask); } }
javascript
function(elContainer) { // Validate container elContainer = Dom.get(elContainer); if(elContainer && elContainer.nodeName && (elContainer.nodeName.toLowerCase() == "div")) { // Destroy previous this._destroyContainerEl(elContainer); Dom.addClass(elContainer, DT.CLASS_DATATABLE); Ev.addListener(elContainer, "focus", this._onTableFocus, this); Ev.addListener(elContainer, "dblclick", this._onTableDblclick, this); this._elContainer = elContainer; var elMask = document.createElement("div"); elMask.className = DT.CLASS_MASK; elMask.style.display = "none"; this._elMask = elContainer.appendChild(elMask); } }
[ "function", "(", "elContainer", ")", "{", "// Validate container", "elContainer", "=", "Dom", ".", "get", "(", "elContainer", ")", ";", "if", "(", "elContainer", "&&", "elContainer", ".", "nodeName", "&&", "(", "elContainer", ".", "nodeName", ".", "toLowerCase", "(", ")", "==", "\"div\"", ")", ")", "{", "// Destroy previous", "this", ".", "_destroyContainerEl", "(", "elContainer", ")", ";", "Dom", ".", "addClass", "(", "elContainer", ",", "DT", ".", "CLASS_DATATABLE", ")", ";", "Ev", ".", "addListener", "(", "elContainer", ",", "\"focus\"", ",", "this", ".", "_onTableFocus", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elContainer", ",", "\"dblclick\"", ",", "this", ".", "_onTableDblclick", ",", "this", ")", ";", "this", ".", "_elContainer", "=", "elContainer", ";", "var", "elMask", "=", "document", ".", "createElement", "(", "\"div\"", ")", ";", "elMask", ".", "className", "=", "DT", ".", "CLASS_MASK", ";", "elMask", ".", "style", ".", "display", "=", "\"none\"", ";", "this", ".", "_elMask", "=", "elContainer", ".", "appendChild", "(", "elMask", ")", ";", "}", "}" ]
Initializes the DataTable outer container element, including a mask. @method _initContainerEl @param elContainer {HTMLElement | String} HTML DIV element by reference or ID. @private
[ "Initializes", "the", "DataTable", "outer", "container", "element", "including", "a", "mask", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4532-L4550
42,477
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { var elTable = this._elTable; if(elTable) { Ev.purgeElement(elTable, true); elTable.parentNode.removeChild(elTable); this._elCaption = null; this._elColgroup = null; this._elThead = null; this._elTbody = null; } }
javascript
function() { var elTable = this._elTable; if(elTable) { Ev.purgeElement(elTable, true); elTable.parentNode.removeChild(elTable); this._elCaption = null; this._elColgroup = null; this._elThead = null; this._elTbody = null; } }
[ "function", "(", ")", "{", "var", "elTable", "=", "this", ".", "_elTable", ";", "if", "(", "elTable", ")", "{", "Ev", ".", "purgeElement", "(", "elTable", ",", "true", ")", ";", "elTable", ".", "parentNode", ".", "removeChild", "(", "elTable", ")", ";", "this", ".", "_elCaption", "=", "null", ";", "this", ".", "_elColgroup", "=", "null", ";", "this", ".", "_elThead", "=", "null", ";", "this", ".", "_elTbody", "=", "null", ";", "}", "}" ]
Destroy's the DataTable TABLE element, if available. @method _destroyTableEl @private
[ "Destroy", "s", "the", "DataTable", "TABLE", "element", "if", "available", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4558-L4568
42,478
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(sCaption) { if(this._elTable && sCaption) { // Create CAPTION element if(!this._elCaption) { this._elCaption = this._elTable.createCaption(); } // Set CAPTION value this._elCaption.innerHTML = sCaption; } else if(this._elCaption) { this._elCaption.parentNode.removeChild(this._elCaption); } }
javascript
function(sCaption) { if(this._elTable && sCaption) { // Create CAPTION element if(!this._elCaption) { this._elCaption = this._elTable.createCaption(); } // Set CAPTION value this._elCaption.innerHTML = sCaption; } else if(this._elCaption) { this._elCaption.parentNode.removeChild(this._elCaption); } }
[ "function", "(", "sCaption", ")", "{", "if", "(", "this", ".", "_elTable", "&&", "sCaption", ")", "{", "// Create CAPTION element", "if", "(", "!", "this", ".", "_elCaption", ")", "{", "this", ".", "_elCaption", "=", "this", ".", "_elTable", ".", "createCaption", "(", ")", ";", "}", "// Set CAPTION value", "this", ".", "_elCaption", ".", "innerHTML", "=", "sCaption", ";", "}", "else", "if", "(", "this", ".", "_elCaption", ")", "{", "this", ".", "_elCaption", ".", "parentNode", ".", "removeChild", "(", "this", ".", "_elCaption", ")", ";", "}", "}" ]
Creates HTML markup CAPTION element. @method _initCaptionEl @param sCaption {String} Text for caption. @private
[ "Creates", "HTML", "markup", "CAPTION", "element", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4577-L4589
42,479
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(elContainer) { if(elContainer) { // Destroy previous this._destroyTableEl(); // Create TABLE this._elTable = elContainer.appendChild(document.createElement("table")); // Set SUMMARY attribute this._elTable.summary = this.get("summary"); // Create CAPTION element if(this.get("caption")) { this._initCaptionEl(this.get("caption")); } } }
javascript
function(elContainer) { if(elContainer) { // Destroy previous this._destroyTableEl(); // Create TABLE this._elTable = elContainer.appendChild(document.createElement("table")); // Set SUMMARY attribute this._elTable.summary = this.get("summary"); // Create CAPTION element if(this.get("caption")) { this._initCaptionEl(this.get("caption")); } } }
[ "function", "(", "elContainer", ")", "{", "if", "(", "elContainer", ")", "{", "// Destroy previous", "this", ".", "_destroyTableEl", "(", ")", ";", "// Create TABLE", "this", ".", "_elTable", "=", "elContainer", ".", "appendChild", "(", "document", ".", "createElement", "(", "\"table\"", ")", ")", ";", "// Set SUMMARY attribute", "this", ".", "_elTable", ".", "summary", "=", "this", ".", "get", "(", "\"summary\"", ")", ";", "// Create CAPTION element", "if", "(", "this", ".", "get", "(", "\"caption\"", ")", ")", "{", "this", ".", "_initCaptionEl", "(", "this", ".", "get", "(", "\"caption\"", ")", ")", ";", "}", "}", "}" ]
Creates HTML markup for TABLE, COLGROUP, THEAD and TBODY elements in outer container element. @method _initTableEl @param elContainer {HTMLElement} Container element into which to create TABLE. @private
[ "Creates", "HTML", "markup", "for", "TABLE", "COLGROUP", "THEAD", "and", "TBODY", "elements", "in", "outer", "container", "element", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4599-L4615
42,480
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { var elColgroup = this._elColgroup; if(elColgroup) { var elTable = elColgroup.parentNode; Ev.purgeElement(elColgroup, true); elTable.removeChild(elColgroup); this._elColgroup = null; } }
javascript
function() { var elColgroup = this._elColgroup; if(elColgroup) { var elTable = elColgroup.parentNode; Ev.purgeElement(elColgroup, true); elTable.removeChild(elColgroup); this._elColgroup = null; } }
[ "function", "(", ")", "{", "var", "elColgroup", "=", "this", ".", "_elColgroup", ";", "if", "(", "elColgroup", ")", "{", "var", "elTable", "=", "elColgroup", ".", "parentNode", ";", "Ev", ".", "purgeElement", "(", "elColgroup", ",", "true", ")", ";", "elTable", ".", "removeChild", "(", "elColgroup", ")", ";", "this", ".", "_elColgroup", "=", "null", ";", "}", "}" ]
Destroy's the DataTable COLGROUP element, if available. @method _destroyColgroupEl @private
[ "Destroy", "s", "the", "DataTable", "COLGROUP", "element", "if", "available", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4623-L4631
42,481
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(elTable) { if(elTable) { // Destroy previous this._destroyColgroupEl(); // Add COLs to DOCUMENT FRAGMENT var allCols = this._aColIds || [], allKeys = this._oColumnSet.keys, i = 0, len = allCols.length, elCol, oColumn, elFragment = document.createDocumentFragment(), elColTemplate = document.createElement("col"); for(i=0,len=allKeys.length; i<len; i++) { oColumn = allKeys[i]; elCol = elFragment.appendChild(elColTemplate.cloneNode(false)); } // Create COLGROUP var elColgroup = elTable.insertBefore(document.createElement("colgroup"), elTable.firstChild); elColgroup.appendChild(elFragment); this._elColgroup = elColgroup; } }
javascript
function(elTable) { if(elTable) { // Destroy previous this._destroyColgroupEl(); // Add COLs to DOCUMENT FRAGMENT var allCols = this._aColIds || [], allKeys = this._oColumnSet.keys, i = 0, len = allCols.length, elCol, oColumn, elFragment = document.createDocumentFragment(), elColTemplate = document.createElement("col"); for(i=0,len=allKeys.length; i<len; i++) { oColumn = allKeys[i]; elCol = elFragment.appendChild(elColTemplate.cloneNode(false)); } // Create COLGROUP var elColgroup = elTable.insertBefore(document.createElement("colgroup"), elTable.firstChild); elColgroup.appendChild(elFragment); this._elColgroup = elColgroup; } }
[ "function", "(", "elTable", ")", "{", "if", "(", "elTable", ")", "{", "// Destroy previous", "this", ".", "_destroyColgroupEl", "(", ")", ";", "// Add COLs to DOCUMENT FRAGMENT", "var", "allCols", "=", "this", ".", "_aColIds", "||", "[", "]", ",", "allKeys", "=", "this", ".", "_oColumnSet", ".", "keys", ",", "i", "=", "0", ",", "len", "=", "allCols", ".", "length", ",", "elCol", ",", "oColumn", ",", "elFragment", "=", "document", ".", "createDocumentFragment", "(", ")", ",", "elColTemplate", "=", "document", ".", "createElement", "(", "\"col\"", ")", ";", "for", "(", "i", "=", "0", ",", "len", "=", "allKeys", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "oColumn", "=", "allKeys", "[", "i", "]", ";", "elCol", "=", "elFragment", ".", "appendChild", "(", "elColTemplate", ".", "cloneNode", "(", "false", ")", ")", ";", "}", "// Create COLGROUP", "var", "elColgroup", "=", "elTable", ".", "insertBefore", "(", "document", ".", "createElement", "(", "\"colgroup\"", ")", ",", "elTable", ".", "firstChild", ")", ";", "elColgroup", ".", "appendChild", "(", "elFragment", ")", ";", "this", ".", "_elColgroup", "=", "elColgroup", ";", "}", "}" ]
Initializes COLGROUP and COL elements for managing minWidth. @method _initColgroupEl @param elTable {HTMLElement} TABLE element into which to create COLGROUP. @private
[ "Initializes", "COLGROUP", "and", "COL", "elements", "for", "managing", "minWidth", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4640-L4663
42,482
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(index) { if(lang.isNumber(index)&& this._elColgroup) { var nextSibling = this._elColgroup.childNodes[index] || null; this._elColgroup.insertBefore(document.createElement("col"), nextSibling); } }
javascript
function(index) { if(lang.isNumber(index)&& this._elColgroup) { var nextSibling = this._elColgroup.childNodes[index] || null; this._elColgroup.insertBefore(document.createElement("col"), nextSibling); } }
[ "function", "(", "index", ")", "{", "if", "(", "lang", ".", "isNumber", "(", "index", ")", "&&", "this", ".", "_elColgroup", ")", "{", "var", "nextSibling", "=", "this", ".", "_elColgroup", ".", "childNodes", "[", "index", "]", "||", "null", ";", "this", ".", "_elColgroup", ".", "insertBefore", "(", "document", ".", "createElement", "(", "\"col\"", ")", ",", "nextSibling", ")", ";", "}", "}" ]
Adds a COL element to COLGROUP at given index. @method _insertColgroupColEl @param index {Number} Index of new COL element. @private
[ "Adds", "a", "COL", "element", "to", "COLGROUP", "at", "given", "index", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4672-L4677
42,483
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(index) { if(lang.isNumber(index) && this._elColgroup && this._elColgroup.childNodes[index]) { this._elColgroup.removeChild(this._elColgroup.childNodes[index]); } }
javascript
function(index) { if(lang.isNumber(index) && this._elColgroup && this._elColgroup.childNodes[index]) { this._elColgroup.removeChild(this._elColgroup.childNodes[index]); } }
[ "function", "(", "index", ")", "{", "if", "(", "lang", ".", "isNumber", "(", "index", ")", "&&", "this", ".", "_elColgroup", "&&", "this", ".", "_elColgroup", ".", "childNodes", "[", "index", "]", ")", "{", "this", ".", "_elColgroup", ".", "removeChild", "(", "this", ".", "_elColgroup", ".", "childNodes", "[", "index", "]", ")", ";", "}", "}" ]
Removes a COL element to COLGROUP at given index. @method _removeColgroupColEl @param index {Number} Index of removed COL element. @private
[ "Removes", "a", "COL", "element", "to", "COLGROUP", "at", "given", "index", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4686-L4690
42,484
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { var elThead = this._elThead; if(elThead) { var elTable = elThead.parentNode; Ev.purgeElement(elThead, true); this._destroyColumnHelpers(); elTable.removeChild(elThead); this._elThead = null; } }
javascript
function() { var elThead = this._elThead; if(elThead) { var elTable = elThead.parentNode; Ev.purgeElement(elThead, true); this._destroyColumnHelpers(); elTable.removeChild(elThead); this._elThead = null; } }
[ "function", "(", ")", "{", "var", "elThead", "=", "this", ".", "_elThead", ";", "if", "(", "elThead", ")", "{", "var", "elTable", "=", "elThead", ".", "parentNode", ";", "Ev", ".", "purgeElement", "(", "elThead", ",", "true", ")", ";", "this", ".", "_destroyColumnHelpers", "(", ")", ";", "elTable", ".", "removeChild", "(", "elThead", ")", ";", "this", ".", "_elThead", "=", "null", ";", "}", "}" ]
Destroy's the DataTable THEAD element, if available. @method _destroyTheadEl @private
[ "Destroy", "s", "the", "DataTable", "THEAD", "element", "if", "available", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4722-L4731
42,485
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(elTh, oColumn) { elTh.id = this.getId() + "-th-" + oColumn.getSanitizedKey(); // Needed for accessibility, getColumn by TH, and ColumnDD elTh.innerHTML = ""; elTh.rowSpan = oColumn.getRowspan(); elTh.colSpan = oColumn.getColspan(); oColumn._elTh = elTh; var elThLiner = elTh.appendChild(document.createElement("div")); elThLiner.id = elTh.id + "-liner"; // Needed for resizer elThLiner.className = DT.CLASS_LINER; oColumn._elThLiner = elThLiner; var elThLabel = elThLiner.appendChild(document.createElement("span")); elThLabel.className = DT.CLASS_LABEL; // Assign abbr attribute if(oColumn.abbr) { elTh.abbr = oColumn.abbr; } // Clear minWidth on hidden Columns if(oColumn.hidden) { this._clearMinWidth(oColumn); } elTh.className = this._getColumnClassNames(oColumn); // Set Column width... if(oColumn.width) { // Validate minWidth var nWidth = (oColumn.minWidth && (oColumn.width < oColumn.minWidth)) ? oColumn.minWidth : oColumn.width; // ...for fallback cases if(DT._bDynStylesFallback) { elTh.firstChild.style.overflow = 'hidden'; elTh.firstChild.style.width = nWidth + 'px'; } // ...for non fallback cases else { this._setColumnWidthDynStyles(oColumn, nWidth + 'px', 'hidden'); } } this.formatTheadCell(elThLabel, oColumn, this.get("sortedBy")); oColumn._elThLabel = elThLabel; }
javascript
function(elTh, oColumn) { elTh.id = this.getId() + "-th-" + oColumn.getSanitizedKey(); // Needed for accessibility, getColumn by TH, and ColumnDD elTh.innerHTML = ""; elTh.rowSpan = oColumn.getRowspan(); elTh.colSpan = oColumn.getColspan(); oColumn._elTh = elTh; var elThLiner = elTh.appendChild(document.createElement("div")); elThLiner.id = elTh.id + "-liner"; // Needed for resizer elThLiner.className = DT.CLASS_LINER; oColumn._elThLiner = elThLiner; var elThLabel = elThLiner.appendChild(document.createElement("span")); elThLabel.className = DT.CLASS_LABEL; // Assign abbr attribute if(oColumn.abbr) { elTh.abbr = oColumn.abbr; } // Clear minWidth on hidden Columns if(oColumn.hidden) { this._clearMinWidth(oColumn); } elTh.className = this._getColumnClassNames(oColumn); // Set Column width... if(oColumn.width) { // Validate minWidth var nWidth = (oColumn.minWidth && (oColumn.width < oColumn.minWidth)) ? oColumn.minWidth : oColumn.width; // ...for fallback cases if(DT._bDynStylesFallback) { elTh.firstChild.style.overflow = 'hidden'; elTh.firstChild.style.width = nWidth + 'px'; } // ...for non fallback cases else { this._setColumnWidthDynStyles(oColumn, nWidth + 'px', 'hidden'); } } this.formatTheadCell(elThLabel, oColumn, this.get("sortedBy")); oColumn._elThLabel = elThLabel; }
[ "function", "(", "elTh", ",", "oColumn", ")", "{", "elTh", ".", "id", "=", "this", ".", "getId", "(", ")", "+", "\"-th-\"", "+", "oColumn", ".", "getSanitizedKey", "(", ")", ";", "// Needed for accessibility, getColumn by TH, and ColumnDD", "elTh", ".", "innerHTML", "=", "\"\"", ";", "elTh", ".", "rowSpan", "=", "oColumn", ".", "getRowspan", "(", ")", ";", "elTh", ".", "colSpan", "=", "oColumn", ".", "getColspan", "(", ")", ";", "oColumn", ".", "_elTh", "=", "elTh", ";", "var", "elThLiner", "=", "elTh", ".", "appendChild", "(", "document", ".", "createElement", "(", "\"div\"", ")", ")", ";", "elThLiner", ".", "id", "=", "elTh", ".", "id", "+", "\"-liner\"", ";", "// Needed for resizer", "elThLiner", ".", "className", "=", "DT", ".", "CLASS_LINER", ";", "oColumn", ".", "_elThLiner", "=", "elThLiner", ";", "var", "elThLabel", "=", "elThLiner", ".", "appendChild", "(", "document", ".", "createElement", "(", "\"span\"", ")", ")", ";", "elThLabel", ".", "className", "=", "DT", ".", "CLASS_LABEL", ";", "// Assign abbr attribute", "if", "(", "oColumn", ".", "abbr", ")", "{", "elTh", ".", "abbr", "=", "oColumn", ".", "abbr", ";", "}", "// Clear minWidth on hidden Columns", "if", "(", "oColumn", ".", "hidden", ")", "{", "this", ".", "_clearMinWidth", "(", "oColumn", ")", ";", "}", "elTh", ".", "className", "=", "this", ".", "_getColumnClassNames", "(", "oColumn", ")", ";", "// Set Column width...", "if", "(", "oColumn", ".", "width", ")", "{", "// Validate minWidth", "var", "nWidth", "=", "(", "oColumn", ".", "minWidth", "&&", "(", "oColumn", ".", "width", "<", "oColumn", ".", "minWidth", ")", ")", "?", "oColumn", ".", "minWidth", ":", "oColumn", ".", "width", ";", "// ...for fallback cases", "if", "(", "DT", ".", "_bDynStylesFallback", ")", "{", "elTh", ".", "firstChild", ".", "style", ".", "overflow", "=", "'hidden'", ";", "elTh", ".", "firstChild", ".", "style", ".", "width", "=", "nWidth", "+", "'px'", ";", "}", "// ...for non fallback cases", "else", "{", "this", ".", "_setColumnWidthDynStyles", "(", "oColumn", ",", "nWidth", "+", "'px'", ",", "'hidden'", ")", ";", "}", "}", "this", ".", "formatTheadCell", "(", "elThLabel", ",", "oColumn", ",", "this", ".", "get", "(", "\"sortedBy\"", ")", ")", ";", "oColumn", ".", "_elThLabel", "=", "elThLabel", ";", "}" ]
Populates TH element as defined by Column. @method _initThEl @param elTh {HTMLElement} TH element reference. @param oColumn {YAHOO.widget.Column} Column object. @private
[ "Populates", "TH", "element", "as", "defined", "by", "Column", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4828-L4872
42,486
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(elCellLabel, oColumn, oSortedBy) { var sKey = oColumn.getKey(); var sLabel = lang.isValue(oColumn.label) ? oColumn.label : sKey; // Add accessibility link for sortable Columns if(oColumn.sortable) { // Calculate the direction var sSortClass = this.getColumnSortDir(oColumn, oSortedBy); var bDesc = (sSortClass === DT.CLASS_DESC); // This is the sorted Column if(oSortedBy && (oColumn.key === oSortedBy.key)) { bDesc = !(oSortedBy.dir === DT.CLASS_DESC); } // Generate a unique HREF for visited status var sHref = this.getId() + "-href-" + oColumn.getSanitizedKey(); // Generate a dynamic TITLE for sort status var sTitle = (bDesc) ? this.get("MSG_SORTDESC") : this.get("MSG_SORTASC"); // Format the element elCellLabel.innerHTML = "<a href=\"" + sHref + "\" title=\"" + sTitle + "\" class=\"" + DT.CLASS_SORTABLE + "\">" + sLabel + "</a>"; } // Just display the label for non-sortable Columns else { elCellLabel.innerHTML = sLabel; } }
javascript
function(elCellLabel, oColumn, oSortedBy) { var sKey = oColumn.getKey(); var sLabel = lang.isValue(oColumn.label) ? oColumn.label : sKey; // Add accessibility link for sortable Columns if(oColumn.sortable) { // Calculate the direction var sSortClass = this.getColumnSortDir(oColumn, oSortedBy); var bDesc = (sSortClass === DT.CLASS_DESC); // This is the sorted Column if(oSortedBy && (oColumn.key === oSortedBy.key)) { bDesc = !(oSortedBy.dir === DT.CLASS_DESC); } // Generate a unique HREF for visited status var sHref = this.getId() + "-href-" + oColumn.getSanitizedKey(); // Generate a dynamic TITLE for sort status var sTitle = (bDesc) ? this.get("MSG_SORTDESC") : this.get("MSG_SORTASC"); // Format the element elCellLabel.innerHTML = "<a href=\"" + sHref + "\" title=\"" + sTitle + "\" class=\"" + DT.CLASS_SORTABLE + "\">" + sLabel + "</a>"; } // Just display the label for non-sortable Columns else { elCellLabel.innerHTML = sLabel; } }
[ "function", "(", "elCellLabel", ",", "oColumn", ",", "oSortedBy", ")", "{", "var", "sKey", "=", "oColumn", ".", "getKey", "(", ")", ";", "var", "sLabel", "=", "lang", ".", "isValue", "(", "oColumn", ".", "label", ")", "?", "oColumn", ".", "label", ":", "sKey", ";", "// Add accessibility link for sortable Columns", "if", "(", "oColumn", ".", "sortable", ")", "{", "// Calculate the direction", "var", "sSortClass", "=", "this", ".", "getColumnSortDir", "(", "oColumn", ",", "oSortedBy", ")", ";", "var", "bDesc", "=", "(", "sSortClass", "===", "DT", ".", "CLASS_DESC", ")", ";", "// This is the sorted Column", "if", "(", "oSortedBy", "&&", "(", "oColumn", ".", "key", "===", "oSortedBy", ".", "key", ")", ")", "{", "bDesc", "=", "!", "(", "oSortedBy", ".", "dir", "===", "DT", ".", "CLASS_DESC", ")", ";", "}", "// Generate a unique HREF for visited status", "var", "sHref", "=", "this", ".", "getId", "(", ")", "+", "\"-href-\"", "+", "oColumn", ".", "getSanitizedKey", "(", ")", ";", "// Generate a dynamic TITLE for sort status", "var", "sTitle", "=", "(", "bDesc", ")", "?", "this", ".", "get", "(", "\"MSG_SORTDESC\"", ")", ":", "this", ".", "get", "(", "\"MSG_SORTASC\"", ")", ";", "// Format the element", "elCellLabel", ".", "innerHTML", "=", "\"<a href=\\\"\"", "+", "sHref", "+", "\"\\\" title=\\\"\"", "+", "sTitle", "+", "\"\\\" class=\\\"\"", "+", "DT", ".", "CLASS_SORTABLE", "+", "\"\\\">\"", "+", "sLabel", "+", "\"</a>\"", ";", "}", "// Just display the label for non-sortable Columns", "else", "{", "elCellLabel", ".", "innerHTML", "=", "sLabel", ";", "}", "}" ]
Outputs markup into the given TH based on given Column. @method DataTable.formatTheadCell @param elCellLabel {HTMLElement} The label SPAN element within the TH liner, not the liner DIV element. @param oColumn {YAHOO.widget.Column} Column instance. @param oSortedBy {Object} Sort state object literal.
[ "Outputs", "markup", "into", "the", "given", "TH", "based", "on", "given", "Column", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4883-L4911
42,487
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { var oColumn, elTh; for(var i=0, len=this._oColumnSet.tree[0].length; i<len; i++) { oColumn = this._oColumnSet.tree[0][i]; if(oColumn._dd) { oColumn._dd = oColumn._dd.unreg(); Dom.removeClass(oColumn.getThEl(), DT.CLASS_DRAGGABLE); } } }
javascript
function() { var oColumn, elTh; for(var i=0, len=this._oColumnSet.tree[0].length; i<len; i++) { oColumn = this._oColumnSet.tree[0][i]; if(oColumn._dd) { oColumn._dd = oColumn._dd.unreg(); Dom.removeClass(oColumn.getThEl(), DT.CLASS_DRAGGABLE); } } }
[ "function", "(", ")", "{", "var", "oColumn", ",", "elTh", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "this", ".", "_oColumnSet", ".", "tree", "[", "0", "]", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "oColumn", "=", "this", ".", "_oColumnSet", ".", "tree", "[", "0", "]", "[", "i", "]", ";", "if", "(", "oColumn", ".", "_dd", ")", "{", "oColumn", ".", "_dd", "=", "oColumn", ".", "_dd", ".", "unreg", "(", ")", ";", "Dom", ".", "removeClass", "(", "oColumn", ".", "getThEl", "(", ")", ",", "DT", ".", "CLASS_DRAGGABLE", ")", ";", "}", "}", "}" ]
Disables DD from top-level Column TH elements. @method _destroyDraggableColumns @private
[ "Disables", "DD", "from", "top", "-", "level", "Column", "TH", "elements", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4919-L4928
42,488
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { var aKeys = this._oColumnSet.keys; for(var i=0, len=aKeys.length; i<len; i++) { if(aKeys[i]._ddResizer) { aKeys[i]._ddResizer = aKeys[i]._ddResizer.unreg(); Dom.removeClass(aKeys[i].getThEl(), DT.CLASS_RESIZEABLE); } } }
javascript
function() { var aKeys = this._oColumnSet.keys; for(var i=0, len=aKeys.length; i<len; i++) { if(aKeys[i]._ddResizer) { aKeys[i]._ddResizer = aKeys[i]._ddResizer.unreg(); Dom.removeClass(aKeys[i].getThEl(), DT.CLASS_RESIZEABLE); } } }
[ "function", "(", ")", "{", "var", "aKeys", "=", "this", ".", "_oColumnSet", ".", "keys", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "aKeys", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "aKeys", "[", "i", "]", ".", "_ddResizer", ")", "{", "aKeys", "[", "i", "]", ".", "_ddResizer", "=", "aKeys", "[", "i", "]", ".", "_ddResizer", ".", "unreg", "(", ")", ";", "Dom", ".", "removeClass", "(", "aKeys", "[", "i", "]", ".", "getThEl", "(", ")", ",", "DT", ".", "CLASS_RESIZEABLE", ")", ";", "}", "}", "}" ]
Disables resizeability on key Column TH elements. @method _destroyResizeableColumns @private
[ "Disables", "resizeability", "on", "key", "Column", "TH", "elements", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4958-L4966
42,489
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { this._destroyResizeableColumns(); if(util.DD) { var oColumn, elTh, elThLiner, elThResizerLiner, elThResizer, elResizerProxy, cancelClick; for(var i=0, len=this._oColumnSet.keys.length; i<len; i++) { oColumn = this._oColumnSet.keys[i]; if(oColumn.resizeable) { elTh = oColumn.getThEl(); Dom.addClass(elTh, DT.CLASS_RESIZEABLE); elThLiner = oColumn.getThLinerEl(); // Bug 1915349: So resizer is as tall as TH when rowspan > 1 // Create a separate resizer liner with position:relative elThResizerLiner = elTh.appendChild(document.createElement("div")); elThResizerLiner.className = DT.CLASS_RESIZERLINER; // Move TH contents into the new resizer liner elThResizerLiner.appendChild(elThLiner); // Create the resizer elThResizer = elThResizerLiner.appendChild(document.createElement("div")); elThResizer.id = elTh.id + "-resizer"; // Needed for ColumnResizer elThResizer.className = DT.CLASS_RESIZER; oColumn._elResizer = elThResizer; // Create the resizer proxy, once globally elResizerProxy = DT._initColumnResizerProxyEl(); oColumn._ddResizer = new YAHOO.util.ColumnResizer( this, oColumn, elTh, elThResizer, elResizerProxy); cancelClick = function(e) { Ev.stopPropagation(e); }; Ev.addListener(elThResizer,"click",cancelClick); } } } else { } }
javascript
function() { this._destroyResizeableColumns(); if(util.DD) { var oColumn, elTh, elThLiner, elThResizerLiner, elThResizer, elResizerProxy, cancelClick; for(var i=0, len=this._oColumnSet.keys.length; i<len; i++) { oColumn = this._oColumnSet.keys[i]; if(oColumn.resizeable) { elTh = oColumn.getThEl(); Dom.addClass(elTh, DT.CLASS_RESIZEABLE); elThLiner = oColumn.getThLinerEl(); // Bug 1915349: So resizer is as tall as TH when rowspan > 1 // Create a separate resizer liner with position:relative elThResizerLiner = elTh.appendChild(document.createElement("div")); elThResizerLiner.className = DT.CLASS_RESIZERLINER; // Move TH contents into the new resizer liner elThResizerLiner.appendChild(elThLiner); // Create the resizer elThResizer = elThResizerLiner.appendChild(document.createElement("div")); elThResizer.id = elTh.id + "-resizer"; // Needed for ColumnResizer elThResizer.className = DT.CLASS_RESIZER; oColumn._elResizer = elThResizer; // Create the resizer proxy, once globally elResizerProxy = DT._initColumnResizerProxyEl(); oColumn._ddResizer = new YAHOO.util.ColumnResizer( this, oColumn, elTh, elThResizer, elResizerProxy); cancelClick = function(e) { Ev.stopPropagation(e); }; Ev.addListener(elThResizer,"click",cancelClick); } } } else { } }
[ "function", "(", ")", "{", "this", ".", "_destroyResizeableColumns", "(", ")", ";", "if", "(", "util", ".", "DD", ")", "{", "var", "oColumn", ",", "elTh", ",", "elThLiner", ",", "elThResizerLiner", ",", "elThResizer", ",", "elResizerProxy", ",", "cancelClick", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "this", ".", "_oColumnSet", ".", "keys", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "oColumn", "=", "this", ".", "_oColumnSet", ".", "keys", "[", "i", "]", ";", "if", "(", "oColumn", ".", "resizeable", ")", "{", "elTh", "=", "oColumn", ".", "getThEl", "(", ")", ";", "Dom", ".", "addClass", "(", "elTh", ",", "DT", ".", "CLASS_RESIZEABLE", ")", ";", "elThLiner", "=", "oColumn", ".", "getThLinerEl", "(", ")", ";", "// Bug 1915349: So resizer is as tall as TH when rowspan > 1", "// Create a separate resizer liner with position:relative", "elThResizerLiner", "=", "elTh", ".", "appendChild", "(", "document", ".", "createElement", "(", "\"div\"", ")", ")", ";", "elThResizerLiner", ".", "className", "=", "DT", ".", "CLASS_RESIZERLINER", ";", "// Move TH contents into the new resizer liner", "elThResizerLiner", ".", "appendChild", "(", "elThLiner", ")", ";", "// Create the resizer", "elThResizer", "=", "elThResizerLiner", ".", "appendChild", "(", "document", ".", "createElement", "(", "\"div\"", ")", ")", ";", "elThResizer", ".", "id", "=", "elTh", ".", "id", "+", "\"-resizer\"", ";", "// Needed for ColumnResizer", "elThResizer", ".", "className", "=", "DT", ".", "CLASS_RESIZER", ";", "oColumn", ".", "_elResizer", "=", "elThResizer", ";", "// Create the resizer proxy, once globally", "elResizerProxy", "=", "DT", ".", "_initColumnResizerProxyEl", "(", ")", ";", "oColumn", ".", "_ddResizer", "=", "new", "YAHOO", ".", "util", ".", "ColumnResizer", "(", "this", ",", "oColumn", ",", "elTh", ",", "elThResizer", ",", "elResizerProxy", ")", ";", "cancelClick", "=", "function", "(", "e", ")", "{", "Ev", ".", "stopPropagation", "(", "e", ")", ";", "}", ";", "Ev", ".", "addListener", "(", "elThResizer", ",", "\"click\"", ",", "cancelClick", ")", ";", "}", "}", "}", "else", "{", "}", "}" ]
Initializes resizeability on key Column TH elements. @method _initResizeableColumns @private
[ "Initializes", "resizeability", "on", "key", "Column", "TH", "elements", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L4974-L5012
42,490
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { var elTbody = this._elTbody; if(elTbody) { var elTable = elTbody.parentNode; Ev.purgeElement(elTbody, true); elTable.removeChild(elTbody); this._elTbody = null; } }
javascript
function() { var elTbody = this._elTbody; if(elTbody) { var elTable = elTbody.parentNode; Ev.purgeElement(elTbody, true); elTable.removeChild(elTbody); this._elTbody = null; } }
[ "function", "(", ")", "{", "var", "elTbody", "=", "this", ".", "_elTbody", ";", "if", "(", "elTbody", ")", "{", "var", "elTable", "=", "elTbody", ".", "parentNode", ";", "Ev", ".", "purgeElement", "(", "elTbody", ",", "true", ")", ";", "elTable", ".", "removeChild", "(", "elTbody", ")", ";", "this", ".", "_elTbody", "=", "null", ";", "}", "}" ]
Destroy's the DataTable TBODY element, if available. @method _destroyTbodyEl @private
[ "Destroy", "s", "the", "DataTable", "TBODY", "element", "if", "available", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5044-L5052
42,491
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(elTable) { if(elTable) { // Destroy previous this._destroyTbodyEl(); // Create TBODY var elTbody = elTable.appendChild(document.createElement("tbody")); elTbody.tabIndex = 0; elTbody.className = DT.CLASS_DATA; // Set up DOM events for TBODY Ev.addListener(elTbody, "focus", this._onTbodyFocus, this); Ev.addListener(elTbody, "mouseover", this._onTableMouseover, this); Ev.addListener(elTbody, "mouseout", this._onTableMouseout, this); Ev.addListener(elTbody, "mousedown", this._onTableMousedown, this); Ev.addListener(elTbody, "mouseup", this._onTableMouseup, this); Ev.addListener(elTbody, "keydown", this._onTbodyKeydown, this); Ev.addListener(elTbody, "keypress", this._onTableKeypress, this); Ev.addListener(elTbody, "click", this._onTbodyClick, this); // Since we can't listen for click and dblclick on the same element... // Attach separately to THEAD and TBODY ///Ev.addListener(elTbody, "dblclick", this._onTableDblclick, this); // IE puts focus outline in the wrong place if(ua.ie) { elTbody.hideFocus=true; } this._elTbody = elTbody; } }
javascript
function(elTable) { if(elTable) { // Destroy previous this._destroyTbodyEl(); // Create TBODY var elTbody = elTable.appendChild(document.createElement("tbody")); elTbody.tabIndex = 0; elTbody.className = DT.CLASS_DATA; // Set up DOM events for TBODY Ev.addListener(elTbody, "focus", this._onTbodyFocus, this); Ev.addListener(elTbody, "mouseover", this._onTableMouseover, this); Ev.addListener(elTbody, "mouseout", this._onTableMouseout, this); Ev.addListener(elTbody, "mousedown", this._onTableMousedown, this); Ev.addListener(elTbody, "mouseup", this._onTableMouseup, this); Ev.addListener(elTbody, "keydown", this._onTbodyKeydown, this); Ev.addListener(elTbody, "keypress", this._onTableKeypress, this); Ev.addListener(elTbody, "click", this._onTbodyClick, this); // Since we can't listen for click and dblclick on the same element... // Attach separately to THEAD and TBODY ///Ev.addListener(elTbody, "dblclick", this._onTableDblclick, this); // IE puts focus outline in the wrong place if(ua.ie) { elTbody.hideFocus=true; } this._elTbody = elTbody; } }
[ "function", "(", "elTable", ")", "{", "if", "(", "elTable", ")", "{", "// Destroy previous", "this", ".", "_destroyTbodyEl", "(", ")", ";", "// Create TBODY", "var", "elTbody", "=", "elTable", ".", "appendChild", "(", "document", ".", "createElement", "(", "\"tbody\"", ")", ")", ";", "elTbody", ".", "tabIndex", "=", "0", ";", "elTbody", ".", "className", "=", "DT", ".", "CLASS_DATA", ";", "// Set up DOM events for TBODY", "Ev", ".", "addListener", "(", "elTbody", ",", "\"focus\"", ",", "this", ".", "_onTbodyFocus", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elTbody", ",", "\"mouseover\"", ",", "this", ".", "_onTableMouseover", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elTbody", ",", "\"mouseout\"", ",", "this", ".", "_onTableMouseout", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elTbody", ",", "\"mousedown\"", ",", "this", ".", "_onTableMousedown", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elTbody", ",", "\"mouseup\"", ",", "this", ".", "_onTableMouseup", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elTbody", ",", "\"keydown\"", ",", "this", ".", "_onTbodyKeydown", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elTbody", ",", "\"keypress\"", ",", "this", ".", "_onTableKeypress", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elTbody", ",", "\"click\"", ",", "this", ".", "_onTbodyClick", ",", "this", ")", ";", "// Since we can't listen for click and dblclick on the same element...", "// Attach separately to THEAD and TBODY", "///Ev.addListener(elTbody, \"dblclick\", this._onTableDblclick, this);", "// IE puts focus outline in the wrong place", "if", "(", "ua", ".", "ie", ")", "{", "elTbody", ".", "hideFocus", "=", "true", ";", "}", "this", ".", "_elTbody", "=", "elTbody", ";", "}", "}" ]
Initializes TBODY element for data. @method _initTbodyEl @param elTable {HTMLElement} TABLE element into which to create TBODY . @private
[ "Initializes", "TBODY", "element", "for", "data", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5061-L5093
42,492
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { var elMsgTbody = this._elMsgTbody; if(elMsgTbody) { var elTable = elMsgTbody.parentNode; Ev.purgeElement(elMsgTbody, true); elTable.removeChild(elMsgTbody); this._elTbody = null; } }
javascript
function() { var elMsgTbody = this._elMsgTbody; if(elMsgTbody) { var elTable = elMsgTbody.parentNode; Ev.purgeElement(elMsgTbody, true); elTable.removeChild(elMsgTbody); this._elTbody = null; } }
[ "function", "(", ")", "{", "var", "elMsgTbody", "=", "this", ".", "_elMsgTbody", ";", "if", "(", "elMsgTbody", ")", "{", "var", "elTable", "=", "elMsgTbody", ".", "parentNode", ";", "Ev", ".", "purgeElement", "(", "elMsgTbody", ",", "true", ")", ";", "elTable", ".", "removeChild", "(", "elMsgTbody", ")", ";", "this", ".", "_elTbody", "=", "null", ";", "}", "}" ]
Destroy's the DataTable message TBODY element, if available. @method _destroyMsgTbodyEl @private
[ "Destroy", "s", "the", "DataTable", "message", "TBODY", "element", "if", "available", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5101-L5109
42,493
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function(elTable) { if(elTable) { var elMsgTbody = document.createElement("tbody"); elMsgTbody.className = DT.CLASS_MESSAGE; var elMsgTr = elMsgTbody.appendChild(document.createElement("tr")); elMsgTr.className = DT.CLASS_FIRST + " " + DT.CLASS_LAST; this._elMsgTr = elMsgTr; var elMsgTd = elMsgTr.appendChild(document.createElement("td")); elMsgTd.colSpan = this._oColumnSet.keys.length || 1; elMsgTd.className = DT.CLASS_FIRST + " " + DT.CLASS_LAST; this._elMsgTd = elMsgTd; elMsgTbody = elTable.insertBefore(elMsgTbody, this._elTbody); var elMsgLiner = elMsgTd.appendChild(document.createElement("div")); elMsgLiner.className = DT.CLASS_LINER; this._elMsgTbody = elMsgTbody; // Set up DOM events for TBODY Ev.addListener(elMsgTbody, "focus", this._onTbodyFocus, this); Ev.addListener(elMsgTbody, "mouseover", this._onTableMouseover, this); Ev.addListener(elMsgTbody, "mouseout", this._onTableMouseout, this); Ev.addListener(elMsgTbody, "mousedown", this._onTableMousedown, this); Ev.addListener(elMsgTbody, "mouseup", this._onTableMouseup, this); Ev.addListener(elMsgTbody, "keydown", this._onTbodyKeydown, this); Ev.addListener(elMsgTbody, "keypress", this._onTableKeypress, this); Ev.addListener(elMsgTbody, "click", this._onTbodyClick, this); } }
javascript
function(elTable) { if(elTable) { var elMsgTbody = document.createElement("tbody"); elMsgTbody.className = DT.CLASS_MESSAGE; var elMsgTr = elMsgTbody.appendChild(document.createElement("tr")); elMsgTr.className = DT.CLASS_FIRST + " " + DT.CLASS_LAST; this._elMsgTr = elMsgTr; var elMsgTd = elMsgTr.appendChild(document.createElement("td")); elMsgTd.colSpan = this._oColumnSet.keys.length || 1; elMsgTd.className = DT.CLASS_FIRST + " " + DT.CLASS_LAST; this._elMsgTd = elMsgTd; elMsgTbody = elTable.insertBefore(elMsgTbody, this._elTbody); var elMsgLiner = elMsgTd.appendChild(document.createElement("div")); elMsgLiner.className = DT.CLASS_LINER; this._elMsgTbody = elMsgTbody; // Set up DOM events for TBODY Ev.addListener(elMsgTbody, "focus", this._onTbodyFocus, this); Ev.addListener(elMsgTbody, "mouseover", this._onTableMouseover, this); Ev.addListener(elMsgTbody, "mouseout", this._onTableMouseout, this); Ev.addListener(elMsgTbody, "mousedown", this._onTableMousedown, this); Ev.addListener(elMsgTbody, "mouseup", this._onTableMouseup, this); Ev.addListener(elMsgTbody, "keydown", this._onTbodyKeydown, this); Ev.addListener(elMsgTbody, "keypress", this._onTableKeypress, this); Ev.addListener(elMsgTbody, "click", this._onTbodyClick, this); } }
[ "function", "(", "elTable", ")", "{", "if", "(", "elTable", ")", "{", "var", "elMsgTbody", "=", "document", ".", "createElement", "(", "\"tbody\"", ")", ";", "elMsgTbody", ".", "className", "=", "DT", ".", "CLASS_MESSAGE", ";", "var", "elMsgTr", "=", "elMsgTbody", ".", "appendChild", "(", "document", ".", "createElement", "(", "\"tr\"", ")", ")", ";", "elMsgTr", ".", "className", "=", "DT", ".", "CLASS_FIRST", "+", "\" \"", "+", "DT", ".", "CLASS_LAST", ";", "this", ".", "_elMsgTr", "=", "elMsgTr", ";", "var", "elMsgTd", "=", "elMsgTr", ".", "appendChild", "(", "document", ".", "createElement", "(", "\"td\"", ")", ")", ";", "elMsgTd", ".", "colSpan", "=", "this", ".", "_oColumnSet", ".", "keys", ".", "length", "||", "1", ";", "elMsgTd", ".", "className", "=", "DT", ".", "CLASS_FIRST", "+", "\" \"", "+", "DT", ".", "CLASS_LAST", ";", "this", ".", "_elMsgTd", "=", "elMsgTd", ";", "elMsgTbody", "=", "elTable", ".", "insertBefore", "(", "elMsgTbody", ",", "this", ".", "_elTbody", ")", ";", "var", "elMsgLiner", "=", "elMsgTd", ".", "appendChild", "(", "document", ".", "createElement", "(", "\"div\"", ")", ")", ";", "elMsgLiner", ".", "className", "=", "DT", ".", "CLASS_LINER", ";", "this", ".", "_elMsgTbody", "=", "elMsgTbody", ";", "// Set up DOM events for TBODY", "Ev", ".", "addListener", "(", "elMsgTbody", ",", "\"focus\"", ",", "this", ".", "_onTbodyFocus", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elMsgTbody", ",", "\"mouseover\"", ",", "this", ".", "_onTableMouseover", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elMsgTbody", ",", "\"mouseout\"", ",", "this", ".", "_onTableMouseout", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elMsgTbody", ",", "\"mousedown\"", ",", "this", ".", "_onTableMousedown", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elMsgTbody", ",", "\"mouseup\"", ",", "this", ".", "_onTableMouseup", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elMsgTbody", ",", "\"keydown\"", ",", "this", ".", "_onTbodyKeydown", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elMsgTbody", ",", "\"keypress\"", ",", "this", ".", "_onTableKeypress", ",", "this", ")", ";", "Ev", ".", "addListener", "(", "elMsgTbody", ",", "\"click\"", ",", "this", ".", "_onTbodyClick", ",", "this", ")", ";", "}", "}" ]
Initializes TBODY element for messaging. @method _initMsgTbodyEl @param elTable {HTMLElement} TABLE element into which to create TBODY @private
[ "Initializes", "TBODY", "element", "for", "messaging", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5118-L5144
42,494
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function () { // Initialize Column sort this._initColumnSort(); // Add the document level click listener YAHOO.util.Event.addListener(document, "click", this._onDocumentClick, this); // Paginator integration this.subscribe("paginatorChange",function () { this._handlePaginatorChange.apply(this,arguments); }); this.subscribe("initEvent",function () { this.renderPaginator(); }); // Initialize CellEditor integration this._initCellEditing(); }
javascript
function () { // Initialize Column sort this._initColumnSort(); // Add the document level click listener YAHOO.util.Event.addListener(document, "click", this._onDocumentClick, this); // Paginator integration this.subscribe("paginatorChange",function () { this._handlePaginatorChange.apply(this,arguments); }); this.subscribe("initEvent",function () { this.renderPaginator(); }); // Initialize CellEditor integration this._initCellEditing(); }
[ "function", "(", ")", "{", "// Initialize Column sort", "this", ".", "_initColumnSort", "(", ")", ";", "// Add the document level click listener", "YAHOO", ".", "util", ".", "Event", ".", "addListener", "(", "document", ",", "\"click\"", ",", "this", ".", "_onDocumentClick", ",", "this", ")", ";", "// Paginator integration", "this", ".", "subscribe", "(", "\"paginatorChange\"", ",", "function", "(", ")", "{", "this", ".", "_handlePaginatorChange", ".", "apply", "(", "this", ",", "arguments", ")", ";", "}", ")", ";", "this", ".", "subscribe", "(", "\"initEvent\"", ",", "function", "(", ")", "{", "this", ".", "renderPaginator", "(", ")", ";", "}", ")", ";", "// Initialize CellEditor integration", "this", ".", "_initCellEditing", "(", ")", ";", "}" ]
Initialize internal event listeners @method _initEvents @private
[ "Initialize", "internal", "event", "listeners" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5152-L5170
42,495
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { this.subscribe("theadCellClickEvent", this.onEventSortColumn); // Backward compatibility var oSortedBy = this.get("sortedBy"); if(oSortedBy) { if(oSortedBy.dir == "desc") { this._configs.sortedBy.value.dir = DT.CLASS_DESC; } else if(oSortedBy.dir == "asc") { this._configs.sortedBy.value.dir = DT.CLASS_ASC; } } }
javascript
function() { this.subscribe("theadCellClickEvent", this.onEventSortColumn); // Backward compatibility var oSortedBy = this.get("sortedBy"); if(oSortedBy) { if(oSortedBy.dir == "desc") { this._configs.sortedBy.value.dir = DT.CLASS_DESC; } else if(oSortedBy.dir == "asc") { this._configs.sortedBy.value.dir = DT.CLASS_ASC; } } }
[ "function", "(", ")", "{", "this", ".", "subscribe", "(", "\"theadCellClickEvent\"", ",", "this", ".", "onEventSortColumn", ")", ";", "// Backward compatibility", "var", "oSortedBy", "=", "this", ".", "get", "(", "\"sortedBy\"", ")", ";", "if", "(", "oSortedBy", ")", "{", "if", "(", "oSortedBy", ".", "dir", "==", "\"desc\"", ")", "{", "this", ".", "_configs", ".", "sortedBy", ".", "value", ".", "dir", "=", "DT", ".", "CLASS_DESC", ";", "}", "else", "if", "(", "oSortedBy", ".", "dir", "==", "\"asc\"", ")", "{", "this", ".", "_configs", ".", "sortedBy", ".", "value", ".", "dir", "=", "DT", ".", "CLASS_ASC", ";", "}", "}", "}" ]
Initializes Column sorting. @method _initColumnSort @private
[ "Initializes", "Column", "sorting", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5178-L5191
42,496
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function() { this.subscribe("editorBlurEvent",function () { this.onEditorBlurEvent.apply(this,arguments); }); this.subscribe("editorBlockEvent",function () { this.onEditorBlockEvent.apply(this,arguments); }); this.subscribe("editorUnblockEvent",function () { this.onEditorUnblockEvent.apply(this,arguments); }); }
javascript
function() { this.subscribe("editorBlurEvent",function () { this.onEditorBlurEvent.apply(this,arguments); }); this.subscribe("editorBlockEvent",function () { this.onEditorBlockEvent.apply(this,arguments); }); this.subscribe("editorUnblockEvent",function () { this.onEditorUnblockEvent.apply(this,arguments); }); }
[ "function", "(", ")", "{", "this", ".", "subscribe", "(", "\"editorBlurEvent\"", ",", "function", "(", ")", "{", "this", ".", "onEditorBlurEvent", ".", "apply", "(", "this", ",", "arguments", ")", ";", "}", ")", ";", "this", ".", "subscribe", "(", "\"editorBlockEvent\"", ",", "function", "(", ")", "{", "this", ".", "onEditorBlockEvent", ".", "apply", "(", "this", ",", "arguments", ")", ";", "}", ")", ";", "this", ".", "subscribe", "(", "\"editorUnblockEvent\"", ",", "function", "(", ")", "{", "this", ".", "onEditorUnblockEvent", ".", "apply", "(", "this", ",", "arguments", ")", ";", "}", ")", ";", "}" ]
Initializes CellEditor integration. @method _initCellEditing @private
[ "Initializes", "CellEditor", "integration", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5199-L5209
42,497
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function (oColumn, aAddClasses) { var allClasses; // Add CSS classes if(lang.isString(oColumn.className)) { // Single custom class allClasses = [oColumn.className]; } else if(lang.isArray(oColumn.className)) { // Array of custom classes allClasses = oColumn.className; } else { // no custom classes allClasses = []; } // Hook for setting width with via dynamic style uses key since ID is too disposable allClasses[allClasses.length] = this.getId() + "-col-" +oColumn.getSanitizedKey(); // Column key - minus any chars other than "A-Z", "a-z", "0-9", "_", "-", ".", or ":" allClasses[allClasses.length] = "yui-dt-col-" +oColumn.getSanitizedKey(); var isSortedBy = this.get("sortedBy") || {}; // Sorted if(oColumn.key === isSortedBy.key) { allClasses[allClasses.length] = isSortedBy.dir || ''; } // Hidden if(oColumn.hidden) { allClasses[allClasses.length] = DT.CLASS_HIDDEN; } // Selected if(oColumn.selected) { allClasses[allClasses.length] = DT.CLASS_SELECTED; } // Sortable if(oColumn.sortable) { allClasses[allClasses.length] = DT.CLASS_SORTABLE; } // Resizeable if(oColumn.resizeable) { allClasses[allClasses.length] = DT.CLASS_RESIZEABLE; } // Editable if(oColumn.editor) { allClasses[allClasses.length] = DT.CLASS_EDITABLE; } // Addtnl classes, including First/Last if(aAddClasses) { allClasses = allClasses.concat(aAddClasses); } return allClasses.join(' '); }
javascript
function (oColumn, aAddClasses) { var allClasses; // Add CSS classes if(lang.isString(oColumn.className)) { // Single custom class allClasses = [oColumn.className]; } else if(lang.isArray(oColumn.className)) { // Array of custom classes allClasses = oColumn.className; } else { // no custom classes allClasses = []; } // Hook for setting width with via dynamic style uses key since ID is too disposable allClasses[allClasses.length] = this.getId() + "-col-" +oColumn.getSanitizedKey(); // Column key - minus any chars other than "A-Z", "a-z", "0-9", "_", "-", ".", or ":" allClasses[allClasses.length] = "yui-dt-col-" +oColumn.getSanitizedKey(); var isSortedBy = this.get("sortedBy") || {}; // Sorted if(oColumn.key === isSortedBy.key) { allClasses[allClasses.length] = isSortedBy.dir || ''; } // Hidden if(oColumn.hidden) { allClasses[allClasses.length] = DT.CLASS_HIDDEN; } // Selected if(oColumn.selected) { allClasses[allClasses.length] = DT.CLASS_SELECTED; } // Sortable if(oColumn.sortable) { allClasses[allClasses.length] = DT.CLASS_SORTABLE; } // Resizeable if(oColumn.resizeable) { allClasses[allClasses.length] = DT.CLASS_RESIZEABLE; } // Editable if(oColumn.editor) { allClasses[allClasses.length] = DT.CLASS_EDITABLE; } // Addtnl classes, including First/Last if(aAddClasses) { allClasses = allClasses.concat(aAddClasses); } return allClasses.join(' '); }
[ "function", "(", "oColumn", ",", "aAddClasses", ")", "{", "var", "allClasses", ";", "// Add CSS classes", "if", "(", "lang", ".", "isString", "(", "oColumn", ".", "className", ")", ")", "{", "// Single custom class", "allClasses", "=", "[", "oColumn", ".", "className", "]", ";", "}", "else", "if", "(", "lang", ".", "isArray", "(", "oColumn", ".", "className", ")", ")", "{", "// Array of custom classes", "allClasses", "=", "oColumn", ".", "className", ";", "}", "else", "{", "// no custom classes", "allClasses", "=", "[", "]", ";", "}", "// Hook for setting width with via dynamic style uses key since ID is too disposable", "allClasses", "[", "allClasses", ".", "length", "]", "=", "this", ".", "getId", "(", ")", "+", "\"-col-\"", "+", "oColumn", ".", "getSanitizedKey", "(", ")", ";", "// Column key - minus any chars other than \"A-Z\", \"a-z\", \"0-9\", \"_\", \"-\", \".\", or \":\"", "allClasses", "[", "allClasses", ".", "length", "]", "=", "\"yui-dt-col-\"", "+", "oColumn", ".", "getSanitizedKey", "(", ")", ";", "var", "isSortedBy", "=", "this", ".", "get", "(", "\"sortedBy\"", ")", "||", "{", "}", ";", "// Sorted", "if", "(", "oColumn", ".", "key", "===", "isSortedBy", ".", "key", ")", "{", "allClasses", "[", "allClasses", ".", "length", "]", "=", "isSortedBy", ".", "dir", "||", "''", ";", "}", "// Hidden", "if", "(", "oColumn", ".", "hidden", ")", "{", "allClasses", "[", "allClasses", ".", "length", "]", "=", "DT", ".", "CLASS_HIDDEN", ";", "}", "// Selected", "if", "(", "oColumn", ".", "selected", ")", "{", "allClasses", "[", "allClasses", ".", "length", "]", "=", "DT", ".", "CLASS_SELECTED", ";", "}", "// Sortable", "if", "(", "oColumn", ".", "sortable", ")", "{", "allClasses", "[", "allClasses", ".", "length", "]", "=", "DT", ".", "CLASS_SORTABLE", ";", "}", "// Resizeable", "if", "(", "oColumn", ".", "resizeable", ")", "{", "allClasses", "[", "allClasses", ".", "length", "]", "=", "DT", ".", "CLASS_RESIZEABLE", ";", "}", "// Editable", "if", "(", "oColumn", ".", "editor", ")", "{", "allClasses", "[", "allClasses", ".", "length", "]", "=", "DT", ".", "CLASS_EDITABLE", ";", "}", "// Addtnl classes, including First/Last", "if", "(", "aAddClasses", ")", "{", "allClasses", "=", "allClasses", ".", "concat", "(", "aAddClasses", ")", ";", "}", "return", "allClasses", ".", "join", "(", "' '", ")", ";", "}" ]
DOM MUTATION FUNCTIONS Retruns classnames to represent current Column states. @method _getColumnClassnames @param oColumn {YAHOO.widget.Column} Column instance. @param aAddClasses {String[]} An array of additional classnames to add to the return value. @return {String} A String of classnames to be assigned to TH or TD elements for given Column. @private
[ "DOM", "MUTATION", "FUNCTIONS", "Retruns", "classnames", "to", "represent", "current", "Column", "states", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5255-L5310
42,498
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function (oRecord, index) { // Template is already available if(this._elTrTemplate) { return this._elTrTemplate; } // Template needs to be created else { var d = document, tr = d.createElement('tr'), td = d.createElement('td'), div = d.createElement('div'); // Append the liner element td.appendChild(div); // Create TD elements into DOCUMENT FRAGMENT var df = document.createDocumentFragment(), allKeys = this._oColumnSet.keys, elTd; // Set state for each TD; var aAddClasses; for(var i=0, keysLen=allKeys.length; i<keysLen; i++) { // Clone the TD template elTd = td.cloneNode(true); // Format the base TD elTd = this._formatTdEl(allKeys[i], elTd, i, (i===keysLen-1)); df.appendChild(elTd); } tr.appendChild(df); this._elTrTemplate = tr; return tr; } }
javascript
function (oRecord, index) { // Template is already available if(this._elTrTemplate) { return this._elTrTemplate; } // Template needs to be created else { var d = document, tr = d.createElement('tr'), td = d.createElement('td'), div = d.createElement('div'); // Append the liner element td.appendChild(div); // Create TD elements into DOCUMENT FRAGMENT var df = document.createDocumentFragment(), allKeys = this._oColumnSet.keys, elTd; // Set state for each TD; var aAddClasses; for(var i=0, keysLen=allKeys.length; i<keysLen; i++) { // Clone the TD template elTd = td.cloneNode(true); // Format the base TD elTd = this._formatTdEl(allKeys[i], elTd, i, (i===keysLen-1)); df.appendChild(elTd); } tr.appendChild(df); this._elTrTemplate = tr; return tr; } }
[ "function", "(", "oRecord", ",", "index", ")", "{", "// Template is already available", "if", "(", "this", ".", "_elTrTemplate", ")", "{", "return", "this", ".", "_elTrTemplate", ";", "}", "// Template needs to be created", "else", "{", "var", "d", "=", "document", ",", "tr", "=", "d", ".", "createElement", "(", "'tr'", ")", ",", "td", "=", "d", ".", "createElement", "(", "'td'", ")", ",", "div", "=", "d", ".", "createElement", "(", "'div'", ")", ";", "// Append the liner element", "td", ".", "appendChild", "(", "div", ")", ";", "// Create TD elements into DOCUMENT FRAGMENT", "var", "df", "=", "document", ".", "createDocumentFragment", "(", ")", ",", "allKeys", "=", "this", ".", "_oColumnSet", ".", "keys", ",", "elTd", ";", "// Set state for each TD;", "var", "aAddClasses", ";", "for", "(", "var", "i", "=", "0", ",", "keysLen", "=", "allKeys", ".", "length", ";", "i", "<", "keysLen", ";", "i", "++", ")", "{", "// Clone the TD template", "elTd", "=", "td", ".", "cloneNode", "(", "true", ")", ";", "// Format the base TD", "elTd", "=", "this", ".", "_formatTdEl", "(", "allKeys", "[", "i", "]", ",", "elTd", ",", "i", ",", "(", "i", "===", "keysLen", "-", "1", ")", ")", ";", "df", ".", "appendChild", "(", "elTd", ")", ";", "}", "tr", ".", "appendChild", "(", "df", ")", ";", "this", ".", "_elTrTemplate", "=", "tr", ";", "return", "tr", ";", "}", "}" ]
Returns a new TR element template with TD elements classed with current Column states. @method _getTrTemplateEl @return {HTMLElement} A TR element to be cloned and added to the DOM. @private
[ "Returns", "a", "new", "TR", "element", "template", "with", "TD", "elements", "classed", "with", "current", "Column", "states", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5328-L5363
42,499
neyric/webhookit
public/javascripts/yui/datatable/datatable.js
function (oColumn, elTd, index, isLast) { var oColumnSet = this._oColumnSet; // Set the TD's accessibility headers var allHeaders = oColumnSet.headers, allColHeaders = allHeaders[index], sTdHeaders = "", sHeader; for(var j=0, headersLen=allColHeaders.length; j < headersLen; j++) { sHeader = this._sId + "-th-" + allColHeaders[j] + ' '; sTdHeaders += sHeader; } elTd.headers = sTdHeaders; // Class the TD element var aAddClasses = []; if(index === 0) { aAddClasses[aAddClasses.length] = DT.CLASS_FIRST; } if(isLast) { aAddClasses[aAddClasses.length] = DT.CLASS_LAST; } elTd.className = this._getColumnClassNames(oColumn, aAddClasses); // Class the liner element elTd.firstChild.className = DT.CLASS_LINER; // Set Column width for fallback cases if(oColumn.width && DT._bDynStylesFallback) { // Validate minWidth var nWidth = (oColumn.minWidth && (oColumn.width < oColumn.minWidth)) ? oColumn.minWidth : oColumn.width; elTd.firstChild.style.overflow = 'hidden'; elTd.firstChild.style.width = nWidth + 'px'; } return elTd; }
javascript
function (oColumn, elTd, index, isLast) { var oColumnSet = this._oColumnSet; // Set the TD's accessibility headers var allHeaders = oColumnSet.headers, allColHeaders = allHeaders[index], sTdHeaders = "", sHeader; for(var j=0, headersLen=allColHeaders.length; j < headersLen; j++) { sHeader = this._sId + "-th-" + allColHeaders[j] + ' '; sTdHeaders += sHeader; } elTd.headers = sTdHeaders; // Class the TD element var aAddClasses = []; if(index === 0) { aAddClasses[aAddClasses.length] = DT.CLASS_FIRST; } if(isLast) { aAddClasses[aAddClasses.length] = DT.CLASS_LAST; } elTd.className = this._getColumnClassNames(oColumn, aAddClasses); // Class the liner element elTd.firstChild.className = DT.CLASS_LINER; // Set Column width for fallback cases if(oColumn.width && DT._bDynStylesFallback) { // Validate minWidth var nWidth = (oColumn.minWidth && (oColumn.width < oColumn.minWidth)) ? oColumn.minWidth : oColumn.width; elTd.firstChild.style.overflow = 'hidden'; elTd.firstChild.style.width = nWidth + 'px'; } return elTd; }
[ "function", "(", "oColumn", ",", "elTd", ",", "index", ",", "isLast", ")", "{", "var", "oColumnSet", "=", "this", ".", "_oColumnSet", ";", "// Set the TD's accessibility headers", "var", "allHeaders", "=", "oColumnSet", ".", "headers", ",", "allColHeaders", "=", "allHeaders", "[", "index", "]", ",", "sTdHeaders", "=", "\"\"", ",", "sHeader", ";", "for", "(", "var", "j", "=", "0", ",", "headersLen", "=", "allColHeaders", ".", "length", ";", "j", "<", "headersLen", ";", "j", "++", ")", "{", "sHeader", "=", "this", ".", "_sId", "+", "\"-th-\"", "+", "allColHeaders", "[", "j", "]", "+", "' '", ";", "sTdHeaders", "+=", "sHeader", ";", "}", "elTd", ".", "headers", "=", "sTdHeaders", ";", "// Class the TD element", "var", "aAddClasses", "=", "[", "]", ";", "if", "(", "index", "===", "0", ")", "{", "aAddClasses", "[", "aAddClasses", ".", "length", "]", "=", "DT", ".", "CLASS_FIRST", ";", "}", "if", "(", "isLast", ")", "{", "aAddClasses", "[", "aAddClasses", ".", "length", "]", "=", "DT", ".", "CLASS_LAST", ";", "}", "elTd", ".", "className", "=", "this", ".", "_getColumnClassNames", "(", "oColumn", ",", "aAddClasses", ")", ";", "// Class the liner element", "elTd", ".", "firstChild", ".", "className", "=", "DT", ".", "CLASS_LINER", ";", "// Set Column width for fallback cases", "if", "(", "oColumn", ".", "width", "&&", "DT", ".", "_bDynStylesFallback", ")", "{", "// Validate minWidth", "var", "nWidth", "=", "(", "oColumn", ".", "minWidth", "&&", "(", "oColumn", ".", "width", "<", "oColumn", ".", "minWidth", ")", ")", "?", "oColumn", ".", "minWidth", ":", "oColumn", ".", "width", ";", "elTd", ".", "firstChild", ".", "style", ".", "overflow", "=", "'hidden'", ";", "elTd", ".", "firstChild", ".", "style", ".", "width", "=", "nWidth", "+", "'px'", ";", "}", "return", "elTd", ";", "}" ]
Formats a basic TD element. @method _formatTdEl @param oColumn {YAHOO.widget.Column} Associated Column instance. @param elTd {HTMLElement} An unformatted TD element. @param index {Number} Column key index. @param isLast {Boolean} True if Column is last key of the ColumnSet. @return {HTMLElement} A formatted TD element. @private
[ "Formats", "a", "basic", "TD", "element", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5375-L5412