This file contains hidden or 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
// editable is an aui-widget instance | |
editable.after('startEditing', function(ev1){ | |
// some code here | |
// subscribe here, event will fire multiple times, | |
// but captured only once, | |
// it will be reattached next time the widget is editted | |
editable.once('stopEditing', function(ev2) { | |
// sent AJAX here! | |
}); |
This file contains hidden or 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
// LOAD 3rd party libraries as commonJS modules | |
var module = { | |
exports : {} | |
}; | |
var exports = {}; | |
var config = (function() { | |
var BASE = '//localhost:8888/'; | |
return { |
This file contains hidden or 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
it('test AJAX mock', function() { | |
spyOn(Y.io, 'request') | |
.andCallFake(function(url, config) { | |
console.log('fake ajax', arguments); | |
var bound = config.on.success.bind({ | |
'get' : function(name) { | |
if (name === 'responseData') { | |
return { |
This file contains hidden or 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 _fancy_prompt { | |
local RED="\[\033[01;31m\]" | |
local GREEN="\[\033[01;32m\]" | |
local YELLOW="\[\033[01;33m\]" | |
local BLUE="\[\033[01;34m\]" | |
local WHITE="\[\033[00m\]" | |
local PROMPT="" | |
# Working directory |
This file contains hidden or 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
var module = { | |
exports : {} | |
}; | |
var exports = {}; | |
YUI({ | |
modules : { | |
'jquery' : { | |
fullpath : 'http://code.jquery.com/jquery-1.10.1.min.js' | |
}, |
This file contains hidden or 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
// cheat jQuery that so it uses module exports instead of global variable | |
// FIXME needs feature detection before defining module | |
var module = { | |
exports : {} | |
} | |
// version with global module export | |
YUI.add('dlp-jquery-commonjs', function(Y) { | |
Y.Get.script('http://code.jquery.com/jquery-1.10.1.min.js', { |
This file contains hidden or 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
// version with iframe | |
YUI.add('dlp-jquery', function(Y) { | |
// create iframe dynamically to create a sandbox for our script | |
var myIframe = document.createElement('iframe'); | |
myIframe.id = 'jQueryIframe'; | |
// callback run when the iframe is loaded | |
myIframe.onload = function() { | |
console.log('my iframe loaded'); |
NewerOlder