tell installer if old etherpad needs updating during plugin install

This commit is contained in:
John McLear 2015-01-25 02:44:10 +00:00
parent 831151cfba
commit aca745ddf6
2 changed files with 4 additions and 1 deletions

View File

@ -83,7 +83,7 @@ exports.socketio = function (hook_name, args, cb) {
socket.on("install", function (plugin_name) {
installer.install(plugin_name, function (er) {
if(er) console.warn(er)
socket.emit("finished:install", {plugin: plugin_name, error: er? er.message : null});
socket.emit("finished:install", {plugin: plugin_name, code: er? er.code : null, error: er? er.message : null});
});
});

View File

@ -225,6 +225,9 @@ $(document).ready(function () {
socket.on('finished:install', function(data) {
if(data.error) {
if(data.code === "EPEERINVALID"){
alert("This plugin requires that you update Etherpad so it can operate in it's true glory");
}
alert('An error occured while installing '+data.plugin+' \n'+data.error)
$('#installed-plugins .'+data.plugin).remove()
}