From a57d0d93a8c741e64ac18bbb36aad4164569f266 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Tue, 31 Mar 2009 05:14:40 +0000 Subject: Add quick edit pane to resize images, ticket #189 --- core/helpers/core_theme.php | 16 +++++++++++++++- core/js/quick.js | 8 ++++---- core/libraries/Theme_View.php | 2 ++ core/views/quick_pane.html.php | 10 +++++----- 4 files changed, 26 insertions(+), 10 deletions(-) (limited to 'core') diff --git a/core/helpers/core_theme.php b/core/helpers/core_theme.php index fbb8aef3..03018d48 100644 --- a/core/helpers/core_theme.php +++ b/core/helpers/core_theme.php @@ -25,7 +25,8 @@ class core_theme_Core { $buf .= ""; } - if ($theme->page_type == "album" && access::can("edit", $theme->item())) { + if (($theme->page_type == "album" || $theme->page_type == "photo") + && access::can("edit", $theme->item())) { $buf .= ""; $buf .= html::script("core/js/quick.js"); @@ -51,6 +52,19 @@ class core_theme_Core { return $buf; } + static function resize_top($theme, $item) { + if (access::can("edit", $item)) { + $edit_link = url::site("quick/pane/$item->id"); + return "
"; + } + } + + static function resize_bottom($theme, $item) { + if (access::can("edit", $item)) { + return "
"; + } + } + static function thumb_top($theme, $child) { if (access::can("edit", $child)) { $edit_link = url::site("quick/pane/$child->id"); diff --git a/core/js/quick.js b/core/js/quick.js index bfef0d65..15297c03 100644 --- a/core/js/quick.js +++ b/core/js/quick.js @@ -3,8 +3,8 @@ $(document).ready(function() { // @todo Add quick edit pane for album (meta, move, permissions, delete) $(".gItem").hover(show_quick, function() {}); } - if ($("#gItem").length) { - // @todo Apply quick edit to resize view + if ($("#gPhoto").length) { + $("#gPhoto").hover(show_quick, function() {}); } }); @@ -19,8 +19,9 @@ var show_quick = function() { "position": "absolute", "top": pos.top, "left": pos.left, + "text-align": "center", "width": cont.innerWidth() + 1, - "height": 32 + "height": "auto" }).hide(); cont.hover(function() {}, hide_quick); $.get( @@ -28,7 +29,6 @@ var show_quick = function() { {}, function(data, textStatus) { $("#gQuickPane").html(data).slideDown("fast"); - // @todo Move hover to a function $(".ui-state-default").hover( function(){ $(this).addClass("ui-state-hover"); diff --git a/core/libraries/Theme_View.php b/core/libraries/Theme_View.php index bcd1604f..e28df958 100644 --- a/core/libraries/Theme_View.php +++ b/core/libraries/Theme_View.php @@ -176,6 +176,8 @@ class Theme_View_Core extends View { case "photo_blocks": case "photo_bottom": case "photo_top": + case "resize_bottom": + case "resize_top": case "sidebar_blocks": case "sidebar_bottom": case "sidebar_top": diff --git a/core/views/quick_pane.html.php b/core/views/quick_pane.html.php index d6f097d4..9bdff325 100644 --- a/core/views/quick_pane.html.php +++ b/core/views/quick_pane.html.php @@ -1,5 +1,5 @@ -type == "photo"): ?> +type == "photo" || $item->type == "resize"): ?> type == "movie"): ?> @@ -13,7 +13,7 @@ -is_photo() && graphics::can("rotate")): ?> +is_photo() || $item->type == "resize") && graphics::can("rotate")): ?> id/ccw?csrf=$csrf") ?>" title=""> @@ -29,7 +29,7 @@ -type == "photo"): ?> +type == "photo" || $item->type == "resize"): ?> type == "movie"): ?> @@ -44,7 +44,7 @@ parent())): ?> -type == "photo"): ?> +type == "photo" || $item->type == "resize"): ?> type == "movie"): ?> @@ -58,7 +58,7 @@ -type == "photo"): ?> +type == "photo" || $item->type == "resize"): ?> type == "movie"): ?> -- cgit v1.2.3