summaryrefslogtreecommitdiff
path: root/lib/gallery.common.js
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-08-07 23:58:57 +0800
committerBharat Mediratta <bharat@menalto.com>2009-08-08 02:08:28 +0800
commita302a9c3fa7ec8d11373dc5eeb9c94400a255b1a (patch)
tree8717b8ac37b5df417e21ed1fc4af09f178875111 /lib/gallery.common.js
parent1591c3871a41b9b0ef240c227c6049de8ae066e3 (diff)
Refactor the gallery dialog into a jQuery widget
Signed-off-by: Bharat Mediratta <bharat@menalto.com>
Diffstat (limited to 'lib/gallery.common.js')
-rw-r--r--lib/gallery.common.js27
1 files changed, 22 insertions, 5 deletions
diff --git a/lib/gallery.common.js b/lib/gallery.common.js
index 1eaa6db2..e063462e 100644
--- a/lib/gallery.common.js
+++ b/lib/gallery.common.js
@@ -2,17 +2,15 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
-(function () {
+(function ($) {
$.fn.showMessage = 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) {
return this.each(function(i){
if (container == null) {
@@ -26,10 +24,8 @@
$(el).css('margin-top', nh);
});
};
-})(jQuery);
// Get the viewport size
-(function () {
$.getViewportSize = function() {
return {
width : function() {
@@ -40,4 +36,25 @@
}
};
};
+
+ /**
+ * Toggle the processing indicator, both large and small
+ * @param elementID Target ID, including #, to apply .gLoadingSize
+ */
+ $.fn.showLoading = 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);