Skip to content

Instantly share code, notes, and snippets.

View ericf's full-sized avatar

Eric Ferraiuolo ericf

View GitHub Profile
var MyClass = Y.Base.create('my-class', Y.Base, [], {
_mergeProps: function (value, prop) {
var cur = this.get(prop);
if (Y.Lang.isUndefined(cur)) {
this.reset(prop); // will rest to { test: true } for this instance instead of always using the static default values
}
return Y.merge(cur, value);
}
}, {
ATTRS: {
_setNewAmount : function (v) {
var amountMin = TipUI.AMOUNT_MIN,
amountMax = TipUI.AMOUNT_MAX;
if (isString(v)) {
v = parseAmount(v);
}
if (isNull(v)) { return v; }
<!DOCTYPE html>
<html>
<head>
<title>TTW Buttons — No JavaScript</title>
<!--[if (gte IE 8)|!(IE)]><!-->
<link rel="stylesheet" href="http://platform.tiptheweb.org/tip/css/button-datauri.css" />
<!--<![endif]-->
<!DOCTYPE html>
<html>
<head>
<title>ModelResource Manual Tests</title>
</head>
<body>
<h1>ModelResource Manual Tests</h1>
// Google Map
YUI.Env.DBD || (YUI.Env.DBD = {});
YUI.Env.DBD[Y.stamp(this, true)] = { map: Y.bind(this.useComponent, this, 'map') };
Y.Get.script(sub(Y.DBD.App.GOOGLE_MAPS_URL, { id : Y.stamp(this, true) }));
// Statically defined:
GOOGLE_MAPS_URL : 'http://maps.google.com/maps/api/js?sensor=false&callback=YUI.Env.DBD.{id}.map',
function eventWrap (event, config) {
var proto = this.prototype;
proto[event] = function(){
if (isString(config)) { config = isFunction(this[config]) ? this[config] : null; }
if (isFunction(config)) { config = { defaultFn: config }; }
this.publish(event, config);
function fireEvent () {
this.fire(event, { args: Y.Array(arguments) });
return this;
}
/**
* Model Collection
*
* @module model
* @submodule model-collection
*/
var ModelCollection,
MODEL_COLLECTION = 'modelCollection',
@ericf
ericf / gist:961730
Created May 8, 2011 22:12
A simple, small, and powerful CSS Grid System (based on YUI 3 CSS Grids)
/* Based on YUI 3 CSS Grids: http://developer.yahoo.com/yui/3/cssgrids/ */
.layout {
letter-spacing: -0.31em; /* webkit: collapse white-space between units */
*letter-spacing: normal; /* reset IE < 8 */
word-spacing: -0.43em; /* IE < 8 && gecko: collapse white-space between units */
}
.layout > *,
.layout .unit {
display: inline-block;
zoom: 1; *display: inline; /* IE < 8: fake inline-block */
Y.eventMethod = function (receiver, method, config) {
config || (config = {});
var original = receiver[method] || noop,
type = config.type || method;
config.defaultFn = config.defaultFn || function(e){
original.apply(this, e.args);
};
receiver[method] = function(){
.yui3-overlay-pointing {}
.yui3-overlay-pointer {
position: absolute;
display: block;
width: 0px;
height: 0px;
border-style: solid;
border-width: 10px;
}
.yui3-overlay-pointing-tl > .yui3-widget-stdmod,