From 5f619d3254052cb48fc47bc36e7aaabf9d33ce50 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 6 Aug 2012 23:10:37 -0700 Subject: [PATCH] the dynamic "show more" sort of works - but with a nagging delay. But I need to move on to bigger things. We'll leave it for now. --- boot.php | 12 ++- include/bbcode.php | 8 +- include/oembed.php | 10 +- js/main.js | 34 ++++++- version.inc | 2 +- view/theme/dispy/dark/icons.svg | 130 ++++++++++++++++++++++++-- view/theme/dispy/dark/style.css | 2 +- view/theme/dispy/dark/style.less | 4 +- view/theme/dispy/head.tpl | 16 ++-- view/theme/dispy/jot-header.tpl | 2 +- view/theme/dispy/jot.tpl | 9 +- view/theme/dispy/light/icons.svg | 126 +++++++++++++++++++++++-- view/theme/dispy/light/style.css | 2 +- view/theme/dispy/light/style.less | 4 +- view/theme/duepuntozero/css/style.css | 4 +- 15 files changed, 316 insertions(+), 49 deletions(-) diff --git a/boot.php b/boot.php index 8d7be178d..921df5593 100644 --- a/boot.php +++ b/boot.php @@ -382,12 +382,22 @@ if(! class_exists('App')) { public $plugins; public $apps = array(); public $identities; - public $sourcename = ''; public $nav_sel; public $category; + // Allow themes to control internal parameters + // by changing App values in theme.php + // + // Possibly should make these part of the plugin + // system, but it seems like overkill to invoke + // all the plugin machinery just to change a couple + // of values + public $sourcename = ''; + public $videowidth = 425; + public $videoheight = 350; + private $scheme; private $hostname; private $baseurl; diff --git a/include/bbcode.php b/include/bbcode.php index 2a4b4592b..7a88225f0 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -325,7 +325,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { // Try to Oembed if ($tryoembed) { - $Text = preg_replace("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4))\[\/video\]/ism", '', $Text); + $Text = preg_replace("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4))\[\/video\]/ism", '', $Text); $Text = preg_replace("/\[audio\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mp3))\[\/audio\]/ism", '', $Text); $Text = preg_replace_callback("/\[video\](.*?)\[\/video\]/ism", 'tryoembed', $Text); @@ -339,7 +339,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { if ($tryoembed) - $Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '', $Text); + $Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '', $Text); else $Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '$1', $Text); @@ -355,7 +355,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { $Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text); if ($tryoembed) - $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '', $Text); + $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '', $Text); else $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", "http://www.youtube.com/watch?v=$1", $Text); @@ -369,7 +369,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { $Text = preg_replace("/\[vimeo\]https?:\/\/vimeo.com\/([0-9]+)(.*?)\[\/vimeo\]/ism",'[vimeo]$1[/vimeo]',$Text); if ($tryoembed) - $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '', $Text); + $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '', $Text); else $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", "http://vimeo.com/$1", $Text); diff --git a/include/oembed.php b/include/oembed.php index a4452586e..6fc4c5371 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -12,7 +12,9 @@ function oembed_replacecb($matches){ function oembed_fetch_url($embedurl){ - $txt = Cache::get($embedurl); + $a = get_app(); + + $txt = Cache::get($a->videowidth . $embedurl); // These media files should now be caught in bbcode.php // left here as a fallback in case this is called from another source @@ -38,7 +40,7 @@ function oembed_fetch_url($embedurl){ $entries = $xpath->query("//link[@type='application/json+oembed']"); foreach($entries as $e){ $href = $e->getAttributeNode("href")->nodeValue; - $txt = fetch_url($href . '&maxwidth=425'); + $txt = fetch_url($href . '&maxwidth=' . $a->videowidth); break; } } @@ -47,7 +49,7 @@ function oembed_fetch_url($embedurl){ if ($txt==false || $txt==""){ // try oohembed service - $ourl = "http://oohembed.com/oohembed/?url=".urlencode($embedurl).'&maxwidth=425'; + $ourl = "http://oohembed.com/oohembed/?url=".urlencode($embedurl).'&maxwidth=' . $a->videowidth; $txt = fetch_url($ourl); } @@ -55,7 +57,7 @@ function oembed_fetch_url($embedurl){ if ($txt[0]!="{") $txt='{"type":"error"}'; //save in cache - Cache::set($embedurl,$txt); + Cache::set($a->videowidth . $embedurl,$txt); } diff --git a/js/main.js b/js/main.js index 438b7db14..b31261065 100644 --- a/js/main.js +++ b/js/main.js @@ -303,12 +303,43 @@ function updateConvItems(mode,data) { /* autocomplete @nicknames */ $(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl"); + + var bimgs = $(".wall-item-body > img").not(function() { return this.complete; }); + var bimgcount = bimgs.length; + if (bimgcount) { + bimgs.load(function() { + bimgcount--; + if (! bimgcount) { + collapseHeight(); + + } + }); + } else { + collapseHeight(); + } + + + // $(".wall-item-body").each(function() { + // if(! $(this).hasClass('divmore')) { + // $(this).divgrow({ initialHeight: 400, showBrackets: false }); + // $(this).addClass('divmore'); + // } + //}); } - + function collapseHeight() { + $(".wall-item-body").each(function() { + if($(this).height() > 410) { + if(! $(this).hasClass('divmore')) { + $(this).divgrow({ initialHeight: 400, showBrackets: false }); + $(this).addClass('divmore'); + } + } + }); + } @@ -737,6 +768,7 @@ jQuery.timeago.settings.strings = { $("abbr.wall-item-ago-time").timeago(); //$("div.wall-item-body").divgrow({ initialHeight: 400 }); +//reCalcHeight(); }); diff --git a/version.inc b/version.inc index 5706599cc..349538534 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2012-08-05.37 +2012-08-06.38 diff --git a/view/theme/dispy/dark/icons.svg b/view/theme/dispy/dark/icons.svg index 7cbbd3574..90b83bf81 100644 --- a/view/theme/dispy/dark/icons.svg +++ b/view/theme/dispy/dark/icons.svg @@ -43,6 +43,58 @@ is_visible="true" teeth="10" phi="10" /> + + + + + + + + + + + + + + + fit-margin-bottom="0" + inkscape:showpageshadow="false" + showborder="true"> image/svg+xml - + @@ -117,7 +171,7 @@ id="layer1" transform="translate(0,-852.36218)"> + + + + + + + + + + diff --git a/view/theme/dispy/dark/style.css b/view/theme/dispy/dark/style.css index 681952d63..18236ade5 100644 --- a/view/theme/dispy/dark/style.css +++ b/view/theme/dispy/dark/style.css @@ -90,7 +90,7 @@ nav .nav-link{display:inline-block;width:22px;height:22px;overflow:hidden;margin #nav-home-link{background-position:-44px -132px;}#nav-home-link:hover{background-position:-66px -132px;} #nav-intro-link{background-position:0px -88px;}#nav-intro-link:hover{background-position:-22px -88px;} #nav-login-link,#nav-logout-link{background-position:0 -88px;}#nav-login-link:hover,#nav-logout-link:hover{background-position:-22px -88px;} -#nav-manage-link{background-position:0px -22px;}#nav-manage-link:hover{background-position:-22px -22px;} +#nav-manage-link{background-position:-88px -88px;}#nav-manage-link:hover{background-position:-110px -88px;} #nav-messages-link{background-position:-44px -88px;}#nav-messages-link:hover{background-position:-66px -88px;} #nav-notify-link,#nav-notifications-linkmenu{background-position:-44px -110px;} #nav-notify-link:hover{background-position:-66px -110px;} diff --git a/view/theme/dispy/dark/style.less b/view/theme/dispy/dark/style.less index 4d9432961..1304e48c1 100644 --- a/view/theme/dispy/dark/style.less +++ b/view/theme/dispy/dark/style.less @@ -542,9 +542,9 @@ nav .nav-link { } } #nav-manage-link { - background-position: 0px -22px; + background-position: -88px -88px; &:hover { - background-position: -22px -22px; + background-position: -110px -88px; } } #nav-messages-link { diff --git a/view/theme/dispy/head.tpl b/view/theme/dispy/head.tpl index d42b19aef..4f24bac8f 100644 --- a/view/theme/dispy/head.tpl +++ b/view/theme/dispy/head.tpl @@ -2,27 +2,30 @@ - - + + + - - + - + + {{ endif }} diff --git a/view/theme/dispy/light/icons.svg b/view/theme/dispy/light/icons.svg index 7b82b94ea..1531edc19 100644 --- a/view/theme/dispy/light/icons.svg +++ b/view/theme/dispy/light/icons.svg @@ -14,9 +14,9 @@ height="200" id="svg3403" version="1.1" - inkscape:version="0.48+devel r" + inkscape:version="0.48.3.1 r9886" sodipodi:docname="icons.svg" - inkscape:export-filename="/var/www3/kisikew.org/portal/pub/fd/view/theme/dispy/icons.png" + inkscape:export-filename="/var/www3/kisikew.org/portal/pub/fd/view/theme/dispy/light/icons.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> + + + + + + + + + + + + + + image/svg+xml - + @@ -1482,7 +1534,7 @@ id="path4166" /> + + + + + + + + diff --git a/view/theme/dispy/light/style.css b/view/theme/dispy/light/style.css index 33c56d18f..57e317485 100644 --- a/view/theme/dispy/light/style.css +++ b/view/theme/dispy/light/style.css @@ -90,7 +90,7 @@ nav .nav-link{display:inline-block;width:22px;height:22px;overflow:hidden;margin #nav-home-link{background-position:-44px -132px;}#nav-home-link:hover{background-position:-66px -132px;} #nav-intro-link{background-position:0px -88px;}#nav-intro-link:hover{background-position:-22px -88px;} #nav-login-link,#nav-logout-link{background-position:0 -88px;}#nav-login-link:hover,#nav-logout-link:hover{background-position:-22px -88px;} -#nav-manage-link{background-position:0px -22px;}#nav-manage-link:hover{background-position:-22px -22px;} +#nav-manage-link{background-position:-88px -88px;}#nav-manage-link:hover{background-position:-110px -88px;} #nav-messages-link{background-position:-44px -88px;}#nav-messages-link:hover{background-position:-66px -88px;} #nav-notify-link,#nav-notifications-linkmenu{background-position:-44px -110px;} #nav-notify-link:hover{background-position:-66px -110px;} diff --git a/view/theme/dispy/light/style.less b/view/theme/dispy/light/style.less index d04f86969..8bb3dffa5 100644 --- a/view/theme/dispy/light/style.less +++ b/view/theme/dispy/light/style.less @@ -543,9 +543,9 @@ nav .nav-link { } } #nav-manage-link { - background-position: 0px -22px; + background-position: -88px -88px; &:hover { - background-position: -22px -22px; + background-position: -110px -88px; } } #nav-messages-link { diff --git a/view/theme/duepuntozero/css/style.css b/view/theme/duepuntozero/css/style.css index 56464ea50..544820b68 100644 --- a/view/theme/duepuntozero/css/style.css +++ b/view/theme/duepuntozero/css/style.css @@ -1122,7 +1122,7 @@ input#dfrn-url { height: 50px !important; } .wall-item-content { - /*float: left;*/ + float: left; /*width: 450px;*/ margin-left: 10px; /*margin-bottom: 20px;*/ @@ -1148,7 +1148,7 @@ input#dfrn-url { } .wall-item-body { - float: left; +/* float: left; */ /*width: 450px;*/ margin-top: 10px; }