diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-27 11:35:14 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-27 11:35:14 -0700 |
commit | 940edac81c854227d1a25f482cb38c96b6937bb2 (patch) | |
tree | 700590167ee3c7e172738db615c8545edaa75e3e | |
parent | dc67de520d58838d0bf1ab2ba13135745b59facf (diff) |
delete the simple slideshow
-rw-r--r-- | modules/slideshow/controllers/slideshow.php | 64 | ||||
-rw-r--r-- | modules/slideshow/css/buttons.png | bin | 3579 -> 0 bytes | |||
-rw-r--r-- | modules/slideshow/css/slideshow.css | 101 | ||||
-rw-r--r-- | modules/slideshow/helpers/slideshow_event.php | 47 | ||||
-rw-r--r-- | modules/slideshow/helpers/slideshow_installer.php | 30 | ||||
-rw-r--r-- | modules/slideshow/helpers/slideshow_theme.php | 25 | ||||
-rw-r--r-- | modules/slideshow/js/slideshow.js | 145 | ||||
-rw-r--r-- | modules/slideshow/module.info | 3 |
8 files changed, 0 insertions, 415 deletions
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 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2009 Bharat Mediratta - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. - */ -class Slideshow_Controller extends Controller { - function album($item_id) { - $item = ORM::factory("item", $item_id); - access::required("view", $item); - - print json_encode(array_values($this->_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 Binary files differdeleted file mode 100644 index 6fe50e1b..00000000 --- a/modules/slideshow/css/buttons.png +++ /dev/null diff --git a/modules/slideshow/css/slideshow.css b/modules/slideshow/css/slideshow.css deleted file mode 100644 index f635c244..00000000 --- a/modules/slideshow/css/slideshow.css +++ /dev/null @@ -1,101 +0,0 @@ -#gSlideshowOverlay { - border: none; - margin: 0; - padding: 0; - background-color: #000; - position: absolute; - top: 0px; - left: 0px; - width: 100%; - height: 100%; - opacity: 0.7; - filter: alpha(opacity=70); - -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; - -moz-background-inline-policy: -moz-initial; - z-index: 2001; -} - -#gSlideShowImages { - z-index: 2002; -} - -#gSlideShowImages img { - display: none; - float: left; - z-index: 2002; -} - -#gSlideshowButtonPanel { - bottom: .5em; - position: absolute; - width: 100%; - z-index: 2004; -} - -#gSlideshowButtonPanel div { - background-color: #000; - color: #fff; - filter: alpha(opacity=70); - height: 55px; - margin: 0 auto; - opacity: 0.7; - width: 232px; - z-index: 2004; -} - -#gSlideshowPrevious, -#gSlideshowPause, -#gSlideshowResume, -#gSlideshowResume, -#gSlideshowClose, -#gSlideshowNext { - background-image: url(buttons.png); - background-repeat: no-repeat; - display: block; - float: left; - height: 55px; - overflow: hidden; - text-indent: -99999px; - width: 58px; -} - -#gSlideshowPrevious { - background-position: 0 0; -} - -#gSlideshowPrevious:hover { - background-position: -58px 0; -} - -#gSlideshowPause { - background-position: -174px 0; -} - -#gSlideshowPause:hover { - background-position: -116px 0; -} - -#gSlideshowResume { - background-position: -290px 0; - display: none; -} - -#gSlideshowResume:hover { - background-position: -232px 0; -} - -#gSlideshowNext { - background-position: -406px 0; -} - -#gSlideshowNext:hover { - background-position: -348px 0; -} - -#gSlideshowClose { - background-position: -464px 0; -} - -#gSlideshowClose:hover { - background-position: -522px 0; -} diff --git a/modules/slideshow/helpers/slideshow_event.php b/modules/slideshow/helpers/slideshow_event.php deleted file mode 100644 index 926b4da1..00000000 --- a/modules/slideshow/helpers/slideshow_event.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2009 Bharat Mediratta - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. - */ -class slideshow_event_Core { - static function album_menu($menu, $theme) { - $item = $theme->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 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2009 Bharat Mediratta - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. - */ -class slideshow_installer { - static function install() { - module::set_version("slideshow", 2); - } - - static function upgrade($version) { - if ($version == 1) { - module::set_version("slideshow", 2); - } - } -} diff --git a/modules/slideshow/helpers/slideshow_theme.php b/modules/slideshow/helpers/slideshow_theme.php deleted file mode 100644 index fdce22f3..00000000 --- a/modules/slideshow/helpers/slideshow_theme.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2009 Bharat Mediratta - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. - */ -class slideshow_theme_Core { - static function head($theme) { - $theme->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( - '<div id="gSlideshowOverlay" class="ui-dialog-overlay"></div>' + - '<div class="gLoadingLarge" style="z-index; 2005; width:100%; height:100%"> </div>' + - '<div id="gSlideshowButtonPanel"><div class="ui-corner-all">' + - '<a id="gSlideshowPrevious" href="javascript: $.gallery_slideshow.previous()" />' + - '<a id="gSlideshowPause" href="javascript: $.gallery_slideshow.pause()" />' + - '<a id="gSlideshowResume" href="javascript: $.gallery_slideshow.resume()" />' + - '<a id="gSlideshowNext" href="javascript: $.gallery_slideshow.next()" />' + - '<a id="gSlideshowClose" href="javascript: $.gallery_slideshow.close()" />' + - '</div></div>' + - '<div id="gSlideShowImages"></div>'); - $().bind("mousemove", $.gallery_slideshow._mouse_over); - - // array of {url: xxx, width: nnn, height: nnn} - for (var i=0; i < data.length; i++) { - $("#gSlideShowImages").append( - '<img id="img_' + i + '" src="' + data[i].url + '" width="' + data[i].width + 'px" ' + - 'height="' + data[i].height + 'px" />'); - $("#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 |