This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Y.Panel.prototype._uiSetHostVisibleModal = function (visible) { | |
var stack = Y.WidgetModality.STACK, | |
maskNode = this.get('maskNode'), | |
isModal = this.get('modal'), | |
topModal, index; | |
if (visible) { | |
Y.Array.each(stack, function (modal) { | |
modal._detachUIHandlesModal(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'), | |
path = require('path'), | |
parseCSS = require('css-parse'), | |
Promise = require('es6-promise').Promise; | |
module.exports = function gridUnits(pureDir, callback) { | |
readUnits(path.join(pureDir, 'grids-units.css')) | |
.then(parseCSS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI.add('cancellable-promise', function (Y) { | |
function CancellationError(message) { | |
CancellationError.superclass.constructor.apply(this, arguments); | |
this.message = message; | |
} | |
Y.extend(CancellationError, Error, { | |
name: 'cancel' | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uploader.after('uploadcancel', function () { | |
// Uploader is currently only looking at two possibilities when | |
// calling uploadThese(): if there's no queue or if the queue is in | |
// progress. After cancelling if there are still items int he queue | |
// everything works fine, but if there aren't any the queue stays | |
// there stuck in an UPLOADING state. To fix that, remove the | |
// queue object if empty | |
if (this.queue && !this.queue.queuedFiles.length) { | |
this.queue = null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//make sure the input tag has an ID assigned, if not, assign one. | |
if (!input.attr('id')) input.attr('id') = 'input_' + rnd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ajax(url) { | |
return new Promise(function (resolver) { | |
var xhr = new XMLHttpRequest(); | |
xhr.onreadystatechange = function () { | |
if (xhr.readyState === 4) { | |
if (xhr.status === 200) { | |
resolver.resolve(xhr.responseText); | |
} else { | |
resolver.reject(new Error('There was a problem with the request.')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Y.Promise.defer = function () { | |
var deferred = {}; | |
deferred.promise = new Y.Promise(function (resolve, reject) { | |
deferred.resolve = resolve; | |
deferred.reject = reject; | |
}); | |
return deferred; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* jQuery plugin to validate forms around segurosdigitales | |
* requires jquery validate plugin | |
* */ | |
(function($){ | |
function Validator(options, element) { | |
this.options = $.extend( {}, this.options, options ); | |
this.elem = element; | |
this.$elem = $(element); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI().use("datatable", "datasource-io", "datasource-jsonschema", "datatable-datasource", "datasource-polling", function (Y) { | |
Y.mix(Y.Plugin.DataTableDataSource.prototype, { | |
initializer: function (config) { | |
this.after('datasourceChange', this._bindDataSource); | |
if (config.datasource) { | |
this._bindDataSource({ | |
newVal: config.datasource | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
suite.add(new Y.Test.Case({ | |
name: 'foo', | |
'some test': function () { | |
var test = this; | |
Y.io('foo', function (id, response) { | |
// this is just boilerplate | |
test.resume(function () { | |
Y.Test.Assert.areEqual('foo', response.responseText); |