Skip to content

Instantly share code, notes, and snippets.

View addyosmani's full-sized avatar
🎯
Focusing

Addy Osmani addyosmani

🎯
Focusing
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<project name="sample-require-js" default="" basedir=".">
<!-- properties -->
<property name="requirejs.dir" value="_build/requirejs" />
<!-- custom tasks -->
/*!
* jQuery whenthen - v0.2 - 3/12/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($){
/*!
* jQuery whenthen - v0.2 - 3/12/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($){
$ git clone github:lenary/guides.git
Cloning into guides...
remote: Counting objects: 255, done.
remote: Compressing objects: 100% (216/216), done.
remote: Total 255 (delta 111), reused 163 (delta 35)
Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done.
Resolving deltas: 100% (111/111), done.
$ cd guides
$ git remote -v
NEEDSDOCS no ticket associated
https://github.com/jquery/jquery/commit/4e97543
FEATURE (SMALL) SHOULD THIS BE REMOVED BEFORE 1.5.1??
.invert() method on promises
returns an inverted promise that is resolved/rejected when the underlying deferred is rejected/resolved)
https://github.com/jquery/jquery/commit/e0b1bb8
http://api.jquery.com/extending-ajax/ <-- the code example at the very bottom should be updated to match the new regex
#8122
function Promise () {
this._thens = [];
}
Promise.prototype = {
then: function (resolve, reject) {
// capture calls to then()
this._thens.push({ resolve: resolve, reject: reject });
},
var application = {
page_loaded : false,
page_init : function() {
var i;
application.page_loaded = true;
// Load scripts that have not already been loaded.
var script;
for (i=0; script = application.scripts_to_load[i]; i++) {
(function($){
$.Class = function(code){
var klass = function() {
var instance = (arguments[0] !== null && this.__init__ && typeof this.__init__ == 'function') ? this.__init__.apply(this, arguments) : this;
return instance;
};
$.extend(klass, this);
$.extend(klass.prototype, {
'bind': function(type, fn) {
this.__events__ = this.__events__ || {};
(function($) {
$.fn.enable = function() {
// Enable each selected element by removing its 'disabled' attribute.
return this.each(function() {
$(this).removeAttr('disabled');
});
};
$.fn.disable = function() {
(function( $ ){
$.fn.pushTop = function() {
return this.each(function() {
var $this = $(this);
top_z_index = 0;
$('*').each(function() {
var this_z_index = $(this).css('z-index');
if (this_z_index != "auto" && this_z_index > top_z_index) {
top_z_index = this_z_index;
}