\ No newline at end of file
diff --git a/main/webapp/modules/core/scripts/dialogs/extend-data-preview-dialog.js b/main/webapp/modules/core/scripts/dialogs/extend-data-preview-dialog.js
index f813c045b..a5a8323fd 100644
--- a/main/webapp/modules/core/scripts/dialogs/extend-data-preview-dialog.js
+++ b/main/webapp/modules/core/scripts/dialogs/extend-data-preview-dialog.js
@@ -6,51 +6,25 @@ function ExtendDataPreviewDialog(column, columnIndex, rowIndices, onDone) {
this._extension = { properties: [] };
var self = this;
- var frame = this._frame = DialogSystem.createDialog();
- frame.width("1000px").addClass("extend-data-preview-dialog");
-
- var header = $('').addClass("dialog-header").text("Add Columns from Freebase Based on Column " + column.name).appendTo(frame);
- var body = $('').addClass("dialog-body").appendTo(frame);
- var footer = $('').addClass("dialog-footer").appendTo(frame);
- var html = $(
- '
' +
- '
' +
- '
Add Property
' +
- '
Preview
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
Suggested Properties
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
'
- ).appendTo(body);
-
- this._elmts = DOM.bind(html);
-
+ this._dialog = $(DOM.loadHTML("core", "scripts/dialogs/extend-data-preview-dialog.html"));
+ this._elmts = DOM.bind(this._dialog);
+ this._elmts.dialogHeader.text("Add Columns from Freebase Based on Column " + column.name);
this._elmts.resetButton.click(function() {
self._extension.properties = [];
self._update();
});
- $('').html(" OK ").click(function() {
+ this._elmts.okButton.click(function() {
if (self._extension.properties.length === 0) {
alert("Please add some properties first.");
} else {
DialogSystem.dismissUntil(self._level - 1);
self._onDone(self._extension);
}
- }).appendTo(footer);
-
- $('').text("Cancel").click(function() {
+ });
+ this._elmts.cancelButton.click(function() {
DialogSystem.dismissUntil(self._level - 1);
- }).appendTo(footer);
+ });
var dismissBusy = DialogSystem.showBusy();
var type = "reconConfig" in column && "type" in column.reconConfig ? column.reconConfig.type.id : "/common/topic";
@@ -105,7 +79,7 @@ ExtendDataPreviewDialog.getAllProperties = function(typeID, onDone) {
};
ExtendDataPreviewDialog.prototype._show = function(properties) {
- this._level = DialogSystem.showDialog(this._frame);
+ this._level = DialogSystem.showDialog(this._dialog);
var n = this._elmts.suggestedPropertyContainer.offset().top +
this._elmts.suggestedPropertyContainer.outerHeight(true) -
diff --git a/main/webapp/modules/core/scripts/dialogs/freebase-loading-dialog.html b/main/webapp/modules/core/scripts/dialogs/freebase-loading-dialog.html
new file mode 100644
index 000000000..a1433649f
--- /dev/null
+++ b/main/webapp/modules/core/scripts/dialogs/freebase-loading-dialog.html
@@ -0,0 +1,24 @@
+
+
Load Data into Freebase
+
+
+
+
\ No newline at end of file
diff --git a/main/webapp/modules/core/scripts/dialogs/freebase-loading-dialog.js b/main/webapp/modules/core/scripts/dialogs/freebase-loading-dialog.js
index 1e1fead74..690ccee52 100644
--- a/main/webapp/modules/core/scripts/dialogs/freebase-loading-dialog.js
+++ b/main/webapp/modules/core/scripts/dialogs/freebase-loading-dialog.js
@@ -5,53 +5,26 @@ function FreebaseLoadingDialog() {
FreebaseLoadingDialog.prototype._createDialog = function() {
var self = this;
- var frame = DialogSystem.createDialog();
- frame.width("800px");
-
- var header = $('').addClass("dialog-header").text('Load Data into Freebase').appendTo(frame);
- var body = $('').addClass("dialog-body").appendTo(frame);
- var footer = $(
- ''
- ).appendTo(frame);
-
- this._elmts = DOM.bind(frame);
-
- var left_footer = this._elmts.left;
- var center_footer = this._elmts.center;
- var right_footer = this._elmts.right;
-
- var cancel_button = $('').text("Cancel").click(function() {
- self._dismiss();
- }).appendTo(left_footer);
-
- var authorization = $('
').addClass("freebase-loading-authorization").hide().appendTo(center_footer);
+ var dialog = $(DOM.loadHTML("core", "scripts/dialogs/freebase-loading-dialog.html"));
+ this._elmts = DOM.bind(dialog);
+ this._elmts.cancelButton.click(function() { self._dismiss(); });
+ this._elmts.selector.buttonset();
- var selector = $('').addClass("freebase-loading-graph-selector").html("Load this data into " +
- '' +
- ''
- ).buttonset().appendTo(right_footer);
-
- var load_button = $('').text("Load").appendTo(right_footer);
-
var provider = "www.freebase.com";
-
+ var authorization = this._elmts.authorization;
+ var loadButton = this._elmts.loadButton;
+
var check_authorization = function(cont) {
$.get("/command/check-authorization/" + provider, function(data) {
if ("status" in data && data.code == "/api/status/ok") {
authorization.html('Signed in as: ' + data.username + ' | Sign Out').show();
DOM.bind(authorization).signout.click(function() {
self._signedin = false;
- load_button.attr("disabled","disabled");
+ loadButton.attr("disabled","disabled");
$("#freebase-loading-graph-selector-freebase").attr("disabled","disabled").button("refresh");
Sign.signout(check_authorization,provider);
});
- load_button.unbind().click(function() {
+ loadButton.unbind().click(function() {
self._load();
});
self._signedin = true;
@@ -121,6 +94,7 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
{ protograph: JSON.stringify(theProject.protograph), engine: JSON.stringify(ui.browsingEngine.getJSON()) },
function(data) {
if ("tripleloader" in data) {
+ var body = self._elmts.dialogBody;
body.html(
'
\ No newline at end of file
diff --git a/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.js b/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.js
index 6e26a9401..2c3187efc 100644
--- a/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.js
+++ b/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.js
@@ -6,34 +6,8 @@ function TemplatingExporterDialog() {
TemplatingExporterDialog.prototype._createDialog = function() {
var self = this;
- var frame = DialogSystem.createDialog();
- frame.width("900px");
-
- var header = $('').addClass("dialog-header").text('Templating Export').appendTo(frame);
- var body = $('').addClass("dialog-body").appendTo(frame);
- var footer = $('