From 1702fd784aace9f5d78dd252b89185a13f195aaa Mon Sep 17 00:00:00 2001 From: ewinslow Date: Sat, 20 Nov 2010 07:00:32 +0000 Subject: Utilizing elgg.extend, rather than jQuery.extend git-svn-id: http://code.elgg.org/elgg/trunk@7363 36083f99-b078-4883-b0ff-0f9b5a30f544 --- js/lib/security.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/js/lib/security.js b/js/lib/security.js index ab5c829be..7f04f0cfb 100644 --- a/js/lib/security.js +++ b/js/lib/security.js @@ -8,11 +8,11 @@ elgg.security.token = {}; elgg.security.setToken = function(json) { //update the convenience object elgg.security.token = json; - + //also update all forms $('[name=__elgg_ts]').val(json.__elgg_ts); $('[name=__elgg_token]').val(json.__elgg_token); - + //also update all links $('[href]').each(function() { this.href = this.href @@ -34,7 +34,7 @@ elgg.security.refreshToken = function() { /** * Add elgg action tokens to an object or string (assumed to be url data) - * + * * @param {Object|string} data * @return {Object} The new data object including action tokens * @private @@ -48,19 +48,19 @@ elgg.security.addToken = function(data) { args.push(data); } args.push("__elgg_ts=" + elgg.security.token.__elgg_ts); - args.push("__elgg_token=" + elgg.security.token.__elgg_token) - + args.push("__elgg_token=" + elgg.security.token.__elgg_token); + return args.join('&'); } - + // no input! acts like a getter if (elgg.isUndefined(data)) { return elgg.security.token; } - + // {...} if (elgg.isPlainObject(data)) { - return $.extend(data, elgg.security.token); + return elgg.extend(data, elgg.security.token); } // oops, don't recognize that! -- cgit v1.2.3