From afb3c6450d6b9ab31581aa173f718b7ae8735390 Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Sat, 5 Mar 2016 14:50:30 +0100 Subject: [PATCH] add userArray in script tag in profile cards, to be used by e.g. plugins --- js/dom-functions.js | 11 ++++++----- js/misc-functions.js | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/js/dom-functions.js b/js/dom-functions.js index b72f16b..8ad09e6 100644 --- a/js/dom-functions.js +++ b/js/dom-functions.js @@ -419,8 +419,9 @@ function buildProfileCard(data) { } // full card html - data.profileCardHtml = '\ + var profileCardHtml = '\
\ + \ \ '; - return data; + return { userArray: data, profileCardHtml: profileCardHtml }; } @@ -551,7 +552,7 @@ function buildExternalProfileCard(data) { var serverUrl = guessInstanceUrlWithoutProtocolFromProfileUrlAndNickname(data.statusnet_profile_url, data.screen_name); data.screenNameWithServer = '@' + data.screen_name + '@' + serverUrl; - data.profileCardHtml = '\ + var profileCardHtml = '\
\
\
\ @@ -590,7 +591,7 @@ function buildExternalProfileCard(data) {
\
'; - return data; + return { userArray: data, profileCardHtml: profileCardHtml }; } @@ -608,7 +609,7 @@ function addProfileCardToDOM(data) { // change design - changeDesign({backgroundimage:data.background_image, backgroundcolor:data.backgroundcolor, linkcolor:data.linkcolor}); + changeDesign({backgroundimage:data.userArray.background_image, backgroundcolor:data.userArray.backgroundcolor, linkcolor:data.userArray.linkcolor}); // remove any old profile card and show profile card $('#feed').siblings('.profile-card').remove(); diff --git a/js/misc-functions.js b/js/misc-functions.js index c1ac3f8..492d2ad 100644 --- a/js/misc-functions.js +++ b/js/misc-functions.js @@ -847,7 +847,7 @@ function cacheSyntaxHighlightingGroups() { /* · · - · User array cache + · User array cache (called array because it's an array in php) · · Stored in window.userArrayCache with unique key like instance_url/nickname · with protocol (http:// or https://) trimmed off, e.g. "quitter.se/hannes2peer"