function onClickUploadFileButton(evt) { var projectName = $("#project-name-input")[0].value; if (! $.trim(projectName).length) { window.alert("You must specify a project name."); evt.preventDefault(); return false; } else { $("#file-upload-form").attr("action", "/command/create-project-from-upload?" + [ "split-into-columns=" + $("#split-into-columns-input")[0].checked, "separator=" + $("#separator-input")[0].value, "ignore=" + $("#ignore-input")[0].value, "header-lines=" + $("#header-lines-input")[0].value, "skip=" + $("#skip-input")[0].value, "limit=" + $("#limit-input")[0].value, "guess-value-type=" + $("#guess-value-type-input")[0].checked ].join("&")); } } function formatDate(d) { var yesterday = Date.today().add({ days: -1 }); 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(yesterday, today)) { return "Yesterday " + d.toString("h:mm tt"); } else { return d.toString("ddd, MMM d, yyyy"); } } function isThereNewRelease() { var thisRevision = GridworksVersion.revision; var revision_pattern = /r([0-9]+)/; if (!revision_pattern.test(thisRevision)) { // probably "trunk" return false; } var latestRevision = GridworksReleases.releases[0].revision; var thisRev = parseInt(revision_pattern.exec(thisRevision)[1],10); var latestRev = parseInt(revision_pattern.exec(GridworksReleases.releases[0].revision)[1],10); return latestRev > thisRev; } function renderProjects(data) { var projects = []; for (var n in data.projects) { if (data.projects.hasOwnProperty(n)) { var project = data.projects[n]; project.id = n; project.date = Date.parseExact(project.modified, "yyyy-MM-ddTHH:mm:ssZ"); projects.push(project); } } projects.sort(function(a, b) { return b.date.getTime() - a.date.getTime(); }); var container = $("#projects-container").empty(); if (!projects.length) { $('
Project Name | ' + 'Last Modified | ' + '' + ' |
---|