|
1 | 1 | /*!
|
2 |
| - * BackMVC.js 0.1.0 |
| 2 | + * BackMVC.js 0.3.0 |
3 | 3 | * May be freely distributed under the MIT license
|
4 | 4 | * https://github.com/krange/backmvc
|
5 | 5 | */
|
|
8 | 8 | RouterObserver, ViewObserver, Model, Collection, View, Command, Router,
|
9 | 9 | Facade, BackMVC;
|
10 | 10 |
|
11 |
| - global.BackMVC = BackMVC = {}; |
| 11 | + BackMVC = {}; |
12 | 12 |
|
13 | 13 | /**
|
14 | 14 | * Base object that can register and remove a facade object. Each actor in
|
|
558 | 558 | this._routerObserver.registerFacade(this);
|
559 | 559 | this._viewObserver.registerFacade(this);
|
560 | 560 | };
|
561 |
| - global.Facade = BackMVC.Facade = Facade; |
| 561 | + BackMVC.Facade = Facade; |
562 | 562 | Facade.extend = Backbone.Model.extend;
|
563 | 563 | _.extend(Facade.prototype, {
|
564 | 564 | /**
|
|
741 | 741 | this.name = name;
|
742 | 742 | Backbone.Model.call(this, attributes, options);
|
743 | 743 | };
|
744 |
| - global.Model = BackMVC.Model = Model; |
| 744 | + BackMVC.Model = Model; |
745 | 745 | Model.extend = Backbone.Model.extend;
|
746 | 746 | _.extend(Model.prototype, Actor, Backbone.Model.prototype);
|
747 | 747 | delete Model.prototype.registerView;
|
|
762 | 762 | this.name = name;
|
763 | 763 | Backbone.Router.call(this, options);
|
764 | 764 | };
|
765 |
| - global.Router = BackMVC.Router = Router; |
| 765 | + BackMVC.Router = Router; |
766 | 766 | Router.extend = Backbone.Router.extend;
|
767 | 767 | _.extend(Router.prototype, Actor, Backbone.Router.prototype);
|
768 | 768 |
|
|
783 | 783 | Backbone.Collection.call(this, attributes, options);
|
784 | 784 | };
|
785 | 785 |
|
786 |
| - global.Collection = BackMVC.Collection = Collection; |
| 786 | + BackMVC.Collection = Collection; |
787 | 787 | Collection.extend = Backbone.Collection.extend;
|
788 | 788 | _.extend(Collection.prototype, Actor, Backbone.Collection.prototype);
|
789 | 789 | delete Collection.prototype.registerView;
|
|
799 | 799 | Command = function () {
|
800 | 800 | this.facade = undefined;
|
801 | 801 | };
|
802 |
| - global.Command = BackMVC.Command = Command; |
| 802 | + BackMVC.Command = Command; |
803 | 803 | Command.extend = Backbone.Model.extend;
|
804 | 804 | _.extend(Command.prototype, Actor, {
|
805 | 805 | /**
|
|
850 | 850 |
|
851 | 851 | Backbone.View.call(this, attributes, options);
|
852 | 852 | };
|
853 |
| - global.View = BackMVC.View = View; |
| 853 | + BackMVC.View = View; |
854 | 854 | View.extend = Backbone.View.extend;
|
855 | 855 | _.extend(View.prototype, Actor, Backbone.View.prototype, {
|
856 | 856 | /**
|
|
866 | 866 | return this.messageInterests;
|
867 | 867 | }
|
868 | 868 | });
|
869 |
| -}(window)) |
| 869 | + |
| 870 | + if (typeof define === 'function' && define.amd) { |
| 871 | + define(BackMVC); |
| 872 | + } else if (typeof module !== 'undefined' && module.exports) { |
| 873 | + module.exports = BackMVC; |
| 874 | + } else { |
| 875 | + global['signals'] = BackMVC; |
| 876 | + } |
| 877 | +}(window)); |
0 commit comments