From 8e8231d8c6779affaf1d73953e9e97d6a338ce0f Mon Sep 17 00:00:00 2001 From: David Huynh Date: Sat, 16 Oct 2010 19:13:34 +0000 Subject: [PATCH] Fixed 'are you sure?' dialog box's styling. git-svn-id: http://google-refine.googlecode.com/svn/trunk@1583 7d457c2a-affb-35e4-300a-418c747d4874 --- .../scripts/dialogs/confirm-qa-dialog.html | 11 +++++++ .../dialogs/freebase-loading-dialog.js | 31 ++++++++----------- 2 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 extensions/freebase/module/scripts/dialogs/confirm-qa-dialog.html diff --git a/extensions/freebase/module/scripts/dialogs/confirm-qa-dialog.html b/extensions/freebase/module/scripts/dialogs/confirm-qa-dialog.html new file mode 100644 index 000000000..1f8e79bf3 --- /dev/null +++ b/extensions/freebase/module/scripts/dialogs/confirm-qa-dialog.html @@ -0,0 +1,11 @@ +
+
Are You Sure?
+
+ + +
Are you sure this data is ready to be tested for upload into Freebase?
+ +
\ No newline at end of file diff --git a/extensions/freebase/module/scripts/dialogs/freebase-loading-dialog.js b/extensions/freebase/module/scripts/dialogs/freebase-loading-dialog.js index 8e2e29aad..45b267c18 100644 --- a/extensions/freebase/module/scripts/dialogs/freebase-loading-dialog.js +++ b/extensions/freebase/module/scripts/dialogs/freebase-loading-dialog.js @@ -172,24 +172,19 @@ FreebaseLoadingDialog.prototype._load = function() { }; if (qa) { - var dialog = $( - '
' + - '
Are you sure this data is ready to be tested for upload into Freebase?
' + - '
' - ).dialog({ - resizable: false, - width: 400, - height: 230, - modal: true, - buttons: { - 'yes, I\'m sure': function() { - $(this).dialog('close'); - doLoad(); - }, - 'hmm, not really': function() { - $(this).dialog('close'); - } - } + var dialog = $(DOM.loadHTML("freebase", "scripts/dialogs/confirm-qa-dialog.html")); + var elmts = DOM.bind(dialog); + var level = DialogSystem.showDialog(dialog); + var dismiss = function() { + DialogSystem.dismissUntil(level - 1); + }; + + elmts.okButton.click(function() { + doLoad(); + dismiss(); + }); + elmts.cancelButton.click(function() { + dismiss(); }); } else { doLoad();