Skip to content

Instantly share code, notes, and snippets.

View rgrove's full-sized avatar
🥧

Ryan Grove rgrove

🥧
View GitHub Profile
Y.HistoryHTML5.prototype._init = function (config) {
Y.on('popstate', this._onPopState, Y.config.win, this);
config = this._config = config || {};
if (config && config['enableSessionFallback'] && YUI.Env.windowLoaded) {
this._loadSessionState();
}
Y.HistoryHTML5.superclass._init.apply(this, arguments);
@rgrove
rgrove / history-lite.js
Created August 11, 2010 16:44
History Lite for YUI 2.
/**
* Lightweight history utility for YUI 2. Similar in purpose to the YUI Browser
* History Manager, but with a more flexible API, no initialization requirement,
* no IE6/7 support, and a much smaller footprint.
*
* @module history-lite
* @requires YAHOO, Event
* @class HistoryLite
* @static
*/
<?php
$file = <<<EOF
attribute/tests/attribute.html
async-queue/tests/async-queue.html
cache/tests/cache.html
cache/tests/cacheoffline.html
classnamemanager/tests/classnamemanager.html
collection/tests/arraylist.html
collection/tests/collection.html
@rgrove
rgrove / gist:557733
Created August 30, 2010 17:31 — forked from ericf/gist:557658
<!DOCTYPE html>
<html>
<head>
<title>ValueChange Multiple Subscriptions</title>
</head>
<body>
// Make an HTTP request to 'get.php'.
Y.io('get.php', {
on: {
complete: function (id, response) {
var id = id, // Transaction ID.
data = response.responseText; // Response data.
// ... handle the response ...
}
}
@rgrove
rgrove / rakefile.rb
Created September 3, 2010 19:11 — forked from tivac/rakefile.rb
require 'yui-utils'
task :default, [:file, :replace, :filter, :jsdir] do |t, args|
args.with_defaults(
:filter => nil,
:jsdir => nil,
:replace => nil
)
modules = YUIUtils.build_module_list(args.filter, args.jsdir)
@rgrove
rgrove / rakefile.rb
Created September 3, 2010 19:24 — forked from tivac/rakefile.rb
require 'yui-utils'
task :yui_modules do
output = YUIUtils.build_module_list()
#YUIUtils.output(modules)
end
@rgrove
rgrove / gist:570979
Created September 8, 2010 22:40
Monkeypatch to support Edit->Paste via the browser menubar for auto-focused elements in YUI 3.2.0's event-valuechange.
var VC = Y.ValueChange;
VC._onFocus = function (e) {
VC._startPolling(e.currentTarget, null, e);
};
VC._onSubscribe = function (node, subscription, notifier) {
var stamp = Y.stamp(node),
notifiers = VC._notifiers[stamp];
@rgrove
rgrove / node-combo.js
Created October 4, 2010 23:23
Simple NodeJS combo handler for YUI 3 (or anything, really).
#!/usr/bin/env node
/**
* Simple YUI combo handler using NodeJS and Express. Stick a caching and
* compressing proxy in front of this and you're ready to rock in production.
*
* Copyright (c) 2010 Ryan Grove <ryan@wonko.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
L.trimLeft = String.prototype.trimLeft ? function (s) {
return s.trimLeft();
} : function (s) {
return s.replace(/^\s+/, '');
};
L.trimRight = String.prototype.trimRight ? function (s) {
return s.trimRight();
} : function (s) {
return s.replace(/\s+$/, '');