From 8a784dd79c8a91fca239305aabb6a5ec58a1691f Mon Sep 17 00:00:00 2001 From: Fredrik Erlandsson Date: Tue, 8 Nov 2011 11:24:21 +0100 Subject: [PATCH 1/4] Squashed '3.0/themes/pear4gallery3/' changes from 98195b4..5da2cba 5da2cba Version 2.5 * Support for elastic thumb-margins. * Support for videos. 20a4d37 Elastic padding around thumbs. 4b07153 Fix for carousel view via settings (and iron out some other bugs). ab1cd0a Fix for carousel view via hash. 88b1fcd Video support. 99e46d8 Disabled console.. f148b5a Fix for 'View at smallest/largest photo size' both give 'Err on page' (Error line 53, Char: 15910, 'undefined' is null or not an object) 342e592 Escaping characters in title (for images). 3613146 version up bb7c321 Edited views/album.html.php via GitHub 293feae Fix for overflowing height. 067b764 Support for photo view count, including redirects. 77c42a1 Limit of n:o thumbs to show when skimming. Support for exif data from detailview (no longer links to the photo page), breaks the view count. git-subtree-dir: 3.0/themes/pear4gallery3 git-subtree-split: 5da2cba5ac98a199c1cf1b614fc1c5978834ec24 --- admin/controllers/admin_theme_options.php | 2 +- css/pear.css | 8 +- icons/movie.png | Bin 0 -> 4158 bytes icons/pear.css | 28 ++++-- js/pear.js | 102 ++++++++++++---------- theme.info | 2 +- views/album.html.php | 23 +++-- views/hoverView.html.php | 4 +- views/movie.html.php | 7 +- views/page.html.php | 8 +- 10 files changed, 111 insertions(+), 73 deletions(-) create mode 100644 icons/movie.png diff --git a/admin/controllers/admin_theme_options.php b/admin/controllers/admin_theme_options.php index 999334f1..cd784e24 100644 --- a/admin/controllers/admin_theme_options.php +++ b/admin/controllers/admin_theme_options.php @@ -87,7 +87,7 @@ class Admin_Theme_Options_Controller extends Admin_Controller { ->checked(module::get_var("th_pear4gallery3", "hide_logo")); $group->dropdown("mainmenu_view") ->label(t("Main page View")) - ->options(array("grid" => t("Grid (Default)"), "mosaic" => t("Mosaic"))) + ->options(array("grid" => t("Grid (Default)"), "mosaic" => t("Mosaic"), "carousel" => t("Carousel"))) ->selected(module::get_var("th_pear4gallery3", "mainmenu_view")); $group->checkbox("show_guest_menu") ->label(t("Show Main Menu for Guest Users")) diff --git a/css/pear.css b/css/pear.css index 475a0757..2be381c2 100644 --- a/css/pear.css +++ b/css/pear.css @@ -1,8 +1,6 @@ .gallery-thumb { float: left; - margin-bottom: 5px; - margin-left: 5px; - margin-right: 5px; + padding: 3px 5px 7px 5px; position: relative; text-align: center; cursor: pointer; @@ -40,9 +38,11 @@ th, td { .giTitle { font-size: 1.1em; font-weight: bold; - margin: 3px 10px !important; + margin: 0.3em 3px !important; padding: 0 0; text-align: left; + height: 1.2em; + overflow: hidden; } #gsNavBar div { diff --git a/icons/movie.png b/icons/movie.png new file mode 100644 index 0000000000000000000000000000000000000000..97793bb71abe1aa6d46fde68256d247e25b09842 GIT binary patch literal 4158 zcmV-E5W(+>P)4Tx0C)kdmkBsj>mSEohOv)Hq7flvvXq@xTXxyWR$=Th_ARnp*<~kdwicqu z&ZVq{lqIytjY5UE$S!lwA*I{x-ur+4_slcT`JVT@?>lGC=X{>uc>$mWrjCww!~g($ zysNX8f()C!fgu~&b3g?cppO_3H^sR)N^5ASLS25cE%XB-_|#K=c&_=lie3TBqwVNN zmByHYX{w(L+G?h8hJFwLA~vXj-fA<8z}ajwE5g~s)zKB|V+?1UwW&Fj9ihzUtfM6h z<#Z^ctTuBYoXs|KEu7tPR`A#k0FZQea~nJWWJ6FsVQ%4qgHE#n06cMy&QKpzGL)t4 z?H!=`QO}`_h3^Hlhqkj!0EoE(Kq>L9%}EDl-$=Y>Up9*;U)u<69j%9iKV9c7E?NVfuT z_QGBe@s{>cyJ+ld>*wVk8j$=;USQRwwxEIFk0DK=s$rbr;t?v5CYN2K!lScdDq=h0 z-o~#a(k1a+kxe#EaZ8O(%TI64cztyxiy>P$M?Kf>TG;iQH(GAK%}3nYS0G(zdOP4w zPEk|wXbH0PK$%K8z9O!&ylSn3C~e~a#eix022K51Kc#M+_s z1k;(()!IGxl%*Hdd#x|4zvJ2Ri~TRP2LfId4GzAh9y&T~^C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ys7RUYiw!S?Kw^$oYI?W@g4385t?&^7$kjm%g=H zb`Ys!_rc^WITni@V^YKOn}%5_d0iJOoG&dc(YbC(dEUr*X|82$^J$AifE_UKsXb8l ziSXmN79X##i|(GDESy&@wrVyI{xx@h*@1F;dKyAi|9~*@OsFYFp%B4mCl#MB38lIr zcN@V1w-Npq+EL&?!)A6EV$iu`S_KHt3r=s?-r+@yi8 zhlhuUR8@V91OOF=e7IC-C_oKuKiVa*pYJFz6(CuHMJ*zP_udiy$199MJ(MyG2oCQBhO_giY)x21wrB+uM70dV2bE z+%dWH<$wafqIF1kLuwPyaL9zPGe$7EYjkw<@%j1r+5Z0iA?*7BOp>tRo?8S#3;IQz zbjkhw{hb>(7CyRt`_753>%0xy1b8Vm0Y}_M*hvC}#t0y+VHk}ftdGFKqiAyZ*c>n+a literal 0 HcmV?d00001 diff --git a/icons/pear.css b/icons/pear.css index 1cb9cc07..fe2bac04 100644 --- a/icons/pear.css +++ b/icons/pear.css @@ -1,6 +1,17 @@ .gallery-thumb-round { background: url('rounded.png') no-repeat scroll left top; position: absolute; + height: 200px; + width: 200px; +} + +.p-video{ + background: url('movie.png') no-repeat center; + position: absolute; + width: 200px; + height: 200px; + left: 0px; + top: 0px; } .skimm_div { @@ -57,9 +68,9 @@ height:40px; #logoButton { display: block; - z-index: 1000; + z-index: 100; background: transparent url('pear_logo_sml.png') no-repeat center left; -width: 83px; +width: 30px; height: 40px; border: 0px; padding: 0px; @@ -84,7 +95,7 @@ background: transparent url('pear_logo_sml.png') no-repeat center left; padding: 0px 0px; width: auto; float: right; - z-index: 10000; + z-index: 100; font-size: 12px; top: 11px; } @@ -203,7 +214,7 @@ top: 10px; height: 3px; width: 154px; float: right; -z-index: 10000; +z-index: 100; } .sliderView .smaller { @@ -301,11 +312,11 @@ cursor: default; #viewControls { position: relative; color: #616161; -width: 381px; +width: 334px; float: left; margin-left: 30px; margin-top: 13px; - z-index: 8000; + z-index: 800; font-size: 12px; text-shadow: #111111 0px -1px 1px; } @@ -400,8 +411,9 @@ background: url('slideshow_active.png') center left no-repeat; top: 0; width: 100%; height: 100%; - z-index: 99999; + z-index: 999; background-color: #000000; + display: none; } #detailView .iMovieVideo { @@ -535,7 +547,7 @@ background: url('slideshow_active.png') center left no-repeat; bottom: 30px; width: 99%; text-align: center; - z-index: 99999; + z-index: 999; } #hoverView #hoverViewMenu { diff --git a/js/pear.js b/js/pear.js index 6e9c2412..30381456 100644 --- a/js/pear.js +++ b/js/pear.js @@ -5,9 +5,8 @@ var detailViewMode=false; var savedHeight = 0; var savedWidth = 0; -$(window).resize(function (e) { - if (window.innerHeight == savedHeight && - window.innerWidth == savedWidth) { e.stop(); } +$(window).resize(function () { + if (window.innerHeight == savedHeight && window.innerWidth == savedWidth) return; savedHeight = window.innerHeight; savedWidth = window.innerWidth; mosaicResize(); @@ -24,7 +23,7 @@ function swatchSkin(intSkin){ case 'dkgrey' : case 1 : $('div.gallery-thumb-round').css('backgroundPosition' , "-200px 0px"); - $('#mosaicTable').css('backgroundColor' , "#262626"); + $('#mosaicTable,.pear').css('backgroundColor' , "#262626"); $('p.giTitle').css("color", "#a9a9a9"); $("#dkgrey").addClass("dkgrey sel dkgrey-with-sel-with-swatch"); bgcolor="dkgrey"; @@ -33,7 +32,7 @@ function swatchSkin(intSkin){ case 'ltgrey' : case 2 : $('div.gallery-thumb-round').css('backgroundPosition' , "-400px 0px"); - $('#mosaicTable').css('backgroundColor' , "#d9d9d9"); + $('#mosaicTable,.pear').css('backgroundColor' , "#d9d9d9"); $('p.giTitle').css("color", "#333333"); $("#ltgrey").addClass("ltgrey sel ltgrey-with-sel-with-swatch"); bgcolor="ltgrey"; @@ -42,7 +41,7 @@ function swatchSkin(intSkin){ case 'white' : case 3 : $('div.gallery-thumb-round').css('backgroundPosition' , "-600px 0px"); - $('#mosaicTable').css('backgroundColor' , "#ffffff"); + $('#mosaicTable,.pear').css('backgroundColor' , "#ffffff"); $('p.giTitle').css("color", "#444444"); $("#white").addClass("white sel white-with-sel-with-swatch"); bgcolor="white"; @@ -52,7 +51,7 @@ function swatchSkin(intSkin){ case 0 : default: $('div.gallery-thumb-round').css('backgroundPosition' , "0px 0px"); - $('#mosaicTable').css('backgroundColor' , "#000"); + $('#mosaicTable,.pear').css('backgroundColor' , "#000"); $('p.giTitle').css("color", "#a3a3a3"); $("#black").addClass("black sel black-with-sel-with-swatch"); bgcolor="black"; @@ -66,14 +65,16 @@ function scaleIt(v,sliding){ // Remap the 0-1 scale to fit the desired range //v=.26+(v*(1.0-.26)); - size = (mosaicView) ? v/2 : v; + var size = (mosaicView) ? v/2 : v; toggleReflex(true); $(".p-photo").each(function (i) { $(this).attr({height: size+'px',width: size + 'px'}); $(this).css({height: size+'px',width: size+'px'});}); + $(".g-photo").css({width: size+'px'}); if(!mosaicView && !sliding) toggleReflex(false); + thumbPadding(); } function setCookie(c_name,value,expiredays) { @@ -148,14 +149,16 @@ function swatchImg(imageId) if( detailViewMode ) { //Image count. - $.get(slideshowImages[currentImg][1]); + $.get(slideshowImages[currentImg][6]); } updateHash(); + $('#info_detail').attr('href', slideshowImages[currentImg][1]); } -function updateHash() +function updateHash(viewMode) { - viewMode = detailViewMode ? "detail" : (mosaicView ? "mosaic" : "grid"); + if(typeof viewMode == 'undefined') + viewMode = detailViewMode ? "detail" : (mosaicView ? "mosaic" : "grid"); hash = "#img=" + currentImg + "&viewMode=" + viewMode + "&bgcolor=" + bgcolor; window.location.hash = hash; } @@ -185,8 +188,6 @@ function mosaicResize() myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } - if($('#pearImageFlow').length != 0) - $('#pearImageFlow').css({'height' : (myHeight-87)+'px', 'width': myWidth+'px', 'minHeight': ((myHeight-70)*0.9)+'px'}); if($('#imageflow').length != 0) $('#imageflow').css({'height': (myHeight-53)+'px', 'width': (((myWidth*0.5)<(myHeight-53)) ? myWidth : ((myHeight-65)*2)) +'px'}); $('#detailImageView').css({'height': myHeight-165+"px"}); @@ -195,8 +196,13 @@ function mosaicResize() $('#img_detail').css({'height': iHeight+"px", 'width':iWidth+"px"}); myWidth=myWidth-7; + myHeight = myHeight - $('#g-site-status').outerHeight(true); + $('#pearFlowPadd').css({'height' : myHeight-90-(Math.round(myWidth / 2.4))+'px'}); ($('#paginator').length != 0) ? myHeight-=165: myHeight-=138; + $('#g-header').css('top', $('#gsNavBar').outerHeight(true)+$('#g-site-status').outerHeight(true)-4); + if($('#g-movie').length) + myHeight+=18; if ( !mosaicView ) { $('#mosaicGridContainer').css({'height': (myHeight+33)+"px", 'width': myWidth+"px"}); @@ -211,20 +217,28 @@ function mosaicResize() (iRatio>(myWidth/myHeight)) ? $('#mosaicImg').attr({height: myWidth/iRatio,width: myWidth}) : $('#mosaicImg').attr({height: myHeight,width: myHeight*iRatio}); if(iHeight"+slideshowImages[id][4]+""); @@ -350,45 +370,34 @@ function focusImage(id) swatchImg(id); $('#detailView').fadeIn('slow'); hideHoverV = setTimeout("hideHoverView()",3000); - //Image count. detailViewMode=true; updateHash(); - $.get(slideshowImages[currentImg][1]); + //Image count. + if(!redirected) + $.get(slideshowImages[currentImg][6]); + $('#info_detail').attr('href', slideshowImages[currentImg][1]); } var pearCarousel; function startImageFlow() { $('#mosaicTable').hide(); - $('#pearImageFlow').show(); + $('#pearImageFlow,#pearFlowPadd').show(); toggleReflex(true); - for (var i = 0; i < slideshowImages.length; i++) { - var img = '
'+$('#mosaicGridContainer img').eq(i).attr('alt')+'"
'; - var img = ''+slideshowImages[i][4]+''; - console.log(img); - $('#pearImageFlow').append(img); - } if(!pearCarousel){ - pearCarousel = new ImageFlow(); - pearCarousel.init({ImageFlowID: 'pearImageFlow', aspectRatio: 2.4, imagesHeight: 0.6, opacity: true, reflections: false, startID: currentImg, onClick: function() {focusImage($(this).attr('longdesc'));}, startAnimation: true, xStep: 200, imageFocusM: 1.7, imageFocusMax: 4, opacityArray: [10, 9, 6, 2], percentOther: 130, captions: false, slider: false}); + for (var i = 0; i < slideshowImages.length; i++) { + var img = '
'+$('#mosaicGridContainer img').eq(i).attr('alt')+'"
'; + var img = ''+slideshowImages[i][4]+''; + // console.log(img); + $('#pearImageFlow').append(img); + } + pearCarousel = new ImageFlow(); + pearCarousel.init({ImageFlowID: 'pearImageFlow', aspectRatio: 2.4, imagesHeight: 0.6, opacity: true, reflections: false, startID: currentImg, onClick: function() {focusImage($(this).attr('longdesc'));}, startAnimation: true, xStep: 200, imageFocusM: 1.7, imageFocusMax: 4, opacityArray: [10, 9, 6, 2], percentOther: 130, captions: false, slider: false}); } -/* - current=(currentImg)*-xstep; - caption_id=currentImg; - refresh(true); - - iShow(conf_images); - iShow(conf_scrollbar); - initMouseWheel(); - initMouseDrag(); - mosaicResize(); - - moveTo(current); - glideTo(current, caption_id); -*/ switchMode('carousel'); + mosaicResize(); } function setKeys() { @@ -431,6 +440,7 @@ var hovering=false; function switchMode(mode){ $('#mosaic,#grid,#carousel').removeClass("sel sel-with-viewSwitcher"); $('#'+mode).addClass("sel sel-with-viewSwitcher"); + updateHash(mode); } function preFetch() diff --git a/theme.info b/theme.info index ee4e256c..00af05f4 100644 --- a/theme.info +++ b/theme.info @@ -1,6 +1,6 @@ name = ".Pear Theme" description = "A theme with the intention to mimic Apples mobile me gallery." -version = 2.1 +version = 2.5 author = "Fredrik Erlandsson " site = 1 admin = 0 diff --git a/views/album.html.php b/views/album.html.php index 68f13a47..237fc3fd 100644 --- a/views/album.html.php +++ b/views/album.html.php @@ -30,20 +30,27 @@ $(function() { is_photo()): ?> + is_movie()): ?> + + + is_movie()): ?> + + thumb_bottom($child) ?> context_menu($child, "#g-item-id-{$child->id} .g-thumbnail") ?>

@@ -68,7 +78,7 @@ endif; var slideshowImages = new Array(); $child): ?> is_album() || $child->is_movie())): ?> - slideshowImages.push(['resize_url() ?>', 'url() ?>', 'width ?>','height ?>', 'title ?>', 'file_url() ?>']); + slideshowImages.push(['resize_url() ?>', 'id") ?>', 'width ?>','height ?>', 'title, ENT_QUOTES) ?>', 'file_url() ?>', 'url() ?>']); @@ -86,4 +96,5 @@ endif; album_bottom() ?> paginator() ?> -
+ + diff --git a/views/hoverView.html.php b/views/hoverView.html.php index 418ba664..b38ad8f7 100644 --- a/views/hoverView.html.php +++ b/views/hoverView.html.php @@ -1,5 +1,5 @@ - From 9600f7958b2509fcf1f79fc64ffd8f50acfeba79 Mon Sep 17 00:00:00 2001 From: Fredrik Erlandsson Date: Thu, 10 Nov 2011 15:11:09 +0100 Subject: [PATCH 2/4] Squashed '3.0/themes/pear4gallery3/' changes from 5da2cba..996ee67 996ee67 Version up (2.6) with fix for viewMode. git-subtree-dir: 3.0/themes/pear4gallery3 git-subtree-split: 996ee6721478fdf8a4e580c242e8fdadeeede70b --- js/pear.js | 52 +++++++++++++++++++++++++++++---------------- theme.info | 2 +- views/page.html.php | 8 +++---- 3 files changed, 39 insertions(+), 23 deletions(-) diff --git a/js/pear.js b/js/pear.js index 30381456..7f898de0 100644 --- a/js/pear.js +++ b/js/pear.js @@ -1,3 +1,4 @@ +var viewMode=""; var skimimg = 0; var hash=""; var bgcolor="black"; @@ -154,18 +155,24 @@ function swatchImg(imageId) updateHash(); $('#info_detail').attr('href', slideshowImages[currentImg][1]); } - -function updateHash(viewMode) +function getViewMode() { - if(typeof viewMode == 'undefined') - viewMode = detailViewMode ? "detail" : (mosaicView ? "mosaic" : "grid"); - hash = "#img=" + currentImg + "&viewMode=" + viewMode + "&bgcolor=" + bgcolor; + var vm = detailViewMode ? "detail" : viewMode; + if(vm !== '') + vm = "&viewMode=" + vm; + return vm; +} +function updateHash() +{ + var img=""; + if(currentImg !== 0) + img = "img=" + currentImg; + hash = "#" + img + getViewMode() + "&bgcolor=" + bgcolor; window.location.hash = hash; } function getAlbumHash(img) { - viewMode = detailViewMode ? "detail" : (mosaicView ? "mosaic" : "grid"); - return "#img=" + img + "&viewMode=" + viewMode + "&bgcolor=" + bgcolor; + return "#img=" + img + getViewMode() + "&bgcolor=" + bgcolor; } var currentImg=0; @@ -230,7 +237,7 @@ function thumbPadding() { $('.gallery-thumb').css({'margin-left': Math.ceil(margin/2) + 'px', 'margin-right': Math.floor(margin/2) + 'px'}); } -function bodyLoad(viewMode, bgcolor) { +function bodyLoad(vm, bgcolor) { /* Parse hash */ hash = window.location.hash; var h = $.parseQuery(hash.substring(1)); @@ -239,7 +246,7 @@ function bodyLoad(viewMode, bgcolor) { if(h.bgcolor != undefined) swatchSkin(h.bgcolor); if(h.viewMode != undefined) - viewMode = h.viewMode; + viewMode = vm = h.viewMode; /* end parse hash */ if(navigator.appName == "Microsoft Internet Explorer") $('.track').each(function(s){$(this).css('top', '-16px');}); //Fix for IE's poor page rendering. @@ -266,17 +273,17 @@ function bodyLoad(viewMode, bgcolor) { if(typeof slideshowImages != 'undefined') if(!slideshowImages.length) - viewMode='grid'; + vm='grid'; - switch (viewMode) { + switch (vm) { case 'carousel': - startImageFlow(); + startImageFlow(false); break; case 'grid': - switchToGrid(); + switchToGrid(false); break; case 'mosaic': - switchToMosaic(); + switchToMosaic(false); break; case 'detail': focusImage(currentImg, h.redirected); @@ -290,8 +297,11 @@ if(typeof slideshowImages != 'undefined') setKeys(); } -function switchToGrid() +function switchToGrid(userSet) { + if(userSet === true) { + viewMode = "grid"; + } toggleReflex(true); $('#pearImageFlow,#pearFlowPadd').hide(); $('#mosaicTable').show(); @@ -306,8 +316,11 @@ function switchToGrid() mosaicResize(); } -function switchToMosaic() +function switchToMosaic(userSet) { + if(userSet === true) { + viewMode = "mosaic"; + } toggleReflex(false); $('#pearImageFlow,#pearFlowPadd').hide(); $('#mosaicTable').show(); @@ -378,8 +391,11 @@ function focusImage(id, redirected) $('#info_detail').attr('href', slideshowImages[currentImg][1]); } var pearCarousel; -function startImageFlow() +function startImageFlow(userSet) { + if(userSet === true) { + viewMode = "carousel"; + } $('#mosaicTable').hide(); $('#pearImageFlow,#pearFlowPadd').show(); @@ -440,7 +456,7 @@ var hovering=false; function switchMode(mode){ $('#mosaic,#grid,#carousel').removeClass("sel sel-with-viewSwitcher"); $('#'+mode).addClass("sel sel-with-viewSwitcher"); - updateHash(mode); + updateHash(); } function preFetch() diff --git a/theme.info b/theme.info index 00af05f4..7ba4673f 100644 --- a/theme.info +++ b/theme.info @@ -1,6 +1,6 @@ name = ".Pear Theme" description = "A theme with the intention to mimic Apples mobile me gallery." -version = 2.5 +version = 2.6 author = "Fredrik Erlandsson " site = 1 admin = 0 diff --git a/views/page.html.php b/views/page.html.php index 22109bb5..cc06af5d 100644 --- a/views/page.html.php +++ b/views/page.html.php @@ -122,7 +122,7 @@ item()): ?> - +
item()->title, 40)) ?>   @@ -170,14 +170,14 @@
page_subtype != "movie"): ?> -
+
Grid
-
+
Mosaic
-