From 64aa96b5527b0a887800bb4d7868495b4397da74 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 30 Jul 2009 21:00:10 +0800 Subject: Move the getViewportSize method to gallery.common.js Signed-off-by: Tim Almdal --- lib/gallery.common.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/gallery.common.js b/lib/gallery.common.js index 14c28a56..599f23d1 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -27,3 +27,21 @@ }); }; })(jQuery); + +// Get the viewport size +(function () { + $.getViewportSize = function() { + return { + width : function() { + return window.innerWidth + || document.documentElement && document.documentElement.clientWidth + || document.body.clientWidth; + }, + height : function() { + return window.innerHeight + || document.documentElement && document.documentElement.clientHeight + || document.body.clientHeight; + } + }; + }; +})(jQuery); -- cgit v1.2.3 From 86c7fabeaf6fcc9fbbdf1c1a7dc2a3cf9c9a6366 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 31 Jul 2009 20:27:53 +0800 Subject: Simplify getViewportSize function to use the jQuery height and width functions Signed-off-by: Tim Almdal --- lib/gallery.common.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/gallery.common.js b/lib/gallery.common.js index 599f23d1..1eaa6db2 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -33,14 +33,10 @@ $.getViewportSize = function() { return { width : function() { - return window.innerWidth - || document.documentElement && document.documentElement.clientWidth - || document.body.clientWidth; + return $(window).width(); }, height : function() { - return window.innerHeight - || document.documentElement && document.documentElement.clientHeight - || document.body.clientHeight; + return $(window).height(); } }; }; -- cgit v1.2.3 From f034c6c534ad6a07dacc6e64c7e6b43f139c3831 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 31 Jul 2009 13:32:07 -0700 Subject: Add new events: graphics_resize graphics_resize_completed graphics_rotate graphics_rotate_completed graphics_composite graphics_composite_completed --- modules/gallery/helpers/graphics.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index db9b2ef5..d506a982 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -195,6 +195,8 @@ class graphics_Core { self::init_toolkit(); } + module::event("graphics_resize", $input_file, $output_file, $options); + if (@filesize($input_file) == 0) { throw new Exception("@todo EMPTY_INPUT_FILE"); } @@ -209,6 +211,8 @@ class graphics_Core { ->quality(module::get_var("gallery", "image_quality")) ->save($output_file); } + + module::event("graphics_resize_completed", $input_file, $output_file, $options); } /** @@ -223,10 +227,14 @@ class graphics_Core { self::init_toolkit(); } + module::event("graphics_rotate", $input_file, $output_file, $options); + Image::factory($input_file) ->quality(module::get_var("gallery", "image_quality")) ->rotate($options["degrees"]) ->save($output_file); + + module::event("graphics_rotate_completed", $input_file, $output_file, $options); } /** @@ -249,6 +257,8 @@ class graphics_Core { self::init_toolkit(); } + module::event("graphics_composite", $input_file, $output_file, $options); + list ($width, $height) = getimagesize($input_file); list ($w_width, $w_height) = getimagesize($options["file"]); @@ -276,6 +286,9 @@ class graphics_Core { ->composite($options["file"], $x, $y, $options["transparency"]) ->quality(module::get_var("gallery", "image_quality")) ->save($output_file); + + + module::event("graphics_composite_completed", $input_file, $output_file, $options); } /** -- cgit v1.2.3