From 9fd54de691f3829dc63b8fa2c64330fab42d12c9 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Tue, 27 Mar 2012 15:29:46 +0200 Subject: provide a close-option for boxes in right_aside and store info via js and cookies --- view/theme/diabook-blue/communityhome.tpl | 32 ++++++-- view/theme/diabook-blue/icons/close_box.png | Bin 0 -> 206 bytes view/theme/diabook-blue/js/jquery.cookie.js | 47 ++++++++++++ view/theme/diabook-blue/style-network.css | 11 ++- view/theme/diabook-blue/style-profile.css | 10 ++- view/theme/diabook-blue/theme.php | 114 ++++++++++++++++++++++++++-- 6 files changed, 195 insertions(+), 19 deletions(-) create mode 100755 view/theme/diabook-blue/icons/close_box.png create mode 100644 view/theme/diabook-blue/js/jquery.cookie.js (limited to 'view/theme/diabook-blue') diff --git a/view/theme/diabook-blue/communityhome.tpl b/view/theme/diabook-blue/communityhome.tpl index 748e6d077..1e3da2199 100755 --- a/view/theme/diabook-blue/communityhome.tpl +++ b/view/theme/diabook-blue/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,36 @@ 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 the Link.
{{ endif }} +
+
{{ if $lastusers_title }} -

$lastusers_title

+

$lastusers_title

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

$activeusers_title

@@ -55,21 +68,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-blue/icons/close_box.png b/view/theme/diabook-blue/icons/close_box.png new file mode 100755 index 000000000..28e2675b8 Binary files /dev/null and b/view/theme/diabook-blue/icons/close_box.png differ diff --git a/view/theme/diabook-blue/js/jquery.cookie.js b/view/theme/diabook-blue/js/jquery.cookie.js new file mode 100644 index 000000000..6d5974a2c --- /dev/null +++ b/view/theme/diabook-blue/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-blue/style-network.css b/view/theme/diabook-blue/style-network.css index d0bcd3209..ebf4da695 100644 --- a/view/theme/diabook-blue/style-network.css +++ b/view/theme/diabook-blue/style-network.css @@ -1174,8 +1174,8 @@ body .pageheader{ right_aside { display: table-cell; vertical-align: top; - width: 160px; - padding-right: 10px; + width: 170px; + /*border-left: 1px solid #D2D2D2;*/ /* background: #F1F1F1; */ @@ -1192,6 +1192,13 @@ right_aside #lastusers-wrapper { padding-left: 6px; padding-top: 3px; overflow: right_aside #ra-photos-wrapper { padding-left: 5px; padding-top: 3px; overflow: auto; width: 100%; } #page-sidebar-right_aside{margin-top: 0px; margin-bottom: 30px;} #page-sidebar-right_aside ul {margin-top: 0px;} +right_aside .icon {width: 10px; height: 10px;} +.close_box { + background-image: url("../../../view/theme/diabook-blue/icons/close_box.png"); + float: right; + cursor: pointer; + } + /* wall item */ .tread-wrapper { border-bottom: 1px solid #D2D2D2; diff --git a/view/theme/diabook-blue/style-profile.css b/view/theme/diabook-blue/style-profile.css index 1296f1647..db172dcda 100644 --- a/view/theme/diabook-blue/style-profile.css +++ b/view/theme/diabook-blue/style-profile.css @@ -1173,8 +1173,8 @@ body .pageheader{ right_aside { display: table-cell; vertical-align: top; - width: 160px; - padding-right: 10px; + width: 170px; + /*padding-right: 10px;*/ /*border-left: 1px solid #D2D2D2;*/ /* background: #F1F1F1; */ @@ -1191,6 +1191,12 @@ right_aside #lastusers-wrapper { padding-left: 6px; padding-top: 3px; overflow: right_aside #ra-photos-wrapper { padding-left: 5px; padding-top: 3px; overflow: auto; width: 100%; } #page-sidebar-right_aside{margin-top: 0px; margin-bottom: 30px;} #page-sidebar-right_aside ul {margin-top: 0px;} +right_aside .icon {width: 10px; height: 10px;} +.close_box { + background-image: url("../../../view/theme/diabook-blue/icons/close_box.png"); + float: right; + cursor: pointer; + } /* wall item */ .tread-wrapper { border-bottom: 1px solid #D2D2D2; diff --git a/view/theme/diabook-blue/theme.php b/view/theme/diabook-blue/theme.php index e12d940aa..3e35144de 100755 --- a/view/theme/diabook-blue/theme.php +++ b/view/theme/diabook-blue/theme.php @@ -147,9 +147,10 @@ function diabook_blue_community_info(){ $aside['$nv'] = $nv; }; //Community Page + if(local_user()) { $page = '
-

'.t("Community Pages").'

+

'.t("Community Pages").'

'; - if (sizeof($contacts) > 0) + //if (sizeof($contacts) > 0) $aside['$page'] = $page; - + } //END Community Page @@ -222,31 +223,39 @@ if ($a->argv[0] === "network" && local_user()){ } + $ccCookie = $_COOKIE['close_pages'] + $_COOKIE['close_helpers'] + $_COOKIE['close_services'] + $_COOKIE['close_friends'] + $_COOKIE['close_postit'] + $_COOKIE['close_lastusers'] + $_COOKIE['close_lastphotos'] + $_COOKIE['close_lastlikes']; + + if($ccCookie != "8") { // COMMUNITY diabook_blue_community_info(); // CUSTOM CSS $cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook-blue/style-network.css"; - + } } //right_aside at profile pages if ($a->argv[0] === "profile"){ - + if($ccCookie != "8") { // COMMUNITY diabook_blue_community_info(); // CUSTOM CSS $cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook-blue/style-profile.css"; - + } } // custom css if (!is_null($cssFile)) $a->page['htmlhead'] .= sprintf('', $cssFile); +//load jquery.cookie.js +$cookieJS = $a->get_baseurl($ssl_state)."/view/theme/diabook-blue/js/jquery.cookie.js"; +$a->page['htmlhead'] .= sprintf(' + + + + + EOT; -- cgit v1.2.3 From 1a9bbac0bede3daf3bca9260397e1ad2214be1f7 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Wed, 28 Mar 2012 20:45:39 +0200 Subject: bugfix in diabook --- view/theme/diabook-blue/communityhome.tpl | 14 +++++++------- view/theme/diabook-blue/style-network.css | 14 +++++++++++++- view/theme/diabook-blue/style-profile.css | 12 ++++++++++++ view/theme/diabook-blue/theme.php | 6 +++--- 4 files changed, 35 insertions(+), 11 deletions(-) (limited to 'view/theme/diabook-blue') diff --git a/view/theme/diabook-blue/communityhome.tpl b/view/theme/diabook-blue/communityhome.tpl index 1e3da2199..fa8197dd4 100755 --- a/view/theme/diabook-blue/communityhome.tpl +++ b/view/theme/diabook-blue/communityhome.tpl @@ -6,7 +6,7 @@
{{ if $lastusers_title }} -

Help or @NewHere ?

+

Help or @NewHere ?

Friendica Support
Let's talk
Local Friendica @@ -16,7 +16,7 @@
{{ if $lastusers_title }} -

Connectable Services

+

Connectable Services

Facebook StatusNet @@ -32,7 +32,7 @@
{{ if $nv }} -

Find Friends

+

Find Friends

$nv.directory.1
$nv.match.1
$nv.suggest.1 @@ -42,14 +42,14 @@
{{ if $lastusers_title }} -

PostIt to Friendica

+

PostIt to Friendica

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

$lastusers_title

+

$lastusers_title

{{ for $lastusers_items as $i }} $i @@ -70,7 +70,7 @@
{{ if $photos_title }} -

$photos_title

+

$photos_title

{{ for $photos_items as $i }} $i @@ -81,7 +81,7 @@
{{ if $like_title }} -

$like_title

+

$like_title

    {{ for $like_items as $i }}
  • $i
  • diff --git a/view/theme/diabook-blue/style-network.css b/view/theme/diabook-blue/style-network.css index ebf4da695..fc4e4c60c 100644 --- a/view/theme/diabook-blue/style-network.css +++ b/view/theme/diabook-blue/style-network.css @@ -1197,6 +1197,18 @@ right_aside .icon {width: 10px; height: 10px;} background-image: url("../../../view/theme/diabook-blue/icons/close_box.png"); float: right; cursor: pointer; + opacity: 0.1; + } +.close_box:hover { + background-image: url("../../../view/theme/diabook-blue/icons/close_box.png"); + float: right; + cursor: pointer; + opacity: 1; +-webkit-transition: all 0.2s ease-in-out; +-moz-transition: all 0.2s ease-in-out; +-o-transition: all 0.2s ease-in-out; +-ms-transition: all 0.2s ease-in-out; +transition: all 0.2s ease-in-out; } /* wall item */ @@ -1279,7 +1291,7 @@ right_aside .icon {width: 10px; height: 10px;} } .wall-item-container .wall-item-content img { - max-width: 400px; + max-width: 400px; } .wall-item-container .wall-item-links, .wall-item-container .wall-item-actions { display: table-cell; diff --git a/view/theme/diabook-blue/style-profile.css b/view/theme/diabook-blue/style-profile.css index db172dcda..b3a578680 100644 --- a/view/theme/diabook-blue/style-profile.css +++ b/view/theme/diabook-blue/style-profile.css @@ -1196,6 +1196,18 @@ right_aside .icon {width: 10px; height: 10px;} background-image: url("../../../view/theme/diabook-blue/icons/close_box.png"); float: right; cursor: pointer; + opacity: 0.1; + } +.close_box:hover { + background-image: url("../../../view/theme/diabook-blue/icons/close_box.png"); + float: right; + cursor: pointer; + opacity: 1; +-webkit-transition: all 0.2s ease-in-out; +-moz-transition: all 0.2s ease-in-out; +-o-transition: all 0.2s ease-in-out; +-ms-transition: all 0.2s ease-in-out; +transition: all 0.2s ease-in-out; } /* wall item */ .tread-wrapper { diff --git a/view/theme/diabook-blue/theme.php b/view/theme/diabook-blue/theme.php index 3e35144de..de3042dbf 100755 --- a/view/theme/diabook-blue/theme.php +++ b/view/theme/diabook-blue/theme.php @@ -150,7 +150,7 @@ function diabook_blue_community_info(){ if(local_user()) { $page = '
    -

    '.t("Community Pages").'

    +

    '.t("Community Pages").'