From a5ddef021c1ca4920e40c0657de082ae0d7008ee Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 29 Aug 2009 15:03:46 -0700 Subject: Fix invalida syntax on trying to parse the progress bar percentage --- modules/gallery/views/admin_maintenance_task.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/views/admin_maintenance_task.html.php b/modules/gallery/views/admin_maintenance_task.html.php index 0eb0b38c..509e87b5 100644 --- a/modules/gallery/views/admin_maintenance_task.html.php +++ b/modules/gallery/views/admin_maintenance_task.html.php @@ -4,7 +4,7 @@ var animation = null; var delta = 1; animate_progress_bar = function() { - var current_value = Number($(".gProgressBar div").css("width").replace("%", "")); + var current_value = parseInt($(".gProgressBar div").css("width").replace("%", "")); if (target_value > current_value) { // speed up delta = Math.min(delta + 0.04, 3); -- cgit v1.2.3 From 0aceba6f48e5542d3edfbb1f195af50187adbac4 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 29 Aug 2009 15:20:27 -0700 Subject: Fix for ticket #628: 1) increased gallery module version to 11 2) added image_sharpened parameter to the gallery module 3) sharpen all resizes. --- modules/gallery/helpers/gallery_installer.php | 9 ++++++++- modules/gallery/helpers/graphics.php | 5 +++++ modules/gallery/module.info | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index a212ef85..40830bc0 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -223,6 +223,7 @@ class gallery_installer { module::set_var("gallery", "resize_size", 640); module::set_var("gallery", "default_locale", "en_US"); module::set_var("gallery", "image_quality", 75); + module::set_var("gallery", "image_sharpen", 15); // Add rules for generating our thumbnails and resizes graphics::add_rule( @@ -259,7 +260,7 @@ class gallery_installer { module::set_var("gallery", "show_credits", 1); // @todo this string needs to be picked up by l10n_scanner module::set_var("gallery", "credits", "Powered by Gallery %version"); - module::set_version("gallery", 10); + module::set_version("gallery", 11); } static function upgrade($version) { @@ -336,6 +337,12 @@ class gallery_installer { module::set_version("gallery", $version = 10); } + + if ($version == 10) { + module::set_var("gallery", "image_sharpen", 15); + + module::set_version("gallery", $version = 11); + } } static function uninstall() { diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 7dc46eeb..2892011f 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -206,10 +206,15 @@ class graphics_Core { // Image would get upscaled; do nothing copy($input_file, $output_file); } else { + try { Image::factory($input_file) ->resize($options["width"], $options["height"], $options["master"]) ->quality(module::get_var("gallery", "image_quality")) + ->sharpen(module::get_var("gallery", "image_sharpen")) ->save($output_file); + } catch (Exception $e) { + Kohana::log("error", $e->getMessage()); + } } module::event("graphics_resize_completed", $input_file, $output_file, $options); diff --git a/modules/gallery/module.info b/modules/gallery/module.info index dfb1a7a2..6b9dd1ba 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 10 +version = 11 -- cgit v1.2.3 From a1ce2d3f0aff6dcb7149f2d7327a10079e5c78f8 Mon Sep 17 00:00:00 2001 From: jhilden Date: Sat, 29 Aug 2009 19:19:04 -0400 Subject: you can close the l10n client directly from its interface now, without going back to the languages admin page --- modules/gallery/js/l10n_client.js | 13 +++++++++++++ modules/gallery/views/l10n_client.html.php | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/js/l10n_client.js b/modules/gallery/js/l10n_client.js index 80fe166b..35986e5a 100644 --- a/modules/gallery/js/l10n_client.js +++ b/modules/gallery/js/l10n_client.js @@ -205,6 +205,19 @@ Gallery.behaviors.l10nClient = function(context) { Gallery.l10nClient.toggle(0); } }); + + // Close the l10n client using an AJAX call and refreshing the page + $('#gCloseL10n').click(function(event) { + $.ajax({ + type: "GET", + url: toggle_l10n_mode_url, + data: "csrf=" + csrf, + success: function() { + window.location.reload(true); + } + }); + event.preventDefault(); + }); // Register keybindings using jQuery hotkeys // TODO: Either remove hotkeys code or add query.hotkeys.js. diff --git a/modules/gallery/views/l10n_client.html.php b/modules/gallery/views/l10n_client.html.php index 5ee7eca3..6c440b68 100644 --- a/modules/gallery/views/l10n_client.html.php +++ b/modules/gallery/views/l10n_client.html.php @@ -3,7 +3,8 @@
_ - X + " + href="">X

get('show_all_l10n_messages')): ?> @@ -76,5 +77,7 @@ var MSG_CLOSE_X = ""; var l10n_client_data = ; var plural_forms = ; + var toggle_l10n_mode_url = ""; + var csrf = "";

-- cgit v1.2.3 From 878b9c91b234f464eb9e1a3bdfbd0e6285a1a0e7 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 29 Aug 2009 16:38:53 -0700 Subject: Remove try/catch in resize() since that will swallow any exceptions that we generate when resizing. --- modules/gallery/helpers/graphics.php | 4 ---- 1 file changed, 4 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 2892011f..a20c58dd 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -206,15 +206,11 @@ class graphics_Core { // Image would get upscaled; do nothing copy($input_file, $output_file); } else { - try { Image::factory($input_file) ->resize($options["width"], $options["height"], $options["master"]) ->quality(module::get_var("gallery", "image_quality")) ->sharpen(module::get_var("gallery", "image_sharpen")) ->save($output_file); - } catch (Exception $e) { - Kohana::log("error", $e->getMessage()); - } } module::event("graphics_resize_completed", $input_file, $output_file, $options); -- cgit v1.2.3 From dee0abfab9c613855c9145bd189776cc23d92973 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 30 Aug 2009 15:04:39 -0700 Subject: Use is_descendant() API inside move_to() for clarity. --- modules/gallery/libraries/ORM_MPTT.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/libraries/ORM_MPTT.php b/modules/gallery/libraries/ORM_MPTT.php index a7defba9..9b3e1f2b 100644 --- a/modules/gallery/libraries/ORM_MPTT.php +++ b/modules/gallery/libraries/ORM_MPTT.php @@ -212,8 +212,7 @@ class ORM_MPTT_Core extends ORM { * @return ORM_MTPP */ function move_to($target) { - if ($this->left_ptr <= $target->left_ptr && - $this->right_ptr >= $target->right_ptr) { + if ($this->is_descendant($target)) { throw new Exception("@todo INVALID_TARGET can't move item inside itself"); } -- cgit v1.2.3