Update Discourse to Ember 1.0 RC2

This commit is contained in:
Robin Ward 2013-04-01 11:25:43 -04:00
parent 083ab0465c
commit 4c5ab8d688
2 changed files with 91 additions and 95 deletions

View file

@ -1,5 +1,5 @@
// Version: v1.0.0-pre.2-924-g9e5ec3b // Version: v1.0.0-pre.2-950-g656fa6e
// Last commit: 9e5ec3b (2013-03-26 21:49:38 -0700) // Last commit: 656fa6e (2013-03-29 13:40:38 -0700)
(function() { (function() {
@ -151,8 +151,8 @@ Ember.deprecateFunc = function(message, func) {
})(); })();
// Version: v1.0.0-pre.2-924-g9e5ec3b // Version: v1.0.0-pre.2-950-g656fa6e
// Last commit: 9e5ec3b (2013-03-26 21:49:38 -0700) // Last commit: 656fa6e (2013-03-29 13:40:38 -0700)
(function() { (function() {
@ -212,7 +212,7 @@ var define, requireModule;
@class Ember @class Ember
@static @static
@version 1.0.0-rc.1 @version 1.0.0-rc.2
*/ */
if ('undefined' === typeof Ember) { if ('undefined' === typeof Ember) {
@ -239,10 +239,10 @@ Ember.toString = function() { return "Ember"; };
/** /**
@property VERSION @property VERSION
@type String @type String
@default '1.0.0-rc.1' @default '1.0.0-rc.2'
@final @final
*/ */
Ember.VERSION = '1.0.0-rc.1'; Ember.VERSION = '1.0.0-rc.2';
/** /**
Standard environmental variables. You can define these in a global `ENV` Standard environmental variables. You can define these in a global `ENV`
@ -18012,7 +18012,7 @@ if(!Handlebars && typeof require === 'function') {
Handlebars = require('handlebars'); Handlebars = require('handlebars');
} }
Ember.assert("Ember Handlebars requires Handlebars 1.0.0-rc.3 or greater. Include a SCRIPT tag in the HTML HEAD linking to the Handlebars file before you link to Ember.", Handlebars && Handlebars.VERSION.match(/^1\.0\.[0-9](\.rc\.[23456789]+)?/)); Ember.assert("Ember Handlebars requires Handlebars 1.0.0-rc.3 or greater. Include a SCRIPT tag in the HTML HEAD linking to the Handlebars file before you link to Ember.", Handlebars && Handlebars.COMPILER_REVISION === 2);
/** /**
Prepares the Handlebars templating library for use inside Ember's view Prepares the Handlebars templating library for use inside Ember's view
@ -23224,7 +23224,8 @@ DSL.prototype = {
}, },
push: function(url, name, callback) { push: function(url, name, callback) {
if (url === "" || url === "/") { this.explicitIndex = true; } var parts = name.split('.');
if (url === "" || url === "/" || parts[parts.length-1] === "index") { this.explicitIndex = true; }
this.matches.push([url, name, callback]); this.matches.push([url, name, callback]);
}, },
@ -23494,20 +23495,6 @@ function getHandlerFunction(router) {
}; };
} }
function handlerIsActive(router, handlerName) {
var routeName = 'route:' + handlerName,
handler = router.container.lookup(routeName),
currentHandlerInfos = router.router.currentHandlerInfos,
handlerInfo;
for (var i=0, l=currentHandlerInfos.length; i<l; i++) {
handlerInfo = currentHandlerInfos[i];
if (handlerInfo.handler === handler) { return true; }
}
return false;
}
function routePath(handlerInfos) { function routePath(handlerInfos) {
var path = []; var path = [];
@ -23779,6 +23766,13 @@ Ember.Route = Ember.Object.extend({
* The find method is called on the model class with the value of * The find method is called on the model class with the value of
the dynamic segment. the dynamic segment.
Note that for routes with dynamic segments, this hook is only
executed when entered via the URL. If the route is entered
through a transition (e.g. when using the `linkTo` Handlebars
helper), then a model context is already provided and this hook
is not called. Routes without dynamic segments will always
execute the model hook.
@method model @method model
@param {Object} params the parameters extracted from the URL @param {Object} params the parameters extracted from the URL
*/ */
@ -24440,7 +24434,7 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) {
container = options.data.keywords.controller.container; container = options.data.keywords.controller.container;
router = container.lookup('router:main'); router = container.lookup('router:main');
Ember.assert("This view is already rendered", !router || !router._lookupActiveView(name)); Ember.assert("You can only use the {{render}} helper once without a model object as its second argument, as in {{render \"post\" post}}.", context || !router || !router._lookupActiveView(name));
view = container.lookup('view:' + name) || container.lookup('view:default'); view = container.lookup('view:' + name) || container.lookup('view:default');
@ -24468,7 +24462,7 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) {
options.hash.template = container.lookup('template:' + name); options.hash.template = container.lookup('template:' + name);
options.hash.controller = controller; options.hash.controller = controller;
if (router && !contextString) { if (router && !context) {
router._connectActiveView(name, view); router._connectActiveView(name, view);
} }
@ -24761,7 +24755,6 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) {
contexts = a_slice.call(arguments, 1, -1); contexts = a_slice.call(arguments, 1, -1);
var hash = options.hash, var hash = options.hash,
view = options.data.view,
controller; controller;
// create a hash to pass along to registerAction // create a hash to pass along to registerAction
@ -24775,7 +24768,7 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) {
params: contexts params: contexts
}; };
action.view = view = get(view, 'concreteView'); action.view = options.data.view;
var root, target; var root, target;
@ -25921,8 +25914,6 @@ var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
*/ */
customEvents: null, customEvents: null,
isInitialized: false,
// Start off the number of deferrals at 1. This will be // Start off the number of deferrals at 1. This will be
// decremented by the Application's own `initialize` method. // decremented by the Application's own `initialize` method.
_readinessDeferrals: 1, _readinessDeferrals: 1,
@ -26014,15 +26005,12 @@ var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
scheduleInitialize: function() { scheduleInitialize: function() {
var self = this; var self = this;
function initialize(){
if (self.isDestroyed) { return; }
Ember.run.schedule('actions', self, 'initialize');
}
if (!this.$ || this.$.isReady) { if (!this.$ || this.$.isReady) {
initialize(); Ember.run.schedule('actions', self, '_initialize');
} else { } else {
this.$().ready(initialize); this.$().ready(function(){
Ember.run(self, '_initialize');
});
} }
}, },
@ -26114,6 +26102,20 @@ var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
container.injection.apply(container, arguments); container.injection.apply(container, arguments);
}, },
/**
@private
@deprecated
Calling initialize manually is not supported.
Please see Ember.Application#advanceReadiness and
Ember.Application#deferReadiness.
@method initialize
**/
initialize: function(){
Ember.deprecate('Calling initialize manually is not supported. Please see Ember.Application#advanceReadiness and Ember.Application#deferReadiness');
},
/** /**
@private @private
@ -26123,12 +26125,10 @@ var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
choose to defer readiness. For example, an authentication hook might want choose to defer readiness. For example, an authentication hook might want
to defer readiness until the auth token has been retrieved. to defer readiness until the auth token has been retrieved.
@method initialize @method _initialize
*/ */
initialize: function() { _initialize: function() {
Ember.assert("Application initialize may only be called once", !this.isInitialized); if (this.isDestroyed) { return; }
Ember.assert("Cannot initialize a destroyed application", !this.isDestroyed);
this.isInitialized = true;
// At this point, the App.Router must already be assigned // At this point, the App.Router must already be assigned
this.register('router:main', this.Router); this.register('router:main', this.Router);
@ -26148,10 +26148,8 @@ var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
get(this, '__container__').destroy(); get(this, '__container__').destroy();
this.buildContainer(); this.buildContainer();
this.isInitialized = false;
Ember.run.schedule('actions', this, function(){ Ember.run.schedule('actions', this, function(){
this.initialize(); this._initialize();
this.startRouting(); this.startRouting();
}); });
}, },
@ -27743,8 +27741,8 @@ Ember States
})(); })();
// Version: v1.0.0-pre.2-924-g9e5ec3b // Version: v1.0.0-pre.2-950-g656fa6e
// Last commit: 9e5ec3b (2013-03-26 21:49:38 -0700) // Last commit: 656fa6e (2013-03-29 13:40:38 -0700)
(function() { (function() {

View file

@ -55,7 +55,7 @@ var define, requireModule;
@class Ember @class Ember
@static @static
@version 1.0.0-rc.1 @version 1.0.0-rc.2
*/ */
if ('undefined' === typeof Ember) { if ('undefined' === typeof Ember) {
@ -82,10 +82,10 @@ Ember.toString = function() { return "Ember"; };
/** /**
@property VERSION @property VERSION
@type String @type String
@default '1.0.0-rc.1' @default '1.0.0-rc.2'
@final @final
*/ */
Ember.VERSION = '1.0.0-rc.1'; Ember.VERSION = '1.0.0-rc.2';
/** /**
Standard environmental variables. You can define these in a global `ENV` Standard environmental variables. You can define these in a global `ENV`
@ -23035,7 +23035,8 @@ DSL.prototype = {
}, },
push: function(url, name, callback) { push: function(url, name, callback) {
if (url === "" || url === "/") { this.explicitIndex = true; } var parts = name.split('.');
if (url === "" || url === "/" || parts[parts.length-1] === "index") { this.explicitIndex = true; }
this.matches.push([url, name, callback]); this.matches.push([url, name, callback]);
}, },
@ -23305,20 +23306,6 @@ function getHandlerFunction(router) {
}; };
} }
function handlerIsActive(router, handlerName) {
var routeName = 'route:' + handlerName,
handler = router.container.lookup(routeName),
currentHandlerInfos = router.router.currentHandlerInfos,
handlerInfo;
for (var i=0, l=currentHandlerInfos.length; i<l; i++) {
handlerInfo = currentHandlerInfos[i];
if (handlerInfo.handler === handler) { return true; }
}
return false;
}
function routePath(handlerInfos) { function routePath(handlerInfos) {
var path = []; var path = [];
@ -23589,6 +23576,13 @@ Ember.Route = Ember.Object.extend({
* The find method is called on the model class with the value of * The find method is called on the model class with the value of
the dynamic segment. the dynamic segment.
Note that for routes with dynamic segments, this hook is only
executed when entered via the URL. If the route is entered
through a transition (e.g. when using the `linkTo` Handlebars
helper), then a model context is already provided and this hook
is not called. Routes without dynamic segments will always
execute the model hook.
@method model @method model
@param {Object} params the parameters extracted from the URL @param {Object} params the parameters extracted from the URL
*/ */
@ -24272,7 +24266,7 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) {
options.hash.template = container.lookup('template:' + name); options.hash.template = container.lookup('template:' + name);
options.hash.controller = controller; options.hash.controller = controller;
if (router && !contextString) { if (router && !context) {
router._connectActiveView(name, view); router._connectActiveView(name, view);
} }
@ -24565,7 +24559,6 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) {
contexts = a_slice.call(arguments, 1, -1); contexts = a_slice.call(arguments, 1, -1);
var hash = options.hash, var hash = options.hash,
view = options.data.view,
controller; controller;
// create a hash to pass along to registerAction // create a hash to pass along to registerAction
@ -24579,7 +24572,7 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) {
params: contexts params: contexts
}; };
action.view = view = get(view, 'concreteView'); action.view = options.data.view;
var root, target; var root, target;
@ -25723,8 +25716,6 @@ var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
*/ */
customEvents: null, customEvents: null,
isInitialized: false,
// Start off the number of deferrals at 1. This will be // Start off the number of deferrals at 1. This will be
// decremented by the Application's own `initialize` method. // decremented by the Application's own `initialize` method.
_readinessDeferrals: 1, _readinessDeferrals: 1,
@ -25816,15 +25807,12 @@ var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
scheduleInitialize: function() { scheduleInitialize: function() {
var self = this; var self = this;
function initialize(){
if (self.isDestroyed) { return; }
Ember.run.schedule('actions', self, 'initialize');
}
if (!this.$ || this.$.isReady) { if (!this.$ || this.$.isReady) {
initialize(); Ember.run.schedule('actions', self, '_initialize');
} else { } else {
this.$().ready(initialize); this.$().ready(function(){
Ember.run(self, '_initialize');
});
} }
}, },
@ -25916,6 +25904,20 @@ var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
container.injection.apply(container, arguments); container.injection.apply(container, arguments);
}, },
/**
@private
@deprecated
Calling initialize manually is not supported.
Please see Ember.Application#advanceReadiness and
Ember.Application#deferReadiness.
@method initialize
**/
initialize: function(){
},
/** /**
@private @private
@ -25925,12 +25927,10 @@ var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
choose to defer readiness. For example, an authentication hook might want choose to defer readiness. For example, an authentication hook might want
to defer readiness until the auth token has been retrieved. to defer readiness until the auth token has been retrieved.
@method initialize @method _initialize
*/ */
initialize: function() { _initialize: function() {
if (this.isDestroyed) { return; }
this.isInitialized = true;
// At this point, the App.Router must already be assigned // At this point, the App.Router must already be assigned
this.register('router:main', this.Router); this.register('router:main', this.Router);
@ -25950,10 +25950,8 @@ var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
get(this, '__container__').destroy(); get(this, '__container__').destroy();
this.buildContainer(); this.buildContainer();
this.isInitialized = false;
Ember.run.schedule('actions', this, function(){ Ember.run.schedule('actions', this, function(){
this.initialize(); this._initialize();
this.startRouting(); this.startRouting();
}); });
}, },