')
diff --git a/main/webapp/modules/core/scripts/index/create-project-ui-source-selection.html b/main/webapp/modules/core/scripts/index/create-project-ui-source-selection.html
index 48bff8f37..866137c86 100644
--- a/main/webapp/modules/core/scripts/index/create-project-ui-source-selection.html
+++ b/main/webapp/modules/core/scripts/index/create-project-ui-source-selection.html
@@ -3,8 +3,8 @@
Create a project by importing data. What kinds of data files can I import?
TSV, CSV, *SV, Excel (.xls and .xlsx), JSON, XML, RDF as XML, and
- Google Spreadsheets are all supported. Support for other formats can
- be added with Refine extensions.
+ Google Data documents are all supported. Support for other formats can
+ be added with Google Refine extensions.
|
diff --git a/main/webapp/modules/core/scripts/index/create-project-ui.js b/main/webapp/modules/core/scripts/index/create-project-ui.js
index dee5d0528..7af543438 100644
--- a/main/webapp/modules/core/scripts/index/create-project-ui.js
+++ b/main/webapp/modules/core/scripts/index/create-project-ui.js
@@ -38,6 +38,10 @@ Refine.CreateProjectUI = function(elmt) {
this._sourceSelectionUIs = [];
this._customPanels = [];
this._controllers = [];
+
+ this._sourceSelectionElmt =
+ $(DOM.loadHTML("core", "scripts/index/create-project-ui-source-selection.html")).appendTo(this._elmt);
+ this._sourceSelectionElmts = DOM.bind(this._sourceSelectionElmt);
$.post(
"/command/core/get-importing-configuration",
@@ -52,12 +56,17 @@ Refine.CreateProjectUI = function(elmt) {
Refine.CreateProjectUI.controllers = [];
+Refine.CreateProjectUI.prototype.resize = function() {
+ var totalHeight = this._elmt.height();
+ var tabBodyContainer = $('#create-project-ui-source-selection-tab-bodies');
+ var selectedTabBody = $('.create-project-ui-source-selection-tab-body.selected');
+
+ var top = tabBodyContainer.position().top;
+ var tabBodyHeight = totalHeight - top - DOM.getVPaddings(selectedTabBody);
+ $('.create-project-ui-source-selection-tab-body').css('height', tabBodyHeight + 'px');
+};
+
Refine.CreateProjectUI.prototype._initializeUI = function() {
- this._sourceSelectionElmt =
- $(DOM.loadHTML("core", "scripts/index/create-project-ui-source-selection.html")).appendTo(this._elmt);
-
- this._sourceSelectionElmts = DOM.bind(this._sourceSelectionElmt);
-
for (var i = 0; i < Refine.CreateProjectUI.controllers.length; i++) {
this._controllers.push(new Refine.CreateProjectUI.controllers[i](this));
}
@@ -93,10 +102,10 @@ Refine.CreateProjectUI.prototype.selectImportSource = function(id) {
for (var i = 0; i < this._sourceSelectionUIs.length; i++) {
var sourceSelectionUI = this._sourceSelectionUIs[i];
if (sourceSelectionUI.id == id) {
- $('.create-project-ui-source-selection-tab-body').hide();
+ $('.create-project-ui-source-selection-tab-body').removeClass('selected').hide();
$('.create-project-ui-source-selection-tab').removeClass('selected');
- sourceSelectionUI._divBody.show();
+ sourceSelectionUI._divBody.addClass('selected').show();
sourceSelectionUI._divHeader.addClass('selected');
sourceSelectionUI.ui.focus();
diff --git a/main/webapp/modules/core/scripts/index/default-importing-controller/parsing-panel.js b/main/webapp/modules/core/scripts/index/default-importing-controller/parsing-panel.js
index 4757d8b4c..72d83b806 100644
--- a/main/webapp/modules/core/scripts/index/default-importing-controller/parsing-panel.js
+++ b/main/webapp/modules/core/scripts/index/default-importing-controller/parsing-panel.js
@@ -88,7 +88,7 @@ Refine.DefaultImportingController.prototype._prepareParsingPanel = function() {
});
this._parsingPanelElmts.progressPanel.hide();
- this._parsingPanelResizer = function() {console.log("here");
+ this._parsingPanelResizer = function() {
var elmts = self._parsingPanelElmts;
var width = self._parsingPanel.width();
var height = self._parsingPanel.height();
diff --git a/main/webapp/modules/core/scripts/index/import-project-ui.js b/main/webapp/modules/core/scripts/index/import-project-ui.js
index 4b4b161fb..d74f7ac2a 100644
--- a/main/webapp/modules/core/scripts/index/import-project-ui.js
+++ b/main/webapp/modules/core/scripts/index/import-project-ui.js
@@ -43,3 +43,7 @@ Refine.actionAreas.push({
label: "Import Project",
uiClass: Refine.ImportProjectUI
});
+
+Refine.ImportProjectUI.prototype.resize = function() {
+
+};
diff --git a/main/webapp/modules/core/scripts/index/open-project-ui.js b/main/webapp/modules/core/scripts/index/open-project-ui.js
index 77b5b420a..3d5e02365 100644
--- a/main/webapp/modules/core/scripts/index/open-project-ui.js
+++ b/main/webapp/modules/core/scripts/index/open-project-ui.js
@@ -39,19 +39,6 @@ Refine.OpenProjectUI = function(elmt) {
this._elmt = elmt;
this._elmts = DOM.bind(elmt);
- var resize = function() {
- var height = elmt.height();
- var width = elmt.width();
- var controlsHeight = self._elmts.workspaceControls.outerHeight();
- self._elmts.projectsContainer
- .css("height", (height - controlsHeight - DOM.getVPaddings(self._elmts.projectsContainer)) + "px");
- self._elmts.workspaceControls
- .css("bottom", "0px")
- .css("width", (width - DOM.getHPaddings(self._elmts.workspaceControls)) + "px")
- };
- $(window).resize(resize);
- window.setTimeout(resize, 100);
-
$("#project-file-input").change(function() {
if ($("#project-name-input")[0].value.length == 0) {
var fileName = this.files[0].fileName;
@@ -86,6 +73,19 @@ Refine.OpenProjectUI = function(elmt) {
this._fetchProjects();
};
+Refine.OpenProjectUI.prototype.resize = function() {
+ var height = this._elmt.height();
+ var width = this._elmt.width();
+ var controlsHeight = this._elmts.workspaceControls.outerHeight();
+
+ this._elmts.projectsContainer
+ .css("height", (height - controlsHeight - DOM.getVPaddings(this._elmts.projectsContainer)) + "px");
+
+ this._elmts.workspaceControls
+ .css("bottom", "0px")
+ .css("width", (width - DOM.getHPaddings(this._elmts.workspaceControls)) + "px")
+};
+
Refine.OpenProjectUI.prototype._fetchProjects = function() {
var self = this;
$.getJSON(
@@ -119,47 +119,41 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
var table = $(
'
' +
+ ' | ' +
+ ' | ' +
'Name | ' +
- ' | ' +
- ' | ' +
- 'Last modified | ' +
+ 'Last modified | ' +
'
'
).appendTo(container)[0];
- var formatDate = function(d) {
- var d = new Date(d);
- var last_year = Date.today().add({ years: -1 });
- var last_month = Date.today().add({ months: -1 });
- var last_week = Date.today().add({ days: -7 });
- var today = Date.today();
- var tomorrow = Date.today().add({ days: 1 });
-
- if (d.between(today, tomorrow)) {
- return "today " + d.toString("h:mm tt");
- } else if (d.between(last_week, today)) {
- var diff = Math.floor(today.getDayOfYear() - d.getDayOfYear());
- return (diff <= 1) ? ("yesterday " + d.toString("h:mm tt")) : (diff + " days ago");
- } else if (d.between(last_month, today)) {
- var diff = Math.floor((today.getDayOfYear() - d.getDayOfYear()) / 7);
- return (diff == 1) ? "a week ago" : diff.toFixed(0) + " weeks ago" ;
- } else if (d.between(last_year, today)) {
- var diff = Math.floor(today.getMonth() - d.getMonth());
- return (diff == 1) ? "a month ago" : diff + " months ago";
- } else {
- var diff = Math.floor(today.getYear() - d.getYear());
- return (diff == 1) ? "a year ago" : diff + " years ago";
- }
- };
-
var renderProject = function(project) {
var tr = table.insertRow(table.rows.length);
tr.className = "project";
- var nameLink = $('
')
- .addClass("list-table-itemname")
- .text(project.name)
- .attr("href", "/project?project=" + project.id)
- .appendTo(tr.insertCell(tr.cells.length));
+ var deleteLink = $('
')
+ .addClass("delete-project")
+ .attr("title","Delete this project")
+ .attr("href","")
+ .css("visibility", "hidden")
+ .html("
")
+ .click(function() {
+ if (window.confirm("Are you sure you want to delete project \"" + project.name + "\"?")) {
+ $.ajax({
+ type: "POST",
+ url: "/command/core/delete-project",
+ data: { "project" : project.id },
+ dataType: "json",
+ success: function (data) {
+ if (data && typeof data.code != 'undefined' && data.code == "ok") {
+ self._fetchProjects();
+ }
+ }
+ });
+ }
+ return false;
+ }).appendTo(
+ $(tr.insertCell(tr.cells.length)).css('width', '1%')
+ );
var renameLink = $('
')
.text("rename")
@@ -190,34 +184,19 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
}
}
});
- }).appendTo(tr.insertCell(tr.cells.length));
+ }).appendTo(
+ $(tr.insertCell(tr.cells.length)).css('width', '1%')
+ );
- var deleteLink = $('
')
- .addClass("delete-project")
- .attr("title","Delete this project")
- .attr("href","")
- .css("visibility", "hidden")
- .html("
")
- .click(function() {
- if (window.confirm("Are you sure you want to delete project \"" + project.name + "\"?")) {
- $.ajax({
- type: "POST",
- url: "/command/core/delete-project",
- data: { "project" : project.id },
- dataType: "json",
- success: function (data) {
- if (data && typeof data.code != 'undefined' && data.code == "ok") {
- self._fetchProjects();
- }
- }
- });
- }
- return false;
- }).appendTo(tr.insertCell(tr.cells.length));
+ var nameLink = $('
')
+ .addClass("list-table-itemname")
+ .text(project.name)
+ .attr("href", "/project?project=" + project.id)
+ .appendTo(tr.insertCell(tr.cells.length));
$('
')
- .html(formatDate(project.date))
+ .html(formatRelativeDate(project.date))
.addClass("last-modified")
.attr("title", project.date.toString())
.appendTo(tr.insertCell(tr.cells.length));
diff --git a/main/webapp/modules/core/scripts/util/misc.js b/main/webapp/modules/core/scripts/util/misc.js
index 2e465392e..2e1f2b84b 100644
--- a/main/webapp/modules/core/scripts/util/misc.js
+++ b/main/webapp/modules/core/scripts/util/misc.js
@@ -53,4 +53,32 @@ function cloneDeep(o) {
} else {
return o;
}
-}
\ No newline at end of file
+}
+
+function formatRelativeDate(d) {
+ var d = new Date(d);
+ var almost_last_year = Date.today().add({ months: -11 });
+ var last_month = Date.today().add({ months: -1 });
+ var last_week = Date.today().add({ days: -7 });
+ var today = Date.today();
+ var tomorrow = Date.today().add({ days: 1 });
+
+ if (d.between(today, tomorrow)) {
+ return "today " + d.toString("h:mm tt");
+ } else if (d.between(last_week, today)) {
+ var diff = Math.floor(today.getDayOfYear() - d.getDayOfYear());
+ return (diff <= 1) ? ("yesterday " + d.toString("h:mm tt")) : (diff + " days ago");
+ } else if (d.between(last_month, today)) {
+ var diff = Math.floor((today.getDayOfYear() - d.getDayOfYear()) / 7);
+ return (diff == 1) ? "a week ago" : diff.toFixed(0) + " weeks ago" ;
+ } else if (d.between(almost_last_year, today)) {
+ var diff = today.getMonth() - d.getMonth();
+ if (diff < 1) {
+ diff += 12;
+ }
+ return (diff == 1) ? "a month ago" : diff + " months ago";
+ } else {
+ var diff = Math.floor(today.getYear() - d.getYear());
+ return (diff == 1) ? "a year ago" : diff + " years ago";
+ }
+};
\ No newline at end of file
diff --git a/main/webapp/modules/core/styles/index.less b/main/webapp/modules/core/styles/index.less
index dcf614528..c60f5b5f5 100644
--- a/main/webapp/modules/core/styles/index.less
+++ b/main/webapp/modules/core/styles/index.less
@@ -114,4 +114,5 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
left: 0;
width: 100%;
height: 100%;
+ overflow: hidden;
}
diff --git a/main/webapp/modules/core/styles/index/create-project-ui.less b/main/webapp/modules/core/styles/index/create-project-ui.less
index 6361378a5..e4884e8c1 100644
--- a/main/webapp/modules/core/styles/index/create-project-ui.less
+++ b/main/webapp/modules/core/styles/index/create-project-ui.less
@@ -55,6 +55,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
border-collapse: collapse;
border-bottom: 1px solid @chrome_primary;
}
+#create-project-ui-source-selection-layout > tbody > tr > td {
+ vertical-align: top;
+ }
#create-project-ui-source-selection-tab-bodies {
background: white;
@@ -73,6 +76,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.create-project-ui-source-selection-tab-body {
padding: @padding_loose;
+ overflow: auto;
}
.create-project-ui-source-selection-tab {