From d0d79196ba43a9826eff135ef5cb2096570fc568 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 27 Apr 2012 13:31:06 -0400 Subject: fix contact-friend stuff on profile sidebar Signed-off-by: Simon L'nu --- view/theme/dispy/dark/style.css | 3 ++- view/theme/dispy/dark/style.less | 26 +++++++++++++++++++++----- view/theme/dispy/light/style.css | 3 ++- view/theme/dispy/light/style.less | 26 +++++++++++++++++++++----- 4 files changed, 46 insertions(+), 12 deletions(-) (limited to 'view/theme') diff --git a/view/theme/dispy/dark/style.css b/view/theme/dispy/dark/style.css index 3b0548be2..553279415 100644 --- a/view/theme/dispy/dark/style.css +++ b/view/theme/dispy/dark/style.css @@ -103,6 +103,7 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm .vcard #profile-photo-wrapper{margin:20px;}.vcard #profile-photo-wrapper img{box-shadow:3px 3px 10px 0 #000;} #asidemain h4{font-size:1.2em;} #asidemain #viewcontacts{text-align:right;} +#asidemain #contact-block{width:99%;}#asidemain #contact-block .contact-block-content{width:99%;}#asidemain #contact-block .contact-block-content .contact-block-div{float:left;margin:0 5px 5px 0;width:50px;height:50px;padding:3px;position:relative;} .aprofile dt{background:#eec;color:#2e2f2e;font-weight:bold;box-shadow:1px 1px 5px 0 #000;margin:15px 0 5px;padding-left:5px;} #profile-extra-links ul{margin-left:0px;padding-left:0px;list-style:none;} #dfrn-request-link{background:#3465a4 url(dark/connect.png) no-repeat 95% center;border-radius:5px 5px 5px 5px;color:#eec;display:block;font-size:1.2em;padding:0.2em 0.5em;} @@ -217,7 +218,7 @@ div[id$="text"]{font-weight:bold;border-bottom:1px solid #ccc;} div[id$="wrapper"]{height:100%;margin-bottom:1em;}div[id$="wrapper"] br{clear:left;} .profile-match-wrapper{float:left;margin:0 5px 40px 0;width:120px;height:120px;padding:3px;position:relative;} .icon.drophide.profile-match-ignore{margin:0 6px 0 -3px;} -[id$="-end"],[class$="end"]{clear:both;margin:0 0 10px 0;} +[id$="-end"],[class$="-end"]{clear:both;margin:0 0 10px 0;} .profile-match-end{margin:0 0 5px 0;} .profile-match-name{font-weight:bold;margin:auto auto auto 23px;} .profile-match-connect{font-style:italic;margin:auto auto auto 23px;} diff --git a/view/theme/dispy/dark/style.less b/view/theme/dispy/dark/style.less index 96cdb82fa..321cb7618 100644 --- a/view/theme/dispy/dark/style.less +++ b/view/theme/dispy/dark/style.less @@ -693,10 +693,26 @@ nav #nav-notifications-linkmenu { */ #asidemain { - h4 { - font-size: 1.2em; } - #viewcontacts { - text-align: right; } } + h4 { + font-size: 1.2em; } + #viewcontacts { + text-align: right; + } + #contact-block { + width: 99%; + .contact-block-content { + width: 99%; + .contact-block-div { + float: left; + margin: 0 5px 5px 0; + width: 50px; + height: 50px; + padding: 3px; + position: relative; + } + } + } +} .aprofile dt { background: #eec; @@ -1400,7 +1416,7 @@ div { } -[id$="-end"], [class$="end"] { +[id$="-end"], [class$="-end"] { clear: both; margin: 0 0 10px 0; } diff --git a/view/theme/dispy/light/style.css b/view/theme/dispy/light/style.css index fc293def8..087555615 100644 --- a/view/theme/dispy/light/style.css +++ b/view/theme/dispy/light/style.css @@ -103,6 +103,7 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm .vcard #profile-photo-wrapper{margin:20px;}.vcard #profile-photo-wrapper img{box-shadow:3px 3px 10px 0 #000;} #asidemain h4{font-size:1.2em;} #asidemain #viewcontacts{text-align:right;} +#asidemain #contact-block{width:99%;}#asidemain #contact-block .contact-block-content{width:99%;}#asidemain #contact-block .contact-block-content .contact-block-div{float:left;margin:0 5px 5px 0;width:50px;height:50px;padding:3px;position:relative;} .aprofile dt{background:transparent;color:#666666;font-weight:bold;box-shadow:1px 1px 5px 0 #000;margin:15px 0 5px;padding-left:5px;} #profile-extra-links ul{margin-left:0px;padding-left:0px;list-style:none;} #dfrn-request-link{background:#3465a4 url(light/connect.png) no-repeat 95% center;border-radius:5px 5px 5px 5px;color:#fff;display:block;font-size:1.2em;padding:0.2em 0.5em;} @@ -217,7 +218,7 @@ div[id$="text"]{font-weight:bold;border-bottom:1px solid #ccc;} div[id$="wrapper"]{height:100%;margin-bottom:1em;}div[id$="wrapper"] br{clear:left;} .profile-match-wrapper{float:left;margin:0 5px 40px 0;width:120px;height:120px;padding:3px;position:relative;} .icon.drophide.profile-match-ignore{margin:0 6px 0 -3px;} -[id$="-end"],[class$="end"]{clear:both;margin:0 0 10px 0;} +[id$="-end"],[class$="-end"]{clear:both;margin:0 0 10px 0;} .profile-match-end{margin:0 0 5px 0;} .profile-match-name{font-weight:bold;margin:auto auto auto 23px;} .profile-match-connect{font-style:italic;margin:auto auto auto 23px;} diff --git a/view/theme/dispy/light/style.less b/view/theme/dispy/light/style.less index f14284f39..f7c4135c7 100644 --- a/view/theme/dispy/light/style.less +++ b/view/theme/dispy/light/style.less @@ -694,10 +694,26 @@ nav #nav-notifications-linkmenu { */ #asidemain { - h4 { - font-size: 1.2em; } - #viewcontacts { - text-align: right; } } + h4 { + font-size: 1.2em; } + #viewcontacts { + text-align: right; + } + #contact-block { + width: 99%; + .contact-block-content { + width: 99%; + .contact-block-div { + float: left; + margin: 0 5px 5px 0; + width: 50px; + height: 50px; + padding: 3px; + position: relative; + } + } + } +} .aprofile dt { background: transparent; @@ -1401,7 +1417,7 @@ div { } -[id$="-end"], [class$="end"] { +[id$="-end"], [class$="-end"] { clear: both; margin: 0 0 10px 0; } -- cgit v1.2.3 From 64f3af49fa31ee566515cb878f5e5e48a0b4f6b3 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 27 Apr 2012 14:33:56 -0400 Subject: remove extra netsearch-box and fix Signed-off-by: Simon L'nu --- view/theme/dispy/dark/style.css | 3 +-- view/theme/dispy/dark/style.less | 16 ++++++---------- view/theme/dispy/light/style.css | 3 +-- view/theme/dispy/light/style.less | 16 ++++++---------- 4 files changed, 14 insertions(+), 24 deletions(-) (limited to 'view/theme') diff --git a/view/theme/dispy/dark/style.css b/view/theme/dispy/dark/style.css index 553279415..26a21bcf1 100644 --- a/view/theme/dispy/dark/style.css +++ b/view/theme/dispy/dark/style.css @@ -108,7 +108,6 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm #profile-extra-links ul{margin-left:0px;padding-left:0px;list-style:none;} #dfrn-request-link{background:#3465a4 url(dark/connect.png) no-repeat 95% center;border-radius:5px 5px 5px 5px;color:#eec;display:block;font-size:1.2em;padding:0.2em 0.5em;} #wallmessage-link{color:#eee;display:block;font-size:1.2em;padding:0.2em 0.5em;} -#netsearch-box{margin:20px 0px 30px;width:150px;}#netsearch-box #search-submit{margin:5px 5px 0px 0px;} .ttright{margin:0px 0px 0px 0px;} .contact-block-div{width:50px;height:50px;float:left;} .contact-block-textdiv{width:150px;height:34px;float:left;} @@ -385,7 +384,7 @@ div[id$="wrapper"]{height:100%;margin-bottom:1em;}div[id$="wrapper"] br{clear:le #side-peoplefind-url{background-color:#2e2f2e;color:#eec;border:1px #999 solid;margin-right:3px;width:75%;}#side-peoplefind-url:hover,#side-peoplefind-url:focus{background-color:#efefef;color:#222;border:1px 333 solid;} .nets-ul{list-style-type:none;padding-left:0px;}.nets-ul li{margin:10px 0 0;} .nets-link,.nets-all{margin-left:0px;} -#netsearch-box{margin-top:20px;width:150px;}#netsearch-box #search-submit{margin:5px 0px 0px 0px;} +#netsearch-box{margin:20px 0px 30px;width:135px;}#netsearch-box #search-submit{margin:5px 5px 0px 0px;} #pending-update{float:right;color:#fff;font-weight:bold;background-color:#ff0000;padding:0 .3em;} .admin.linklist{border:0;padding:0;} .admin.link{list-style-position:inside;} diff --git a/view/theme/dispy/dark/style.less b/view/theme/dispy/dark/style.less index 321cb7618..c56adf5a1 100644 --- a/view/theme/dispy/dark/style.less +++ b/view/theme/dispy/dark/style.less @@ -743,12 +743,6 @@ nav #nav-notifications-linkmenu { font-size: 1.2em; padding: 0.2em 0.5em; } -#netsearch-box { - margin: 20px 0px 30px; - width: 150px; - #search-submit { - margin: 5px 5px 0px 0px; } } - .ttright { margin: 0px 0px 0px 0px; } @@ -2222,10 +2216,12 @@ div { margin-left: 0px; } #netsearch-box { - margin-top: 20px; - width: 150px; - #search-submit { - margin: 5px 0px 0px 0px; } } + margin: 20px 0px 30px; + width: 135px; + #search-submit { + margin: 5px 5px 0px 0px; + } +} /** * admin diff --git a/view/theme/dispy/light/style.css b/view/theme/dispy/light/style.css index 087555615..2c95d70da 100644 --- a/view/theme/dispy/light/style.css +++ b/view/theme/dispy/light/style.css @@ -108,7 +108,6 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm #profile-extra-links ul{margin-left:0px;padding-left:0px;list-style:none;} #dfrn-request-link{background:#3465a4 url(light/connect.png) no-repeat 95% center;border-radius:5px 5px 5px 5px;color:#fff;display:block;font-size:1.2em;padding:0.2em 0.5em;} #wallmessage-link{color:#eee;display:block;font-size:1.2em;padding:0.2em 0.5em;} -#netsearch-box{margin:20px 0px 30px;width:150px;}#netsearch-box #search-submit{margin:5px 5px 0px 0px;} .ttright{margin:0px 0px 0px 0px;} .contact-block-div{width:50px;height:50px;float:left;} .contact-block-textdiv{width:150px;height:34px;float:left;} @@ -385,7 +384,7 @@ div[id$="wrapper"]{height:100%;margin-bottom:1em;}div[id$="wrapper"] br{clear:le #side-peoplefind-url{background-color:#e5e0cf;color:#666;border:1px #666 solid;margin-right:3px;width:75%;}#side-peoplefind-url:hover,#side-peoplefind-url:focus{background-color:#efefef;color:#222;border:1px 333 solid;} .nets-ul{list-style-type:none;padding-left:0px;}.nets-ul li{margin:10px 0 0;} .nets-link,.nets-all{margin-left:0px;} -#netsearch-box{margin-top:20px;width:150px;}#netsearch-box #search-submit{margin:5px 0px 0px 0px;} +#netsearch-box{margin:20px 0px 30px;width:135px;}#netsearch-box #search-submit{margin:5px 5px 0px 0px;} #pending-update{float:right;color:#fff;font-weight:bold;background-color:#ff0000;padding:0 .3em;} .admin.linklist{border:0;padding:0;} .admin.link{list-style-position:inside;} diff --git a/view/theme/dispy/light/style.less b/view/theme/dispy/light/style.less index f7c4135c7..18151bc27 100644 --- a/view/theme/dispy/light/style.less +++ b/view/theme/dispy/light/style.less @@ -744,12 +744,6 @@ nav #nav-notifications-linkmenu { font-size: 1.2em; padding: 0.2em 0.5em; } -#netsearch-box { - margin: 20px 0px 30px; - width: 150px; - #search-submit { - margin: 5px 5px 0px 0px; } } - .ttright { margin: 0px 0px 0px 0px; } @@ -2223,10 +2217,12 @@ div { margin-left: 0px; } #netsearch-box { - margin-top: 20px; - width: 150px; - #search-submit { - margin: 5px 0px 0px 0px; } } + margin: 20px 0px 30px; + width: 135px; + #search-submit { + margin: 5px 5px 0px 0px; + } +} /** * admin -- cgit v1.2.3 From 731379fa25b52f6b8333a591bbc4b74cb7d2f74c Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Fri, 27 Apr 2012 23:48:44 +0200 Subject: another attempt to fix lower tab behaviour on small screens, community back in tab area --- view/theme/cleanzero/nav.tpl | 46 +++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'view/theme') diff --git a/view/theme/cleanzero/nav.tpl b/view/theme/cleanzero/nav.tpl index 4dacf3858..9fe5ac0fe 100644 --- a/view/theme/cleanzero/nav.tpl +++ b/view/theme/cleanzero/nav.tpl @@ -1,23 +1,14 @@ - - +
$langselector
diff --git a/view/theme/diabook/style-wide.css b/view/theme/diabook/style-wide.css index f8dced3e6..71ed4e472 100644 --- a/view/theme/diabook/style-wide.css +++ b/view/theme/diabook/style-wide.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -974,7 +975,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1195,7 +1196,7 @@ aside #side-peoplefind-url { margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index 9150ea8cf..e70c72cb2 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -974,7 +975,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1198,7 +1199,7 @@ aside #side-peoplefind-url { margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index c45db9884..fa0d47ece 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -3,13 +3,13 @@ /* * Name: Diabook * Description: Diabook: report bugs and request here: http://pad.toktan.org/p/diabook or contact me : thomas_bierey@friendica.eu - * Version: (Version: 1.022) + * Version: (Version: 1.023) * Author: */ //print diabook-version for debugging -$diabook_version = "Diabook (Version: 1.022)"; +$diabook_version = "Diabook (Version: 1.023)"; $a->page['htmlhead'] .= sprintf('', $diabook_version); //change css on network and profilepages @@ -313,6 +313,20 @@ $autogrowJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.autogro $a->page['htmlhead'] .= sprintf('', $autogrowJS); //js scripts + +//check if community_home-plugin is activated and change css +$nametocheck = "communityhome"; +$r = q("select id from addon where name = '%s' and installed = 1", dbesc($nametocheck)); +if(count($r) == "1") { + +$a->page['htmlhead'] .= ' +'; +} + //comment-edit-wrapper on photo_view if ($a->argv[0].$a->argv[2] === "photos"."image"){ @@ -324,7 +338,6 @@ $a->page['htmlhead'] .= ' }); '; - } $a->page['htmlhead'] .= ' @@ -334,6 +347,10 @@ $a->page['htmlhead'] .= ' $("a.lightbox").fancybox(); // Select all links with lightbox class }); +$(document).ready(function() { + var footer_top = $(document).height() - 30; + $("div#footerbox").attr("style", "border-top: 1px solid #D2D2D2; width: 70%;right: 15%;position: absolute;top:"+footer_top+"px;"); + }); '; -- cgit v1.2.3 From 920d40acf43adb584a33555bfd73e2e5d5f1ebd0 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Sun, 29 Apr 2012 05:58:23 +0200 Subject: diabook-themes: small fix --- view/theme/diabook/footer.tpl | 2 +- view/theme/diabook/theme.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'view/theme') diff --git a/view/theme/diabook/footer.tpl b/view/theme/diabook/footer.tpl index bae5e1056..25058a7ff 100644 --- a/view/theme/diabook/footer.tpl +++ b/view/theme/diabook/footer.tpl @@ -1,3 +1,3 @@ -
+ \ No newline at end of file diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index fa0d47ece..9a1ac0f68 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -347,7 +347,7 @@ $a->page['htmlhead'] .= ' $("a.lightbox").fancybox(); // Select all links with lightbox class }); -$(document).ready(function() { +$(window).load(function() { var footer_top = $(document).height() - 30; $("div#footerbox").attr("style", "border-top: 1px solid #D2D2D2; width: 70%;right: 15%;position: absolute;top:"+footer_top+"px;"); }); -- cgit v1.2.3 From f35ffa9b6065e351a99c546c6b81a312a93086a4 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Tue, 1 May 2012 02:33:55 +0200 Subject: diabook-themes: add "last tweets"-box to right_aside, that searches for #friendica on twitter --- view/theme/diabook/communityhome.tpl | 3 + view/theme/diabook/js/README | 5 + view/theme/diabook/js/jquery.twitter.search.js | 289 +++++++++++++++++++++++++ view/theme/diabook/style-network.css | 1 + view/theme/diabook/theme.php | 36 ++- 5 files changed, 327 insertions(+), 7 deletions(-) create mode 100644 view/theme/diabook/js/jquery.twitter.search.js (limited to 'view/theme') diff --git a/view/theme/diabook/communityhome.tpl b/view/theme/diabook/communityhome.tpl index 66f93c32d..5fb6eb5e2 100755 --- a/view/theme/diabook/communityhome.tpl +++ b/view/theme/diabook/communityhome.tpl @@ -42,6 +42,9 @@ $nv.search {{ endif }}
+
+
+
{{ if $lastusers_title }}

$lastusers_title

diff --git a/view/theme/diabook/js/README b/view/theme/diabook/js/README index 57ca16d02..12447afc9 100644 --- a/view/theme/diabook/js/README +++ b/view/theme/diabook/js/README @@ -24,3 +24,8 @@ $(function() { _______________________________________________________________________________________________ http://javascriptly.com/examples/jquery-grab-bag/autogrow-textarea.html + +_______________________________________________________________________________________________ + +http://jquery.malsup.com/ +http://jquery.malsup.com/twitter/ diff --git a/view/theme/diabook/js/jquery.twitter.search.js b/view/theme/diabook/js/jquery.twitter.search.js new file mode 100644 index 000000000..18d2e091a --- /dev/null +++ b/view/theme/diabook/js/jquery.twitter.search.js @@ -0,0 +1,289 @@ +/*! + * jQuery Twitter Search Plugin + * Examples and documentation at: http://jquery.malsup.com/twitter/ + * Copyright (c) 2010 M. Alsup + * Version: 1.04 (15-SEP-2011) + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * Requires: jQuery v1.3.2 or later + */ + +;(function($) { + $.fn.twitterSearch = function(options) { + if (typeof options == 'string') + options = { term: options }; + return this.each(function() { + var grabFlag = false, + grabbing = false, + $frame = $(this), text, $text, $title, $bird, $cont, height, paused = false, + opts = $.extend(true, {}, $.fn.twitterSearch.defaults, options || {}, $.metadata ? $frame.metadata() : {}); + + opts.formatter = opts.formatter || $.fn.twitterSearch.formatter; + opts.filter = opts.filter || $.fn.twitterSearch.filter; + + if (!opts.applyStyles) { // throw away all style defs + for (var css in opts.css) + opts.css[css] = {}; + } + + if (opts.title === null) // user can set to '' to suppress title + opts.title = opts.term; + + opts.title = opts.title || ''; + text = opts.titleLink ? (''+ opts.title + '') : ('' + opts.title +''+ ''); + $text = $(text); + if (opts.titleLink) + $text.css(opts.css['titleLink']); + $title = $('
').append($text).appendTo($frame).css(opts.css['title']); + if (opts.bird) { + $bird = $('').appendTo($title).css(opts.css['bird']); + if (opts.birdLink) + $bird.wrap(''); + } + $cont = $('
').appendTo($frame).css(opts.css['container']); + cont = $cont[0]; + if (opts.colorExterior) + $title.css('background-color',opts.colorExterior); + if (opts.colorInterior) + $cont.css('background-color',opts.colorInterior); + + $frame.css(opts.css['frame']); + if (opts.colorExterior) + $frame.css('border-color',opts.colorExterior); + + height = $frame.innerHeight() - $title.outerHeight(); + $cont.height(height); + + if (opts.pause) + $cont.hover(function(){paused = true;},function(){paused = false;}); + + $('
Loading tweets..
').css(opts.css['loading']).appendTo($cont); + + grabTweets(); + + function grabTweets() { + var url = opts.url + opts.term; + grabFlag = false; + grabbing = true; + // grab twitter stream + $.getJSONP({ + url: url, + timeout: 30000, + error: function(xhr, status, e) { + failWhale(e); + }, + complete: function() { + grabbing = false; + if (opts.refreshSeconds) + setTimeout(regrab, opts.refreshSeconds * 1000); + }, + success: function(json) { + if (json.error) { + failWhale(json.error); + return; + } + $cont.fadeOut('fast',function() { + $cont.empty(); + + // iterate twitter results + $.each(json.results, function(i) { + if (!opts.filter.call(opts, this)) + return; // skip this tweet + var $img, $text, w, + tweet = opts.formatter(this, opts), + $tweet = $(tweet); + $tweet.css(opts.css['tweet']); + $img = $tweet.find('.twitterSearchProfileImg').css(opts.css['img']); + $tweet.find('.twitterSearchUser').css(opts.css['user']); + $tweet.find('.twitterSearchTime').css(opts.css['time']); + $tweet.find('a').css(opts.css['a']); + $tweet.appendTo($cont); + $text = $tweet.find('.twitterSearchText').css(opts.css['text']); + if (opts.avatar) { + w = $img.outerWidth() + parseInt($tweet.css('paddingLeft')); + $text.css('paddingLeft', w); + } + }); + + $cont.fadeIn('fast'); + + if (json.results.length < 2) { + if (opts.refreshSeconds) + setTimeout(grabTweets, opts.refreshSeconds * 1000); + return; + } + + // stage first animation + setTimeout(go, opts.timeout); + }); + } + }); + }; + + function regrab() { + grabFlag = true; + } + + function failWhale(msg) { + var $fail = $('
' + msg + '
').css(opts.css['fail']); + $cont.empty().append($fail); + }; + + function go() { + if (paused || grabbing) { + setTimeout(go, 500); + return; + } + var h, $el = $cont.children(':first'), el = $el[0]; + $el.animate(opts.animOut, opts.animOutSpeed, function() { + h = $el.outerHeight(); + $el.animate({ marginTop: -h }, opts.animInSpeed, function() { + $el.css({ marginTop: 0, opacity: 1 }); + /*@cc_on + try { el.style.removeAttribute('filter'); } // ie cleartype fix + catch(smother) {} + @*/ + $el.css(opts.css['tweet']).show().appendTo($cont); + + setTimeout(grabFlag ? grabTweets : go, opts.timeout); + }); + }); + } + }); + }; + + $.fn.twitterSearch.filter = function(tweet) { + return true; + }; + + $.fn.twitterSearch.formatter = function(json, opts) { + var str, pretty, + text = json.text; + if (opts.anchors) { + text = json.text.replace(/(http:\/\/\S+)/g, '$1'); + text = text.replace(/\@(\w+)/g, '@$1'); + } + str = '
'; + if (opts.avatar) + str += ''; + str += '
' + + json.from_user + ''; + pretty = prettyDate(json.created_at); + if (opts.time && pretty) + str += ' ('+ pretty +')' + str += '
' + text + '
'; + return str; + }; + + $.fn.twitterSearch.defaults = { + url: 'http://search.twitter.com/search.json?callback=?&q=', + anchors: true, // true or false (enable embedded links in tweets) + animOutSpeed: 500, // speed of animation for top tweet when removed + animInSpeed: 500, // speed of scroll animation for moving tweets up + animOut: { opacity: 0 }, // animation of top tweet when it is removed + applyStyles: true, // true or false (apply default css styling or not) + avatar: true, // true or false (show or hide twitter profile images) + bird: true, // true or false (show or hide twitter bird image) + birdLink: false, // url that twitter bird image should like to + birdSrc: 'http://cloud.github.com/downloads/malsup/twitter/tweet.gif', // twitter bird image + colorExterior: null, // css override of frame border-color and title background-color + colorInterior: null, // css override of container background-color + filter: null, // callback fn to filter tweets: fn(tweetJson) { /* return false to skip tweet */ } + formatter: null, // callback fn to build tweet markup + pause: false, // true or false (pause on hover) + refreshSeconds: 0, // number of seconds to wait before polling for newer tweets + term: '', // twitter search term + time: true, // true or false (show or hide the time that the tweet was sent) + timeout: 4000, // delay betweet tweet scroll + title: null, // title text to display when frame option is true (default = 'term' text) + titleLink: null, // url for title link + css: { + // default styling + a: { textDecoration: 'none', color: '#3B5998' }, + bird: { width: '50px', height: '20px', position: 'absolute', left: '-30px', top: '-20px', border: 'none' }, + container: { overflow: 'hidden', backgroundColor: '', height: '360px' }, + fail: { background: '#6cc5c3 url(http://cloud.github.com/downloads/malsup/twitter/failwhale.png) no-repeat 50% 50%', height: '100%', padding: '10px' }, + frame: { border: '0px solid #C2CFF1', borderRadius: '0px', '-moz-border-radius': '0px', '-webkit-border-radius': '0px' }, + tweet: { padding: '5px 10px', clear: 'left' }, + img: { 'float': 'left', margin: '5px', width: '48px', height: '48px' }, + loading: { padding: '20px', textAlign: 'center', color: '#888' }, + text: {}, + time: { fontSize: 'smaller', color: '#888' }, + title: { 'border-bottom': '1px solid #D2D2D2', 'padding-top': '5px', 'padding-bottom': '0px', 'padding-left': '9px', 'margin-bottom': '0px', 'margin-top': '30px' , 'display': 'block', 'font-size': '1.17em', 'font-weight': 'bold'}, + titleLink: { textDecoration: 'none', color: '#3B5998' }, + user: { fontWeight: 'bold' } + } + }; + + // fn to handle jsonp with timeouts and errors + // hat tip to Ricardo Tomasi for the timeout logic + $.getJSONP = function(s) { + s.dataType = 'jsonp'; + $.ajax(s); + + // figure out what the callback fn is + var $script = $(document.getElementsByTagName('head')[0].firstChild); + var url = $script.attr('src') || ''; + var cb = (url.match(/callback=(\w+)/)||[])[1]; + if (!cb) + return; // bail + var t = 0, cbFn = window[cb]; + + $script[0].onerror = function(e) { + $script.remove(); + handleError(s, {}, "error", e); + clearTimeout(t); + }; + + if (!s.timeout) + return; + + window[cb] = function(json) { + clearTimeout(t); + cbFn(json); + cbFn = null; + }; + + t = setTimeout(function() { + $script.remove(); + handleError(s, {}, "timeout"); + if (cbFn) + window[cb] = function(){}; + }, s.timeout); + + function handleError(s, xhr, msg, e) { + s.error && s.error.call(s.context, xhr, msg, e); + s.global && $.event.trigger("ajaxError", [xhr, s, e || msg]); + s.complete && s.complete.call(s.context, xhr, e || msg); + } + }; + + /* + * JavaScript Pretty Date + * Copyright (c) 2008 John Resig (jquery.com) + * Licensed under the MIT license. + */ + // converts ISO time to casual time + function prettyDate(time){ + var date = new Date((time || "").replace(/-/g,"/").replace(/TZ/g," ")), + diff = (((new Date()).getTime() - date.getTime()) / 1000), + day_diff = Math.floor(diff / 86400); + + if ( isNaN(day_diff) || day_diff < 0 || day_diff >= 31 ) + return; + var v = day_diff == 0 && ( + diff < 60 && "just now" || + diff < 120 && "1 minute ago" || + diff < 3600 && Math.floor( diff / 60 ) + " minutes ago" || + diff < 7200 && "1 hour ago" || + diff < 86400 && Math.floor( diff / 3600 ) + " hours ago") || + day_diff == 1 && "Yesterday" || + day_diff < 7 && day_diff + " days ago" || + day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks ago"; + if (!v) + window.console && console.log(time); + return v ? v : ''; + } + +})(jQuery); diff --git a/view/theme/diabook/style-network.css b/view/theme/diabook/style-network.css index a8ed1e9a2..2ba8d1b07 100644 --- a/view/theme/diabook/style-network.css +++ b/view/theme/diabook/style-network.css @@ -1252,6 +1252,7 @@ right_aside .icon {width: 10px; height: 10px;} transition: all 0.2s ease-in-out; } + /* wall item */ .tread-wrapper { border-bottom: 1px solid #D2D2D2; diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index 9a1ac0f68..ffa480f3b 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -3,13 +3,13 @@ /* * Name: Diabook * Description: Diabook: report bugs and request here: http://pad.toktan.org/p/diabook or contact me : thomas_bierey@friendica.eu - * Version: (Version: 1.023) + * Version: (Version: 1.024) * Author: */ //print diabook-version for debugging -$diabook_version = "Diabook (Version: 1.023)"; +$diabook_version = "Diabook (Version: 1.024)"; $a->page['htmlhead'] .= sprintf('', $diabook_version); //change css on network and profilepages @@ -266,9 +266,9 @@ if ($a->argv[0] === "network" && local_user()){ } - $ccCookie = $_COOKIE['close_pages'] + $_COOKIE['close_helpers'] + $_COOKIE['close_services'] + $_COOKIE['close_friends'] + $_COOKIE['close_lastusers'] + $_COOKIE['close_lastphotos'] + $_COOKIE['close_lastlikes']; + $ccCookie = $_COOKIE['close_pages'] + $_COOKIE['close_helpers'] + $_COOKIE['close_services'] + $_COOKIE['close_friends'] + $_COOKIE['close_twitter'] + $_COOKIE['close_lastusers'] + $_COOKIE['close_lastphotos'] + $_COOKIE['close_lastlikes']; - if($ccCookie != "7") { + if($ccCookie != "8") { // COMMUNITY diabook_community_info(); @@ -282,7 +282,7 @@ if ($a->argv[0] === "network" && local_user()){ //right_aside at profile pages if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname']){ - if($ccCookie != "7") { + if($ccCookie != "8") { // COMMUNITY diabook_community_info(); @@ -312,6 +312,10 @@ $a->page['htmlhead'] .= sprintf('', $autogrowJS); +//load jquery.twitter.search.js +$twitterJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.twitter.search.js"; +$a->page['htmlhead'] .= sprintf('', $twitterJS); + //js scripts //check if community_home-plugin is activated and change css @@ -343,8 +347,17 @@ $a->page['htmlhead'] .= ' $a->page['htmlhead'] .= ' '; - if($ccCookie != "7") { + if($ccCookie != "8") { $a->page['htmlhead'] .= ' '; - if($ccCookie != "8") { + if($ccCookie != "9") { $a->page['htmlhead'] .= ' + diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index f9be99759..de003b27d 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -3,13 +3,20 @@ /* * Name: Diabook * Description: Diabook: report bugs and request here: http://pad.toktan.org/p/diabook or contact me : thomas_bierey@friendica.eu - * Version: (Version: 1.024) + * Version: (Version: 1.025) * Author: */ +$a = get_app(); +$a->theme_info = array( + 'family' => 'diabook', + 'version' => '1.025' +); +function diabook_init(&$a) { + //print diabook-version for debugging -$diabook_version = "Diabook (Version: 1.024)"; +$diabook_version = "Diabook (Version: 1.025)"; $a->page['htmlhead'] .= sprintf('', $diabook_version); //change css on network and profilepages @@ -34,16 +41,259 @@ if ($color=="green") $color_path = "/diabook-green/"; if ($color=="dark") $color_path = "/diabook-dark/"; -/** - * prints last community activity - */ + //profile_side at networkpages + if ($a->argv[0] === "network" && local_user()){ + + // USER MENU + if(local_user()) { + + $r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid'])); + + $userinfo = array( + 'icon' => (count($r) ? $r[0]['micro']: $a->get_baseurl()."/images/default-profile-mm.jpg"), + 'name' => $a->user['username'], + ); + $ps = array('usermenu'=>array()); + $ps['usermenu']['status'] = Array('profile/' . $a->user['nickname'], t('Home'), "", t('Your posts and conversations')); + $ps['usermenu']['profile'] = Array('profile/' . $a->user['nickname']. '?tab=profile', t('Profile'), "", t('Your profile page')); + $ps['usermenu']['contacts'] = Array('contacts' , t('Contacts'), "", t('Your contacts')); + $ps['usermenu']['photos'] = Array('photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos')); + $ps['usermenu']['events'] = Array('events/', t('Events'), "", t('Your events')); + $ps['usermenu']['notes'] = Array('notes/', t('Personal notes'), "", t('Your personal photos')); + $ps['usermenu']['community'] = Array('community/', t('Community'), "", ""); + $ps['usermenu']['pgroups'] = Array('http://dir.friendica.com/directory/forum', t('Community Pages'), "", ""); + + $tpl = get_markup_template('profile_side.tpl'); + + $a->page['aside'] = replace_macros($tpl, array( + '$userinfo' => $userinfo, + '$ps' => $ps, + )).$a->page['aside']; + + } + + $ccCookie = $_COOKIE['close_pages'] + $_COOKIE['close_profiles'] + $_COOKIE['close_helpers'] + $_COOKIE['close_services'] + $_COOKIE['close_friends'] + $_COOKIE['close_twitter'] + $_COOKIE['close_lastusers'] + $_COOKIE['close_lastphotos'] + $_COOKIE['close_lastlikes']; + + if($ccCookie != "9") { + // COMMUNITY + diabook_community_info(); + + // CUSTOM CSS + if($resolution == "normal") {$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook".$color_path."style-network.css";} + if($resolution == "wide") {$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook".$color_path."style-network-wide.css";} + } + } + + + //right_aside at profile pages + if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname']){ + if($ccCookie != "9") { + // COMMUNITY + diabook_community_info(); + + // CUSTOM CSS + if($resolution == "normal") {$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook".$color_path."style-profile.css";} + if($resolution == "wide") {$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook".$color_path."style-profile-wide.css";} + + } + } + + //js scripts + //load jquery.cookie.js + $cookieJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.cookie.js"; + $a->page['htmlhead'] .= sprintf('', $cookieJS); + + //load jquery.ae.image.resize.js + $imageresizeJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.ae.image.resize.js"; + $a->page['htmlhead'] .= sprintf('', $imageresizeJS); + + //load jquery.twitter.search.js + $twitterJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.twitter.search.js"; + $a->page['htmlhead'] .= sprintf('', $twitterJS); + + $a->page['htmlhead'] .= ' + '; + //check if community_home-plugin is activated and change css + $nametocheck = "communityhome"; + $r = q("select id from addon where name = '%s' and installed = 1", dbesc($nametocheck)); + if(count($r) == "1") { + + $a->page['htmlhead'] .= ' + '; + } + //comment-edit-wrapper on photo_view + if ($a->argv[0].$a->argv[2] === "photos"."image"){ + $a->page['htmlhead'] .= ' + '; + } + //restore right hand col at settingspage + if($a->argv[0] === "settings" && local_user()) { + $a->page['htmlhead'] .= ' + ';} + + if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] or $a->argv[0] === "network" && local_user()){ + $a->page['htmlhead'] .= ' + '; + + if($ccCookie != "9") { + $a->page['htmlhead'] .= ' + ';} + } + //end js scripts + + // custom css + if (!is_null($cssFile)) $a->page['htmlhead'] .= sprintf('', $cssFile); + + //footer + $tpl = get_markup_template('footer.tpl'); + $a->page['footer'] .= replace_macros($tpl, array()); + + // + js_in_foot(); +} + + function diabook_community_info() { + $a = get_app(); // comunity_profiles $aside['$comunity_profilest_title'] = t('Community Profiles'); $aside['$comunity_profiles_items'] = array(); @@ -193,7 +443,7 @@ function diabook_community_info(){ $aside['$nv'] = $nv; }; - //Community Page + //Community_Pages at right_aside if(local_user()) { $page = '

'.t("Community Pages").'

@@ -223,404 +473,46 @@ function diabook_community_info(){ } $page .= '
'; //if (sizeof($contacts) > 0) - $aside['$page'] = $page; } //END Community Page //helpers $helpers = array(); $helpers['title'] = Array("", t('Help or @NewHere ?'), "", ""); - $aside['$helpers'] = $helpers; //end helpers //connectable services $con_services = array(); $con_services['title'] = Array("", t('Connect Services'), "", ""); - $aside['$con_services'] = $con_services; //end connectable services - - //get_baseurl $url = $a->get_baseurl($ssl_state); $aside['$url'] = $url; - + //print right_aside $tpl = file_get_contents(dirname(__file__).'/communityhome.tpl'); $a->page['right_aside'] = replace_macros($tpl, $aside); - - - -} - - -//profile_side at networkpages -if ($a->argv[0] === "network" && local_user()){ - - // USER MENU - if(local_user()) { - - $r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid'])); - - $userinfo = array( - 'icon' => (count($r) ? $r[0]['micro']: $a->get_baseurl()."/images/default-profile-mm.jpg"), - 'name' => $a->user['username'], - ); - $ps = array('usermenu'=>array()); - $ps['usermenu']['status'] = Array('profile/' . $a->user['nickname'], t('Home'), "", t('Your posts and conversations')); - $ps['usermenu']['profile'] = Array('profile/' . $a->user['nickname']. '?tab=profile', t('Profile'), "", t('Your profile page')); - $ps['usermenu']['contacts'] = Array('contacts' , t('Contacts'), "", t('Your contacts')); - $ps['usermenu']['photos'] = Array('photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos')); - $ps['usermenu']['events'] = Array('events/', t('Events'), "", t('Your events')); - $ps['usermenu']['notes'] = Array('notes/', t('Personal notes'), "", t('Your personal photos')); - $ps['usermenu']['community'] = Array('community/', t('Community'), "", ""); - $ps['usermenu']['pgroups'] = Array('http://dir.friendica.com/directory/forum', t('Community Pages'), "", ""); - - $tpl = get_markup_template('profile_side.tpl'); - - $a->page['aside'] .= replace_macros($tpl, array( - '$userinfo' => $userinfo, - '$ps' => $ps, - )); - - } - - $ccCookie = $_COOKIE['close_pages'] + $_COOKIE['close_profiles'] + $_COOKIE['close_helpers'] + $_COOKIE['close_services'] + $_COOKIE['close_friends'] + $_COOKIE['close_twitter'] + $_COOKIE['close_lastusers'] + $_COOKIE['close_lastphotos'] + $_COOKIE['close_lastlikes']; - - if($ccCookie != "9") { - // COMMUNITY - diabook_community_info(); - - // CUSTOM CSS - if($resolution == "normal") {$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook".$color_path."style-network.css";} - if($resolution == "wide") {$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook".$color_path."style-network-wide.css";} - } -} - - - -//right_aside at profile pages -if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname']){ - if($ccCookie != "9") { - // COMMUNITY - diabook_community_info(); - - // CUSTOM CSS - if($resolution == "normal") {$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook".$color_path."style-profile.css";} - if($resolution == "wide") {$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook".$color_path."style-profile-wide.css";} - - } -} + } -// custom css -if (!is_null($cssFile)) $a->page['htmlhead'] .= sprintf('', $cssFile); - -//footer -$tpl = get_markup_template('footer.tpl'); -$a->page['footer'] .= replace_macros($tpl, array()); - -//load jquery.cookie.js -$cookieJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.cookie.js"; -$a->page['htmlhead'] .= sprintf('', $cookieJS); - -//load jquery.ae.image.resize.js -$imageresizeJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.ae.image.resize.js"; -$a->page['htmlhead'] .= sprintf('', $imageresizeJS); + function js_in_foot() { + /** @purpose insert stuff in bottom of page + */ + $a = get_app(); + $baseurl = $a->get_baseurl($ssl_state); + $bottom['$baseurl'] = $baseurl; + $tpl = file_get_contents(dirname(__file__) . '/bottom.tpl'); + $a->page['footer'] = $a->page['footer'].replace_macros($tpl, $bottom); + } -//load jquery.autogrow-textarea.js -$autogrowJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.autogrow.textarea.js"; -$a->page['htmlhead'] .= sprintf('', $autogrowJS); -//load jquery.twitter.search.js -$twitterJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.twitter.search.js"; -$a->page['htmlhead'] .= sprintf('', $twitterJS); -//js scripts -//check if community_home-plugin is activated and change css -$nametocheck = "communityhome"; -$r = q("select id from addon where name = '%s' and installed = 1", dbesc($nametocheck)); -if(count($r) == "1") { - -$a->page['htmlhead'] .= ' -'; -} -//comment-edit-wrapper on photo_view -if ($a->argv[0].$a->argv[2] === "photos"."image"){ -$a->page['htmlhead'] .= ' -'; -} -$a->page['htmlhead'] .= ' - -'; -$a->page['htmlhead'] .= ' -'; - -$a->page['htmlhead'] .= ' - '; -if($a->argv[0] === "settings" && local_user()) { -$a->page['htmlhead'] .= ' -';} - - - -if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] or $a->argv[0] === "network" && local_user()){ -$a->page['htmlhead'] .= ' -'; - - - if($ccCookie != "9") { -$a->page['htmlhead'] .= ' -';}} - -$a->page['htmlhead'] .= ' - - '; \ No newline at end of file -- cgit v1.2.3 From 6875f54647cbbdb66e6d570cbf357a8b83644fad Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Wed, 2 May 2012 16:27:01 +0200 Subject: diabook-themes: more improvements in theme.php, add titles to bbcode under coment-box --- view/theme/diabook/comment_item.tpl | 14 +++---- view/theme/diabook/communityhome.tpl | 4 +- view/theme/diabook/js/jquery.twitter.search.js | 2 +- view/theme/diabook/theme.php | 55 +++++++++++++++++--------- 4 files changed, 47 insertions(+), 28 deletions(-) (limited to 'view/theme') diff --git a/view/theme/diabook/comment_item.tpl b/view/theme/diabook/comment_item.tpl index e10b86845..fc3594fdc 100644 --- a/view/theme/diabook/comment_item.tpl +++ b/view/theme/diabook/comment_item.tpl @@ -13,13 +13,13 @@
{{ if $qcomment }}