dist/ember.prod.js in ember-source-1.3.1.1 vs dist/ember.prod.js in ember-source-1.3.2
- old
+ new
@@ -3,11 +3,11 @@
* @copyright Copyright 2011-2014 Tilde Inc. and contributors
* Portions Copyright 2006-2011 Strobe Inc.
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
* @license Licensed under MIT license
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
- * @version 1.3.1.1
+ * @version 1.3.2
*/
(function() {
var define, requireModule, require, requirejs;
@@ -86,11 +86,11 @@
The core Runtime framework is based on the jQuery API with a number of
performance optimizations.
@class Ember
@static
- @version 1.3.1.1
+ @version 1.3.2
*/
if ('undefined' === typeof Ember) {
// Create core object. Make it act like an instance of Ember.Namespace so that
// objects assigned to it are given a sane string representation.
@@ -113,14 +113,14 @@
/**
@property VERSION
@type String
- @default '1.3.1.1'
+ @default '1.3.2'
@static
*/
-Ember.VERSION = '1.3.1.1';
+Ember.VERSION = '1.3.2';
/**
Standard environmental variables. You can define these in a global `EmberENV`
variable before loading Ember to control various configuration settings.
@@ -26201,10 +26201,37 @@
return value;
};
+/**
+ This method uses `Ember.Handlebars.get` to lookup a value, then ensures
+ that the value is escaped properly.
+
+ If `unescaped` is a truthy value then the escaping will not be performed.
+
+ @method getEscaped
+ @for Ember.Handlebars
+ @param {Object} root The object to look up the property on
+ @param {String} path The path to be lookedup
+ @param {Object} options The template's option hash
+*/
+Ember.Handlebars.getEscaped = function(root, path, options) {
+ var result = handlebarsGet(root, path, options);
+
+ if (result === null || result === undefined) {
+ result = "";
+ } else if (!(result instanceof Handlebars.SafeString)) {
+ result = String(result);
+ }
+ if (!options.hash.unescaped){
+ result = Handlebars.Utils.escapeExpression(result);
+ }
+
+ return result;
+};
+
Ember.Handlebars.resolveParams = function(context, params, options) {
var resolvedParams = [], types = options.types, param, type;
for (var i=0, l=params.length; i<l; i++) {
param = params[i];
@@ -27151,33 +27178,20 @@
@submodule ember-handlebars
*/
var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
var handlebarsGet = Ember.Handlebars.get, normalizePath = Ember.Handlebars.normalizePath;
+var handlebarsGetEscaped = Ember.Handlebars.getEscaped;
var forEach = Ember.ArrayPolyfills.forEach;
var o_create = Ember.create;
var EmberHandlebars = Ember.Handlebars, helpers = EmberHandlebars.helpers;
function exists(value) {
return !Ember.isNone(value);
}
-function sanitizedHandlebarsGet(currentContext, property, options) {
- var result = handlebarsGet(currentContext, property, options);
- if (result === null || result === undefined) {
- result = "";
- } else if (!(result instanceof Handlebars.SafeString)) {
- result = String(result);
- }
- if (!options.hash.unescaped){
- result = Handlebars.Utils.escapeExpression(result);
- }
-
- return result;
-}
-
// Binds a property into the DOM. This will create a hook in DOM that the
// KVO system will look for and update if the property changes.
function bind(property, options, preserveContext, shouldDisplay, valueNormalizer, childProperties) {
var data = options.data,
fn = options.fn,
@@ -27244,11 +27258,11 @@
}
}
} else {
// The object is not observable, so just render it out and
// be done with it.
- data.buffer.push(handlebarsGet(currentContext, property, options));
+ data.buffer.push(handlebarsGetEscaped(currentContext, property, options));
}
}
EmberHandlebars.bind = bind;
@@ -27265,11 +27279,11 @@
if (data.insideGroup) {
observer = function() {
Ember.run.once(view, 'rerender');
};
- output = sanitizedHandlebarsGet(currentContext, property, options);
+ output = handlebarsGetEscaped(currentContext, property, options);
data.buffer.push(output);
} else {
var bindView = new Ember._SimpleHandlebarsView(
property, currentContext, !options.hash.unescaped, options.data
@@ -27291,12 +27305,11 @@
view.registerObserver(normalized.root, normalized.path, observer);
}
} else {
// The object is not observable, so just render it out and
// be done with it.
- output = sanitizedHandlebarsGet(currentContext, property, options);
-
+ output = handlebarsGetEscaped(currentContext, property, options);
data.buffer.push(output);
}
}
/**
@@ -35788,10 +35801,10 @@
var linkType = options.types.shift();
var context = this;
if (linkType === 'ID') {
options.linkTextPath = linkTitle;
options.fn = function() {
- return Ember.Handlebars.get(context, linkTitle, options);
+ return Ember.Handlebars.getEscaped(context, linkTitle, options);
};
} else {
options.fn = function() {
return linkTitle;
};