Skip to content

Instantly share code, notes, and snippets.

View ericf's full-sized avatar

Eric Ferraiuolo ericf

View GitHub Profile
_onSuccess : function (txId, r, args) {
var entity = r.responseText;
if (entity && entity.length > 0) {
try {
entity = Y.JSON.parse(entity);
} catch (e) {}
}
@ericf
ericf / gist:255872
Created December 14, 2009 07:24 — forked from lsmith/gist:255870
document.addEventListener('focus', prepareHandler, true); // capture phase
input.addEventListener('focus', inputHandler, false);
function prepareHandler(e) {
var id = e.target.id;
process[id] = true;
setTimeout(function () {
if (process[id]) {
// do stuff (e is available, but its methods are useless)
/**
* MyWidget
*/
var MyWidget,
MY_WIDGET = 'myWidget',
SUBJECT = 'subject',
MESSAGE = 'message',
SUBJECT_NODE = 'subjectNode',
YUI({
modules: {
'gallery-overlay-modal': {
fullpath: 'http://yui.yahooapis.com/gallery-2009.12.08-22/build/gallery-overlay-modal/gallery-overlay-modal-min.js',
requires: ['overlay','plugin','event-focus'],
optional: [],
supersedes: []
}
}
<!DOCTYPE html>
<html>
<head>
<title>test</title>
</head>
<body class="yui-skin-sam">
<script type="text/javascript" src="http://yui.yahooapis.com/3.0.0/build/yui/yui-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/gallery-2009.12.08-22/build/gallery-overlay-modal/gallery-overlay-modal-min.js"></script>
<script type="text/javascript">
YUI().use('event-synthetic', 'node', function(Y){
/*!
* Technique from Juriy Zaytsev via jQuery 1.4.2
* http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
*/
function eventSupported (eventName) {
eventName = "on" + eventName;
/**
* Base Component Manager
*
* Oddnut Software
* Copyright (c) 2010 Eric Ferraiuolo - http://eric.ferraiuolo.name
*/
var ComponentMgr,
COMPONENTS = 'components',
var purgeCSS;
Y.Get.css('path/to/file.css', { onSuccess: function(e){
purgeCSS = e.purge;
// now you could call purgeCSS(); and it will be removed
}});
YUI().use('node', function(Y){
var testEl, hasPosFixed;
testEl = Y.Node.create('<div></div>').setStyles({
position : 'absolute',
top : '1px',
left : '1px',
width : '0',
height : '0'
YUI({
groups : {
utils : {
base : 'base/path/',
comboBase : 'combo/base/path/',
root : '',
combine : true,
modules : {