From 077cf537142cc71ca822e35a055dc7e1d40b80b0 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 2 Sep 2010 22:03:16 -0700 Subject: Don't try to compare ORM instances; compare their ids instead. Follow on to the fix for #1318 that caused the show= param to get dropped in the breadcrumbs. See http://gallery.menalto.com/node/97790 --- themes/wind/views/page.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/themes/wind/views/page.html.php b/themes/wind/views/page.html.php index 4938ed60..e620d652 100644 --- a/themes/wind/views/page.html.php +++ b/themes/wind/views/page.html.php @@ -105,9 +105,9 @@ // containing that photo. For now, we just do it for // the immediate parent so that when you go back up a // level you're on the right page. ?> - url($parent->id == $theme->item()->parent_id ? "show={$theme->item()->id}" : null) ?>"> - + title, module::get_var("gallery", "visible_title_length"))) ?> -- cgit v1.2.3 From b49d2e6e0003c643af1ee440dd61bf3b20396103 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 4 Sep 2010 14:01:23 -0700 Subject: Make .g-unavailable a little more legible. --- themes/admin_wind/css/screen.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index 81b1a896..eda79b97 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -191,7 +191,8 @@ th { .g-unavailable { border-color: #999; - opacity: 0.4; + color: black; + opacity: .6; } .g-info td { -- cgit v1.2.3 From c51b6ab38d7f16d64127fd3a73df38166a698f0f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 4 Sep 2010 15:54:07 -0700 Subject: Fix full size dimensions after rotating an image on the photo view page. The photo view page caches the dimensions of the full size and then renders it in Javascript. But after rotation, those dimensions are no longer valid. Create a new function on the items controller that returns the appropriate dimensions, then add a hook on $.gallery_replace_image and implement the hook on the photo view page to have it make an async call to get the new dimensions. Fixes ticket #1317 --- lib/gallery.common.js | 3 +++ modules/gallery/controllers/items.php | 9 +++++++++ themes/wind/views/photo.html.php | 15 ++++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) (limited to 'themes') diff --git a/lib/gallery.common.js b/lib/gallery.common.js index a8b237bf..69452f39 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -121,6 +121,9 @@ // Ajax handler for replacing an image, used in Ajax thumbnail rotation $.gallery_replace_image = function(data, thumb) { $(thumb).attr({src: data.src, width: data.width, height: data.height}); + if (typeof gallery_image_replaced_hook == 'function') { + gallery_image_replaced_hook(data, thumb); + } }; // Initialize context menus diff --git a/modules/gallery/controllers/items.php b/modules/gallery/controllers/items.php index f205bf86..39b0f638 100644 --- a/modules/gallery/controllers/items.php +++ b/modules/gallery/controllers/items.php @@ -31,4 +31,13 @@ class Items_Controller extends Controller { access::required("view", $item); url::redirect($item->abs_url()); } + + // Return the width/height dimensinons for the given item + public function dimensions($id) { + $item = ORM::factory("item", $id); + access::required("view", $item); + json::reply(array("thumb" => array((int)$item->thumb_width, (int)$item->thumb_height), + "resize" => array((int)$item->resize_width, (int)$item->resize_height), + "full" => array((int)$item->width, (int)$item->height))); + } } diff --git a/themes/wind/views/photo.html.php b/themes/wind/views/photo.html.php index f8b5511c..cb830e23 100644 --- a/themes/wind/views/photo.html.php +++ b/themes/wind/views/photo.html.php @@ -4,10 +4,23 @@ -- cgit v1.2.3