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,500 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function (oRecord) {
var elTrTemplate = this._getTrTemplateEl();
// Clone the TR template.
var elTr = elTrTemplate.cloneNode(true);
// Populate content
return this._updateTrEl(elTr,oRecord);
} | javascript | function (oRecord) {
var elTrTemplate = this._getTrTemplateEl();
// Clone the TR template.
var elTr = elTrTemplate.cloneNode(true);
// Populate content
return this._updateTrEl(elTr,oRecord);
} | [
"function",
"(",
"oRecord",
")",
"{",
"var",
"elTrTemplate",
"=",
"this",
".",
"_getTrTemplateEl",
"(",
")",
";",
"// Clone the TR template.",
"var",
"elTr",
"=",
"elTrTemplate",
".",
"cloneNode",
"(",
"true",
")",
";",
"// Populate content",
"return",
"this",
".",
"_updateTrEl",
"(",
"elTr",
",",
"oRecord",
")",
";",
"}"
]
| Create a new TR element for a given Record and appends it with the correct
number of Column-state-classed TD elements. Striping is the responsibility of
the calling function, which may decide to stripe the single row, a subset of
rows, or all the rows.
@method _createTrEl
@param oRecord {YAHOO.widget.Record} Record instance
@return {HTMLElement} The new TR element. This must be added to the DOM.
@private | [
"Create",
"a",
"new",
"TR",
"element",
"for",
"a",
"given",
"Record",
"and",
"appends",
"it",
"with",
"the",
"correct",
"number",
"of",
"Column",
"-",
"state",
"-",
"classed",
"TD",
"elements",
".",
"Striping",
"is",
"the",
"responsibility",
"of",
"the",
"calling",
"function",
"which",
"may",
"decide",
"to",
"stripe",
"the",
"single",
"row",
"a",
"subset",
"of",
"rows",
"or",
"all",
"the",
"rows",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5425-L5433 |
|
42,501 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(elTr, oRecord) {
var ok = this.get("formatRow") ? this.get("formatRow").call(this, elTr, oRecord) : true;
if(ok) {
// Hide the row to prevent constant reflows
elTr.style.display = 'none';
// Update TD elements with new data
var allTds = elTr.childNodes,
elTd;
for(var i=0,len=allTds.length; i<len; ++i) {
elTd = allTds[i];
// Set the cell content
this.formatCell(allTds[i].firstChild, oRecord, this._oColumnSet.keys[i]);
}
// Redisplay the row for reflow
elTr.style.display = '';
}
elTr.id = oRecord.getId(); // Needed for Record association and tracking of FIRST/LAST
return elTr;
} | javascript | function(elTr, oRecord) {
var ok = this.get("formatRow") ? this.get("formatRow").call(this, elTr, oRecord) : true;
if(ok) {
// Hide the row to prevent constant reflows
elTr.style.display = 'none';
// Update TD elements with new data
var allTds = elTr.childNodes,
elTd;
for(var i=0,len=allTds.length; i<len; ++i) {
elTd = allTds[i];
// Set the cell content
this.formatCell(allTds[i].firstChild, oRecord, this._oColumnSet.keys[i]);
}
// Redisplay the row for reflow
elTr.style.display = '';
}
elTr.id = oRecord.getId(); // Needed for Record association and tracking of FIRST/LAST
return elTr;
} | [
"function",
"(",
"elTr",
",",
"oRecord",
")",
"{",
"var",
"ok",
"=",
"this",
".",
"get",
"(",
"\"formatRow\"",
")",
"?",
"this",
".",
"get",
"(",
"\"formatRow\"",
")",
".",
"call",
"(",
"this",
",",
"elTr",
",",
"oRecord",
")",
":",
"true",
";",
"if",
"(",
"ok",
")",
"{",
"// Hide the row to prevent constant reflows",
"elTr",
".",
"style",
".",
"display",
"=",
"'none'",
";",
"// Update TD elements with new data",
"var",
"allTds",
"=",
"elTr",
".",
"childNodes",
",",
"elTd",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"allTds",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"elTd",
"=",
"allTds",
"[",
"i",
"]",
";",
"// Set the cell content",
"this",
".",
"formatCell",
"(",
"allTds",
"[",
"i",
"]",
".",
"firstChild",
",",
"oRecord",
",",
"this",
".",
"_oColumnSet",
".",
"keys",
"[",
"i",
"]",
")",
";",
"}",
"// Redisplay the row for reflow",
"elTr",
".",
"style",
".",
"display",
"=",
"''",
";",
"}",
"elTr",
".",
"id",
"=",
"oRecord",
".",
"getId",
"(",
")",
";",
"// Needed for Record association and tracking of FIRST/LAST",
"return",
"elTr",
";",
"}"
]
| Formats the contents of the given TR's TD elements with data from the given
Record. Only innerHTML should change, nothing structural.
@method _updateTrEl
@param elTr {HTMLElement} The TR element to update.
@param oRecord {YAHOO.widget.Record} The associated Record instance.
@return {HTMLElement} DOM reference to the new TR element.
@private | [
"Formats",
"the",
"contents",
"of",
"the",
"given",
"TR",
"s",
"TD",
"elements",
"with",
"data",
"from",
"the",
"given",
"Record",
".",
"Only",
"innerHTML",
"should",
"change",
"nothing",
"structural",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5445-L5467 |
|
42,502 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(row) {
var rowIndex;
// Get page row index for the element
if(!lang.isNumber(row)) {
rowIndex = Dom.get(row).sectionRowIndex;
}
else {
rowIndex = row;
}
if(lang.isNumber(rowIndex) && (rowIndex > -2) && (rowIndex < this._elTbody.rows.length)) {
// Cannot use tbody.deleteRow due to IE6 instability
//return this._elTbody.deleteRow(rowIndex);
return this._elTbody.removeChild(this.getTrEl(row));
}
else {
return null;
}
} | javascript | function(row) {
var rowIndex;
// Get page row index for the element
if(!lang.isNumber(row)) {
rowIndex = Dom.get(row).sectionRowIndex;
}
else {
rowIndex = row;
}
if(lang.isNumber(rowIndex) && (rowIndex > -2) && (rowIndex < this._elTbody.rows.length)) {
// Cannot use tbody.deleteRow due to IE6 instability
//return this._elTbody.deleteRow(rowIndex);
return this._elTbody.removeChild(this.getTrEl(row));
}
else {
return null;
}
} | [
"function",
"(",
"row",
")",
"{",
"var",
"rowIndex",
";",
"// Get page row index for the element",
"if",
"(",
"!",
"lang",
".",
"isNumber",
"(",
"row",
")",
")",
"{",
"rowIndex",
"=",
"Dom",
".",
"get",
"(",
"row",
")",
".",
"sectionRowIndex",
";",
"}",
"else",
"{",
"rowIndex",
"=",
"row",
";",
"}",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"rowIndex",
")",
"&&",
"(",
"rowIndex",
">",
"-",
"2",
")",
"&&",
"(",
"rowIndex",
"<",
"this",
".",
"_elTbody",
".",
"rows",
".",
"length",
")",
")",
"{",
"// Cannot use tbody.deleteRow due to IE6 instability",
"//return this._elTbody.deleteRow(rowIndex);",
"return",
"this",
".",
"_elTbody",
".",
"removeChild",
"(",
"this",
".",
"getTrEl",
"(",
"row",
")",
")",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}"
]
| Deletes TR element by DOM reference or by DataTable page row index.
@method _deleteTrEl
@param row {HTMLElement | Number} TR element reference or Datatable page row index.
@return {Boolean} Returns true if successful, else returns false.
@private | [
"Deletes",
"TR",
"element",
"by",
"DOM",
"reference",
"or",
"by",
"DataTable",
"page",
"row",
"index",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5478-L5496 |
|
42,503 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
this._unsetFirstRow();
var elTr = this.getFirstTrEl();
if(elTr) {
// Set FIRST
Dom.addClass(elTr, DT.CLASS_FIRST);
this._sFirstTrId = elTr.id;
}
} | javascript | function() {
this._unsetFirstRow();
var elTr = this.getFirstTrEl();
if(elTr) {
// Set FIRST
Dom.addClass(elTr, DT.CLASS_FIRST);
this._sFirstTrId = elTr.id;
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"_unsetFirstRow",
"(",
")",
";",
"var",
"elTr",
"=",
"this",
".",
"getFirstTrEl",
"(",
")",
";",
"if",
"(",
"elTr",
")",
"{",
"// Set FIRST",
"Dom",
".",
"addClass",
"(",
"elTr",
",",
"DT",
".",
"CLASS_FIRST",
")",
";",
"this",
".",
"_sFirstTrId",
"=",
"elTr",
".",
"id",
";",
"}",
"}"
]
| Assigns the class YAHOO.widget.DataTable.CLASS_FIRST to the first TR element
of the DataTable page and updates internal tracker.
@method _setFirstRow
@private | [
"Assigns",
"the",
"class",
"YAHOO",
".",
"widget",
".",
"DataTable",
".",
"CLASS_FIRST",
"to",
"the",
"first",
"TR",
"element",
"of",
"the",
"DataTable",
"page",
"and",
"updates",
"internal",
"tracker",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5551-L5559 |
|
42,504 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
this._unsetLastRow();
var elTr = this.getLastTrEl();
if(elTr) {
// Assign class
Dom.addClass(elTr, DT.CLASS_LAST);
this._sLastTrId = elTr.id;
}
} | javascript | function() {
this._unsetLastRow();
var elTr = this.getLastTrEl();
if(elTr) {
// Assign class
Dom.addClass(elTr, DT.CLASS_LAST);
this._sLastTrId = elTr.id;
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"_unsetLastRow",
"(",
")",
";",
"var",
"elTr",
"=",
"this",
".",
"getLastTrEl",
"(",
")",
";",
"if",
"(",
"elTr",
")",
"{",
"// Assign class",
"Dom",
".",
"addClass",
"(",
"elTr",
",",
"DT",
".",
"CLASS_LAST",
")",
";",
"this",
".",
"_sLastTrId",
"=",
"elTr",
".",
"id",
";",
"}",
"}"
]
| Assigns the class YAHOO.widget.DataTable.CLASS_LAST to the last TR element
of the DataTable page and updates internal tracker.
@method _setLastRow
@private | [
"Assigns",
"the",
"class",
"YAHOO",
".",
"widget",
".",
"DataTable",
".",
"CLASS_LAST",
"to",
"the",
"last",
"TR",
"element",
"of",
"the",
"DataTable",
"page",
"and",
"updates",
"internal",
"tracker",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5583-L5591 |
|
42,505 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(row, range) {
// Default values stripe all rows
var allRows = this._elTbody.rows,
nStartIndex = 0,
nEndIndex = allRows.length,
aOdds = [], nOddIdx = 0,
aEvens = [], nEvenIdx = 0;
// Stripe a subset
if((row !== null) && (row !== undefined)) {
// Validate given start row
var elStartRow = this.getTrEl(row);
if(elStartRow) {
nStartIndex = elStartRow.sectionRowIndex;
// Validate given range
if(lang.isNumber(range) && (range > 1)) {
nEndIndex = nStartIndex + range;
}
}
}
for(var i=nStartIndex; i<nEndIndex; i++) {
if(i%2) {
aOdds[nOddIdx++] = allRows[i];
} else {
aEvens[nEvenIdx++] = allRows[i];
}
}
if (aOdds.length) {
Dom.replaceClass(aOdds, DT.CLASS_EVEN, DT.CLASS_ODD);
}
if (aEvens.length) {
Dom.replaceClass(aEvens, DT.CLASS_ODD, DT.CLASS_EVEN);
}
} | javascript | function(row, range) {
// Default values stripe all rows
var allRows = this._elTbody.rows,
nStartIndex = 0,
nEndIndex = allRows.length,
aOdds = [], nOddIdx = 0,
aEvens = [], nEvenIdx = 0;
// Stripe a subset
if((row !== null) && (row !== undefined)) {
// Validate given start row
var elStartRow = this.getTrEl(row);
if(elStartRow) {
nStartIndex = elStartRow.sectionRowIndex;
// Validate given range
if(lang.isNumber(range) && (range > 1)) {
nEndIndex = nStartIndex + range;
}
}
}
for(var i=nStartIndex; i<nEndIndex; i++) {
if(i%2) {
aOdds[nOddIdx++] = allRows[i];
} else {
aEvens[nEvenIdx++] = allRows[i];
}
}
if (aOdds.length) {
Dom.replaceClass(aOdds, DT.CLASS_EVEN, DT.CLASS_ODD);
}
if (aEvens.length) {
Dom.replaceClass(aEvens, DT.CLASS_ODD, DT.CLASS_EVEN);
}
} | [
"function",
"(",
"row",
",",
"range",
")",
"{",
"// Default values stripe all rows",
"var",
"allRows",
"=",
"this",
".",
"_elTbody",
".",
"rows",
",",
"nStartIndex",
"=",
"0",
",",
"nEndIndex",
"=",
"allRows",
".",
"length",
",",
"aOdds",
"=",
"[",
"]",
",",
"nOddIdx",
"=",
"0",
",",
"aEvens",
"=",
"[",
"]",
",",
"nEvenIdx",
"=",
"0",
";",
"// Stripe a subset",
"if",
"(",
"(",
"row",
"!==",
"null",
")",
"&&",
"(",
"row",
"!==",
"undefined",
")",
")",
"{",
"// Validate given start row",
"var",
"elStartRow",
"=",
"this",
".",
"getTrEl",
"(",
"row",
")",
";",
"if",
"(",
"elStartRow",
")",
"{",
"nStartIndex",
"=",
"elStartRow",
".",
"sectionRowIndex",
";",
"// Validate given range",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"range",
")",
"&&",
"(",
"range",
">",
"1",
")",
")",
"{",
"nEndIndex",
"=",
"nStartIndex",
"+",
"range",
";",
"}",
"}",
"}",
"for",
"(",
"var",
"i",
"=",
"nStartIndex",
";",
"i",
"<",
"nEndIndex",
";",
"i",
"++",
")",
"{",
"if",
"(",
"i",
"%",
"2",
")",
"{",
"aOdds",
"[",
"nOddIdx",
"++",
"]",
"=",
"allRows",
"[",
"i",
"]",
";",
"}",
"else",
"{",
"aEvens",
"[",
"nEvenIdx",
"++",
"]",
"=",
"allRows",
"[",
"i",
"]",
";",
"}",
"}",
"if",
"(",
"aOdds",
".",
"length",
")",
"{",
"Dom",
".",
"replaceClass",
"(",
"aOdds",
",",
"DT",
".",
"CLASS_EVEN",
",",
"DT",
".",
"CLASS_ODD",
")",
";",
"}",
"if",
"(",
"aEvens",
".",
"length",
")",
"{",
"Dom",
".",
"replaceClass",
"(",
"aEvens",
",",
"DT",
".",
"CLASS_ODD",
",",
"DT",
".",
"CLASS_EVEN",
")",
";",
"}",
"}"
]
| Assigns the classes DT.CLASS_EVEN and DT.CLASS_ODD to one, many, or all TR elements.
@method _setRowStripes
@param row {HTMLElement | String | Number} (optional) HTML TR element reference
or string ID, or page row index of where to start striping.
@param range {Number} (optional) If given, how many rows to stripe, otherwise
stripe all the rows until the end.
@private | [
"Assigns",
"the",
"classes",
"DT",
".",
"CLASS_EVEN",
"and",
"DT",
".",
"CLASS_ODD",
"to",
"one",
"many",
"or",
"all",
"TR",
"elements",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5603-L5640 |
|
42,506 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
// Keep track of selected rows
var allSelectedRows = this.getSelectedRows();
// Keep track of selected cells
var allSelectedCells = this.getSelectedCells();
// Anything to select?
if((allSelectedRows.length>0) || (allSelectedCells.length > 0)) {
var oColumnSet = this._oColumnSet,
el;
// Loop over each row
for(var i=0; i<allSelectedRows.length; i++) {
el = Dom.get(allSelectedRows[i]);
if(el) {
Dom.addClass(el, DT.CLASS_SELECTED);
}
}
// Loop over each cell
for(i=0; i<allSelectedCells.length; i++) {
el = Dom.get(allSelectedCells[i].recordId);
if(el) {
Dom.addClass(el.childNodes[oColumnSet.getColumn(allSelectedCells[i].columnKey).getKeyIndex()], DT.CLASS_SELECTED);
}
}
}
} | javascript | function() {
// Keep track of selected rows
var allSelectedRows = this.getSelectedRows();
// Keep track of selected cells
var allSelectedCells = this.getSelectedCells();
// Anything to select?
if((allSelectedRows.length>0) || (allSelectedCells.length > 0)) {
var oColumnSet = this._oColumnSet,
el;
// Loop over each row
for(var i=0; i<allSelectedRows.length; i++) {
el = Dom.get(allSelectedRows[i]);
if(el) {
Dom.addClass(el, DT.CLASS_SELECTED);
}
}
// Loop over each cell
for(i=0; i<allSelectedCells.length; i++) {
el = Dom.get(allSelectedCells[i].recordId);
if(el) {
Dom.addClass(el.childNodes[oColumnSet.getColumn(allSelectedCells[i].columnKey).getKeyIndex()], DT.CLASS_SELECTED);
}
}
}
} | [
"function",
"(",
")",
"{",
"// Keep track of selected rows",
"var",
"allSelectedRows",
"=",
"this",
".",
"getSelectedRows",
"(",
")",
";",
"// Keep track of selected cells",
"var",
"allSelectedCells",
"=",
"this",
".",
"getSelectedCells",
"(",
")",
";",
"// Anything to select?",
"if",
"(",
"(",
"allSelectedRows",
".",
"length",
">",
"0",
")",
"||",
"(",
"allSelectedCells",
".",
"length",
">",
"0",
")",
")",
"{",
"var",
"oColumnSet",
"=",
"this",
".",
"_oColumnSet",
",",
"el",
";",
"// Loop over each row",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"allSelectedRows",
".",
"length",
";",
"i",
"++",
")",
"{",
"el",
"=",
"Dom",
".",
"get",
"(",
"allSelectedRows",
"[",
"i",
"]",
")",
";",
"if",
"(",
"el",
")",
"{",
"Dom",
".",
"addClass",
"(",
"el",
",",
"DT",
".",
"CLASS_SELECTED",
")",
";",
"}",
"}",
"// Loop over each cell",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"allSelectedCells",
".",
"length",
";",
"i",
"++",
")",
"{",
"el",
"=",
"Dom",
".",
"get",
"(",
"allSelectedCells",
"[",
"i",
"]",
".",
"recordId",
")",
";",
"if",
"(",
"el",
")",
"{",
"Dom",
".",
"addClass",
"(",
"el",
".",
"childNodes",
"[",
"oColumnSet",
".",
"getColumn",
"(",
"allSelectedCells",
"[",
"i",
"]",
".",
"columnKey",
")",
".",
"getKeyIndex",
"(",
")",
"]",
",",
"DT",
".",
"CLASS_SELECTED",
")",
";",
"}",
"}",
"}",
"}"
]
| Assigns the class DT.CLASS_SELECTED to TR and TD elements.
@method _setSelections
@private | [
"Assigns",
"the",
"class",
"DT",
".",
"CLASS_SELECTED",
"to",
"TR",
"and",
"TD",
"elements",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5648-L5672 |
|
42,507 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(e, oSelf) {
var elTarget = Ev.getTarget(e);
var elTag = elTarget.nodeName.toLowerCase();
if(!Dom.isAncestor(oSelf._elContainer, elTarget)) {
oSelf.fireEvent("tableBlurEvent");
// Fires editorBlurEvent when click is not within the TABLE.
// For cases when click is within the TABLE, due to timing issues,
// the editorBlurEvent needs to get fired by the lower-level DOM click
// handlers below rather than by the TABLE click handler directly.
if(oSelf._oCellEditor) {
if(oSelf._oCellEditor.getContainerEl) {
var elContainer = oSelf._oCellEditor.getContainerEl();
// Only if the click was not within the CellEditor container
if(!Dom.isAncestor(elContainer, elTarget) &&
(elContainer.id !== elTarget.id)) {
oSelf._oCellEditor.fireEvent("blurEvent", {editor: oSelf._oCellEditor});
}
}
// Backward Compatibility
else if(oSelf._oCellEditor.isActive) {
// Only if the click was not within the Cell Editor container
if(!Dom.isAncestor(oSelf._oCellEditor.container, elTarget) &&
(oSelf._oCellEditor.container.id !== elTarget.id)) {
oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
}
}
}
}
} | javascript | function(e, oSelf) {
var elTarget = Ev.getTarget(e);
var elTag = elTarget.nodeName.toLowerCase();
if(!Dom.isAncestor(oSelf._elContainer, elTarget)) {
oSelf.fireEvent("tableBlurEvent");
// Fires editorBlurEvent when click is not within the TABLE.
// For cases when click is within the TABLE, due to timing issues,
// the editorBlurEvent needs to get fired by the lower-level DOM click
// handlers below rather than by the TABLE click handler directly.
if(oSelf._oCellEditor) {
if(oSelf._oCellEditor.getContainerEl) {
var elContainer = oSelf._oCellEditor.getContainerEl();
// Only if the click was not within the CellEditor container
if(!Dom.isAncestor(elContainer, elTarget) &&
(elContainer.id !== elTarget.id)) {
oSelf._oCellEditor.fireEvent("blurEvent", {editor: oSelf._oCellEditor});
}
}
// Backward Compatibility
else if(oSelf._oCellEditor.isActive) {
// Only if the click was not within the Cell Editor container
if(!Dom.isAncestor(oSelf._oCellEditor.container, elTarget) &&
(oSelf._oCellEditor.container.id !== elTarget.id)) {
oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
}
}
}
}
} | [
"function",
"(",
"e",
",",
"oSelf",
")",
"{",
"var",
"elTarget",
"=",
"Ev",
".",
"getTarget",
"(",
"e",
")",
";",
"var",
"elTag",
"=",
"elTarget",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
";",
"if",
"(",
"!",
"Dom",
".",
"isAncestor",
"(",
"oSelf",
".",
"_elContainer",
",",
"elTarget",
")",
")",
"{",
"oSelf",
".",
"fireEvent",
"(",
"\"tableBlurEvent\"",
")",
";",
"// Fires editorBlurEvent when click is not within the TABLE.",
"// For cases when click is within the TABLE, due to timing issues,",
"// the editorBlurEvent needs to get fired by the lower-level DOM click",
"// handlers below rather than by the TABLE click handler directly.",
"if",
"(",
"oSelf",
".",
"_oCellEditor",
")",
"{",
"if",
"(",
"oSelf",
".",
"_oCellEditor",
".",
"getContainerEl",
")",
"{",
"var",
"elContainer",
"=",
"oSelf",
".",
"_oCellEditor",
".",
"getContainerEl",
"(",
")",
";",
"// Only if the click was not within the CellEditor container",
"if",
"(",
"!",
"Dom",
".",
"isAncestor",
"(",
"elContainer",
",",
"elTarget",
")",
"&&",
"(",
"elContainer",
".",
"id",
"!==",
"elTarget",
".",
"id",
")",
")",
"{",
"oSelf",
".",
"_oCellEditor",
".",
"fireEvent",
"(",
"\"blurEvent\"",
",",
"{",
"editor",
":",
"oSelf",
".",
"_oCellEditor",
"}",
")",
";",
"}",
"}",
"// Backward Compatibility",
"else",
"if",
"(",
"oSelf",
".",
"_oCellEditor",
".",
"isActive",
")",
"{",
"// Only if the click was not within the Cell Editor container",
"if",
"(",
"!",
"Dom",
".",
"isAncestor",
"(",
"oSelf",
".",
"_oCellEditor",
".",
"container",
",",
"elTarget",
")",
"&&",
"(",
"oSelf",
".",
"_oCellEditor",
".",
"container",
".",
"id",
"!==",
"elTarget",
".",
"id",
")",
")",
"{",
"oSelf",
".",
"fireEvent",
"(",
"\"editorBlurEvent\"",
",",
"{",
"editor",
":",
"oSelf",
".",
"_oCellEditor",
"}",
")",
";",
"}",
"}",
"}",
"}",
"}"
]
| Handles click events on the DOCUMENT.
@method _onDocumentClick
@param e {HTMLEvent} The click event.
@param oSelf {YAHOO.wiget.DataTable} DataTable instance.
@private | [
"Handles",
"click",
"events",
"on",
"the",
"DOCUMENT",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5775-L5805 |
|
42,508 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(e, oSelf) {
var elTarget = Ev.getTarget(e);
var elTag = elTarget.nodeName.toLowerCase();
var bKeepBubbling = true;
while(elTarget && (elTag != "table")) {
switch(elTag) {
case "body":
return;
case "a":
break;
case "td":
bKeepBubbling = oSelf.fireEvent("cellMouseoverEvent",{target:elTarget,event:e});
break;
case "span":
if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
bKeepBubbling = oSelf.fireEvent("theadLabelMouseoverEvent",{target:elTarget,event:e});
// Backward compatibility
bKeepBubbling = oSelf.fireEvent("headerLabelMouseoverEvent",{target:elTarget,event:e});
}
break;
case "th":
bKeepBubbling = oSelf.fireEvent("theadCellMouseoverEvent",{target:elTarget,event:e});
// Backward compatibility
bKeepBubbling = oSelf.fireEvent("headerCellMouseoverEvent",{target:elTarget,event:e});
break;
case "tr":
if(elTarget.parentNode.nodeName.toLowerCase() == "thead") {
bKeepBubbling = oSelf.fireEvent("theadRowMouseoverEvent",{target:elTarget,event:e});
// Backward compatibility
bKeepBubbling = oSelf.fireEvent("headerRowMouseoverEvent",{target:elTarget,event:e});
}
else {
bKeepBubbling = oSelf.fireEvent("rowMouseoverEvent",{target:elTarget,event:e});
}
break;
default:
break;
}
if(bKeepBubbling === false) {
return;
}
else {
elTarget = elTarget.parentNode;
if(elTarget) {
elTag = elTarget.nodeName.toLowerCase();
}
}
}
oSelf.fireEvent("tableMouseoverEvent",{target:(elTarget || oSelf._elContainer),event:e});
} | javascript | function(e, oSelf) {
var elTarget = Ev.getTarget(e);
var elTag = elTarget.nodeName.toLowerCase();
var bKeepBubbling = true;
while(elTarget && (elTag != "table")) {
switch(elTag) {
case "body":
return;
case "a":
break;
case "td":
bKeepBubbling = oSelf.fireEvent("cellMouseoverEvent",{target:elTarget,event:e});
break;
case "span":
if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
bKeepBubbling = oSelf.fireEvent("theadLabelMouseoverEvent",{target:elTarget,event:e});
// Backward compatibility
bKeepBubbling = oSelf.fireEvent("headerLabelMouseoverEvent",{target:elTarget,event:e});
}
break;
case "th":
bKeepBubbling = oSelf.fireEvent("theadCellMouseoverEvent",{target:elTarget,event:e});
// Backward compatibility
bKeepBubbling = oSelf.fireEvent("headerCellMouseoverEvent",{target:elTarget,event:e});
break;
case "tr":
if(elTarget.parentNode.nodeName.toLowerCase() == "thead") {
bKeepBubbling = oSelf.fireEvent("theadRowMouseoverEvent",{target:elTarget,event:e});
// Backward compatibility
bKeepBubbling = oSelf.fireEvent("headerRowMouseoverEvent",{target:elTarget,event:e});
}
else {
bKeepBubbling = oSelf.fireEvent("rowMouseoverEvent",{target:elTarget,event:e});
}
break;
default:
break;
}
if(bKeepBubbling === false) {
return;
}
else {
elTarget = elTarget.parentNode;
if(elTarget) {
elTag = elTarget.nodeName.toLowerCase();
}
}
}
oSelf.fireEvent("tableMouseoverEvent",{target:(elTarget || oSelf._elContainer),event:e});
} | [
"function",
"(",
"e",
",",
"oSelf",
")",
"{",
"var",
"elTarget",
"=",
"Ev",
".",
"getTarget",
"(",
"e",
")",
";",
"var",
"elTag",
"=",
"elTarget",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
";",
"var",
"bKeepBubbling",
"=",
"true",
";",
"while",
"(",
"elTarget",
"&&",
"(",
"elTag",
"!=",
"\"table\"",
")",
")",
"{",
"switch",
"(",
"elTag",
")",
"{",
"case",
"\"body\"",
":",
"return",
";",
"case",
"\"a\"",
":",
"break",
";",
"case",
"\"td\"",
":",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"cellMouseoverEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"break",
";",
"case",
"\"span\"",
":",
"if",
"(",
"Dom",
".",
"hasClass",
"(",
"elTarget",
",",
"DT",
".",
"CLASS_LABEL",
")",
")",
"{",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"theadLabelMouseoverEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"// Backward compatibility",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"headerLabelMouseoverEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"}",
"break",
";",
"case",
"\"th\"",
":",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"theadCellMouseoverEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"// Backward compatibility",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"headerCellMouseoverEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"break",
";",
"case",
"\"tr\"",
":",
"if",
"(",
"elTarget",
".",
"parentNode",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
"==",
"\"thead\"",
")",
"{",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"theadRowMouseoverEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"// Backward compatibility",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"headerRowMouseoverEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"}",
"else",
"{",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"rowMouseoverEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"}",
"break",
";",
"default",
":",
"break",
";",
"}",
"if",
"(",
"bKeepBubbling",
"===",
"false",
")",
"{",
"return",
";",
"}",
"else",
"{",
"elTarget",
"=",
"elTarget",
".",
"parentNode",
";",
"if",
"(",
"elTarget",
")",
"{",
"elTag",
"=",
"elTarget",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
";",
"}",
"}",
"}",
"oSelf",
".",
"fireEvent",
"(",
"\"tableMouseoverEvent\"",
",",
"{",
"target",
":",
"(",
"elTarget",
"||",
"oSelf",
".",
"_elContainer",
")",
",",
"event",
":",
"e",
"}",
")",
";",
"}"
]
| Handles mouseover events on the DataTable instance.
@method _onTableMouseover
@param e {HTMLEvent} The mouseover event.
@param oSelf {YAHOO.wiget.DataTable} DataTable instance.
@private | [
"Handles",
"mouseover",
"events",
"on",
"the",
"DataTable",
"instance",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L5853-L5902 |
|
42,509 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(e, oSelf) {
var sMode = oSelf.get("selectionMode");
if(sMode == "standard") {
oSelf._handleStandardSelectionByKey(e);
}
else if(sMode == "single") {
oSelf._handleSingleSelectionByKey(e);
}
else if(sMode == "cellblock") {
oSelf._handleCellBlockSelectionByKey(e);
}
else if(sMode == "cellrange") {
oSelf._handleCellRangeSelectionByKey(e);
}
else if(sMode == "singlecell") {
oSelf._handleSingleCellSelectionByKey(e);
}
if(oSelf._oCellEditor) {
if(oSelf._oCellEditor.fireEvent) {
oSelf._oCellEditor.fireEvent("blurEvent", {editor: oSelf._oCellEditor});
}
else if(oSelf._oCellEditor.isActive) {
oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
}
}
var elTarget = Ev.getTarget(e);
var elTag = elTarget.nodeName.toLowerCase();
var bKeepBubbling = true;
while(elTarget && (elTag != "table")) {
switch(elTag) {
case "body":
return;
case "tbody":
bKeepBubbling = oSelf.fireEvent("tbodyKeyEvent",{target:elTarget,event:e});
break;
default:
break;
}
if(bKeepBubbling === false) {
return;
}
else {
elTarget = elTarget.parentNode;
if(elTarget) {
elTag = elTarget.nodeName.toLowerCase();
}
}
}
oSelf.fireEvent("tableKeyEvent",{target:(elTarget || oSelf._elContainer),event:e});
} | javascript | function(e, oSelf) {
var sMode = oSelf.get("selectionMode");
if(sMode == "standard") {
oSelf._handleStandardSelectionByKey(e);
}
else if(sMode == "single") {
oSelf._handleSingleSelectionByKey(e);
}
else if(sMode == "cellblock") {
oSelf._handleCellBlockSelectionByKey(e);
}
else if(sMode == "cellrange") {
oSelf._handleCellRangeSelectionByKey(e);
}
else if(sMode == "singlecell") {
oSelf._handleSingleCellSelectionByKey(e);
}
if(oSelf._oCellEditor) {
if(oSelf._oCellEditor.fireEvent) {
oSelf._oCellEditor.fireEvent("blurEvent", {editor: oSelf._oCellEditor});
}
else if(oSelf._oCellEditor.isActive) {
oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
}
}
var elTarget = Ev.getTarget(e);
var elTag = elTarget.nodeName.toLowerCase();
var bKeepBubbling = true;
while(elTarget && (elTag != "table")) {
switch(elTag) {
case "body":
return;
case "tbody":
bKeepBubbling = oSelf.fireEvent("tbodyKeyEvent",{target:elTarget,event:e});
break;
default:
break;
}
if(bKeepBubbling === false) {
return;
}
else {
elTarget = elTarget.parentNode;
if(elTarget) {
elTag = elTarget.nodeName.toLowerCase();
}
}
}
oSelf.fireEvent("tableKeyEvent",{target:(elTarget || oSelf._elContainer),event:e});
} | [
"function",
"(",
"e",
",",
"oSelf",
")",
"{",
"var",
"sMode",
"=",
"oSelf",
".",
"get",
"(",
"\"selectionMode\"",
")",
";",
"if",
"(",
"sMode",
"==",
"\"standard\"",
")",
"{",
"oSelf",
".",
"_handleStandardSelectionByKey",
"(",
"e",
")",
";",
"}",
"else",
"if",
"(",
"sMode",
"==",
"\"single\"",
")",
"{",
"oSelf",
".",
"_handleSingleSelectionByKey",
"(",
"e",
")",
";",
"}",
"else",
"if",
"(",
"sMode",
"==",
"\"cellblock\"",
")",
"{",
"oSelf",
".",
"_handleCellBlockSelectionByKey",
"(",
"e",
")",
";",
"}",
"else",
"if",
"(",
"sMode",
"==",
"\"cellrange\"",
")",
"{",
"oSelf",
".",
"_handleCellRangeSelectionByKey",
"(",
"e",
")",
";",
"}",
"else",
"if",
"(",
"sMode",
"==",
"\"singlecell\"",
")",
"{",
"oSelf",
".",
"_handleSingleCellSelectionByKey",
"(",
"e",
")",
";",
"}",
"if",
"(",
"oSelf",
".",
"_oCellEditor",
")",
"{",
"if",
"(",
"oSelf",
".",
"_oCellEditor",
".",
"fireEvent",
")",
"{",
"oSelf",
".",
"_oCellEditor",
".",
"fireEvent",
"(",
"\"blurEvent\"",
",",
"{",
"editor",
":",
"oSelf",
".",
"_oCellEditor",
"}",
")",
";",
"}",
"else",
"if",
"(",
"oSelf",
".",
"_oCellEditor",
".",
"isActive",
")",
"{",
"oSelf",
".",
"fireEvent",
"(",
"\"editorBlurEvent\"",
",",
"{",
"editor",
":",
"oSelf",
".",
"_oCellEditor",
"}",
")",
";",
"}",
"}",
"var",
"elTarget",
"=",
"Ev",
".",
"getTarget",
"(",
"e",
")",
";",
"var",
"elTag",
"=",
"elTarget",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
";",
"var",
"bKeepBubbling",
"=",
"true",
";",
"while",
"(",
"elTarget",
"&&",
"(",
"elTag",
"!=",
"\"table\"",
")",
")",
"{",
"switch",
"(",
"elTag",
")",
"{",
"case",
"\"body\"",
":",
"return",
";",
"case",
"\"tbody\"",
":",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"tbodyKeyEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"break",
";",
"default",
":",
"break",
";",
"}",
"if",
"(",
"bKeepBubbling",
"===",
"false",
")",
"{",
"return",
";",
"}",
"else",
"{",
"elTarget",
"=",
"elTarget",
".",
"parentNode",
";",
"if",
"(",
"elTarget",
")",
"{",
"elTag",
"=",
"elTarget",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
";",
"}",
"}",
"}",
"oSelf",
".",
"fireEvent",
"(",
"\"tableKeyEvent\"",
",",
"{",
"target",
":",
"(",
"elTarget",
"||",
"oSelf",
".",
"_elContainer",
")",
",",
"event",
":",
"e",
"}",
")",
";",
"}"
]
| Handles keydown events on the TBODY element. Handles selection behavior,
provides hooks for ENTER to edit functionality.
@method _onTbodyKeydown
@param e {HTMLEvent} The key event.
@param oSelf {YAHOO.wiget.DataTable} DataTable instance.
@private | [
"Handles",
"keydown",
"events",
"on",
"the",
"TBODY",
"element",
".",
"Handles",
"selection",
"behavior",
"provides",
"hooks",
"for",
"ENTER",
"to",
"edit",
"functionality",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L6185-L6237 |
|
42,510 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(e, oSelf) {
if(ua.opera || (navigator.userAgent.toLowerCase().indexOf("mac") !== -1) && (ua.webkit < 420)) {
var nKey = Ev.getCharCode(e);
// arrow down
if(nKey == 40) {
Ev.stopEvent(e);
}
// arrow up
else if(nKey == 38) {
Ev.stopEvent(e);
}
}
} | javascript | function(e, oSelf) {
if(ua.opera || (navigator.userAgent.toLowerCase().indexOf("mac") !== -1) && (ua.webkit < 420)) {
var nKey = Ev.getCharCode(e);
// arrow down
if(nKey == 40) {
Ev.stopEvent(e);
}
// arrow up
else if(nKey == 38) {
Ev.stopEvent(e);
}
}
} | [
"function",
"(",
"e",
",",
"oSelf",
")",
"{",
"if",
"(",
"ua",
".",
"opera",
"||",
"(",
"navigator",
".",
"userAgent",
".",
"toLowerCase",
"(",
")",
".",
"indexOf",
"(",
"\"mac\"",
")",
"!==",
"-",
"1",
")",
"&&",
"(",
"ua",
".",
"webkit",
"<",
"420",
")",
")",
"{",
"var",
"nKey",
"=",
"Ev",
".",
"getCharCode",
"(",
"e",
")",
";",
"// arrow down",
"if",
"(",
"nKey",
"==",
"40",
")",
"{",
"Ev",
".",
"stopEvent",
"(",
"e",
")",
";",
"}",
"// arrow up",
"else",
"if",
"(",
"nKey",
"==",
"38",
")",
"{",
"Ev",
".",
"stopEvent",
"(",
"e",
")",
";",
"}",
"}",
"}"
]
| Handles keypress events on the TABLE. Mainly to support stopEvent on Mac.
@method _onTableKeypress
@param e {HTMLEvent} The key event.
@param oSelf {YAHOO.wiget.DataTable} DataTable instance.
@private | [
"Handles",
"keypress",
"events",
"on",
"the",
"TABLE",
".",
"Mainly",
"to",
"support",
"stopEvent",
"on",
"Mac",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L6247-L6259 |
|
42,511 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(e, oSelf) {
// This blurs the CellEditor
if(oSelf._oCellEditor) {
if(oSelf._oCellEditor.fireEvent) {
oSelf._oCellEditor.fireEvent("blurEvent", {editor: oSelf._oCellEditor});
}
// Backward compatibility
else if(oSelf._oCellEditor.isActive) {
oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
}
}
var elTarget = Ev.getTarget(e),
elTag = elTarget.nodeName.toLowerCase(),
bKeepBubbling = true;
while(elTarget && (elTag != "table")) {
switch(elTag) {
case "body":
return;
case "input":
var sType = elTarget.type.toLowerCase();
if(sType == "checkbox") {
bKeepBubbling = oSelf.fireEvent("theadCheckboxClickEvent",{target:elTarget,event:e});
}
else if(sType == "radio") {
bKeepBubbling = oSelf.fireEvent("theadRadioClickEvent",{target:elTarget,event:e});
}
else if((sType == "button") || (sType == "image") || (sType == "submit") || (sType == "reset")) {
bKeepBubbling = oSelf.fireEvent("theadButtonClickEvent",{target:elTarget,event:e});
}
break;
case "a":
bKeepBubbling = oSelf.fireEvent("theadLinkClickEvent",{target:elTarget,event:e});
break;
case "button":
bKeepBubbling = oSelf.fireEvent("theadButtonClickEvent",{target:elTarget,event:e});
break;
case "span":
if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
bKeepBubbling = oSelf.fireEvent("theadLabelClickEvent",{target:elTarget,event:e});
// Backward compatibility
bKeepBubbling = oSelf.fireEvent("headerLabelClickEvent",{target:elTarget,event:e});
}
break;
case "th":
bKeepBubbling = oSelf.fireEvent("theadCellClickEvent",{target:elTarget,event:e});
// Backward compatibility
bKeepBubbling = oSelf.fireEvent("headerCellClickEvent",{target:elTarget,event:e});
break;
case "tr":
bKeepBubbling = oSelf.fireEvent("theadRowClickEvent",{target:elTarget,event:e});
// Backward compatibility
bKeepBubbling = oSelf.fireEvent("headerRowClickEvent",{target:elTarget,event:e});
break;
default:
break;
}
if(bKeepBubbling === false) {
return;
}
else {
elTarget = elTarget.parentNode;
if(elTarget) {
elTag = elTarget.nodeName.toLowerCase();
}
}
}
oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elContainer),event:e});
} | javascript | function(e, oSelf) {
// This blurs the CellEditor
if(oSelf._oCellEditor) {
if(oSelf._oCellEditor.fireEvent) {
oSelf._oCellEditor.fireEvent("blurEvent", {editor: oSelf._oCellEditor});
}
// Backward compatibility
else if(oSelf._oCellEditor.isActive) {
oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
}
}
var elTarget = Ev.getTarget(e),
elTag = elTarget.nodeName.toLowerCase(),
bKeepBubbling = true;
while(elTarget && (elTag != "table")) {
switch(elTag) {
case "body":
return;
case "input":
var sType = elTarget.type.toLowerCase();
if(sType == "checkbox") {
bKeepBubbling = oSelf.fireEvent("theadCheckboxClickEvent",{target:elTarget,event:e});
}
else if(sType == "radio") {
bKeepBubbling = oSelf.fireEvent("theadRadioClickEvent",{target:elTarget,event:e});
}
else if((sType == "button") || (sType == "image") || (sType == "submit") || (sType == "reset")) {
bKeepBubbling = oSelf.fireEvent("theadButtonClickEvent",{target:elTarget,event:e});
}
break;
case "a":
bKeepBubbling = oSelf.fireEvent("theadLinkClickEvent",{target:elTarget,event:e});
break;
case "button":
bKeepBubbling = oSelf.fireEvent("theadButtonClickEvent",{target:elTarget,event:e});
break;
case "span":
if(Dom.hasClass(elTarget, DT.CLASS_LABEL)) {
bKeepBubbling = oSelf.fireEvent("theadLabelClickEvent",{target:elTarget,event:e});
// Backward compatibility
bKeepBubbling = oSelf.fireEvent("headerLabelClickEvent",{target:elTarget,event:e});
}
break;
case "th":
bKeepBubbling = oSelf.fireEvent("theadCellClickEvent",{target:elTarget,event:e});
// Backward compatibility
bKeepBubbling = oSelf.fireEvent("headerCellClickEvent",{target:elTarget,event:e});
break;
case "tr":
bKeepBubbling = oSelf.fireEvent("theadRowClickEvent",{target:elTarget,event:e});
// Backward compatibility
bKeepBubbling = oSelf.fireEvent("headerRowClickEvent",{target:elTarget,event:e});
break;
default:
break;
}
if(bKeepBubbling === false) {
return;
}
else {
elTarget = elTarget.parentNode;
if(elTarget) {
elTag = elTarget.nodeName.toLowerCase();
}
}
}
oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elContainer),event:e});
} | [
"function",
"(",
"e",
",",
"oSelf",
")",
"{",
"// This blurs the CellEditor",
"if",
"(",
"oSelf",
".",
"_oCellEditor",
")",
"{",
"if",
"(",
"oSelf",
".",
"_oCellEditor",
".",
"fireEvent",
")",
"{",
"oSelf",
".",
"_oCellEditor",
".",
"fireEvent",
"(",
"\"blurEvent\"",
",",
"{",
"editor",
":",
"oSelf",
".",
"_oCellEditor",
"}",
")",
";",
"}",
"// Backward compatibility",
"else",
"if",
"(",
"oSelf",
".",
"_oCellEditor",
".",
"isActive",
")",
"{",
"oSelf",
".",
"fireEvent",
"(",
"\"editorBlurEvent\"",
",",
"{",
"editor",
":",
"oSelf",
".",
"_oCellEditor",
"}",
")",
";",
"}",
"}",
"var",
"elTarget",
"=",
"Ev",
".",
"getTarget",
"(",
"e",
")",
",",
"elTag",
"=",
"elTarget",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
",",
"bKeepBubbling",
"=",
"true",
";",
"while",
"(",
"elTarget",
"&&",
"(",
"elTag",
"!=",
"\"table\"",
")",
")",
"{",
"switch",
"(",
"elTag",
")",
"{",
"case",
"\"body\"",
":",
"return",
";",
"case",
"\"input\"",
":",
"var",
"sType",
"=",
"elTarget",
".",
"type",
".",
"toLowerCase",
"(",
")",
";",
"if",
"(",
"sType",
"==",
"\"checkbox\"",
")",
"{",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"theadCheckboxClickEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"}",
"else",
"if",
"(",
"sType",
"==",
"\"radio\"",
")",
"{",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"theadRadioClickEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"}",
"else",
"if",
"(",
"(",
"sType",
"==",
"\"button\"",
")",
"||",
"(",
"sType",
"==",
"\"image\"",
")",
"||",
"(",
"sType",
"==",
"\"submit\"",
")",
"||",
"(",
"sType",
"==",
"\"reset\"",
")",
")",
"{",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"theadButtonClickEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"}",
"break",
";",
"case",
"\"a\"",
":",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"theadLinkClickEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"break",
";",
"case",
"\"button\"",
":",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"theadButtonClickEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"break",
";",
"case",
"\"span\"",
":",
"if",
"(",
"Dom",
".",
"hasClass",
"(",
"elTarget",
",",
"DT",
".",
"CLASS_LABEL",
")",
")",
"{",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"theadLabelClickEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"// Backward compatibility",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"headerLabelClickEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"}",
"break",
";",
"case",
"\"th\"",
":",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"theadCellClickEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"// Backward compatibility",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"headerCellClickEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"break",
";",
"case",
"\"tr\"",
":",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"theadRowClickEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"// Backward compatibility",
"bKeepBubbling",
"=",
"oSelf",
".",
"fireEvent",
"(",
"\"headerRowClickEvent\"",
",",
"{",
"target",
":",
"elTarget",
",",
"event",
":",
"e",
"}",
")",
";",
"break",
";",
"default",
":",
"break",
";",
"}",
"if",
"(",
"bKeepBubbling",
"===",
"false",
")",
"{",
"return",
";",
"}",
"else",
"{",
"elTarget",
"=",
"elTarget",
".",
"parentNode",
";",
"if",
"(",
"elTarget",
")",
"{",
"elTag",
"=",
"elTarget",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
";",
"}",
"}",
"}",
"oSelf",
".",
"fireEvent",
"(",
"\"tableClickEvent\"",
",",
"{",
"target",
":",
"(",
"elTarget",
"||",
"oSelf",
".",
"_elContainer",
")",
",",
"event",
":",
"e",
"}",
")",
";",
"}"
]
| Handles click events on the THEAD element.
@method _onTheadClick
@param e {HTMLEvent} The click event.
@param oSelf {YAHOO.wiget.DataTable} DataTable instance.
@private | [
"Handles",
"click",
"events",
"on",
"the",
"THEAD",
"element",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L6269-L6337 |
|
42,512 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(e, oSelf) {
var elTarget = Ev.getTarget(e);
oSelf.fireEvent("dropdownChangeEvent", {event:e, target:elTarget});
} | javascript | function(e, oSelf) {
var elTarget = Ev.getTarget(e);
oSelf.fireEvent("dropdownChangeEvent", {event:e, target:elTarget});
} | [
"function",
"(",
"e",
",",
"oSelf",
")",
"{",
"var",
"elTarget",
"=",
"Ev",
".",
"getTarget",
"(",
"e",
")",
";",
"oSelf",
".",
"fireEvent",
"(",
"\"dropdownChangeEvent\"",
",",
"{",
"event",
":",
"e",
",",
"target",
":",
"elTarget",
"}",
")",
";",
"}"
]
| Handles change events on SELECT elements within DataTable.
@method _onDropdownChange
@param e {HTMLEvent} The change event.
@param oSelf {YAHOO.wiget.DataTable} DataTable instance.
@private | [
"Handles",
"change",
"events",
"on",
"SELECT",
"elements",
"within",
"DataTable",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L6414-L6417 |
|
42,513 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(row) {
// By Record
if(row instanceof YAHOO.widget.Record) {
return document.getElementById(row.getId());
}
// By page row index
else if(lang.isNumber(row)) {
var allRows = this._elTbody.rows;
return ((row > -1) && (row < allRows.length)) ? allRows[row] : null;
}
// By ID string or element reference
else {
var elRow = (lang.isString(row)) ? document.getElementById(row) : row;
// Validate HTML element
if(elRow && (elRow.ownerDocument == document)) {
// Validate TR element
if(elRow.nodeName.toLowerCase() != "tr") {
// Traverse up the DOM to find the corresponding TR element
elRow = Dom.getAncestorByTagName(elRow,"tr");
}
return elRow;
}
}
return null;
} | javascript | function(row) {
// By Record
if(row instanceof YAHOO.widget.Record) {
return document.getElementById(row.getId());
}
// By page row index
else if(lang.isNumber(row)) {
var allRows = this._elTbody.rows;
return ((row > -1) && (row < allRows.length)) ? allRows[row] : null;
}
// By ID string or element reference
else {
var elRow = (lang.isString(row)) ? document.getElementById(row) : row;
// Validate HTML element
if(elRow && (elRow.ownerDocument == document)) {
// Validate TR element
if(elRow.nodeName.toLowerCase() != "tr") {
// Traverse up the DOM to find the corresponding TR element
elRow = Dom.getAncestorByTagName(elRow,"tr");
}
return elRow;
}
}
return null;
} | [
"function",
"(",
"row",
")",
"{",
"// By Record",
"if",
"(",
"row",
"instanceof",
"YAHOO",
".",
"widget",
".",
"Record",
")",
"{",
"return",
"document",
".",
"getElementById",
"(",
"row",
".",
"getId",
"(",
")",
")",
";",
"}",
"// By page row index",
"else",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"row",
")",
")",
"{",
"var",
"allRows",
"=",
"this",
".",
"_elTbody",
".",
"rows",
";",
"return",
"(",
"(",
"row",
">",
"-",
"1",
")",
"&&",
"(",
"row",
"<",
"allRows",
".",
"length",
")",
")",
"?",
"allRows",
"[",
"row",
"]",
":",
"null",
";",
"}",
"// By ID string or element reference",
"else",
"{",
"var",
"elRow",
"=",
"(",
"lang",
".",
"isString",
"(",
"row",
")",
")",
"?",
"document",
".",
"getElementById",
"(",
"row",
")",
":",
"row",
";",
"// Validate HTML element",
"if",
"(",
"elRow",
"&&",
"(",
"elRow",
".",
"ownerDocument",
"==",
"document",
")",
")",
"{",
"// Validate TR element",
"if",
"(",
"elRow",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
"!=",
"\"tr\"",
")",
"{",
"// Traverse up the DOM to find the corresponding TR element",
"elRow",
"=",
"Dom",
".",
"getAncestorByTagName",
"(",
"elRow",
",",
"\"tr\"",
")",
";",
"}",
"return",
"elRow",
";",
"}",
"}",
"return",
"null",
";",
"}"
]
| Returns the corresponding TR reference for a given DOM element, ID string or
directly page row index. If the given identifier is a child of a TR element,
then DOM tree is traversed until a parent TR element is returned, otherwise
null.
@method getTrEl
@param row {HTMLElement | String | Number | YAHOO.widget.Record} Which row to
get: by element reference, ID string, page row index, or Record.
@return {HTMLElement} Reference to TR element, or null. | [
"Returns",
"the",
"corresponding",
"TR",
"reference",
"for",
"a",
"given",
"DOM",
"element",
"ID",
"string",
"or",
"directly",
"page",
"row",
"index",
".",
"If",
"the",
"given",
"identifier",
"is",
"a",
"child",
"of",
"a",
"TR",
"element",
"then",
"DOM",
"tree",
"is",
"traversed",
"until",
"a",
"parent",
"TR",
"element",
"is",
"returned",
"otherwise",
"null",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L6678-L6705 |
|
42,514 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(cell) {
var elCell;
var el = Dom.get(cell);
// Validate HTML element
if(el && (el.ownerDocument == document)) {
// Validate TD element
if(el.nodeName.toLowerCase() != "td") {
// Traverse up the DOM to find the corresponding TR element
elCell = Dom.getAncestorByTagName(el, "td");
}
else {
elCell = el;
}
// Make sure the TD is in this TBODY
// Bug 2527707 and bug 2263558
if(elCell && ((elCell.parentNode.parentNode == this._elTbody) || (elCell.parentNode.parentNode === null))) {
// Now we can return the TD element
return elCell;
}
}
else if(cell) {
var oRecord, nColKeyIndex;
if(lang.isString(cell.columnKey) && lang.isString(cell.recordId)) {
oRecord = this.getRecord(cell.recordId);
var oColumn = this.getColumn(cell.columnKey);
if(oColumn) {
nColKeyIndex = oColumn.getKeyIndex();
}
}
if(cell.record && cell.column && cell.column.getKeyIndex) {
oRecord = cell.record;
nColKeyIndex = cell.column.getKeyIndex();
}
var elRow = this.getTrEl(oRecord);
if((nColKeyIndex !== null) && elRow && elRow.cells && elRow.cells.length > 0) {
return elRow.cells[nColKeyIndex] || null;
}
}
return null;
} | javascript | function(cell) {
var elCell;
var el = Dom.get(cell);
// Validate HTML element
if(el && (el.ownerDocument == document)) {
// Validate TD element
if(el.nodeName.toLowerCase() != "td") {
// Traverse up the DOM to find the corresponding TR element
elCell = Dom.getAncestorByTagName(el, "td");
}
else {
elCell = el;
}
// Make sure the TD is in this TBODY
// Bug 2527707 and bug 2263558
if(elCell && ((elCell.parentNode.parentNode == this._elTbody) || (elCell.parentNode.parentNode === null))) {
// Now we can return the TD element
return elCell;
}
}
else if(cell) {
var oRecord, nColKeyIndex;
if(lang.isString(cell.columnKey) && lang.isString(cell.recordId)) {
oRecord = this.getRecord(cell.recordId);
var oColumn = this.getColumn(cell.columnKey);
if(oColumn) {
nColKeyIndex = oColumn.getKeyIndex();
}
}
if(cell.record && cell.column && cell.column.getKeyIndex) {
oRecord = cell.record;
nColKeyIndex = cell.column.getKeyIndex();
}
var elRow = this.getTrEl(oRecord);
if((nColKeyIndex !== null) && elRow && elRow.cells && elRow.cells.length > 0) {
return elRow.cells[nColKeyIndex] || null;
}
}
return null;
} | [
"function",
"(",
"cell",
")",
"{",
"var",
"elCell",
";",
"var",
"el",
"=",
"Dom",
".",
"get",
"(",
"cell",
")",
";",
"// Validate HTML element",
"if",
"(",
"el",
"&&",
"(",
"el",
".",
"ownerDocument",
"==",
"document",
")",
")",
"{",
"// Validate TD element",
"if",
"(",
"el",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
"!=",
"\"td\"",
")",
"{",
"// Traverse up the DOM to find the corresponding TR element",
"elCell",
"=",
"Dom",
".",
"getAncestorByTagName",
"(",
"el",
",",
"\"td\"",
")",
";",
"}",
"else",
"{",
"elCell",
"=",
"el",
";",
"}",
"// Make sure the TD is in this TBODY",
"// Bug 2527707 and bug 2263558",
"if",
"(",
"elCell",
"&&",
"(",
"(",
"elCell",
".",
"parentNode",
".",
"parentNode",
"==",
"this",
".",
"_elTbody",
")",
"||",
"(",
"elCell",
".",
"parentNode",
".",
"parentNode",
"===",
"null",
")",
")",
")",
"{",
"// Now we can return the TD element",
"return",
"elCell",
";",
"}",
"}",
"else",
"if",
"(",
"cell",
")",
"{",
"var",
"oRecord",
",",
"nColKeyIndex",
";",
"if",
"(",
"lang",
".",
"isString",
"(",
"cell",
".",
"columnKey",
")",
"&&",
"lang",
".",
"isString",
"(",
"cell",
".",
"recordId",
")",
")",
"{",
"oRecord",
"=",
"this",
".",
"getRecord",
"(",
"cell",
".",
"recordId",
")",
";",
"var",
"oColumn",
"=",
"this",
".",
"getColumn",
"(",
"cell",
".",
"columnKey",
")",
";",
"if",
"(",
"oColumn",
")",
"{",
"nColKeyIndex",
"=",
"oColumn",
".",
"getKeyIndex",
"(",
")",
";",
"}",
"}",
"if",
"(",
"cell",
".",
"record",
"&&",
"cell",
".",
"column",
"&&",
"cell",
".",
"column",
".",
"getKeyIndex",
")",
"{",
"oRecord",
"=",
"cell",
".",
"record",
";",
"nColKeyIndex",
"=",
"cell",
".",
"column",
".",
"getKeyIndex",
"(",
")",
";",
"}",
"var",
"elRow",
"=",
"this",
".",
"getTrEl",
"(",
"oRecord",
")",
";",
"if",
"(",
"(",
"nColKeyIndex",
"!==",
"null",
")",
"&&",
"elRow",
"&&",
"elRow",
".",
"cells",
"&&",
"elRow",
".",
"cells",
".",
"length",
">",
"0",
")",
"{",
"return",
"elRow",
".",
"cells",
"[",
"nColKeyIndex",
"]",
"||",
"null",
";",
"}",
"}",
"return",
"null",
";",
"}"
]
| Returns DOM reference to a TD element.
@method getTdEl
@param cell {HTMLElement | String | Object} TD element or child of a TD element, or
object literal of syntax {record:oRecord, column:oColumn}.
@return {HTMLElement} Reference to TD element. | [
"Returns",
"DOM",
"reference",
"to",
"a",
"TD",
"element",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L6791-L6835 |
|
42,515 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(cell) {
var elCell = this.getTdEl(cell);
if(elCell) {
var nThisTdIndex = elCell.cellIndex;
var elRow = this.getTrEl(elCell);
if(nThisTdIndex < elRow.cells.length-1) {
return elRow.cells[nThisTdIndex+1];
}
else {
var elNextRow = this.getNextTrEl(elRow);
if(elNextRow) {
return elNextRow.cells[0];
}
}
}
return null;
} | javascript | function(cell) {
var elCell = this.getTdEl(cell);
if(elCell) {
var nThisTdIndex = elCell.cellIndex;
var elRow = this.getTrEl(elCell);
if(nThisTdIndex < elRow.cells.length-1) {
return elRow.cells[nThisTdIndex+1];
}
else {
var elNextRow = this.getNextTrEl(elRow);
if(elNextRow) {
return elNextRow.cells[0];
}
}
}
return null;
} | [
"function",
"(",
"cell",
")",
"{",
"var",
"elCell",
"=",
"this",
".",
"getTdEl",
"(",
"cell",
")",
";",
"if",
"(",
"elCell",
")",
"{",
"var",
"nThisTdIndex",
"=",
"elCell",
".",
"cellIndex",
";",
"var",
"elRow",
"=",
"this",
".",
"getTrEl",
"(",
"elCell",
")",
";",
"if",
"(",
"nThisTdIndex",
"<",
"elRow",
".",
"cells",
".",
"length",
"-",
"1",
")",
"{",
"return",
"elRow",
".",
"cells",
"[",
"nThisTdIndex",
"+",
"1",
"]",
";",
"}",
"else",
"{",
"var",
"elNextRow",
"=",
"this",
".",
"getNextTrEl",
"(",
"elRow",
")",
";",
"if",
"(",
"elNextRow",
")",
"{",
"return",
"elNextRow",
".",
"cells",
"[",
"0",
"]",
";",
"}",
"}",
"}",
"return",
"null",
";",
"}"
]
| Returns DOM reference to the next TD element from the given cell, or null.
@method getNextTdEl
@param cell {HTMLElement | String | Object} DOM element reference or string ID, or
object literal of syntax {record:oRecord, column:oColumn} from which to get next TD element.
@return {HTMLElement} Reference to next TD element, or null. | [
"Returns",
"DOM",
"reference",
"to",
"the",
"next",
"TD",
"element",
"from",
"the",
"given",
"cell",
"or",
"null",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L6876-L6892 |
|
42,516 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(theadCell) {
var elTh;
// Validate Column instance
if(theadCell instanceof YAHOO.widget.Column) {
var oColumn = theadCell;
elTh = oColumn.getThEl();
if(elTh) {
return elTh;
}
}
// Validate HTML element
else {
var el = Dom.get(theadCell);
if(el && (el.ownerDocument == document)) {
// Validate TH element
if(el.nodeName.toLowerCase() != "th") {
// Traverse up the DOM to find the corresponding TR element
elTh = Dom.getAncestorByTagName(el,"th");
}
else {
elTh = el;
}
return elTh;
}
}
return null;
} | javascript | function(theadCell) {
var elTh;
// Validate Column instance
if(theadCell instanceof YAHOO.widget.Column) {
var oColumn = theadCell;
elTh = oColumn.getThEl();
if(elTh) {
return elTh;
}
}
// Validate HTML element
else {
var el = Dom.get(theadCell);
if(el && (el.ownerDocument == document)) {
// Validate TH element
if(el.nodeName.toLowerCase() != "th") {
// Traverse up the DOM to find the corresponding TR element
elTh = Dom.getAncestorByTagName(el,"th");
}
else {
elTh = el;
}
return elTh;
}
}
return null;
} | [
"function",
"(",
"theadCell",
")",
"{",
"var",
"elTh",
";",
"// Validate Column instance",
"if",
"(",
"theadCell",
"instanceof",
"YAHOO",
".",
"widget",
".",
"Column",
")",
"{",
"var",
"oColumn",
"=",
"theadCell",
";",
"elTh",
"=",
"oColumn",
".",
"getThEl",
"(",
")",
";",
"if",
"(",
"elTh",
")",
"{",
"return",
"elTh",
";",
"}",
"}",
"// Validate HTML element",
"else",
"{",
"var",
"el",
"=",
"Dom",
".",
"get",
"(",
"theadCell",
")",
";",
"if",
"(",
"el",
"&&",
"(",
"el",
".",
"ownerDocument",
"==",
"document",
")",
")",
"{",
"// Validate TH element",
"if",
"(",
"el",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
"!=",
"\"th\"",
")",
"{",
"// Traverse up the DOM to find the corresponding TR element",
"elTh",
"=",
"Dom",
".",
"getAncestorByTagName",
"(",
"el",
",",
"\"th\"",
")",
";",
"}",
"else",
"{",
"elTh",
"=",
"el",
";",
"}",
"return",
"elTh",
";",
"}",
"}",
"return",
"null",
";",
"}"
]
| Returns DOM reference to a TH element.
@method getThEl
@param theadCell {YAHOO.widget.Column | HTMLElement | String} Column instance,
DOM element reference, or string ID.
@return {HTMLElement} Reference to TH element. | [
"Returns",
"DOM",
"reference",
"to",
"a",
"TH",
"element",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L6981-L7011 |
|
42,517 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(row) {
var nRecordIndex;
// By Record
if(row instanceof YAHOO.widget.Record) {
nRecordIndex = this._oRecordSet.getRecordIndex(row);
if(nRecordIndex === null) {
// Not a valid Record
return null;
}
}
// Calculate page row index from Record index
else if(lang.isNumber(row)) {
nRecordIndex = row;
}
if(lang.isNumber(nRecordIndex)) {
// Validate the number
if((nRecordIndex > -1) && (nRecordIndex < this._oRecordSet.getLength())) {
// DataTable is paginated
var oPaginator = this.get('paginator');
if(oPaginator) {
// Check the record index is within the indices of the
// current page
var rng = oPaginator.getPageRecords();
if (rng && nRecordIndex >= rng[0] && nRecordIndex <= rng[1]) {
// This Record is on current page
return nRecordIndex - rng[0];
}
// This Record is not on current page
else {
return null;
}
}
// Not paginated, just return the Record index
else {
return nRecordIndex;
}
}
// RecordSet index is out of range
else {
return null;
}
}
// By element reference or ID string
else {
// Validate TR element
var elRow = this.getTrEl(row);
if(elRow && (elRow.ownerDocument == document) &&
(elRow.parentNode == this._elTbody)) {
return elRow.sectionRowIndex;
}
}
return null;
} | javascript | function(row) {
var nRecordIndex;
// By Record
if(row instanceof YAHOO.widget.Record) {
nRecordIndex = this._oRecordSet.getRecordIndex(row);
if(nRecordIndex === null) {
// Not a valid Record
return null;
}
}
// Calculate page row index from Record index
else if(lang.isNumber(row)) {
nRecordIndex = row;
}
if(lang.isNumber(nRecordIndex)) {
// Validate the number
if((nRecordIndex > -1) && (nRecordIndex < this._oRecordSet.getLength())) {
// DataTable is paginated
var oPaginator = this.get('paginator');
if(oPaginator) {
// Check the record index is within the indices of the
// current page
var rng = oPaginator.getPageRecords();
if (rng && nRecordIndex >= rng[0] && nRecordIndex <= rng[1]) {
// This Record is on current page
return nRecordIndex - rng[0];
}
// This Record is not on current page
else {
return null;
}
}
// Not paginated, just return the Record index
else {
return nRecordIndex;
}
}
// RecordSet index is out of range
else {
return null;
}
}
// By element reference or ID string
else {
// Validate TR element
var elRow = this.getTrEl(row);
if(elRow && (elRow.ownerDocument == document) &&
(elRow.parentNode == this._elTbody)) {
return elRow.sectionRowIndex;
}
}
return null;
} | [
"function",
"(",
"row",
")",
"{",
"var",
"nRecordIndex",
";",
"// By Record",
"if",
"(",
"row",
"instanceof",
"YAHOO",
".",
"widget",
".",
"Record",
")",
"{",
"nRecordIndex",
"=",
"this",
".",
"_oRecordSet",
".",
"getRecordIndex",
"(",
"row",
")",
";",
"if",
"(",
"nRecordIndex",
"===",
"null",
")",
"{",
"// Not a valid Record",
"return",
"null",
";",
"}",
"}",
"// Calculate page row index from Record index",
"else",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"row",
")",
")",
"{",
"nRecordIndex",
"=",
"row",
";",
"}",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"nRecordIndex",
")",
")",
"{",
"// Validate the number",
"if",
"(",
"(",
"nRecordIndex",
">",
"-",
"1",
")",
"&&",
"(",
"nRecordIndex",
"<",
"this",
".",
"_oRecordSet",
".",
"getLength",
"(",
")",
")",
")",
"{",
"// DataTable is paginated",
"var",
"oPaginator",
"=",
"this",
".",
"get",
"(",
"'paginator'",
")",
";",
"if",
"(",
"oPaginator",
")",
"{",
"// Check the record index is within the indices of the",
"// current page",
"var",
"rng",
"=",
"oPaginator",
".",
"getPageRecords",
"(",
")",
";",
"if",
"(",
"rng",
"&&",
"nRecordIndex",
">=",
"rng",
"[",
"0",
"]",
"&&",
"nRecordIndex",
"<=",
"rng",
"[",
"1",
"]",
")",
"{",
"// This Record is on current page",
"return",
"nRecordIndex",
"-",
"rng",
"[",
"0",
"]",
";",
"}",
"// This Record is not on current page",
"else",
"{",
"return",
"null",
";",
"}",
"}",
"// Not paginated, just return the Record index",
"else",
"{",
"return",
"nRecordIndex",
";",
"}",
"}",
"// RecordSet index is out of range",
"else",
"{",
"return",
"null",
";",
"}",
"}",
"// By element reference or ID string",
"else",
"{",
"// Validate TR element",
"var",
"elRow",
"=",
"this",
".",
"getTrEl",
"(",
"row",
")",
";",
"if",
"(",
"elRow",
"&&",
"(",
"elRow",
".",
"ownerDocument",
"==",
"document",
")",
"&&",
"(",
"elRow",
".",
"parentNode",
"==",
"this",
".",
"_elTbody",
")",
")",
"{",
"return",
"elRow",
".",
"sectionRowIndex",
";",
"}",
"}",
"return",
"null",
";",
"}"
]
| Returns the page row index of given row. Returns null if the row is not on the
current DataTable page.
@method getTrIndex
@param row {HTMLElement | String | YAHOO.widget.Record | Number} DOM or ID
string reference to an element within the DataTable page, a Record instance,
or a Record's RecordSet index.
@return {Number} Page row index, or null if row does not exist or is not on current page. | [
"Returns",
"the",
"page",
"row",
"index",
"of",
"given",
"row",
".",
"Returns",
"null",
"if",
"the",
"row",
"is",
"not",
"on",
"the",
"current",
"DataTable",
"page",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L7023-L7077 |
|
42,518 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
// Reset init flag
this._bInit = true;
// Clear the RecordSet
this._oRecordSet.reset();
// Clear the Paginator's totalRecords if paginating
var pag = this.get('paginator');
if (pag) {
pag.set('totalRecords',0);
}
// Clear selections
this._unselectAllTrEls();
this._unselectAllTdEls();
this._aSelections = null;
this._oAnchorRecord = null;
this._oAnchorCell = null;
// Clear sort
this.set("sortedBy", null);
} | javascript | function() {
// Reset init flag
this._bInit = true;
// Clear the RecordSet
this._oRecordSet.reset();
// Clear the Paginator's totalRecords if paginating
var pag = this.get('paginator');
if (pag) {
pag.set('totalRecords',0);
}
// Clear selections
this._unselectAllTrEls();
this._unselectAllTdEls();
this._aSelections = null;
this._oAnchorRecord = null;
this._oAnchorCell = null;
// Clear sort
this.set("sortedBy", null);
} | [
"function",
"(",
")",
"{",
"// Reset init flag",
"this",
".",
"_bInit",
"=",
"true",
";",
"// Clear the RecordSet",
"this",
".",
"_oRecordSet",
".",
"reset",
"(",
")",
";",
"// Clear the Paginator's totalRecords if paginating",
"var",
"pag",
"=",
"this",
".",
"get",
"(",
"'paginator'",
")",
";",
"if",
"(",
"pag",
")",
"{",
"pag",
".",
"set",
"(",
"'totalRecords'",
",",
"0",
")",
";",
"}",
"// Clear selections",
"this",
".",
"_unselectAllTrEls",
"(",
")",
";",
"this",
".",
"_unselectAllTdEls",
"(",
")",
";",
"this",
".",
"_aSelections",
"=",
"null",
";",
"this",
".",
"_oAnchorRecord",
"=",
"null",
";",
"this",
".",
"_oAnchorCell",
"=",
"null",
";",
"// Clear sort",
"this",
".",
"set",
"(",
"\"sortedBy\"",
",",
"null",
")",
";",
"}"
]
| TABLE FUNCTIONS
Resets a RecordSet with the given data and populates the page view
with the new data. Any previous data, and selection and sort states are
cleared. New data should be added as a separate step.
@method initializeTable | [
"TABLE",
"FUNCTIONS",
"Resets",
"a",
"RecordSet",
"with",
"the",
"given",
"data",
"and",
"populates",
"the",
"page",
"view",
"with",
"the",
"new",
"data",
".",
"Any",
"previous",
"data",
"and",
"selection",
"and",
"sort",
"states",
"are",
"cleared",
".",
"New",
"data",
"should",
"be",
"added",
"as",
"a",
"separate",
"step",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L7133-L7155 |
|
42,519 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var elTable = this._elTable;
var elMask = this._elMask;
elMask.style.width = elTable.offsetWidth + "px";
elMask.style.height = elTable.offsetHeight + "px";
elMask.style.display = "";
this.fireEvent("disableEvent");
} | javascript | function() {
var elTable = this._elTable;
var elMask = this._elMask;
elMask.style.width = elTable.offsetWidth + "px";
elMask.style.height = elTable.offsetHeight + "px";
elMask.style.display = "";
this.fireEvent("disableEvent");
} | [
"function",
"(",
")",
"{",
"var",
"elTable",
"=",
"this",
".",
"_elTable",
";",
"var",
"elMask",
"=",
"this",
".",
"_elMask",
";",
"elMask",
".",
"style",
".",
"width",
"=",
"elTable",
".",
"offsetWidth",
"+",
"\"px\"",
";",
"elMask",
".",
"style",
".",
"height",
"=",
"elTable",
".",
"offsetHeight",
"+",
"\"px\"",
";",
"elMask",
".",
"style",
".",
"display",
"=",
"\"\"",
";",
"this",
".",
"fireEvent",
"(",
"\"disableEvent\"",
")",
";",
"}"
]
| Disables DataTable UI.
@method disable | [
"Disables",
"DataTable",
"UI",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L7299-L7306 |
|
42,520 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(row) {
var nTrIndex;
if(!lang.isNumber(row)) {
// By Record
if(row instanceof YAHOO.widget.Record) {
return this._oRecordSet.getRecordIndex(row);
}
// By element reference
else {
// Find the TR element
var el = this.getTrEl(row);
if(el) {
nTrIndex = el.sectionRowIndex;
}
}
}
// By page row index
else {
nTrIndex = row;
}
if(lang.isNumber(nTrIndex)) {
var oPaginator = this.get("paginator");
if(oPaginator) {
return oPaginator.get('recordOffset') + nTrIndex;
}
else {
return nTrIndex;
}
}
return null;
} | javascript | function(row) {
var nTrIndex;
if(!lang.isNumber(row)) {
// By Record
if(row instanceof YAHOO.widget.Record) {
return this._oRecordSet.getRecordIndex(row);
}
// By element reference
else {
// Find the TR element
var el = this.getTrEl(row);
if(el) {
nTrIndex = el.sectionRowIndex;
}
}
}
// By page row index
else {
nTrIndex = row;
}
if(lang.isNumber(nTrIndex)) {
var oPaginator = this.get("paginator");
if(oPaginator) {
return oPaginator.get('recordOffset') + nTrIndex;
}
else {
return nTrIndex;
}
}
return null;
} | [
"function",
"(",
"row",
")",
"{",
"var",
"nTrIndex",
";",
"if",
"(",
"!",
"lang",
".",
"isNumber",
"(",
"row",
")",
")",
"{",
"// By Record",
"if",
"(",
"row",
"instanceof",
"YAHOO",
".",
"widget",
".",
"Record",
")",
"{",
"return",
"this",
".",
"_oRecordSet",
".",
"getRecordIndex",
"(",
"row",
")",
";",
"}",
"// By element reference",
"else",
"{",
"// Find the TR element",
"var",
"el",
"=",
"this",
".",
"getTrEl",
"(",
"row",
")",
";",
"if",
"(",
"el",
")",
"{",
"nTrIndex",
"=",
"el",
".",
"sectionRowIndex",
";",
"}",
"}",
"}",
"// By page row index",
"else",
"{",
"nTrIndex",
"=",
"row",
";",
"}",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"nTrIndex",
")",
")",
"{",
"var",
"oPaginator",
"=",
"this",
".",
"get",
"(",
"\"paginator\"",
")",
";",
"if",
"(",
"oPaginator",
")",
"{",
"return",
"oPaginator",
".",
"get",
"(",
"'recordOffset'",
")",
"+",
"nTrIndex",
";",
"}",
"else",
"{",
"return",
"nTrIndex",
";",
"}",
"}",
"return",
"null",
";",
"}"
]
| RECORDSET FUNCTIONS
Returns Record index for given TR element or page row index.
@method getRecordIndex
@param row {YAHOO.widget.Record | HTMLElement | Number} Record instance, TR
element reference or page row index.
@return {Number} Record's RecordSet index, or null. | [
"RECORDSET",
"FUNCTIONS",
"Returns",
"Record",
"index",
"for",
"given",
"TR",
"element",
"or",
"page",
"row",
"index",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L7536-L7569 |
|
42,521 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(row) {
var oRecord = this._oRecordSet.getRecord(row);
if(!oRecord) {
// Validate TR element
var elRow = this.getTrEl(row);
if(elRow) {
oRecord = this._oRecordSet.getRecord(elRow.id);
}
}
if(oRecord instanceof YAHOO.widget.Record) {
return this._oRecordSet.getRecord(oRecord);
}
else {
return null;
}
} | javascript | function(row) {
var oRecord = this._oRecordSet.getRecord(row);
if(!oRecord) {
// Validate TR element
var elRow = this.getTrEl(row);
if(elRow) {
oRecord = this._oRecordSet.getRecord(elRow.id);
}
}
if(oRecord instanceof YAHOO.widget.Record) {
return this._oRecordSet.getRecord(oRecord);
}
else {
return null;
}
} | [
"function",
"(",
"row",
")",
"{",
"var",
"oRecord",
"=",
"this",
".",
"_oRecordSet",
".",
"getRecord",
"(",
"row",
")",
";",
"if",
"(",
"!",
"oRecord",
")",
"{",
"// Validate TR element",
"var",
"elRow",
"=",
"this",
".",
"getTrEl",
"(",
"row",
")",
";",
"if",
"(",
"elRow",
")",
"{",
"oRecord",
"=",
"this",
".",
"_oRecordSet",
".",
"getRecord",
"(",
"elRow",
".",
"id",
")",
";",
"}",
"}",
"if",
"(",
"oRecord",
"instanceof",
"YAHOO",
".",
"widget",
".",
"Record",
")",
"{",
"return",
"this",
".",
"_oRecordSet",
".",
"getRecord",
"(",
"oRecord",
")",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}"
]
| For the given identifier, returns the associated Record instance.
@method getRecord
@param row {HTMLElement | Number | String} DOM reference to a TR element (or
child of a TR element), RecordSet position index, or Record ID.
@return {YAHOO.widget.Record} Record instance. | [
"For",
"the",
"given",
"identifier",
"returns",
"the",
"associated",
"Record",
"instance",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L7579-L7596 |
|
42,522 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oColumn, oSortedBy) {
// Backward compatibility
if(oColumn.sortOptions && oColumn.sortOptions.defaultOrder) {
if(oColumn.sortOptions.defaultOrder == "asc") {
oColumn.sortOptions.defaultDir = DT.CLASS_ASC;
}
else if (oColumn.sortOptions.defaultOrder == "desc") {
oColumn.sortOptions.defaultDir = DT.CLASS_DESC;
}
}
// What is the Column's default sort direction?
var sortDir = (oColumn.sortOptions && oColumn.sortOptions.defaultDir) ? oColumn.sortOptions.defaultDir : DT.CLASS_ASC;
// Is the Column currently sorted?
var bSorted = false;
oSortedBy = oSortedBy || this.get("sortedBy");
if(oSortedBy && (oSortedBy.key === oColumn.key)) {
bSorted = true;
if(oSortedBy.dir) {
sortDir = (oSortedBy.dir === DT.CLASS_ASC) ? DT.CLASS_DESC : DT.CLASS_ASC;
}
else {
sortDir = (sortDir === DT.CLASS_ASC) ? DT.CLASS_DESC : DT.CLASS_ASC;
}
}
return sortDir;
} | javascript | function(oColumn, oSortedBy) {
// Backward compatibility
if(oColumn.sortOptions && oColumn.sortOptions.defaultOrder) {
if(oColumn.sortOptions.defaultOrder == "asc") {
oColumn.sortOptions.defaultDir = DT.CLASS_ASC;
}
else if (oColumn.sortOptions.defaultOrder == "desc") {
oColumn.sortOptions.defaultDir = DT.CLASS_DESC;
}
}
// What is the Column's default sort direction?
var sortDir = (oColumn.sortOptions && oColumn.sortOptions.defaultDir) ? oColumn.sortOptions.defaultDir : DT.CLASS_ASC;
// Is the Column currently sorted?
var bSorted = false;
oSortedBy = oSortedBy || this.get("sortedBy");
if(oSortedBy && (oSortedBy.key === oColumn.key)) {
bSorted = true;
if(oSortedBy.dir) {
sortDir = (oSortedBy.dir === DT.CLASS_ASC) ? DT.CLASS_DESC : DT.CLASS_ASC;
}
else {
sortDir = (sortDir === DT.CLASS_ASC) ? DT.CLASS_DESC : DT.CLASS_ASC;
}
}
return sortDir;
} | [
"function",
"(",
"oColumn",
",",
"oSortedBy",
")",
"{",
"// Backward compatibility",
"if",
"(",
"oColumn",
".",
"sortOptions",
"&&",
"oColumn",
".",
"sortOptions",
".",
"defaultOrder",
")",
"{",
"if",
"(",
"oColumn",
".",
"sortOptions",
".",
"defaultOrder",
"==",
"\"asc\"",
")",
"{",
"oColumn",
".",
"sortOptions",
".",
"defaultDir",
"=",
"DT",
".",
"CLASS_ASC",
";",
"}",
"else",
"if",
"(",
"oColumn",
".",
"sortOptions",
".",
"defaultOrder",
"==",
"\"desc\"",
")",
"{",
"oColumn",
".",
"sortOptions",
".",
"defaultDir",
"=",
"DT",
".",
"CLASS_DESC",
";",
"}",
"}",
"// What is the Column's default sort direction?",
"var",
"sortDir",
"=",
"(",
"oColumn",
".",
"sortOptions",
"&&",
"oColumn",
".",
"sortOptions",
".",
"defaultDir",
")",
"?",
"oColumn",
".",
"sortOptions",
".",
"defaultDir",
":",
"DT",
".",
"CLASS_ASC",
";",
"// Is the Column currently sorted?",
"var",
"bSorted",
"=",
"false",
";",
"oSortedBy",
"=",
"oSortedBy",
"||",
"this",
".",
"get",
"(",
"\"sortedBy\"",
")",
";",
"if",
"(",
"oSortedBy",
"&&",
"(",
"oSortedBy",
".",
"key",
"===",
"oColumn",
".",
"key",
")",
")",
"{",
"bSorted",
"=",
"true",
";",
"if",
"(",
"oSortedBy",
".",
"dir",
")",
"{",
"sortDir",
"=",
"(",
"oSortedBy",
".",
"dir",
"===",
"DT",
".",
"CLASS_ASC",
")",
"?",
"DT",
".",
"CLASS_DESC",
":",
"DT",
".",
"CLASS_ASC",
";",
"}",
"else",
"{",
"sortDir",
"=",
"(",
"sortDir",
"===",
"DT",
".",
"CLASS_ASC",
")",
"?",
"DT",
".",
"CLASS_DESC",
":",
"DT",
".",
"CLASS_ASC",
";",
"}",
"}",
"return",
"sortDir",
";",
"}"
]
| For the given Column instance, returns next direction to sort.
@method getColumnSortDir
@param oColumn {YAHOO.widget.Column} Column instance.
@param oSortedBy {Object} (optional) Specify the state, or use current state.
@return {String} YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTableCLASS_DESC. | [
"For",
"the",
"given",
"Column",
"instance",
"returns",
"next",
"direction",
"to",
"sort",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L7702-L7729 |
|
42,523 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oColumn) {
if(oColumn.getKeyIndex() !== null) {
this._elColgroup.childNodes[oColumn.getKeyIndex()].style.width = '';
}
} | javascript | function(oColumn) {
if(oColumn.getKeyIndex() !== null) {
this._elColgroup.childNodes[oColumn.getKeyIndex()].style.width = '';
}
} | [
"function",
"(",
"oColumn",
")",
"{",
"if",
"(",
"oColumn",
".",
"getKeyIndex",
"(",
")",
"!==",
"null",
")",
"{",
"this",
".",
"_elColgroup",
".",
"childNodes",
"[",
"oColumn",
".",
"getKeyIndex",
"(",
")",
"]",
".",
"style",
".",
"width",
"=",
"''",
";",
"}",
"}"
]
| Clears minWidth.
@method _clearMinWidth
@param oColumn {YAHOO.widget.Column} Which Column.
@private | [
"Clears",
"minWidth",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L8138-L8142 |
|
42,524 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oColumn) {
var selectedColumns = [];
var aKeys = this._oColumnSet.keys;
for(var i=0,len=aKeys.length; i<len; i++) {
if(aKeys[i].selected) {
selectedColumns[selectedColumns.length] = aKeys[i];
}
}
return selectedColumns;
} | javascript | function(oColumn) {
var selectedColumns = [];
var aKeys = this._oColumnSet.keys;
for(var i=0,len=aKeys.length; i<len; i++) {
if(aKeys[i].selected) {
selectedColumns[selectedColumns.length] = aKeys[i];
}
}
return selectedColumns;
} | [
"function",
"(",
"oColumn",
")",
"{",
"var",
"selectedColumns",
"=",
"[",
"]",
";",
"var",
"aKeys",
"=",
"this",
".",
"_oColumnSet",
".",
"keys",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"aKeys",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"if",
"(",
"aKeys",
"[",
"i",
"]",
".",
"selected",
")",
"{",
"selectedColumns",
"[",
"selectedColumns",
".",
"length",
"]",
"=",
"aKeys",
"[",
"i",
"]",
";",
"}",
"}",
"return",
"selectedColumns",
";",
"}"
]
| Returns an array selected Column instances.
@method getSelectedColumns
@return {YAHOO.widget.Column[]} Array of Column instances. | [
"Returns",
"an",
"array",
"selected",
"Column",
"instances",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L8684-L8693 |
|
42,525 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oData, index) {
if(lang.isNumber(index) && (index < 0 || index > this._oRecordSet.getLength())) {
return;
}
if(oData && lang.isObject(oData)) {
var oRecord = this._oRecordSet.addRecord(oData, index);
if(oRecord) {
var recIndex;
var oPaginator = this.get('paginator');
// Paginated
if (oPaginator) {
// Update the paginator's totalRecords
var totalRecords = oPaginator.get('totalRecords');
if (totalRecords !== widget.Paginator.VALUE_UNLIMITED) {
oPaginator.set('totalRecords',totalRecords + 1);
}
recIndex = this.getRecordIndex(oRecord);
var endRecIndex = (oPaginator.getPageRecords())[1];
// New record affects the view
if (recIndex <= endRecIndex) {
// Defer UI updates to the render method
this.render();
}
this.fireEvent("rowAddEvent", {record:oRecord});
return;
}
// Not paginated
else {
recIndex = this.getTrIndex(oRecord);
if(lang.isNumber(recIndex)) {
// Add the TR element
this._oChainRender.add({
method: function(oArg) {
if((this instanceof DT) && this._sId) {
var oRecord = oArg.record;
var recIndex = oArg.recIndex;
var elNewTr = this._addTrEl(oRecord);
if(elNewTr) {
var elNext = (this._elTbody.rows[recIndex]) ? this._elTbody.rows[recIndex] : null;
this._elTbody.insertBefore(elNewTr, elNext);
// Set FIRST/LAST
if(recIndex === 0) {
this._setFirstRow();
}
if(elNext === null) {
this._setLastRow();
}
// Set EVEN/ODD
this._setRowStripes();
this.hideTableMessage();
this.fireEvent("rowAddEvent", {record:oRecord});
}
}
},
argument: {record: oRecord, recIndex: recIndex},
scope: this,
timeout: (this.get("renderLoopSize") > 0) ? 0 : -1
});
this._runRenderChain();
return;
}
}
}
}
} | javascript | function(oData, index) {
if(lang.isNumber(index) && (index < 0 || index > this._oRecordSet.getLength())) {
return;
}
if(oData && lang.isObject(oData)) {
var oRecord = this._oRecordSet.addRecord(oData, index);
if(oRecord) {
var recIndex;
var oPaginator = this.get('paginator');
// Paginated
if (oPaginator) {
// Update the paginator's totalRecords
var totalRecords = oPaginator.get('totalRecords');
if (totalRecords !== widget.Paginator.VALUE_UNLIMITED) {
oPaginator.set('totalRecords',totalRecords + 1);
}
recIndex = this.getRecordIndex(oRecord);
var endRecIndex = (oPaginator.getPageRecords())[1];
// New record affects the view
if (recIndex <= endRecIndex) {
// Defer UI updates to the render method
this.render();
}
this.fireEvent("rowAddEvent", {record:oRecord});
return;
}
// Not paginated
else {
recIndex = this.getTrIndex(oRecord);
if(lang.isNumber(recIndex)) {
// Add the TR element
this._oChainRender.add({
method: function(oArg) {
if((this instanceof DT) && this._sId) {
var oRecord = oArg.record;
var recIndex = oArg.recIndex;
var elNewTr = this._addTrEl(oRecord);
if(elNewTr) {
var elNext = (this._elTbody.rows[recIndex]) ? this._elTbody.rows[recIndex] : null;
this._elTbody.insertBefore(elNewTr, elNext);
// Set FIRST/LAST
if(recIndex === 0) {
this._setFirstRow();
}
if(elNext === null) {
this._setLastRow();
}
// Set EVEN/ODD
this._setRowStripes();
this.hideTableMessage();
this.fireEvent("rowAddEvent", {record:oRecord});
}
}
},
argument: {record: oRecord, recIndex: recIndex},
scope: this,
timeout: (this.get("renderLoopSize") > 0) ? 0 : -1
});
this._runRenderChain();
return;
}
}
}
}
} | [
"function",
"(",
"oData",
",",
"index",
")",
"{",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"index",
")",
"&&",
"(",
"index",
"<",
"0",
"||",
"index",
">",
"this",
".",
"_oRecordSet",
".",
"getLength",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"oData",
"&&",
"lang",
".",
"isObject",
"(",
"oData",
")",
")",
"{",
"var",
"oRecord",
"=",
"this",
".",
"_oRecordSet",
".",
"addRecord",
"(",
"oData",
",",
"index",
")",
";",
"if",
"(",
"oRecord",
")",
"{",
"var",
"recIndex",
";",
"var",
"oPaginator",
"=",
"this",
".",
"get",
"(",
"'paginator'",
")",
";",
"// Paginated",
"if",
"(",
"oPaginator",
")",
"{",
"// Update the paginator's totalRecords",
"var",
"totalRecords",
"=",
"oPaginator",
".",
"get",
"(",
"'totalRecords'",
")",
";",
"if",
"(",
"totalRecords",
"!==",
"widget",
".",
"Paginator",
".",
"VALUE_UNLIMITED",
")",
"{",
"oPaginator",
".",
"set",
"(",
"'totalRecords'",
",",
"totalRecords",
"+",
"1",
")",
";",
"}",
"recIndex",
"=",
"this",
".",
"getRecordIndex",
"(",
"oRecord",
")",
";",
"var",
"endRecIndex",
"=",
"(",
"oPaginator",
".",
"getPageRecords",
"(",
")",
")",
"[",
"1",
"]",
";",
"// New record affects the view",
"if",
"(",
"recIndex",
"<=",
"endRecIndex",
")",
"{",
"// Defer UI updates to the render method",
"this",
".",
"render",
"(",
")",
";",
"}",
"this",
".",
"fireEvent",
"(",
"\"rowAddEvent\"",
",",
"{",
"record",
":",
"oRecord",
"}",
")",
";",
"return",
";",
"}",
"// Not paginated",
"else",
"{",
"recIndex",
"=",
"this",
".",
"getTrIndex",
"(",
"oRecord",
")",
";",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"recIndex",
")",
")",
"{",
"// Add the TR element",
"this",
".",
"_oChainRender",
".",
"add",
"(",
"{",
"method",
":",
"function",
"(",
"oArg",
")",
"{",
"if",
"(",
"(",
"this",
"instanceof",
"DT",
")",
"&&",
"this",
".",
"_sId",
")",
"{",
"var",
"oRecord",
"=",
"oArg",
".",
"record",
";",
"var",
"recIndex",
"=",
"oArg",
".",
"recIndex",
";",
"var",
"elNewTr",
"=",
"this",
".",
"_addTrEl",
"(",
"oRecord",
")",
";",
"if",
"(",
"elNewTr",
")",
"{",
"var",
"elNext",
"=",
"(",
"this",
".",
"_elTbody",
".",
"rows",
"[",
"recIndex",
"]",
")",
"?",
"this",
".",
"_elTbody",
".",
"rows",
"[",
"recIndex",
"]",
":",
"null",
";",
"this",
".",
"_elTbody",
".",
"insertBefore",
"(",
"elNewTr",
",",
"elNext",
")",
";",
"// Set FIRST/LAST",
"if",
"(",
"recIndex",
"===",
"0",
")",
"{",
"this",
".",
"_setFirstRow",
"(",
")",
";",
"}",
"if",
"(",
"elNext",
"===",
"null",
")",
"{",
"this",
".",
"_setLastRow",
"(",
")",
";",
"}",
"// Set EVEN/ODD",
"this",
".",
"_setRowStripes",
"(",
")",
";",
"this",
".",
"hideTableMessage",
"(",
")",
";",
"this",
".",
"fireEvent",
"(",
"\"rowAddEvent\"",
",",
"{",
"record",
":",
"oRecord",
"}",
")",
";",
"}",
"}",
"}",
",",
"argument",
":",
"{",
"record",
":",
"oRecord",
",",
"recIndex",
":",
"recIndex",
"}",
",",
"scope",
":",
"this",
",",
"timeout",
":",
"(",
"this",
".",
"get",
"(",
"\"renderLoopSize\"",
")",
">",
"0",
")",
"?",
"0",
":",
"-",
"1",
"}",
")",
";",
"this",
".",
"_runRenderChain",
"(",
")",
";",
"return",
";",
"}",
"}",
"}",
"}",
"}"
]
| ROW FUNCTIONS
Adds one new Record of data into the RecordSet at the index if given,
otherwise at the end. If the new Record is in page view, the
corresponding DOM elements are also updated.
@method addRow
@param oData {Object} Object literal of data for the row.
@param index {Number} (optional) RecordSet position index at which to add data. | [
"ROW",
"FUNCTIONS",
"Adds",
"one",
"new",
"Record",
"of",
"data",
"into",
"the",
"RecordSet",
"at",
"the",
"index",
"if",
"given",
"otherwise",
"at",
"the",
"end",
".",
"If",
"the",
"new",
"Record",
"is",
"in",
"page",
"view",
"the",
"corresponding",
"DOM",
"elements",
"are",
"also",
"updated",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L8833-L8905 |
|
42,526 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function (e) {
if (e.prevValue === e.newValue) { return; }
var newPag = e.newValue,
oldPag = e.prevValue,
containers = this._defaultPaginatorContainers();
if (oldPag) {
if (oldPag.getContainerNodes()[0] == containers[0]) {
oldPag.set('containers',[]);
}
oldPag.destroy();
// Convenience: share the default containers if possible.
// Otherwise, remove the default containers from the DOM.
if (containers[0]) {
if (newPag && !newPag.getContainerNodes().length) {
newPag.set('containers',containers);
} else {
// No new Paginator to use existing containers, OR new
// Paginator has configured containers.
for (var i = containers.length - 1; i >= 0; --i) {
if (containers[i]) {
containers[i].parentNode.removeChild(containers[i]);
}
}
}
}
}
if (!this._bInit) {
this.render();
}
if (newPag) {
this.renderPaginator();
}
} | javascript | function (e) {
if (e.prevValue === e.newValue) { return; }
var newPag = e.newValue,
oldPag = e.prevValue,
containers = this._defaultPaginatorContainers();
if (oldPag) {
if (oldPag.getContainerNodes()[0] == containers[0]) {
oldPag.set('containers',[]);
}
oldPag.destroy();
// Convenience: share the default containers if possible.
// Otherwise, remove the default containers from the DOM.
if (containers[0]) {
if (newPag && !newPag.getContainerNodes().length) {
newPag.set('containers',containers);
} else {
// No new Paginator to use existing containers, OR new
// Paginator has configured containers.
for (var i = containers.length - 1; i >= 0; --i) {
if (containers[i]) {
containers[i].parentNode.removeChild(containers[i]);
}
}
}
}
}
if (!this._bInit) {
this.render();
}
if (newPag) {
this.renderPaginator();
}
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"e",
".",
"prevValue",
"===",
"e",
".",
"newValue",
")",
"{",
"return",
";",
"}",
"var",
"newPag",
"=",
"e",
".",
"newValue",
",",
"oldPag",
"=",
"e",
".",
"prevValue",
",",
"containers",
"=",
"this",
".",
"_defaultPaginatorContainers",
"(",
")",
";",
"if",
"(",
"oldPag",
")",
"{",
"if",
"(",
"oldPag",
".",
"getContainerNodes",
"(",
")",
"[",
"0",
"]",
"==",
"containers",
"[",
"0",
"]",
")",
"{",
"oldPag",
".",
"set",
"(",
"'containers'",
",",
"[",
"]",
")",
";",
"}",
"oldPag",
".",
"destroy",
"(",
")",
";",
"// Convenience: share the default containers if possible.",
"// Otherwise, remove the default containers from the DOM.",
"if",
"(",
"containers",
"[",
"0",
"]",
")",
"{",
"if",
"(",
"newPag",
"&&",
"!",
"newPag",
".",
"getContainerNodes",
"(",
")",
".",
"length",
")",
"{",
"newPag",
".",
"set",
"(",
"'containers'",
",",
"containers",
")",
";",
"}",
"else",
"{",
"// No new Paginator to use existing containers, OR new",
"// Paginator has configured containers.",
"for",
"(",
"var",
"i",
"=",
"containers",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"--",
"i",
")",
"{",
"if",
"(",
"containers",
"[",
"i",
"]",
")",
"{",
"containers",
"[",
"i",
"]",
".",
"parentNode",
".",
"removeChild",
"(",
"containers",
"[",
"i",
"]",
")",
";",
"}",
"}",
"}",
"}",
"}",
"if",
"(",
"!",
"this",
".",
"_bInit",
")",
"{",
"this",
".",
"render",
"(",
")",
";",
"}",
"if",
"(",
"newPag",
")",
"{",
"this",
".",
"renderPaginator",
"(",
")",
";",
"}",
"}"
]
| Update the UI infrastructure in response to a "paginator" attribute change.
@method _handlePaginatorChange
@param e {Object} Change event object containing keys 'type','newValue',
and 'prevValue'
@private | [
"Update",
"the",
"UI",
"infrastructure",
"in",
"response",
"to",
"a",
"paginator",
"attribute",
"change",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L9631-L9670 |
|
42,527 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function (create) {
var above_id = this._sId + '-paginator0',
below_id = this._sId + '-paginator1',
above = Dom.get(above_id),
below = Dom.get(below_id);
if (create && (!above || !below)) {
// One above and one below the table
if (!above) {
above = document.createElement('div');
above.id = above_id;
Dom.addClass(above, DT.CLASS_PAGINATOR);
this._elContainer.insertBefore(above,this._elContainer.firstChild);
}
if (!below) {
below = document.createElement('div');
below.id = below_id;
Dom.addClass(below, DT.CLASS_PAGINATOR);
this._elContainer.appendChild(below);
}
}
return [above,below];
} | javascript | function (create) {
var above_id = this._sId + '-paginator0',
below_id = this._sId + '-paginator1',
above = Dom.get(above_id),
below = Dom.get(below_id);
if (create && (!above || !below)) {
// One above and one below the table
if (!above) {
above = document.createElement('div');
above.id = above_id;
Dom.addClass(above, DT.CLASS_PAGINATOR);
this._elContainer.insertBefore(above,this._elContainer.firstChild);
}
if (!below) {
below = document.createElement('div');
below.id = below_id;
Dom.addClass(below, DT.CLASS_PAGINATOR);
this._elContainer.appendChild(below);
}
}
return [above,below];
} | [
"function",
"(",
"create",
")",
"{",
"var",
"above_id",
"=",
"this",
".",
"_sId",
"+",
"'-paginator0'",
",",
"below_id",
"=",
"this",
".",
"_sId",
"+",
"'-paginator1'",
",",
"above",
"=",
"Dom",
".",
"get",
"(",
"above_id",
")",
",",
"below",
"=",
"Dom",
".",
"get",
"(",
"below_id",
")",
";",
"if",
"(",
"create",
"&&",
"(",
"!",
"above",
"||",
"!",
"below",
")",
")",
"{",
"// One above and one below the table",
"if",
"(",
"!",
"above",
")",
"{",
"above",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"above",
".",
"id",
"=",
"above_id",
";",
"Dom",
".",
"addClass",
"(",
"above",
",",
"DT",
".",
"CLASS_PAGINATOR",
")",
";",
"this",
".",
"_elContainer",
".",
"insertBefore",
"(",
"above",
",",
"this",
".",
"_elContainer",
".",
"firstChild",
")",
";",
"}",
"if",
"(",
"!",
"below",
")",
"{",
"below",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"below",
".",
"id",
"=",
"below_id",
";",
"Dom",
".",
"addClass",
"(",
"below",
",",
"DT",
".",
"CLASS_PAGINATOR",
")",
";",
"this",
".",
"_elContainer",
".",
"appendChild",
"(",
"below",
")",
";",
"}",
"}",
"return",
"[",
"above",
",",
"below",
"]",
";",
"}"
]
| Returns the default containers used for Paginators. If create param is
passed, the containers will be created and added to the DataTable container.
@method _defaultPaginatorContainers
@param create {boolean} Create the default containers if not found
@private | [
"Returns",
"the",
"default",
"containers",
"used",
"for",
"Paginators",
".",
"If",
"create",
"param",
"is",
"passed",
"the",
"containers",
"will",
"be",
"created",
"and",
"added",
"to",
"the",
"DataTable",
"container",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L9680-L9706 |
|
42,528 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function () {
var pag = this.get("paginator");
if (!pag) { return; }
// Add the containers if the Paginator is not configured with containers
if (!pag.getContainerNodes().length) {
pag.set('containers',this._defaultPaginatorContainers(true));
}
pag.render();
} | javascript | function () {
var pag = this.get("paginator");
if (!pag) { return; }
// Add the containers if the Paginator is not configured with containers
if (!pag.getContainerNodes().length) {
pag.set('containers',this._defaultPaginatorContainers(true));
}
pag.render();
} | [
"function",
"(",
")",
"{",
"var",
"pag",
"=",
"this",
".",
"get",
"(",
"\"paginator\"",
")",
";",
"if",
"(",
"!",
"pag",
")",
"{",
"return",
";",
"}",
"// Add the containers if the Paginator is not configured with containers",
"if",
"(",
"!",
"pag",
".",
"getContainerNodes",
"(",
")",
".",
"length",
")",
"{",
"pag",
".",
"set",
"(",
"'containers'",
",",
"this",
".",
"_defaultPaginatorContainers",
"(",
"true",
")",
")",
";",
"}",
"pag",
".",
"render",
"(",
")",
";",
"}"
]
| Renders the Paginator to the DataTable UI
@method renderPaginator | [
"Renders",
"the",
"Paginator",
"to",
"the",
"DataTable",
"UI"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L9726-L9736 |
|
42,529 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var selectedRows = Dom.getElementsByClassName(DT.CLASS_SELECTED,"tr",this._elTbody);
Dom.removeClass(selectedRows, DT.CLASS_SELECTED);
} | javascript | function() {
var selectedRows = Dom.getElementsByClassName(DT.CLASS_SELECTED,"tr",this._elTbody);
Dom.removeClass(selectedRows, DT.CLASS_SELECTED);
} | [
"function",
"(",
")",
"{",
"var",
"selectedRows",
"=",
"Dom",
".",
"getElementsByClassName",
"(",
"DT",
".",
"CLASS_SELECTED",
",",
"\"tr\"",
",",
"this",
".",
"_elTbody",
")",
";",
"Dom",
".",
"removeClass",
"(",
"selectedRows",
",",
"DT",
".",
"CLASS_SELECTED",
")",
";",
"}"
]
| Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED
from all TR elements on the page.
@method _unselectAllTrEls
@private | [
"Convenience",
"method",
"to",
"remove",
"the",
"class",
"YAHOO",
".",
"widget",
".",
"DataTable",
".",
"CLASS_SELECTED",
"from",
"all",
"TR",
"elements",
"on",
"the",
"page",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L9907-L9910 |
|
42,530 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var sMode = this.get("selectionMode");
var oTrigger = {};
var oTriggerCell, oTriggerRecord, nTriggerRecordIndex, elTriggerRow, nTriggerTrIndex;
// Cell mode
if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
oTriggerCell = this.getLastSelectedCell();
// No selected cells found
if(!oTriggerCell) {
return null;
}
else {
oTriggerRecord = this.getRecord(oTriggerCell.recordId);
nTriggerRecordIndex = this.getRecordIndex(oTriggerRecord);
elTriggerRow = this.getTrEl(oTriggerRecord);
nTriggerTrIndex = this.getTrIndex(elTriggerRow);
// Selected cell not found on this page
if(nTriggerTrIndex === null) {
return null;
}
else {
oTrigger.record = oTriggerRecord;
oTrigger.recordIndex = nTriggerRecordIndex;
oTrigger.el = this.getTdEl(oTriggerCell);
oTrigger.trIndex = nTriggerTrIndex;
oTrigger.column = this.getColumn(oTriggerCell.columnKey);
oTrigger.colKeyIndex = oTrigger.column.getKeyIndex();
oTrigger.cell = oTriggerCell;
return oTrigger;
}
}
}
// Row mode
else {
oTriggerRecord = this.getLastSelectedRecord();
// No selected rows found
if(!oTriggerRecord) {
return null;
}
else {
// Selected row found, but is it on current page?
oTriggerRecord = this.getRecord(oTriggerRecord);
nTriggerRecordIndex = this.getRecordIndex(oTriggerRecord);
elTriggerRow = this.getTrEl(oTriggerRecord);
nTriggerTrIndex = this.getTrIndex(elTriggerRow);
// Selected row not found on this page
if(nTriggerTrIndex === null) {
return null;
}
else {
oTrigger.record = oTriggerRecord;
oTrigger.recordIndex = nTriggerRecordIndex;
oTrigger.el = elTriggerRow;
oTrigger.trIndex = nTriggerTrIndex;
return oTrigger;
}
}
}
} | javascript | function() {
var sMode = this.get("selectionMode");
var oTrigger = {};
var oTriggerCell, oTriggerRecord, nTriggerRecordIndex, elTriggerRow, nTriggerTrIndex;
// Cell mode
if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
oTriggerCell = this.getLastSelectedCell();
// No selected cells found
if(!oTriggerCell) {
return null;
}
else {
oTriggerRecord = this.getRecord(oTriggerCell.recordId);
nTriggerRecordIndex = this.getRecordIndex(oTriggerRecord);
elTriggerRow = this.getTrEl(oTriggerRecord);
nTriggerTrIndex = this.getTrIndex(elTriggerRow);
// Selected cell not found on this page
if(nTriggerTrIndex === null) {
return null;
}
else {
oTrigger.record = oTriggerRecord;
oTrigger.recordIndex = nTriggerRecordIndex;
oTrigger.el = this.getTdEl(oTriggerCell);
oTrigger.trIndex = nTriggerTrIndex;
oTrigger.column = this.getColumn(oTriggerCell.columnKey);
oTrigger.colKeyIndex = oTrigger.column.getKeyIndex();
oTrigger.cell = oTriggerCell;
return oTrigger;
}
}
}
// Row mode
else {
oTriggerRecord = this.getLastSelectedRecord();
// No selected rows found
if(!oTriggerRecord) {
return null;
}
else {
// Selected row found, but is it on current page?
oTriggerRecord = this.getRecord(oTriggerRecord);
nTriggerRecordIndex = this.getRecordIndex(oTriggerRecord);
elTriggerRow = this.getTrEl(oTriggerRecord);
nTriggerTrIndex = this.getTrIndex(elTriggerRow);
// Selected row not found on this page
if(nTriggerTrIndex === null) {
return null;
}
else {
oTrigger.record = oTriggerRecord;
oTrigger.recordIndex = nTriggerRecordIndex;
oTrigger.el = elTriggerRow;
oTrigger.trIndex = nTriggerTrIndex;
return oTrigger;
}
}
}
} | [
"function",
"(",
")",
"{",
"var",
"sMode",
"=",
"this",
".",
"get",
"(",
"\"selectionMode\"",
")",
";",
"var",
"oTrigger",
"=",
"{",
"}",
";",
"var",
"oTriggerCell",
",",
"oTriggerRecord",
",",
"nTriggerRecordIndex",
",",
"elTriggerRow",
",",
"nTriggerTrIndex",
";",
"// Cell mode",
"if",
"(",
"(",
"sMode",
"==",
"\"cellblock\"",
")",
"||",
"(",
"sMode",
"==",
"\"cellrange\"",
")",
"||",
"(",
"sMode",
"==",
"\"singlecell\"",
")",
")",
"{",
"oTriggerCell",
"=",
"this",
".",
"getLastSelectedCell",
"(",
")",
";",
"// No selected cells found",
"if",
"(",
"!",
"oTriggerCell",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"oTriggerRecord",
"=",
"this",
".",
"getRecord",
"(",
"oTriggerCell",
".",
"recordId",
")",
";",
"nTriggerRecordIndex",
"=",
"this",
".",
"getRecordIndex",
"(",
"oTriggerRecord",
")",
";",
"elTriggerRow",
"=",
"this",
".",
"getTrEl",
"(",
"oTriggerRecord",
")",
";",
"nTriggerTrIndex",
"=",
"this",
".",
"getTrIndex",
"(",
"elTriggerRow",
")",
";",
"// Selected cell not found on this page",
"if",
"(",
"nTriggerTrIndex",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"oTrigger",
".",
"record",
"=",
"oTriggerRecord",
";",
"oTrigger",
".",
"recordIndex",
"=",
"nTriggerRecordIndex",
";",
"oTrigger",
".",
"el",
"=",
"this",
".",
"getTdEl",
"(",
"oTriggerCell",
")",
";",
"oTrigger",
".",
"trIndex",
"=",
"nTriggerTrIndex",
";",
"oTrigger",
".",
"column",
"=",
"this",
".",
"getColumn",
"(",
"oTriggerCell",
".",
"columnKey",
")",
";",
"oTrigger",
".",
"colKeyIndex",
"=",
"oTrigger",
".",
"column",
".",
"getKeyIndex",
"(",
")",
";",
"oTrigger",
".",
"cell",
"=",
"oTriggerCell",
";",
"return",
"oTrigger",
";",
"}",
"}",
"}",
"// Row mode",
"else",
"{",
"oTriggerRecord",
"=",
"this",
".",
"getLastSelectedRecord",
"(",
")",
";",
"// No selected rows found",
"if",
"(",
"!",
"oTriggerRecord",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"// Selected row found, but is it on current page?",
"oTriggerRecord",
"=",
"this",
".",
"getRecord",
"(",
"oTriggerRecord",
")",
";",
"nTriggerRecordIndex",
"=",
"this",
".",
"getRecordIndex",
"(",
"oTriggerRecord",
")",
";",
"elTriggerRow",
"=",
"this",
".",
"getTrEl",
"(",
"oTriggerRecord",
")",
";",
"nTriggerTrIndex",
"=",
"this",
".",
"getTrIndex",
"(",
"elTriggerRow",
")",
";",
"// Selected row not found on this page",
"if",
"(",
"nTriggerTrIndex",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"oTrigger",
".",
"record",
"=",
"oTriggerRecord",
";",
"oTrigger",
".",
"recordIndex",
"=",
"nTriggerRecordIndex",
";",
"oTrigger",
".",
"el",
"=",
"elTriggerRow",
";",
"oTrigger",
".",
"trIndex",
"=",
"nTriggerTrIndex",
";",
"return",
"oTrigger",
";",
"}",
"}",
"}",
"}"
]
| Returns object literal of values that represent the selection trigger. Used
to determine selection behavior resulting from a key event.
@method _getSelectionTrigger
@private | [
"Returns",
"object",
"literal",
"of",
"values",
"that",
"represent",
"the",
"selection",
"trigger",
".",
"Used",
"to",
"determine",
"selection",
"behavior",
"resulting",
"from",
"a",
"key",
"event",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L9919-L9980 |
|
42,531 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oTrigger) {
var sMode = this.get("selectionMode");
var oAnchor = {};
var oAnchorRecord, nAnchorRecordIndex, nAnchorTrIndex;
// Cell mode
if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
// Validate anchor cell
var oAnchorCell = this._oAnchorCell;
if(!oAnchorCell) {
if(oTrigger) {
oAnchorCell = this._oAnchorCell = oTrigger.cell;
}
else {
return null;
}
}
oAnchorRecord = this._oAnchorCell.record;
nAnchorRecordIndex = this._oRecordSet.getRecordIndex(oAnchorRecord);
nAnchorTrIndex = this.getTrIndex(oAnchorRecord);
// If anchor cell is not on this page...
if(nAnchorTrIndex === null) {
// ...set TR index equal to top TR
if(nAnchorRecordIndex < this.getRecordIndex(this.getFirstTrEl())) {
nAnchorTrIndex = 0;
}
// ...set TR index equal to bottom TR
else {
nAnchorTrIndex = this.getRecordIndex(this.getLastTrEl());
}
}
oAnchor.record = oAnchorRecord;
oAnchor.recordIndex = nAnchorRecordIndex;
oAnchor.trIndex = nAnchorTrIndex;
oAnchor.column = this._oAnchorCell.column;
oAnchor.colKeyIndex = oAnchor.column.getKeyIndex();
oAnchor.cell = oAnchorCell;
return oAnchor;
}
// Row mode
else {
oAnchorRecord = this._oAnchorRecord;
if(!oAnchorRecord) {
if(oTrigger) {
oAnchorRecord = this._oAnchorRecord = oTrigger.record;
}
else {
return null;
}
}
nAnchorRecordIndex = this.getRecordIndex(oAnchorRecord);
nAnchorTrIndex = this.getTrIndex(oAnchorRecord);
// If anchor row is not on this page...
if(nAnchorTrIndex === null) {
// ...set TR index equal to top TR
if(nAnchorRecordIndex < this.getRecordIndex(this.getFirstTrEl())) {
nAnchorTrIndex = 0;
}
// ...set TR index equal to bottom TR
else {
nAnchorTrIndex = this.getRecordIndex(this.getLastTrEl());
}
}
oAnchor.record = oAnchorRecord;
oAnchor.recordIndex = nAnchorRecordIndex;
oAnchor.trIndex = nAnchorTrIndex;
return oAnchor;
}
} | javascript | function(oTrigger) {
var sMode = this.get("selectionMode");
var oAnchor = {};
var oAnchorRecord, nAnchorRecordIndex, nAnchorTrIndex;
// Cell mode
if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
// Validate anchor cell
var oAnchorCell = this._oAnchorCell;
if(!oAnchorCell) {
if(oTrigger) {
oAnchorCell = this._oAnchorCell = oTrigger.cell;
}
else {
return null;
}
}
oAnchorRecord = this._oAnchorCell.record;
nAnchorRecordIndex = this._oRecordSet.getRecordIndex(oAnchorRecord);
nAnchorTrIndex = this.getTrIndex(oAnchorRecord);
// If anchor cell is not on this page...
if(nAnchorTrIndex === null) {
// ...set TR index equal to top TR
if(nAnchorRecordIndex < this.getRecordIndex(this.getFirstTrEl())) {
nAnchorTrIndex = 0;
}
// ...set TR index equal to bottom TR
else {
nAnchorTrIndex = this.getRecordIndex(this.getLastTrEl());
}
}
oAnchor.record = oAnchorRecord;
oAnchor.recordIndex = nAnchorRecordIndex;
oAnchor.trIndex = nAnchorTrIndex;
oAnchor.column = this._oAnchorCell.column;
oAnchor.colKeyIndex = oAnchor.column.getKeyIndex();
oAnchor.cell = oAnchorCell;
return oAnchor;
}
// Row mode
else {
oAnchorRecord = this._oAnchorRecord;
if(!oAnchorRecord) {
if(oTrigger) {
oAnchorRecord = this._oAnchorRecord = oTrigger.record;
}
else {
return null;
}
}
nAnchorRecordIndex = this.getRecordIndex(oAnchorRecord);
nAnchorTrIndex = this.getTrIndex(oAnchorRecord);
// If anchor row is not on this page...
if(nAnchorTrIndex === null) {
// ...set TR index equal to top TR
if(nAnchorRecordIndex < this.getRecordIndex(this.getFirstTrEl())) {
nAnchorTrIndex = 0;
}
// ...set TR index equal to bottom TR
else {
nAnchorTrIndex = this.getRecordIndex(this.getLastTrEl());
}
}
oAnchor.record = oAnchorRecord;
oAnchor.recordIndex = nAnchorRecordIndex;
oAnchor.trIndex = nAnchorTrIndex;
return oAnchor;
}
} | [
"function",
"(",
"oTrigger",
")",
"{",
"var",
"sMode",
"=",
"this",
".",
"get",
"(",
"\"selectionMode\"",
")",
";",
"var",
"oAnchor",
"=",
"{",
"}",
";",
"var",
"oAnchorRecord",
",",
"nAnchorRecordIndex",
",",
"nAnchorTrIndex",
";",
"// Cell mode",
"if",
"(",
"(",
"sMode",
"==",
"\"cellblock\"",
")",
"||",
"(",
"sMode",
"==",
"\"cellrange\"",
")",
"||",
"(",
"sMode",
"==",
"\"singlecell\"",
")",
")",
"{",
"// Validate anchor cell",
"var",
"oAnchorCell",
"=",
"this",
".",
"_oAnchorCell",
";",
"if",
"(",
"!",
"oAnchorCell",
")",
"{",
"if",
"(",
"oTrigger",
")",
"{",
"oAnchorCell",
"=",
"this",
".",
"_oAnchorCell",
"=",
"oTrigger",
".",
"cell",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}",
"oAnchorRecord",
"=",
"this",
".",
"_oAnchorCell",
".",
"record",
";",
"nAnchorRecordIndex",
"=",
"this",
".",
"_oRecordSet",
".",
"getRecordIndex",
"(",
"oAnchorRecord",
")",
";",
"nAnchorTrIndex",
"=",
"this",
".",
"getTrIndex",
"(",
"oAnchorRecord",
")",
";",
"// If anchor cell is not on this page...",
"if",
"(",
"nAnchorTrIndex",
"===",
"null",
")",
"{",
"// ...set TR index equal to top TR",
"if",
"(",
"nAnchorRecordIndex",
"<",
"this",
".",
"getRecordIndex",
"(",
"this",
".",
"getFirstTrEl",
"(",
")",
")",
")",
"{",
"nAnchorTrIndex",
"=",
"0",
";",
"}",
"// ...set TR index equal to bottom TR",
"else",
"{",
"nAnchorTrIndex",
"=",
"this",
".",
"getRecordIndex",
"(",
"this",
".",
"getLastTrEl",
"(",
")",
")",
";",
"}",
"}",
"oAnchor",
".",
"record",
"=",
"oAnchorRecord",
";",
"oAnchor",
".",
"recordIndex",
"=",
"nAnchorRecordIndex",
";",
"oAnchor",
".",
"trIndex",
"=",
"nAnchorTrIndex",
";",
"oAnchor",
".",
"column",
"=",
"this",
".",
"_oAnchorCell",
".",
"column",
";",
"oAnchor",
".",
"colKeyIndex",
"=",
"oAnchor",
".",
"column",
".",
"getKeyIndex",
"(",
")",
";",
"oAnchor",
".",
"cell",
"=",
"oAnchorCell",
";",
"return",
"oAnchor",
";",
"}",
"// Row mode",
"else",
"{",
"oAnchorRecord",
"=",
"this",
".",
"_oAnchorRecord",
";",
"if",
"(",
"!",
"oAnchorRecord",
")",
"{",
"if",
"(",
"oTrigger",
")",
"{",
"oAnchorRecord",
"=",
"this",
".",
"_oAnchorRecord",
"=",
"oTrigger",
".",
"record",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}",
"nAnchorRecordIndex",
"=",
"this",
".",
"getRecordIndex",
"(",
"oAnchorRecord",
")",
";",
"nAnchorTrIndex",
"=",
"this",
".",
"getTrIndex",
"(",
"oAnchorRecord",
")",
";",
"// If anchor row is not on this page...",
"if",
"(",
"nAnchorTrIndex",
"===",
"null",
")",
"{",
"// ...set TR index equal to top TR",
"if",
"(",
"nAnchorRecordIndex",
"<",
"this",
".",
"getRecordIndex",
"(",
"this",
".",
"getFirstTrEl",
"(",
")",
")",
")",
"{",
"nAnchorTrIndex",
"=",
"0",
";",
"}",
"// ...set TR index equal to bottom TR",
"else",
"{",
"nAnchorTrIndex",
"=",
"this",
".",
"getRecordIndex",
"(",
"this",
".",
"getLastTrEl",
"(",
")",
")",
";",
"}",
"}",
"oAnchor",
".",
"record",
"=",
"oAnchorRecord",
";",
"oAnchor",
".",
"recordIndex",
"=",
"nAnchorRecordIndex",
";",
"oAnchor",
".",
"trIndex",
"=",
"nAnchorTrIndex",
";",
"return",
"oAnchor",
";",
"}",
"}"
]
| Returns object literal of values that represent the selection anchor. Used
to determine selection behavior resulting from a user event.
@method _getSelectionAnchor
@param oTrigger {Object} (Optional) Object literal of selection trigger values
(for key events).
@private | [
"Returns",
"object",
"literal",
"of",
"values",
"that",
"represent",
"the",
"selection",
"anchor",
".",
"Used",
"to",
"determine",
"selection",
"behavior",
"resulting",
"from",
"a",
"user",
"event",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L9991-L10062 |
|
42,532 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oArgs) {
var elTarget = oArgs.target;
// Validate target row
var elTargetRow = this.getTrEl(elTarget);
if(elTargetRow) {
var e = oArgs.event;
var bSHIFT = e.shiftKey;
var bCTRL = e.ctrlKey || ((navigator.userAgent.toLowerCase().indexOf("mac") != -1) && e.metaKey);
var oTargetRecord = this.getRecord(elTargetRow);
var nTargetRecordIndex = this._oRecordSet.getRecordIndex(oTargetRecord);
var oAnchor = this._getSelectionAnchor();
var i;
// Both SHIFT and CTRL
if(bSHIFT && bCTRL) {
// Validate anchor
if(oAnchor) {
if(this.isSelected(oAnchor.record)) {
// Select all rows between anchor row and target row, including target row
if(oAnchor.recordIndex < nTargetRecordIndex) {
for(i=oAnchor.recordIndex+1; i<=nTargetRecordIndex; i++) {
if(!this.isSelected(i)) {
this.selectRow(i);
}
}
}
// Select all rows between target row and anchor row, including target row
else {
for(i=oAnchor.recordIndex-1; i>=nTargetRecordIndex; i--) {
if(!this.isSelected(i)) {
this.selectRow(i);
}
}
}
}
else {
// Unselect all rows between anchor row and target row
if(oAnchor.recordIndex < nTargetRecordIndex) {
for(i=oAnchor.recordIndex+1; i<=nTargetRecordIndex-1; i++) {
if(this.isSelected(i)) {
this.unselectRow(i);
}
}
}
// Unselect all rows between target row and anchor row
else {
for(i=nTargetRecordIndex+1; i<=oAnchor.recordIndex-1; i++) {
if(this.isSelected(i)) {
this.unselectRow(i);
}
}
}
// Select the target row
this.selectRow(oTargetRecord);
}
}
// Invalid anchor
else {
// Set anchor
this._oAnchorRecord = oTargetRecord;
// Toggle selection of target
if(this.isSelected(oTargetRecord)) {
this.unselectRow(oTargetRecord);
}
else {
this.selectRow(oTargetRecord);
}
}
}
// Only SHIFT
else if(bSHIFT) {
this.unselectAllRows();
// Validate anchor
if(oAnchor) {
// Select all rows between anchor row and target row,
// including the anchor row and target row
if(oAnchor.recordIndex < nTargetRecordIndex) {
for(i=oAnchor.recordIndex; i<=nTargetRecordIndex; i++) {
this.selectRow(i);
}
}
// Select all rows between target row and anchor row,
// including the target row and anchor row
else {
for(i=oAnchor.recordIndex; i>=nTargetRecordIndex; i--) {
this.selectRow(i);
}
}
}
// Invalid anchor
else {
// Set anchor
this._oAnchorRecord = oTargetRecord;
// Select target row only
this.selectRow(oTargetRecord);
}
}
// Only CTRL
else if(bCTRL) {
// Set anchor
this._oAnchorRecord = oTargetRecord;
// Toggle selection of target
if(this.isSelected(oTargetRecord)) {
this.unselectRow(oTargetRecord);
}
else {
this.selectRow(oTargetRecord);
}
}
// Neither SHIFT nor CTRL
else {
this._handleSingleSelectionByMouse(oArgs);
return;
}
}
} | javascript | function(oArgs) {
var elTarget = oArgs.target;
// Validate target row
var elTargetRow = this.getTrEl(elTarget);
if(elTargetRow) {
var e = oArgs.event;
var bSHIFT = e.shiftKey;
var bCTRL = e.ctrlKey || ((navigator.userAgent.toLowerCase().indexOf("mac") != -1) && e.metaKey);
var oTargetRecord = this.getRecord(elTargetRow);
var nTargetRecordIndex = this._oRecordSet.getRecordIndex(oTargetRecord);
var oAnchor = this._getSelectionAnchor();
var i;
// Both SHIFT and CTRL
if(bSHIFT && bCTRL) {
// Validate anchor
if(oAnchor) {
if(this.isSelected(oAnchor.record)) {
// Select all rows between anchor row and target row, including target row
if(oAnchor.recordIndex < nTargetRecordIndex) {
for(i=oAnchor.recordIndex+1; i<=nTargetRecordIndex; i++) {
if(!this.isSelected(i)) {
this.selectRow(i);
}
}
}
// Select all rows between target row and anchor row, including target row
else {
for(i=oAnchor.recordIndex-1; i>=nTargetRecordIndex; i--) {
if(!this.isSelected(i)) {
this.selectRow(i);
}
}
}
}
else {
// Unselect all rows between anchor row and target row
if(oAnchor.recordIndex < nTargetRecordIndex) {
for(i=oAnchor.recordIndex+1; i<=nTargetRecordIndex-1; i++) {
if(this.isSelected(i)) {
this.unselectRow(i);
}
}
}
// Unselect all rows between target row and anchor row
else {
for(i=nTargetRecordIndex+1; i<=oAnchor.recordIndex-1; i++) {
if(this.isSelected(i)) {
this.unselectRow(i);
}
}
}
// Select the target row
this.selectRow(oTargetRecord);
}
}
// Invalid anchor
else {
// Set anchor
this._oAnchorRecord = oTargetRecord;
// Toggle selection of target
if(this.isSelected(oTargetRecord)) {
this.unselectRow(oTargetRecord);
}
else {
this.selectRow(oTargetRecord);
}
}
}
// Only SHIFT
else if(bSHIFT) {
this.unselectAllRows();
// Validate anchor
if(oAnchor) {
// Select all rows between anchor row and target row,
// including the anchor row and target row
if(oAnchor.recordIndex < nTargetRecordIndex) {
for(i=oAnchor.recordIndex; i<=nTargetRecordIndex; i++) {
this.selectRow(i);
}
}
// Select all rows between target row and anchor row,
// including the target row and anchor row
else {
for(i=oAnchor.recordIndex; i>=nTargetRecordIndex; i--) {
this.selectRow(i);
}
}
}
// Invalid anchor
else {
// Set anchor
this._oAnchorRecord = oTargetRecord;
// Select target row only
this.selectRow(oTargetRecord);
}
}
// Only CTRL
else if(bCTRL) {
// Set anchor
this._oAnchorRecord = oTargetRecord;
// Toggle selection of target
if(this.isSelected(oTargetRecord)) {
this.unselectRow(oTargetRecord);
}
else {
this.selectRow(oTargetRecord);
}
}
// Neither SHIFT nor CTRL
else {
this._handleSingleSelectionByMouse(oArgs);
return;
}
}
} | [
"function",
"(",
"oArgs",
")",
"{",
"var",
"elTarget",
"=",
"oArgs",
".",
"target",
";",
"// Validate target row",
"var",
"elTargetRow",
"=",
"this",
".",
"getTrEl",
"(",
"elTarget",
")",
";",
"if",
"(",
"elTargetRow",
")",
"{",
"var",
"e",
"=",
"oArgs",
".",
"event",
";",
"var",
"bSHIFT",
"=",
"e",
".",
"shiftKey",
";",
"var",
"bCTRL",
"=",
"e",
".",
"ctrlKey",
"||",
"(",
"(",
"navigator",
".",
"userAgent",
".",
"toLowerCase",
"(",
")",
".",
"indexOf",
"(",
"\"mac\"",
")",
"!=",
"-",
"1",
")",
"&&",
"e",
".",
"metaKey",
")",
";",
"var",
"oTargetRecord",
"=",
"this",
".",
"getRecord",
"(",
"elTargetRow",
")",
";",
"var",
"nTargetRecordIndex",
"=",
"this",
".",
"_oRecordSet",
".",
"getRecordIndex",
"(",
"oTargetRecord",
")",
";",
"var",
"oAnchor",
"=",
"this",
".",
"_getSelectionAnchor",
"(",
")",
";",
"var",
"i",
";",
"// Both SHIFT and CTRL",
"if",
"(",
"bSHIFT",
"&&",
"bCTRL",
")",
"{",
"// Validate anchor",
"if",
"(",
"oAnchor",
")",
"{",
"if",
"(",
"this",
".",
"isSelected",
"(",
"oAnchor",
".",
"record",
")",
")",
"{",
"// Select all rows between anchor row and target row, including target row",
"if",
"(",
"oAnchor",
".",
"recordIndex",
"<",
"nTargetRecordIndex",
")",
"{",
"for",
"(",
"i",
"=",
"oAnchor",
".",
"recordIndex",
"+",
"1",
";",
"i",
"<=",
"nTargetRecordIndex",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"this",
".",
"isSelected",
"(",
"i",
")",
")",
"{",
"this",
".",
"selectRow",
"(",
"i",
")",
";",
"}",
"}",
"}",
"// Select all rows between target row and anchor row, including target row",
"else",
"{",
"for",
"(",
"i",
"=",
"oAnchor",
".",
"recordIndex",
"-",
"1",
";",
"i",
">=",
"nTargetRecordIndex",
";",
"i",
"--",
")",
"{",
"if",
"(",
"!",
"this",
".",
"isSelected",
"(",
"i",
")",
")",
"{",
"this",
".",
"selectRow",
"(",
"i",
")",
";",
"}",
"}",
"}",
"}",
"else",
"{",
"// Unselect all rows between anchor row and target row",
"if",
"(",
"oAnchor",
".",
"recordIndex",
"<",
"nTargetRecordIndex",
")",
"{",
"for",
"(",
"i",
"=",
"oAnchor",
".",
"recordIndex",
"+",
"1",
";",
"i",
"<=",
"nTargetRecordIndex",
"-",
"1",
";",
"i",
"++",
")",
"{",
"if",
"(",
"this",
".",
"isSelected",
"(",
"i",
")",
")",
"{",
"this",
".",
"unselectRow",
"(",
"i",
")",
";",
"}",
"}",
"}",
"// Unselect all rows between target row and anchor row",
"else",
"{",
"for",
"(",
"i",
"=",
"nTargetRecordIndex",
"+",
"1",
";",
"i",
"<=",
"oAnchor",
".",
"recordIndex",
"-",
"1",
";",
"i",
"++",
")",
"{",
"if",
"(",
"this",
".",
"isSelected",
"(",
"i",
")",
")",
"{",
"this",
".",
"unselectRow",
"(",
"i",
")",
";",
"}",
"}",
"}",
"// Select the target row",
"this",
".",
"selectRow",
"(",
"oTargetRecord",
")",
";",
"}",
"}",
"// Invalid anchor",
"else",
"{",
"// Set anchor",
"this",
".",
"_oAnchorRecord",
"=",
"oTargetRecord",
";",
"// Toggle selection of target",
"if",
"(",
"this",
".",
"isSelected",
"(",
"oTargetRecord",
")",
")",
"{",
"this",
".",
"unselectRow",
"(",
"oTargetRecord",
")",
";",
"}",
"else",
"{",
"this",
".",
"selectRow",
"(",
"oTargetRecord",
")",
";",
"}",
"}",
"}",
"// Only SHIFT",
"else",
"if",
"(",
"bSHIFT",
")",
"{",
"this",
".",
"unselectAllRows",
"(",
")",
";",
"// Validate anchor",
"if",
"(",
"oAnchor",
")",
"{",
"// Select all rows between anchor row and target row,",
"// including the anchor row and target row",
"if",
"(",
"oAnchor",
".",
"recordIndex",
"<",
"nTargetRecordIndex",
")",
"{",
"for",
"(",
"i",
"=",
"oAnchor",
".",
"recordIndex",
";",
"i",
"<=",
"nTargetRecordIndex",
";",
"i",
"++",
")",
"{",
"this",
".",
"selectRow",
"(",
"i",
")",
";",
"}",
"}",
"// Select all rows between target row and anchor row,",
"// including the target row and anchor row",
"else",
"{",
"for",
"(",
"i",
"=",
"oAnchor",
".",
"recordIndex",
";",
"i",
">=",
"nTargetRecordIndex",
";",
"i",
"--",
")",
"{",
"this",
".",
"selectRow",
"(",
"i",
")",
";",
"}",
"}",
"}",
"// Invalid anchor",
"else",
"{",
"// Set anchor",
"this",
".",
"_oAnchorRecord",
"=",
"oTargetRecord",
";",
"// Select target row only",
"this",
".",
"selectRow",
"(",
"oTargetRecord",
")",
";",
"}",
"}",
"// Only CTRL",
"else",
"if",
"(",
"bCTRL",
")",
"{",
"// Set anchor",
"this",
".",
"_oAnchorRecord",
"=",
"oTargetRecord",
";",
"// Toggle selection of target",
"if",
"(",
"this",
".",
"isSelected",
"(",
"oTargetRecord",
")",
")",
"{",
"this",
".",
"unselectRow",
"(",
"oTargetRecord",
")",
";",
"}",
"else",
"{",
"this",
".",
"selectRow",
"(",
"oTargetRecord",
")",
";",
"}",
"}",
"// Neither SHIFT nor CTRL",
"else",
"{",
"this",
".",
"_handleSingleSelectionByMouse",
"(",
"oArgs",
")",
";",
"return",
";",
"}",
"}",
"}"
]
| Determines selection behavior resulting from a mouse event when selection mode
is set to "standard".
@method _handleStandardSelectionByMouse
@param oArgs.event {HTMLEvent} Event object.
@param oArgs.target {HTMLElement} Target element.
@private | [
"Determines",
"selection",
"behavior",
"resulting",
"from",
"a",
"mouse",
"event",
"when",
"selection",
"mode",
"is",
"set",
"to",
"standard",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L10073-L10196 |
|
42,533 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(e) {
var nKey = Ev.getCharCode(e);
if((nKey == 38) || (nKey == 40)) {
var bSHIFT = e.shiftKey;
// Validate trigger
var oTrigger = this._getSelectionTrigger();
// Arrow selection only works if last selected row is on current page
if(!oTrigger) {
return null;
}
Ev.stopEvent(e);
// Validate anchor
var oAnchor = this._getSelectionAnchor(oTrigger);
// Determine which direction we're going to
if(bSHIFT) {
// Selecting down away from anchor row
if((nKey == 40) && (oAnchor.recordIndex <= oTrigger.trIndex)) {
this.selectRow(this.getNextTrEl(oTrigger.el));
}
// Selecting up away from anchor row
else if((nKey == 38) && (oAnchor.recordIndex >= oTrigger.trIndex)) {
this.selectRow(this.getPreviousTrEl(oTrigger.el));
}
// Unselect trigger
else {
this.unselectRow(oTrigger.el);
}
}
else {
this._handleSingleSelectionByKey(e);
}
}
} | javascript | function(e) {
var nKey = Ev.getCharCode(e);
if((nKey == 38) || (nKey == 40)) {
var bSHIFT = e.shiftKey;
// Validate trigger
var oTrigger = this._getSelectionTrigger();
// Arrow selection only works if last selected row is on current page
if(!oTrigger) {
return null;
}
Ev.stopEvent(e);
// Validate anchor
var oAnchor = this._getSelectionAnchor(oTrigger);
// Determine which direction we're going to
if(bSHIFT) {
// Selecting down away from anchor row
if((nKey == 40) && (oAnchor.recordIndex <= oTrigger.trIndex)) {
this.selectRow(this.getNextTrEl(oTrigger.el));
}
// Selecting up away from anchor row
else if((nKey == 38) && (oAnchor.recordIndex >= oTrigger.trIndex)) {
this.selectRow(this.getPreviousTrEl(oTrigger.el));
}
// Unselect trigger
else {
this.unselectRow(oTrigger.el);
}
}
else {
this._handleSingleSelectionByKey(e);
}
}
} | [
"function",
"(",
"e",
")",
"{",
"var",
"nKey",
"=",
"Ev",
".",
"getCharCode",
"(",
"e",
")",
";",
"if",
"(",
"(",
"nKey",
"==",
"38",
")",
"||",
"(",
"nKey",
"==",
"40",
")",
")",
"{",
"var",
"bSHIFT",
"=",
"e",
".",
"shiftKey",
";",
"// Validate trigger",
"var",
"oTrigger",
"=",
"this",
".",
"_getSelectionTrigger",
"(",
")",
";",
"// Arrow selection only works if last selected row is on current page",
"if",
"(",
"!",
"oTrigger",
")",
"{",
"return",
"null",
";",
"}",
"Ev",
".",
"stopEvent",
"(",
"e",
")",
";",
"// Validate anchor",
"var",
"oAnchor",
"=",
"this",
".",
"_getSelectionAnchor",
"(",
"oTrigger",
")",
";",
"// Determine which direction we're going to",
"if",
"(",
"bSHIFT",
")",
"{",
"// Selecting down away from anchor row",
"if",
"(",
"(",
"nKey",
"==",
"40",
")",
"&&",
"(",
"oAnchor",
".",
"recordIndex",
"<=",
"oTrigger",
".",
"trIndex",
")",
")",
"{",
"this",
".",
"selectRow",
"(",
"this",
".",
"getNextTrEl",
"(",
"oTrigger",
".",
"el",
")",
")",
";",
"}",
"// Selecting up away from anchor row",
"else",
"if",
"(",
"(",
"nKey",
"==",
"38",
")",
"&&",
"(",
"oAnchor",
".",
"recordIndex",
">=",
"oTrigger",
".",
"trIndex",
")",
")",
"{",
"this",
".",
"selectRow",
"(",
"this",
".",
"getPreviousTrEl",
"(",
"oTrigger",
".",
"el",
")",
")",
";",
"}",
"// Unselect trigger",
"else",
"{",
"this",
".",
"unselectRow",
"(",
"oTrigger",
".",
"el",
")",
";",
"}",
"}",
"else",
"{",
"this",
".",
"_handleSingleSelectionByKey",
"(",
"e",
")",
";",
"}",
"}",
"}"
]
| Determines selection behavior resulting from a key event when selection mode
is set to "standard".
@method _handleStandardSelectionByKey
@param e {HTMLEvent} Event object.
@private | [
"Determines",
"selection",
"behavior",
"resulting",
"from",
"a",
"key",
"event",
"when",
"selection",
"mode",
"is",
"set",
"to",
"standard",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L10206-L10243 |
|
42,534 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oArgs) {
var elTarget = oArgs.target;
// Validate target row
var elTargetRow = this.getTrEl(elTarget);
if(elTargetRow) {
var oTargetRecord = this.getRecord(elTargetRow);
// Set anchor
this._oAnchorRecord = oTargetRecord;
// Select only target
this.unselectAllRows();
this.selectRow(oTargetRecord);
}
} | javascript | function(oArgs) {
var elTarget = oArgs.target;
// Validate target row
var elTargetRow = this.getTrEl(elTarget);
if(elTargetRow) {
var oTargetRecord = this.getRecord(elTargetRow);
// Set anchor
this._oAnchorRecord = oTargetRecord;
// Select only target
this.unselectAllRows();
this.selectRow(oTargetRecord);
}
} | [
"function",
"(",
"oArgs",
")",
"{",
"var",
"elTarget",
"=",
"oArgs",
".",
"target",
";",
"// Validate target row",
"var",
"elTargetRow",
"=",
"this",
".",
"getTrEl",
"(",
"elTarget",
")",
";",
"if",
"(",
"elTargetRow",
")",
"{",
"var",
"oTargetRecord",
"=",
"this",
".",
"getRecord",
"(",
"elTargetRow",
")",
";",
"// Set anchor",
"this",
".",
"_oAnchorRecord",
"=",
"oTargetRecord",
";",
"// Select only target",
"this",
".",
"unselectAllRows",
"(",
")",
";",
"this",
".",
"selectRow",
"(",
"oTargetRecord",
")",
";",
"}",
"}"
]
| Determines selection behavior resulting from a mouse event when selection mode
is set to "single".
@method _handleSingleSelectionByMouse
@param oArgs.event {HTMLEvent} Event object.
@param oArgs.target {HTMLElement} Target element.
@private | [
"Determines",
"selection",
"behavior",
"resulting",
"from",
"a",
"mouse",
"event",
"when",
"selection",
"mode",
"is",
"set",
"to",
"single",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L10254-L10269 |
|
42,535 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(e) {
var nKey = Ev.getCharCode(e);
if((nKey == 38) || (nKey == 40)) {
// Validate trigger
var oTrigger = this._getSelectionTrigger();
// Arrow selection only works if last selected row is on current page
if(!oTrigger) {
return null;
}
Ev.stopEvent(e);
// Determine the new row to select
var elNew;
if(nKey == 38) { // arrow up
elNew = this.getPreviousTrEl(oTrigger.el);
// Validate new row
if(elNew === null) {
//TODO: wrap around to last tr on current page
//elNew = this.getLastTrEl();
//TODO: wrap back to last tr of previous page
// Top row selection is sticky
elNew = this.getFirstTrEl();
}
}
else if(nKey == 40) { // arrow down
elNew = this.getNextTrEl(oTrigger.el);
// Validate new row
if(elNew === null) {
//TODO: wrap around to first tr on current page
//elNew = this.getFirstTrEl();
//TODO: wrap forward to first tr of previous page
// Bottom row selection is sticky
elNew = this.getLastTrEl();
}
}
// Unselect all rows
this.unselectAllRows();
// Select the new row
this.selectRow(elNew);
// Set new anchor
this._oAnchorRecord = this.getRecord(elNew);
}
} | javascript | function(e) {
var nKey = Ev.getCharCode(e);
if((nKey == 38) || (nKey == 40)) {
// Validate trigger
var oTrigger = this._getSelectionTrigger();
// Arrow selection only works if last selected row is on current page
if(!oTrigger) {
return null;
}
Ev.stopEvent(e);
// Determine the new row to select
var elNew;
if(nKey == 38) { // arrow up
elNew = this.getPreviousTrEl(oTrigger.el);
// Validate new row
if(elNew === null) {
//TODO: wrap around to last tr on current page
//elNew = this.getLastTrEl();
//TODO: wrap back to last tr of previous page
// Top row selection is sticky
elNew = this.getFirstTrEl();
}
}
else if(nKey == 40) { // arrow down
elNew = this.getNextTrEl(oTrigger.el);
// Validate new row
if(elNew === null) {
//TODO: wrap around to first tr on current page
//elNew = this.getFirstTrEl();
//TODO: wrap forward to first tr of previous page
// Bottom row selection is sticky
elNew = this.getLastTrEl();
}
}
// Unselect all rows
this.unselectAllRows();
// Select the new row
this.selectRow(elNew);
// Set new anchor
this._oAnchorRecord = this.getRecord(elNew);
}
} | [
"function",
"(",
"e",
")",
"{",
"var",
"nKey",
"=",
"Ev",
".",
"getCharCode",
"(",
"e",
")",
";",
"if",
"(",
"(",
"nKey",
"==",
"38",
")",
"||",
"(",
"nKey",
"==",
"40",
")",
")",
"{",
"// Validate trigger",
"var",
"oTrigger",
"=",
"this",
".",
"_getSelectionTrigger",
"(",
")",
";",
"// Arrow selection only works if last selected row is on current page",
"if",
"(",
"!",
"oTrigger",
")",
"{",
"return",
"null",
";",
"}",
"Ev",
".",
"stopEvent",
"(",
"e",
")",
";",
"// Determine the new row to select",
"var",
"elNew",
";",
"if",
"(",
"nKey",
"==",
"38",
")",
"{",
"// arrow up",
"elNew",
"=",
"this",
".",
"getPreviousTrEl",
"(",
"oTrigger",
".",
"el",
")",
";",
"// Validate new row",
"if",
"(",
"elNew",
"===",
"null",
")",
"{",
"//TODO: wrap around to last tr on current page",
"//elNew = this.getLastTrEl();",
"//TODO: wrap back to last tr of previous page",
"// Top row selection is sticky",
"elNew",
"=",
"this",
".",
"getFirstTrEl",
"(",
")",
";",
"}",
"}",
"else",
"if",
"(",
"nKey",
"==",
"40",
")",
"{",
"// arrow down",
"elNew",
"=",
"this",
".",
"getNextTrEl",
"(",
"oTrigger",
".",
"el",
")",
";",
"// Validate new row",
"if",
"(",
"elNew",
"===",
"null",
")",
"{",
"//TODO: wrap around to first tr on current page",
"//elNew = this.getFirstTrEl();",
"//TODO: wrap forward to first tr of previous page",
"// Bottom row selection is sticky",
"elNew",
"=",
"this",
".",
"getLastTrEl",
"(",
")",
";",
"}",
"}",
"// Unselect all rows",
"this",
".",
"unselectAllRows",
"(",
")",
";",
"// Select the new row",
"this",
".",
"selectRow",
"(",
"elNew",
")",
";",
"// Set new anchor",
"this",
".",
"_oAnchorRecord",
"=",
"this",
".",
"getRecord",
"(",
"elNew",
")",
";",
"}",
"}"
]
| Determines selection behavior resulting from a key event when selection mode
is set to "single".
@method _handleSingleSelectionByKey
@param e {HTMLEvent} Event object.
@private | [
"Determines",
"selection",
"behavior",
"resulting",
"from",
"a",
"key",
"event",
"when",
"selection",
"mode",
"is",
"set",
"to",
"single",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L10279-L10332 |
|
42,536 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oArgs) {
var elTarget = oArgs.target;
// Validate target cell
var elTargetCell = this.getTdEl(elTarget);
if(elTargetCell) {
var elTargetRow = this.getTrEl(elTargetCell);
var oTargetRecord = this.getRecord(elTargetRow);
var oTargetColumn = this.getColumn(elTargetCell);
var oTargetCell = {record:oTargetRecord, column:oTargetColumn};
// Set anchor
this._oAnchorCell = oTargetCell;
// Select only target
this.unselectAllCells();
this.selectCell(oTargetCell);
}
} | javascript | function(oArgs) {
var elTarget = oArgs.target;
// Validate target cell
var elTargetCell = this.getTdEl(elTarget);
if(elTargetCell) {
var elTargetRow = this.getTrEl(elTargetCell);
var oTargetRecord = this.getRecord(elTargetRow);
var oTargetColumn = this.getColumn(elTargetCell);
var oTargetCell = {record:oTargetRecord, column:oTargetColumn};
// Set anchor
this._oAnchorCell = oTargetCell;
// Select only target
this.unselectAllCells();
this.selectCell(oTargetCell);
}
} | [
"function",
"(",
"oArgs",
")",
"{",
"var",
"elTarget",
"=",
"oArgs",
".",
"target",
";",
"// Validate target cell",
"var",
"elTargetCell",
"=",
"this",
".",
"getTdEl",
"(",
"elTarget",
")",
";",
"if",
"(",
"elTargetCell",
")",
"{",
"var",
"elTargetRow",
"=",
"this",
".",
"getTrEl",
"(",
"elTargetCell",
")",
";",
"var",
"oTargetRecord",
"=",
"this",
".",
"getRecord",
"(",
"elTargetRow",
")",
";",
"var",
"oTargetColumn",
"=",
"this",
".",
"getColumn",
"(",
"elTargetCell",
")",
";",
"var",
"oTargetCell",
"=",
"{",
"record",
":",
"oTargetRecord",
",",
"column",
":",
"oTargetColumn",
"}",
";",
"// Set anchor",
"this",
".",
"_oAnchorCell",
"=",
"oTargetCell",
";",
"// Select only target",
"this",
".",
"unselectAllCells",
"(",
")",
";",
"this",
".",
"selectCell",
"(",
"oTargetCell",
")",
";",
"}",
"}"
]
| Determines selection behavior resulting from a mouse event when selection mode
is set to "singlecell".
@method _handleSingleCellSelectionByMouse
@param oArgs.event {HTMLEvent} Event object.
@param oArgs.target {HTMLElement} Target element.
@private | [
"Determines",
"selection",
"behavior",
"resulting",
"from",
"a",
"mouse",
"event",
"when",
"selection",
"mode",
"is",
"set",
"to",
"singlecell",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L11272-L11290 |
|
42,537 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(e) {
var nKey = Ev.getCharCode(e);
if((nKey == 9) || ((nKey > 36) && (nKey < 41))) {
var bSHIFT = e.shiftKey;
// Validate trigger
var oTrigger = this._getSelectionTrigger();
// Arrow selection only works if last selected row is on current page
if(!oTrigger) {
return null;
}
// Determine the new cell to select
var elNew;
if(nKey == 40) { // Arrow down
elNew = this.getBelowTdEl(oTrigger.el);
// Validate new cell
if(elNew === null) {
//TODO: wrap around to first tr on current page
//TODO: wrap forward to first tr of next page
// Bottom selection is sticky
elNew = oTrigger.el;
}
}
else if(nKey == 38) { // Arrow up
elNew = this.getAboveTdEl(oTrigger.el);
// Validate new cell
if(elNew === null) {
//TODO: wrap around to last tr on current page
//TODO: wrap back to last tr of previous page
// Top selection is sticky
elNew = oTrigger.el;
}
}
else if((nKey == 39) || (!bSHIFT && (nKey == 9))) { // Arrow right or tab
elNew = this.getNextTdEl(oTrigger.el);
// Validate new cell
if(elNew === null) {
//TODO: wrap around to first td on current page
//TODO: wrap forward to first td of next page
// Top-left selection is sticky, and release TAB focus
//elNew = oTrigger.el;
return;
}
}
else if((nKey == 37) || (bSHIFT && (nKey == 9))) { // Arrow left or shift-tab
elNew = this.getPreviousTdEl(oTrigger.el);
// Validate new cell
if(elNew === null) {
//TODO: wrap around to last td on current page
//TODO: wrap back to last td of previous page
// Bottom-right selection is sticky, and release TAB focus
//elNew = oTrigger.el;
return;
}
}
Ev.stopEvent(e);
// Unselect all cells
this.unselectAllCells();
// Select the new cell
this.selectCell(elNew);
// Set new anchor
this._oAnchorCell = {record:this.getRecord(elNew), column:this.getColumn(elNew)};
}
} | javascript | function(e) {
var nKey = Ev.getCharCode(e);
if((nKey == 9) || ((nKey > 36) && (nKey < 41))) {
var bSHIFT = e.shiftKey;
// Validate trigger
var oTrigger = this._getSelectionTrigger();
// Arrow selection only works if last selected row is on current page
if(!oTrigger) {
return null;
}
// Determine the new cell to select
var elNew;
if(nKey == 40) { // Arrow down
elNew = this.getBelowTdEl(oTrigger.el);
// Validate new cell
if(elNew === null) {
//TODO: wrap around to first tr on current page
//TODO: wrap forward to first tr of next page
// Bottom selection is sticky
elNew = oTrigger.el;
}
}
else if(nKey == 38) { // Arrow up
elNew = this.getAboveTdEl(oTrigger.el);
// Validate new cell
if(elNew === null) {
//TODO: wrap around to last tr on current page
//TODO: wrap back to last tr of previous page
// Top selection is sticky
elNew = oTrigger.el;
}
}
else if((nKey == 39) || (!bSHIFT && (nKey == 9))) { // Arrow right or tab
elNew = this.getNextTdEl(oTrigger.el);
// Validate new cell
if(elNew === null) {
//TODO: wrap around to first td on current page
//TODO: wrap forward to first td of next page
// Top-left selection is sticky, and release TAB focus
//elNew = oTrigger.el;
return;
}
}
else if((nKey == 37) || (bSHIFT && (nKey == 9))) { // Arrow left or shift-tab
elNew = this.getPreviousTdEl(oTrigger.el);
// Validate new cell
if(elNew === null) {
//TODO: wrap around to last td on current page
//TODO: wrap back to last td of previous page
// Bottom-right selection is sticky, and release TAB focus
//elNew = oTrigger.el;
return;
}
}
Ev.stopEvent(e);
// Unselect all cells
this.unselectAllCells();
// Select the new cell
this.selectCell(elNew);
// Set new anchor
this._oAnchorCell = {record:this.getRecord(elNew), column:this.getColumn(elNew)};
}
} | [
"function",
"(",
"e",
")",
"{",
"var",
"nKey",
"=",
"Ev",
".",
"getCharCode",
"(",
"e",
")",
";",
"if",
"(",
"(",
"nKey",
"==",
"9",
")",
"||",
"(",
"(",
"nKey",
">",
"36",
")",
"&&",
"(",
"nKey",
"<",
"41",
")",
")",
")",
"{",
"var",
"bSHIFT",
"=",
"e",
".",
"shiftKey",
";",
"// Validate trigger",
"var",
"oTrigger",
"=",
"this",
".",
"_getSelectionTrigger",
"(",
")",
";",
"// Arrow selection only works if last selected row is on current page",
"if",
"(",
"!",
"oTrigger",
")",
"{",
"return",
"null",
";",
"}",
"// Determine the new cell to select",
"var",
"elNew",
";",
"if",
"(",
"nKey",
"==",
"40",
")",
"{",
"// Arrow down",
"elNew",
"=",
"this",
".",
"getBelowTdEl",
"(",
"oTrigger",
".",
"el",
")",
";",
"// Validate new cell",
"if",
"(",
"elNew",
"===",
"null",
")",
"{",
"//TODO: wrap around to first tr on current page",
"//TODO: wrap forward to first tr of next page",
"// Bottom selection is sticky",
"elNew",
"=",
"oTrigger",
".",
"el",
";",
"}",
"}",
"else",
"if",
"(",
"nKey",
"==",
"38",
")",
"{",
"// Arrow up",
"elNew",
"=",
"this",
".",
"getAboveTdEl",
"(",
"oTrigger",
".",
"el",
")",
";",
"// Validate new cell",
"if",
"(",
"elNew",
"===",
"null",
")",
"{",
"//TODO: wrap around to last tr on current page",
"//TODO: wrap back to last tr of previous page",
"// Top selection is sticky",
"elNew",
"=",
"oTrigger",
".",
"el",
";",
"}",
"}",
"else",
"if",
"(",
"(",
"nKey",
"==",
"39",
")",
"||",
"(",
"!",
"bSHIFT",
"&&",
"(",
"nKey",
"==",
"9",
")",
")",
")",
"{",
"// Arrow right or tab",
"elNew",
"=",
"this",
".",
"getNextTdEl",
"(",
"oTrigger",
".",
"el",
")",
";",
"// Validate new cell",
"if",
"(",
"elNew",
"===",
"null",
")",
"{",
"//TODO: wrap around to first td on current page",
"//TODO: wrap forward to first td of next page",
"// Top-left selection is sticky, and release TAB focus",
"//elNew = oTrigger.el;",
"return",
";",
"}",
"}",
"else",
"if",
"(",
"(",
"nKey",
"==",
"37",
")",
"||",
"(",
"bSHIFT",
"&&",
"(",
"nKey",
"==",
"9",
")",
")",
")",
"{",
"// Arrow left or shift-tab",
"elNew",
"=",
"this",
".",
"getPreviousTdEl",
"(",
"oTrigger",
".",
"el",
")",
";",
"// Validate new cell",
"if",
"(",
"elNew",
"===",
"null",
")",
"{",
"//TODO: wrap around to last td on current page",
"//TODO: wrap back to last td of previous page",
"// Bottom-right selection is sticky, and release TAB focus",
"//elNew = oTrigger.el;",
"return",
";",
"}",
"}",
"Ev",
".",
"stopEvent",
"(",
"e",
")",
";",
"// Unselect all cells",
"this",
".",
"unselectAllCells",
"(",
")",
";",
"// Select the new cell",
"this",
".",
"selectCell",
"(",
"elNew",
")",
";",
"// Set new anchor",
"this",
".",
"_oAnchorCell",
"=",
"{",
"record",
":",
"this",
".",
"getRecord",
"(",
"elNew",
")",
",",
"column",
":",
"this",
".",
"getColumn",
"(",
"elNew",
")",
"}",
";",
"}",
"}"
]
| Determines selection behavior resulting from a key event when selection mode
is set to "singlecell".
@method _handleSingleCellSelectionByKey
@param e {HTMLEvent} Event object.
@private | [
"Determines",
"selection",
"behavior",
"resulting",
"from",
"a",
"key",
"event",
"when",
"selection",
"mode",
"is",
"set",
"to",
"singlecell",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L11300-L11380 |
|
42,538 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(row) {
var oRecord, elRow;
if(row instanceof YAHOO.widget.Record) {
oRecord = this._oRecordSet.getRecord(row);
elRow = this.getTrEl(oRecord);
}
else if(lang.isNumber(row)) {
oRecord = this.getRecord(row);
elRow = this.getTrEl(oRecord);
}
else {
elRow = this.getTrEl(row);
oRecord = this.getRecord(elRow);
}
if(oRecord) {
// Update selection trackers
var tracker = this._aSelections || [];
var sRecordId = oRecord.getId();
var index = -1;
// Remove if already there:
// Use Array.indexOf if available...
/*if(tracker.indexOf && (tracker.indexOf(sRecordId) > -1)) {
tracker.splice(tracker.indexOf(sRecordId),1);
}*/
if(tracker.indexOf) {
index = tracker.indexOf(sRecordId);
}
// ...or do it the old-fashioned way
else {
for(var j=tracker.length-1; j>-1; j--) {
if(tracker[j] === sRecordId){
index = j;
break;
}
}
}
if(index > -1) {
tracker.splice(index,1);
}
// Add to the end
tracker.push(sRecordId);
this._aSelections = tracker;
// Update trackers
if(!this._oAnchorRecord) {
this._oAnchorRecord = oRecord;
}
// Update UI
if(elRow) {
Dom.addClass(elRow, DT.CLASS_SELECTED);
}
this.fireEvent("rowSelectEvent", {record:oRecord, el:elRow});
}
else {
}
} | javascript | function(row) {
var oRecord, elRow;
if(row instanceof YAHOO.widget.Record) {
oRecord = this._oRecordSet.getRecord(row);
elRow = this.getTrEl(oRecord);
}
else if(lang.isNumber(row)) {
oRecord = this.getRecord(row);
elRow = this.getTrEl(oRecord);
}
else {
elRow = this.getTrEl(row);
oRecord = this.getRecord(elRow);
}
if(oRecord) {
// Update selection trackers
var tracker = this._aSelections || [];
var sRecordId = oRecord.getId();
var index = -1;
// Remove if already there:
// Use Array.indexOf if available...
/*if(tracker.indexOf && (tracker.indexOf(sRecordId) > -1)) {
tracker.splice(tracker.indexOf(sRecordId),1);
}*/
if(tracker.indexOf) {
index = tracker.indexOf(sRecordId);
}
// ...or do it the old-fashioned way
else {
for(var j=tracker.length-1; j>-1; j--) {
if(tracker[j] === sRecordId){
index = j;
break;
}
}
}
if(index > -1) {
tracker.splice(index,1);
}
// Add to the end
tracker.push(sRecordId);
this._aSelections = tracker;
// Update trackers
if(!this._oAnchorRecord) {
this._oAnchorRecord = oRecord;
}
// Update UI
if(elRow) {
Dom.addClass(elRow, DT.CLASS_SELECTED);
}
this.fireEvent("rowSelectEvent", {record:oRecord, el:elRow});
}
else {
}
} | [
"function",
"(",
"row",
")",
"{",
"var",
"oRecord",
",",
"elRow",
";",
"if",
"(",
"row",
"instanceof",
"YAHOO",
".",
"widget",
".",
"Record",
")",
"{",
"oRecord",
"=",
"this",
".",
"_oRecordSet",
".",
"getRecord",
"(",
"row",
")",
";",
"elRow",
"=",
"this",
".",
"getTrEl",
"(",
"oRecord",
")",
";",
"}",
"else",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"row",
")",
")",
"{",
"oRecord",
"=",
"this",
".",
"getRecord",
"(",
"row",
")",
";",
"elRow",
"=",
"this",
".",
"getTrEl",
"(",
"oRecord",
")",
";",
"}",
"else",
"{",
"elRow",
"=",
"this",
".",
"getTrEl",
"(",
"row",
")",
";",
"oRecord",
"=",
"this",
".",
"getRecord",
"(",
"elRow",
")",
";",
"}",
"if",
"(",
"oRecord",
")",
"{",
"// Update selection trackers",
"var",
"tracker",
"=",
"this",
".",
"_aSelections",
"||",
"[",
"]",
";",
"var",
"sRecordId",
"=",
"oRecord",
".",
"getId",
"(",
")",
";",
"var",
"index",
"=",
"-",
"1",
";",
"// Remove if already there:",
"// Use Array.indexOf if available...",
"/*if(tracker.indexOf && (tracker.indexOf(sRecordId) > -1)) {\n tracker.splice(tracker.indexOf(sRecordId),1);\n }*/",
"if",
"(",
"tracker",
".",
"indexOf",
")",
"{",
"index",
"=",
"tracker",
".",
"indexOf",
"(",
"sRecordId",
")",
";",
"}",
"// ...or do it the old-fashioned way",
"else",
"{",
"for",
"(",
"var",
"j",
"=",
"tracker",
".",
"length",
"-",
"1",
";",
"j",
">",
"-",
"1",
";",
"j",
"--",
")",
"{",
"if",
"(",
"tracker",
"[",
"j",
"]",
"===",
"sRecordId",
")",
"{",
"index",
"=",
"j",
";",
"break",
";",
"}",
"}",
"}",
"if",
"(",
"index",
">",
"-",
"1",
")",
"{",
"tracker",
".",
"splice",
"(",
"index",
",",
"1",
")",
";",
"}",
"// Add to the end",
"tracker",
".",
"push",
"(",
"sRecordId",
")",
";",
"this",
".",
"_aSelections",
"=",
"tracker",
";",
"// Update trackers",
"if",
"(",
"!",
"this",
".",
"_oAnchorRecord",
")",
"{",
"this",
".",
"_oAnchorRecord",
"=",
"oRecord",
";",
"}",
"// Update UI",
"if",
"(",
"elRow",
")",
"{",
"Dom",
".",
"addClass",
"(",
"elRow",
",",
"DT",
".",
"CLASS_SELECTED",
")",
";",
"}",
"this",
".",
"fireEvent",
"(",
"\"rowSelectEvent\"",
",",
"{",
"record",
":",
"oRecord",
",",
"el",
":",
"elRow",
"}",
")",
";",
"}",
"else",
"{",
"}",
"}"
]
| Sets given row to the selected state.
@method selectRow
@param row {HTMLElement | String | YAHOO.widget.Record | Number} HTML element
reference or ID string, Record instance, or RecordSet position index. | [
"Sets",
"given",
"row",
"to",
"the",
"selected",
"state",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L11399-L11461 |
|
42,539 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
// Remove all rows from tracker
var tracker = this._aSelections || [],
recId,
removed = [];
for(var j=tracker.length-1; j>-1; j--) {
if(lang.isString(tracker[j])){
recId = tracker.splice(j,1);
removed[removed.length] = this.getRecord(lang.isArray(recId) ? recId[0] : recId);
}
}
// Update tracker
this._aSelections = tracker;
// Update UI
this._unselectAllTrEls();
this.fireEvent("unselectAllRowsEvent", {records: removed});
} | javascript | function() {
// Remove all rows from tracker
var tracker = this._aSelections || [],
recId,
removed = [];
for(var j=tracker.length-1; j>-1; j--) {
if(lang.isString(tracker[j])){
recId = tracker.splice(j,1);
removed[removed.length] = this.getRecord(lang.isArray(recId) ? recId[0] : recId);
}
}
// Update tracker
this._aSelections = tracker;
// Update UI
this._unselectAllTrEls();
this.fireEvent("unselectAllRowsEvent", {records: removed});
} | [
"function",
"(",
")",
"{",
"// Remove all rows from tracker",
"var",
"tracker",
"=",
"this",
".",
"_aSelections",
"||",
"[",
"]",
",",
"recId",
",",
"removed",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"j",
"=",
"tracker",
".",
"length",
"-",
"1",
";",
"j",
">",
"-",
"1",
";",
"j",
"--",
")",
"{",
"if",
"(",
"lang",
".",
"isString",
"(",
"tracker",
"[",
"j",
"]",
")",
")",
"{",
"recId",
"=",
"tracker",
".",
"splice",
"(",
"j",
",",
"1",
")",
";",
"removed",
"[",
"removed",
".",
"length",
"]",
"=",
"this",
".",
"getRecord",
"(",
"lang",
".",
"isArray",
"(",
"recId",
")",
"?",
"recId",
"[",
"0",
"]",
":",
"recId",
")",
";",
"}",
"}",
"// Update tracker",
"this",
".",
"_aSelections",
"=",
"tracker",
";",
"// Update UI",
"this",
".",
"_unselectAllTrEls",
"(",
")",
";",
"this",
".",
"fireEvent",
"(",
"\"unselectAllRowsEvent\"",
",",
"{",
"records",
":",
"removed",
"}",
")",
";",
"}"
]
| Clears out all row selections.
@method unselectAllRows | [
"Clears",
"out",
"all",
"row",
"selections",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L11523-L11542 |
|
42,540 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var selectedCells = Dom.getElementsByClassName(DT.CLASS_SELECTED,"td",this._elTbody);
Dom.removeClass(selectedCells, DT.CLASS_SELECTED);
} | javascript | function() {
var selectedCells = Dom.getElementsByClassName(DT.CLASS_SELECTED,"td",this._elTbody);
Dom.removeClass(selectedCells, DT.CLASS_SELECTED);
} | [
"function",
"(",
")",
"{",
"var",
"selectedCells",
"=",
"Dom",
".",
"getElementsByClassName",
"(",
"DT",
".",
"CLASS_SELECTED",
",",
"\"td\"",
",",
"this",
".",
"_elTbody",
")",
";",
"Dom",
".",
"removeClass",
"(",
"selectedCells",
",",
"DT",
".",
"CLASS_SELECTED",
")",
";",
"}"
]
| Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED
from all TD elements in the internal tracker.
@method _unselectAllTdEls
@private | [
"Convenience",
"method",
"to",
"remove",
"the",
"class",
"YAHOO",
".",
"widget",
".",
"DataTable",
".",
"CLASS_SELECTED",
"from",
"all",
"TD",
"elements",
"in",
"the",
"internal",
"tracker",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L11551-L11554 |
|
42,541 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(cell) {
var elCell = this.getTdEl(cell);
if(elCell) {
var oRecord = this.getRecord(elCell);
var sColumnKey = this.getColumn(elCell.cellIndex).getKey();
if(oRecord && sColumnKey) {
// Get Record ID
var tracker = this._aSelections || [];
var id = oRecord.getId();
// Is it selected?
for(var j=tracker.length-1; j>-1; j--) {
if((tracker[j].recordId === id) && (tracker[j].columnKey === sColumnKey)){
// Remove from tracker
tracker.splice(j,1);
// Update tracker
this._aSelections = tracker;
// Update the UI
Dom.removeClass(elCell, DT.CLASS_SELECTED);
this.fireEvent("cellUnselectEvent", {record:oRecord, column: this.getColumn(elCell.cellIndex), key:this.getColumn(elCell.cellIndex).getKey(), el:elCell});
return;
}
}
}
}
} | javascript | function(cell) {
var elCell = this.getTdEl(cell);
if(elCell) {
var oRecord = this.getRecord(elCell);
var sColumnKey = this.getColumn(elCell.cellIndex).getKey();
if(oRecord && sColumnKey) {
// Get Record ID
var tracker = this._aSelections || [];
var id = oRecord.getId();
// Is it selected?
for(var j=tracker.length-1; j>-1; j--) {
if((tracker[j].recordId === id) && (tracker[j].columnKey === sColumnKey)){
// Remove from tracker
tracker.splice(j,1);
// Update tracker
this._aSelections = tracker;
// Update the UI
Dom.removeClass(elCell, DT.CLASS_SELECTED);
this.fireEvent("cellUnselectEvent", {record:oRecord, column: this.getColumn(elCell.cellIndex), key:this.getColumn(elCell.cellIndex).getKey(), el:elCell});
return;
}
}
}
}
} | [
"function",
"(",
"cell",
")",
"{",
"var",
"elCell",
"=",
"this",
".",
"getTdEl",
"(",
"cell",
")",
";",
"if",
"(",
"elCell",
")",
"{",
"var",
"oRecord",
"=",
"this",
".",
"getRecord",
"(",
"elCell",
")",
";",
"var",
"sColumnKey",
"=",
"this",
".",
"getColumn",
"(",
"elCell",
".",
"cellIndex",
")",
".",
"getKey",
"(",
")",
";",
"if",
"(",
"oRecord",
"&&",
"sColumnKey",
")",
"{",
"// Get Record ID",
"var",
"tracker",
"=",
"this",
".",
"_aSelections",
"||",
"[",
"]",
";",
"var",
"id",
"=",
"oRecord",
".",
"getId",
"(",
")",
";",
"// Is it selected?",
"for",
"(",
"var",
"j",
"=",
"tracker",
".",
"length",
"-",
"1",
";",
"j",
">",
"-",
"1",
";",
"j",
"--",
")",
"{",
"if",
"(",
"(",
"tracker",
"[",
"j",
"]",
".",
"recordId",
"===",
"id",
")",
"&&",
"(",
"tracker",
"[",
"j",
"]",
".",
"columnKey",
"===",
"sColumnKey",
")",
")",
"{",
"// Remove from tracker",
"tracker",
".",
"splice",
"(",
"j",
",",
"1",
")",
";",
"// Update tracker",
"this",
".",
"_aSelections",
"=",
"tracker",
";",
"// Update the UI",
"Dom",
".",
"removeClass",
"(",
"elCell",
",",
"DT",
".",
"CLASS_SELECTED",
")",
";",
"this",
".",
"fireEvent",
"(",
"\"cellUnselectEvent\"",
",",
"{",
"record",
":",
"oRecord",
",",
"column",
":",
"this",
".",
"getColumn",
"(",
"elCell",
".",
"cellIndex",
")",
",",
"key",
":",
"this",
".",
"getColumn",
"(",
"elCell",
".",
"cellIndex",
")",
".",
"getKey",
"(",
")",
",",
"el",
":",
"elCell",
"}",
")",
";",
"return",
";",
"}",
"}",
"}",
"}",
"}"
]
| Sets given cell to the unselected state.
@method unselectCell
@param cell {HTMLElement | String} DOM element reference or ID string
to DataTable page element or RecordSet index. | [
"Sets",
"given",
"cell",
"to",
"the",
"unselected",
"state",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L11619-L11649 |
|
42,542 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(o) {
if(o && (o.ownerDocument == document)) {
return (Dom.hasClass(this.getTdEl(o),DT.CLASS_SELECTED) || Dom.hasClass(this.getTrEl(o),DT.CLASS_SELECTED));
}
else {
var oRecord, sRecordId, j;
var tracker = this._aSelections;
if(tracker && tracker.length > 0) {
// Looking for a Record?
if(o instanceof YAHOO.widget.Record) {
oRecord = o;
}
else if(lang.isNumber(o)) {
oRecord = this.getRecord(o);
}
if(oRecord) {
sRecordId = oRecord.getId();
// Is it there?
// Use Array.indexOf if available...
if(tracker.indexOf) {
if(tracker.indexOf(sRecordId) > -1) {
return true;
}
}
// ...or do it the old-fashioned way
else {
for(j=tracker.length-1; j>-1; j--) {
if(tracker[j] === sRecordId){
return true;
}
}
}
}
// Looking for a cell
else if(o.record && o.column){
sRecordId = o.record.getId();
var sColumnKey = o.column.getKey();
for(j=tracker.length-1; j>-1; j--) {
if((tracker[j].recordId === sRecordId) && (tracker[j].columnKey === sColumnKey)){
return true;
}
}
}
}
}
return false;
} | javascript | function(o) {
if(o && (o.ownerDocument == document)) {
return (Dom.hasClass(this.getTdEl(o),DT.CLASS_SELECTED) || Dom.hasClass(this.getTrEl(o),DT.CLASS_SELECTED));
}
else {
var oRecord, sRecordId, j;
var tracker = this._aSelections;
if(tracker && tracker.length > 0) {
// Looking for a Record?
if(o instanceof YAHOO.widget.Record) {
oRecord = o;
}
else if(lang.isNumber(o)) {
oRecord = this.getRecord(o);
}
if(oRecord) {
sRecordId = oRecord.getId();
// Is it there?
// Use Array.indexOf if available...
if(tracker.indexOf) {
if(tracker.indexOf(sRecordId) > -1) {
return true;
}
}
// ...or do it the old-fashioned way
else {
for(j=tracker.length-1; j>-1; j--) {
if(tracker[j] === sRecordId){
return true;
}
}
}
}
// Looking for a cell
else if(o.record && o.column){
sRecordId = o.record.getId();
var sColumnKey = o.column.getKey();
for(j=tracker.length-1; j>-1; j--) {
if((tracker[j].recordId === sRecordId) && (tracker[j].columnKey === sColumnKey)){
return true;
}
}
}
}
}
return false;
} | [
"function",
"(",
"o",
")",
"{",
"if",
"(",
"o",
"&&",
"(",
"o",
".",
"ownerDocument",
"==",
"document",
")",
")",
"{",
"return",
"(",
"Dom",
".",
"hasClass",
"(",
"this",
".",
"getTdEl",
"(",
"o",
")",
",",
"DT",
".",
"CLASS_SELECTED",
")",
"||",
"Dom",
".",
"hasClass",
"(",
"this",
".",
"getTrEl",
"(",
"o",
")",
",",
"DT",
".",
"CLASS_SELECTED",
")",
")",
";",
"}",
"else",
"{",
"var",
"oRecord",
",",
"sRecordId",
",",
"j",
";",
"var",
"tracker",
"=",
"this",
".",
"_aSelections",
";",
"if",
"(",
"tracker",
"&&",
"tracker",
".",
"length",
">",
"0",
")",
"{",
"// Looking for a Record?",
"if",
"(",
"o",
"instanceof",
"YAHOO",
".",
"widget",
".",
"Record",
")",
"{",
"oRecord",
"=",
"o",
";",
"}",
"else",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"o",
")",
")",
"{",
"oRecord",
"=",
"this",
".",
"getRecord",
"(",
"o",
")",
";",
"}",
"if",
"(",
"oRecord",
")",
"{",
"sRecordId",
"=",
"oRecord",
".",
"getId",
"(",
")",
";",
"// Is it there?",
"// Use Array.indexOf if available...",
"if",
"(",
"tracker",
".",
"indexOf",
")",
"{",
"if",
"(",
"tracker",
".",
"indexOf",
"(",
"sRecordId",
")",
">",
"-",
"1",
")",
"{",
"return",
"true",
";",
"}",
"}",
"// ...or do it the old-fashioned way",
"else",
"{",
"for",
"(",
"j",
"=",
"tracker",
".",
"length",
"-",
"1",
";",
"j",
">",
"-",
"1",
";",
"j",
"--",
")",
"{",
"if",
"(",
"tracker",
"[",
"j",
"]",
"===",
"sRecordId",
")",
"{",
"return",
"true",
";",
"}",
"}",
"}",
"}",
"// Looking for a cell",
"else",
"if",
"(",
"o",
".",
"record",
"&&",
"o",
".",
"column",
")",
"{",
"sRecordId",
"=",
"o",
".",
"record",
".",
"getId",
"(",
")",
";",
"var",
"sColumnKey",
"=",
"o",
".",
"column",
".",
"getKey",
"(",
")",
";",
"for",
"(",
"j",
"=",
"tracker",
".",
"length",
"-",
"1",
";",
"j",
">",
"-",
"1",
";",
"j",
"--",
")",
"{",
"if",
"(",
"(",
"tracker",
"[",
"j",
"]",
".",
"recordId",
"===",
"sRecordId",
")",
"&&",
"(",
"tracker",
"[",
"j",
"]",
".",
"columnKey",
"===",
"sColumnKey",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"}",
"}",
"}",
"return",
"false",
";",
"}"
]
| Returns true if given item is selected, false otherwise.
@method isSelected
@param o {String | HTMLElement | YAHOO.widget.Record | Number
{record:YAHOO.widget.Record, column:YAHOO.widget.Column} } TR or TD element by
reference or ID string, a Record instance, a RecordSet position index,
or an object literal representation
of a cell.
@return {Boolean} True if item is selected. | [
"Returns",
"true",
"if",
"given",
"item",
"is",
"selected",
"false",
"otherwise",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L11686-L11734 |
|
42,543 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var aSelectedRows = [];
var tracker = this._aSelections || [];
for(var j=0; j<tracker.length; j++) {
if(lang.isString(tracker[j])){
aSelectedRows.push(tracker[j]);
}
}
return aSelectedRows;
} | javascript | function() {
var aSelectedRows = [];
var tracker = this._aSelections || [];
for(var j=0; j<tracker.length; j++) {
if(lang.isString(tracker[j])){
aSelectedRows.push(tracker[j]);
}
}
return aSelectedRows;
} | [
"function",
"(",
")",
"{",
"var",
"aSelectedRows",
"=",
"[",
"]",
";",
"var",
"tracker",
"=",
"this",
".",
"_aSelections",
"||",
"[",
"]",
";",
"for",
"(",
"var",
"j",
"=",
"0",
";",
"j",
"<",
"tracker",
".",
"length",
";",
"j",
"++",
")",
"{",
"if",
"(",
"lang",
".",
"isString",
"(",
"tracker",
"[",
"j",
"]",
")",
")",
"{",
"aSelectedRows",
".",
"push",
"(",
"tracker",
"[",
"j",
"]",
")",
";",
"}",
"}",
"return",
"aSelectedRows",
";",
"}"
]
| Returns selected rows as an array of Record IDs.
@method getSelectedRows
@return {String[]} Array of selected rows by Record ID. | [
"Returns",
"selected",
"rows",
"as",
"an",
"array",
"of",
"Record",
"IDs",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L11742-L11751 |
|
42,544 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var tracker = this._aSelections;
if(tracker && tracker.length > 0) {
for(var i=tracker.length-1; i>-1; i--) {
if(lang.isString(tracker[i])){
return tracker[i];
}
}
}
} | javascript | function() {
var tracker = this._aSelections;
if(tracker && tracker.length > 0) {
for(var i=tracker.length-1; i>-1; i--) {
if(lang.isString(tracker[i])){
return tracker[i];
}
}
}
} | [
"function",
"(",
")",
"{",
"var",
"tracker",
"=",
"this",
".",
"_aSelections",
";",
"if",
"(",
"tracker",
"&&",
"tracker",
".",
"length",
">",
"0",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"tracker",
".",
"length",
"-",
"1",
";",
"i",
">",
"-",
"1",
";",
"i",
"--",
")",
"{",
"if",
"(",
"lang",
".",
"isString",
"(",
"tracker",
"[",
"i",
"]",
")",
")",
"{",
"return",
"tracker",
"[",
"i",
"]",
";",
"}",
"}",
"}",
"}"
]
| Returns last selected Record ID.
@method getLastSelectedRecord
@return {String} Record ID of last selected row. | [
"Returns",
"last",
"selected",
"Record",
"ID",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L11777-L11786 |
|
42,545 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(row) {
var elRow = this.getTrEl(row);
if(elRow) {
var oRecord = this.getRecord(elRow);
Dom.removeClass(elRow,DT.CLASS_HIGHLIGHTED);
this.fireEvent("rowUnhighlightEvent", {record:oRecord, el:elRow});
return;
}
} | javascript | function(row) {
var elRow = this.getTrEl(row);
if(elRow) {
var oRecord = this.getRecord(elRow);
Dom.removeClass(elRow,DT.CLASS_HIGHLIGHTED);
this.fireEvent("rowUnhighlightEvent", {record:oRecord, el:elRow});
return;
}
} | [
"function",
"(",
"row",
")",
"{",
"var",
"elRow",
"=",
"this",
".",
"getTrEl",
"(",
"row",
")",
";",
"if",
"(",
"elRow",
")",
"{",
"var",
"oRecord",
"=",
"this",
".",
"getRecord",
"(",
"elRow",
")",
";",
"Dom",
".",
"removeClass",
"(",
"elRow",
",",
"DT",
".",
"CLASS_HIGHLIGHTED",
")",
";",
"this",
".",
"fireEvent",
"(",
"\"rowUnhighlightEvent\"",
",",
"{",
"record",
":",
"oRecord",
",",
"el",
":",
"elRow",
"}",
")",
";",
"return",
";",
"}",
"}"
]
| Removes the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED from the given row.
@method unhighlightRow
@param row {HTMLElement | String} DOM element reference or ID string. | [
"Removes",
"the",
"class",
"YAHOO",
".",
"widget",
".",
"DataTable",
".",
"CLASS_HIGHLIGHTED",
"from",
"the",
"given",
"row",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L11834-L11843 |
|
42,546 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(cell) {
var elCell = this.getTdEl(cell);
if(elCell) {
// Make sure previous cell is unhighlighted
if(this._elLastHighlightedTd) {
this.unhighlightCell(this._elLastHighlightedTd);
}
var oRecord = this.getRecord(elCell);
var sColumnKey = this.getColumn(elCell.cellIndex).getKey();
Dom.addClass(elCell,DT.CLASS_HIGHLIGHTED);
this._elLastHighlightedTd = elCell;
this.fireEvent("cellHighlightEvent", {record:oRecord, column:this.getColumn(elCell.cellIndex), key:this.getColumn(elCell.cellIndex).getKey(), el:elCell});
return;
}
} | javascript | function(cell) {
var elCell = this.getTdEl(cell);
if(elCell) {
// Make sure previous cell is unhighlighted
if(this._elLastHighlightedTd) {
this.unhighlightCell(this._elLastHighlightedTd);
}
var oRecord = this.getRecord(elCell);
var sColumnKey = this.getColumn(elCell.cellIndex).getKey();
Dom.addClass(elCell,DT.CLASS_HIGHLIGHTED);
this._elLastHighlightedTd = elCell;
this.fireEvent("cellHighlightEvent", {record:oRecord, column:this.getColumn(elCell.cellIndex), key:this.getColumn(elCell.cellIndex).getKey(), el:elCell});
return;
}
} | [
"function",
"(",
"cell",
")",
"{",
"var",
"elCell",
"=",
"this",
".",
"getTdEl",
"(",
"cell",
")",
";",
"if",
"(",
"elCell",
")",
"{",
"// Make sure previous cell is unhighlighted",
"if",
"(",
"this",
".",
"_elLastHighlightedTd",
")",
"{",
"this",
".",
"unhighlightCell",
"(",
"this",
".",
"_elLastHighlightedTd",
")",
";",
"}",
"var",
"oRecord",
"=",
"this",
".",
"getRecord",
"(",
"elCell",
")",
";",
"var",
"sColumnKey",
"=",
"this",
".",
"getColumn",
"(",
"elCell",
".",
"cellIndex",
")",
".",
"getKey",
"(",
")",
";",
"Dom",
".",
"addClass",
"(",
"elCell",
",",
"DT",
".",
"CLASS_HIGHLIGHTED",
")",
";",
"this",
".",
"_elLastHighlightedTd",
"=",
"elCell",
";",
"this",
".",
"fireEvent",
"(",
"\"cellHighlightEvent\"",
",",
"{",
"record",
":",
"oRecord",
",",
"column",
":",
"this",
".",
"getColumn",
"(",
"elCell",
".",
"cellIndex",
")",
",",
"key",
":",
"this",
".",
"getColumn",
"(",
"elCell",
".",
"cellIndex",
")",
".",
"getKey",
"(",
")",
",",
"el",
":",
"elCell",
"}",
")",
";",
"return",
";",
"}",
"}"
]
| Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to the given cell.
@method highlightCell
@param cell {HTMLElement | String} DOM element reference or ID string. | [
"Assigns",
"the",
"class",
"YAHOO",
".",
"widget",
".",
"DataTable",
".",
"CLASS_HIGHLIGHTED",
"to",
"the",
"given",
"cell",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L11851-L11867 |
|
42,547 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
// Attach Cell Editor container element as first child of body
var elCellEditor = document.createElement("div");
elCellEditor.id = this._sId + "-celleditor";
elCellEditor.style.display = "none";
elCellEditor.tabIndex = 0;
Dom.addClass(elCellEditor, DT.CLASS_EDITOR);
var elFirstChild = Dom.getFirstChild(document.body);
if(elFirstChild) {
elCellEditor = Dom.insertBefore(elCellEditor, elFirstChild);
}
else {
elCellEditor = document.body.appendChild(elCellEditor);
}
// Internal tracker of Cell Editor values
var oCellEditor = {};
oCellEditor.container = elCellEditor;
oCellEditor.value = null;
oCellEditor.isActive = false;
this._oCellEditor = oCellEditor;
} | javascript | function() {
// Attach Cell Editor container element as first child of body
var elCellEditor = document.createElement("div");
elCellEditor.id = this._sId + "-celleditor";
elCellEditor.style.display = "none";
elCellEditor.tabIndex = 0;
Dom.addClass(elCellEditor, DT.CLASS_EDITOR);
var elFirstChild = Dom.getFirstChild(document.body);
if(elFirstChild) {
elCellEditor = Dom.insertBefore(elCellEditor, elFirstChild);
}
else {
elCellEditor = document.body.appendChild(elCellEditor);
}
// Internal tracker of Cell Editor values
var oCellEditor = {};
oCellEditor.container = elCellEditor;
oCellEditor.value = null;
oCellEditor.isActive = false;
this._oCellEditor = oCellEditor;
} | [
"function",
"(",
")",
"{",
"// Attach Cell Editor container element as first child of body",
"var",
"elCellEditor",
"=",
"document",
".",
"createElement",
"(",
"\"div\"",
")",
";",
"elCellEditor",
".",
"id",
"=",
"this",
".",
"_sId",
"+",
"\"-celleditor\"",
";",
"elCellEditor",
".",
"style",
".",
"display",
"=",
"\"none\"",
";",
"elCellEditor",
".",
"tabIndex",
"=",
"0",
";",
"Dom",
".",
"addClass",
"(",
"elCellEditor",
",",
"DT",
".",
"CLASS_EDITOR",
")",
";",
"var",
"elFirstChild",
"=",
"Dom",
".",
"getFirstChild",
"(",
"document",
".",
"body",
")",
";",
"if",
"(",
"elFirstChild",
")",
"{",
"elCellEditor",
"=",
"Dom",
".",
"insertBefore",
"(",
"elCellEditor",
",",
"elFirstChild",
")",
";",
"}",
"else",
"{",
"elCellEditor",
"=",
"document",
".",
"body",
".",
"appendChild",
"(",
"elCellEditor",
")",
";",
"}",
"// Internal tracker of Cell Editor values",
"var",
"oCellEditor",
"=",
"{",
"}",
";",
"oCellEditor",
".",
"container",
"=",
"elCellEditor",
";",
"oCellEditor",
".",
"value",
"=",
"null",
";",
"oCellEditor",
".",
"isActive",
"=",
"false",
";",
"this",
".",
"_oCellEditor",
"=",
"oCellEditor",
";",
"}"
]
| Backward compatibility.
@method _initCellEditorEl
@private
@deprecated | [
"Backward",
"compatibility",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12106-L12127 |
|
42,548 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
if(this._oCellEditor) {
if(this._oCellEditor.save) {
this._oCellEditor.save();
}
// Backward compatibility
else if(this._oCellEditor.isActive) {
var newData = this._oCellEditor.value;
// Copy the data to pass to the event
//var oldData = YAHOO.widget.DataTable._cloneObject(this._oCellEditor.record.getData(this._oCellEditor.column.key));
var oldData = this._oCellEditor.record.getData(this._oCellEditor.column.key);
// Validate input data
if(this._oCellEditor.validator) {
newData = this._oCellEditor.value = this._oCellEditor.validator.call(this, newData, oldData, this._oCellEditor);
if(newData === null ) {
this.resetCellEditor();
this.fireEvent("editorRevertEvent",
{editor:this._oCellEditor, oldData:oldData, newData:newData});
return;
}
}
// Update the Record
this._oRecordSet.updateRecordValue(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);
// Update the UI
this.formatCell(this._oCellEditor.cell.firstChild);
// Bug fix 1764044
this._oChainRender.add({
method: function() {
this.validateColumnWidths();
},
scope: this
});
this._oChainRender.run();
// Clear out the Cell Editor
this.resetCellEditor();
this.fireEvent("editorSaveEvent",
{editor:this._oCellEditor, oldData:oldData, newData:newData});
}
}
} | javascript | function() {
if(this._oCellEditor) {
if(this._oCellEditor.save) {
this._oCellEditor.save();
}
// Backward compatibility
else if(this._oCellEditor.isActive) {
var newData = this._oCellEditor.value;
// Copy the data to pass to the event
//var oldData = YAHOO.widget.DataTable._cloneObject(this._oCellEditor.record.getData(this._oCellEditor.column.key));
var oldData = this._oCellEditor.record.getData(this._oCellEditor.column.key);
// Validate input data
if(this._oCellEditor.validator) {
newData = this._oCellEditor.value = this._oCellEditor.validator.call(this, newData, oldData, this._oCellEditor);
if(newData === null ) {
this.resetCellEditor();
this.fireEvent("editorRevertEvent",
{editor:this._oCellEditor, oldData:oldData, newData:newData});
return;
}
}
// Update the Record
this._oRecordSet.updateRecordValue(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);
// Update the UI
this.formatCell(this._oCellEditor.cell.firstChild);
// Bug fix 1764044
this._oChainRender.add({
method: function() {
this.validateColumnWidths();
},
scope: this
});
this._oChainRender.run();
// Clear out the Cell Editor
this.resetCellEditor();
this.fireEvent("editorSaveEvent",
{editor:this._oCellEditor, oldData:oldData, newData:newData});
}
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_oCellEditor",
")",
"{",
"if",
"(",
"this",
".",
"_oCellEditor",
".",
"save",
")",
"{",
"this",
".",
"_oCellEditor",
".",
"save",
"(",
")",
";",
"}",
"// Backward compatibility",
"else",
"if",
"(",
"this",
".",
"_oCellEditor",
".",
"isActive",
")",
"{",
"var",
"newData",
"=",
"this",
".",
"_oCellEditor",
".",
"value",
";",
"// Copy the data to pass to the event",
"//var oldData = YAHOO.widget.DataTable._cloneObject(this._oCellEditor.record.getData(this._oCellEditor.column.key));",
"var",
"oldData",
"=",
"this",
".",
"_oCellEditor",
".",
"record",
".",
"getData",
"(",
"this",
".",
"_oCellEditor",
".",
"column",
".",
"key",
")",
";",
"// Validate input data",
"if",
"(",
"this",
".",
"_oCellEditor",
".",
"validator",
")",
"{",
"newData",
"=",
"this",
".",
"_oCellEditor",
".",
"value",
"=",
"this",
".",
"_oCellEditor",
".",
"validator",
".",
"call",
"(",
"this",
",",
"newData",
",",
"oldData",
",",
"this",
".",
"_oCellEditor",
")",
";",
"if",
"(",
"newData",
"===",
"null",
")",
"{",
"this",
".",
"resetCellEditor",
"(",
")",
";",
"this",
".",
"fireEvent",
"(",
"\"editorRevertEvent\"",
",",
"{",
"editor",
":",
"this",
".",
"_oCellEditor",
",",
"oldData",
":",
"oldData",
",",
"newData",
":",
"newData",
"}",
")",
";",
"return",
";",
"}",
"}",
"// Update the Record",
"this",
".",
"_oRecordSet",
".",
"updateRecordValue",
"(",
"this",
".",
"_oCellEditor",
".",
"record",
",",
"this",
".",
"_oCellEditor",
".",
"column",
".",
"key",
",",
"this",
".",
"_oCellEditor",
".",
"value",
")",
";",
"// Update the UI",
"this",
".",
"formatCell",
"(",
"this",
".",
"_oCellEditor",
".",
"cell",
".",
"firstChild",
")",
";",
"// Bug fix 1764044",
"this",
".",
"_oChainRender",
".",
"add",
"(",
"{",
"method",
":",
"function",
"(",
")",
"{",
"this",
".",
"validateColumnWidths",
"(",
")",
";",
"}",
",",
"scope",
":",
"this",
"}",
")",
";",
"this",
".",
"_oChainRender",
".",
"run",
"(",
")",
";",
"// Clear out the Cell Editor",
"this",
".",
"resetCellEditor",
"(",
")",
";",
"this",
".",
"fireEvent",
"(",
"\"editorSaveEvent\"",
",",
"{",
"editor",
":",
"this",
".",
"_oCellEditor",
",",
"oldData",
":",
"oldData",
",",
"newData",
":",
"newData",
"}",
")",
";",
"}",
"}",
"}"
]
| Saves active CellEditor input to Record and upates DOM UI.
@method saveCellEditor | [
"Saves",
"active",
"CellEditor",
"input",
"to",
"Record",
"and",
"upates",
"DOM",
"UI",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12145-L12187 |
|
42,549 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oArgs) {
if(oArgs.editor.disableBtns) {
// Save on blur
if(oArgs.editor.save) { // Backward incompatible
oArgs.editor.save();
}
}
else if(oArgs.editor.cancel) { // Backward incompatible
// Cancel on blur
oArgs.editor.cancel();
}
} | javascript | function(oArgs) {
if(oArgs.editor.disableBtns) {
// Save on blur
if(oArgs.editor.save) { // Backward incompatible
oArgs.editor.save();
}
}
else if(oArgs.editor.cancel) { // Backward incompatible
// Cancel on blur
oArgs.editor.cancel();
}
} | [
"function",
"(",
"oArgs",
")",
"{",
"if",
"(",
"oArgs",
".",
"editor",
".",
"disableBtns",
")",
"{",
"// Save on blur",
"if",
"(",
"oArgs",
".",
"editor",
".",
"save",
")",
"{",
"// Backward incompatible",
"oArgs",
".",
"editor",
".",
"save",
"(",
")",
";",
"}",
"}",
"else",
"if",
"(",
"oArgs",
".",
"editor",
".",
"cancel",
")",
"{",
"// Backward incompatible",
"// Cancel on blur",
"oArgs",
".",
"editor",
".",
"cancel",
"(",
")",
";",
"}",
"}"
]
| Public handler of the editorBlurEvent. By default, saves on blur if
disableBtns is true, otherwise cancels on blur.
@method onEditorBlurEvent
@param oArgs {Object} Custom Event args. | [
"Public",
"handler",
"of",
"the",
"editorBlurEvent",
".",
"By",
"default",
"saves",
"on",
"blur",
"if",
"disableBtns",
"is",
"true",
"otherwise",
"cancels",
"on",
"blur",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12316-L12327 |
|
42,550 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oArgs) {
//TODO: filter for all spurious events at a lower level
if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
this.highlightColumn(oArgs.target);
}
} | javascript | function(oArgs) {
//TODO: filter for all spurious events at a lower level
if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
this.highlightColumn(oArgs.target);
}
} | [
"function",
"(",
"oArgs",
")",
"{",
"//TODO: filter for all spurious events at a lower level",
"if",
"(",
"!",
"Dom",
".",
"isAncestor",
"(",
"oArgs",
".",
"target",
",",
"Ev",
".",
"getRelatedTarget",
"(",
"oArgs",
".",
"event",
")",
")",
")",
"{",
"this",
".",
"highlightColumn",
"(",
"oArgs",
".",
"target",
")",
";",
"}",
"}"
]
| Overridable custom event handler to highlight Column. Accounts for spurious
caused-by-child events.
@method onEventHighlightColumn
@param oArgs.event {HTMLEvent} Event object.
@param oArgs.target {HTMLElement} Target element. | [
"Overridable",
"custom",
"event",
"handler",
"to",
"highlight",
"Column",
".",
"Accounts",
"for",
"spurious",
"caused",
"-",
"by",
"-",
"child",
"events",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12514-L12519 |
|
42,551 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oArgs) {
//TODO: filter for all spurious events at a lower level
if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
this.unhighlightColumn(oArgs.target);
}
} | javascript | function(oArgs) {
//TODO: filter for all spurious events at a lower level
if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
this.unhighlightColumn(oArgs.target);
}
} | [
"function",
"(",
"oArgs",
")",
"{",
"//TODO: filter for all spurious events at a lower level",
"if",
"(",
"!",
"Dom",
".",
"isAncestor",
"(",
"oArgs",
".",
"target",
",",
"Ev",
".",
"getRelatedTarget",
"(",
"oArgs",
".",
"event",
")",
")",
")",
"{",
"this",
".",
"unhighlightColumn",
"(",
"oArgs",
".",
"target",
")",
";",
"}",
"}"
]
| Overridable custom event handler to unhighlight Column. Accounts for spurious
caused-by-child events.
@method onEventUnhighlightColumn
@param oArgs.event {HTMLEvent} Event object.
@param oArgs.target {HTMLElement} Target element. | [
"Overridable",
"custom",
"event",
"handler",
"to",
"unhighlight",
"Column",
".",
"Accounts",
"for",
"spurious",
"caused",
"-",
"by",
"-",
"child",
"events",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12529-L12534 |
|
42,552 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oArgs) {
var sMode = this.get("selectionMode");
if(sMode == "cellblock") {
this._handleCellBlockSelectionByMouse(oArgs);
}
else if(sMode == "cellrange") {
this._handleCellRangeSelectionByMouse(oArgs);
}
else {
this._handleSingleCellSelectionByMouse(oArgs);
}
} | javascript | function(oArgs) {
var sMode = this.get("selectionMode");
if(sMode == "cellblock") {
this._handleCellBlockSelectionByMouse(oArgs);
}
else if(sMode == "cellrange") {
this._handleCellRangeSelectionByMouse(oArgs);
}
else {
this._handleSingleCellSelectionByMouse(oArgs);
}
} | [
"function",
"(",
"oArgs",
")",
"{",
"var",
"sMode",
"=",
"this",
".",
"get",
"(",
"\"selectionMode\"",
")",
";",
"if",
"(",
"sMode",
"==",
"\"cellblock\"",
")",
"{",
"this",
".",
"_handleCellBlockSelectionByMouse",
"(",
"oArgs",
")",
";",
"}",
"else",
"if",
"(",
"sMode",
"==",
"\"cellrange\"",
")",
"{",
"this",
".",
"_handleCellRangeSelectionByMouse",
"(",
"oArgs",
")",
";",
"}",
"else",
"{",
"this",
".",
"_handleSingleCellSelectionByMouse",
"(",
"oArgs",
")",
";",
"}",
"}"
]
| Overridable custom event handler to select cell.
@method onEventSelectCell
@param oArgs.event {HTMLEvent} Event object.
@param oArgs.target {HTMLElement} Target element. | [
"Overridable",
"custom",
"event",
"handler",
"to",
"select",
"cell",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12560-L12571 |
|
42,553 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oArgs) {
//TODO: filter for all spurious events at a lower level
if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
this.highlightRow(oArgs.target);
}
} | javascript | function(oArgs) {
//TODO: filter for all spurious events at a lower level
if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
this.highlightRow(oArgs.target);
}
} | [
"function",
"(",
"oArgs",
")",
"{",
"//TODO: filter for all spurious events at a lower level",
"if",
"(",
"!",
"Dom",
".",
"isAncestor",
"(",
"oArgs",
".",
"target",
",",
"Ev",
".",
"getRelatedTarget",
"(",
"oArgs",
".",
"event",
")",
")",
")",
"{",
"this",
".",
"highlightRow",
"(",
"oArgs",
".",
"target",
")",
";",
"}",
"}"
]
| Overridable custom event handler to highlight row. Accounts for spurious
caused-by-child events.
@method onEventHighlightRow
@param oArgs.event {HTMLEvent} Event object.
@param oArgs.target {HTMLElement} Target element. | [
"Overridable",
"custom",
"event",
"handler",
"to",
"highlight",
"row",
".",
"Accounts",
"for",
"spurious",
"caused",
"-",
"by",
"-",
"child",
"events",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12581-L12586 |
|
42,554 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oArgs) {
//TODO: filter for all spurious events at a lower level
if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
this.unhighlightRow(oArgs.target);
}
} | javascript | function(oArgs) {
//TODO: filter for all spurious events at a lower level
if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
this.unhighlightRow(oArgs.target);
}
} | [
"function",
"(",
"oArgs",
")",
"{",
"//TODO: filter for all spurious events at a lower level",
"if",
"(",
"!",
"Dom",
".",
"isAncestor",
"(",
"oArgs",
".",
"target",
",",
"Ev",
".",
"getRelatedTarget",
"(",
"oArgs",
".",
"event",
")",
")",
")",
"{",
"this",
".",
"unhighlightRow",
"(",
"oArgs",
".",
"target",
")",
";",
"}",
"}"
]
| Overridable custom event handler to unhighlight row. Accounts for spurious
caused-by-child events.
@method onEventUnhighlightRow
@param oArgs.event {HTMLEvent} Event object.
@param oArgs.target {HTMLElement} Target element. | [
"Overridable",
"custom",
"event",
"handler",
"to",
"unhighlight",
"row",
".",
"Accounts",
"for",
"spurious",
"caused",
"-",
"by",
"-",
"child",
"events",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12596-L12601 |
|
42,555 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oArgs) {
//TODO: filter for all spurious events at a lower level
if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
this.highlightCell(oArgs.target);
}
} | javascript | function(oArgs) {
//TODO: filter for all spurious events at a lower level
if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
this.highlightCell(oArgs.target);
}
} | [
"function",
"(",
"oArgs",
")",
"{",
"//TODO: filter for all spurious events at a lower level",
"if",
"(",
"!",
"Dom",
".",
"isAncestor",
"(",
"oArgs",
".",
"target",
",",
"Ev",
".",
"getRelatedTarget",
"(",
"oArgs",
".",
"event",
")",
")",
")",
"{",
"this",
".",
"highlightCell",
"(",
"oArgs",
".",
"target",
")",
";",
"}",
"}"
]
| Overridable custom event handler to highlight cell. Accounts for spurious
caused-by-child events.
@method onEventHighlightCell
@param oArgs.event {HTMLEvent} Event object.
@param oArgs.target {HTMLElement} Target element. | [
"Overridable",
"custom",
"event",
"handler",
"to",
"highlight",
"cell",
".",
"Accounts",
"for",
"spurious",
"caused",
"-",
"by",
"-",
"child",
"events",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12611-L12616 |
|
42,556 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oArgs) {
//TODO: filter for all spurious events at a lower level
if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
this.unhighlightCell(oArgs.target);
}
} | javascript | function(oArgs) {
//TODO: filter for all spurious events at a lower level
if(!Dom.isAncestor(oArgs.target,Ev.getRelatedTarget(oArgs.event))) {
this.unhighlightCell(oArgs.target);
}
} | [
"function",
"(",
"oArgs",
")",
"{",
"//TODO: filter for all spurious events at a lower level",
"if",
"(",
"!",
"Dom",
".",
"isAncestor",
"(",
"oArgs",
".",
"target",
",",
"Ev",
".",
"getRelatedTarget",
"(",
"oArgs",
".",
"event",
")",
")",
")",
"{",
"this",
".",
"unhighlightCell",
"(",
"oArgs",
".",
"target",
")",
";",
"}",
"}"
]
| Overridable custom event handler to unhighlight cell. Accounts for spurious
caused-by-child events.
@method onEventUnhighlightCell
@param oArgs.event {HTMLEvent} Event object.
@param oArgs.target {HTMLElement} Target element. | [
"Overridable",
"custom",
"event",
"handler",
"to",
"unhighlight",
"cell",
".",
"Accounts",
"for",
"spurious",
"caused",
"-",
"by",
"-",
"child",
"events",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12626-L12631 |
|
42,557 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(sRequest, oResponse, oPayload) {
if((this instanceof DT) && this._sId) {
this.initializeTable();
this.onDataReturnSetRows(sRequest,oResponse,oPayload);
}
} | javascript | function(sRequest, oResponse, oPayload) {
if((this instanceof DT) && this._sId) {
this.initializeTable();
this.onDataReturnSetRows(sRequest,oResponse,oPayload);
}
} | [
"function",
"(",
"sRequest",
",",
"oResponse",
",",
"oPayload",
")",
"{",
"if",
"(",
"(",
"this",
"instanceof",
"DT",
")",
"&&",
"this",
".",
"_sId",
")",
"{",
"this",
".",
"initializeTable",
"(",
")",
";",
"this",
".",
"onDataReturnSetRows",
"(",
"sRequest",
",",
"oResponse",
",",
"oPayload",
")",
";",
"}",
"}"
]
| Callback function receives data from DataSource and populates an entire
DataTable with Records and TR elements, clearing previous Records, if any.
@method onDataReturnInitializeTable
@param sRequest {String} Original request.
@param oResponse {Object} Response object.
@param oPayload {MIXED} (optional) Additional argument(s) | [
"Callback",
"function",
"receives",
"data",
"from",
"DataSource",
"and",
"populates",
"an",
"entire",
"DataTable",
"with",
"Records",
"and",
"TR",
"elements",
"clearing",
"previous",
"Records",
"if",
"any",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12706-L12712 |
|
42,558 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(sRequest, oResponse, oPayload) {
if((this instanceof DT) && this._sId) {
this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse,payload:oPayload});
// Pass data through abstract method for any transformations
var ok = this.doBeforeLoadData(sRequest, oResponse, oPayload);
// Data ok to append
if(ok && oResponse && !oResponse.error && lang.isArray(oResponse.results)) {
// Append rows
this.addRows(oResponse.results);
// Update state
this._handleDataReturnPayload(sRequest, oResponse, oPayload);
}
// Error
else if(ok && oResponse.error) {
this.showTableMessage(this.get("MSG_ERROR"), DT.CLASS_ERROR);
}
}
} | javascript | function(sRequest, oResponse, oPayload) {
if((this instanceof DT) && this._sId) {
this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse,payload:oPayload});
// Pass data through abstract method for any transformations
var ok = this.doBeforeLoadData(sRequest, oResponse, oPayload);
// Data ok to append
if(ok && oResponse && !oResponse.error && lang.isArray(oResponse.results)) {
// Append rows
this.addRows(oResponse.results);
// Update state
this._handleDataReturnPayload(sRequest, oResponse, oPayload);
}
// Error
else if(ok && oResponse.error) {
this.showTableMessage(this.get("MSG_ERROR"), DT.CLASS_ERROR);
}
}
} | [
"function",
"(",
"sRequest",
",",
"oResponse",
",",
"oPayload",
")",
"{",
"if",
"(",
"(",
"this",
"instanceof",
"DT",
")",
"&&",
"this",
".",
"_sId",
")",
"{",
"this",
".",
"fireEvent",
"(",
"\"dataReturnEvent\"",
",",
"{",
"request",
":",
"sRequest",
",",
"response",
":",
"oResponse",
",",
"payload",
":",
"oPayload",
"}",
")",
";",
"// Pass data through abstract method for any transformations",
"var",
"ok",
"=",
"this",
".",
"doBeforeLoadData",
"(",
"sRequest",
",",
"oResponse",
",",
"oPayload",
")",
";",
"// Data ok to append",
"if",
"(",
"ok",
"&&",
"oResponse",
"&&",
"!",
"oResponse",
".",
"error",
"&&",
"lang",
".",
"isArray",
"(",
"oResponse",
".",
"results",
")",
")",
"{",
"// Append rows",
"this",
".",
"addRows",
"(",
"oResponse",
".",
"results",
")",
";",
"// Update state",
"this",
".",
"_handleDataReturnPayload",
"(",
"sRequest",
",",
"oResponse",
",",
"oPayload",
")",
";",
"}",
"// Error",
"else",
"if",
"(",
"ok",
"&&",
"oResponse",
".",
"error",
")",
"{",
"this",
".",
"showTableMessage",
"(",
"this",
".",
"get",
"(",
"\"MSG_ERROR\"",
")",
",",
"DT",
".",
"CLASS_ERROR",
")",
";",
"}",
"}",
"}"
]
| Callback function receives data from DataSource and appends to an existing
DataTable new Records and, if applicable, creates or updates
corresponding TR elements.
@method onDataReturnAppendRows
@param sRequest {String} Original request.
@param oResponse {Object} Response object.
@param oPayload {MIXED} (optional) Additional argument(s) | [
"Callback",
"function",
"receives",
"data",
"from",
"DataSource",
"and",
"appends",
"to",
"an",
"existing",
"DataTable",
"new",
"Records",
"and",
"if",
"applicable",
"creates",
"or",
"updates",
"corresponding",
"TR",
"elements",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12772-L12792 |
|
42,559 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oRequest, oResponse, oPayload) {
if((this instanceof DT) && this._sId) {
this.fireEvent("dataReturnEvent", {request:oRequest,response:oResponse,payload:oPayload});
// Pass data through abstract method for any transformations
var ok = this.doBeforeLoadData(oRequest, oResponse, oPayload),
pag = this.get('paginator'),
index = 0;
// Data ok to set
if(ok && oResponse && !oResponse.error && lang.isArray(oResponse.results)) {
// Update Records
if (this.get('dynamicData')) {
if (oPayload && oPayload.pagination &&
lang.isNumber(oPayload.pagination.recordOffset)) {
index = oPayload.pagination.recordOffset;
} else if (pag) {
index = pag.getStartIndex();
}
this._oRecordSet.reset(); // Bug 2290604: dyanmic data shouldn't keep accumulating by default
}
this._oRecordSet.setRecords(oResponse.results, index | 0);
// Update state
this._handleDataReturnPayload(oRequest, oResponse, oPayload);
// Update UI
this.render();
}
// Error
else if(ok && oResponse.error) {
this.showTableMessage(this.get("MSG_ERROR"), DT.CLASS_ERROR);
}
}
else {
}
} | javascript | function(oRequest, oResponse, oPayload) {
if((this instanceof DT) && this._sId) {
this.fireEvent("dataReturnEvent", {request:oRequest,response:oResponse,payload:oPayload});
// Pass data through abstract method for any transformations
var ok = this.doBeforeLoadData(oRequest, oResponse, oPayload),
pag = this.get('paginator'),
index = 0;
// Data ok to set
if(ok && oResponse && !oResponse.error && lang.isArray(oResponse.results)) {
// Update Records
if (this.get('dynamicData')) {
if (oPayload && oPayload.pagination &&
lang.isNumber(oPayload.pagination.recordOffset)) {
index = oPayload.pagination.recordOffset;
} else if (pag) {
index = pag.getStartIndex();
}
this._oRecordSet.reset(); // Bug 2290604: dyanmic data shouldn't keep accumulating by default
}
this._oRecordSet.setRecords(oResponse.results, index | 0);
// Update state
this._handleDataReturnPayload(oRequest, oResponse, oPayload);
// Update UI
this.render();
}
// Error
else if(ok && oResponse.error) {
this.showTableMessage(this.get("MSG_ERROR"), DT.CLASS_ERROR);
}
}
else {
}
} | [
"function",
"(",
"oRequest",
",",
"oResponse",
",",
"oPayload",
")",
"{",
"if",
"(",
"(",
"this",
"instanceof",
"DT",
")",
"&&",
"this",
".",
"_sId",
")",
"{",
"this",
".",
"fireEvent",
"(",
"\"dataReturnEvent\"",
",",
"{",
"request",
":",
"oRequest",
",",
"response",
":",
"oResponse",
",",
"payload",
":",
"oPayload",
"}",
")",
";",
"// Pass data through abstract method for any transformations",
"var",
"ok",
"=",
"this",
".",
"doBeforeLoadData",
"(",
"oRequest",
",",
"oResponse",
",",
"oPayload",
")",
",",
"pag",
"=",
"this",
".",
"get",
"(",
"'paginator'",
")",
",",
"index",
"=",
"0",
";",
"// Data ok to set",
"if",
"(",
"ok",
"&&",
"oResponse",
"&&",
"!",
"oResponse",
".",
"error",
"&&",
"lang",
".",
"isArray",
"(",
"oResponse",
".",
"results",
")",
")",
"{",
"// Update Records",
"if",
"(",
"this",
".",
"get",
"(",
"'dynamicData'",
")",
")",
"{",
"if",
"(",
"oPayload",
"&&",
"oPayload",
".",
"pagination",
"&&",
"lang",
".",
"isNumber",
"(",
"oPayload",
".",
"pagination",
".",
"recordOffset",
")",
")",
"{",
"index",
"=",
"oPayload",
".",
"pagination",
".",
"recordOffset",
";",
"}",
"else",
"if",
"(",
"pag",
")",
"{",
"index",
"=",
"pag",
".",
"getStartIndex",
"(",
")",
";",
"}",
"this",
".",
"_oRecordSet",
".",
"reset",
"(",
")",
";",
"// Bug 2290604: dyanmic data shouldn't keep accumulating by default",
"}",
"this",
".",
"_oRecordSet",
".",
"setRecords",
"(",
"oResponse",
".",
"results",
",",
"index",
"|",
"0",
")",
";",
"// Update state",
"this",
".",
"_handleDataReturnPayload",
"(",
"oRequest",
",",
"oResponse",
",",
"oPayload",
")",
";",
"// Update UI",
"this",
".",
"render",
"(",
")",
";",
"}",
"// Error",
"else",
"if",
"(",
"ok",
"&&",
"oResponse",
".",
"error",
")",
"{",
"this",
".",
"showTableMessage",
"(",
"this",
".",
"get",
"(",
"\"MSG_ERROR\"",
")",
",",
"DT",
".",
"CLASS_ERROR",
")",
";",
"}",
"}",
"else",
"{",
"}",
"}"
]
| Callback function receives reponse from DataSource and populates the
RecordSet with the results.
@method onDataReturnSetRows
@param oRequest {MIXED} Original generated request.
@param oResponse {Object} Response object.
@param oPayload {MIXED} (optional) Additional argument(s) | [
"Callback",
"function",
"receives",
"reponse",
"from",
"DataSource",
"and",
"populates",
"the",
"RecordSet",
"with",
"the",
"results",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L12871-L12909 |
|
42,560 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(elContainer) {
Dom.removeClass(elContainer, DT.CLASS_SCROLLABLE);
SDT.superclass._destroyContainerEl.call(this, elContainer);
this._elHdContainer = null;
this._elBdContainer = null;
} | javascript | function(elContainer) {
Dom.removeClass(elContainer, DT.CLASS_SCROLLABLE);
SDT.superclass._destroyContainerEl.call(this, elContainer);
this._elHdContainer = null;
this._elBdContainer = null;
} | [
"function",
"(",
"elContainer",
")",
"{",
"Dom",
".",
"removeClass",
"(",
"elContainer",
",",
"DT",
".",
"CLASS_SCROLLABLE",
")",
";",
"SDT",
".",
"superclass",
".",
"_destroyContainerEl",
".",
"call",
"(",
"this",
",",
"elContainer",
")",
";",
"this",
".",
"_elHdContainer",
"=",
"null",
";",
"this",
".",
"_elBdContainer",
"=",
"null",
";",
"}"
]
| Destroy's the DataTable outer and inner container elements, if available.
@method _destroyContainerEl
@param elContainer {HTMLElement} Reference to the container element.
@private | [
"Destroy",
"s",
"the",
"DataTable",
"outer",
"and",
"inner",
"container",
"elements",
"if",
"available",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14325-L14330 |
|
42,561 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(elContainer) {
SDT.superclass._initContainerEl.call(this, elContainer);
if(this._elContainer) {
elContainer = this._elContainer; // was constructor input, now is DOM ref
Dom.addClass(elContainer, DT.CLASS_SCROLLABLE);
// Container for header TABLE
var elHdContainer = document.createElement("div");
elHdContainer.style.width = this.get("width") || "";
elHdContainer.style.backgroundColor = this.get("COLOR_COLUMNFILLER");
Dom.addClass(elHdContainer, SDT.CLASS_HEADER);
this._elHdContainer = elHdContainer;
elContainer.appendChild(elHdContainer);
// Container for body TABLE
var elBdContainer = document.createElement("div");
elBdContainer.style.width = this.get("width") || "";
elBdContainer.style.height = this.get("height") || "";
Dom.addClass(elBdContainer, SDT.CLASS_BODY);
Ev.addListener(elBdContainer, "scroll", this._onScroll, this); // to sync horiz scroll headers
this._elBdContainer = elBdContainer;
elContainer.appendChild(elBdContainer);
}
} | javascript | function(elContainer) {
SDT.superclass._initContainerEl.call(this, elContainer);
if(this._elContainer) {
elContainer = this._elContainer; // was constructor input, now is DOM ref
Dom.addClass(elContainer, DT.CLASS_SCROLLABLE);
// Container for header TABLE
var elHdContainer = document.createElement("div");
elHdContainer.style.width = this.get("width") || "";
elHdContainer.style.backgroundColor = this.get("COLOR_COLUMNFILLER");
Dom.addClass(elHdContainer, SDT.CLASS_HEADER);
this._elHdContainer = elHdContainer;
elContainer.appendChild(elHdContainer);
// Container for body TABLE
var elBdContainer = document.createElement("div");
elBdContainer.style.width = this.get("width") || "";
elBdContainer.style.height = this.get("height") || "";
Dom.addClass(elBdContainer, SDT.CLASS_BODY);
Ev.addListener(elBdContainer, "scroll", this._onScroll, this); // to sync horiz scroll headers
this._elBdContainer = elBdContainer;
elContainer.appendChild(elBdContainer);
}
} | [
"function",
"(",
"elContainer",
")",
"{",
"SDT",
".",
"superclass",
".",
"_initContainerEl",
".",
"call",
"(",
"this",
",",
"elContainer",
")",
";",
"if",
"(",
"this",
".",
"_elContainer",
")",
"{",
"elContainer",
"=",
"this",
".",
"_elContainer",
";",
"// was constructor input, now is DOM ref",
"Dom",
".",
"addClass",
"(",
"elContainer",
",",
"DT",
".",
"CLASS_SCROLLABLE",
")",
";",
"// Container for header TABLE",
"var",
"elHdContainer",
"=",
"document",
".",
"createElement",
"(",
"\"div\"",
")",
";",
"elHdContainer",
".",
"style",
".",
"width",
"=",
"this",
".",
"get",
"(",
"\"width\"",
")",
"||",
"\"\"",
";",
"elHdContainer",
".",
"style",
".",
"backgroundColor",
"=",
"this",
".",
"get",
"(",
"\"COLOR_COLUMNFILLER\"",
")",
";",
"Dom",
".",
"addClass",
"(",
"elHdContainer",
",",
"SDT",
".",
"CLASS_HEADER",
")",
";",
"this",
".",
"_elHdContainer",
"=",
"elHdContainer",
";",
"elContainer",
".",
"appendChild",
"(",
"elHdContainer",
")",
";",
"// Container for body TABLE",
"var",
"elBdContainer",
"=",
"document",
".",
"createElement",
"(",
"\"div\"",
")",
";",
"elBdContainer",
".",
"style",
".",
"width",
"=",
"this",
".",
"get",
"(",
"\"width\"",
")",
"||",
"\"\"",
";",
"elBdContainer",
".",
"style",
".",
"height",
"=",
"this",
".",
"get",
"(",
"\"height\"",
")",
"||",
"\"\"",
";",
"Dom",
".",
"addClass",
"(",
"elBdContainer",
",",
"SDT",
".",
"CLASS_BODY",
")",
";",
"Ev",
".",
"addListener",
"(",
"elBdContainer",
",",
"\"scroll\"",
",",
"this",
".",
"_onScroll",
",",
"this",
")",
";",
"// to sync horiz scroll headers",
"this",
".",
"_elBdContainer",
"=",
"elBdContainer",
";",
"elContainer",
".",
"appendChild",
"(",
"elBdContainer",
")",
";",
"}",
"}"
]
| Initializes the DataTable outer container element and creates inner header
and body container elements.
@method _initContainerEl
@param elContainer {HTMLElement | String} HTML DIV element by reference or ID.
@private | [
"Initializes",
"the",
"DataTable",
"outer",
"container",
"element",
"and",
"creates",
"inner",
"header",
"and",
"body",
"container",
"elements",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14340-L14364 |
|
42,562 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var elTable = this._elHdTable;
if(elTable) {
Ev.purgeElement(elTable, true);
elTable.parentNode.removeChild(elTable);
// A little out of place, but where else can we null out these extra elements?
///this._elBdColgroup = null;
this._elBdThead = null;
}
} | javascript | function() {
var elTable = this._elHdTable;
if(elTable) {
Ev.purgeElement(elTable, true);
elTable.parentNode.removeChild(elTable);
// A little out of place, but where else can we null out these extra elements?
///this._elBdColgroup = null;
this._elBdThead = null;
}
} | [
"function",
"(",
")",
"{",
"var",
"elTable",
"=",
"this",
".",
"_elHdTable",
";",
"if",
"(",
"elTable",
")",
"{",
"Ev",
".",
"purgeElement",
"(",
"elTable",
",",
"true",
")",
";",
"elTable",
".",
"parentNode",
".",
"removeChild",
"(",
"elTable",
")",
";",
"// A little out of place, but where else can we null out these extra elements?",
"///this._elBdColgroup = null;",
"this",
".",
"_elBdThead",
"=",
"null",
";",
"}",
"}"
]
| Destroy's the DataTable head TABLE element, if available.
@method _destroyHdTableEl
@private | [
"Destroy",
"s",
"the",
"DataTable",
"head",
"TABLE",
"element",
"if",
"available",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14394-L14404 |
|
42,563 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(elHdTable, elTable) {
elHdTable = elHdTable || this._elHdTable;
elTable = elTable || this._elTable;
// Scrolling body's THEAD
this._initBdTheadEl(elTable);
// Standard fixed head THEAD
SDT.superclass._initTheadEl.call(this, elHdTable);
} | javascript | function(elHdTable, elTable) {
elHdTable = elHdTable || this._elHdTable;
elTable = elTable || this._elTable;
// Scrolling body's THEAD
this._initBdTheadEl(elTable);
// Standard fixed head THEAD
SDT.superclass._initTheadEl.call(this, elHdTable);
} | [
"function",
"(",
"elHdTable",
",",
"elTable",
")",
"{",
"elHdTable",
"=",
"elHdTable",
"||",
"this",
".",
"_elHdTable",
";",
"elTable",
"=",
"elTable",
"||",
"this",
".",
"_elTable",
";",
"// Scrolling body's THEAD",
"this",
".",
"_initBdTheadEl",
"(",
"elTable",
")",
";",
"// Standard fixed head THEAD",
"SDT",
".",
"superclass",
".",
"_initTheadEl",
".",
"call",
"(",
"this",
",",
"elHdTable",
")",
";",
"}"
]
| Initializes ScrollingDataTable THEAD elements into the two inner containers.
@method _initTheadEl
@param elHdTable {HTMLElement} (optional) Fixed header TABLE element reference.
@param elTable {HTMLElement} (optional) TABLE element reference.
@private | [
"Initializes",
"ScrollingDataTable",
"THEAD",
"elements",
"into",
"the",
"two",
"inner",
"containers",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14432-L14440 |
|
42,564 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(elTh, oColumn) {
SDT.superclass._initThEl.call(this, elTh, oColumn);
elTh.id = this.getId() +"-fixedth-" + oColumn.getSanitizedKey(); // Needed for getColumn by TH and ColumnDD
} | javascript | function(elTh, oColumn) {
SDT.superclass._initThEl.call(this, elTh, oColumn);
elTh.id = this.getId() +"-fixedth-" + oColumn.getSanitizedKey(); // Needed for getColumn by TH and ColumnDD
} | [
"function",
"(",
"elTh",
",",
"oColumn",
")",
"{",
"SDT",
".",
"superclass",
".",
"_initThEl",
".",
"call",
"(",
"this",
",",
"elTh",
",",
"oColumn",
")",
";",
"elTh",
".",
"id",
"=",
"this",
".",
"getId",
"(",
")",
"+",
"\"-fixedth-\"",
"+",
"oColumn",
".",
"getSanitizedKey",
"(",
")",
";",
"// Needed for getColumn by TH and ColumnDD",
"}"
]
| SDT changes ID so as not to duplicate the accessibility TH IDs.
@method _initThEl
@param elTh {HTMLElement} TH element reference.
@param oColumn {YAHOO.widget.Column} Column object.
@private | [
"SDT",
"changes",
"ID",
"so",
"as",
"not",
"to",
"duplicate",
"the",
"accessibility",
"TH",
"IDs",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14450-L14453 |
|
42,565 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var elBdThead = this._elBdThead;
if(elBdThead) {
var elTable = elBdThead.parentNode;
Ev.purgeElement(elBdThead, true);
elTable.removeChild(elBdThead);
this._elBdThead = null;
this._destroyColumnHelpers();
}
} | javascript | function() {
var elBdThead = this._elBdThead;
if(elBdThead) {
var elTable = elBdThead.parentNode;
Ev.purgeElement(elBdThead, true);
elTable.removeChild(elBdThead);
this._elBdThead = null;
this._destroyColumnHelpers();
}
} | [
"function",
"(",
")",
"{",
"var",
"elBdThead",
"=",
"this",
".",
"_elBdThead",
";",
"if",
"(",
"elBdThead",
")",
"{",
"var",
"elTable",
"=",
"elBdThead",
".",
"parentNode",
";",
"Ev",
".",
"purgeElement",
"(",
"elBdThead",
",",
"true",
")",
";",
"elTable",
".",
"removeChild",
"(",
"elBdThead",
")",
";",
"this",
".",
"_elBdThead",
"=",
"null",
";",
"this",
".",
"_destroyColumnHelpers",
"(",
")",
";",
"}",
"}"
]
| Destroy's the DataTable body THEAD element, if available.
@method _destroyBdTheadEl
@private | [
"Destroy",
"s",
"the",
"DataTable",
"body",
"THEAD",
"element",
"if",
"available",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14461-L14471 |
|
42,566 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(elTable) {
if(elTable) {
// Destroy previous
this._destroyBdTheadEl();
var elThead = elTable.insertBefore(document.createElement("thead"), elTable.firstChild);
// Add TRs to the THEAD;
var oColumnSet = this._oColumnSet,
colTree = oColumnSet.tree,
elTh, elTheadTr, oColumn, i, j, k, len;
for(i=0, k=colTree.length; i<k; i++) {
elTheadTr = elThead.appendChild(document.createElement("tr"));
// ...and create TH cells
for(j=0, len=colTree[i].length; j<len; j++) {
oColumn = colTree[i][j];
elTh = elTheadTr.appendChild(document.createElement("th"));
this._initBdThEl(elTh,oColumn,i,j);
}
}
this._elBdThead = elThead;
}
} | javascript | function(elTable) {
if(elTable) {
// Destroy previous
this._destroyBdTheadEl();
var elThead = elTable.insertBefore(document.createElement("thead"), elTable.firstChild);
// Add TRs to the THEAD;
var oColumnSet = this._oColumnSet,
colTree = oColumnSet.tree,
elTh, elTheadTr, oColumn, i, j, k, len;
for(i=0, k=colTree.length; i<k; i++) {
elTheadTr = elThead.appendChild(document.createElement("tr"));
// ...and create TH cells
for(j=0, len=colTree[i].length; j<len; j++) {
oColumn = colTree[i][j];
elTh = elTheadTr.appendChild(document.createElement("th"));
this._initBdThEl(elTh,oColumn,i,j);
}
}
this._elBdThead = elThead;
}
} | [
"function",
"(",
"elTable",
")",
"{",
"if",
"(",
"elTable",
")",
"{",
"// Destroy previous",
"this",
".",
"_destroyBdTheadEl",
"(",
")",
";",
"var",
"elThead",
"=",
"elTable",
".",
"insertBefore",
"(",
"document",
".",
"createElement",
"(",
"\"thead\"",
")",
",",
"elTable",
".",
"firstChild",
")",
";",
"// Add TRs to the THEAD;",
"var",
"oColumnSet",
"=",
"this",
".",
"_oColumnSet",
",",
"colTree",
"=",
"oColumnSet",
".",
"tree",
",",
"elTh",
",",
"elTheadTr",
",",
"oColumn",
",",
"i",
",",
"j",
",",
"k",
",",
"len",
";",
"for",
"(",
"i",
"=",
"0",
",",
"k",
"=",
"colTree",
".",
"length",
";",
"i",
"<",
"k",
";",
"i",
"++",
")",
"{",
"elTheadTr",
"=",
"elThead",
".",
"appendChild",
"(",
"document",
".",
"createElement",
"(",
"\"tr\"",
")",
")",
";",
"// ...and create TH cells",
"for",
"(",
"j",
"=",
"0",
",",
"len",
"=",
"colTree",
"[",
"i",
"]",
".",
"length",
";",
"j",
"<",
"len",
";",
"j",
"++",
")",
"{",
"oColumn",
"=",
"colTree",
"[",
"i",
"]",
"[",
"j",
"]",
";",
"elTh",
"=",
"elTheadTr",
".",
"appendChild",
"(",
"document",
".",
"createElement",
"(",
"\"th\"",
")",
")",
";",
"this",
".",
"_initBdThEl",
"(",
"elTh",
",",
"oColumn",
",",
"i",
",",
"j",
")",
";",
"}",
"}",
"this",
".",
"_elBdThead",
"=",
"elThead",
";",
"}",
"}"
]
| Initializes body THEAD element.
@method _initBdTheadEl
@param elTable {HTMLElement} TABLE element into which to create THEAD.
@return {HTMLElement} Initialized THEAD element.
@private | [
"Initializes",
"body",
"THEAD",
"element",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14481-L14505 |
|
42,567 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(elTh, oColumn) {
elTh.id = this.getId()+"-th-" + oColumn.getSanitizedKey(); // Needed for accessibility
elTh.rowSpan = oColumn.getRowspan();
elTh.colSpan = oColumn.getColspan();
// Assign abbr attribute
if(oColumn.abbr) {
elTh.abbr = oColumn.abbr;
}
// TODO: strip links and form elements
var sKey = oColumn.getKey();
var sLabel = lang.isValue(oColumn.label) ? oColumn.label : sKey;
elTh.innerHTML = sLabel;
} | javascript | function(elTh, oColumn) {
elTh.id = this.getId()+"-th-" + oColumn.getSanitizedKey(); // Needed for accessibility
elTh.rowSpan = oColumn.getRowspan();
elTh.colSpan = oColumn.getColspan();
// Assign abbr attribute
if(oColumn.abbr) {
elTh.abbr = oColumn.abbr;
}
// TODO: strip links and form elements
var sKey = oColumn.getKey();
var sLabel = lang.isValue(oColumn.label) ? oColumn.label : sKey;
elTh.innerHTML = sLabel;
} | [
"function",
"(",
"elTh",
",",
"oColumn",
")",
"{",
"elTh",
".",
"id",
"=",
"this",
".",
"getId",
"(",
")",
"+",
"\"-th-\"",
"+",
"oColumn",
".",
"getSanitizedKey",
"(",
")",
";",
"// Needed for accessibility",
"elTh",
".",
"rowSpan",
"=",
"oColumn",
".",
"getRowspan",
"(",
")",
";",
"elTh",
".",
"colSpan",
"=",
"oColumn",
".",
"getColspan",
"(",
")",
";",
"// Assign abbr attribute",
"if",
"(",
"oColumn",
".",
"abbr",
")",
"{",
"elTh",
".",
"abbr",
"=",
"oColumn",
".",
"abbr",
";",
"}",
"// TODO: strip links and form elements",
"var",
"sKey",
"=",
"oColumn",
".",
"getKey",
"(",
")",
";",
"var",
"sLabel",
"=",
"lang",
".",
"isValue",
"(",
"oColumn",
".",
"label",
")",
"?",
"oColumn",
".",
"label",
":",
"sKey",
";",
"elTh",
".",
"innerHTML",
"=",
"sLabel",
";",
"}"
]
| Populates TH element for the body THEAD element.
@method _initBdThEl
@param elTh {HTMLElement} TH element reference.
@param oColumn {YAHOO.widget.Column} Column object.
@private | [
"Populates",
"TH",
"element",
"for",
"the",
"body",
"THEAD",
"element",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14515-L14528 |
|
42,568 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(elTable) {
SDT.superclass._initTbodyEl.call(this, elTable);
// Bug 2105534 - Safari 3 gap
// Bug 2492591 - IE8 offsetTop
elTable.style.marginTop = (this._elTbody.offsetTop > 0) ?
"-"+this._elTbody.offsetTop+"px" : 0;
} | javascript | function(elTable) {
SDT.superclass._initTbodyEl.call(this, elTable);
// Bug 2105534 - Safari 3 gap
// Bug 2492591 - IE8 offsetTop
elTable.style.marginTop = (this._elTbody.offsetTop > 0) ?
"-"+this._elTbody.offsetTop+"px" : 0;
} | [
"function",
"(",
"elTable",
")",
"{",
"SDT",
".",
"superclass",
".",
"_initTbodyEl",
".",
"call",
"(",
"this",
",",
"elTable",
")",
";",
"// Bug 2105534 - Safari 3 gap",
"// Bug 2492591 - IE8 offsetTop",
"elTable",
".",
"style",
".",
"marginTop",
"=",
"(",
"this",
".",
"_elTbody",
".",
"offsetTop",
">",
"0",
")",
"?",
"\"-\"",
"+",
"this",
".",
"_elTbody",
".",
"offsetTop",
"+",
"\"px\"",
":",
"0",
";",
"}"
]
| Initializes ScrollingDataTable TBODY element for data
@method _initTbodyEl
@param elTable {HTMLElement} TABLE element into which to create TBODY .
@private | [
"Initializes",
"ScrollingDataTable",
"TBODY",
"element",
"for",
"data"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14537-L14544 |
|
42,569 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(el) {
el = el || this._elTbody;
var oSelf = this;
this._storeScrollPositions();
// http://developer.mozilla.org/en/docs/index.php?title=Key-navigable_custom_DHTML_widgets
// The timeout is necessary in both IE and Firefox 1.5, to prevent scripts from doing
// strange unexpected things as the user clicks on buttons and other controls.
// Bug 1921135: Wrap the whole thing in a setTimeout
setTimeout(function() {
setTimeout(function() {
try {
el.focus();
oSelf._restoreScrollPositions();
}
catch(e) {
}
},0);
}, 0);
} | javascript | function(el) {
el = el || this._elTbody;
var oSelf = this;
this._storeScrollPositions();
// http://developer.mozilla.org/en/docs/index.php?title=Key-navigable_custom_DHTML_widgets
// The timeout is necessary in both IE and Firefox 1.5, to prevent scripts from doing
// strange unexpected things as the user clicks on buttons and other controls.
// Bug 1921135: Wrap the whole thing in a setTimeout
setTimeout(function() {
setTimeout(function() {
try {
el.focus();
oSelf._restoreScrollPositions();
}
catch(e) {
}
},0);
}, 0);
} | [
"function",
"(",
"el",
")",
"{",
"el",
"=",
"el",
"||",
"this",
".",
"_elTbody",
";",
"var",
"oSelf",
"=",
"this",
";",
"this",
".",
"_storeScrollPositions",
"(",
")",
";",
"// http://developer.mozilla.org/en/docs/index.php?title=Key-navigable_custom_DHTML_widgets",
"// The timeout is necessary in both IE and Firefox 1.5, to prevent scripts from doing",
"// strange unexpected things as the user clicks on buttons and other controls.",
"// Bug 1921135: Wrap the whole thing in a setTimeout",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"try",
"{",
"el",
".",
"focus",
"(",
")",
";",
"oSelf",
".",
"_restoreScrollPositions",
"(",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"}",
"}",
",",
"0",
")",
";",
"}",
",",
"0",
")",
";",
"}"
]
| Sets focus on the given element.
@method _focusEl
@param el {HTMLElement} Element.
@private | [
"Sets",
"focus",
"on",
"the",
"given",
"element",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14581-L14600 |
|
42,570 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
// Reset scroll positions
if(this._nScrollTop) {
this._elBdContainer.scrollTop = this._nScrollTop;
this._nScrollTop = null;
}
if(this._nScrollLeft) {
this._elBdContainer.scrollLeft = this._nScrollLeft;
this._nScrollLeft = null;
}
} | javascript | function() {
// Reset scroll positions
if(this._nScrollTop) {
this._elBdContainer.scrollTop = this._nScrollTop;
this._nScrollTop = null;
}
if(this._nScrollLeft) {
this._elBdContainer.scrollLeft = this._nScrollLeft;
this._nScrollLeft = null;
}
} | [
"function",
"(",
")",
"{",
"// Reset scroll positions",
"if",
"(",
"this",
".",
"_nScrollTop",
")",
"{",
"this",
".",
"_elBdContainer",
".",
"scrollTop",
"=",
"this",
".",
"_nScrollTop",
";",
"this",
".",
"_nScrollTop",
"=",
"null",
";",
"}",
"if",
"(",
"this",
".",
"_nScrollLeft",
")",
"{",
"this",
".",
"_elBdContainer",
".",
"scrollLeft",
"=",
"this",
".",
"_nScrollLeft",
";",
"this",
".",
"_nScrollLeft",
"=",
"null",
";",
"}",
"}"
]
| Restores scroll positions to stored value.
@method _retoreScrollPositions
@private | [
"Restores",
"scroll",
"positions",
"to",
"stored",
"value",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14661-L14671 |
|
42,571 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oColumn, elTd) {
// Only Columns without widths that are not hidden
if(!oColumn.width && !oColumn.hidden) {
var elTh = oColumn.getThEl();
// Unset a calculated auto-width
if(oColumn._calculatedWidth) {
this._setColumnWidth(oColumn, "auto", "visible");
}
// Compare auto-widths
if(elTh.offsetWidth !== elTd.offsetWidth) {
var elWider = (elTh.offsetWidth > elTd.offsetWidth) ?
oColumn.getThLinerEl() : elTd.firstChild;
// Grab the wider liner width, unless the minWidth is wider
var newWidth = Math.max(0,
(elWider.offsetWidth -(parseInt(Dom.getStyle(elWider,"paddingLeft"),10)|0) - (parseInt(Dom.getStyle(elWider,"paddingRight"),10)|0)),
oColumn.minWidth);
var sOverflow = 'visible';
// Now validate against maxAutoWidth
if((oColumn.maxAutoWidth > 0) && (newWidth > oColumn.maxAutoWidth)) {
newWidth = oColumn.maxAutoWidth;
sOverflow = "hidden";
}
// Set to the wider auto-width
this._elTbody.style.display = "none";
this._setColumnWidth(oColumn, newWidth+'px', sOverflow);
oColumn._calculatedWidth = newWidth;
this._elTbody.style.display = "";
}
}
} | javascript | function(oColumn, elTd) {
// Only Columns without widths that are not hidden
if(!oColumn.width && !oColumn.hidden) {
var elTh = oColumn.getThEl();
// Unset a calculated auto-width
if(oColumn._calculatedWidth) {
this._setColumnWidth(oColumn, "auto", "visible");
}
// Compare auto-widths
if(elTh.offsetWidth !== elTd.offsetWidth) {
var elWider = (elTh.offsetWidth > elTd.offsetWidth) ?
oColumn.getThLinerEl() : elTd.firstChild;
// Grab the wider liner width, unless the minWidth is wider
var newWidth = Math.max(0,
(elWider.offsetWidth -(parseInt(Dom.getStyle(elWider,"paddingLeft"),10)|0) - (parseInt(Dom.getStyle(elWider,"paddingRight"),10)|0)),
oColumn.minWidth);
var sOverflow = 'visible';
// Now validate against maxAutoWidth
if((oColumn.maxAutoWidth > 0) && (newWidth > oColumn.maxAutoWidth)) {
newWidth = oColumn.maxAutoWidth;
sOverflow = "hidden";
}
// Set to the wider auto-width
this._elTbody.style.display = "none";
this._setColumnWidth(oColumn, newWidth+'px', sOverflow);
oColumn._calculatedWidth = newWidth;
this._elTbody.style.display = "";
}
}
} | [
"function",
"(",
"oColumn",
",",
"elTd",
")",
"{",
"// Only Columns without widths that are not hidden",
"if",
"(",
"!",
"oColumn",
".",
"width",
"&&",
"!",
"oColumn",
".",
"hidden",
")",
"{",
"var",
"elTh",
"=",
"oColumn",
".",
"getThEl",
"(",
")",
";",
"// Unset a calculated auto-width",
"if",
"(",
"oColumn",
".",
"_calculatedWidth",
")",
"{",
"this",
".",
"_setColumnWidth",
"(",
"oColumn",
",",
"\"auto\"",
",",
"\"visible\"",
")",
";",
"}",
"// Compare auto-widths",
"if",
"(",
"elTh",
".",
"offsetWidth",
"!==",
"elTd",
".",
"offsetWidth",
")",
"{",
"var",
"elWider",
"=",
"(",
"elTh",
".",
"offsetWidth",
">",
"elTd",
".",
"offsetWidth",
")",
"?",
"oColumn",
".",
"getThLinerEl",
"(",
")",
":",
"elTd",
".",
"firstChild",
";",
"// Grab the wider liner width, unless the minWidth is wider",
"var",
"newWidth",
"=",
"Math",
".",
"max",
"(",
"0",
",",
"(",
"elWider",
".",
"offsetWidth",
"-",
"(",
"parseInt",
"(",
"Dom",
".",
"getStyle",
"(",
"elWider",
",",
"\"paddingLeft\"",
")",
",",
"10",
")",
"|",
"0",
")",
"-",
"(",
"parseInt",
"(",
"Dom",
".",
"getStyle",
"(",
"elWider",
",",
"\"paddingRight\"",
")",
",",
"10",
")",
"|",
"0",
")",
")",
",",
"oColumn",
".",
"minWidth",
")",
";",
"var",
"sOverflow",
"=",
"'visible'",
";",
"// Now validate against maxAutoWidth",
"if",
"(",
"(",
"oColumn",
".",
"maxAutoWidth",
">",
"0",
")",
"&&",
"(",
"newWidth",
">",
"oColumn",
".",
"maxAutoWidth",
")",
")",
"{",
"newWidth",
"=",
"oColumn",
".",
"maxAutoWidth",
";",
"sOverflow",
"=",
"\"hidden\"",
";",
"}",
"// Set to the wider auto-width",
"this",
".",
"_elTbody",
".",
"style",
".",
"display",
"=",
"\"none\"",
";",
"this",
".",
"_setColumnWidth",
"(",
"oColumn",
",",
"newWidth",
"+",
"'px'",
",",
"sOverflow",
")",
";",
"oColumn",
".",
"_calculatedWidth",
"=",
"newWidth",
";",
"this",
".",
"_elTbody",
".",
"style",
".",
"display",
"=",
"\"\"",
";",
"}",
"}",
"}"
]
| Helper function calculates and sets a validated width for a Column in a ScrollingDataTable.
@method _validateColumnWidth
@param oColumn {YAHOO.widget.Column} Column instance.
@param elTd {HTMLElement} TD element to validate against.
@private | [
"Helper",
"function",
"calculates",
"and",
"sets",
"a",
"validated",
"width",
"for",
"a",
"Column",
"in",
"a",
"ScrollingDataTable",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14681-L14714 |
|
42,572 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var elTbody = this._elTbody,
elBdContainer = this._elBdContainer;
// X-scrolling not enabled
if(!this.get("width")) {
// Snap outer container width to content
this._elContainer.style.width =
(elBdContainer.scrollHeight > elBdContainer.clientHeight) ?
// but account for y-scrollbar since it is visible
(elTbody.parentNode.clientWidth + 19) + "px" :
// no y-scrollbar, just borders
(elTbody.parentNode.clientWidth + 2) + "px";
}
} | javascript | function() {
var elTbody = this._elTbody,
elBdContainer = this._elBdContainer;
// X-scrolling not enabled
if(!this.get("width")) {
// Snap outer container width to content
this._elContainer.style.width =
(elBdContainer.scrollHeight > elBdContainer.clientHeight) ?
// but account for y-scrollbar since it is visible
(elTbody.parentNode.clientWidth + 19) + "px" :
// no y-scrollbar, just borders
(elTbody.parentNode.clientWidth + 2) + "px";
}
} | [
"function",
"(",
")",
"{",
"var",
"elTbody",
"=",
"this",
".",
"_elTbody",
",",
"elBdContainer",
"=",
"this",
".",
"_elBdContainer",
";",
"// X-scrolling not enabled",
"if",
"(",
"!",
"this",
".",
"get",
"(",
"\"width\"",
")",
")",
"{",
"// Snap outer container width to content",
"this",
".",
"_elContainer",
".",
"style",
".",
"width",
"=",
"(",
"elBdContainer",
".",
"scrollHeight",
">",
"elBdContainer",
".",
"clientHeight",
")",
"?",
"// but account for y-scrollbar since it is visible",
"(",
"elTbody",
".",
"parentNode",
".",
"clientWidth",
"+",
"19",
")",
"+",
"\"px\"",
":",
"// no y-scrollbar, just borders",
"(",
"elTbody",
".",
"parentNode",
".",
"clientWidth",
"+",
"2",
")",
"+",
"\"px\"",
";",
"}",
"}"
]
| Snaps container width for y-scrolling tables.
@method _syncScrollY
@private | [
"Snaps",
"container",
"width",
"for",
"y",
"-",
"scrolling",
"tables",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14846-L14860 |
|
42,573 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var elTbody = this._elTbody,
elBdContainer = this._elBdContainer;
// IE 6 and 7 only when y-scrolling not enabled
if(!this.get("height") && (ua.ie)) {
// Snap outer container height to content
elBdContainer.style.height =
// but account for x-scrollbar if it is visible
(elBdContainer.scrollWidth > elBdContainer.offsetWidth ) ?
(elTbody.parentNode.offsetHeight + 18) + "px" :
elTbody.parentNode.offsetHeight + "px";
}
// Sync message tbody
if(this._elTbody.rows.length === 0) {
this._elMsgTbody.parentNode.style.width = this.getTheadEl().parentNode.offsetWidth + "px";
}
else {
this._elMsgTbody.parentNode.style.width = "";
}
} | javascript | function() {
var elTbody = this._elTbody,
elBdContainer = this._elBdContainer;
// IE 6 and 7 only when y-scrolling not enabled
if(!this.get("height") && (ua.ie)) {
// Snap outer container height to content
elBdContainer.style.height =
// but account for x-scrollbar if it is visible
(elBdContainer.scrollWidth > elBdContainer.offsetWidth ) ?
(elTbody.parentNode.offsetHeight + 18) + "px" :
elTbody.parentNode.offsetHeight + "px";
}
// Sync message tbody
if(this._elTbody.rows.length === 0) {
this._elMsgTbody.parentNode.style.width = this.getTheadEl().parentNode.offsetWidth + "px";
}
else {
this._elMsgTbody.parentNode.style.width = "";
}
} | [
"function",
"(",
")",
"{",
"var",
"elTbody",
"=",
"this",
".",
"_elTbody",
",",
"elBdContainer",
"=",
"this",
".",
"_elBdContainer",
";",
"// IE 6 and 7 only when y-scrolling not enabled",
"if",
"(",
"!",
"this",
".",
"get",
"(",
"\"height\"",
")",
"&&",
"(",
"ua",
".",
"ie",
")",
")",
"{",
"// Snap outer container height to content",
"elBdContainer",
".",
"style",
".",
"height",
"=",
"// but account for x-scrollbar if it is visible",
"(",
"elBdContainer",
".",
"scrollWidth",
">",
"elBdContainer",
".",
"offsetWidth",
")",
"?",
"(",
"elTbody",
".",
"parentNode",
".",
"offsetHeight",
"+",
"18",
")",
"+",
"\"px\"",
":",
"elTbody",
".",
"parentNode",
".",
"offsetHeight",
"+",
"\"px\"",
";",
"}",
"// Sync message tbody",
"if",
"(",
"this",
".",
"_elTbody",
".",
"rows",
".",
"length",
"===",
"0",
")",
"{",
"this",
".",
"_elMsgTbody",
".",
"parentNode",
".",
"style",
".",
"width",
"=",
"this",
".",
"getTheadEl",
"(",
")",
".",
"parentNode",
".",
"offsetWidth",
"+",
"\"px\"",
";",
"}",
"else",
"{",
"this",
".",
"_elMsgTbody",
".",
"parentNode",
".",
"style",
".",
"width",
"=",
"\"\"",
";",
"}",
"}"
]
| Snaps container height for x-scrolling tables in IE. Syncs message TBODY width.
@method _syncScrollX
@private | [
"Snaps",
"container",
"height",
"for",
"x",
"-",
"scrolling",
"tables",
"in",
"IE",
".",
"Syncs",
"message",
"TBODY",
"width",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14868-L14889 |
|
42,574 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(nBorderWidth) {
var aLastHeaders = this._oColumnSet.headers[this._oColumnSet.headers.length-1] || [],
len = aLastHeaders.length,
sPrefix = this._sId+"-fixedth-",
sValue = nBorderWidth + "px solid " + this.get("COLOR_COLUMNFILLER");
this._elThead.style.display = "none";
for(var i=0; i<len; i++) {
Dom.get(sPrefix+aLastHeaders[i]).style.borderRight = sValue;
}
this._elThead.style.display = "";
} | javascript | function(nBorderWidth) {
var aLastHeaders = this._oColumnSet.headers[this._oColumnSet.headers.length-1] || [],
len = aLastHeaders.length,
sPrefix = this._sId+"-fixedth-",
sValue = nBorderWidth + "px solid " + this.get("COLOR_COLUMNFILLER");
this._elThead.style.display = "none";
for(var i=0; i<len; i++) {
Dom.get(sPrefix+aLastHeaders[i]).style.borderRight = sValue;
}
this._elThead.style.display = "";
} | [
"function",
"(",
"nBorderWidth",
")",
"{",
"var",
"aLastHeaders",
"=",
"this",
".",
"_oColumnSet",
".",
"headers",
"[",
"this",
".",
"_oColumnSet",
".",
"headers",
".",
"length",
"-",
"1",
"]",
"||",
"[",
"]",
",",
"len",
"=",
"aLastHeaders",
".",
"length",
",",
"sPrefix",
"=",
"this",
".",
"_sId",
"+",
"\"-fixedth-\"",
",",
"sValue",
"=",
"nBorderWidth",
"+",
"\"px solid \"",
"+",
"this",
".",
"get",
"(",
"\"COLOR_COLUMNFILLER\"",
")",
";",
"this",
".",
"_elThead",
".",
"style",
".",
"display",
"=",
"\"none\"",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"Dom",
".",
"get",
"(",
"sPrefix",
"+",
"aLastHeaders",
"[",
"i",
"]",
")",
".",
"style",
".",
"borderRight",
"=",
"sValue",
";",
"}",
"this",
".",
"_elThead",
".",
"style",
".",
"display",
"=",
"\"\"",
";",
"}"
]
| Sets Column header overhang to given width.
@method _setOverhangValue
@param nBorderWidth {Number} Value of new border for overhang.
@private | [
"Sets",
"Column",
"header",
"overhang",
"to",
"given",
"width",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L14920-L14931 |
|
42,575 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var elMask = this._elMask;
elMask.style.width = this._elBdContainer.offsetWidth + "px";
elMask.style.height = this._elHdContainer.offsetHeight + this._elBdContainer.offsetHeight + "px";
elMask.style.display = "";
this.fireEvent("disableEvent");
} | javascript | function() {
var elMask = this._elMask;
elMask.style.width = this._elBdContainer.offsetWidth + "px";
elMask.style.height = this._elHdContainer.offsetHeight + this._elBdContainer.offsetHeight + "px";
elMask.style.display = "";
this.fireEvent("disableEvent");
} | [
"function",
"(",
")",
"{",
"var",
"elMask",
"=",
"this",
".",
"_elMask",
";",
"elMask",
".",
"style",
".",
"width",
"=",
"this",
".",
"_elBdContainer",
".",
"offsetWidth",
"+",
"\"px\"",
";",
"elMask",
".",
"style",
".",
"height",
"=",
"this",
".",
"_elHdContainer",
".",
"offsetHeight",
"+",
"this",
".",
"_elBdContainer",
".",
"offsetHeight",
"+",
"\"px\"",
";",
"elMask",
".",
"style",
".",
"display",
"=",
"\"\"",
";",
"this",
".",
"fireEvent",
"(",
"\"disableEvent\"",
")",
";",
"}"
]
| Disables ScrollingDataTable UI.
@method disable | [
"Disables",
"ScrollingDataTable",
"UI",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L15015-L15021 |
|
42,576 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(oColumn, nWidth) {
oColumn = this.getColumn(oColumn);
if(oColumn) {
this._storeScrollPositions();
// Validate new width against minWidth
if(lang.isNumber(nWidth)) {
nWidth = (nWidth > oColumn.minWidth) ? nWidth : oColumn.minWidth;
// Save state
oColumn.width = nWidth;
// Resize the DOM elements
this._setColumnWidth(oColumn, nWidth+"px");
this._syncScroll();
this.fireEvent("columnSetWidthEvent",{column:oColumn,width:nWidth});
}
// Unsets a width to auto-size
else if(nWidth === null) {
// Save state
oColumn.width = nWidth;
// Resize the DOM elements
this._setColumnWidth(oColumn, "auto");
this.validateColumnWidths(oColumn);
this.fireEvent("columnUnsetWidthEvent",{column:oColumn});
}
// Bug 2339454: resize then sort misaligment
this._clearTrTemplateEl();
}
else {
}
} | javascript | function(oColumn, nWidth) {
oColumn = this.getColumn(oColumn);
if(oColumn) {
this._storeScrollPositions();
// Validate new width against minWidth
if(lang.isNumber(nWidth)) {
nWidth = (nWidth > oColumn.minWidth) ? nWidth : oColumn.minWidth;
// Save state
oColumn.width = nWidth;
// Resize the DOM elements
this._setColumnWidth(oColumn, nWidth+"px");
this._syncScroll();
this.fireEvent("columnSetWidthEvent",{column:oColumn,width:nWidth});
}
// Unsets a width to auto-size
else if(nWidth === null) {
// Save state
oColumn.width = nWidth;
// Resize the DOM elements
this._setColumnWidth(oColumn, "auto");
this.validateColumnWidths(oColumn);
this.fireEvent("columnUnsetWidthEvent",{column:oColumn});
}
// Bug 2339454: resize then sort misaligment
this._clearTrTemplateEl();
}
else {
}
} | [
"function",
"(",
"oColumn",
",",
"nWidth",
")",
"{",
"oColumn",
"=",
"this",
".",
"getColumn",
"(",
"oColumn",
")",
";",
"if",
"(",
"oColumn",
")",
"{",
"this",
".",
"_storeScrollPositions",
"(",
")",
";",
"// Validate new width against minWidth",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"nWidth",
")",
")",
"{",
"nWidth",
"=",
"(",
"nWidth",
">",
"oColumn",
".",
"minWidth",
")",
"?",
"nWidth",
":",
"oColumn",
".",
"minWidth",
";",
"// Save state",
"oColumn",
".",
"width",
"=",
"nWidth",
";",
"// Resize the DOM elements",
"this",
".",
"_setColumnWidth",
"(",
"oColumn",
",",
"nWidth",
"+",
"\"px\"",
")",
";",
"this",
".",
"_syncScroll",
"(",
")",
";",
"this",
".",
"fireEvent",
"(",
"\"columnSetWidthEvent\"",
",",
"{",
"column",
":",
"oColumn",
",",
"width",
":",
"nWidth",
"}",
")",
";",
"}",
"// Unsets a width to auto-size",
"else",
"if",
"(",
"nWidth",
"===",
"null",
")",
"{",
"// Save state",
"oColumn",
".",
"width",
"=",
"nWidth",
";",
"// Resize the DOM elements",
"this",
".",
"_setColumnWidth",
"(",
"oColumn",
",",
"\"auto\"",
")",
";",
"this",
".",
"validateColumnWidths",
"(",
"oColumn",
")",
";",
"this",
".",
"fireEvent",
"(",
"\"columnUnsetWidthEvent\"",
",",
"{",
"column",
":",
"oColumn",
"}",
")",
";",
"}",
"// Bug 2339454: resize then sort misaligment",
"this",
".",
"_clearTrTemplateEl",
"(",
")",
";",
"}",
"else",
"{",
"}",
"}"
]
| Sets given Column to given pixel width. If new width is less than minWidth
width, sets to minWidth. Updates oColumn.width value.
@method setColumnWidth
@param oColumn {YAHOO.widget.Column} Column instance.
@param nWidth {Number} New width in pixels. | [
"Sets",
"given",
"Column",
"to",
"given",
"pixel",
"width",
".",
"If",
"new",
"width",
"is",
"less",
"than",
"minWidth",
"width",
"sets",
"to",
"minWidth",
".",
"Updates",
"oColumn",
".",
"width",
"value",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L15105-L15139 |
|
42,577 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function(to) {
var td = this.getTdEl(to);
if(td) {
this.clearScrollPositions();
this.getBdContainerEl().scrollLeft = td.offsetLeft;
this.getBdContainerEl().scrollTop = td.parentNode.offsetTop;
}
else {
var tr = this.getTrEl(to);
if(tr) {
this.clearScrollPositions();
this.getBdContainerEl().scrollTop = tr.offsetTop;
}
}
} | javascript | function(to) {
var td = this.getTdEl(to);
if(td) {
this.clearScrollPositions();
this.getBdContainerEl().scrollLeft = td.offsetLeft;
this.getBdContainerEl().scrollTop = td.parentNode.offsetTop;
}
else {
var tr = this.getTrEl(to);
if(tr) {
this.clearScrollPositions();
this.getBdContainerEl().scrollTop = tr.offsetTop;
}
}
} | [
"function",
"(",
"to",
")",
"{",
"var",
"td",
"=",
"this",
".",
"getTdEl",
"(",
"to",
")",
";",
"if",
"(",
"td",
")",
"{",
"this",
".",
"clearScrollPositions",
"(",
")",
";",
"this",
".",
"getBdContainerEl",
"(",
")",
".",
"scrollLeft",
"=",
"td",
".",
"offsetLeft",
";",
"this",
".",
"getBdContainerEl",
"(",
")",
".",
"scrollTop",
"=",
"td",
".",
"parentNode",
".",
"offsetTop",
";",
"}",
"else",
"{",
"var",
"tr",
"=",
"this",
".",
"getTrEl",
"(",
"to",
")",
";",
"if",
"(",
"tr",
")",
"{",
"this",
".",
"clearScrollPositions",
"(",
")",
";",
"this",
".",
"getBdContainerEl",
"(",
")",
".",
"scrollTop",
"=",
"tr",
".",
"offsetTop",
";",
"}",
"}",
"}"
]
| Scrolls to given row or cell
@method scrollTo
@param to {YAHOO.widget.Record | HTMLElement } Itme to scroll to. | [
"Scrolls",
"to",
"given",
"row",
"or",
"cell"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L15147-L15161 |
|
42,578 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
this.unsubscribeAll();
// Column is late-binding in attach()
var oColumn = this.getColumn();
if(oColumn) {
oColumn.editor = null;
}
var elContainer = this.getContainerEl();
Ev.purgeElement(elContainer, true);
elContainer.parentNode.removeChild(elContainer);
} | javascript | function() {
this.unsubscribeAll();
// Column is late-binding in attach()
var oColumn = this.getColumn();
if(oColumn) {
oColumn.editor = null;
}
var elContainer = this.getContainerEl();
Ev.purgeElement(elContainer, true);
elContainer.parentNode.removeChild(elContainer);
} | [
"function",
"(",
")",
"{",
"this",
".",
"unsubscribeAll",
"(",
")",
";",
"// Column is late-binding in attach()",
"var",
"oColumn",
"=",
"this",
".",
"getColumn",
"(",
")",
";",
"if",
"(",
"oColumn",
")",
"{",
"oColumn",
".",
"editor",
"=",
"null",
";",
"}",
"var",
"elContainer",
"=",
"this",
".",
"getContainerEl",
"(",
")",
";",
"Ev",
".",
"purgeElement",
"(",
"elContainer",
",",
"true",
")",
";",
"elContainer",
".",
"parentNode",
".",
"removeChild",
"(",
"elContainer",
")",
";",
"}"
]
| Nulls out the entire CellEditor instance and related objects, removes attached
event listeners, and clears out DOM elements inside the container, removes
container from the DOM.
@method destroy | [
"Nulls",
"out",
"the",
"entire",
"CellEditor",
"instance",
"and",
"related",
"objects",
"removes",
"attached",
"event",
"listeners",
"and",
"clears",
"out",
"DOM",
"elements",
"inside",
"the",
"container",
"removes",
"container",
"from",
"the",
"DOM",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L15744-L15756 |
|
42,579 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
if(this._elContainer) {
YAHOO.util.Event.purgeElement(this._elContainer, true);
this._elContainer.innerHTML = "";
}
// Render Cell Editor container element as first child of body
var elContainer = document.createElement("div");
elContainer.id = this.getId() + "-container"; // Needed for tracking blur event
elContainer.style.display = "none";
elContainer.tabIndex = 0;
elContainer.className = DT.CLASS_EDITOR;
document.body.insertBefore(elContainer, document.body.firstChild);
this._elContainer = elContainer;
// Handle ESC key
Ev.addListener(elContainer, "keydown", function(e, oSelf) {
// ESC cancels Cell Editor
if((e.keyCode == 27)) {
var target = Ev.getTarget(e);
// workaround for Mac FF3 bug that disabled clicks when ESC hit when
// select is open. [bug 2273056]
if (target.nodeName && target.nodeName.toLowerCase() === 'select') {
target.blur();
}
oSelf.cancel();
}
// Pass through event
oSelf.fireEvent("keydownEvent", {editor:this, event:e});
}, this);
this.renderForm();
// Show Save/Cancel buttons
if(!this.disableBtns) {
this.renderBtns();
}
this.doAfterRender();
} | javascript | function() {
if(this._elContainer) {
YAHOO.util.Event.purgeElement(this._elContainer, true);
this._elContainer.innerHTML = "";
}
// Render Cell Editor container element as first child of body
var elContainer = document.createElement("div");
elContainer.id = this.getId() + "-container"; // Needed for tracking blur event
elContainer.style.display = "none";
elContainer.tabIndex = 0;
elContainer.className = DT.CLASS_EDITOR;
document.body.insertBefore(elContainer, document.body.firstChild);
this._elContainer = elContainer;
// Handle ESC key
Ev.addListener(elContainer, "keydown", function(e, oSelf) {
// ESC cancels Cell Editor
if((e.keyCode == 27)) {
var target = Ev.getTarget(e);
// workaround for Mac FF3 bug that disabled clicks when ESC hit when
// select is open. [bug 2273056]
if (target.nodeName && target.nodeName.toLowerCase() === 'select') {
target.blur();
}
oSelf.cancel();
}
// Pass through event
oSelf.fireEvent("keydownEvent", {editor:this, event:e});
}, this);
this.renderForm();
// Show Save/Cancel buttons
if(!this.disableBtns) {
this.renderBtns();
}
this.doAfterRender();
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_elContainer",
")",
"{",
"YAHOO",
".",
"util",
".",
"Event",
".",
"purgeElement",
"(",
"this",
".",
"_elContainer",
",",
"true",
")",
";",
"this",
".",
"_elContainer",
".",
"innerHTML",
"=",
"\"\"",
";",
"}",
"// Render Cell Editor container element as first child of body",
"var",
"elContainer",
"=",
"document",
".",
"createElement",
"(",
"\"div\"",
")",
";",
"elContainer",
".",
"id",
"=",
"this",
".",
"getId",
"(",
")",
"+",
"\"-container\"",
";",
"// Needed for tracking blur event",
"elContainer",
".",
"style",
".",
"display",
"=",
"\"none\"",
";",
"elContainer",
".",
"tabIndex",
"=",
"0",
";",
"elContainer",
".",
"className",
"=",
"DT",
".",
"CLASS_EDITOR",
";",
"document",
".",
"body",
".",
"insertBefore",
"(",
"elContainer",
",",
"document",
".",
"body",
".",
"firstChild",
")",
";",
"this",
".",
"_elContainer",
"=",
"elContainer",
";",
"// Handle ESC key",
"Ev",
".",
"addListener",
"(",
"elContainer",
",",
"\"keydown\"",
",",
"function",
"(",
"e",
",",
"oSelf",
")",
"{",
"// ESC cancels Cell Editor",
"if",
"(",
"(",
"e",
".",
"keyCode",
"==",
"27",
")",
")",
"{",
"var",
"target",
"=",
"Ev",
".",
"getTarget",
"(",
"e",
")",
";",
"// workaround for Mac FF3 bug that disabled clicks when ESC hit when",
"// select is open. [bug 2273056]",
"if",
"(",
"target",
".",
"nodeName",
"&&",
"target",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
"===",
"'select'",
")",
"{",
"target",
".",
"blur",
"(",
")",
";",
"}",
"oSelf",
".",
"cancel",
"(",
")",
";",
"}",
"// Pass through event",
"oSelf",
".",
"fireEvent",
"(",
"\"keydownEvent\"",
",",
"{",
"editor",
":",
"this",
",",
"event",
":",
"e",
"}",
")",
";",
"}",
",",
"this",
")",
";",
"this",
".",
"renderForm",
"(",
")",
";",
"// Show Save/Cancel buttons",
"if",
"(",
"!",
"this",
".",
"disableBtns",
")",
"{",
"this",
".",
"renderBtns",
"(",
")",
";",
"}",
"this",
".",
"doAfterRender",
"(",
")",
";",
"}"
]
| Renders DOM elements and attaches event listeners.
@method render | [
"Renders",
"DOM",
"elements",
"and",
"attaches",
"event",
"listeners",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L15763-L15802 |
|
42,580 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
// Move Editor
var elContainer = this.getContainerEl(),
elTd = this.getTdEl(),
x = Dom.getX(elTd),
y = Dom.getY(elTd);
//TODO: remove scrolling logic
// SF doesn't get xy for cells in scrolling table
// when tbody display is set to block
if(isNaN(x) || isNaN(y)) {
var elTbody = this.getDataTable().getTbodyEl();
x = elTd.offsetLeft + // cell pos relative to table
Dom.getX(elTbody.parentNode) - // plus table pos relative to document
elTbody.scrollLeft; // minus tbody scroll
y = elTd.offsetTop + // cell pos relative to table
Dom.getY(elTbody.parentNode) - // plus table pos relative to document
elTbody.scrollTop + // minus tbody scroll
this.getDataTable().getTheadEl().offsetHeight; // account for fixed THEAD cells
}
elContainer.style.left = x + "px";
elContainer.style.top = y + "px";
} | javascript | function() {
// Move Editor
var elContainer = this.getContainerEl(),
elTd = this.getTdEl(),
x = Dom.getX(elTd),
y = Dom.getY(elTd);
//TODO: remove scrolling logic
// SF doesn't get xy for cells in scrolling table
// when tbody display is set to block
if(isNaN(x) || isNaN(y)) {
var elTbody = this.getDataTable().getTbodyEl();
x = elTd.offsetLeft + // cell pos relative to table
Dom.getX(elTbody.parentNode) - // plus table pos relative to document
elTbody.scrollLeft; // minus tbody scroll
y = elTd.offsetTop + // cell pos relative to table
Dom.getY(elTbody.parentNode) - // plus table pos relative to document
elTbody.scrollTop + // minus tbody scroll
this.getDataTable().getTheadEl().offsetHeight; // account for fixed THEAD cells
}
elContainer.style.left = x + "px";
elContainer.style.top = y + "px";
} | [
"function",
"(",
")",
"{",
"// Move Editor",
"var",
"elContainer",
"=",
"this",
".",
"getContainerEl",
"(",
")",
",",
"elTd",
"=",
"this",
".",
"getTdEl",
"(",
")",
",",
"x",
"=",
"Dom",
".",
"getX",
"(",
"elTd",
")",
",",
"y",
"=",
"Dom",
".",
"getY",
"(",
"elTd",
")",
";",
"//TODO: remove scrolling logic",
"// SF doesn't get xy for cells in scrolling table",
"// when tbody display is set to block",
"if",
"(",
"isNaN",
"(",
"x",
")",
"||",
"isNaN",
"(",
"y",
")",
")",
"{",
"var",
"elTbody",
"=",
"this",
".",
"getDataTable",
"(",
")",
".",
"getTbodyEl",
"(",
")",
";",
"x",
"=",
"elTd",
".",
"offsetLeft",
"+",
"// cell pos relative to table",
"Dom",
".",
"getX",
"(",
"elTbody",
".",
"parentNode",
")",
"-",
"// plus table pos relative to document",
"elTbody",
".",
"scrollLeft",
";",
"// minus tbody scroll",
"y",
"=",
"elTd",
".",
"offsetTop",
"+",
"// cell pos relative to table",
"Dom",
".",
"getY",
"(",
"elTbody",
".",
"parentNode",
")",
"-",
"// plus table pos relative to document",
"elTbody",
".",
"scrollTop",
"+",
"// minus tbody scroll",
"this",
".",
"getDataTable",
"(",
")",
".",
"getTheadEl",
"(",
")",
".",
"offsetHeight",
";",
"// account for fixed THEAD cells",
"}",
"elContainer",
".",
"style",
".",
"left",
"=",
"x",
"+",
"\"px\"",
";",
"elContainer",
".",
"style",
".",
"top",
"=",
"y",
"+",
"\"px\"",
";",
"}"
]
| Moves container into position for display.
@method move | [
"Moves",
"container",
"into",
"position",
"for",
"display",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L15873-L15896 |
|
42,581 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
// Get new value
var inputValue = this.getInputValue();
var validValue = inputValue;
// Validate new value
if(this.validator) {
validValue = this.validator.call(this.getDataTable(), inputValue, this.value, this);
if(validValue === undefined ) {
if(this.resetInvalidData) {
this.resetForm();
}
this.fireEvent("invalidDataEvent",
{editor:this, oldData:this.value, newData:inputValue});
return;
}
}
var oSelf = this;
var finishSave = function(bSuccess, oNewValue) {
var oOrigValue = oSelf.value;
if(bSuccess) {
// Update new value
oSelf.value = oNewValue;
oSelf.getDataTable().updateCell(oSelf.getRecord(), oSelf.getColumn(), oNewValue);
// Hide CellEditor
oSelf.getContainerEl().style.display = "none";
oSelf.isActive = false;
oSelf.getDataTable()._oCellEditor = null;
oSelf.fireEvent("saveEvent",
{editor:oSelf, oldData:oOrigValue, newData:oSelf.value});
}
else {
oSelf.resetForm();
oSelf.fireEvent("revertEvent",
{editor:oSelf, oldData:oOrigValue, newData:oNewValue});
}
oSelf.unblock();
};
this.block();
if(lang.isFunction(this.asyncSubmitter)) {
this.asyncSubmitter.call(this, finishSave, validValue);
}
else {
finishSave(true, validValue);
}
} | javascript | function() {
// Get new value
var inputValue = this.getInputValue();
var validValue = inputValue;
// Validate new value
if(this.validator) {
validValue = this.validator.call(this.getDataTable(), inputValue, this.value, this);
if(validValue === undefined ) {
if(this.resetInvalidData) {
this.resetForm();
}
this.fireEvent("invalidDataEvent",
{editor:this, oldData:this.value, newData:inputValue});
return;
}
}
var oSelf = this;
var finishSave = function(bSuccess, oNewValue) {
var oOrigValue = oSelf.value;
if(bSuccess) {
// Update new value
oSelf.value = oNewValue;
oSelf.getDataTable().updateCell(oSelf.getRecord(), oSelf.getColumn(), oNewValue);
// Hide CellEditor
oSelf.getContainerEl().style.display = "none";
oSelf.isActive = false;
oSelf.getDataTable()._oCellEditor = null;
oSelf.fireEvent("saveEvent",
{editor:oSelf, oldData:oOrigValue, newData:oSelf.value});
}
else {
oSelf.resetForm();
oSelf.fireEvent("revertEvent",
{editor:oSelf, oldData:oOrigValue, newData:oNewValue});
}
oSelf.unblock();
};
this.block();
if(lang.isFunction(this.asyncSubmitter)) {
this.asyncSubmitter.call(this, finishSave, validValue);
}
else {
finishSave(true, validValue);
}
} | [
"function",
"(",
")",
"{",
"// Get new value",
"var",
"inputValue",
"=",
"this",
".",
"getInputValue",
"(",
")",
";",
"var",
"validValue",
"=",
"inputValue",
";",
"// Validate new value",
"if",
"(",
"this",
".",
"validator",
")",
"{",
"validValue",
"=",
"this",
".",
"validator",
".",
"call",
"(",
"this",
".",
"getDataTable",
"(",
")",
",",
"inputValue",
",",
"this",
".",
"value",
",",
"this",
")",
";",
"if",
"(",
"validValue",
"===",
"undefined",
")",
"{",
"if",
"(",
"this",
".",
"resetInvalidData",
")",
"{",
"this",
".",
"resetForm",
"(",
")",
";",
"}",
"this",
".",
"fireEvent",
"(",
"\"invalidDataEvent\"",
",",
"{",
"editor",
":",
"this",
",",
"oldData",
":",
"this",
".",
"value",
",",
"newData",
":",
"inputValue",
"}",
")",
";",
"return",
";",
"}",
"}",
"var",
"oSelf",
"=",
"this",
";",
"var",
"finishSave",
"=",
"function",
"(",
"bSuccess",
",",
"oNewValue",
")",
"{",
"var",
"oOrigValue",
"=",
"oSelf",
".",
"value",
";",
"if",
"(",
"bSuccess",
")",
"{",
"// Update new value",
"oSelf",
".",
"value",
"=",
"oNewValue",
";",
"oSelf",
".",
"getDataTable",
"(",
")",
".",
"updateCell",
"(",
"oSelf",
".",
"getRecord",
"(",
")",
",",
"oSelf",
".",
"getColumn",
"(",
")",
",",
"oNewValue",
")",
";",
"// Hide CellEditor",
"oSelf",
".",
"getContainerEl",
"(",
")",
".",
"style",
".",
"display",
"=",
"\"none\"",
";",
"oSelf",
".",
"isActive",
"=",
"false",
";",
"oSelf",
".",
"getDataTable",
"(",
")",
".",
"_oCellEditor",
"=",
"null",
";",
"oSelf",
".",
"fireEvent",
"(",
"\"saveEvent\"",
",",
"{",
"editor",
":",
"oSelf",
",",
"oldData",
":",
"oOrigValue",
",",
"newData",
":",
"oSelf",
".",
"value",
"}",
")",
";",
"}",
"else",
"{",
"oSelf",
".",
"resetForm",
"(",
")",
";",
"oSelf",
".",
"fireEvent",
"(",
"\"revertEvent\"",
",",
"{",
"editor",
":",
"oSelf",
",",
"oldData",
":",
"oOrigValue",
",",
"newData",
":",
"oNewValue",
"}",
")",
";",
"}",
"oSelf",
".",
"unblock",
"(",
")",
";",
"}",
";",
"this",
".",
"block",
"(",
")",
";",
"if",
"(",
"lang",
".",
"isFunction",
"(",
"this",
".",
"asyncSubmitter",
")",
")",
"{",
"this",
".",
"asyncSubmitter",
".",
"call",
"(",
"this",
",",
"finishSave",
",",
"validValue",
")",
";",
"}",
"else",
"{",
"finishSave",
"(",
"true",
",",
"validValue",
")",
";",
"}",
"}"
]
| Saves value of CellEditor and hides UI.
@method save | [
"Saves",
"value",
"of",
"CellEditor",
"and",
"hides",
"UI",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L15934-L15983 |
|
42,582 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
// Normalize to array
var originalValues = lang.isArray(this.value) ? this.value : [this.value];
// Match checks to value
for(var i=0, j=this.checkboxes.length; i<j; i++) {
this.checkboxes[i].checked = false;
for(var k=0, len=originalValues.length; k<len; k++) {
if(this.checkboxes[i].value === originalValues[k]) {
this.checkboxes[i].checked = true;
}
}
}
} | javascript | function() {
// Normalize to array
var originalValues = lang.isArray(this.value) ? this.value : [this.value];
// Match checks to value
for(var i=0, j=this.checkboxes.length; i<j; i++) {
this.checkboxes[i].checked = false;
for(var k=0, len=originalValues.length; k<len; k++) {
if(this.checkboxes[i].value === originalValues[k]) {
this.checkboxes[i].checked = true;
}
}
}
} | [
"function",
"(",
")",
"{",
"// Normalize to array",
"var",
"originalValues",
"=",
"lang",
".",
"isArray",
"(",
"this",
".",
"value",
")",
"?",
"this",
".",
"value",
":",
"[",
"this",
".",
"value",
"]",
";",
"// Match checks to value",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"j",
"=",
"this",
".",
"checkboxes",
".",
"length",
";",
"i",
"<",
"j",
";",
"i",
"++",
")",
"{",
"this",
".",
"checkboxes",
"[",
"i",
"]",
".",
"checked",
"=",
"false",
";",
"for",
"(",
"var",
"k",
"=",
"0",
",",
"len",
"=",
"originalValues",
".",
"length",
";",
"k",
"<",
"len",
";",
"k",
"++",
")",
"{",
"if",
"(",
"this",
".",
"checkboxes",
"[",
"i",
"]",
".",
"value",
"===",
"originalValues",
"[",
"k",
"]",
")",
"{",
"this",
".",
"checkboxes",
"[",
"i",
"]",
".",
"checked",
"=",
"true",
";",
"}",
"}",
"}",
"}"
]
| Resets CheckboxCellEditor UI to initial state.
@method resetForm | [
"Resets",
"CheckboxCellEditor",
"UI",
"to",
"initial",
"state",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L16258-L16271 |
|
42,583 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var checkedValues = [];
for(var i=0, j=this.checkboxes.length; i<j; i++) {
if(this.checkboxes[i].checked) {
checkedValues[checkedValues.length] = this.checkboxes[i].value;
}
}
return checkedValues;
} | javascript | function() {
var checkedValues = [];
for(var i=0, j=this.checkboxes.length; i<j; i++) {
if(this.checkboxes[i].checked) {
checkedValues[checkedValues.length] = this.checkboxes[i].value;
}
}
return checkedValues;
} | [
"function",
"(",
")",
"{",
"var",
"checkedValues",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"j",
"=",
"this",
".",
"checkboxes",
".",
"length",
";",
"i",
"<",
"j",
";",
"i",
"++",
")",
"{",
"if",
"(",
"this",
".",
"checkboxes",
"[",
"i",
"]",
".",
"checked",
")",
"{",
"checkedValues",
"[",
"checkedValues",
".",
"length",
"]",
"=",
"this",
".",
"checkboxes",
"[",
"i",
"]",
".",
"value",
";",
"}",
"}",
"return",
"checkedValues",
";",
"}"
]
| Retrieves input value from CheckboxCellEditor.
@method getInputValue | [
"Retrieves",
"input",
"value",
"from",
"CheckboxCellEditor",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L16287-L16295 |
|
42,584 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var value = this.value;
var selectedValue = (value.getMonth()+1)+"/"+value.getDate()+"/"+value.getFullYear();
this.calendar.cfg.setProperty("selected",selectedValue,false);
this.calendar.render();
} | javascript | function() {
var value = this.value;
var selectedValue = (value.getMonth()+1)+"/"+value.getDate()+"/"+value.getFullYear();
this.calendar.cfg.setProperty("selected",selectedValue,false);
this.calendar.render();
} | [
"function",
"(",
")",
"{",
"var",
"value",
"=",
"this",
".",
"value",
";",
"var",
"selectedValue",
"=",
"(",
"value",
".",
"getMonth",
"(",
")",
"+",
"1",
")",
"+",
"\"/\"",
"+",
"value",
".",
"getDate",
"(",
")",
"+",
"\"/\"",
"+",
"value",
".",
"getFullYear",
"(",
")",
";",
"this",
".",
"calendar",
".",
"cfg",
".",
"setProperty",
"(",
"\"selected\"",
",",
"selectedValue",
",",
"false",
")",
";",
"this",
".",
"calendar",
".",
"render",
"(",
")",
";",
"}"
]
| Resets DateCellEditor UI to initial state.
@method resetForm | [
"Resets",
"DateCellEditor",
"UI",
"to",
"initial",
"state",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L16418-L16423 |
|
42,585 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var allOptions = this.dropdown.options,
i=0, j=allOptions.length;
// Look for multi-select selections
if(lang.isArray(this.value)) {
var allValues = this.value,
m=0, n=allValues.length,
hash = {};
// Reset all selections and stash options in a value hash
for(; i<j; i++) {
allOptions[i].selected = false;
hash[allOptions[i].value] = allOptions[i];
}
for(; m<n; m++) {
if(hash[allValues[m]]) {
hash[allValues[m]].selected = true;
}
}
}
// Only need to look for a single selection
else {
for(; i<j; i++) {
if(this.value === allOptions[i].value) {
allOptions[i].selected = true;
}
}
}
} | javascript | function() {
var allOptions = this.dropdown.options,
i=0, j=allOptions.length;
// Look for multi-select selections
if(lang.isArray(this.value)) {
var allValues = this.value,
m=0, n=allValues.length,
hash = {};
// Reset all selections and stash options in a value hash
for(; i<j; i++) {
allOptions[i].selected = false;
hash[allOptions[i].value] = allOptions[i];
}
for(; m<n; m++) {
if(hash[allValues[m]]) {
hash[allValues[m]].selected = true;
}
}
}
// Only need to look for a single selection
else {
for(; i<j; i++) {
if(this.value === allOptions[i].value) {
allOptions[i].selected = true;
}
}
}
} | [
"function",
"(",
")",
"{",
"var",
"allOptions",
"=",
"this",
".",
"dropdown",
".",
"options",
",",
"i",
"=",
"0",
",",
"j",
"=",
"allOptions",
".",
"length",
";",
"// Look for multi-select selections",
"if",
"(",
"lang",
".",
"isArray",
"(",
"this",
".",
"value",
")",
")",
"{",
"var",
"allValues",
"=",
"this",
".",
"value",
",",
"m",
"=",
"0",
",",
"n",
"=",
"allValues",
".",
"length",
",",
"hash",
"=",
"{",
"}",
";",
"// Reset all selections and stash options in a value hash",
"for",
"(",
";",
"i",
"<",
"j",
";",
"i",
"++",
")",
"{",
"allOptions",
"[",
"i",
"]",
".",
"selected",
"=",
"false",
";",
"hash",
"[",
"allOptions",
"[",
"i",
"]",
".",
"value",
"]",
"=",
"allOptions",
"[",
"i",
"]",
";",
"}",
"for",
"(",
";",
"m",
"<",
"n",
";",
"m",
"++",
")",
"{",
"if",
"(",
"hash",
"[",
"allValues",
"[",
"m",
"]",
"]",
")",
"{",
"hash",
"[",
"allValues",
"[",
"m",
"]",
"]",
".",
"selected",
"=",
"true",
";",
"}",
"}",
"}",
"// Only need to look for a single selection",
"else",
"{",
"for",
"(",
";",
"i",
"<",
"j",
";",
"i",
"++",
")",
"{",
"if",
"(",
"this",
".",
"value",
"===",
"allOptions",
"[",
"i",
"]",
".",
"value",
")",
"{",
"allOptions",
"[",
"i",
"]",
".",
"selected",
"=",
"true",
";",
"}",
"}",
"}",
"}"
]
| Resets DropdownCellEditor UI to initial state.
@method resetForm | [
"Resets",
"DropdownCellEditor",
"UI",
"to",
"initial",
"state",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L16586-L16614 |
|
42,586 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
var allOptions = this.dropdown.options;
// Look for multiple selections
if(this.multiple) {
var values = [],
i=0, j=allOptions.length;
for(; i<j; i++) {
if(allOptions[i].selected) {
values.push(allOptions[i].value);
}
}
return values;
}
// Only need to look for single selection
else {
return allOptions[allOptions.selectedIndex].value;
}
} | javascript | function() {
var allOptions = this.dropdown.options;
// Look for multiple selections
if(this.multiple) {
var values = [],
i=0, j=allOptions.length;
for(; i<j; i++) {
if(allOptions[i].selected) {
values.push(allOptions[i].value);
}
}
return values;
}
// Only need to look for single selection
else {
return allOptions[allOptions.selectedIndex].value;
}
} | [
"function",
"(",
")",
"{",
"var",
"allOptions",
"=",
"this",
".",
"dropdown",
".",
"options",
";",
"// Look for multiple selections",
"if",
"(",
"this",
".",
"multiple",
")",
"{",
"var",
"values",
"=",
"[",
"]",
",",
"i",
"=",
"0",
",",
"j",
"=",
"allOptions",
".",
"length",
";",
"for",
"(",
";",
"i",
"<",
"j",
";",
"i",
"++",
")",
"{",
"if",
"(",
"allOptions",
"[",
"i",
"]",
".",
"selected",
")",
"{",
"values",
".",
"push",
"(",
"allOptions",
"[",
"i",
"]",
".",
"value",
")",
";",
"}",
"}",
"return",
"values",
";",
"}",
"// Only need to look for single selection",
"else",
"{",
"return",
"allOptions",
"[",
"allOptions",
".",
"selectedIndex",
"]",
".",
"value",
";",
"}",
"}"
]
| Retrieves input value from DropdownCellEditor.
@method getInputValue | [
"Retrieves",
"input",
"value",
"from",
"DropdownCellEditor",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L16630-L16648 |
|
42,587 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
for(var i=0, j=this.radios.length; i<j; i++) {
var elRadio = this.radios[i];
if(this.value === elRadio.value) {
elRadio.checked = true;
return;
}
}
} | javascript | function() {
for(var i=0, j=this.radios.length; i<j; i++) {
var elRadio = this.radios[i];
if(this.value === elRadio.value) {
elRadio.checked = true;
return;
}
}
} | [
"function",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"j",
"=",
"this",
".",
"radios",
".",
"length",
";",
"i",
"<",
"j",
";",
"i",
"++",
")",
"{",
"var",
"elRadio",
"=",
"this",
".",
"radios",
"[",
"i",
"]",
";",
"if",
"(",
"this",
".",
"value",
"===",
"elRadio",
".",
"value",
")",
"{",
"elRadio",
".",
"checked",
"=",
"true",
";",
"return",
";",
"}",
"}",
"}"
]
| Resets RadioCellEditor UI to initial state.
@method resetForm | [
"Resets",
"RadioCellEditor",
"UI",
"to",
"initial",
"state",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L16775-L16783 |
|
42,588 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
for(var i=0, j=this.radios.length; i<j; i++) {
if(this.radios[i].checked) {
this.radios[i].focus();
return;
}
}
} | javascript | function() {
for(var i=0, j=this.radios.length; i<j; i++) {
if(this.radios[i].checked) {
this.radios[i].focus();
return;
}
}
} | [
"function",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"j",
"=",
"this",
".",
"radios",
".",
"length",
";",
"i",
"<",
"j",
";",
"i",
"++",
")",
"{",
"if",
"(",
"this",
".",
"radios",
"[",
"i",
"]",
".",
"checked",
")",
"{",
"this",
".",
"radios",
"[",
"i",
"]",
".",
"focus",
"(",
")",
";",
"return",
";",
"}",
"}",
"}"
]
| Sets focus in RadioCellEditor.
@method focus | [
"Sets",
"focus",
"in",
"RadioCellEditor",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L16790-L16797 |
|
42,589 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
for(var i=0, j=this.radios.length; i<j; i++) {
if(this.radios[i].checked) {
return this.radios[i].value;
}
}
} | javascript | function() {
for(var i=0, j=this.radios.length; i<j; i++) {
if(this.radios[i].checked) {
return this.radios[i].value;
}
}
} | [
"function",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"j",
"=",
"this",
".",
"radios",
".",
"length",
";",
"i",
"<",
"j",
";",
"i",
"++",
")",
"{",
"if",
"(",
"this",
".",
"radios",
"[",
"i",
"]",
".",
"checked",
")",
"{",
"return",
"this",
".",
"radios",
"[",
"i",
"]",
".",
"value",
";",
"}",
"}",
"}"
]
| Retrieves input value from RadioCellEditor.
@method getInputValue | [
"Retrieves",
"input",
"value",
"from",
"RadioCellEditor",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L16804-L16810 |
|
42,590 | neyric/webhookit | public/javascripts/yui/datatable/datatable.js | function() {
this.textarea.style.width = this.getTdEl().offsetWidth + "px";
this.textarea.style.height = "3em";
YAHOO.widget.TextareaCellEditor.superclass.move.call(this);
} | javascript | function() {
this.textarea.style.width = this.getTdEl().offsetWidth + "px";
this.textarea.style.height = "3em";
YAHOO.widget.TextareaCellEditor.superclass.move.call(this);
} | [
"function",
"(",
")",
"{",
"this",
".",
"textarea",
".",
"style",
".",
"width",
"=",
"this",
".",
"getTdEl",
"(",
")",
".",
"offsetWidth",
"+",
"\"px\"",
";",
"this",
".",
"textarea",
".",
"style",
".",
"height",
"=",
"\"3em\"",
";",
"YAHOO",
".",
"widget",
".",
"TextareaCellEditor",
".",
"superclass",
".",
"move",
".",
"call",
"(",
"this",
")",
";",
"}"
]
| Moves TextareaCellEditor UI to a cell.
@method move | [
"Moves",
"TextareaCellEditor",
"UI",
"to",
"a",
"cell",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable.js#L16896-L16900 |
|
42,591 | izolate/agegate | dist/index.js | validateData | function validateData(data) {
var random = Math.floor(Math.random() * (data.length - 0) + 0);
// ensure: containing Array and Object keys
var ok = Array.isArray(data) || data instanceof Array;
ok = ok && ['code', 'name', 'age'].every(function (k) {
return data[random].hasOwnProperty(k);
});
return ok ? data : this.respond(false, 'Supplied data is invalid');
} | javascript | function validateData(data) {
var random = Math.floor(Math.random() * (data.length - 0) + 0);
// ensure: containing Array and Object keys
var ok = Array.isArray(data) || data instanceof Array;
ok = ok && ['code', 'name', 'age'].every(function (k) {
return data[random].hasOwnProperty(k);
});
return ok ? data : this.respond(false, 'Supplied data is invalid');
} | [
"function",
"validateData",
"(",
"data",
")",
"{",
"var",
"random",
"=",
"Math",
".",
"floor",
"(",
"Math",
".",
"random",
"(",
")",
"*",
"(",
"data",
".",
"length",
"-",
"0",
")",
"+",
"0",
")",
";",
"// ensure: containing Array and Object keys",
"var",
"ok",
"=",
"Array",
".",
"isArray",
"(",
"data",
")",
"||",
"data",
"instanceof",
"Array",
";",
"ok",
"=",
"ok",
"&&",
"[",
"'code'",
",",
"'name'",
",",
"'age'",
"]",
".",
"every",
"(",
"function",
"(",
"k",
")",
"{",
"return",
"data",
"[",
"random",
"]",
".",
"hasOwnProperty",
"(",
"k",
")",
";",
"}",
")",
";",
"return",
"ok",
"?",
"data",
":",
"this",
".",
"respond",
"(",
"false",
",",
"'Supplied data is invalid'",
")",
";",
"}"
]
| Check data structure of supplied data
@param {Array} data | [
"Check",
"data",
"structure",
"of",
"supplied",
"data"
]
| 7869cde6d5c8805ec9424e763cb5d47dc5807408 | https://github.com/izolate/agegate/blob/7869cde6d5c8805ec9424e763cb5d47dc5807408/dist/index.js#L51-L61 |
42,592 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(id) {
this._el = Dom.get(id);
this.id = Dom.generateId(this._el,"yui-tv-auto-id-");
/**
* When animation is enabled, this event fires when the animation
* starts
* @event animStart
* @type CustomEvent
* @param {YAHOO.widget.Node} oArgs.node the node that is expanding/collapsing
* @param {String} oArgs.type the type of animation ("expand" or "collapse")
*/
this.createEvent("animStart", this);
/**
* When animation is enabled, this event fires when the animation
* completes
* @event animComplete
* @type CustomEvent
* @param {YAHOO.widget.Node} oArgs.node the node that is expanding/collapsing
* @param {String} oArgs.type the type of animation ("expand" or "collapse")
*/
this.createEvent("animComplete", this);
/**
* Fires when a node is going to be collapsed. Return false to stop
* the collapse.
* @event collapse
* @type CustomEvent
* @param {YAHOO.widget.Node} node the node that is collapsing
*/
this.createEvent("collapse", this);
/**
* Fires after a node is successfully collapsed. This event will not fire
* if the "collapse" event was cancelled.
* @event collapseComplete
* @type CustomEvent
* @param {YAHOO.widget.Node} node the node that was collapsed
*/
this.createEvent("collapseComplete", this);
/**
* Fires when a node is going to be expanded. Return false to stop
* the collapse.
* @event expand
* @type CustomEvent
* @param {YAHOO.widget.Node} node the node that is expanding
*/
this.createEvent("expand", this);
/**
* Fires after a node is successfully expanded. This event will not fire
* if the "expand" event was cancelled.
* @event expandComplete
* @type CustomEvent
* @param {YAHOO.widget.Node} node the node that was expanded
*/
this.createEvent("expandComplete", this);
/**
* Fires when the Enter key is pressed on a node that has the focus
* @event enterKeyPressed
* @type CustomEvent
* @param {YAHOO.widget.Node} node the node that has the focus
*/
this.createEvent("enterKeyPressed", this);
/**
* Fires when the label in a TextNode or MenuNode or content in an HTMLNode receives a Click.
* The listener may return false to cancel toggling and focusing on the node.
* @event clickEvent
* @type CustomEvent
* @param oArgs.event {HTMLEvent} The event object
* @param oArgs.node {YAHOO.widget.Node} node the node that was clicked
*/
this.createEvent("clickEvent", this);
/**
* Fires when the focus receives the focus, when it changes from a Node
* to another Node or when it is completely lost (blurred)
* @event focusChanged
* @type CustomEvent
* @param oArgs.oldNode {YAHOO.widget.Node} Node that had the focus or null if none
* @param oArgs.newNode {YAHOO.widget.Node} Node that receives the focus or null if none
*/
this.createEvent('focusChanged',this);
/**
* Fires when the label in a TextNode or MenuNode or content in an HTMLNode receives a double Click
* @event dblClickEvent
* @type CustomEvent
* @param oArgs.event {HTMLEvent} The event object
* @param oArgs.node {YAHOO.widget.Node} node the node that was clicked
*/
var self = this;
this.createEvent("dblClickEvent", {
scope:this,
onSubscribeCallback: function() {
self._hasDblClickSubscriber = true;
}
});
/**
* Custom event that is fired when the text node label is clicked.
* The node clicked is provided as an argument
*
* @event labelClick
* @type CustomEvent
* @param {YAHOO.widget.Node} node the node clicked
* @deprecated use clickEvent or dblClickEvent
*/
this.createEvent("labelClick", this);
/**
* Custom event fired when the highlight of a node changes.
* The node that triggered the change is provided as an argument:
* The status of the highlight can be checked in
* <a href="YAHOO.widget.Node.html#property_highlightState">nodeRef.highlightState</a>.
* Depending on <a href="YAHOO.widget.Node.html#property_propagateHighlight">nodeRef.propagateHighlight</a>, other nodes might have changed
* @event highlightEvent
* @type CustomEvent
* @param node {YAHOO.widget.Node} the node that started the change in highlighting state
*/
this.createEvent("highlightEvent",this);
this._nodes = [];
// store a global reference
TV.trees[this.id] = this;
// Set up the root node
this.root = new Widget.RootNode(this);
var LW = Widget.LogWriter;
if (this._initEditor) {
this._initEditor();
}
// YAHOO.util.Event.onContentReady(this.id, this.handleAvailable, this, true);
// YAHOO.util.Event.on(this.id, "click", this.handleClick, this, true);
} | javascript | function(id) {
this._el = Dom.get(id);
this.id = Dom.generateId(this._el,"yui-tv-auto-id-");
/**
* When animation is enabled, this event fires when the animation
* starts
* @event animStart
* @type CustomEvent
* @param {YAHOO.widget.Node} oArgs.node the node that is expanding/collapsing
* @param {String} oArgs.type the type of animation ("expand" or "collapse")
*/
this.createEvent("animStart", this);
/**
* When animation is enabled, this event fires when the animation
* completes
* @event animComplete
* @type CustomEvent
* @param {YAHOO.widget.Node} oArgs.node the node that is expanding/collapsing
* @param {String} oArgs.type the type of animation ("expand" or "collapse")
*/
this.createEvent("animComplete", this);
/**
* Fires when a node is going to be collapsed. Return false to stop
* the collapse.
* @event collapse
* @type CustomEvent
* @param {YAHOO.widget.Node} node the node that is collapsing
*/
this.createEvent("collapse", this);
/**
* Fires after a node is successfully collapsed. This event will not fire
* if the "collapse" event was cancelled.
* @event collapseComplete
* @type CustomEvent
* @param {YAHOO.widget.Node} node the node that was collapsed
*/
this.createEvent("collapseComplete", this);
/**
* Fires when a node is going to be expanded. Return false to stop
* the collapse.
* @event expand
* @type CustomEvent
* @param {YAHOO.widget.Node} node the node that is expanding
*/
this.createEvent("expand", this);
/**
* Fires after a node is successfully expanded. This event will not fire
* if the "expand" event was cancelled.
* @event expandComplete
* @type CustomEvent
* @param {YAHOO.widget.Node} node the node that was expanded
*/
this.createEvent("expandComplete", this);
/**
* Fires when the Enter key is pressed on a node that has the focus
* @event enterKeyPressed
* @type CustomEvent
* @param {YAHOO.widget.Node} node the node that has the focus
*/
this.createEvent("enterKeyPressed", this);
/**
* Fires when the label in a TextNode or MenuNode or content in an HTMLNode receives a Click.
* The listener may return false to cancel toggling and focusing on the node.
* @event clickEvent
* @type CustomEvent
* @param oArgs.event {HTMLEvent} The event object
* @param oArgs.node {YAHOO.widget.Node} node the node that was clicked
*/
this.createEvent("clickEvent", this);
/**
* Fires when the focus receives the focus, when it changes from a Node
* to another Node or when it is completely lost (blurred)
* @event focusChanged
* @type CustomEvent
* @param oArgs.oldNode {YAHOO.widget.Node} Node that had the focus or null if none
* @param oArgs.newNode {YAHOO.widget.Node} Node that receives the focus or null if none
*/
this.createEvent('focusChanged',this);
/**
* Fires when the label in a TextNode or MenuNode or content in an HTMLNode receives a double Click
* @event dblClickEvent
* @type CustomEvent
* @param oArgs.event {HTMLEvent} The event object
* @param oArgs.node {YAHOO.widget.Node} node the node that was clicked
*/
var self = this;
this.createEvent("dblClickEvent", {
scope:this,
onSubscribeCallback: function() {
self._hasDblClickSubscriber = true;
}
});
/**
* Custom event that is fired when the text node label is clicked.
* The node clicked is provided as an argument
*
* @event labelClick
* @type CustomEvent
* @param {YAHOO.widget.Node} node the node clicked
* @deprecated use clickEvent or dblClickEvent
*/
this.createEvent("labelClick", this);
/**
* Custom event fired when the highlight of a node changes.
* The node that triggered the change is provided as an argument:
* The status of the highlight can be checked in
* <a href="YAHOO.widget.Node.html#property_highlightState">nodeRef.highlightState</a>.
* Depending on <a href="YAHOO.widget.Node.html#property_propagateHighlight">nodeRef.propagateHighlight</a>, other nodes might have changed
* @event highlightEvent
* @type CustomEvent
* @param node {YAHOO.widget.Node} the node that started the change in highlighting state
*/
this.createEvent("highlightEvent",this);
this._nodes = [];
// store a global reference
TV.trees[this.id] = this;
// Set up the root node
this.root = new Widget.RootNode(this);
var LW = Widget.LogWriter;
if (this._initEditor) {
this._initEditor();
}
// YAHOO.util.Event.onContentReady(this.id, this.handleAvailable, this, true);
// YAHOO.util.Event.on(this.id, "click", this.handleClick, this, true);
} | [
"function",
"(",
"id",
")",
"{",
"this",
".",
"_el",
"=",
"Dom",
".",
"get",
"(",
"id",
")",
";",
"this",
".",
"id",
"=",
"Dom",
".",
"generateId",
"(",
"this",
".",
"_el",
",",
"\"yui-tv-auto-id-\"",
")",
";",
"/**\n * When animation is enabled, this event fires when the animation\n * starts\n * @event animStart\n * @type CustomEvent\n * @param {YAHOO.widget.Node} oArgs.node the node that is expanding/collapsing\n * @param {String} oArgs.type the type of animation (\"expand\" or \"collapse\")\n */",
"this",
".",
"createEvent",
"(",
"\"animStart\"",
",",
"this",
")",
";",
"/**\n * When animation is enabled, this event fires when the animation\n * completes\n * @event animComplete\n * @type CustomEvent\n * @param {YAHOO.widget.Node} oArgs.node the node that is expanding/collapsing\n * @param {String} oArgs.type the type of animation (\"expand\" or \"collapse\")\n */",
"this",
".",
"createEvent",
"(",
"\"animComplete\"",
",",
"this",
")",
";",
"/**\n * Fires when a node is going to be collapsed. Return false to stop\n * the collapse.\n * @event collapse\n * @type CustomEvent\n * @param {YAHOO.widget.Node} node the node that is collapsing\n */",
"this",
".",
"createEvent",
"(",
"\"collapse\"",
",",
"this",
")",
";",
"/**\n * Fires after a node is successfully collapsed. This event will not fire\n * if the \"collapse\" event was cancelled.\n * @event collapseComplete\n * @type CustomEvent\n * @param {YAHOO.widget.Node} node the node that was collapsed\n */",
"this",
".",
"createEvent",
"(",
"\"collapseComplete\"",
",",
"this",
")",
";",
"/**\n * Fires when a node is going to be expanded. Return false to stop\n * the collapse.\n * @event expand\n * @type CustomEvent\n * @param {YAHOO.widget.Node} node the node that is expanding\n */",
"this",
".",
"createEvent",
"(",
"\"expand\"",
",",
"this",
")",
";",
"/**\n * Fires after a node is successfully expanded. This event will not fire\n * if the \"expand\" event was cancelled.\n * @event expandComplete\n * @type CustomEvent\n * @param {YAHOO.widget.Node} node the node that was expanded\n */",
"this",
".",
"createEvent",
"(",
"\"expandComplete\"",
",",
"this",
")",
";",
"/**\n * Fires when the Enter key is pressed on a node that has the focus\n * @event enterKeyPressed\n * @type CustomEvent\n * @param {YAHOO.widget.Node} node the node that has the focus\n */",
"this",
".",
"createEvent",
"(",
"\"enterKeyPressed\"",
",",
"this",
")",
";",
"/**\n * Fires when the label in a TextNode or MenuNode or content in an HTMLNode receives a Click.\n * The listener may return false to cancel toggling and focusing on the node.\n * @event clickEvent\n * @type CustomEvent\n * @param oArgs.event {HTMLEvent} The event object\n * @param oArgs.node {YAHOO.widget.Node} node the node that was clicked\n */",
"this",
".",
"createEvent",
"(",
"\"clickEvent\"",
",",
"this",
")",
";",
"/**\n * Fires when the focus receives the focus, when it changes from a Node \n * to another Node or when it is completely lost (blurred)\n * @event focusChanged\n * @type CustomEvent\n * @param oArgs.oldNode {YAHOO.widget.Node} Node that had the focus or null if none\n * @param oArgs.newNode {YAHOO.widget.Node} Node that receives the focus or null if none\n */",
"this",
".",
"createEvent",
"(",
"'focusChanged'",
",",
"this",
")",
";",
"/**\n * Fires when the label in a TextNode or MenuNode or content in an HTMLNode receives a double Click\n * @event dblClickEvent\n * @type CustomEvent\n * @param oArgs.event {HTMLEvent} The event object\n * @param oArgs.node {YAHOO.widget.Node} node the node that was clicked\n */",
"var",
"self",
"=",
"this",
";",
"this",
".",
"createEvent",
"(",
"\"dblClickEvent\"",
",",
"{",
"scope",
":",
"this",
",",
"onSubscribeCallback",
":",
"function",
"(",
")",
"{",
"self",
".",
"_hasDblClickSubscriber",
"=",
"true",
";",
"}",
"}",
")",
";",
"/**\n * Custom event that is fired when the text node label is clicked. \n * The node clicked is provided as an argument\n *\n * @event labelClick\n * @type CustomEvent\n * @param {YAHOO.widget.Node} node the node clicked\n * @deprecated use clickEvent or dblClickEvent\n */",
"this",
".",
"createEvent",
"(",
"\"labelClick\"",
",",
"this",
")",
";",
"/**\n * Custom event fired when the highlight of a node changes.\n * The node that triggered the change is provided as an argument:\n * The status of the highlight can be checked in \n * <a href=\"YAHOO.widget.Node.html#property_highlightState\">nodeRef.highlightState</a>.\n * Depending on <a href=\"YAHOO.widget.Node.html#property_propagateHighlight\">nodeRef.propagateHighlight</a>, other nodes might have changed\n * @event highlightEvent\n * @type CustomEvent\n * @param node {YAHOO.widget.Node} the node that started the change in highlighting state\n */",
"this",
".",
"createEvent",
"(",
"\"highlightEvent\"",
",",
"this",
")",
";",
"this",
".",
"_nodes",
"=",
"[",
"]",
";",
"// store a global reference",
"TV",
".",
"trees",
"[",
"this",
".",
"id",
"]",
"=",
"this",
";",
"// Set up the root node",
"this",
".",
"root",
"=",
"new",
"Widget",
".",
"RootNode",
"(",
"this",
")",
";",
"var",
"LW",
"=",
"Widget",
".",
"LogWriter",
";",
"if",
"(",
"this",
".",
"_initEditor",
")",
"{",
"this",
".",
"_initEditor",
"(",
")",
";",
"}",
"// YAHOO.util.Event.onContentReady(this.id, this.handleAvailable, this, true);",
"// YAHOO.util.Event.on(this.id, \"click\", this.handleClick, this, true);",
"}"
]
| Initializes the tree
@method init
@parm {string|HTMLElement} id the id of the element that will hold the tree
@private | [
"Initializes",
"the",
"tree"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L266-L413 |
|
42,593 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function (ev) {
var target = Event.getTarget(ev);
// go up looking for a TD with a className with a ygtv prefix
while (target && !(target.tagName.toUpperCase() == 'TD' && Dom.hasClass(target.parentNode,'ygtvrow'))) {
target = Dom.getAncestorByTagName(target,'td');
}
if (Lang.isNull(target)) { return null; }
// If it is a spacer cell, do nothing
if (/\bygtv(blank)?depthcell/.test(target.className)) { return null;}
// If it has an id, search for the node number and see if it belongs to a node in this tree.
if (target.id) {
var m = target.id.match(/\bygtv([^\d]*)(.*)/);
if (m && m[2] && this._nodes[m[2]]) {
return target;
}
}
return null;
} | javascript | function (ev) {
var target = Event.getTarget(ev);
// go up looking for a TD with a className with a ygtv prefix
while (target && !(target.tagName.toUpperCase() == 'TD' && Dom.hasClass(target.parentNode,'ygtvrow'))) {
target = Dom.getAncestorByTagName(target,'td');
}
if (Lang.isNull(target)) { return null; }
// If it is a spacer cell, do nothing
if (/\bygtv(blank)?depthcell/.test(target.className)) { return null;}
// If it has an id, search for the node number and see if it belongs to a node in this tree.
if (target.id) {
var m = target.id.match(/\bygtv([^\d]*)(.*)/);
if (m && m[2] && this._nodes[m[2]]) {
return target;
}
}
return null;
} | [
"function",
"(",
"ev",
")",
"{",
"var",
"target",
"=",
"Event",
".",
"getTarget",
"(",
"ev",
")",
";",
"// go up looking for a TD with a className with a ygtv prefix",
"while",
"(",
"target",
"&&",
"!",
"(",
"target",
".",
"tagName",
".",
"toUpperCase",
"(",
")",
"==",
"'TD'",
"&&",
"Dom",
".",
"hasClass",
"(",
"target",
".",
"parentNode",
",",
"'ygtvrow'",
")",
")",
")",
"{",
"target",
"=",
"Dom",
".",
"getAncestorByTagName",
"(",
"target",
",",
"'td'",
")",
";",
"}",
"if",
"(",
"Lang",
".",
"isNull",
"(",
"target",
")",
")",
"{",
"return",
"null",
";",
"}",
"// If it is a spacer cell, do nothing",
"if",
"(",
"/",
"\\bygtv(blank)?depthcell",
"/",
".",
"test",
"(",
"target",
".",
"className",
")",
")",
"{",
"return",
"null",
";",
"}",
"// If it has an id, search for the node number and see if it belongs to a node in this tree.",
"if",
"(",
"target",
".",
"id",
")",
"{",
"var",
"m",
"=",
"target",
".",
"id",
".",
"match",
"(",
"/",
"\\bygtv([^\\d]*)(.*)",
"/",
")",
";",
"if",
"(",
"m",
"&&",
"m",
"[",
"2",
"]",
"&&",
"this",
".",
"_nodes",
"[",
"m",
"[",
"2",
"]",
"]",
")",
"{",
"return",
"target",
";",
"}",
"}",
"return",
"null",
";",
"}"
]
| Returns the TD element where the event has occurred
@method _getEventTargetTdEl
@private | [
"Returns",
"the",
"TD",
"element",
"where",
"the",
"event",
"has",
"occurred"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L591-L608 |
|
42,594 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function (ev) {
var self = this,
td = this._getEventTargetTdEl(ev),
node,
target,
toggle = function (force) {
node.focus();
if (force || !node.href) {
node.toggle();
try {
Event.preventDefault(ev);
} catch (e) {
// @TODO
// For some reason IE8 is providing an event object with
// most of the fields missing, but only when clicking on
// the node's label, and only when working with inline
// editing. This generates a "Member not found" error
// in that browser. Determine if this is a browser
// bug, or a problem with this code. Already checked to
// see if the problem has to do with access the event
// in the outer scope, and that isn't the problem.
// Maybe the markup for inline editing is broken.
}
}
};
if (!td) {
return;
}
node = this.getNodeByElement(td);
if (!node) {
return;
}
// exception to handle deprecated event labelClick
// @TODO take another look at this deprecation. It is common for people to
// only be interested in the label click, so why make them have to test
// the node type to figure out whether the click was on the label?
target = Event.getTarget(ev);
if (Dom.hasClass(target, node.labelStyle) || Dom.getAncestorByClassName(target,node.labelStyle)) {
this.fireEvent('labelClick',node);
}
// If it is a toggle cell, toggle
if (/\bygtv[tl][mp]h?h?/.test(td.className)) {
toggle(true);
} else {
if (this._dblClickTimer) {
window.clearTimeout(this._dblClickTimer);
this._dblClickTimer = null;
} else {
if (this._hasDblClickSubscriber) {
this._dblClickTimer = window.setTimeout(function () {
self._dblClickTimer = null;
if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) {
toggle();
}
}, 200);
} else {
if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) {
toggle();
}
}
}
}
} | javascript | function (ev) {
var self = this,
td = this._getEventTargetTdEl(ev),
node,
target,
toggle = function (force) {
node.focus();
if (force || !node.href) {
node.toggle();
try {
Event.preventDefault(ev);
} catch (e) {
// @TODO
// For some reason IE8 is providing an event object with
// most of the fields missing, but only when clicking on
// the node's label, and only when working with inline
// editing. This generates a "Member not found" error
// in that browser. Determine if this is a browser
// bug, or a problem with this code. Already checked to
// see if the problem has to do with access the event
// in the outer scope, and that isn't the problem.
// Maybe the markup for inline editing is broken.
}
}
};
if (!td) {
return;
}
node = this.getNodeByElement(td);
if (!node) {
return;
}
// exception to handle deprecated event labelClick
// @TODO take another look at this deprecation. It is common for people to
// only be interested in the label click, so why make them have to test
// the node type to figure out whether the click was on the label?
target = Event.getTarget(ev);
if (Dom.hasClass(target, node.labelStyle) || Dom.getAncestorByClassName(target,node.labelStyle)) {
this.fireEvent('labelClick',node);
}
// If it is a toggle cell, toggle
if (/\bygtv[tl][mp]h?h?/.test(td.className)) {
toggle(true);
} else {
if (this._dblClickTimer) {
window.clearTimeout(this._dblClickTimer);
this._dblClickTimer = null;
} else {
if (this._hasDblClickSubscriber) {
this._dblClickTimer = window.setTimeout(function () {
self._dblClickTimer = null;
if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) {
toggle();
}
}, 200);
} else {
if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) {
toggle();
}
}
}
}
} | [
"function",
"(",
"ev",
")",
"{",
"var",
"self",
"=",
"this",
",",
"td",
"=",
"this",
".",
"_getEventTargetTdEl",
"(",
"ev",
")",
",",
"node",
",",
"target",
",",
"toggle",
"=",
"function",
"(",
"force",
")",
"{",
"node",
".",
"focus",
"(",
")",
";",
"if",
"(",
"force",
"||",
"!",
"node",
".",
"href",
")",
"{",
"node",
".",
"toggle",
"(",
")",
";",
"try",
"{",
"Event",
".",
"preventDefault",
"(",
"ev",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"// @TODO",
"// For some reason IE8 is providing an event object with",
"// most of the fields missing, but only when clicking on",
"// the node's label, and only when working with inline",
"// editing. This generates a \"Member not found\" error",
"// in that browser. Determine if this is a browser",
"// bug, or a problem with this code. Already checked to",
"// see if the problem has to do with access the event",
"// in the outer scope, and that isn't the problem.",
"// Maybe the markup for inline editing is broken.",
"}",
"}",
"}",
";",
"if",
"(",
"!",
"td",
")",
"{",
"return",
";",
"}",
"node",
"=",
"this",
".",
"getNodeByElement",
"(",
"td",
")",
";",
"if",
"(",
"!",
"node",
")",
"{",
"return",
";",
"}",
"// exception to handle deprecated event labelClick",
"// @TODO take another look at this deprecation. It is common for people to",
"// only be interested in the label click, so why make them have to test",
"// the node type to figure out whether the click was on the label?",
"target",
"=",
"Event",
".",
"getTarget",
"(",
"ev",
")",
";",
"if",
"(",
"Dom",
".",
"hasClass",
"(",
"target",
",",
"node",
".",
"labelStyle",
")",
"||",
"Dom",
".",
"getAncestorByClassName",
"(",
"target",
",",
"node",
".",
"labelStyle",
")",
")",
"{",
"this",
".",
"fireEvent",
"(",
"'labelClick'",
",",
"node",
")",
";",
"}",
"// If it is a toggle cell, toggle",
"if",
"(",
"/",
"\\bygtv[tl][mp]h?h?",
"/",
".",
"test",
"(",
"td",
".",
"className",
")",
")",
"{",
"toggle",
"(",
"true",
")",
";",
"}",
"else",
"{",
"if",
"(",
"this",
".",
"_dblClickTimer",
")",
"{",
"window",
".",
"clearTimeout",
"(",
"this",
".",
"_dblClickTimer",
")",
";",
"this",
".",
"_dblClickTimer",
"=",
"null",
";",
"}",
"else",
"{",
"if",
"(",
"this",
".",
"_hasDblClickSubscriber",
")",
"{",
"this",
".",
"_dblClickTimer",
"=",
"window",
".",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"self",
".",
"_dblClickTimer",
"=",
"null",
";",
"if",
"(",
"self",
".",
"fireEvent",
"(",
"'clickEvent'",
",",
"{",
"event",
":",
"ev",
",",
"node",
":",
"node",
"}",
")",
"!==",
"false",
")",
"{",
"toggle",
"(",
")",
";",
"}",
"}",
",",
"200",
")",
";",
"}",
"else",
"{",
"if",
"(",
"self",
".",
"fireEvent",
"(",
"'clickEvent'",
",",
"{",
"event",
":",
"ev",
",",
"node",
":",
"node",
"}",
")",
"!==",
"false",
")",
"{",
"toggle",
"(",
")",
";",
"}",
"}",
"}",
"}",
"}"
]
| Event listener for click events
@method _onClickEvent
@private | [
"Event",
"listener",
"for",
"click",
"events"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L614-L680 |
|
42,595 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function (ev) {
if (!this._hasDblClickSubscriber) { return; }
var td = this._getEventTargetTdEl(ev);
if (!td) {return;}
if (!(/\bygtv[tl][mp]h?h?/.test(td.className))) {
this.fireEvent('dblClickEvent', {event:ev, node:this.getNodeByElement(td)});
if (this._dblClickTimer) {
window.clearTimeout(this._dblClickTimer);
this._dblClickTimer = null;
}
}
} | javascript | function (ev) {
if (!this._hasDblClickSubscriber) { return; }
var td = this._getEventTargetTdEl(ev);
if (!td) {return;}
if (!(/\bygtv[tl][mp]h?h?/.test(td.className))) {
this.fireEvent('dblClickEvent', {event:ev, node:this.getNodeByElement(td)});
if (this._dblClickTimer) {
window.clearTimeout(this._dblClickTimer);
this._dblClickTimer = null;
}
}
} | [
"function",
"(",
"ev",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_hasDblClickSubscriber",
")",
"{",
"return",
";",
"}",
"var",
"td",
"=",
"this",
".",
"_getEventTargetTdEl",
"(",
"ev",
")",
";",
"if",
"(",
"!",
"td",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"(",
"/",
"\\bygtv[tl][mp]h?h?",
"/",
".",
"test",
"(",
"td",
".",
"className",
")",
")",
")",
"{",
"this",
".",
"fireEvent",
"(",
"'dblClickEvent'",
",",
"{",
"event",
":",
"ev",
",",
"node",
":",
"this",
".",
"getNodeByElement",
"(",
"td",
")",
"}",
")",
";",
"if",
"(",
"this",
".",
"_dblClickTimer",
")",
"{",
"window",
".",
"clearTimeout",
"(",
"this",
".",
"_dblClickTimer",
")",
";",
"this",
".",
"_dblClickTimer",
"=",
"null",
";",
"}",
"}",
"}"
]
| Event listener for double-click events
@method _onDblClickEvent
@private | [
"Event",
"listener",
"for",
"double",
"-",
"click",
"events"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L687-L699 |
|
42,596 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function (ev) {
var target;
if ((target = this._getEventTargetTdEl(ev)) && (target = this.getNodeByElement(target)) && (target = target.getToggleEl())) {
target.className = target.className.replace(/\bygtv([lt])([mp])\b/gi,'ygtv$1$2h');
}
} | javascript | function (ev) {
var target;
if ((target = this._getEventTargetTdEl(ev)) && (target = this.getNodeByElement(target)) && (target = target.getToggleEl())) {
target.className = target.className.replace(/\bygtv([lt])([mp])\b/gi,'ygtv$1$2h');
}
} | [
"function",
"(",
"ev",
")",
"{",
"var",
"target",
";",
"if",
"(",
"(",
"target",
"=",
"this",
".",
"_getEventTargetTdEl",
"(",
"ev",
")",
")",
"&&",
"(",
"target",
"=",
"this",
".",
"getNodeByElement",
"(",
"target",
")",
")",
"&&",
"(",
"target",
"=",
"target",
".",
"getToggleEl",
"(",
")",
")",
")",
"{",
"target",
".",
"className",
"=",
"target",
".",
"className",
".",
"replace",
"(",
"/",
"\\bygtv([lt])([mp])\\b",
"/",
"gi",
",",
"'ygtv$1$2h'",
")",
";",
"}",
"}"
]
| Event listener for mouse over events
@method _onMouseOverEvent
@private | [
"Event",
"listener",
"for",
"mouse",
"over",
"events"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L705-L710 |
|
42,597 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
var html = this.root.getHtml(),
el = this.getEl();
el.innerHTML = html;
if (!this._hasEvents) {
Event.on(el, 'click', this._onClickEvent, this, true);
Event.on(el, 'dblclick', this._onDblClickEvent, this, true);
Event.on(el, 'mouseover', this._onMouseOverEvent, this, true);
Event.on(el, 'mouseout', this._onMouseOutEvent, this, true);
Event.on(el, 'keydown', this._onKeyDownEvent, this, true);
}
this._hasEvents = true;
} | javascript | function() {
var html = this.root.getHtml(),
el = this.getEl();
el.innerHTML = html;
if (!this._hasEvents) {
Event.on(el, 'click', this._onClickEvent, this, true);
Event.on(el, 'dblclick', this._onDblClickEvent, this, true);
Event.on(el, 'mouseover', this._onMouseOverEvent, this, true);
Event.on(el, 'mouseout', this._onMouseOutEvent, this, true);
Event.on(el, 'keydown', this._onKeyDownEvent, this, true);
}
this._hasEvents = true;
} | [
"function",
"(",
")",
"{",
"var",
"html",
"=",
"this",
".",
"root",
".",
"getHtml",
"(",
")",
",",
"el",
"=",
"this",
".",
"getEl",
"(",
")",
";",
"el",
".",
"innerHTML",
"=",
"html",
";",
"if",
"(",
"!",
"this",
".",
"_hasEvents",
")",
"{",
"Event",
".",
"on",
"(",
"el",
",",
"'click'",
",",
"this",
".",
"_onClickEvent",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"on",
"(",
"el",
",",
"'dblclick'",
",",
"this",
".",
"_onDblClickEvent",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"on",
"(",
"el",
",",
"'mouseover'",
",",
"this",
".",
"_onMouseOverEvent",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"on",
"(",
"el",
",",
"'mouseout'",
",",
"this",
".",
"_onMouseOutEvent",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"on",
"(",
"el",
",",
"'keydown'",
",",
"this",
".",
"_onKeyDownEvent",
",",
"this",
",",
"true",
")",
";",
"}",
"this",
".",
"_hasEvents",
"=",
"true",
";",
"}"
]
| Renders the tree boilerplate and visible nodes
@method render | [
"Renders",
"the",
"tree",
"boilerplate",
"and",
"visible",
"nodes"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L848-L860 |
|
42,598 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(property, value) {
for (var i in this._nodes) {
if (this._nodes.hasOwnProperty(i)) {
var n = this._nodes[i];
if ((property in n && n[property] == value) || (n.data && value == n.data[property])) {
return n;
}
}
}
return null;
} | javascript | function(property, value) {
for (var i in this._nodes) {
if (this._nodes.hasOwnProperty(i)) {
var n = this._nodes[i];
if ((property in n && n[property] == value) || (n.data && value == n.data[property])) {
return n;
}
}
}
return null;
} | [
"function",
"(",
"property",
",",
"value",
")",
"{",
"for",
"(",
"var",
"i",
"in",
"this",
".",
"_nodes",
")",
"{",
"if",
"(",
"this",
".",
"_nodes",
".",
"hasOwnProperty",
"(",
"i",
")",
")",
"{",
"var",
"n",
"=",
"this",
".",
"_nodes",
"[",
"i",
"]",
";",
"if",
"(",
"(",
"property",
"in",
"n",
"&&",
"n",
"[",
"property",
"]",
"==",
"value",
")",
"||",
"(",
"n",
".",
"data",
"&&",
"value",
"==",
"n",
".",
"data",
"[",
"property",
"]",
")",
")",
"{",
"return",
"n",
";",
"}",
"}",
"}",
"return",
"null",
";",
"}"
]
| Returns a node that has a matching property and value in the data
object that was passed into its constructor.
@method getNodeByProperty
@param {object} property the property to search (usually a string)
@param {object} value the value we want to find (usuall an int or string)
@return {Node} the matching node, null if no match | [
"Returns",
"a",
"node",
"that",
"has",
"a",
"matching",
"property",
"and",
"value",
"in",
"the",
"data",
"object",
"that",
"was",
"passed",
"into",
"its",
"constructor",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L950-L961 |
|
42,599 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(property, value) {
var values = [];
for (var i in this._nodes) {
if (this._nodes.hasOwnProperty(i)) {
var n = this._nodes[i];
if ((property in n && n[property] == value) || (n.data && value == n.data[property])) {
values.push(n);
}
}
}
return (values.length) ? values : null;
} | javascript | function(property, value) {
var values = [];
for (var i in this._nodes) {
if (this._nodes.hasOwnProperty(i)) {
var n = this._nodes[i];
if ((property in n && n[property] == value) || (n.data && value == n.data[property])) {
values.push(n);
}
}
}
return (values.length) ? values : null;
} | [
"function",
"(",
"property",
",",
"value",
")",
"{",
"var",
"values",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"in",
"this",
".",
"_nodes",
")",
"{",
"if",
"(",
"this",
".",
"_nodes",
".",
"hasOwnProperty",
"(",
"i",
")",
")",
"{",
"var",
"n",
"=",
"this",
".",
"_nodes",
"[",
"i",
"]",
";",
"if",
"(",
"(",
"property",
"in",
"n",
"&&",
"n",
"[",
"property",
"]",
"==",
"value",
")",
"||",
"(",
"n",
".",
"data",
"&&",
"value",
"==",
"n",
".",
"data",
"[",
"property",
"]",
")",
")",
"{",
"values",
".",
"push",
"(",
"n",
")",
";",
"}",
"}",
"}",
"return",
"(",
"values",
".",
"length",
")",
"?",
"values",
":",
"null",
";",
"}"
]
| Returns a collection of nodes that have a matching property
and value in the data object that was passed into its constructor.
@method getNodesByProperty
@param {object} property the property to search (usually a string)
@param {object} value the value we want to find (usuall an int or string)
@return {Array} the matching collection of nodes, null if no match | [
"Returns",
"a",
"collection",
"of",
"nodes",
"that",
"have",
"a",
"matching",
"property",
"and",
"value",
"in",
"the",
"data",
"object",
"that",
"was",
"passed",
"into",
"its",
"constructor",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L971-L983 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.