From 7f528c320df98f9a2974b0e4d8cef99dbee001a1 Mon Sep 17 00:00:00 2001 From: David Huynh Date: Fri, 19 Feb 2010 17:38:47 +0000 Subject: [PATCH] Implemented a "busy" indicator dialog, useful for preparatory steps like guessing types before showing the recon dialog. git-svn-id: http://google-refine.googlecode.com/svn/trunk@107 7d457c2a-affb-35e4-300a-418c747d4874 --- .../scripts/project/data-table-column-header-ui.js | 2 ++ src/main/webapp/scripts/util/dialog.js | 14 ++++++++++++++ src/main/webapp/styles/dialog.css | 11 ++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/scripts/project/data-table-column-header-ui.js b/src/main/webapp/scripts/project/data-table-column-header-ui.js index a4b51b2f7..5af49e111 100644 --- a/src/main/webapp/scripts/project/data-table-column-header-ui.js +++ b/src/main/webapp/scripts/project/data-table-column-header-ui.js @@ -377,10 +377,12 @@ DataTableColumnHeaderUI.prototype._doTextTransformPrompt = function() { DataTableColumnHeaderUI.prototype._doReconcile = function() { var self = this; + var dismissBusy = DialogSystem.showBusy(); $.post( "/command/guess-types-of-column?" + $.param({ project: theProject.id, columnName: this._column.headerLabel }), null, function(data) { + dismissBusy(); new ReconDialog(self._column, data.code == "ok" ? data.types : []); }, "json" diff --git a/src/main/webapp/scripts/util/dialog.js b/src/main/webapp/scripts/util/dialog.js index 9479772ce..0cee82866 100644 --- a/src/main/webapp/scripts/util/dialog.js +++ b/src/main/webapp/scripts/util/dialog.js @@ -53,3 +53,17 @@ DialogSystem.createDialog = function() { return $('
').addClass("dialog-frame"); }; +DialogSystem.showBusy = function(message) { + var frame = DialogSystem.createDialog(); + frame.width("300px").css("-moz-border-radius", "25px"); + + var body = $('
').addClass("dialog-busy-body").appendTo(frame); + $('').attr("src", "images/large-spinner.gif").appendTo(body); + $('').text(" " + (message || "Working...")).appendTo(body); + + var level = DialogSystem.showDialog(frame); + + return function() { + DialogSystem.dismissUntil(level - 1); + }; +}; diff --git a/src/main/webapp/styles/dialog.css b/src/main/webapp/styles/dialog.css index 3f2327975..c70d2f9b5 100644 --- a/src/main/webapp/styles/dialog.css +++ b/src/main/webapp/styles/dialog.css @@ -45,4 +45,13 @@ .dialog-footer button { margin-left: 5px; -} \ No newline at end of file +} + +.dialog-busy-body { + margin: 1em; + text-align: center; + font-size: 200%; + font-weight: bold; + color: #faa; +} +