populate the row number.\n sort the project index

This commit is contained in:
Jacky 2017-11-03 16:59:03 -04:00
parent 68bf4f962c
commit edc3df1ad1
3 changed files with 10 additions and 4 deletions

View File

@ -287,6 +287,8 @@ public class FileProjectManager extends ProjectManager {
if (metadata != null) { if (metadata != null) {
jsonWriter.value(id); jsonWriter.value(id);
if (metadata.isDirty()) { if (metadata.isDirty()) {
Project project = ProjectManager.singleton.getProject(id);
metadata.setRowNumber(project.rows.size());
ProjectMetadataUtilities.save(metadata, getProjectDir(id)); ProjectMetadataUtilities.save(metadata, getProjectDir(id));
saveWasNeeded = true; saveWasNeeded = true;
} }

View File

@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var html = "text/html"; var html = "text/html";
var encoding = "UTF-8"; var encoding = "UTF-8";
var ClientSideResourceManager = Packages.com.google.refine.ClientSideResourceManager; var ClientSideResourceManager = Packages.com.google.refine.ClientSideResourceManager;
var bundle = false; var bundle = true;
var templatedFiles = { var templatedFiles = {
// Requests with last path segments mentioned here // Requests with last path segments mentioned here
@ -319,6 +319,7 @@ function init() {
"externals/jquery-ui/jquery-ui-1.10.3.custom.js", "externals/jquery-ui/jquery-ui-1.10.3.custom.js",
"externals/date.js", "externals/date.js",
"externals/jquery.i18n.js", "externals/jquery.i18n.js",
"externals/tablesorter/jquery.tablesorter.min.js",
"scripts/util/misc.js", "scripts/util/misc.js",
"scripts/util/url.js", "scripts/util/url.js",
@ -362,6 +363,7 @@ function init() {
module, module,
[ [
"externals/jquery-ui/css/ui-lightness/jquery-ui-1.10.3.custom.css", "externals/jquery-ui/css/ui-lightness/jquery-ui-1.10.3.custom.css",
"externals/tablesorter/theme.blue.css",
"styles/jquery-ui-overrides.less", "styles/jquery-ui-overrides.less",
"styles/common.less", "styles/common.less",
"styles/pure.css", "styles/pure.css",

View File

@ -120,7 +120,7 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
Refine.selectActionArea('open-project'); Refine.selectActionArea('open-project');
var table = $( var table = $(
'<table class="list-table"><tr>' + '<table class="tablesorter-blue list-table"><thead><tr>' +
'<th></th>' + '<th></th>' +
'<th></th>' + '<th></th>' +
'<th></th>' + '<th></th>' +
@ -140,11 +140,11 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
return htmlDisplay; return htmlDisplay;
})() + })() +
'</tr></table>' '</tr></thead><tbody></tbody></table>'
).appendTo(container)[0]; ).appendTo(container)[0];
var renderProject = function(project) { var renderProject = function(project) {
var tr = table.insertRow(table.rows.length); var tr = table.getElementsByTagName('tbody')[0].insertRow(table.rows.length - 1);
tr.className = "project"; tr.className = "project";
var deleteLink = $('<a></a>') var deleteLink = $('<a></a>')
@ -266,6 +266,8 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
for (var i = 0; i < projects.length; i++) { for (var i = 0; i < projects.length; i++) {
renderProject(projects[i]); renderProject(projects[i]);
} }
$(table).tablesorter();
} }
}; };