diff --git a/main/.classpath b/main/.classpath index 259b0c5eb..ae1ef41af 100644 --- a/main/.classpath +++ b/main/.classpath @@ -38,6 +38,6 @@ - + diff --git a/main/webapp/WEB-INF/lib-src/butterfly-trunk-r25-sources.jar b/main/webapp/WEB-INF/lib-src/butterfly-trunk-r26-sources.jar similarity index 66% rename from main/webapp/WEB-INF/lib-src/butterfly-trunk-r25-sources.jar rename to main/webapp/WEB-INF/lib-src/butterfly-trunk-r26-sources.jar index 03c8386de..e0e354092 100644 Binary files a/main/webapp/WEB-INF/lib-src/butterfly-trunk-r25-sources.jar and b/main/webapp/WEB-INF/lib-src/butterfly-trunk-r26-sources.jar differ diff --git a/main/webapp/WEB-INF/lib/butterfly-trunk-r25.jar b/main/webapp/WEB-INF/lib/butterfly-trunk-r26.jar similarity index 61% rename from main/webapp/WEB-INF/lib/butterfly-trunk-r25.jar rename to main/webapp/WEB-INF/lib/butterfly-trunk-r26.jar index 55d149609..399fa017b 100644 Binary files a/main/webapp/WEB-INF/lib/butterfly-trunk-r25.jar and b/main/webapp/WEB-INF/lib/butterfly-trunk-r26.jar differ diff --git a/main/webapp/modules/core/MOD-INF/controller.js b/main/webapp/modules/core/MOD-INF/controller.js index b6f876bfa..f2ab6558f 100644 --- a/main/webapp/modules/core/MOD-INF/controller.js +++ b/main/webapp/modules/core/MOD-INF/controller.js @@ -18,6 +18,8 @@ function init() { "project/scripts", module, [ + "wirings.js", + "externals/jquery-1.4.2.min.js", "externals/jquery.cookie.js", "externals/suggest/suggest-1.2.min.js", @@ -111,18 +113,29 @@ function init() { * This is the function that is invoked by Butterfly */ function process(path, request, response) { - if (path.endsWith("/")) { - path = path.substring(0, path.length - 1); - } + if (path == "wirings.js") { + var wirings = butterfly.getWirings(request); + butterfly.sendString( + request, + response, + "var ModuleWirings = " + butterfly.toJSONString(wirings) + ";", + encoding, + "text/javascript" + ); + } else { + if (path.endsWith("/")) { + path = path.substring(0, path.length - 1); + } - var slash = path.lastIndexOf("/"); - var lastSegment = slash >= 0 ? path.substring(slash + 1) : path; - if (lastSegment in templatedFiles) { - var context = {}; - context.scripts = ClientSideResourceManager.getPaths(lastSegment + "/scripts"); - context.styles = ClientSideResourceManager.getPaths(lastSegment + "/styles"); + var slash = path.lastIndexOf("/"); + var lastSegment = slash >= 0 ? path.substring(slash + 1) : path; + if (lastSegment in templatedFiles) { + var context = {}; + context.scripts = ClientSideResourceManager.getPaths(lastSegment + "/scripts"); + context.styles = ClientSideResourceManager.getPaths(lastSegment + "/styles"); - send(request, response, path + ".vt", context); + send(request, response, path + ".vt", context); + } } } diff --git a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.html b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.html new file mode 100644 index 000000000..533d3d242 --- /dev/null +++ b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.html @@ -0,0 +1,57 @@ +
+
+
+
+ + + + + + + + + + +
+ Method: + + +
Keying Function:
+ +
+ + + +
+
+
+
+ +
\ No newline at end of file diff --git a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js index d43e492b3..1742fc611 100644 --- a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js @@ -13,62 +13,10 @@ function ClusteringDialog(columnName, expression) { ClusteringDialog.prototype._createDialog = function() { var self = this; - var frame = DialogSystem.createDialog(); - frame.width("900px"); - - var header = $('
').addClass("dialog-header").text('Cluster & Edit column "' + this._columnName + '"').appendTo(frame); - var body = $('
').addClass("dialog-body").appendTo(frame); - var footer = $( - '' - ).appendTo(frame); - - var html = $( - '
' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '
' + - 'Method: ' + - '' + - '
Keying Function:
' + - '' + - '
' + - '' + - '' + - '' + - '
' + - '
' + - '
' - ).appendTo(body); - - this._elmts = DOM.bind(html); + var dialog = $(DOM.loadHTML("core", "scripts/dialogs/clustering-dialog.html")); + + this._elmts = DOM.bind(dialog); + this._elmts.dialogHeader.text('Cluster & Edit column "' + this._columnName + '"'); this._elmts.methodSelector.change(function() { var selection = $(this).find("option:selected").text(); @@ -116,19 +64,13 @@ ClusteringDialog.prototype._createDialog = function() { this._elmts.radius.change(params_changer); this._elmts.ngramBlock.change(params_changer); - var left_footer = footer.find(".left"); - $('').text("Select All").click(function() { self._selectAll(); }).appendTo(left_footer); - $('').text("Deselect All").click(function() { self._deselectAll(); }).appendTo(left_footer); + this._elmts.selectAllButton.click(function() { self._selectAll(); }); + this._elmts.deselectAllButton.click(function() { self._deselectAll(); }); + this._elmts.applyReClusterButton.click(function() { self._onApplyReCluster(); }); + this._elmts.applyCloseButton.click(function() { self._onApplyClose(); }); + this._elmts.closeButton.click(function() { self._dismiss(); }); - var right_footer = footer.find(".right"); - $('').text("Apply & Re-Cluster").click(function() { self._onApplyReCluster(); }).appendTo(right_footer); - $('').text("Apply & Close").click(function() { self._onApplyClose(); }).appendTo(right_footer); - $('').text("Close").click(function() { self._dismiss(); }).appendTo(right_footer); - - this._level = DialogSystem.showDialog(frame); - - $("#recon-dialog-tabs").tabs(); - $("#recon-dialog-tabs-strict").css("display", ""); + this._level = DialogSystem.showDialog(dialog); }; ClusteringDialog.prototype._renderTable = function(clusters) { @@ -248,7 +190,6 @@ ClusteringDialog.prototype._renderTable = function(clusters) { '
No clusters were found with the selected method
Try selecting another method above or changing its parameters
' ); } - }; ClusteringDialog.prototype._cluster = function() { diff --git a/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.html b/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.html new file mode 100644 index 000000000..ecbb39ed9 --- /dev/null +++ b/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.html @@ -0,0 +1,35 @@ +
+ + + + + + + + + + + + +
ExpressionLanguage
Row Template
Row Separator
Suffix
+ +
+ + + ' + + + \ 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 = $('
').addClass("dialog-footer").appendTo(frame); - - body.html( - '
' + - '' + - '' + - '' + - '' + - '
' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '
Prefix
Row Template
Row Separator
Suffix
' + - '
' + - '
' - ); - - this._elmts = DOM.bind(body); + var dialog = $(DOM.loadHTML("core", "scripts/dialogs/templating-exporter-dialog.html")); + this._elmts = DOM.bind(dialog); this._elmts.controls.find("textarea").keyup(function() { self._scheduleUpdate(); }); this._elmts.prefixTextarea[0].value = '{\n "rows" : [\n'; @@ -44,10 +18,10 @@ TemplatingExporterDialog.prototype._createDialog = function() { return '\n "' + column.name + '" : {{jsonize(cells["' + column.name + '"].value)}}'; }).join(',') + '\n }'; - $('').text("Export").click(function() { self._export(); self._dismiss(); }).appendTo(footer); - $('').text("Close").click(function() { self._dismiss(); }).appendTo(footer); - - this._level = DialogSystem.showDialog(frame); + this._elmts.exportButton.click(function() { self._export(); self._dismiss(); }); + this._elmts.cancelButton.click(function() { self._dismiss(); }); + + this._level = DialogSystem.showDialog(dialog); }; TemplatingExporterDialog.prototype._scheduleUpdate = function() { diff --git a/main/webapp/modules/core/scripts/util/dom.js b/main/webapp/modules/core/scripts/util/dom.js index a3fc6c224..99a5c3371 100644 --- a/main/webapp/modules/core/scripts/util/dom.js +++ b/main/webapp/modules/core/scripts/util/dom.js @@ -14,7 +14,6 @@ DOM._bindDOMElement = function(elmt, map) { var bind = elmt.getAttribute("bind"); if (bind !== null && bind.length > 0) { map[bind] = $(elmt); - elmt.removeAttribute("bind"); } if (elmt.hasChildNodes()) { @@ -31,4 +30,20 @@ DOM._bindDOMChildren = function(elmt, map) { } node = node2; } -}; \ No newline at end of file +}; + +DOM._loadedHTML = {}; +DOM.loadHTML = function(module, path) { + var fullPath = ModuleWirings[module] + path; + if (!(fullPath in DOM._loadedHTML)) { + $.ajax({ + async: false, + url: fullPath, + dataType: "html", + success: function(html) { + DOM._loadedHTML[fullPath] = html; + } + }) + } + return DOM._loadedHTML[fullPath]; +};