From 7b1cca168cb9b29fcccdcdce9e32efb190e4575e Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 5 Aug 2009 10:25:23 -0700 Subject: Revert "Revert "Allow a theme to override the page refresh mechanism. Create a new"" This reverts commit 9f396178cedc96abb282e72ff0e843e255c8225a. --- lib/gallery.dialog.js | 4 ++-- lib/gallery.panel.js | 4 ++-- lib/gallery.reload.js | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 lib/gallery.reload.js (limited to 'lib') diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 74c2f20e..0efcf120 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -25,9 +25,9 @@ function ajaxify_dialog() { } if (data.result == "success") { if (data.location) { - window.location = data.location; + $.gallery_location(data.location); } else { - window.location.reload(); + $.gallery_reload(); } } } diff --git a/lib/gallery.panel.js b/lib/gallery.panel.js index 022e4878..26be11ad 100644 --- a/lib/gallery.panel.js +++ b/lib/gallery.panel.js @@ -40,9 +40,9 @@ function togglePanel(element, on_success) { if (on_success) { on_success(); } else if (data.location) { - window.location = data.location; + $.gallery_location(data.location); } else { - window.location.reload(); + $.gallery_reload(); } } } diff --git a/lib/gallery.reload.js b/lib/gallery.reload.js new file mode 100644 index 00000000..2c8752a0 --- /dev/null +++ b/lib/gallery.reload.js @@ -0,0 +1,16 @@ +/** + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +(function ($) { + $.gallery_reload = function() { + window.location.reload(); + }; +})(jQuery); + +// Vertically align a block element's content +(function ($) { + $.gallery_location = function(location) { + window.location = location; + }; +})(jQuery); -- cgit v1.2.3 From 7bdf382e813515ce7ab6e14f0b8e3e0b7b6bd867 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 6 Aug 2009 07:02:41 -0700 Subject: Revert "Revert "Revert "Allow a theme to override the page refresh mechanism. Create a new""" This reverts commit 7b1cca168cb9b29fcccdcdce9e32efb190e4575e. Basically remove it and Bharat and I will fight it out in SF for a resolution :-) --- lib/gallery.dialog.js | 4 +- lib/gallery.panel.js | 4 +- lib/gallery.reload.js | 16 ----- modules/gallery/js/quick.js | 4 +- modules/gallery/tests/xss_data.txt | 68 +++++++++++----------- .../views/admin_maintenance_show_log.html.php | 2 +- .../gallery/views/admin_maintenance_task.html.php | 2 +- modules/organize/js/organize.js | 2 +- .../views/server_add_tree_dialog.html.php | 2 +- modules/tag/js/tag.js | 2 +- themes/admin_default/views/admin.html.php | 2 - themes/default/views/page.html.php | 2 - 12 files changed, 44 insertions(+), 66 deletions(-) delete mode 100644 lib/gallery.reload.js (limited to 'lib') diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 0efcf120..74c2f20e 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -25,9 +25,9 @@ function ajaxify_dialog() { } if (data.result == "success") { if (data.location) { - $.gallery_location(data.location); + window.location = data.location; } else { - $.gallery_reload(); + window.location.reload(); } } } diff --git a/lib/gallery.panel.js b/lib/gallery.panel.js index 26be11ad..022e4878 100644 --- a/lib/gallery.panel.js +++ b/lib/gallery.panel.js @@ -40,9 +40,9 @@ function togglePanel(element, on_success) { if (on_success) { on_success(); } else if (data.location) { - $.gallery_location(data.location); + window.location = data.location; } else { - $.gallery_reload(); + window.location.reload(); } } } diff --git a/lib/gallery.reload.js b/lib/gallery.reload.js deleted file mode 100644 index 2c8752a0..00000000 --- a/lib/gallery.reload.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -(function ($) { - $.gallery_reload = function() { - window.location.reload(); - }; -})(jQuery); - -// Vertically align a block element's content -(function ($) { - $.gallery_location = function(location) { - window.location = location; - }; -})(jQuery); diff --git a/modules/gallery/js/quick.js b/modules/gallery/js/quick.js index 4753808e..fda6470f 100644 --- a/modules/gallery/js/quick.js +++ b/modules/gallery/js/quick.js @@ -67,9 +67,9 @@ var quick_do = function(cont, pane, img) { img.css("margin-top", 0); } } else if (data.location) { - $.gallery_location(data.location); + window.location = data.location; } else if (data.reload) { - $.gallery_reload(); + window.location.reload(); } } }); diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 29d223b7..0e118ce7 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -496,25 +496,24 @@ themes/admin_default/views/admin.html.php 20 DIRTY $theme->s themes/admin_default/views/admin.html.php 21 DIRTY $theme->script("jquery.form.js") themes/admin_default/views/admin.html.php 22 DIRTY $theme->script("jquery-ui.js") themes/admin_default/views/admin.html.php 23 DIRTY $theme->script("gallery.common.js") -themes/admin_default/views/admin.html.php 25 DIRTY $theme->script("gallery.reload.js") -themes/admin_default/views/admin.html.php 30 DIRTY $theme->script("gallery.dialog.js") -themes/admin_default/views/admin.html.php 31 DIRTY $theme->script("superfish/js/superfish.js") -themes/admin_default/views/admin.html.php 32 DIRTY $theme->script("jquery.dropshadow.js") -themes/admin_default/views/admin.html.php 33 DIRTY $theme->script("ui.init.js") -themes/admin_default/views/admin.html.php 35 DIRTY $theme->admin_head() -themes/admin_default/views/admin.html.php 38 DIRTY $theme->body_attributes() -themes/admin_default/views/admin.html.php 39 DIRTY $theme->admin_page_top() -themes/admin_default/views/admin.html.php 45 DIRTY $theme->site_status() -themes/admin_default/views/admin.html.php 47 DIRTY $theme->admin_header_top() -themes/admin_default/views/admin.html.php 50 DIRTY $csrf -themes/admin_default/views/admin.html.php 56 DIRTY $theme->admin_menu() -themes/admin_default/views/admin.html.php 58 DIRTY $theme->admin_header_bottom() -themes/admin_default/views/admin.html.php 64 DIRTY $theme->messages() -themes/admin_default/views/admin.html.php 65 DIRTY $content -themes/admin_default/views/admin.html.php 71 DIRTY $sidebar -themes/admin_default/views/admin.html.php 76 DIRTY $theme->admin_footer() -themes/admin_default/views/admin.html.php 78 DIRTY $theme->admin_credits() -themes/admin_default/views/admin.html.php 82 DIRTY $theme->admin_page_bottom() +themes/admin_default/views/admin.html.php 28 DIRTY $theme->script("gallery.dialog.js") +themes/admin_default/views/admin.html.php 29 DIRTY $theme->script("superfish/js/superfish.js") +themes/admin_default/views/admin.html.php 30 DIRTY $theme->script("jquery.dropshadow.js") +themes/admin_default/views/admin.html.php 31 DIRTY $theme->script("ui.init.js") +themes/admin_default/views/admin.html.php 33 DIRTY $theme->admin_head() +themes/admin_default/views/admin.html.php 36 DIRTY $theme->body_attributes() +themes/admin_default/views/admin.html.php 37 DIRTY $theme->admin_page_top() +themes/admin_default/views/admin.html.php 43 DIRTY $theme->site_status() +themes/admin_default/views/admin.html.php 45 DIRTY $theme->admin_header_top() +themes/admin_default/views/admin.html.php 48 DIRTY $csrf +themes/admin_default/views/admin.html.php 54 DIRTY $theme->admin_menu() +themes/admin_default/views/admin.html.php 56 DIRTY $theme->admin_header_bottom() +themes/admin_default/views/admin.html.php 62 DIRTY $theme->messages() +themes/admin_default/views/admin.html.php 63 DIRTY $content +themes/admin_default/views/admin.html.php 69 DIRTY $sidebar +themes/admin_default/views/admin.html.php 74 DIRTY $theme->admin_footer() +themes/admin_default/views/admin.html.php 76 DIRTY $theme->admin_credits() +themes/admin_default/views/admin.html.php 80 DIRTY $theme->admin_page_bottom() themes/admin_default/views/block.html.php 2 DIRTY $id themes/admin_default/views/block.html.php 2 DIRTY $css_id themes/admin_default/views/block.html.php 5 DIRTY $id @@ -602,22 +601,21 @@ themes/default/views/page.html.php 48 DIRTY $theme->s themes/default/views/page.html.php 49 DIRTY $theme->script("jquery.form.js") themes/default/views/page.html.php 50 DIRTY $theme->script("jquery-ui.js") themes/default/views/page.html.php 51 DIRTY $theme->script("gallery.common.js") -themes/default/views/page.html.php 53 DIRTY $theme->script("gallery.reload.js") -themes/default/views/page.html.php 58 DIRTY $theme->script("gallery.dialog.js") -themes/default/views/page.html.php 59 DIRTY $theme->script("gallery.form.js") -themes/default/views/page.html.php 60 DIRTY $theme->script("superfish/js/superfish.js") -themes/default/views/page.html.php 61 DIRTY $theme->script("jquery.localscroll.js") -themes/default/views/page.html.php 62 DIRTY $theme->script("ui.init.js") -themes/default/views/page.html.php 66 DIRTY $theme->script("jquery.scrollTo.js") -themes/default/views/page.html.php 67 DIRTY $theme->script("gallery.show_full_size.js") -themes/default/views/page.html.php 69 DIRTY $theme->script("flowplayer.js") -themes/default/views/page.html.php 72 DIRTY $theme->head() -themes/default/views/page.html.php 75 DIRTY $theme->body_attributes() -themes/default/views/page.html.php 76 DIRTY $theme->page_top() -themes/default/views/page.html.php 78 DIRTY $theme->site_status() -themes/default/views/page.html.php 86 DIRTY $theme->messages() -themes/default/views/page.html.php 87 DIRTY $content -themes/default/views/page.html.php 101 DIRTY $theme->page_bottom() +themes/default/views/page.html.php 56 DIRTY $theme->script("gallery.dialog.js") +themes/default/views/page.html.php 57 DIRTY $theme->script("gallery.form.js") +themes/default/views/page.html.php 58 DIRTY $theme->script("superfish/js/superfish.js") +themes/default/views/page.html.php 59 DIRTY $theme->script("jquery.localscroll.js") +themes/default/views/page.html.php 60 DIRTY $theme->script("ui.init.js") +themes/default/views/page.html.php 64 DIRTY $theme->script("jquery.scrollTo.js") +themes/default/views/page.html.php 65 DIRTY $theme->script("gallery.show_full_size.js") +themes/default/views/page.html.php 67 DIRTY $theme->script("flowplayer.js") +themes/default/views/page.html.php 70 DIRTY $theme->head() +themes/default/views/page.html.php 73 DIRTY $theme->body_attributes() +themes/default/views/page.html.php 74 DIRTY $theme->page_top() +themes/default/views/page.html.php 76 DIRTY $theme->site_status() +themes/default/views/page.html.php 84 DIRTY $theme->messages() +themes/default/views/page.html.php 85 DIRTY $content +themes/default/views/page.html.php 99 DIRTY $theme->page_bottom() themes/default/views/pager.html.php 13 DIRTY $url themes/default/views/pager.html.php 20 DIRTY $previous_page themes/default/views/pager.html.php 20 DIRTY $url diff --git a/modules/gallery/views/admin_maintenance_show_log.html.php b/modules/gallery/views/admin_maintenance_show_log.html.php index ac593de7..9d850986 100644 --- a/modules/gallery/views/admin_maintenance_show_log.html.php +++ b/modules/gallery/views/admin_maintenance_show_log.html.php @@ -1,7 +1,7 @@
diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js index 0a7576b0..89549954 100644 --- a/modules/organize/js/organize.js +++ b/modules/organize/js/organize.js @@ -58,7 +58,7 @@ $("#gOrganizeDialog #gMicroThumbDone").click(_dialog_close); $("#gOrganizeDialog").bind("organize_close", function(target) { - $.gallery_reload(); + document.location.reload(); }); $(".gBranchText span").click(_collapse_or_expanded_tree); diff --git a/modules/server_add/views/server_add_tree_dialog.html.php b/modules/server_add/views/server_add_tree_dialog.html.php index 8dfd2c38..21952849 100644 --- a/modules/server_add/views/server_add_tree_dialog.html.php +++ b/modules/server_add/views/server_add_tree_dialog.html.php @@ -34,7 +34,7 @@ - diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js index 564de393..765c2a35 100644 --- a/modules/tag/js/tag.js +++ b/modules/tag/js/tag.js @@ -59,7 +59,7 @@ function editInPlace(element) { closeEditInPlaceForms(); // close form $("#gTag-" + data.tag_id).text(data.new_tagname); // update tagname console.log(data); - $.gallery_reload(); + window.location.reload(); } } }); diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index 63fc45b5..d27f9260 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -21,8 +21,6 @@ script("jquery.form.js") ?> script("jquery-ui.js") ?> script("gallery.common.js") ?> - - script("gallery.reload.js") ?>

diff --git a/modules/server_add/views/server_add_tree_dialog.html.php b/modules/server_add/views/server_add_tree_dialog.html.php index 21952849..5c5dfd0f 100644 --- a/modules/server_add/views/server_add_tree_dialog.html.php +++ b/modules/server_add/views/server_add_tree_dialog.html.php @@ -34,7 +34,7 @@ - @@ -48,6 +48,9 @@ progressbar("value", 0); $("#gProgress").slideDown("fast", function() { start_add() }); }); + $("#gServerCloseButton").click(function(event) { + $("#gDialog").dialog("close"); + }); }); diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js index 765c2a35..535582c5 100644 --- a/modules/tag/js/tag.js +++ b/modules/tag/js/tag.js @@ -23,7 +23,7 @@ function closeEditInPlaceForms() { $("#gRenameTagForm").parent().html($("#gRenameTagForm").parent().data("revert")); li.height(""); $(".gEditable", li).bind("click", editInPlace); - $(".gDialogLink", li).bind("click", handleDialogEvent); + $(".gDialogLink", li).galleryDialog(); } } diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index 542b8b8b..a487d565 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -28,7 +28,7 @@ {}, function(data) { $("#group-" + group_id).html(data); - $("#group-" + group_id + " .gDialogLink").bind("click", handleDialogEvent); + $("#group-" + group_id + " .gDialogLink").galleryDialog()); }); } diff --git a/themes/admin_default/js/ui.init.js b/themes/admin_default/js/ui.init.js index 63b74300..eea3cab2 100644 --- a/themes/admin_default/js/ui.init.js +++ b/themes/admin_default/js/ui.init.js @@ -17,7 +17,7 @@ $(document).ready(function(){ $("#gMessage li").showMessage(); // Initialize modal dialogs - $(".gDialogLink").bind("click", handleDialogEvent); + $(".gDialogLink").galleryDialog(); // Initialize panels $(".gPanelLink").galleryPanel(); diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index ff76c79c..33d04328 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -34,7 +34,7 @@ $(document).ready(function() { // Initialize dialogs $(".gMenuLink").addClass("gDialogLink"); $("#gLoginLink").addClass("gDialogLink"); - $(".gDialogLink").bind("click", handleDialogEvent); + $(".gDialogLink").galleryDialog(); // Initialize view menu if ($("#gViewMenu").length) { -- cgit v1.2.3 From 46b9375d9050ba7f46def18b59ee80f0ffc15d3a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 7 Aug 2009 10:33:11 -0700 Subject: Forgot this file on the gallery dialog commit --- lib/gallery.common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/gallery.common.js b/lib/gallery.common.js index e063462e..50652532 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -10,7 +10,7 @@ }); }; -// Vertically align a block element's content + // Vertically align a block element's content $.fn.vAlign = function(container) { return this.each(function(i){ if (container == null) { @@ -25,7 +25,7 @@ }); }; -// Get the viewport size + // Get the viewport size $.getViewportSize = function() { return { width : function() { -- cgit v1.2.3 From 49d46e4010e428b9df97a6e7c5e55708d1c674a8 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 7 Aug 2009 10:47:56 -0700 Subject: Change galleryPanel and galleryDialog widgets to gallery_panel and gallery_dialog respectively --- lib/gallery.dialog.js | 8 ++++---- lib/gallery.panel.js | 2 +- modules/gallery/views/after_install.html.php | 2 +- modules/tag/js/tag.js | 2 +- modules/user/views/admin_users.html.php | 2 +- themes/admin_default/js/ui.init.js | 4 ++-- themes/default/js/ui.init.js | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 7e0ba1b4..04ab44de 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -1,5 +1,5 @@ (function($) { - $.widget("ui.galleryDialog", { + $.widget("ui.gallery_dialog", { _init: function() { var self = this; this.element.click(function(event){ @@ -12,7 +12,7 @@ $("body").append(eDialog); if (!self.options.close) { - self.options.close = self.closeDialog; + self.options.close = self.close_dialog; } $("#gDialog").dialog(self.options); @@ -91,7 +91,7 @@ ); }, - closeDialog: function (event, ui) { + close_dialog: function (event, ui) { var self = $("#gDialog").dialog("option", "self"); self.destroy(); }, @@ -124,7 +124,7 @@ dialog_closing: function(event, ui) {} }); - $.extend($.ui.galleryDialog, { + $.extend($.ui.gallery_dialog, { defaults: { autoOpen: false, autoResize: true, diff --git a/lib/gallery.panel.js b/lib/gallery.panel.js index 98d78d2a..e0bf4259 100644 --- a/lib/gallery.panel.js +++ b/lib/gallery.panel.js @@ -1,5 +1,5 @@ (function($) { - $.widget("ui.galleryPanel", { + $.widget("ui.gallery_panel", { _init: function() { var self = this; this.element.click(function(event) { diff --git a/modules/gallery/views/after_install.html.php b/modules/gallery/views/after_install.html.php index feb2d281..bfce46f0 100644 --- a/modules/gallery/views/after_install.html.php +++ b/modules/gallery/views/after_install.html.php @@ -16,7 +16,7 @@ title="" id="gAfterInstallChangePasswordLink" class="gButtonLink ui-state-default ui-corners-all">

diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js index 535582c5..61ac73f4 100644 --- a/modules/tag/js/tag.js +++ b/modules/tag/js/tag.js @@ -23,7 +23,7 @@ function closeEditInPlaceForms() { $("#gRenameTagForm").parent().html($("#gRenameTagForm").parent().data("revert")); li.height(""); $(".gEditable", li).bind("click", editInPlace); - $(".gDialogLink", li).galleryDialog(); + $(".gDialogLink", li).gallery_dialog(); } } diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index a487d565..9bd4c068 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -28,7 +28,7 @@ {}, function(data) { $("#group-" + group_id).html(data); - $("#group-" + group_id + " .gDialogLink").galleryDialog()); + $("#group-" + group_id + " .gDialogLink").gallery_dialog(); }); } diff --git a/themes/admin_default/js/ui.init.js b/themes/admin_default/js/ui.init.js index eea3cab2..89dd5b47 100644 --- a/themes/admin_default/js/ui.init.js +++ b/themes/admin_default/js/ui.init.js @@ -17,10 +17,10 @@ $(document).ready(function(){ $("#gMessage li").showMessage(); // Initialize modal dialogs - $(".gDialogLink").galleryDialog(); + $(".gDialogLink").gallery_dialog(); // Initialize panels - $(".gPanelLink").galleryPanel(); + $(".gPanelLink").gallery_panel(); if ($("#gPhotoStream").length) { // Vertically align thumbs in photostream diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index 33d04328..4b876c66 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -34,7 +34,7 @@ $(document).ready(function() { // Initialize dialogs $(".gMenuLink").addClass("gDialogLink"); $("#gLoginLink").addClass("gDialogLink"); - $(".gDialogLink").galleryDialog(); + $(".gDialogLink").gallery_dialog(); // Initialize view menu if ($("#gViewMenu").length) { -- cgit v1.2.3 From 7b0ea229b8591c3fba5eb3cb853aa2ac3efd2d97 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 7 Aug 2009 17:07:04 -0700 Subject: Make the organize dialog open properly in IE8, Chrome and FF. For some reason (probably a timing thing) the height of the contents was not being set correctly in FF. So we just hard code an estimate of the size of the Draw handle, and message areas. --- lib/gallery.dialog.js | 8 ++++++-- modules/organize/js/organize.js | 16 +++++++--------- modules/organize/views/organize_dialog.html.php | 4 +--- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 51ebb21a..e3597eab 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -59,10 +59,14 @@ var dialogHeight = $("#gDialog").height(); var cssWidth = new String($("#gDialog form").css("width")); var childWidth = cssWidth.replace(/[^0-9]/g,""); + var size = $.gallery_get_viewport_size(); if ($("#gDialog iframe").length) { - dialogWidth = $(window).width() - 100; + dialogWidth = size.width() - 100; // Set the iframe width and height - $("#gDialog iframe").width("100%").height($(window).height() - 100); + $("#gDialog iframe").width("100%").height(size.height() - 100); + } else if ($("#gDialog form").length == 0) { + dialogWidth = size.width() - 100; + $("#gDialog").dialog("option", "height", size.height() - 100); } else if (childWidth == "" || childWidth > 300) { dialogWidth = 500; } diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js index 6b4a5934..853e3eef 100644 --- a/modules/organize/js/organize.js +++ b/modules/organize/js/organize.js @@ -4,21 +4,19 @@ * Dynamically initialize the organize dialog when it is displayed */ init: function(data) { - // Resize with 50 pixels padding all around - var size = $.getViewportSize(); - $("#gDialog").dialog("option", "height", size.height() - 100) - .dialog("option", "width", size.width() - 100) - .dialog("option", "position", "center"); - // Deal with ui.jquery bug: http://dev.jqueryui.com/ticket/4475 (target 1.8?) $(".sf-menu li.sfHover ul").css("z-index", 70); - var height = $("#gOrganizeDetail").innerHeight(); - $("#gMicroThumbPanel").height(height - $("#gOrganizeEditDrawerHandle").outerHeight()); + $("#gDialog").bind("dialogopen", function(event, ui) { + $("#gMicroThumbPanel").height($("#gDialog").innerHeight() - 90); + }); + + $("#gDialog").bind("dialogclose", function(event, ui) { + window.location.reload(); + }); $("#gDialog #gMicroThumbDone").click(function(event) { $("#gDialog").dialog("close"); - window.location.reload(); }); $(".gBranchText span").click($.organize.collapse_or_expand_tree); diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 6001e038..0daa328d 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -41,7 +41,5 @@ -- cgit v1.2.3 From 1c5b04a2c5d58838dbea413359c9b114f7077ca8 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 8 Aug 2009 16:26:34 -0700 Subject: Fix the problem where the login page and edit permission pages were supersized based on ly last commit. --- lib/gallery.dialog.js | 2 +- modules/organize/views/organize_dialog.html.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 6c2993fd..ace588f6 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -61,7 +61,7 @@ dialogWidth = size.width() - 100; // Set the iframe width and height $("#gDialog iframe").width("100%").height(size.height() - 100); - } else if ($("#gDialog form").length == 0) { + } else if ($("#gDialog .gDialogPanel").length) { dialogWidth = size.width() - 100; $("#gDialog").dialog("option", "height", size.height() - 100); } else if (childWidth == "" || childWidth > 300) { diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 0daa328d..b946d82b 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -1,6 +1,6 @@ " /> -
+

p::purify($title))) ?>

-- cgit v1.2.3 From 39b37cc585b7e5413c472176e880da93a2de4e11 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 12 Aug 2009 14:13:39 -0700 Subject: Use the jquery-ui library that contains a prerelease version of the slectable component --- lib/jquery-ui.js | 533 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 508 insertions(+), 25 deletions(-) (limited to 'lib') diff --git a/lib/jquery-ui.js b/lib/jquery-ui.js index 0c6a0ebe..4939d009 100644 --- a/lib/jquery-ui.js +++ b/lib/jquery-ui.js @@ -45,18 +45,6 @@ jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.bro * ui.core.js */ (function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f
');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidthk.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e
');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);;/* - * jQuery UI Selectable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Selectables - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a(c.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.rightg||j.bottomd&&j.righth&&j.bottom=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"
",spinner:"Loading…",tabTemplate:'
  • #{label}
  • '}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i
    ')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('
    '))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$(''+appendText+"");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDatenew Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)0&&iValue="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j0&&iValue-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormatmaxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDrawmaxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?''+prevText+"":(hideIfNoPrevNext?"":''+prevText+""));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?''+nextText+"":(hideIfNoPrevNext?"":''+nextText+""));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'":"");var buttonPanel=(showButtonPanel)?'
    '+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'":"")+(isRTL?"":controls)+"
    ":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'
    ';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="=5?' class="ui-datepicker-week-end"':"")+'>'+dayNamesMin[day]+""}calender+=thead+"";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDatemaxDate);tbody+='";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+""}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="
    =currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?''+printDate.getDate()+"":'=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+""))+"
    "+(isMultiMonth?"
    "+((numMonths[0]>0&&col==numMonths[1]-1)?'
    ':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+=''+drawYear+""}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&datemaxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);;/* * jQuery UI Progressbar 1.7.2 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) @@ -163,4 +139,511 @@ jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(v * Depends: * effects.core.js */ -(function(a){a.effects.transfer=function(b){return this.queue(function(){var f=a(this),h=a(b.options.to),e=h.offset(),g={top:e.top,left:e.left,height:h.innerHeight(),width:h.innerWidth()},d=f.offset(),c=a('
    ').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);; \ No newline at end of file +(function(a){a.effects.transfer=function(b){return this.queue(function(){var f=a(this),h=a(b.options.to),e=h.offset(),g={top:e.top,left:e.left,height:h.innerHeight(),width:h.innerWidth()},d=f.offset(),c=a('
    ').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);;/* + * jQuery UI Selectable @VERSION + * + * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * ui.core.js + */ +(function($) { + + $.widget('ui.selectable', $.extend({}, $.ui.mouse, { + + _init: function() { + + var self = this; + this.items = $(this.options.filter, this.element); + this.element.addClass("ui-selectable"); + + //Set the currentFocus to the first item + this.currentFocus = this.items.eq(0); + + //Refresh item positions + this.refresh(); + + //Disable text selection + this.element.disableSelection(); + + //Prepare caret selection + if(this.options.lasso) this._mouseInit(); + + this.element + .bind('mousedown.selectable', function(event) { + + var item = self._targetIsItem(event.target); + if (!item) return; + + // If item is part of current selection and current + // selection is multiple, return and allow mouseup + // to fire (Windows gets this right too, OSX doesn't) + if(self._selection.length > 1 && $(item).hasClass(self.options.selectedClass)) { + return (self._listenForMouseUp = 1); + } + + if(self._trigger('beforeselect', event) === false) + return true; + + self._select(event, item); + self.element[0].focus(); + event.preventDefault(); + + }) + .bind('mouseup.selectable', function(event) { + if(self._listenForMouseUp) { + + self._listenForMouseUp = 0; + var item = self._targetIsItem(event.target); + if (!item) return; + + if(self._trigger('beforeselect', event) === false) + return true; + + self._select(event, item); + self.element[0].focus(); + event.preventDefault(); + } + }) + .bind('focus.selectable', function() { + self.currentFocus.addClass('ui-focused'); + }) + .bind('blur.selectable', function() { + self.currentFocus.removeClass('ui-focused'); + }) + .bind('keydown.selectable', function(event) { + + if(!self.options.keyboard) + return; + + if(self._trigger('beforeselect', event) === false) + return true; + + if(event.keyCode == $.ui.keyCode.DOWN) { + self.options.smart ? self.selectClosest('down', event) : self.selectNext(event); + event.preventDefault(); + } + + if(event.keyCode == $.ui.keyCode.RIGHT) { + self.options.smart ? self.selectClosest('right', event) : self.selectNext(event); + event.preventDefault(); + } + + if(event.keyCode == $.ui.keyCode.UP) { + self.options.smart ? self.selectClosest('up', event) : self.selectPrevious(event); + event.preventDefault(); + } + + if(event.keyCode == $.ui.keyCode.LEFT) { + self.options.smart ? self.selectClosest('left', event) : self.selectPrevious(event); + event.preventDefault(); + } + + if ((event.ctrlKey || event.metaKey) && event.keyCode == $.ui.keyCode.SPACE) { + self._toggleSelection(self.currentFocus, event); + } + + }); + + this.helper = $(document.createElement('div')) + .addClass("ui-selectable-lasso"); + + }, + + selectClosest: function(direction, event) { + + var current = [/(down|right)/.test(direction) ? 10000 : -10000, null], + overlap = 10000, + selfOffset = this.currentFocus.data('selectable-item'); + + $(this.options.filter, this.element).not(this.currentFocus).filter(':visible').each(function() { + + var $this = $(this), + offset = $this.data('selectable-item'), + distance = { + x: Math.abs(selfOffset.left - offset.left) + Math.abs((offset.left+this.offsetWidth) - (selfOffset.left+this.offsetWidth)), + y: Math.abs(selfOffset.top - offset.top) + Math.abs((offset.top+this.offsetHeight) - (selfOffset.top+this.offsetHeight)) + }; + + switch(direction) { + + case 'up': + if((selfOffset.top > offset.top && offset.top >= current[0]) && (offset.top != current[0] || distance.x < overlap)) { + current = [offset.top, $this]; + overlap = distance.x; + } + break; + + case 'down': + if((selfOffset.top < offset.top && offset.top <= current[0]) && (offset.top != current[0] || distance.x < overlap)) { + current = [offset.top, $this]; + overlap = distance.x; + } + break; + + case 'left': + if((selfOffset.left > offset.left && offset.left >= current[0]) && (offset.left != current[0] || distance.y < overlap)) { + current = [offset.left, $this]; + overlap = distance.y; + } + break; + + case 'right': + if((selfOffset.left < offset.left && offset.left <= current[0]) && (offset.left != current[0] || distance.y < overlap)) { + current = [offset.left, $this]; + overlap = distance.y; + } + break; + + } + + }); + + return current[1] ? this._select(event, current[1]) : false; + + }, + + destroy: function() { + this.element + .removeClass("ui-selectable ui-selectable-disabled") + .removeData("selectable") + .unbind(".selectable"); + this._mouseDestroy(); + }, + + _mouseCapture: function(event) { + //If the item we start dragging on is a selectable, we bail (if keyboard is used) + this.clickedOnItem = this._targetIsItem(event.target); + return !this.options.keyboard || !this.clickedOnItem; + }, + + _mouseStart: function(event) { + + var self = this, o = this.options; + this.opos = [event.pageX, event.pageY]; + + if (o.disabled) + return; + + //Cache positions + this.refresh(); + + //Trigger start event + this._trigger("start", event, this._uiHash()); + + // append and position helper (lasso) + $('body').append(this.helper); + this.helper.css({ + zIndex: 100, + position: "absolute", + left: event.clientX, + top: event.clientY, + width: 0, + height: 0 + }); + + //Tell the intersection that some start selected + this.items.filter('.'+this.options.selectedClass).each(function() { + if(event.metaKey) { + if(this != self.clickedOnItem) $.data(this, "selectable-item").startSelected = true; + } else self._removeFromSelection($(this), event); + }); + + }, + + _mouseDrag: function(event) { + + var self = this, o = this.options; + + if (o.disabled) + return; + + //Do the lasso magic + var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; + if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } + if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } + this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); + + //Loop through all items and check overlaps + this.items.each(function() { + + var item = $.data(this, "selectable-item"); + + //prevent helper from being selected if appendTo: selectable + if (!item || item.element == self.element[0]) + return; + + var hit = false; + if (o.lasso && o.lasso.tolerance == 'touch') { + hit = ( !(item.left > x2 || item.right < x1 || item.top > y2 || item.bottom < y1) ); + } else if (o.lasso && o.lasso.tolerance == 'fit') { + hit = (item.left > x1 && item.right < x2 && item.top > y1 && item.bottom < y2); + } + + hit ? + item.startSelected ? self._removeFromSelection($(this), event) : self._addToSelection($(this), event) + : !item.startSelected ? self._removeFromSelection($(this), event) : self._addToSelection($(this), event); + + }); + + return false; + + }, + + _mouseStop: function(event) { + this._trigger("stop", event, this._uiHash()); + this.helper.remove(); + return false; + }, + + _targetIsItem: function(item) { + var found = $(item).parents().andSelf().filter(':data(selectable-item)'); + return found.length && found; + }, + + _selection: [], + + _clearSelection: function(triggerEvent) { + + var triggerItems = []; + + for (var i = this._selection.length - 1; i >= 0; i--){ + if(triggerEvent && this._selection[i].data('selectable-item').selected) triggerItems.push(this._selection[i]); + this._selection[i].removeClass(this.options.selectedClass); + this._selection[i].data('selectable-item').selected = false; + }; + + this._selection = []; + if(triggerEvent) this._trigger('unselect', triggerEvent, this._uiHash($($.map(triggerItems, function(i) { return i[0]; })), 'removed')); + + }, + + _toggleSelection: function(item, event) { + item.data('selectable-item').selected ? this._removeFromSelection(item, event) : this._addToSelection(item); + }, + + _addToSelection: function(item, triggerEvent) { + + if (item.data('selectable-item').selected) + return null; + + this._selection.push(item); + this.latestSelection = item; + item.addClass(this.options.selectedClass); + item.data('selectable-item').selected = true; + + if(triggerEvent) { + this._trigger('select', triggerEvent, $.extend({ lasso: true }, this._uiHash(item))); + } + + return item; + + }, + + _removeFromSelection: function(item, triggerEvent) { + + for (var i=0; i < this._selection.length; i++) { + if (this._selection[i][0] == item[0]) { + this._selection[i].removeClass(this.options.selectedClass); + this._selection[i].data('selectable-item').selected = false; + this._selection.splice(i,1); + if(triggerEvent) this._trigger('unselect', triggerEvent, this._uiHash($(item), 'removed')); + break; + } + }; + + }, + + _updateSelectionMouse: function(event) { + + var newlySelected = []; + + if (event.shiftKey && this.options.multiple) { + + //Clear the previous selection to make room for a shift selection + this._clearSelection(event); + + var index = this.items.index(this.latestWithoutModifier[0]) > this.items.index(this.currentFocus[0]) ? -1 : 1; + var i = this.latestWithoutModifier.data('selectable-item').selected ? this.items.eq(this.items.index(this.latestWithoutModifier[0])+index) : this.latestWithoutModifier; + while(i.length && i[0] != this.currentFocus[0]) { + i[0] == this.previousFocus[0] ? this._addToSelection(i) : newlySelected.push(this._addToSelection(i)); + i = this.items.eq(this.items.index(i[0])+index); + } + + //Readd the item with the current focus + newlySelected.push(this._addToSelection(this.currentFocus)); + + } else { + + if (event.metaKey) { + this._toggleSelection(this.currentFocus, event); + } else { + this._clearSelection(event); + newlySelected.push(this._addToSelection(this.currentFocus)); + this.latestWithoutModifier = this.currentFocus; + } + + } + + return $($.map(newlySelected, function(i) { return i[0]; })); + + }, + + _updateSelection: function(event, index) { + + var newlySelected = []; + + if (event.shiftKey && this.options.multiple) { + + if (this.currentFocus.data('selectable-item').selected) { + this._removeFromSelection(this.previousFocus, event); + } else { + + var index2 = this.items.index(this.latestSelection[0]) > this.items.index(this.currentFocus[0]) ? 1 : -1; + if (!this.previousFocus.data('selectable-item').selected) { + var i = index == index2 ? this.items.eq(this.items.index(this.previousFocus[0])+index2) : this.previousFocus; + while(i.length && !i.data('selectable-item').selected) { + newlySelected.push(this._addToSelection(i)); + i = this.items.eq(this.items.index(i[0])+index2); + } + } + + newlySelected.push(this._addToSelection(this.currentFocus)); + + } + + } else { + + //If the CTRL or Apple/Win key is pressed, only set focus + if (event.metaKey) + return; + + this._clearSelection(event); + newlySelected.push(this._addToSelection(this.currentFocus)); + this.latestWithoutModifier = this.currentFocus; + + } + + return $($.map(newlySelected, function(i) { return i[0]; })); + + }, + + _select: function(event, item) { + + //Set the current selection to the previous/next item + this.previousFocus = this.currentFocus; + this.currentFocus = $(item); + + this.previousFocus.removeClass('ui-focused'); + this.currentFocus.addClass('ui-focused'); + + //Set and update the selection + var newlySelected = this._updateSelectionMouse(event); + + //Trigger select event + if(newlySelected && newlySelected.length) this._trigger('select', event, this._uiHash(newlySelected, 'added')); + + }, + + _selectAdjacent: function(event, index) { + + var item = this.items.eq(this.items.index(this.currentFocus[0]) + index); + + //Bail if there's no previous/next item + if (!item.length) return; + + //Set the current selection to the previous/next item + this.previousFocus = this.currentFocus; + this.currentFocus = item; + + this.previousFocus.removeClass('ui-focused'); + this.currentFocus.addClass('ui-focused'); + + //Set and update the selection + var newlySelected = this._updateSelection(event, index); + + //Trigger select event + if(newlySelected && newlySelected.length) this._trigger('select', event, this._uiHash(newlySelected, 'added')); + + }, + + selectPrevious: function(event) { + this._selectAdjacent(event, -1); + }, + + selectNext: function(event) { + this._selectAdjacent(event, 1); + }, + + refresh: function() { + + var o = this.options; + this.items = $(o.filter, this.element); + this.items.each(function() { + var $this = $(this); + var pos = $this.offset(); + $.data(this, "selectable-item", { + left: pos.left, + top: pos.top, + right: pos.left + $this.width(), + bottom: pos.top + $this.height(), + startSelected: false, + selected: $this.hasClass(o.selectedClass) + }); + }); + + }, + + select: function(item) { + //TODO + }, + + deselect: function(item) { + if(!item) this._clearSelection(true); + //TODO: Deselect single elements + }, + + _uiHash: function(items, specialKey) { + var uiHash = { + previousFocus: this.previousFocus, + currentFocus: this.currentFocus, + selection: $($.map(this._selection, function(i) { return i[0]; })) + }; + if(specialKey) uiHash[specialKey] = items; + return uiHash; + } + + })); + + $.extend($.ui.selectable, { + defaults: { + + //TODO: Figure out how to move these defaults out + cancel: ":input,option", + delay: 0, + distance: 1, + appendTo: 'body', + + multiple: true, + smart: true, + filter: '> *', + + keyboard: true, + lasso: { + cancel: ":input,option", + delay: 0, + distance: 1, + tolerance: 'touch', + appendTo: 'body' + }, + + //Should we really delete that? + selectedClass: 'ui-state-selected' + } + }); + +})(jQuery); -- cgit v1.2.3 From b184f995f8a9db78b0603a7c19e44f4e26d605cb Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 19 Aug 2009 06:12:29 -0700 Subject: Correct indentation --- lib/gallery.ajax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gallery.ajax.js b/lib/gallery.ajax.js index 31039ea4..0cdd8f27 100644 --- a/lib/gallery.ajax.js +++ b/lib/gallery.ajax.js @@ -6,7 +6,7 @@ $.get($(event.currentTarget).attr("href"), function(data) { eval("var data = " + data); ajax_handler(data); - }); + }); event.preventDefault(); return false; }); -- cgit v1.2.3 From bfcbb600394c33b9cc176d8e0ec4293e1e22620a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 19 Aug 2009 16:06:36 -0700 Subject: Modified the conversion of the margin-top and margin-bottom css values. The problem arises because $(selector).css("margin-top) does not return a string and therefore the replace function is undefined. --- lib/gallery.common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/gallery.common.js b/lib/gallery.common.js index e00eb62a..06775d79 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -89,8 +89,8 @@ */ $.fn.gallery_height = function() { var ht = $(this).height(); - var mt = $(this).css("margin-top").replace("px",""); - var mb = $(this).css("margin-bottom").replace("px",""); + var mt = parseInt($(this).css("margin-top")); + var mb = parseInt($(this).css("margin-bottom")); return ht + parseInt(mt) + parseInt(mb); }; -- cgit v1.2.3 From 74d79dc81929111edebfb47912f18521639241f0 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 20 Aug 2009 12:53:20 -0700 Subject: Refactor the _auto_fit method in gallery.show_full_size to a common method in gallery.common.js --- lib/gallery.common.js | 25 +++++++++++++++++++++++++ lib/gallery.show_full_size.js | 39 +++++---------------------------------- 2 files changed, 30 insertions(+), 34 deletions(-) (limited to 'lib') diff --git a/lib/gallery.common.js b/lib/gallery.common.js index 06775d79..844e219b 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -125,5 +125,30 @@ ); }; + $.gallery_auto_fit_window = function(imageWidth, imageHeight) { + var size = $.gallery_get_viewport_size(); + var width = size.width() - 6, + height = size.height() - 6; + + var ratio = width / imageWidth; + imageWidth *= ratio; + imageHeight *= ratio; + + /* after scaling the width, check that the height fits */ + if (imageHeight > height) { + ratio = height / imageHeight; + imageWidth *= ratio; + imageHeight *= ratio; + } + + // handle the case where the calculation is almost zero (2.14e-14) + return { + top: Number((height - imageHeight) / 2), + left: Number((width - imageWidth) / 2), + width: Number(imageWidth), + height: Number(imageHeight) + }; + }; + })(jQuery); diff --git a/lib/gallery.show_full_size.js b/lib/gallery.show_full_size.js index c32195f6..2f365f0d 100644 --- a/lib/gallery.show_full_size.js +++ b/lib/gallery.show_full_size.js @@ -3,48 +3,19 @@ * @todo Move inline CSS out to external style sheet (theme style sheet) */ $.gallery_show_full_size = function(image_url, image_width, image_height) { - /* - * Calculate the size of the image panel based on the size of the image and the size of the - * window. Scale the image so the entire panel fits in the view port. - */ - function _auto_fit(imageWidth, imageHeight) { - // ui-dialog gives a padding of 2 pixels - var windowWidth = $(window).width() - 10; - var windowHeight = $(window).height() - 10; - - /* If the width is greater then scale the image width first */ - if (imageWidth > windowWidth) { - var ratio = windowWidth / imageWidth; - imageWidth *= ratio; - imageHeight *= ratio; - } - /* after scaling the width, check that the height fits */ - if (imageHeight > windowHeight) { - var ratio = windowHeight / imageHeight; - imageWidth *= ratio; - imageHeight *= ratio; - } - - // handle the case where the calculation is almost zero (2.14e-14) - return { - top: Number((windowHeight - imageHeight) / 2), - left: Number((windowWidth - imageWidth) / 2), - width: Number(imageWidth), - height: Number(imageHeight) - }; - } - var width = $(document).width(); var height = $(document).height(); + var size = $.gallery_get_viewport_size(); $("body").append('
    '); - var image_size = _auto_fit(image_width, image_height); + var image_size = $.gallery_auto_fit_window(image_width, image_height); $("body").append('
    Date: Thu, 27 Aug 2009 15:22:27 -0700 Subject: Fix ticket #644 1) remove close button 2) extend the grey overlay to the document size 3) allow any keypress to close the fullize image 4) click on the fullsize will close --- lib/gallery.show_full_size.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/gallery.show_full_size.js b/lib/gallery.show_full_size.js index 2f365f0d..1f74e6e2 100644 --- a/lib/gallery.show_full_size.js +++ b/lib/gallery.show_full_size.js @@ -10,7 +10,7 @@ $("body").append('
    '); @@ -27,10 +27,14 @@ '
    '); - $("#gFullsize").append(''); - $("#gFullsizeClose").click(function() { + //$("#gFullsize").append(''); + $("#gFullsize").click(function() { + $("#gFullsizeOverlay*").remove(); + $("#gFullsize").remove(); + }); + $().bind("keypress", function() { $("#gFullsizeOverlay*").remove(); $("#gFullsize").remove(); }); -- cgit v1.2.3 From bfc64685e4ae4bbd2c0308e9520194215ab51469 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 27 Aug 2009 15:37:18 -0700 Subject: Allow clicking on the overlay to close the fullsize and remove some debug code --- lib/gallery.show_full_size.js | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'lib') diff --git a/lib/gallery.show_full_size.js b/lib/gallery.show_full_size.js index 1f74e6e2..7e826c32 100644 --- a/lib/gallery.show_full_size.js +++ b/lib/gallery.show_full_size.js @@ -27,27 +27,22 @@ ''); - //$("#gFullsize").append(''); - $("#gFullsize").click(function() { - $("#gFullsizeOverlay*").remove(); - $("#gFullsize").remove(); - }); + $().click(function() { + $("#gFullsizeOverlay*").remove(); + $("#gFullsize").remove(); + }); $().bind("keypress", function() { - $("#gFullsizeOverlay*").remove(); - $("#gFullsize").remove(); - }); + $("#gFullsizeOverlay*").remove(); + $("#gFullsize").remove(); + }); $(window).resize(function() { - $("#gFullsizeOverlay").width($(document).width()) - .height($(document).height()); - image_size = $.gallery_auto_fit_window(image_width, image_height); - $("#gFullsize").height(image_size.height) - .width(image_size.width) - .css("top", image_size.top) - .css("left", image_size.left); - $("#gFullSizeImage").height(image_size.height) - .width(image_size.width); - }); + $("#gFullsizeOverlay").width($(document).width()).height($(document).height()); + image_size = $.gallery_auto_fit_window(image_width, image_height); + $("#gFullsize").height(image_size.height) + .width(image_size.width) + .css("top", image_size.top) + .css("left", image_size.left); + $("#gFullSizeImage").height(image_size.height).width(image_size.width); + }); }; })(jQuery); -- cgit v1.2.3