summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php3
-rw-r--r--lib/gallery.common.js40
-rw-r--r--lib/gallery.dialog.js252
-rw-r--r--lib/gallery.panel.js116
-rw-r--r--lib/gallery.show_full_size.js140
-rw-r--r--modules/gallery/views/after_install.html.php2
-rw-r--r--modules/organize/js/organize.js2
-rw-r--r--modules/organize/js/organize_init.js2
-rw-r--r--modules/server_add/views/server_add_tree_dialog.html.php5
-rw-r--r--modules/tag/js/tag.js2
-rw-r--r--modules/user/helpers/user_theme.php8
-rw-r--r--modules/user/views/admin_users.html.php2
-rw-r--r--themes/admin_default/js/ui.init.js9
-rw-r--r--themes/default/js/ui.init.js10
-rw-r--r--themes/default/views/photo.html.php2
15 files changed, 305 insertions, 290 deletions
diff --git a/index.php b/index.php
index 7def7d16..d0e12cfc 100644
--- a/index.php
+++ b/index.php
@@ -21,7 +21,8 @@
define("IN_PRODUCTION", true);
// Gallery requires PHP 5.2+
-version_compare(PHP_VERSION, "5.2.3", "<") and exit("Gallery requires PHP 5.2.3 or newer.");
+version_compare(PHP_VERSION, "5.2.3", "<") and
+ exit("Gallery requires PHP 5.2.3 or newer (you're using " . PHP_VERSION . ")");
// Gallery requires short_tags to be on
!ini_get("short_open_tag") and exit("Gallery requires short_open_tag to be on.");
diff --git a/lib/gallery.common.js b/lib/gallery.common.js
index 1eaa6db2..7e6acad9 100644
--- a/lib/gallery.common.js
+++ b/lib/gallery.common.js
@@ -1,19 +1,13 @@
-/**
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-(function () {
- $.fn.showMessage = function(message) {
+(function ($) {
+ $.fn.gallery_show_message = function(message) {
return this.each(function(i){
$(this).effect("highlight", {"color": "white"}, 3000);
$(this).animate({opacity: 1.0}, 6000);
});
};
-})(jQuery);
-// Vertically align a block element's content
-(function () {
- $.fn.vAlign = function(container) {
+ // Vertically align a block element's content
+ $.fn.gallery_valign = function(container) {
return this.each(function(i){
if (container == null) {
container = 'div';
@@ -26,11 +20,9 @@
$(el).css('margin-top', nh);
});
};
-})(jQuery);
-// Get the viewport size
-(function () {
- $.getViewportSize = function() {
+ // Get the viewport size
+ $.gallery_get_viewport_size = function() {
return {
width : function() {
return $(window).width();
@@ -40,4 +32,24 @@
}
};
};
+
+ /**
+ * Toggle the processing indicator, both large and small
+ * @param elementID Target ID, including #, to apply .gLoadingSize
+ */
+ $.fn.gallery_show_loading = function() {
+ return this.each(function(i){
+ var size;
+ switch ($(this).attr("id")) {
+ case "#gDialog":
+ case "#gPanel":
+ size = "Large";
+ break;
+ default:
+ size = "Small";
+ break;
+ }
+ $(this).toggleClass("gLoading" + size);
+ });
+ };
})(jQuery);
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js
index 74c2f20e..51ebb21a 100644
--- a/lib/gallery.dialog.js
+++ b/lib/gallery.dialog.js
@@ -1,140 +1,136 @@
-/**
- * Fire openDialog() and prevent links from opening
- * @see openDialog()
- */
-function handleDialogEvent(event) {
- var target = event.currentTarget;
- if (!target) {
- target = event.srcElement;
- }
- openDialog(target);
- event.preventDefault();
-}
+(function($) {
+ $.widget("ui.gallery_dialog", {
+ _init: function() {
+ var self = this;
+ this.element.click(function(event){
+ event.preventDefault();
+ var element = event.currentTarget;
+ var sHref = $(element).attr("href");
+ var sTitle = $(element).attr("title");
+ var eDialog = '<div id="gDialog"></div>';
-function ajaxify_dialog() {
- $("#gDialog form").ajaxForm({
- dataType: "json",
- success: function(data) {
- if (data.form) {
- $("#gDialog form").replaceWith(data.form);
- ajaxify_dialog();
- on_form_loaded();
- if (typeof data.reset == 'function') {
- eval(data.reset + '()');
- }
- }
- if (data.result == "success") {
- if (data.location) {
- window.location = data.location;
- } else {
- window.location.reload();
- }
- }
- }
- });
-};
+ $("body").append(eDialog);
+
+ if (!self.options.close) {
+ self.options.close = self.close_dialog;
+ }
+ $("#gDialog").dialog(self.options);
-/**
- * Display modal dialogs, populate dialog with trigger link's href
- * @requires ui.core
- * @requires ui.draggable
- * @requires ui.resizable
- * @requires ui.dialog
- * @see handleDialogEvent()
- * @see showLoading()
- */
-function openDialog(element) {
- var sHref = $(element).attr("href");
- var sTitle = $(element).attr("title");
- var eDialog = '<div id="gDialog"></div>';
- var dialogWidth;
+ $("#gDialog").gallery_show_loading();
- $("body").append(eDialog);
+ $.get(sHref, function(data) {
+ $("#gDialog").html(data).gallery_show_loading();
- $("#gDialog").dialog({
- autoOpen: false,
- autoResize: true,
- modal: true,
- resizable: false,
- close: closeDialog
- });
+ if ($("#gDialog form").length) {
+ self._trigger("form_loaded", null, $("#gDialog form"));
+ }
+ self._layout();
- showLoading("#gDialog");
+ $("#gDialog").dialog("open");
+ // Remove titlebar for progress dialogs or set title
+ if ($("#gDialog #gProgress").length) {
+ $(".ui-dialog-titlebar").remove();
+ } else if ($("#gDialog h1").length) {
+ $("#gDialog").dialog('option', 'title', $("#gDialog h1:eq(0)").html());
+ } else if ($("#gDialog fieldset legend").length) {
+ $("#gDialog").dialog('option', 'title', $("#gDialog fieldset legend:eq(0)").html());
+ }
- $.get(sHref, function(data) {
- showLoading("#gDialog");
- $("#gDialog").html(data);
- var dialogHeight = $("#gDialog").height();
- var cssWidth = new String($("#gDialog form").css("width"));
- var childWidth = cssWidth.replace(/[^0-9]/g,"");
- if ($("#gDialog iframe").length) {
- dialogWidth = $(window).width() - 100;
- // Set the iframe width and height
- $("#gDialog iframe").width("100%");
- $("#gDialog iframe").height($(window).height() - 100);
- } else if (childWidth == "" || childWidth > 300) {
- dialogWidth = 500;
- }
- $("#gDialog").dialog('option', 'width', dialogWidth);
+ if ($("#gDialog form").length) {
+ self._ajaxify_dialog();
+ }
+ });
+ $("#gDialog").dialog("option", "self", self);
+ return false;
+ });
+ },
- on_form_loaded();
+ destroy: function() {
+ if ($("#gDialog form").length) {
+ this._trigger("form_closing", null, $("#gDialog form"));
+ }
+ this._trigger("dialog_closing", null, $("#gDialog"));
- $("#gDialog").dialog("open");
- // Remove titlebar for progress dialogs or set title
- if ($("#gDialog #gProgress").length) {
- $(".ui-dialog-titlebar").remove();
- } else if ($("#gDialog h1").length) {
- $("#gDialog").dialog('option', 'title', $("#gDialog h1:eq(0)").html());
- } else if ($("#gDialog fieldset legend").length) {
- $("#gDialog").dialog('option', 'title', $("#gDialog fieldset legend:eq(0)").html());
- }
+ $("#gDialog").dialog("destroy").remove();
+ },
+
+ _layout: function() {
+ var dialogWidth;
+ var dialogHeight = $("#gDialog").height();
+ var cssWidth = new String($("#gDialog form").css("width"));
+ var childWidth = cssWidth.replace(/[^0-9]/g,"");
+ if ($("#gDialog iframe").length) {
+ dialogWidth = $(window).width() - 100;
+ // Set the iframe width and height
+ $("#gDialog iframe").width("100%").height($(window).height() - 100);
+ } else if (childWidth == "" || childWidth > 300) {
+ dialogWidth = 500;
+ }
+ $("#gDialog").dialog('option', 'width', dialogWidth);
+ },
+
+ form_loaded: function event(event, ui) {
+ // Should be defined (and localized) in the theme
+ MSG_CANCEL = MSG_CANCEL || 'Cancel';
+ var eCancel = '<a href="#" class="gCancel">' + MSG_CANCEL + '</a>';
+ if ($("#gDialog .submit").length) {
+ $("#gDialog .submit").addClass("ui-state-default ui-corner-all");
+ $("#gDialog .submit").parent().append(eCancel);
+ $("#gDialog .gCancel").click(function(event) {
+ $("gDialog").dialog("close");
+ event.preventDefault();
+ });
+ }
+ $("#gDialog .ui-state-default").hover(
+ function() {
+ $(this).addClass("ui-state-hover");
+ },
+ function() {
+ $(this).removeClass("ui-state-hover");
+ }
+ );
+ },
- ajaxify_dialog();
- });
- return false;
-}
+ close_dialog: function (event, ui) {
+ var self = $("#gDialog").dialog("option", "self");
+ self.destroy();
+ },
-function on_form_loaded() {
- // Should be defined (and localized) in the theme
- MSG_CANCEL = MSG_CANCEL || 'Cancel';
- var eCancel = '<a href="javascript: closeDialog()" class="gCancel">' + MSG_CANCEL + '</a>';
- if ($("#gDialog .submit").length) {
- $("#gDialog .submit").addClass("ui-state-default ui-corner-all");
- $("#gDialog .submit").parent().append(eCancel);
- }
- $("#gDialog").dialog("option", "form", $("#gDialog form"));
- $("#gDialog .ui-state-default").hover(
- function() {
- $(this).addClass("ui-state-hover");
- },
- function() {
- $(this).removeClass("ui-state-hover");
- }
- );
-}
+ _ajaxify_dialog: function() {
+ var self = this;
+ $("#gDialog form").ajaxForm({
+ dataType: "json",
+ success: function(data) {
+ if (data.form) {
+ $("#gDialog form").replaceWith(data.form);
+ self._ajaxify_dialog();
+ self._trigger("form_loaded", null, $("#gDialog form"));
+ if (typeof data.reset == 'function') {
+ eval(data.reset + '()');
+ }
+ }
+ if (data.result == "success") {
+ if (data.location) {
+ window.location = data.location;
+ } else {
+ window.location.reload();
+ }
+ }
+ }
+ });
+ },
-function closeDialog() {
- var form = $("#gDialog").dialog("option", "form");
- if (form != null) {
- $("#gDialog").dialog("option", "form").trigger("form_closing");
- }
- $("#gDialog").dialog("destroy").remove();
-}
+ form_closing: function(event, ui) {},
+ dialog_closing: function(event, ui) {}
+ });
-/**
- * Toggle the processing indicator, both large and small
- * @param elementID Target ID, including #, to apply .gLoadingSize
- */
-function showLoading(elementID) {
- var size;
- switch (elementID) {
- case "#gDialog":
- case "#gPanel":
- size = "Large";
- break;
- default:
- size = "Small";
- break;
- }
- $(elementID).toggleClass("gLoading" + size);
-}
+ $.extend($.ui.gallery_dialog, {
+ defaults: {
+ autoOpen: false,
+ autoResize: true,
+ modal: true,
+ resizable: false,
+ position: "center"
+ }
+ });
+})(jQuery);
diff --git a/lib/gallery.panel.js b/lib/gallery.panel.js
index 022e4878..e0bf4259 100644
--- a/lib/gallery.panel.js
+++ b/lib/gallery.panel.js
@@ -1,62 +1,58 @@
-/**
- * Fire togglePanel() and prevent links from opening
- * @see togglePanel()
- */
-function handlePanelEvent(event) {
- togglePanel(event.currentTarget);
- event.preventDefault();
-}
+(function($) {
+ $.widget("ui.gallery_panel", {
+ _init: function() {
+ var self = this;
+ this.element.click(function(event) {
+ event.preventDefault();
+ var element = event.currentTarget;
+ var parent = $(element).parent().parent();
+ var sHref = $(element).attr("href");
+ var parentClass = $(parent).attr("class");
+ var ePanel = "<tr id=\"gPanel\"><td colspan=\"6\"></td></tr>";
-function togglePanel(element, on_success) {
- var parent = $(element).parent().parent();
- var sHref = $(element).attr("href");
- var parentClass = $(parent).attr("class");
- var ePanel = "<tr id=\"gPanel\"><td colspan=\"6\"></td></tr>";
+ if ($("#gPanel").length) {
+ $("#gPanel").slideUp("slow").remove();
+ if ($(element).attr("orig_text")) {
+ $(element).children(".gButtonText").text($(element).attr("orig_text"));
+ }
+ } else {
+ $(parent).after(ePanel);
+ $("#gPanel td").html(sHref);
+ $.get(sHref, function(data) {
+ $("#gPanel td").html(data);
+ self._ajaxify_panel();
+ if ($(element).attr("open_text")) {
+ $(element).attr("orig_text", $(element).children(".gButtonText").text());
+ $(element).children(".gButtonText").text($(element).attr("open_text"));
+ }
+ $("#gPanel").addClass(parentClass).show().slideDown("slow");
+ });
+ }
+ return false;
+ });
+ },
- if ($("#gPanel").length) {
- $("#gPanel").slideUp("slow");
- $("#gPanel *").remove();
- $("#gPanel").remove();
- if ($(element).attr("orig_text")) {
- $(element).children(".gButtonText").text($(element).attr("orig_text"));
- }
- //togglePanel(element, on_success);
- } else {
- $(parent).after(ePanel);
- //showLoading("#here");
- $("#gPanel td").html(sHref);
- $("#gPanel").addClass(parentClass).show().slideDown("slow");
- $.get(sHref, function(data) {
- $("#gPanel td").html(data);
- ajaxify_panel = function() {
- $("#gPanel td form").ajaxForm({
- dataType: "json",
- success: function(data) {
- if (data.form) {
- $("#gPanel td form").replaceWith(data.form);
- ajaxify_panel();
- }
- if (data.result == "success") {
- if (on_success) {
- on_success();
- } else if (data.location) {
- window.location = data.location;
- } else {
- window.location.reload();
- }
- }
- }
- });
- if ($("#gPanel td").hasClass("gLoadingLarge")) {
- showLoading("#gPanel td");
- }
- };
- ajaxify_panel();
- if ($(element).attr("open_text")) {
- $(element).attr("orig_text", $(element).children(".gButtonText").text());
- $(element).children(".gButtonText").text($(element).attr("open_text"));
- }
- });
- }
- return false;
-}
+ _ajaxify_panel: function () {
+ var self = this;
+ $("#gPanel td form").ajaxForm({
+ dataType: "json",
+ success: function(data) {
+ if (data.form) {
+ $("#gPanel td form").replaceWith(data.form);
+ self._ajaxify_panel();
+ }
+ if (data.result == "success") {
+ self._trigger("success", null, {});
+ if (data.location) {
+ window.location = data.location;
+ } else {
+ window.location.reload();
+ }
+ }
+ }
+ });
+ },
+
+ success: function(event, ui) {}
+ });
+ })(jQuery);
diff --git a/lib/gallery.show_full_size.js b/lib/gallery.show_full_size.js
index 8b271db9..c32195f6 100644
--- a/lib/gallery.show_full_size.js
+++ b/lib/gallery.show_full_size.js
@@ -1,76 +1,78 @@
-/**
- * @todo Move inline CSS out to external style sheet (theme style sheet)
- */
-var 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;
+(function($) {
+ /**
+ * @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;
- }
+ /* 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)
- };
- }
+ // 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 width = $(document).width();
+ var height = $(document).height();
- $("body").append('<div id="gFullsizeOverlay" class="ui-dialog-overlay" ' +
- 'style="border: none; margin: 0; padding: 0; background-color: #000; ' +
- 'position: absolute; top: 0px; left: 0px; ' +
- 'width: ' + width + 'px; height: ' + height + 'px; opacity: 0.7; filter: alpha(opacity=70);' +
- '-moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; ' +
- '-moz-background-inline-policy: -moz-initial; z-index: 1001;"> </div>');
+ $("body").append('<div id="gFullsizeOverlay" class="ui-dialog-overlay" ' +
+ 'style="border: none; margin: 0; padding: 0; background-color: #000; ' +
+ 'position: absolute; top: 0px; left: 0px; ' +
+ 'width: ' + width + 'px; height: ' + height + 'px; opacity: 0.7; filter: alpha(opacity=70);' +
+ '-moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; ' +
+ '-moz-background-inline-policy: -moz-initial; z-index: 1001;"> </div>');
- var image_size = _auto_fit(image_width, image_height);
+ var image_size = _auto_fit(image_width, image_height);
- $("body").append('<div id="gFullsize" class="ui-dialog ui-widget" ' +
- 'style="overflow: hidden; display: block; ' +
- 'position: absolute; z-index: 1002; outline-color: -moz-use-text-color; ' +
- 'outline-style: none; outline-width: 0px; ' +
- 'height: ' + image_size.height + 'px; ' +
- 'width: ' + image_size.width + 'px; ' +
- 'top: ' + image_size.top + 'px; left: ' + image_size.left + 'px;">' +
- '<img id="gFullSizeImage" src="' + image_url + '"' +
- 'height="' + image_size.height + '" width="' + image_size.width + '"/></div>');
+ $("body").append('<div id="gFullsize" class="ui-dialog ui-widget" ' +
+ 'style="overflow: hidden; display: block; ' +
+ 'position: absolute; z-index: 1002; outline-color: -moz-use-text-color; ' +
+ 'outline-style: none; outline-width: 0px; ' +
+ 'height: ' + image_size.height + 'px; ' +
+ 'width: ' + image_size.width + 'px; ' +
+ 'top: ' + image_size.top + 'px; left: ' + image_size.left + 'px;">' +
+ '<img id="gFullSizeImage" src="' + image_url + '"' +
+ 'height="' + image_size.height + '" width="' + image_size.width + '"/></div>');
- $("#gFullsize").append('<span id="gFullsizeClose" class="fg-button ui-icon ui-state-default ' +
- 'ui-icon-closethick ui-corner-all" style="z-index: 1003; position: absolute; ' +
- 'right: 1em; top: 1em;"></span>');
- $("#gFullsizeClose").click(function() {
- $("#gFullsizeOverlay*").remove();
- $("#gFullsize").remove();
- });
- $(window).resize(function() {
- $("#gFullsizeOverlay").width($(document).width());
- $("#gFullsizeOverlay").height($(document).height());
- image_size = _auto_fit(image_width, image_height);
- $("#gFullsize").height(image_size.height);
- $("#gFullsize").width(image_size.width);
- $("#gFullsize").css("top", image_size.top);
- $("#gFullsize").css("left", image_size.left);
- $("#gFullSizeImage").height(image_size.height);
- $("#gFullSizeImage").width(image_size.width);
- });
-};
+ $("#gFullsize").append('<span id="gFullsizeClose" class="fg-button ui-icon ui-state-default ' +
+ 'ui-icon-closethick ui-corner-all" style="z-index: 1003; position: absolute; ' +
+ 'right: 1em; top: 1em;"></span>');
+ $("#gFullsizeClose").click(function() {
+ $("#gFullsizeOverlay*").remove();
+ $("#gFullsize").remove();
+ });
+ $(window).resize(function() {
+ $("#gFullsizeOverlay").width($(document).width())
+ .height($(document).height());
+ image_size = _auto_fit(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);
diff --git a/modules/gallery/views/after_install.html.php b/modules/gallery/views/after_install.html.php
index e4842163..bfce46f0 100644
--- a/modules/gallery/views/after_install.html.php
+++ b/modules/gallery/views/after_install.html.php
@@ -16,7 +16,7 @@
title="<?= t("Edit Your Profile") ?>"
id="gAfterInstallChangePasswordLink" class="gButtonLink ui-state-default ui-corners-all"><?= t("Change Password Now") ?></a>
<script>
- $("#gAfterInstallChangePasswordLink").bind("click", handleDialogEvent);
+ $("#gAfterInstallChangePasswordLink").gallery_dialog();
</script>
</p>
diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js
index f10cbcc9..31657d3a 100644
--- a/modules/organize/js/organize.js
+++ b/modules/organize/js/organize.js
@@ -391,7 +391,7 @@ function organize_dialog_init() {
$(".gBranchText").droppable(treeDroppable);
$(".gBranchText").click(organizeOpenFolder);
retrieveMicroThumbs(item_id);
- //showLoading("#gDialog");
+ //$.gallery_show_loading("#gDialog");
$("#gMicroThumbPanel").droppable(thumbDroppable);
$("#gMicroThumbPanel").selectable(selectable);
diff --git a/modules/organize/js/organize_init.js b/modules/organize/js/organize_init.js
index ed036fdb..30bc78dd 100644
--- a/modules/organize/js/organize_init.js
+++ b/modules/organize/js/organize_init.js
@@ -17,7 +17,7 @@ $("document").ready(function() {
zIndex: 75
});
- //showLoading("#gDialog");
+ //$.gallery_show_loading("#gDialog");
$.get(href, function(data) {
$("#gDialog").html(data);
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 @@
<?= t("Add") ?>
</button>
- <button class="ui-state-default ui-corner-all" onclick="closeDialog(); window.location.reload();">
+ <button id="gServerCloseButton" class="ui-state-default ui-corner-all">
<?= t("Close") ?>
</button>
</span>
@@ -48,6 +48,9 @@
progressbar("value", 0);
$("#gProgress").slideDown("fast", function() { start_add() });
});
+ $("#gServerCloseButton").click(function(event) {
+ $("#gDialog").dialog("close");
+ });
});
</script>
diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js
index 765c2a35..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).bind("click", handleDialogEvent);
+ $(".gDialogLink", li).gallery_dialog();
}
}
diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php
index 69042aed..8de2d248 100644
--- a/modules/user/helpers/user_theme.php
+++ b/modules/user/helpers/user_theme.php
@@ -19,8 +19,10 @@
*/
class user_theme_Core {
static function header_top($theme) {
- $view = new View("login.html");
- $view->user = user::active();
- return $view->render();
+ if ($theme->page_type != "login") {
+ $view = new View("login.html");
+ $view->user = user::active();
+ return $view->render();
+ }
}
}
diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php
index 542b8b8b..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").bind("click", handleDialogEvent);
+ $("#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 06cc1cd5..e52f0c4c 100644
--- a/themes/admin_default/js/ui.init.js
+++ b/themes/admin_default/js/ui.init.js
@@ -1,5 +1,4 @@
$(document).ready(function(){
-
// Initialize Superfish menus
$("#gSiteAdminMenu ul.gMenu").addClass("sf-menu");
$("ul.gMenu").addClass("sf-menu");
@@ -15,17 +14,17 @@ $(document).ready(function(){
$("#gSiteAdminMenu").css("display", "block");
// Initialize status message effects
- $("#gMessage li").showMessage();
+ $("#gMessage li").gallery_show_message();
// Initialize modal dialogs
- $(".gDialogLink").bind("click", handleDialogEvent);
+ $(".gDialogLink").gallery_dialog();
// Initialize panels
- $(".gPanelLink").bind("click", handlePanelEvent);
+ $(".gPanelLink").gallery_panel();
if ($("#gPhotoStream").length) {
// Vertically align thumbs in photostream
- $(".gItem").vAlign();
+ $(".gItem").gallery_valign();
}
// Apply jQuery UI button css to submit inputs
diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js
index 8fee6634..f86c8df4 100644
--- a/themes/default/js/ui.init.js
+++ b/themes/default/js/ui.init.js
@@ -1,3 +1,4 @@
+#
/**
* Initialize jQuery UI and Plugin elements
*
@@ -29,11 +30,11 @@ $(document).ready(function() {
$("#gSiteMenu").css("display", "block");
// Initialize status message effects
- $("#gMessage li").showMessage();
+ $("#gMessage li").gallery_show_message();
// Initialize dialogs
$("#gLoginLink").addClass("gDialogLink");
- $(".gDialogLink").bind("click", handleDialogEvent);
+ $(".gDialogLink").gallery_dialog();
// Initialize view menu
if ($("#gViewMenu").length) {
@@ -52,7 +53,10 @@ $(document).ready(function() {
// Album view only
if ($("#gAlbumGrid").length) {
// Vertical align thumbnails/metadata in album grid
- $(".gItem").vAlign();
+ $(".gItem").gallery_valign();
+ $(".gQuick").ajaxStop(function(){
+ $(".gItem").gallery_valign();
+ });
}
// Photo/Item item view only
diff --git a/themes/default/views/photo.html.php b/themes/default/views/photo.html.php
index cf8bebdd..453417dc 100644
--- a/themes/default/views/photo.html.php
+++ b/themes/default/views/photo.html.php
@@ -5,7 +5,7 @@
<script>
$(document).ready(function() {
$(".gFullSizeLink").click(function() {
- show_full_size("<?= $theme->item()->file_url() ?>", "<?= $theme->item()->width ?>", "<?= $theme->item()->height ?>");
+ $.gallery_show_full_size("<?= $theme->item()->file_url() ?>", "<?= $theme->item()->width ?>", "<?= $theme->item()->height ?>");
return false;
});
});