diff options
-rw-r--r-- | .build_number | 2 | ||||
-rw-r--r-- | lib/gallery.common.js | 4 | ||||
-rw-r--r-- | lib/gallery.show_full_size.js | 75 | ||||
-rw-r--r-- | modules/g2_import/views/admin_g2_import.html.php | 2 | ||||
-rw-r--r-- | modules/gallery/tests/xss_data.txt | 10 | ||||
-rw-r--r-- | modules/gallery_unit_test/controllers/gallery_unit_test.php | 11 | ||||
-rw-r--r-- | modules/server_add/js/server_add.js | 2 | ||||
-rw-r--r-- | modules/server_add/views/admin_server_add.html.php | 2 | ||||
-rw-r--r-- | modules/tag/helpers/tag_theme.php | 4 | ||||
-rw-r--r-- | themes/wind/js/ui.init.js | 2 | ||||
-rw-r--r-- | themes/wind/views/photo.html.php | 2 |
11 files changed, 46 insertions, 70 deletions
diff --git a/.build_number b/.build_number index c5637259..99b6a886 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=387 +build_number=391 diff --git a/lib/gallery.common.js b/lib/gallery.common.js index 5ff6b397..f5dee958 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -212,7 +212,7 @@ } // Attach event listeners to the input - input.bind("focus", function(e) { + input.on("focus", function(e) { // Empty input value if it equals it's label if ($(this).val() == label.html()) { $(this).val(""); @@ -220,7 +220,7 @@ button.attr("disabled", false); }); - input.bind("blur", function(e){ + input.on("blur", function(e) { // Reset the input value if it's empty if ($(this).val() == "") { $(this).val(label.html()); diff --git a/lib/gallery.show_full_size.js b/lib/gallery.show_full_size.js index 0baee882..367fa808 100644 --- a/lib/gallery.show_full_size.js +++ b/lib/gallery.show_full_size.js @@ -1,58 +1,35 @@ (function($) { - /** - * @todo Move inline CSS out to external style sheet (theme style sheet) - */ $.gallery_show_full_size = function(image_url, image_width, image_height) { - var width = $(document).width(); - var height = $(document).height(); - var size = $.gallery_get_viewport_size(); - - $("body").append('<div id="g-fullsize-overlay" class="ui-dialog-overlay" ' + - 'style="border: none; margin: 0; padding: 0; background-color: #000; ' + - 'position: fixed; top: 0px; left: 0px; ' + - 'width: 100%; height: 100%; ' + - 'opacity: 0.7; filter: alpha(opacity=70); ' + - '-moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; ' + - '-moz-background-inline-policy: -moz-initial; z-index: 1001;"> </div>'); - - var image_size; - if (image_width >= size.width() - 6 || image_height >= size.height() - 6) { - image_size = $.gallery_auto_fit_window(image_width, image_height); - } else { - image_size = { - top: 12, - left: Math.round((width - image_width) / 2), - width: Math.round(image_width), - height: Math.round(image_height) - }; - } - - $("body").append('<div id="g-fullsize" class="ui-dialog ui-widget" ' + - 'style="overflow: hidden; display: block; ' + - 'position: absolute; z-index: 1002; outline-color: -moz-use-text-color; ' + - 'outline-style: none; outline-width: 0px; ' + - 'height: ' + image_size.height + 'px; ' + - 'width: ' + image_size.width + 'px; ' + - 'top: ' + image_size.top + 'px; left: ' + image_size.left + 'px;">' + - '<img id="g-fullsize-image" src="' + image_url + '"' + - 'height="' + image_size.height + '" width="' + image_size.width + '"/></div>'); + $("body").append('<div id="g-fullsize-overlay" class="ui-widget-overlay ui-front"></div>' + + '<div id="g-fullsize" class="ui-dialog ui-widget ui-front">' + + '<img id="g-fullsize-image" src="' + image_url + '"/>' + + '</div>'); - $().click(function() { - $("#g-fullsize-overlay*").remove(); - $("#g-fullsize").remove(); - }); - $().bind("keypress", function() { + $(document).on("click keypress", function() { $("#g-fullsize-overlay*").remove(); $("#g-fullsize").remove(); }); - $(window).resize(function() { - $("#g-fullsize-overlay").width($(document).width()).height($(document).height()); - image_size = $.gallery_auto_fit_window(image_width, image_height); - $("#g-fullsize").height(image_size.height) - .width(image_size.width) - .css("top", image_size.top) - .css("left", image_size.left); + + var size = $.gallery_get_viewport_size(); + var image_size; + + function update_image_size() { + if (image_width >= size.width() - 6 || image_height >= size.height() - 6) { + image_size = $.gallery_auto_fit_window(image_width, image_height); + } else { + image_size = { + top: 12, + left: Math.round((size.width() - image_width) / 2), + width: Math.round(image_width), + height: Math.round(image_height) + }; + } + $("#g-fullsize").height(image_size.height).width(image_size.width) + .css("top", image_size.top).css("left", image_size.left); $("#g-fullsize-image").height(image_size.height).width(image_size.width); - }); + } + + $(document).ready(update_image_size); + $(window).resize(update_image_size); }; })(jQuery); diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index fd9487e4..adde83ce 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -1,6 +1,4 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<?= $theme->css("jquery.autocomplete.css") ?> -<?= $theme->script("jquery.autocomplete.js") ?> <script type="text/javascript"> $("document").ready(function() { $("form input[name=embed_path]").gallery_autocomplete( diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 7e77a70b..5daaa371 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -41,8 +41,8 @@ modules/comment/views/user_profile_comments.html.php 10 DIRTY_JS $comme modules/comment/views/user_profile_comments.html.php 11 DIRTY $comment->item()->thumb_img(array(),50) modules/exif/views/exif_dialog.html.php 14 DIRTY $details[$i]["caption"] modules/exif/views/exif_dialog.html.php 21 DIRTY $details[$i]["caption"] -modules/g2_import/views/admin_g2_import.html.php 7 DIRTY_JS url::site("__ARGS__") -modules/g2_import/views/admin_g2_import.html.php 49 DIRTY $form +modules/g2_import/views/admin_g2_import.html.php 5 DIRTY_JS url::site("__ARGS__") +modules/g2_import/views/admin_g2_import.html.php 47 DIRTY $form modules/gallery/views/admin_advanced_settings.html.php 21 DIRTY_ATTR text::alternate("g-odd","g-even") modules/gallery/views/admin_block_log_entries.html.php 4 DIRTY_ATTR log::severity_class($entry->severity) modules/gallery/views/admin_block_log_entries.html.php 8 DIRTY_JS user_profile::url($entry->user->id) @@ -350,9 +350,9 @@ modules/search/views/search.html.php 45 DIRTY $item- modules/search/views/search.html.php 47 DIRTY_ATTR $item_class modules/search/views/search.html.php 57 DIRTY $theme->paginator() modules/search/views/search_link.html.php 15 DIRTY_ATTR $album_id -modules/server_add/views/admin_server_add.html.php 8 DIRTY_JS url::site("__ARGS__") -modules/server_add/views/admin_server_add.html.php 16 DIRTY $form -modules/server_add/views/admin_server_add.html.php 27 DIRTY_ATTR $id +modules/server_add/views/admin_server_add.html.php 6 DIRTY_JS url::site("__ARGS__") +modules/server_add/views/admin_server_add.html.php 14 DIRTY $form +modules/server_add/views/admin_server_add.html.php 25 DIRTY_ATTR $id modules/server_add/views/server_add_tree.html.php 20 DIRTY_ATTR is_dir($file)?"ui-icon-folder-collapsed":"ui-icon-document" modules/server_add/views/server_add_tree.html.php 21 DIRTY_ATTR is_dir($file)?"g-directory":"g-file" modules/server_add/views/server_add_tree_dialog.html.php 3 DIRTY_JS url::site("server_add/children?path=__PATH__") diff --git a/modules/gallery_unit_test/controllers/gallery_unit_test.php b/modules/gallery_unit_test/controllers/gallery_unit_test.php index 3275d741..6b2bf479 100644 --- a/modules/gallery_unit_test/controllers/gallery_unit_test.php +++ b/modules/gallery_unit_test/controllers/gallery_unit_test.php @@ -145,9 +145,14 @@ class Gallery_Unit_Test_Controller extends Controller { print $e->getTraceAsString() . "\n"; } - $failed = 0; - foreach ($unit_test->stats as $class => $stats) { - $failed += ($stats["failed"] + $stats["errors"]); + if (!isset($unit_test)) { + // If an exception is thrown, it's possible that $unit_test was never set. + $failed = 1; + } else { + $failed = 0; + foreach ($unit_test->stats as $class => $stats) { + $failed += ($stats["failed"] + $stats["errors"]); + } } if (PHP_SAPI == 'cli') { exit($failed); diff --git a/modules/server_add/js/server_add.js b/modules/server_add/js/server_add.js index 02dda4c0..a2499896 100644 --- a/modules/server_add/js/server_add.js +++ b/modules/server_add/js/server_add.js @@ -33,7 +33,7 @@ $("#g-server-add-tree span.g-directory", this.element).dblclick(function(event) { self.open_dir(event); }); - $("#g-dialog").bind("dialogclose", function(event, ui) { + $("#g-dialog").on("dialogclose", function(event, ui) { window.location.reload(); }); }, diff --git a/modules/server_add/views/admin_server_add.html.php b/modules/server_add/views/admin_server_add.html.php index 5ad142f3..f7e596b4 100644 --- a/modules/server_add/views/admin_server_add.html.php +++ b/modules/server_add/views/admin_server_add.html.php @@ -1,7 +1,5 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <?= $theme->css("server_add.css") ?> -<?= $theme->css("jquery.autocomplete.css") ?> -<?= $theme->script("jquery.autocomplete.js") ?> <script type="text/javascript"> $("document").ready(function() { $("#g-path").gallery_autocomplete( diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php index 81d1352f..143af6c1 100644 --- a/modules/tag/helpers/tag_theme.php +++ b/modules/tag/helpers/tag_theme.php @@ -19,9 +19,7 @@ */ class tag_theme_Core { static function head($theme) { - return $theme->css("jquery.autocomplete.css") - . $theme->script("jquery.autocomplete.js") - . $theme->css("tag.css"); + return $theme->css("tag.css"); } static function admin_head($theme) { diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js index fd75c210..4f901778 100644 --- a/themes/wind/js/ui.init.js +++ b/themes/wind/js/ui.init.js @@ -83,7 +83,7 @@ $(document).ready(function() { ); // Realign any thumbnails that change so that when we rotate a thumb it stays centered. - $(".g-item").bind("gallery.change", function() { + $(".g-item").on("gallery.change", function() { $(".g-item").each(function() { $(this).height($(this).find("img").height() + 2); }); diff --git a/themes/wind/views/photo.html.php b/themes/wind/views/photo.html.php index b42ab987..1fab71e1 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. - $("#g-photo").bind("gallery.change", function() { + $("#g-photo").on("gallery.change", function() { $.ajax({ url: "<?= url::site("items/dimensions/" . $theme->item()->id) ?>", dataType: "json", |