dist/ember.js in ember-source-1.3.1.1 vs dist/ember.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() {
/*global __fail__*/
@@ -201,11 +201,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;
@@ -284,11 +284,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.
@@ -311,14 +311,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.
@@ -26499,10 +26499,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];
@@ -27456,33 +27483,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,
@@ -27549,11 +27563,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;
@@ -27570,11 +27584,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
@@ -27596,12 +27610,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);
}
}
/**
@@ -36167,10 +36180,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;
};