_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
27
233k
language
stringclasses
1 value
meta_information
dict
q30600
train
function() { for (var p=0;p<this.pages.length;++p) { var cal = this.pages[p];
javascript
{ "resource": "" }
q30601
train
function() { for (var p=this.pages.length-1;p>=0;--p) { var cal = this.pages[p];
javascript
{ "resource": "" }
q30602
train
function() { for (var p=0;p<this.pages.length;++p) { var cal = this.pages[p];
javascript
{ "resource": "" }
q30603
train
function() { for (var p=0;p<this.pages.length;++p) { var cal = this.pages[p];
javascript
{ "resource": "" }
q30604
train
function(month, fnRender) { for (var p=0;p<this.pages.length;++p) { var cal = this.pages[p];
javascript
{ "resource": "" }
q30605
train
function(weekday, fnRender) { for (var p=0;p<this.pages.length;++p) { var cal = this.pages[p];
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)) {
javascript
{ "resource": "" }
q30607
train
function() { var w = 0; for (var p=0;p<this.pages.length;++p) { var cal = this.pages[p];
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 *
javascript
{ "resource": "" }
q30610
train
function(nYear) { var yrPattern = YAHOO.widget.CalendarNavigator.YR_PATTERN; if (YAHOO.lang.isNumber(nYear) && yrPattern.test(nYear+"")) {
javascript
{ "resource": "" }
q30611
train
function() { this.cal.beforeRenderNavEvent.fire(); if (!this.__rendered) { this.createNav();
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);
javascript
{ "resource": "" }
q30615
train
function(cal) { var date = YAHOO.widget.DateMath.getDate(this.getYear() - cal.cfg.getProperty("YEAR_OFFSET"), this.getMonth(), 1);
javascript
{ "resource": "" }
q30616
train
function() { YAHOO.util.Dom.addClass(this.yearEl,
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();
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");
javascript
{ "resource": "" }
q30619
topLevelNodeBefore
train
function topLevelNodeBefore(node, top) { while (!node.previousSibling && node.parentNode != 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; }
javascript
{ "resource": "" }
q30621
focusIssue
train
function focusIssue() { return cs.start.node
javascript
{ "resource": "" }
q30622
selectRange
train
function selectRange(range, window) { var selection = window.getSelection();
javascript
{ "resource": "" }
q30623
train
function (p_bDisabled) { var nButtons = this.getCount(), i; if (nButtons > 0) { i =
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")
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);
javascript
{ "resource": "" }
q30630
train
function(e) { if(!this.dialog) { this.renderDialog(); } // Inserting new record this.insertNewRecord = true; this.dialog.whenFormAvailable({ fn: function() {
javascript
{ "resource": "" }
q30631
train
function(fields) { var columndefs = []; for(var i = 0 ; i < fields.length ; i++) {
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)
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);
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) {
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) {
javascript
{ "resource": "" }
q30644
train
function(key){ this._configs = this._configs || {}; var config = this._configs[key]; if (!config || !this._configs.hasOwnProperty(key)) {
javascript
{ "resource": "" }
q30645
train
function(key, value, silent){ this._configs = this._configs || {}; var config = this._configs[key]; if (!config) {
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]) ) {
javascript
{ "resource": "" }
q30647
train
function(map, silent){ for (var key in map) { if ( Lang.hasOwnProperty(map, key) ) {
javascript
{ "resource": "" }
q30648
train
function(key, silent){ this._configs = this._configs || {}; if (this._configs[key]) { this.set(key,
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) {
javascript
{ "resource": "" }
q30651
train
function(key, map, init) { this._configs = this._configs || {}; map = map || {}; if (!this._configs[key]) { map.name = key;
javascript
{ "resource": "" }
q30652
train
function(type, callback) { this._events = this._events || {}; if ( !(type in this._events) ) { this._events[type] = this.createEvent(type); }
javascript
{ "resource": "" }
q30653
train
function(e) { var type = 'before'; type += e.type.charAt(0).toUpperCase() +
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) {
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;
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] =
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);
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]);
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')
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];
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,'&amp;'). replace(/</g,'&lt;'). replace(/>/g,'&gt;').
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) {
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];
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;
javascript
{ "resource": "" }
q30677
train
function (state) { if (isObject(state)) { var current = state.before; delete state.before; this.fireEvent('pageChange',{ type : 'pageChange',
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; }
javascript
{ "resource": "" }
q30682
train
function (page) { if (!lang.isNumber(page) || page < 1) { return false; } var totalPages =
javascript
{ "resource": "" }
q30683
train
function () { var currentPage = this.getCurrentPage(), totalPages = this.getTotalPages();
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')); }
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 {
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 {
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 {
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';
javascript
{ "resource": "" }
q30691
train
function (e) { if (e && e.prevValue === e.newValue) { return; } this.span.innerHTML = Paginator.ui.CurrentPageReport.sprintf(
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');
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);
javascript
{ "resource": "" }
q30695
train
function (e) { var t = YAHOO.util.Event.getTarget(e); if (t && YAHOO.util.Dom.hasClass(t, this.paginator.get('pageLinkClass'))) {
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) {
javascript
{ "resource": "" }