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 From 5cd34160af2fa1d4499d98aaa807712995082a20 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 8 Sep 2010 21:34:16 -0700 Subject: Remove unnecessary g2_import CSS (which we were loading on every page -- doh!) and replace it with a new "enumeration" list style in the admin_wind CSS. Reshuffle the page a little bit to make it look cleaner. --- modules/g2_import/css/g2_import.css | 30 ------- modules/g2_import/helpers/g2_import_theme.php | 28 ------ modules/g2_import/views/admin_g2_import.html.php | 107 ++++++++++++----------- themes/admin_wind/css/screen.css | 5 ++ 4 files changed, 60 insertions(+), 110 deletions(-) delete mode 100644 modules/g2_import/css/g2_import.css delete mode 100644 modules/g2_import/helpers/g2_import_theme.php (limited to 'themes') diff --git a/modules/g2_import/css/g2_import.css b/modules/g2_import/css/g2_import.css deleted file mode 100644 index d53564d7..00000000 --- a/modules/g2_import/css/g2_import.css +++ /dev/null @@ -1,30 +0,0 @@ -#g-admin-g2-import-notes { - padding-bottom: 20px; -} - -#g-admin-g2-import-details { - padding-top: 20px; -} - -#g-admin-g2-import-details .g-warning { - margin-top: 4px; -} - -#g-admin-g2-import-details .g-info { - padding: 2px; - border: 1px solid #999; - margin-bottom: 10px; -} - -#g-admin-g2-import-notes p, -#g-admin-g2-import-details .g-info p { - padding: 0; - margin: 0; -} - -#g-admin-g2-import-notes ul li, -#g-admin-g2-import .g-info ul li { - padding-left: 0; - margin-left: 20px; - list-style-type: disc; -} diff --git a/modules/g2_import/helpers/g2_import_theme.php b/modules/g2_import/helpers/g2_import_theme.php deleted file mode 100644 index 788253f9..00000000 --- a/modules/g2_import/helpers/g2_import_theme.php +++ /dev/null @@ -1,28 +0,0 @@ -css("g2_import.css"); - } - - static function admin_head($theme) { - $theme->css("g2_import.css"); - } -} \ No newline at end of file diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index 7a6f88ce..a1ee53f6 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -6,27 +6,10 @@

-
-

-

-
    -
  • - Review permissions after your import is done.") ?> -
  • -
  • - -
  • -
  • - notification, search and exif modules during your import will make it go faster.") ?> -
  • -
  • - %lines to gallery3/.htaccess and remove them when the import is done.", array("lines" => "\n\n php_value eaccelerator.enable 0\n php_value xcache.cacher off\n php_value xcache.optimizer off\n\n")) ?> -
  • -
-
- +
+

@@ -51,59 +34,79 @@ "url" => html::mark_clean(url::site("admin/theme_options")))) ?> - -
-

+

  • -

    -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • +
        +
      • + +
      • +
      • + +
      • +
      • + +
      • +
      • + +
      • +
      • + +
      • +
      • + +
      • +
      • + +
      • +
      + +
    + +

    + "> + + +

    +
  • + +
    +
    +

    +
    • - + Review permissions after your import is done.") ?>
    • - +
    • - + notification, search and exif modules during your import will make it go faster.") ?>
    • - + %lines to gallery3/.htaccess and remove them when the import is done.", array("lines" => "\n\n php_value eaccelerator.enable 0\n php_value xcache.cacher off\n php_value xcache.optimizer off\n\n")) ?>
    - -

    - "> - - -

    -
    -

    -

    - -

    +
    +
    +

    +

    + +

    - +
    +
    -
    diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index eda79b97..0d891149 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -222,6 +222,11 @@ th { background-color: #fff; } +ul.enumeration li { + list-style-type: disc; + margin-left: 20px; +} + /*** ****************************************************************** * 3) Page layout containers *********************************************************************/ -- cgit v1.2.3 From 32878ebfdce943271824891639ab0384053bbadd Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 9 Sep 2010 21:04:18 -0700 Subject: Replace the hook function hack I introduced in cbba45fffc7368280e9529f55e108d0080175b6a with a namespaced jQuery custom event. This is way more portable. --- lib/gallery.common.js | 8 +++----- themes/wind/views/photo.html.php | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'themes') diff --git a/lib/gallery.common.js b/lib/gallery.common.js index 69452f39..9fccc602 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -119,11 +119,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); - } + $.gallery_replace_image = function(data, img_selector) { + $(img_selector).attr({src: data.src, width: data.width, height: data.height}); + $(img_selector).trigger("gallery.change"); }; // Initialize context menus diff --git a/themes/wind/views/photo.html.php b/themes/wind/views/photo.html.php index cb830e23..b42ab987 100644 --- a/themes/wind/views/photo.html.php +++ b/themes/wind/views/photo.html.php @@ -12,7 +12,7 @@ // After the image is rotated or replaced we have to reload the image dimensions // so that the full size view isn't distorted. - gallery_image_replaced_hook = function(data, thumb) { + $("#g-photo").bind("gallery.change", function() { $.ajax({ url: "item()->id) ?>", dataType: "json", @@ -20,7 +20,7 @@ full_dims = data.full; } }); - } + }); }); -- cgit v1.2.3 From 6211ed69d7a07d88b18c4db2928663c2cb76b1ba Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 9 Sep 2010 21:25:23 -0700 Subject: Vertically realign thumbnails after rotation so that they stay centered. Partial fix for #1354. --- lib/gallery.common.js | 8 ++++++-- themes/wind/js/ui.init.js | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/lib/gallery.common.js b/lib/gallery.common.js index 9fccc602..548b2e7c 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -24,8 +24,12 @@ if (container == null) { container = 'div'; } - $(this).html("<" + container + " class=\"g-valign\">" + $(this).html() + ""); - var el = $(this).children(container + ".g-valign"); + var el = $(this).find(".g-valign"); + if (!el.length) { + $(this).html("<" + container + " class=\"g-valign\">" + $(this).html() + + ""); + el = $(this).children(container + ".g-valign"); + } var elh = $(el).height(); var ph = $(this).height(); var nh = (ph - elh) / 2; diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js index a4fc0e2f..7637ad80 100644 --- a/themes/wind/js/ui.init.js +++ b/themes/wind/js/ui.init.js @@ -93,6 +93,11 @@ $(document).ready(function() { $("#g-place-holder").remove(); } ); + + // Realign any thumbnails that change so that when we rotate a thumb it stays centered. + $(".g-item").bind("gallery.change", function() { + $(this).gallery_valign(); + }); } // Photo/Item item view -- cgit v1.2.3 From 6e62d604a45b9bf1a60d04effb7eb08e7d15463c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 9 Sep 2010 21:58:16 -0700 Subject: Resize the .g-item to contain the rotated image, and make all .g-item's the same height and realign the photo vertically, both on the .g-item and the hover placeholder. Fixes ticket #1354. --- themes/wind/js/ui.init.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js index 7637ad80..e5071dc1 100644 --- a/themes/wind/js/ui.init.js +++ b/themes/wind/js/ui.init.js @@ -90,13 +90,15 @@ $(document).ready(function() { $(this).css("top", 0).css("left", 0); // Remove the placeholder and hover class from the item $(this).removeClass("g-hover-item"); + $(this).gallery_valign(); $("#g-place-holder").remove(); } ); // Realign any thumbnails that change so that when we rotate a thumb it stays centered. $(".g-item").bind("gallery.change", function() { - $(this).gallery_valign(); + $(this).height($(this).find("img").height() + 2); + $(".g-item").equal_heights().gallery_valign(); }); } -- cgit v1.2.3 From 304dd9cb51b3514f2e663674d22f0d73c0f3e583 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 10 Sep 2010 23:13:47 -0700 Subject: After replacing thumbnails, resize all .g-item boxes down to just a bit larger than the image and then do equal_heights() on them. This tightens the grid back up again when appropriate after a rotation. --- themes/wind/js/ui.init.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js index e5071dc1..2c67bf3a 100644 --- a/themes/wind/js/ui.init.js +++ b/themes/wind/js/ui.init.js @@ -97,7 +97,9 @@ $(document).ready(function() { // Realign any thumbnails that change so that when we rotate a thumb it stays centered. $(".g-item").bind("gallery.change", function() { - $(this).height($(this).find("img").height() + 2); + $(".g-item").each(function() { + $(this).height($(this).find("img").height() + 2); + }); $(".g-item").equal_heights().gallery_valign(); }); } -- cgit v1.2.3