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`
@ -4894,8 +4894,8 @@ Ember.run.scheduleOnce = function(queue, target, method, args) {
}; };
/** /**
Schedules an item to run from within a separate run loop, after Schedules an item to run from within a separate run loop, after
control has been returned to the system. This is equivalent to calling control has been returned to the system. This is equivalent to calling
`Ember.run.later` with a wait time of 1ms. `Ember.run.later` with a wait time of 1ms.
```javascript ```javascript
@ -4907,7 +4907,7 @@ Ember.run.scheduleOnce = function(queue, target, method, args) {
Multiple operations scheduled with `Ember.run.next` will coalesce Multiple operations scheduled with `Ember.run.next` will coalesce
into the same later run loop, along with any other operations into the same later run loop, along with any other operations
scheduled by `Ember.run.later` that expire right around the same scheduled by `Ember.run.later` that expire right around the same
time that `Ember.run.next` operations will fire. time that `Ember.run.next` operations will fire.
Note that there are often alternatives to using `Ember.run.next`. Note that there are often alternatives to using `Ember.run.next`.
For instance, if you'd like to schedule an operation to happen For instance, if you'd like to schedule an operation to happen
@ -4933,13 +4933,13 @@ Ember.run.scheduleOnce = function(queue, target, method, args) {
One benefit of the above approach compared to using `Ember.run.next` is One benefit of the above approach compared to using `Ember.run.next` is
that you will be able to perform DOM/CSS operations before unprocessed that you will be able to perform DOM/CSS operations before unprocessed
elements are rendered to the screen, which may prevent flickering or elements are rendered to the screen, which may prevent flickering or
other artifacts caused by delaying processing until after rendering. other artifacts caused by delaying processing until after rendering.
The other major benefit to the above approach is that `Ember.run.next` The other major benefit to the above approach is that `Ember.run.next`
introduces an element of non-determinism, which can make things much introduces an element of non-determinism, which can make things much
harder to test, due to its reliance on `setTimeout`; it's much harder harder to test, due to its reliance on `setTimeout`; it's much harder
to guarantee the order of scheduled operations when they are scheduled to guarantee the order of scheduled operations when they are scheduled
outside of the current run loop, i.e. with `Ember.run.next`. outside of the current run loop, i.e. with `Ember.run.next`.
@method next @method next
@ -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
@ -21665,7 +21665,7 @@ helpers = helpers || Ember.Handlebars.helpers; data = data || {};
var buffer = '', stack1, hashTypes, escapeExpression=this.escapeExpression, self=this; var buffer = '', stack1, hashTypes, escapeExpression=this.escapeExpression, self=this;
function program1(depth0,data) { function program1(depth0,data) {
var buffer = '', hashTypes; var buffer = '', hashTypes;
data.buffer.push("<option value=\"\">"); data.buffer.push("<option value=\"\">");
hashTypes = {}; hashTypes = {};
@ -21675,7 +21675,7 @@ function program1(depth0,data) {
} }
function program3(depth0,data) { function program3(depth0,data) {
var hashTypes; var hashTypes;
hashTypes = {'contentBinding': "STRING"}; hashTypes = {'contentBinding': "STRING"};
data.buffer.push(escapeExpression(helpers.view.call(depth0, "Ember.SelectOption", {hash:{ data.buffer.push(escapeExpression(helpers.view.call(depth0, "Ember.SelectOption", {hash:{
@ -21690,7 +21690,7 @@ function program3(depth0,data) {
stack1 = helpers.each.call(depth0, "view.content", {hash:{},inverse:self.noop,fn:self.program(3, program3, data),contexts:[depth0],types:["ID"],hashTypes:hashTypes,data:data}); stack1 = helpers.each.call(depth0, "view.content", {hash:{},inverse:self.noop,fn:self.program(3, program3, data),contexts:[depth0],types:["ID"],hashTypes:hashTypes,data:data});
if(stack1 || stack1 === 0) { data.buffer.push(stack1); } if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
return buffer; return buffer;
}), }),
attributeBindings: ['multiple', 'disabled', 'tabindex', 'name'], attributeBindings: ['multiple', 'disabled', 'tabindex', 'name'],
@ -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();
}); });
}, },