_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q30600 | train | function() {
for (var p=0;p<this.pages.length;++p) {
var cal = this.pages[p];
cal.nextMonth();
}
} | javascript | {
"resource": ""
} | |
q30601 | train | function() {
for (var p=this.pages.length-1;p>=0;--p) {
var cal = this.pages[p];
cal.previousMonth();
}
} | javascript | {
"resource": ""
} | |
q30602 | train | function() {
for (var p=0;p<this.pages.length;++p) {
var cal = this.pages[p];
cal.nextYear();
}
} | javascript | {
"resource": ""
} | |
q30603 | train | function() {
for (var p=0;p<this.pages.length;++p) {
var cal = this.pages[p];
cal.previousYear();
}
} | javascript | {
"resource": ""
} | |
q30604 | train | function(month, fnRender) {
for (var p=0;p<this.pages.length;++p) {
var cal = this.pages[p];
cal.addMonthRenderer(month, fnRender);
}
} | javascript | {
"resource": ""
} | |
q30605 | train | function(weekday, fnRender) {
for (var p=0;p<this.pages.length;++p) {
var cal = this.pages[p];
cal.addWeekdayRenderer(weekday, fnRender);
}
} | javascript | {
"resource": ""
} | |
q30606 | train | function(date, iMonth) {
// Bug in Safari 1.3, 2.0 (WebKit build < 420), Date.setMonth does not work consistently if iMonth is not 0-11
if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420 && (iMonth < 0 || iMonth > 11)) {
var newDate = DateMath.add(date, DateMath.MONTH, iMonth-date.getMonth... | javascript | {
"resource": ""
} | |
q30607 | train | function() {
var w = 0;
for (var p=0;p<this.pages.length;++p) {
var cal = this.pages[p];
w += cal.oDomContainer.offsetWidth;
}
if (w > 0) {
this.oDomContainer.style.width = w + "px";
}
} | javascript | {
"resource": ""
} | |
q30608 | train | function() {
if (this.beforeDestroyEvent.fire()) {
var cal = this;
// Child objects
if (cal.navigator) {
cal.navigator.destroy();
}
if (cal.cfg) {
cal.cfg.destroy();
}
// DOM even... | javascript | {
"resource": ""
} | |
q30609 | train | function(cal) {
var calBox = cal.oDomContainer;
this.cal = cal;
this.id = calBox.id + YAHOO.widget.CalendarNavigator.ID_SUFFIX;
this._doc = calBox.ownerDocument;
/**
* Private flag, to identify IE Quirks
* @private
* @property __isIEQuirks
*/... | javascript | {
"resource": ""
} | |
q30610 | train | function(nYear) {
var yrPattern = YAHOO.widget.CalendarNavigator.YR_PATTERN;
if (YAHOO.lang.isNumber(nYear) && yrPattern.test(nYear+"")) {
this._year = nYear;
}
this._updateYearUI();
} | javascript | {
"resource": ""
} | |
q30611 | train | function() {
this.cal.beforeRenderNavEvent.fire();
if (!this.__rendered) {
this.createNav();
this.createMask();
this.applyListeners();
this.__rendered = true;
}
this.cal.renderNavEvent.fire();
} | javascript | {
"resource": ""
} | |
q30612 | train | function(html) {
var NAV = YAHOO.widget.CalendarNavigator,
C = NAV.CLASSES,
h = html; // just to use a shorter name
h[h.length] = '<div class="' + C.MONTH + '">';
this.renderMonth(h);
h[h.length] = '</div>';
h[h.length] = '<div class="' + C.YEAR + '">';
... | javascript | {
"resource": ""
} | |
q30613 | train | function(html) {
var NAV = YAHOO.widget.CalendarNavigator,
C = NAV.CLASSES;
var id = this.id + NAV.MONTH_SUFFIX,
mf = this.__getCfg("monthFormat"),
months = this.cal.cfg.getProperty((mf == YAHOO.widget.Calendar.SHORT) ? "MONTHS_SHORT" : "MONTHS_LONG"),
h ... | javascript | {
"resource": ""
} | |
q30614 | train | function(html) {
var NAV = YAHOO.widget.CalendarNavigator,
C = NAV.CLASSES;
var id = this.id + NAV.YEAR_SUFFIX,
size = NAV.YR_MAX_DIGITS,
h = html;
h[h.length] = '<label for="' + id + '">';
h[h.length] = this.__getCfg("year", true);
h[h.lengt... | javascript | {
"resource": ""
} | |
q30615 | train | function(cal) {
var date = YAHOO.widget.DateMath.getDate(this.getYear() - cal.cfg.getProperty("YEAR_OFFSET"), this.getMonth(), 1);
cal.cfg.setProperty("pagedate", date);
cal.render();
} | javascript | {
"resource": ""
} | |
q30616 | train | function() {
YAHOO.util.Dom.addClass(this.yearEl, YAHOO.widget.CalendarNavigator.CLASSES.INVALID);
} | javascript | {
"resource": ""
} | |
q30617 | train | function() {
var el = this.submitEl,
f = this.__getCfg("initialFocus");
if (f && f.toLowerCase) {
f = f.toLowerCase();
if (f == "year") {
el = this.yearEl;
try {
this.yearEl.select();
} catch (selErr... | javascript | {
"resource": ""
} | |
q30618 | train | function() {
var NAV = YAHOO.widget.CalendarNavigator;
var yr = null;
if (this.yearEl) {
var value = this.yearEl.value;
value = value.replace(NAV.TRIM, "$1");
if (NAV.YR_PATTERN.test(value)) {
yr = parseInt(value, 10);
}
}... | javascript | {
"resource": ""
} | |
q30619 | topLevelNodeBefore | train | function topLevelNodeBefore(node, top) {
while (!node.previousSibling && node.parentNode != top)
node = node.parentNode;
return topLevelNodeAt(node.previousSibling, top);
} | javascript | {
"resource": ""
} |
q30620 | moveToNodeStart | train | function moveToNodeStart(range, node) {
if (node.nodeType == 3) {
var count = 0, cur = node.previousSibling;
while (cur && cur.nodeType == 3) {
count += cur.nodeValue.length;
cur = cur.previousSibling;
}
if (cur) {
try{range.moveToEleme... | javascript | {
"resource": ""
} |
q30621 | focusIssue | train | function focusIssue() {
return cs.start.node == cs.end.node && cs.start.offset == 0 && cs.end.offset == 0;
} | javascript | {
"resource": ""
} |
q30622 | selectRange | train | function selectRange(range, window) {
var selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
} | javascript | {
"resource": ""
} |
q30623 | train | function (p_bDisabled) {
var nButtons = this.getCount(),
i;
if (nButtons > 0) {
i = nButtons - 1;
do {
this._buttons[i].set("disabled", p_bDisabled);
... | javascript | {
"resource": ""
} | |
q30624 | train | function() {
var columndefs = this.setColumnDefs();
/**
* YUI's datatable instance
*/
this.datatable = new YAHOO.widget.DataTable(this.element, columndefs, this.options.datasource, this.options.datatableOpts);
this.datatable.subscribe('cellClickEvent', this._onCellClick, this, true);
... | javascript | {
"resource": ""
} | |
q30625 | train | function(oArgs) {
var elCell = oArgs.target;
if(Dom.hasClass(elCell, "yui-dt-editable") || Dom.hasClass(elCell,"yui-dt-col-delete") || Dom.hasClass(elCell,"yui-dt-col-modify") ) {
this.highlightCell(elCell);
}
} | javascript | {
"resource": ""
} | |
q30626 | train | function() {
var columndefs = this.options.columnDefs || this.fieldsToColumndefs(this.options.fields);
// Adding modify column if we use form editing and if allowModify is true
if(this.options.allowModify ) {
columndefs = columndefs.concat([{
key:'modify',
label:' ',
... | javascript | {
"resource": ""
} | |
q30627 | train | function() {
var that = this;
this.dialog = new inputEx.widget.Dialog({
id: this.options.dialogId,
inputExDef: {
type: 'form',
fields: this.options.fields,
buttons: [
{type: 'submit', value: msgs.saveText, onClick: function() {... | javascript | {
"resource": ""
} | |
q30628 | train | function() {
var newvalues, record;
//Validate the Form
if ( !this.dialog.getForm().validate() ) return ;
// Update the record
if(!this.insertNewRecord){
// Update the row
newvalues = this.dialog.getValue();
this.datatable.updateRow( this.selectedRecord , newvalues );
// Get... | javascript | {
"resource": ""
} | |
q30629 | train | function(rowIndex) {
if(!this.dialog) {
this.renderDialog();
}
// NOT Inserting new record
this.insertNewRecord = false;
// Set the selected Record
this.selectedRecord = rowIndex;
// Get the selected Record
var record = this.datatable.getRecord(this.selectedRecord);
thi... | javascript | {
"resource": ""
} | |
q30630 | train | function(e) {
if(!this.dialog) {
this.renderDialog();
}
// Inserting new record
this.insertNewRecord = true;
this.dialog.whenFormAvailable({
fn: function() {
this.dialog.getForm().clear();
this.dialog.show();
},
scope: this
});
} | javascript | {
"resource": ""
} | |
q30631 | train | function(fields) {
var columndefs = [];
for(var i = 0 ; i < fields.length ; i++) {
columndefs.push( this.fieldToColumndef(fields[i]) );
}
return columndefs;
} | javascript | {
"resource": ""
} | |
q30632 | train | function(field) {
var key, label, colmunDef;
// Retro-compatibility with inputParms
if (lang.isObject(field.inputParams)) {
key = field.inputParams.name;
label = field.inputParams.label;
// New prefered way to set options of a field
} else {
... | javascript | {
"resource": ""
} | |
q30633 | train | function(callback) {
async.waterfall([
// 1. Resolve loose package versions.
function(done) {
var master = this.master;
var packageToVersions = this.packageToVersions;
Package.versions(master, packageToVersions, function(err, result) {
this.packageToVersions = result;
... | javascript | {
"resource": ""
} | |
q30634 | train | function(parent, depToVersions) {
var newdeps = {};
var packages = Object.keys(depToVersions);
packages.forEach(function(package) {
var currVersions = this.packageToVersions[package];
var depVersions = depToVersions[package];
newdeps[package] = {};
// Check if we are watching this p... | javascript | {
"resource": ""
} | |
q30635 | train | function(callback) {
async.waterfall([
// Make root directory.
maybeMkdir.bind(null, this.root),
// Make tmp directory.
function(done) {
this.tempdir = path.join(this.root, '.tmp');
maybeMkdir(this.tempdir, { purge: true }, done);
}.bind(this),
// Make directori... | javascript | {
"resource": ""
} | |
q30636 | train | function(callback) {
async.series([
this.downloadPackageRootObjects.bind(this),
this.downloadPackageVersions.bind(this)
], function(err) {
return callback && callback(err);
});
} | javascript | {
"resource": ""
} | |
q30637 | train | function(callback) {
var packages = Object.keys(this.packageToVersions);
async.parallel(packages.map(function(package) {
var packageRootUrl = url.resolve(this.master, package);
return this.downloadPackageRootObject.bind(this, package, packageRootUrl);
}.bind(this)), function(err) {
return ... | javascript | {
"resource": ""
} | |
q30638 | train | function(callback) {
var packageToVersions = this.packageToVersions;
var count = Package.versionCount(packageToVersions);
if (count === 0) {
return callback && callback();
}
var packages = Object.keys(packageToVersions);
async.parallel(
packages
.map(function(package) {
... | javascript | {
"resource": ""
} | |
q30639 | train | function(callback) {
var packageToVersions = this.packageToVersions;
var count = Package.versionCount(packageToVersions);
if (count === 0) {
return callback && callback();
}
// For each package version, check shasum and copy to server root.
var packages = Object.keys(packageToVersions);
... | javascript | {
"resource": ""
} | |
q30640 | train | function (container, type, fn) {
var sType = type,
returnVal = false,
index,
cacheItem;
// Look up the real event--either mouseover or mouseout
if (type == "mouseenter" || type == "mouseleave") {
sType = Event._getType(type);
}
index = Event._getCacheIndex(delegates, container, sType, ... | javascript | {
"resource": ""
} | |
q30641 | train | function() {
var val = this.value;
if (this.getter) {
val = this.getter.call(this.owner, this.name, val);
}
return val;
} | javascript | {
"resource": ""
} | |
q30642 | train | function(value, silent) {
var beforeRetVal,
owner = this.owner,
name = this.name;
var event = {
type: name,
prevValue: this.getValue(),
newValue: value
};
if (this.readOnly || ( this.writeOnce && this._written... | javascript | {
"resource": ""
} | |
q30643 | train | function(map, init) {
map = map || {};
if (init) {
this._written = false; // reset writeOnce
}
this._initialConfig = this._initialConfig || {};
for (var key in map) {
if ( map.hasOwnProperty(key) ) {
this[key] = map[key];
... | javascript | {
"resource": ""
} | |
q30644 | train | function(key){
this._configs = this._configs || {};
var config = this._configs[key];
if (!config || !this._configs.hasOwnProperty(key)) {
return null;
}
return config.getValue();
} | javascript | {
"resource": ""
} | |
q30645 | train | function(key, value, silent){
this._configs = this._configs || {};
var config = this._configs[key];
if (!config) {
return false;
}
return config.setValue(value, silent);
} | javascript | {
"resource": ""
} | |
q30646 | train | function(){
this._configs = this._configs;
var keys = [], key;
for (key in this._configs) {
if ( Lang.hasOwnProperty(this._configs, key) &&
!Lang.isUndefined(this._configs[key]) ) {
keys[keys.length] = key;
... | javascript | {
"resource": ""
} | |
q30647 | train | function(map, silent){
for (var key in map) {
if ( Lang.hasOwnProperty(map, key) ) {
this.set(key, map[key], silent);
}
}
} | javascript | {
"resource": ""
} | |
q30648 | train | function(key, silent){
this._configs = this._configs || {};
if (this._configs[key]) {
this.set(key, this._configs[key]._initialConfig.value, silent);
return true;
}
return false;
} | javascript | {
"resource": ""
} | |
q30649 | train | function(key, silent) {
this._configs = this._configs || {};
var configs = this._configs;
key = ( ( Lang.isString(key) ) ? [key] : key ) ||
this.getAttributeKeys();
for (var i = 0, len = key.length; i < len; ++i) {
... | javascript | {
"resource": ""
} | |
q30650 | train | function(key) {
this._configs = this._configs || {};
var config = this._configs[key] || {};
var map = {}; // returning a copy to prevent overrides
for (key in config) {
if ( Lang.hasOwnProperty(config, key) ) {
map[key] = c... | javascript | {
"resource": ""
} | |
q30651 | train | function(key, map, init) {
this._configs = this._configs || {};
map = map || {};
if (!this._configs[key]) {
map.name = key;
this._configs[key] = this.createAttribute(map);
} else {
this._configs[key].configure(map, init);
... | javascript | {
"resource": ""
} | |
q30652 | train | function(type, callback) {
this._events = this._events || {};
if ( !(type in this._events) ) {
this._events[type] = this.createEvent(type);
}
YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments);
} | javascript | {
"resource": ""
} | |
q30653 | train | function(e) {
var type = 'before';
type += e.type.charAt(0).toUpperCase() + e.type.substr(1) + 'Change';
e.type = type;
return this.fireEvent(e.type, e);
} | javascript | {
"resource": ""
} | |
q30654 | train | function(type, fn, obj, scope) {
scope = scope || this;
var Event = YAHOO.util.Event,
el = this.get('element') || this.get('id'),
self = this;
if (specialTypes[type] && !Event._createMouseDelegate) {
return false;
}
if (!this._events[type]) { // create on the fly
... | javascript | {
"resource": ""
} | |
q30655 | train | function() {
var queue = this._queue;
for (var i = 0, len = queue.length; i < len; ++i) {
this[queue[i][0]].apply(this, queue[i][1]);
}
} | javascript | {
"resource": ""
} | |
q30656 | train | function(parent, before) {
parent = (parent.get) ? parent.get('element') : Dom.get(parent);
this.fireEvent('beforeAppendTo', {
type: 'beforeAppendTo',
target: parent
});
before = (before && before.get) ?
before.get('ele... | javascript | {
"resource": ""
} | |
q30657 | train | function(key, map) {
var el = this.get('element');
map = map || {};
map.name = key;
map.setter = map.setter || this.DEFAULT_HTML_SETTER;
map.getter = map.getter || this.DEFAULT_HTML_GETTER;
map.value = map.value || el[key];
this._configs[key] = new YAHOO.util.At... | javascript | {
"resource": ""
} | |
q30658 | train | function(wirings) {
// Reset the internal structure
this.pipes = wirings;
this.pipesByName = {};
// Build the "pipesByName" index
for(var i = 0 ; i < this.pipes.length ; i++) {
this.pipesByName[ this.pipes[i].name] = this.pipes[i];
}
// Customize to display composed module in the lef... | javascript | {
"resource": ""
} | |
q30659 | train | function(string) {
// TODO split params ? &
YAHOO.util.Connect.asyncRequest('GET', this.options.uri+'?availabilityRequest='+string, {
success: function(o) {
var obj = lang.JSON.parse(o.responseText);
if(obj === "true" || !!obj){
this.onAvailable();
}
else if(obj === "false" || !obj){
th... | javascript | {
"resource": ""
} | |
q30660 | train | function() {
if(!this.checkAutoLoadOnce) {
var p = window.location.search.substr(1).split('&');
var oP = {};
for(var i = 0 ; i < p.length ; i++) {
var v = p[i].split('=');
oP[v[0]]=window.decodeURIComponent(v[1]);
}
this.checkAutoLoadOnce = true;
if(oP.autoload) {
this.loadPipe(oP.autolo... | javascript | {
"resource": ""
} | |
q30661 | checkPhantomjsVersion | train | function checkPhantomjsVersion(phantomPath) {
console.log('Found PhantomJS at', phantomPath, '...verifying')
return kew.nfcall(cp.execFile, phantomPath, ['--version']).then(function (stdout) {
var version = stdout.trim()
if (helper.version == version) {
return true
} else {
console.log('Phan... | javascript | {
"resource": ""
} |
q30662 | verifyChecksum | train | function verifyChecksum(fileName, checksum) {
return kew.resolve(hasha.fromFile(fileName, {algorithm: 'sha256'})).then(function (hash) {
var result = checksum == hash
if (result) {
console.log('Verified checksum of previously downloaded file')
} else {
console.log('Checksum did not match')
... | javascript | {
"resource": ""
} |
q30663 | _storeStates | train | function _storeStates() {
var moduleName, moduleObj, initialStates = [], currentStates = [];
for (moduleName in _modules) {
if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
moduleObj = _modules[moduleName];
initialStates.push(moduleName + "=" + moduleO... | javascript | {
"resource": ""
} |
q30664 | _handleFQStateChange | train | function _handleFQStateChange(fqstate) {
var i, len, moduleName, moduleObj, modules, states, tokens, currentState;
if (!fqstate) {
// Notifies all modules
for (moduleName in _modules) {
if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
m... | javascript | {
"resource": ""
} |
q30665 | _updateIFrame | train | function _updateIFrame (fqstate) {
var html, doc;
html = '<html><body><div id="state">' +
fqstate.replace(/&/g,'&').
replace(/</g,'<').
replace(/>/g,'>').
replace(/"/g,'"') +
... | javascript | {
"resource": ""
} |
q30666 | _checkIframeLoaded | train | function _checkIframeLoaded() {
var doc, elem, fqstate, hash;
if (!_histFrame.contentWindow || !_histFrame.contentWindow.document) {
// Check again in 10 msec...
setTimeout(_checkIframeLoaded, 10);
return;
}
// Start the thread that will have the re... | javascript | {
"resource": ""
} |
q30667 | _initialize | train | function _initialize() {
var i, len, parts, tokens, moduleName, moduleObj, initialStates, initialState, currentStates, currentState, counter, hash;
// Decode the content of our storage field...
parts = _stateField.value.split("|");
if (parts.length > 1) {
initialStates = ... | javascript | {
"resource": ""
} |
q30668 | train | function (fn, obj, overrideContext) {
if (_initialized) {
setTimeout(function () {
var ctx = window;
if (overrideContext) {
if (overrideContext === true) {
ctx = obj;
} else ... | javascript | {
"resource": ""
} | |
q30669 | train | function (module, initialState, onStateChange, obj, overrideContext) {
var scope, wrappedFn;
if (typeof module !== "string" || YAHOO.lang.trim(module) === "" ||
typeof initialState !== "string" ||
typeof onStateChange !== "function") {
throw new ... | javascript | {
"resource": ""
} | |
q30670 | train | function (stateField, histFrame) {
if (_initialized) {
// The browser history manager has already been initialized.
return;
}
if (YAHOO.env.ua.opera && typeof history.navigationMode !== "undefined") {
// Disable Opera's fast back/forw... | javascript | {
"resource": ""
} | |
q30671 | train | function (module) {
var moduleObj;
if (typeof module !== "string") {
throw new Error("Missing or invalid argument");
}
if (!_initialized) {
throw new Error("The Browser History Manager is not initialized");
}
mod... | javascript | {
"resource": ""
} | |
q30672 | train | function (module) {
var i, len, idx, hash, states, tokens, moduleName;
if (typeof module !== "string") {
throw new Error("Missing or invalid argument");
}
// Use location.href instead of location.hash which is already
// URL-decoded, which c... | javascript | {
"resource": ""
} | |
q30673 | train | function (paramName, url) {
var i, len, idx, queryString, params, tokens;
url = url || top.location.href;
idx = url.indexOf("?");
queryString = idx >= 0 ? url.substr(idx + 1) : url;
// Remove the hash if any
idx = queryString.lastIndexOf("#");
... | javascript | {
"resource": ""
} | |
q30674 | train | function () {
var ui = Paginator.ui,
name,UIComp;
for (name in ui) {
if (ui.hasOwnProperty(name)) {
UIComp = ui[name];
if (isObject(UIComp) && isFunction(UIComp.init)) {
UIComp.init(this);
}
}
... | javascript | {
"resource": ""
} | |
q30675 | train | function (e) {
var v = e.newValue,rpp,state;
if (e.prevValue !== v) {
if (v !== Paginator.VALUE_UNLIMITED) {
rpp = this.get('rowsPerPage');
if (rpp && this.get('recordOffset') >= v) {
state = this.getState({
totalRe... | javascript | {
"resource": ""
} | |
q30676 | train | function (e) {
if (e.prevValue !== e.newValue) {
var change = this._state || {},
state;
change[e.type.replace(/Change$/,'')] = e.prevValue;
state = this.getState(change);
if (state.page !== state.before.page) {
if (this._batch) {
... | javascript | {
"resource": ""
} | |
q30677 | train | function (state) {
if (isObject(state)) {
var current = state.before;
delete state.before;
this.fireEvent('pageChange',{
type : 'pageChange',
prevValue : state.page,
newValue : current.page,
prevState : sta... | javascript | {
"resource": ""
} | |
q30678 | train | function () {
if (this.get('rendered')) {
return this;
}
var template = this.get('template'),
state = this.getState(),
// ex. yui-pg0-1 (first paginator, second container)
id_base = Paginator.ID_BASE + this.get('id') + '-',
i, len;... | javascript | {
"resource": ""
} | |
q30679 | train | function (container, template, id_base, hide) {
var containerClass = this.get('containerClass'),
markers, i, len;
if (!container) {
return;
}
// Hide the container while its contents are rendered
Dom.setStyle(container,'display','none');
Dom.add... | javascript | {
"resource": ""
} | |
q30680 | train | function (e) {
var alwaysVisible = this.get('alwaysVisible'),
totalRecords,visible,rpp,rppOptions,i,len;
if (!e || e.type === 'alwaysVisibleChange' || !alwaysVisible) {
totalRecords = this.get('totalRecords');
visible = true;
rpp = this.get(... | javascript | {
"resource": ""
} | |
q30681 | train | function () {
var records = this.get('totalRecords'),
perPage = this.get('rowsPerPage');
// rowsPerPage not set. Can't calculate
if (!perPage) {
return null;
}
if (records === Paginator.VALUE_UNLIMITED) {
return Paginator.VALUE_UNLIMITED;
... | javascript | {
"resource": ""
} | |
q30682 | train | function (page) {
if (!lang.isNumber(page) || page < 1) {
return false;
}
var totalPages = this.getTotalPages();
return (totalPages === Paginator.VALUE_UNLIMITED || totalPages >= page);
} | javascript | {
"resource": ""
} | |
q30683 | train | function () {
var currentPage = this.getCurrentPage(),
totalPages = this.getTotalPages();
return currentPage && (totalPages === Paginator.VALUE_UNLIMITED || currentPage < totalPages);
} | javascript | {
"resource": ""
} | |
q30684 | train | function (page) {
if (!lang.isNumber(page)) {
page = this.getCurrentPage();
}
var perPage = this.get('rowsPerPage'),
records = this.get('totalRecords'),
start, end;
if (!page || !perPage) {
return null;
}
start = (page - ... | javascript | {
"resource": ""
} | |
q30685 | train | function (page,silent) {
if (this.hasPage(page) && page !== this.getCurrentPage()) {
if (this.get('updateOnChange') || silent) {
this.set('recordOffset', (page - 1) * this.get('rowsPerPage'));
} else {
this.fireEvent('changeRequest',this.getState({'page':p... | javascript | {
"resource": ""
} | |
q30686 | train | function (rpp,silent) {
if (Paginator.isNumeric(rpp) && +rpp > 0 &&
+rpp !== this.get('rowsPerPage')) {
if (this.get('updateOnChange') || silent) {
this.set('rowsPerPage',rpp);
} else {
this.fireEvent('changeRequest',
this.g... | javascript | {
"resource": ""
} | |
q30687 | train | function (total,silent) {
if (Paginator.isNumeric(total) && +total >= 0 &&
+total !== this.get('totalRecords')) {
if (this.get('updateOnChange') || silent) {
this.set('totalRecords',total);
} else {
this.fireEvent('changeRequest',
... | javascript | {
"resource": ""
} | |
q30688 | train | function (offset,silent) {
if (Paginator.isNumeric(offset) && +offset >= 0 &&
+offset !== this.get('recordOffset')) {
if (this.get('updateOnChange') || silent) {
this.set('recordOffset',offset);
} else {
this.fireEvent('changeRequest',
... | javascript | {
"resource": ""
} | |
q30689 | train | function (state) {
if (isObject(state)) {
// get flux state based on current state with before state as well
this._state = this.getState({});
// use just the state props from the input obj
state = {
page : state.page,
rowsP... | javascript | {
"resource": ""
} | |
q30690 | train | function (id_base) {
this.span = document.createElement('span');
this.span.id = id_base + '-page-report';
this.span.className = this.paginator.get('pageReportClass');
this.update();
return this.span;
} | javascript | {
"resource": ""
} | |
q30691 | train | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
this.span.innerHTML = Paginator.ui.CurrentPageReport.sprintf(
this.paginator.get('pageReportTemplate'),
this.paginator.get('pageReportValueGenerator')(this.paginator));
} | javascript | {
"resource": ""
} | |
q30692 | train | function (id_base) {
var p = this.paginator;
// Set up container
this.container = document.createElement('span');
this.container.id = id_base + '-pages';
this.container.className = p.get('pageLinksContainerClass');
YAHOO.util.Event.on(this.container,'click',this.o... | javascript | {
"resource": ""
} | |
q30693 | train | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
var p = this.paginator,
currentPage = p.getCurrentPage();
// Replace content if there's been a change
if (this.current !== currentPage || !currentPage || e.rebuild) {
v... | javascript | {
"resource": ""
} | |
q30694 | train | function () {
YAHOO.util.Event.purgeElement(this.container,true);
this.container.parentNode.removeChild(this.container);
this.container = null;
} | javascript | {
"resource": ""
} | |
q30695 | train | function (e) {
var t = YAHOO.util.Event.getTarget(e);
if (t && YAHOO.util.Dom.hasClass(t,
this.paginator.get('pageLinkClass'))) {
YAHOO.util.Event.stopEvent(e);
this.paginator.setPage(parseInt(t.getAttribute('page'),10));
}
} | javascript | {
"resource": ""
} | |
q30696 | train | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
var par = this.current ? this.current.parentNode : null,
after = this.link;
if (par) {
switch (this.paginator.getTotalPages()) {
case Paginator.VALUE_UNLIMITED :
... | javascript | {
"resource": ""
} | |
q30697 | train | function (id_base) {
var p = this.paginator,
c = p.get('nextPageLinkClass'),
label = p.get('nextPageLinkLabel'),
last = p.getTotalPages();
this.link = document.createElement('a');
this.span = document.createElement('span');
this.link... | javascript | {
"resource": ""
} | |
q30698 | train | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
var last = this.paginator.getTotalPages(),
par = this.current ? this.current.parentNode : null;
if (this.paginator.getCurrentPage() !== last) {
if (par && this.current === this.span) {
... | javascript | {
"resource": ""
} | |
q30699 | train | function (e) {
if (e && e.prevValue === e.newValue) {
return;
}
var rpp = this.paginator.get('rowsPerPage')+'',
options = this.select.options,
i,len;
for (i = 0, len = options.length; i < len; ++i) {
if (options[i].value === rpp) {
... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.