Skip to content

Instantly share code, notes, and snippets.

@stonegao
Forked from cowboy/HEY-YOU.md
Created December 27, 2010 17:32
Show Gist options
  • Save stonegao/756323 to your computer and use it in GitHub Desktop.
Save stonegao/756323 to your computer and use it in GitHub Desktop.

Revisions

  1. @cowboy cowboy revised this gist Nov 15, 2010. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions jquery.ba-tinypubsub.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    /*!
    * jQuery Tiny Pub/Sub - v0.3pre - 11/4/2010
    * jQuery Tiny Pub/Sub - v0.3 - 11/4/2010
    * http://benalman.com/
    *
    * Copyright (c) 2010 "Cowboy" Ben Alman
    @@ -11,15 +11,15 @@

    var o = $({});

    $.subscribe = function(){
    $.subscribe = function() {
    o.bind.apply( o, arguments );
    };

    $.unsubscribe = function(){
    $.unsubscribe = function() {
    o.unbind.apply( o, arguments );
    };

    $.publish = function(){
    $.publish = function() {
    o.trigger.apply( o, arguments );
    };

  2. @cowboy cowboy revised this gist Nov 4, 2010. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions jquery.ba-tinypubsub.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    /*!
    * jQuery Tiny Pub/Sub - v0.2pre - 11/3/2010
    * jQuery Tiny Pub/Sub - v0.3pre - 11/4/2010
    * http://benalman.com/
    *
    * Copyright (c) 2010 "Cowboy" Ben Alman
    @@ -9,18 +9,18 @@

    (function($){

    var w = $(window);
    var o = $({});

    $.subscribe = function(){
    w.bind.apply( w, arguments );
    o.bind.apply( o, arguments );
    };

    $.unsubscribe = function(){
    w.unbind.apply( w, arguments );
    o.unbind.apply( o, arguments );
    };

    $.publish = function(){
    w.trigger.apply( w, arguments );
    o.trigger.apply( o, arguments );
    };

    })(jQuery);
  3. @cowboy cowboy revised this gist Nov 3, 2010. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions jquery.ba-tinypubsub.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    /*!
    * jQuery Tiny Pub/Sub - v0.1pre - 11/3/2010
    * jQuery Tiny Pub/Sub - v0.2pre - 11/3/2010
    * http://benalman.com/
    *
    * Copyright (c) 2010 "Cowboy" Ben Alman
    @@ -15,12 +15,12 @@
    w.bind.apply( w, arguments );
    };

    $.publish = function(){
    w.trigger.apply( w, arguments );
    $.unsubscribe = function(){
    w.unbind.apply( w, arguments );
    };

    $.unpublish = function(){
    w.unbind.apply( w, arguments );
    $.publish = function(){
    w.trigger.apply( w, arguments );
    };

    })(jQuery);
  4. @cowboy cowboy created this gist Nov 3, 2010.
    26 changes: 26 additions & 0 deletions jquery.ba-tinypubsub.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    /*!
    * jQuery Tiny Pub/Sub - v0.1pre - 11/3/2010
    * http://benalman.com/
    *
    * Copyright (c) 2010 "Cowboy" Ben Alman
    * Dual licensed under the MIT and GPL licenses.
    * http://benalman.com/about/license/
    */

    (function($){

    var w = $(window);

    $.subscribe = function(){
    w.bind.apply( w, arguments );
    };

    $.publish = function(){
    w.trigger.apply( w, arguments );
    };

    $.unpublish = function(){
    w.unbind.apply( w, arguments );
    };

    })(jQuery);