Deleted old empty protograph dirs. Use a default assign version even if running from trunk; this is so that we have at least some clue about an imported project file.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@1598 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
8b8e9f1c1b
commit
e7184ec9ab
@ -24,9 +24,11 @@ import edu.mit.simile.butterfly.Butterfly;
|
||||
import edu.mit.simile.butterfly.ButterflyModule;
|
||||
|
||||
public class RefineServlet extends Butterfly {
|
||||
static private String ASSIGNED_VERSION = "2.0";
|
||||
|
||||
static public String VERSION = "";
|
||||
static public String REVISION = "";
|
||||
static public String FULL_VERSION = "";
|
||||
static public String FULLNAME = "Google Refine ";
|
||||
|
||||
static public final String AGENT_ID = "/en/google_refine";
|
||||
@ -67,7 +69,16 @@ public class RefineServlet extends Butterfly {
|
||||
|
||||
VERSION = getInitParameter("refine.version");
|
||||
REVISION = getInitParameter("refine.revision");
|
||||
FULLNAME += VERSION + " [" + REVISION + "]";
|
||||
|
||||
if (VERSION.equals("$VERSION")) {
|
||||
VERSION = ASSIGNED_VERSION;
|
||||
}
|
||||
if (REVISION.equals("$REVISION")) {
|
||||
REVISION = "TRUNK";
|
||||
}
|
||||
|
||||
FULL_VERSION = VERSION + " [" + REVISION + "]";
|
||||
FULLNAME += FULL_VERSION;
|
||||
|
||||
logger.info("Starting " + FULLNAME + "...");
|
||||
|
||||
|
@ -6,6 +6,9 @@ import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import com.google.refine.RefineServlet;
|
||||
|
||||
public class GetVersionCommand extends Command {
|
||||
@ -13,12 +16,17 @@ public class GetVersionCommand extends Command {
|
||||
@Override
|
||||
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
try {
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setHeader("Content-Type", "text/plain");
|
||||
response.getWriter().write(RefineServlet.VERSION);
|
||||
} catch (Exception e) {
|
||||
respondException(response, e);
|
||||
}
|
||||
}
|
||||
JSONObject o = new JSONObject();
|
||||
o.put("version", RefineServlet.VERSION);
|
||||
o.put("revision", RefineServlet.REVISION);
|
||||
o.put("full_version", RefineServlet.FULL_VERSION);
|
||||
o.put("full_name", RefineServlet.FULLNAME);
|
||||
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setHeader("Content-Type", "application/json");
|
||||
respond(response, o.toString());
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace(response.getWriter());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,6 @@ function init() {
|
||||
"externals/jquery-ui/jquery-ui-1.8.custom.min.js",
|
||||
"externals/date.js",
|
||||
"scripts/util/string.js",
|
||||
"scripts/version.js",
|
||||
"scripts/index.js"
|
||||
]
|
||||
);
|
||||
|
@ -209,17 +209,15 @@ function openWorkspaceDir() {
|
||||
});
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
fetchProjects();
|
||||
var GoogleRefineVersion;
|
||||
function showVersion() {
|
||||
$.getJSON(
|
||||
"/command/core/get-version",
|
||||
null,
|
||||
function(data) {
|
||||
GoogleRefineVersion = data;
|
||||
|
||||
$("#upload-file-button").click(onClickUploadFileButton);
|
||||
$("#more-options-link").click(function() {
|
||||
$("#more-options-controls").hide();
|
||||
$("#more-options").show();
|
||||
});
|
||||
|
||||
var version = (GoogleRefineVersion.version != "$VERSION") ? "Version " + GoogleRefineVersion.version + " [" + GoogleRefineVersion.revision + "]" : "Version <trunk>";
|
||||
$("#google-refine-version").text(version);
|
||||
$("#google-refine-version").text("Version " + GoogleRefineVersion.full_version);
|
||||
|
||||
var script = $('<script></script>')
|
||||
.attr("src", "http://google-refine.googlecode.com/svn/support/releases.js")
|
||||
@ -229,9 +227,14 @@ function onLoad() {
|
||||
var poll = function() {
|
||||
if ("releases" in window) {
|
||||
if (isThereNewRelease()) {
|
||||
$('<div id="version-message">' +
|
||||
'New version "' + releases.releases[0].description + '" <a href="' + releases.homepage + '">available for download here</a>.' +
|
||||
'</div>').appendTo(document.body);
|
||||
var div = $('<div id="version-message">')
|
||||
.text('New version "' + releases.releases[0].description + '" ')
|
||||
.appendTo(document.body)
|
||||
|
||||
$('<a>')
|
||||
.attr("href", releases.homepage)
|
||||
.text("available for download here")
|
||||
.appendTo(div);
|
||||
}
|
||||
} else {
|
||||
window.setTimeout(poll, 1000);
|
||||
@ -239,5 +242,19 @@ function onLoad() {
|
||||
};
|
||||
window.setTimeout(poll, 1000);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
fetchProjects();
|
||||
|
||||
$("#upload-file-button").click(onClickUploadFileButton);
|
||||
$("#more-options-link").click(function() {
|
||||
$("#more-options-controls").hide();
|
||||
$("#more-options").show();
|
||||
});
|
||||
|
||||
showVersion();
|
||||
}
|
||||
|
||||
$(onLoad);
|
||||
|
@ -1,5 +0,0 @@
|
||||
var GoogleRefineVersion = {
|
||||
description: "Google Refine $VERSION",
|
||||
version: "$VERSION",
|
||||
revision: "$REVISION"
|
||||
};
|
@ -130,3 +130,14 @@
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
#version-message {
|
||||
position: fixed;
|
||||
top: -1px;
|
||||
padding: @padding_loose;
|
||||
left: 40%;
|
||||
width: 20%;
|
||||
background: @fill_primary;
|
||||
border: 1px solid @chrome_primary;
|
||||
|
||||
.rounded_corners_bottom(10px);
|
||||
}
|
@ -48,3 +48,12 @@
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
.rounded_corners_bottom (@radius: 10px) {
|
||||
-webkit-border-bottom-left-radius: @radius;
|
||||
-webkit-border-bottom-right-radius: @radius;
|
||||
-moz-border-radius-bottomleft: @radius;
|
||||
-moz-border-radius-bottomright: @radius;
|
||||
border-bottom-left-radius: @radius;
|
||||
border-bottom-right-radius: @radius;
|
||||
}
|
Loading…
Reference in New Issue
Block a user