From: <th...@us...> - 2009-03-31 05:14:45
|
Revision: 20516 http://gallery.svn.sourceforge.net/gallery/?rev=20516&view=rev Author: thumb70 Date: 2009-03-31 05:14:40 +0000 (Tue, 31 Mar 2009) Log Message: ----------- Add quick edit pane to resize images, ticket #189 Modified Paths: -------------- gallery3/trunk/core/helpers/core_theme.php gallery3/trunk/core/js/quick.js gallery3/trunk/core/libraries/Theme_View.php gallery3/trunk/core/views/quick_pane.html.php gallery3/trunk/themes/default/css/screen.css gallery3/trunk/themes/default/views/photo.html.php Modified: gallery3/trunk/core/helpers/core_theme.php =================================================================== --- gallery3/trunk/core/helpers/core_theme.php 2009-03-30 18:09:17 UTC (rev 20515) +++ gallery3/trunk/core/helpers/core_theme.php 2009-03-31 05:14:40 UTC (rev 20516) @@ -25,7 +25,8 @@ $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("core/css/debug.css") . "\" />"; } - 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 .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("core/css/quick.css") . "\" />"; $buf .= html::script("core/js/quick.js"); @@ -51,6 +52,19 @@ return $buf; } + static function resize_top($theme, $item) { + if (access::can("edit", $item)) { + $edit_link = url::site("quick/pane/$item->id"); + return "<div class=\"gQuick\" href=\"$edit_link\">"; + } + } + + static function resize_bottom($theme, $item) { + if (access::can("edit", $item)) { + return "</div>"; + } + } + static function thumb_top($theme, $child) { if (access::can("edit", $child)) { $edit_link = url::site("quick/pane/$child->id"); Modified: gallery3/trunk/core/js/quick.js =================================================================== --- gallery3/trunk/core/js/quick.js 2009-03-30 18:09:17 UTC (rev 20515) +++ gallery3/trunk/core/js/quick.js 2009-03-31 05:14:40 UTC (rev 20516) @@ -3,8 +3,8 @@ // @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 @@ "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 @@ {}, function(data, textStatus) { $("#gQuickPane").html(data).slideDown("fast"); - // @todo Move hover to a function $(".ui-state-default").hover( function(){ $(this).addClass("ui-state-hover"); Modified: gallery3/trunk/core/libraries/Theme_View.php =================================================================== --- gallery3/trunk/core/libraries/Theme_View.php 2009-03-30 18:09:17 UTC (rev 20515) +++ gallery3/trunk/core/libraries/Theme_View.php 2009-03-31 05:14:40 UTC (rev 20516) @@ -176,6 +176,8 @@ case "photo_blocks": case "photo_bottom": case "photo_top": + case "resize_bottom": + case "resize_top": case "sidebar_blocks": case "sidebar_bottom": case "sidebar_top": Modified: gallery3/trunk/core/views/quick_pane.html.php =================================================================== --- gallery3/trunk/core/views/quick_pane.html.php 2009-03-30 18:09:17 UTC (rev 20515) +++ gallery3/trunk/core/views/quick_pane.html.php 2009-03-31 05:14:40 UTC (rev 20516) @@ -1,5 +1,5 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<? if ($item->type == "photo"): ?> +<? if ($item->type == "photo" || $item->type == "resize"): ?> <? $title = t("Edit this photo") ?> <? elseif ($item->type == "movie"): ?> <? $title = t("Edit this movie") ?> @@ -13,7 +13,7 @@ </span> </a> -<? if ($item->is_photo() && graphics::can("rotate")): ?> +<? if (($item->is_photo() || $item->type == "resize") && graphics::can("rotate")): ?> <a class="gButtonLink ui-corner-all ui-state-default" href="<?= url::site("quick/rotate/$item->id/ccw?csrf=$csrf") ?>" title="<?= t("Rotate 90 degrees counter clockwise") ?>"> <span class="ui-icon ui-icon-rotate-ccw"> @@ -29,7 +29,7 @@ </a> <? endif ?> -<? if ($item->type == "photo"): ?> +<? if ($item->type == "photo" || $item->type == "resize"): ?> <? $title = t("Move this photo to another album") ?> <? elseif ($item->type == "movie"): ?> <? $title = t("Move this movie to another album") ?> @@ -44,7 +44,7 @@ </a> <? if (access::can("edit", $item->parent())): ?> -<? if ($item->type == "photo"): ?> +<? if ($item->type == "photo" || $item->type == "resize"): ?> <? $title = t("Choose this photo as the album cover") ?> <? elseif ($item->type == "movie"): ?> <? $title = t("Choose this movie as the album cover") ?> @@ -58,7 +58,7 @@ </span> </a> -<? if ($item->type == "photo"): ?> +<? if ($item->type == "photo" || $item->type == "resize"): ?> <? $title = t("Delete this photo") ?> <? elseif ($item->type == "movie"): ?> <? $title = t("Delete this movie") ?> Modified: gallery3/trunk/themes/default/css/screen.css =================================================================== --- gallery3/trunk/themes/default/css/screen.css 2009-03-30 18:09:17 UTC (rev 20515) +++ gallery3/trunk/themes/default/css/screen.css 2009-03-31 05:14:40 UTC (rev 20516) @@ -478,6 +478,10 @@ width: 99%; } +#gContent #gPhoto { + +} + #gContent #gItem .gFullSizeLink img { display: block; margin: 1em auto !important; Modified: gallery3/trunk/themes/default/views/photo.html.php =================================================================== --- gallery3/trunk/themes/default/views/photo.html.php 2009-03-30 18:09:17 UTC (rev 20515) +++ gallery3/trunk/themes/default/views/photo.html.php 2009-03-31 05:14:40 UTC (rev 20516) @@ -24,7 +24,12 @@ </li> </ul> - <a href="#" class="gFullSizeLink" title="<?= t("View full size") ?>"><?= $item->resize_tag(array("id" => "gPhotoId-{$item->id}")) ?></a> + <div id="gPhoto"> + <?= $theme->resize_top($item) ?> + <a href="#" class="gFullSizeLink" title="<?= t("View full size") ?>"> + <?= $item->resize_tag(array("id" => "gPhotoId-{$item->id}")) ?></a> + <?= $theme->resize_bottom($item) ?> + </div> <div id="gInfo"> <h1><?= $item->title ?></h1> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |