Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

Commit

Permalink
Updated to 1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Feb 7, 2014
1 parent 29d92b6 commit 28f8485
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 25 deletions.
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -23,7 +23,7 @@ <h2>Welcome to Ember.js</h2>

<script src="js/libs/jquery-1.10.2.js"></script>
<script src="js/libs/handlebars-1.1.2.js"></script>
<script src="js/libs/ember-1.3.1.js"></script>
<script src="js/libs/ember-1.3.2.js"></script>
<script src="js/app.js"></script>
<!-- to activate the test runner, add the "?test" query string parameter -->
<script src="tests/runner.js"></script>
Expand Down
61 changes: 37 additions & 24 deletions js/libs/ember-1.3.1.js → js/libs/ember-1.3.2.js
Expand Up @@ -5,7 +5,7 @@
* 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
* @version 1.3.2
*/


Expand Down Expand Up @@ -203,7 +203,7 @@ if (!Ember.testing) {
* 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
* @version 1.3.2
*/


Expand Down Expand Up @@ -286,7 +286,7 @@ var define, requireModule, require, requirejs;

@class Ember
@static
@version 1.3.1
@version 1.3.2
*/

if ('undefined' === typeof Ember) {
Expand All @@ -313,10 +313,10 @@ Ember.toString = function() { return "Ember"; };
/**
@property VERSION
@type String
@default '1.3.1'
@default '1.3.2'
@static
*/
Ember.VERSION = '1.3.1';
Ember.VERSION = '1.3.2';

/**
Standard environmental variables. You can define these in a global `EmberENV`
Expand Down Expand Up @@ -26501,6 +26501,33 @@ var handlebarsGet = Ember.Handlebars.get = function(root, path, options) {
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;

Expand Down Expand Up @@ -27458,6 +27485,7 @@ Ember._HandlebarsBoundView = Ember._MetamorphView.extend({

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;

Expand All @@ -27467,20 +27495,6 @@ 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) {
Expand Down Expand Up @@ -27551,7 +27565,7 @@ function bind(property, options, preserveContext, shouldDisplay, valueNormalizer
} 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));
}
}

Expand All @@ -27572,7 +27586,7 @@ function simpleBind(currentContext, property, options) {
Ember.run.once(view, 'rerender');
};

output = sanitizedHandlebarsGet(currentContext, property, options);
output = handlebarsGetEscaped(currentContext, property, options);

data.buffer.push(output);
} else {
Expand All @@ -27598,8 +27612,7 @@ function simpleBind(currentContext, property, options) {
} 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);
}
}
Expand Down Expand Up @@ -36169,7 +36182,7 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) {
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() {
Expand Down

0 comments on commit 28f8485

Please sign in to comment.