From 940edac81c854227d1a25f482cb38c96b6937bb2 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 27 Aug 2009 11:35:14 -0700 Subject: [PATCH] delete the simple slideshow --- modules/slideshow/controllers/slideshow.php | 64 -------- modules/slideshow/css/buttons.png | Bin 3579 -> 0 bytes modules/slideshow/css/slideshow.css | 101 ------------ modules/slideshow/helpers/slideshow_event.php | 47 ------ .../slideshow/helpers/slideshow_installer.php | 30 ---- modules/slideshow/helpers/slideshow_theme.php | 25 --- modules/slideshow/js/slideshow.js | 145 ------------------ modules/slideshow/module.info | 3 - 8 files changed, 415 deletions(-) delete mode 100644 modules/slideshow/controllers/slideshow.php delete mode 100644 modules/slideshow/css/buttons.png delete mode 100644 modules/slideshow/css/slideshow.css delete mode 100644 modules/slideshow/helpers/slideshow_event.php delete mode 100644 modules/slideshow/helpers/slideshow_installer.php delete mode 100644 modules/slideshow/helpers/slideshow_theme.php delete mode 100644 modules/slideshow/js/slideshow.js delete mode 100644 modules/slideshow/module.info diff --git a/modules/slideshow/controllers/slideshow.php b/modules/slideshow/controllers/slideshow.php deleted file mode 100644 index 8c4d1f46..00000000 --- a/modules/slideshow/controllers/slideshow.php +++ /dev/null @@ -1,64 +0,0 @@ -_build_image_list($item->children()))); - } - - function photo($item_id) { - $item = ORM::factory("item", $item_id); - access::required("view", $item); - - $images = $this->_build_image_list($item->parent()->children()); - $this_photo = array_search($item_id, array_keys($images)); - $images = array_merge(array_slice($images, $this_photo), array_slice($images, 0, $this_photo)); - - print json_encode($images); - } - - function tag($tag_id) { - $tag = ORM::factory("tag", $tag_id); - print json_encode(array_values($this->_build_image_list($tag->items()))); - } - - private function _build_image_list($children) { - $resizes = array(); - foreach ($children as $child) { - switch($child->type) { - case "album": - if (!empty($child->album_cover_item_id)) { - $cover = ORM::factory("item", $child->album_cover_item_id); - $resizes[$child->id] = array("url" => $cover->resize_url(), - "width" => $cover->resize_width, "height" => $cover->resize_height); - } - break; - case "photo": - $resizes[$child->id] = array("url" => $child->resize_url(), - "width" => $child->resize_width, "height" => $child->resize_height); - break; - } - } - - return $resizes; - } -} diff --git a/modules/slideshow/css/buttons.png b/modules/slideshow/css/buttons.png deleted file mode 100644 index 6fe50e1b982de4f5677c843a802cb143bd12e300..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3579 zcmd5<`9BnD`<_lJM8;B<6b3c2oyj_OW-N`ZAtcLW2wAgb8)P{eg9wf62a$EgzLce- zLDCFk-^(y$2_rGt`Z|5z_kVbwAMWeEf4M);bw8iabKO_MZ8Jkob|H2E0Kj?62yOuY z`~g47RanoS#BY68!Y9DurfaGT0Mw?OKXf{CQVRs?-wm|%bqx%5@_zuh?ex$mP|i&M zj_6|rIR)kNWt!wkuV=U5x_3exzd3YPUNq*}{T4gBSo?Nmn&e_jh!)V01A+EHto$T5 zSK9Hp9Cn&<5@}H9v?(87QW6UM0jER(EdK+=J9hCJS!Uut60G$Or#HxCviC;k z#C{9p1Hm9K!i-kzdTi0^xnN&mws`7~-`93ysftUo5+?dr{{}UfF5jc=#Ndv5449Tj z^{LQk0DtsG?xD9={G%hu$IhYPP6-2oEPdrz^UC3Yf{G*UJ+nZ(6*sbiV9VWDp4 zX&qm*WfQDab-ZZz8-jXRs5fy%Qd(^ceT-;otd0rLHlb)D$wLQ76}ZW*&kcb?MX~-u zfuj+>DadR6KNB^}n6l+Q^{8^Dloq1;bm$Ynx#$ehAzabO&)Wzv=GRA=CfPDLQjbFy z=$Fl{tPQ#^=~6`t@yih6n+ZprWTSl-;r*bb7EH)OGE?VCtWNOU(bM7j+`F*LX7(Qo zcw(tvmNu(|6pfjnCy6p18Qq$$2%&x zzcE>FxR?|Bx-sQ1Fl{GF7UCj>!&`IQA^?-0d(URz8Sa1|r%lvIACA|?iB*-5G0!ER zd?37E9;+2~Y~OZH>FCoW&_X%;aIQnBcIsfrBy8s^GCf9DVL_>5uFY@36OODPu7r3) zT*PpAJq~YgZ_^Gz)lr#qTvtEsns)E1nmO?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F8?%$Y`&n?L{epKjoT?`?km zRk^3u$dJU4yi$arLyM!a6QTMFi`(@6x8q}D2BEm0L+fvX)~tgfp@%^~lKtN^W}AIc z>213a1LaQO_$4sTpEPKJ1>FGY`+KqaczMC2rcKm!s*jvu*Iy)JUPn&L&^?1@{@qY& zD?A0RkEYN2RZ8&w*$VuUQ8%GL_8xY48t-=%a zQ55GvA5tCvhVol7N3&RE!Fk^8Xx(hpu4G?m)%;9=%Rwwpr{z%^*Rh{Ru zkVLP;6<51`EKtCxqWbTh&{hx-x|$%YnoJx( zbIL!gb6POM7*Aj5OIy?q-(5%PMI{h>@YMV2*MRVq%7PhbQz43K2ajXt^oAn}JoU!>E3G?mbb}YiD9hS}eIDz)YMk({<|+>~_n2${ z6%#Mzy@K-1L{0(#Qnpn2iil%6;`Q}i|)m=^7R$}|+k>;54rF5!25Ps@W z8fOdNQz1uB0u|I8$5q$(!S?3aJj|?m^n}e{2m%>oGk~JJ%@0FO*~yGqfD8uz?STa#sY21yX0;fmr}kaz(eY*8p{5j3x=vc{UVh%Dkm zYo2)G$+afssEuK!%8uA+h^WStbq6_{Rwn4Ivp=`y@Pi}8V~ix@Uly^(xGR}M97cg~ zX-VvH=^B2w%{iv5eH5)<`RrYWXdMqs3OVvb^d>iq1IeP>uzKCj><9?26vO(5IbYBU z=x_?Vz(glEu?BwM&D;<item(); - $menu->append(Menu::factory("link") - ->id("slideshow") - ->label(t("View slideshow")) - ->url(url::site("slideshow/album/{$item->id}")) - ->css_id("gSlideshowLink")); - } - - static function photo_menu($menu, $theme) { - $item = $theme->item(); - $menu->append(Menu::factory("link") - ->id("slideshow") - ->label(t("View slideshow")) - ->url(url::site("slideshow/photo/{$item->id}")) - ->css_id("gSlideshowLink")); - } - - static function tag_menu($menu, $theme) { - $tag = $theme->tag(); - $menu->append(Menu::factory("link") - ->id("slideshow") - ->label(t("View slideshow")) - ->url(url::site("slideshow/tag/{$tag->id}")) - ->css_id("gSlideshowLink")); - } -} diff --git a/modules/slideshow/helpers/slideshow_installer.php b/modules/slideshow/helpers/slideshow_installer.php deleted file mode 100644 index a71ea183..00000000 --- a/modules/slideshow/helpers/slideshow_installer.php +++ /dev/null @@ -1,30 +0,0 @@ -script("slideshow.js"); - $theme->css("slideshow.css"); - } -} diff --git a/modules/slideshow/js/slideshow.js b/modules/slideshow/js/slideshow.js deleted file mode 100644 index 1dffbf5a..00000000 --- a/modules/slideshow/js/slideshow.js +++ /dev/null @@ -1,145 +0,0 @@ -(function($) { - $.gallery_slideshow = { - interval: 4000, - timer: null, - images: [], - current: -1, - init: function(data) { - var self = this; - var size = $.gallery_get_viewport_size(); - $("body").append( - '
' + - '
 
' + - '
' + - '
'); - $().bind("mousemove", $.gallery_slideshow._mouse_over); - - // array of {url: xxx, width: nnn, height: nnn} - for (var i=0; i < data.length; i++) { - $("#gSlideShowImages").append( - ''); - $("#gSlideShowImages #img_" + i).load(function() { - $.gallery_slideshow.images.push("#" +$(this).attr("id")); - if ($.gallery_slideshow.images.length == 1) { - $.gallery_slideshow._show_image(null); - setTimeout(function() {$("#gSlideshowButtonPanel").hide();}, - $.gallery_slideshow.interval); - } - }); - }; - $(window).resize(function() { - var size = $.gallery_get_viewport_size(); - $("#gSlideshowOverlay").width(size.width()).height(size.height()); - var current = $(".gSlideCurrent"); - var position = $.gallery_auto_fit_window(current.width(), current.height()); - $($.gallery_slideshow.images[$.gallery_slideshow.current].replace("img", "clone")) - .height(position.height).width(position.width).css({ - top: position.top, - left: position.left - }); - }); - }, - - close: function(event) { - $.gallery_slideshow.pause(); - $($.gallery_slideshow.images[$.gallery_slideshow.current].replace("img", "clone")).remove(); - $("#gSlideshowOverlay").remove(); - $("#gSlideShowImages").remove(); - $("#gSlideshowButtonPanel").remove(); - $().unbind("mousemove", $.gallery_slideshow._mouse_over); - }, - - previous: function() { - $.gallery_slideshow.pause(); - $.gallery_slideshow.current--; - - $.gallery_slideshow.current = --$.gallery_slideshow.current < 0 ? - $.gallery_slideshow.images.length - 1 : $.gallery_slideshow.current; - var next_image = $($.gallery_slideshow.images[$.gallery_slideshow.current]); - $.gallery_slideshow._show_image(next_image); - }, - - next: function() { - $.gallery_slideshow.pause(); - $.gallery_slideshow.current = ++$.gallery_slideshow.current % $.gallery_slideshow.images.length; - var next_image = $($.gallery_slideshow.images[$.gallery_slideshow.current]); - $.gallery_slideshow._show_image(next_image); - }, - - pause: function() { - if ($.gallery_slideshow.timer) { - $("#gSlideshowPause").toggle(); - $("#gSlideshowResume").toggle(); - clearTimeout($.gallery_slideshow.timer); - $.gallery_slideshow.timer = null; - } - }, - - resume: function() { - $("#gSlideshowPause").toggle(); - $("#gSlideshowResume").toggle(); - $.gallery_slideshow._show_image(null); - }, - - _mouse_over: function(event) { - var size = $.gallery_get_viewport_size(); - if (event.pageY < size.height() && size.height() - 100 <= event.pageY) { - $("#gSlideshowButtonPanel").show(); - } else { - $("#gSlideshowButtonPanel").hide(); - } - }, - - // If next_image is not null, then this a call from prev or next - _show_image: function(next_image) { - var reset_timer = false; - var previous = $.gallery_slideshow.current; - if (next_image == null) { - $.gallery_slideshow.current = ++$.gallery_slideshow.current % $.gallery_slideshow.images.length; - next_image = $($.gallery_slideshow.images[$.gallery_slideshow.current]); - reset_timer = true; - } - var zIndex = parseInt(next_image.css("zIndex")); - var position = $.gallery_auto_fit_window(next_image.width(), next_image.height()); - var clone = next_image.clone(); - - clone.attr("id", next_image.attr("id").replace("img", "clone")); - clone.height(position.height).width(position.width).css({ - marginTop: 0, marginLeft: 0, marginBottom: 0, marginRight: 0, - display: "none", - position: "absolute", - zIndex: zIndex + 1, - top: position.top + "px", - left: position.left + "px" - }); - - $("body").append(clone); - clone.fadeIn("slow", function() { - if (previous >= 0) { - $($.gallery_slideshow.images[previous].replace("img", "clone")).remove(); - } - clone.css("zIndex", zIndex); - if (reset_timer) { - $.gallery_slideshow.timer = - setTimeout(function() {$.gallery_slideshow._show_image(null);}, - $.gallery_slideshow.interval); - } - }); - } - }; -})(jQuery); - -$(document).ready(function() { - $("#gSlideshowLink").click(function(event) { - event.preventDefault(); - $.get($(event.currentTarget).attr("href"), {}, $.gallery_slideshow.init, "json"); - return false; - }); -}); diff --git a/modules/slideshow/module.info b/modules/slideshow/module.info deleted file mode 100644 index b56eac81..00000000 --- a/modules/slideshow/module.info +++ /dev/null @@ -1,3 +0,0 @@ -name = "Slideshow" -description = "Allows users to view a slideshow of photos" -version = 2