From 31fbc3fde3d6dba46b01498c21cb3e5ba74be987 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Tue, 27 Mar 2012 19:02:07 +0200 Subject: [PATCH] provide a close-option for boxes in right_aside and store info via js and cookies --- view/theme/diabook/communityhome.tpl | 30 +++++-- view/theme/diabook/icons/close_box.png | Bin 0 -> 206 bytes view/theme/diabook/icons/expand.png | Bin 263 -> 0 bytes view/theme/diabook/js/jquery.cookie.js | 47 +++++++++++ view/theme/diabook/profile_side.tpl | 2 +- view/theme/diabook/style-network.css | 22 ++--- view/theme/diabook/style-profile.css | 10 ++- view/theme/diabook/style.css | 3 + view/theme/diabook/theme.php | 111 +++++++++++++++++++++++-- 9 files changed, 198 insertions(+), 27 deletions(-) create mode 100755 view/theme/diabook/icons/close_box.png delete mode 100755 view/theme/diabook/icons/expand.png create mode 100644 view/theme/diabook/js/jquery.cookie.js diff --git a/view/theme/diabook/communityhome.tpl b/view/theme/diabook/communityhome.tpl index 7e50423ce..3e6441692 100755 --- a/view/theme/diabook/communityhome.tpl +++ b/view/theme/diabook/communityhome.tpl @@ -1,17 +1,22 @@ +
{{ if $page }}
$page
{{ endif }} +
+
{{ if $lastusers_title }} -

Help or @NewHere ?

+

Help or @NewHere ?

Friendica Support
Let's talk
Local Friendica NewHere {{ endif }} +
+
{{ if $lastusers_title }} -

Connectable Services

+

Connectable Services

Facebook StatusNet @@ -23,28 +28,35 @@ E-Mail
{{ endif }} +
+
{{ if $nv }} -

Find Friends

+

Find Friends

$nv.directory.1
$nv.match.1
$nv.suggest.1 $nv.invite.1 {{ endif }} +
+
{{ if $lastusers_title }} -

PostIt to Friendica

+

PostIt to Friendica

Post to Friendica from anywhere by bookmarking this Link.
{{ endif }} +
+
{{ if $lastusers_title }} -

$lastusers_title

+

$lastusers_title

{{ for $lastusers_items as $i }} $i {{ endfor }}
{{ endif }} +
{{ if $activeusers_title }}

$activeusers_title

@@ -55,20 +67,24 @@ {{ endif }} +
{{ if $photos_title }} -

$photos_title

+

$photos_title

{{ for $photos_items as $i }} $i {{ endfor }}
{{ endif }} +
+
{{ if $like_title }} -

$like_title

+

$like_title

{{ endif }} +
diff --git a/view/theme/diabook/icons/close_box.png b/view/theme/diabook/icons/close_box.png new file mode 100755 index 0000000000000000000000000000000000000000..28e2675b8ca941cc09104d5c9332e75f08e9eb02 GIT binary patch literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPavowb`+m8uXBY=i;OcD{r&L3^~nBde+p#W`RtQqxZgXv%kENK?z&*H&#ni3 uQYL$vdC%RI4=Si#7r4kl?sVy_Sb0HVZjXbj$^?NXGkCiCxvXQL70(Y)*K0-AbW|YuPgfo} z8*&|T5NUbnKilMGP=(2PfsZUrQCq=X1h>S!LmmBhI(`IfzeCS=! zk7zODZ#f$e{d285PtMtH diff --git a/view/theme/diabook/js/jquery.cookie.js b/view/theme/diabook/js/jquery.cookie.js new file mode 100644 index 000000000..6d5974a2c --- /dev/null +++ b/view/theme/diabook/js/jquery.cookie.js @@ -0,0 +1,47 @@ +/*! + * jQuery Cookie Plugin + * https://github.com/carhartl/jquery-cookie + * + * Copyright 2011, Klaus Hartl + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://www.opensource.org/licenses/mit-license.php + * http://www.opensource.org/licenses/GPL-2.0 + */ +(function($) { + $.cookie = function(key, value, options) { + + // key and at least value given, set cookie... + if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value === null || value === undefined)) { + options = $.extend({}, options); + + if (value === null || value === undefined) { + options.expires = -1; + } + + if (typeof options.expires === 'number') { + var days = options.expires, t = options.expires = new Date(); + t.setDate(t.getDate() + days); + } + + value = String(value); + + return (document.cookie = [ + encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value), + options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE + options.path ? '; path=' + options.path : '', + options.domain ? '; domain=' + options.domain : '', + options.secure ? '; secure' : '' + ].join('')); + } + + // key and possibly options given, get cookie... + options = value || {}; + var decode = options.raw ? function(s) { return s; } : decodeURIComponent; + + var pairs = document.cookie.split('; '); + for (var i = 0, pair; pair = pairs[i] && pairs[i].split('='); i++) { + if (decode(pair[0]) === key) return decode(pair[1] || ''); // IE saves cookies with empty string as "c; ", e.g. without "=" as opposed to EOMB, thus pair[1] may be undefined + } + return null; + }; +})(jQuery); diff --git a/view/theme/diabook/profile_side.tpl b/view/theme/diabook/profile_side.tpl index fc949639e..0762dbe44 100644 --- a/view/theme/diabook/profile_side.tpl +++ b/view/theme/diabook/profile_side.tpl @@ -9,7 +9,7 @@