summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gallery.common.css56
-rw-r--r--lib/gallery.common.js4
-rw-r--r--lib/gallery.dialog.js72
3 files changed, 87 insertions, 45 deletions
diff --git a/lib/gallery.common.css b/lib/gallery.common.css
index 601f6609..54453012 100644
--- a/lib/gallery.common.css
+++ b/lib/gallery.common.css
@@ -3,9 +3,10 @@
*
* Sheet organization:
* 1) Text
- * 2) States and interactions
- * 3) Positioning and order
- * 4) Reusable containers/widgets
+ * 2) Dimension and scale
+ * 3) States and interactions
+ * 4) Positioning and order
+ * 5) Containers/widgets
*/
/** *******************************************************************
@@ -24,8 +25,16 @@
text-align: right;
}
+
+/** *******************************************************************
+ * 2) Dimension and scale
+ **********************************************************************/
+
+.g-narrow {
+}
+
/** *******************************************************************
- * 2) States and interactions
+ * 3) States and interactions
**********************************************************************/
.g-active,
@@ -105,7 +114,7 @@ form .g-error {
}
/** *******************************************************************
- * 3) Positioning and order
+ * 4) Positioning and order
**********************************************************************/
.g-left {
@@ -131,10 +140,43 @@ form .g-error {
}
/** *******************************************************************
- * 4) Reusable containers/widgets
+ * 5) Containers/widgets
**********************************************************************/
-.g-dialog {
+#g-dialog {
+ text-align: left;
+}
+
+#g-dialog .g-narrow {
+ margin: 0 auto;
+ width: 270px;
+}
+
+#g-dialog fieldset {
+ border: none;
+}
+
+#g-dialog legend {
+ display: none;
+}
+
+#g-dialog form input[type="text"],
+#g-dialog form input[type="password"] {
+ width: 100%;
+}
+
+#g-dialog p {
+ margin: 0;
+}
+
+#g-dialog li {
+ padding-left: 0;
+}
+
+#g-dialog .g-cancel {
+ clear: none;
+ float: left;
+ margin: .3em 1em;
}
.g-button {
diff --git a/lib/gallery.common.js b/lib/gallery.common.js
index a91f021e..59482b22 100644
--- a/lib/gallery.common.js
+++ b/lib/gallery.common.js
@@ -53,7 +53,7 @@
return this.each(function(i){
var size;
switch ($(this).attr("id")) {
- case "#gDialog":
+ case "#g-dialog":
case "#gPanel":
size = "Large";
break;
@@ -133,7 +133,7 @@
function() {
if (in_progress == 0) {
$(this).find("ul").slideDown("fast", function() { in_progress = 1; });
- $(this).find(".gDialogLink").gallery_dialog();
+ $(this).find(".g-dialogLink").gallery_dialog();
$(this).find(".gAjaxLink").gallery_ajax();
}
},
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js
index 39c451e3..a70200f9 100644
--- a/lib/gallery.dialog.js
+++ b/lib/gallery.dialog.js
@@ -15,75 +15,75 @@
_show: function(sHref) {
var self = this;
- var eDialog = '<div id="gDialog"></div>';
+ var eDialog = '<div id="g-dialog"></div>';
$("body").append(eDialog);
if (!self.options.close) {
self.options.close = self.close_dialog;
}
- $("#gDialog").dialog(self.options);
+ $("#g-dialog").dialog(self.options);
- $("#gDialog").gallery_show_loading();
+ $("#g-dialog").gallery_show_loading();
$.get(sHref, function(data) {
- $("#gDialog").html(data).gallery_show_loading();
+ $("#g-dialog").html(data).gallery_show_loading();
- if ($("#gDialog form").length) {
- self.form_loaded(null, $("#gDialog form"));
+ if ($("#g-dialog form").length) {
+ self.form_loaded(null, $("#g-dialog form"));
}
self._layout();
- $("#gDialog").dialog("open");
+ $("#g-dialog").dialog("open");
// Remove titlebar for progress dialogs or set title
- if ($("#gDialog #gProgress").length) {
+ if ($("#g-dialog #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());
+ } else if ($("#g-dialog h1").length) {
+ $("#g-dialog").dialog('option', 'title', $("#g-dialog h1:eq(0)").html());
+ } else if ($("#g-dialog fieldset legend").length) {
+ $("#g-dialog").dialog('option', 'title', $("#g-dialog fieldset legend:eq(0)").html());
}
- if ($("#gDialog form").length) {
+ if ($("#g-dialog form").length) {
self._ajaxify_dialog();
}
});
- $("#gDialog").dialog("option", "self", self);
+ $("#g-dialog").dialog("option", "self", self);
},
_layout: function() {
var dialogWidth;
- var dialogHeight = $("#gDialog").height();
- var cssWidth = new String($("#gDialog form").css("width"));
+ var dialogHeight = $("#g-dialog").height();
+ var cssWidth = new String($("#g-dialog form").css("width"));
var childWidth = cssWidth.replace(/[^0-9]/g,"");
var size = $.gallery_get_viewport_size();
- if ($("#gDialog iframe").length) {
+ if ($("#g-dialog iframe").length) {
dialogWidth = size.width() - 100;
// Set the iframe width and height
- $("#gDialog iframe").width("100%").height(size.height() - 100);
- } else if ($("#gDialog .gDialogPanel").length) {
+ $("#g-dialog iframe").width("100%").height(size.height() - 100);
+ } else if ($("#g-dialog .g-dialogPanel").length) {
dialogWidth = size.width() - 100;
- $("#gDialog").dialog("option", "height", size.height() - 100);
+ $("#g-dialog").dialog("option", "height", size.height() - 100);
} else if (childWidth == "" || childWidth > 300) {
dialogWidth = 500;
}
- $("#gDialog").dialog('option', 'width', dialogWidth);
+ $("#g-dialog").dialog('option', 'width', dialogWidth);
},
form_loaded: function(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");
+ var eCancel = '<a href="#" class="g-cancel">' + MSG_CANCEL + '</a>';
+ if ($("#g-dialog .submit").length) {
+ $("#g-dialog .submit").addClass("ui-state-default ui-corner-all");
$.fn.gallery_hover_init();
- $("#gDialog .submit").parent().append(eCancel);
- $("#gDialog .gCancel").click(function(event) {
- $("#gDialog").dialog("close");
+ $("#g-dialog .submit").parent().append(eCancel);
+ $("#g-dialog .g-cancel").click(function(event) {
+ $("#g-dialog").dialog("close");
event.preventDefault();
});
}
- $("#gDialog .ui-state-default").hover(
+ $("#g-dialog .ui-state-default").hover(
function() {
$(this).addClass("ui-state-hover");
},
@@ -94,23 +94,23 @@
},
close_dialog: function(event, ui) {
- var self = $("#gDialog").dialog("option", "self");
- if ($("#gDialog form").length) {
- self._trigger("form_closing", null, $("#gDialog form"));
+ var self = $("#g-dialog").dialog("option", "self");
+ if ($("#g-dialog form").length) {
+ self._trigger("form_closing", null, $("#g-dialog form"));
}
- self._trigger("dialog_closing", null, $("#gDialog"));
- $("#gDialog").dialog("destroy").remove();
+ self._trigger("dialog_closing", null, $("#g-dialog"));
+ $("#g-dialog").dialog("destroy").remove();
},
_ajaxify_dialog: function() {
var self = this;
- $("#gDialog form").ajaxForm({
+ $("#g-dialog form").ajaxForm({
dataType: "json",
success: function(data) {
if (data.form) {
- $("#gDialog form").replaceWith(data.form);
+ $("#g-dialog form").replaceWith(data.form);
self._ajaxify_dialog();
- self.form_loaded(null, $("#gDialog form"));
+ self.form_loaded(null, $("#g-dialog form"));
if (typeof data.reset == 'function') {
eval(data.reset + '()');
}