Merge commit 'd5120c9' into pita

This commit is contained in:
Egil Moeller 2012-04-17 22:34:45 +02:00
commit f80f9fc59f
2 changed files with 304 additions and 293 deletions

View file

@ -1,123 +1,138 @@
body { body {
margin: 0; margin: 0;
height: 100%; height: 100%;
color: #333; color: #333;
font: 14px helvetica, sans-serif; font: 14px helvetica, sans-serif;
background: #ddd; background: #ddd;
background: -webkit-radial-gradient(circle,#aaa,#eee 60%) center fixed; background: -webkit-radial-gradient(circle,#aaa,#eee 60%) center fixed;
background: -moz-radial-gradient(circle,#aaa,#eee 60%) center fixed; background: -moz-radial-gradient(circle,#aaa,#eee 60%) center fixed;
background: -ms-radial-gradient(circle,#aaa,#eee 60%) center fixed; background: -ms-radial-gradient(circle,#aaa,#eee 60%) center fixed;
background: -o-radial-gradient(circle,#aaa,#eee 60%) center fixed; background: -o-radial-gradient(circle,#aaa,#eee 60%) center fixed;
border-top: 8px solid rgba(51,51,51,.8); border-top: 8px solid rgba(51,51,51,.8);
} }
#wrapper { #wrapper {
margin-top: 160px; border-top: 1px solid #999;
padding: 15px; margin-top: 160px;
background: #fff; padding: 15px;
opacity: .9; background: #eee;
box-shadow: 0px 1px 8px rgba(0,0,0,0.3); background: -webkit-linear-gradient(#fff,#ccc);
max-width: 700px; background: -moz-linear-gradient(#fff,#ccc);
margin: auto; background: -ms-linear-gradient(#fff,#ccc);
border-radius: 0 0 7px 7px; background: -o-linear-gradient(#fff,#ccc);
} opacity: .9;
h1 { box-shadow: 0px 1px 8px rgba(0,0,0,0.3);
font-size: 29px; max-width: 1200px;
} margin: auto;
h2 { }
font-size: 24px; #inner {
} width: 300px;
.seperator { margin: 0 auto;
margin: 10px 0; }
height: 1px; #button:hover {
background: #aaa; cursor: pointer;
background: -webkit-linear-gradient(left, #fff, #aaa 20%, #aaa 80%, #fff); background: #666;
background: -moz-linear-gradient(left, #fff, #aaa 20%, #aaa 80%, #fff); background: -webkit-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
background: -ms-linear-gradient(left, #fff, #aaa 20%, #aaa 80%, #fff); background: -moz-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
background: -o-linear-gradient(left, #fff, #aaa 20%, #aaa 80%, #fff); background: -ms-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
} background: -o-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
form { }
margin-bottom: 0; #button:active {
} box-shadow: inset 0 1px 12px rgba(0,0,0,0.9);
#inner { background: #444;
width: 300px; }
margin: 0 auto; #label {
} text-align: left;
button, input { text-shadow: 0 1px 1px #fff;
font-weight: bold; margin: 16px auto 0;
font-size: 15px; }
} form {
input[type="button"] { border: 1px solid #bbb;
height: 30px; border-radius: 3px;
margin: 0; position: relative;
display: block; }
} button, input {
input[value="Uninstall"], input[value="Install"] { font-weight: bold;
float: right; font-size: 15px;
width: 100px; }
} input[type="button"] {
input[type="text"] { height:30px;
border-radius: 3px; }
box-sizing: border-box; input[type="text"] {
-moz-box-sizing: border-box; border-radius: 3px;
padding: 10px; box-sizing: border-box;
*padding: 0; /* IE7 hack */ -moz-box-sizing: border-box;
width: 100%; padding: 10px 45px 10px 10px;
outline: none; *padding: 0; /* IE7 hack */
border: 1px solid #ddd; width: 100%;
margin: 0 0 5px 1px; outline: none;
max-width: 500px; border: none;
} }
button{ button{
display:block; display:block;
} }
table { @media only screen and (min-device-width: 320px) and (max-device-width: 720px) {
border: 1px solid #ddd; body {
border-radius: 3px; background: #bbb;
border-spacing: 0; background: -webkit-linear-gradient(#aaa,#eee 60%) center fixed;
width: 100%; background: -moz-linear-gradient(#aaa,#eee 60%) center fixed;
margin: 20px 0; background: -ms-linear-gradient(#aaa,#eee 60%) center fixed;
} }
table thead tr { #wrapper {
background: #eee; margin-top: 0;
} }
td, th { #inner {
padding: 5px; width: 95%;
} }
.template { #label {
display: none; text-align: center;
} }
.dialog { }
display: none;
position: absolute; table {
left: 50%; border-collapse: collapse;
top: 50%; }
width: 700px; td, th {
height: 500px; border: 1px solid black;
margin-left: -350px; padding-left: 10px;
margin-top: -250px; padding-right: 10px;
border: 3px solid #999999; padding-top: 2px;
background: #eeeeee; padding-bottom: 2px;
} }
.dialog .title { .template {
margin: 0; display: none;
padding: 2px; }
border-bottom: 3px solid #999999; .dialog {
font-size: 24px; display: none;
line-height: 24px; position: absolute;
height: 24px; left: 50%;
overflow: hidden; top: 50%;
} width: 700px;
.dialog .title .close { height: 500px;
float: right; margin-left: -350px;
} margin-top: -250px;
.dialog .history { border: 3px solid #999999;
background: #222222; background: #eeeeee;
color: #eeeeee; }
position: absolute; .dialog .title {
top: 41px; margin: 0;
bottom: 10px; padding: 2px;
left: 10px; border-bottom: 3px solid #999999;
right: 10px; font-size: 24px;
padding: 2px; line-height: 24px;
overflow: auto; height: 24px;
} overflow: hidden;
}
.dialog .title .close {
float: right;
}
.dialog .history {
background: #222222;
color: #eeeeee;
position: absolute;
top: 41px;
bottom: 10px;
left: 10px;
right: 10px;
padding: 2px;
overflow: auto;
}

View file

@ -1,170 +1,166 @@
<html> <html>
<head> <head>
<title>Plugin manager</title> <title>Plugin manager</title>
<link href="../../static/css/admin.css" rel="stylesheet" type="text/css" /> <link href="../../static/css/admin.css" rel="stylesheet" type="text/css" />
<script src="../../static/js/jquery.js"></script> <script src="../../static/js/jquery.js"></script>
<script src="../../socket.io/socket.io.js"></script> <script src="../../socket.io/socket.io.js"></script>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var socket = io.connect().of("/pluginfw/installer"); var socket = io.connect().of("/pluginfw/installer");
var doUpdate = false; var doUpdate = false;
function updateHandlers() { function updateHandlers() {
$("#progress.dialog .close").unbind('click').click(function () { $("#progress.dialog .close").unbind('click').click(function () {
$("#progress.dialog").hide(); $("#progress.dialog").hide();
}); });
$("#do-search").unbind('click').click(function () { $("#do-search").unbind('click').click(function () {
if ($("#search-query")[0].value != "") if ($("#search-query")[0].value != "")
socket.emit("search", $("#search-query")[0].value); socket.emit("search", $("#search-query")[0].value);
}); });
$(".do-install").unbind('click').click(function (e) { $(".do-install").unbind('click').click(function (e) {
var row = $(e.target).closest("tr"); var row = $(e.target).closest("tr");
doUpdate = true; doUpdate = true;
socket.emit("install", row.find(".name").html()); socket.emit("install", row.find(".name").html());
}); });
$(".do-uninstall").unbind('click').click(function (e) { $(".do-uninstall").unbind('click').click(function (e) {
var row = $(e.target).closest("tr"); var row = $(e.target).closest("tr");
doUpdate = true; doUpdate = true;
socket.emit("uninstall", row.find(".name").html()); socket.emit("uninstall", row.find(".name").html());
}); });
} }
updateHandlers(); updateHandlers();
socket.on('progress', function (data) { socket.on('progress', function (data) {
$("#progress.dialog .close").hide(); $("#progress.dialog .close").hide();
$("#progress.dialog").show(); $("#progress.dialog").show();
var message = "Unknown status"; var message = "Unknown status";
if (data.message) { if (data.message) {
message = "<span class='status'>" + data.message.toString() + "</span>"; message = "<span class='status'>" + data.message.toString() + "</span>";
} }
if (data.error) { if (data.error) {
message = "<span class='error'>" + data.error.toString() + "<span>"; message = "<span class='error'>" + data.error.toString() + "<span>";
} }
$("#progress.dialog .message").html(message); $("#progress.dialog .message").html(message);
$("#progress.dialog .history").append("<div>" + message + "</div>"); $("#progress.dialog .history").append("<div>" + message + "</div>");
if (data.progress >= 1) { if (data.progress >= 1) {
if (data.error) { if (data.error) {
$("#progress.dialog .close").show(); $("#progress.dialog .close").show();
} else { } else {
if (doUpdate) { if (doUpdate) {
doUpdate = false; doUpdate = false;
socket.emit("load"); socket.emit("load");
} }
$("#progress.dialog").hide(); $("#progress.dialog").hide();
} }
} }
}); });
socket.on('search-result', function (data) { socket.on('search-result', function (data) {
$("#search-results *").remove(); $("#search-results *").remove();
for (plugin_name in data.results) { for (plugin_name in data.results) {
var plugin = data.results[plugin_name]; var plugin = data.results[plugin_name];
var row = $("#search-result-template").clone(); var row = $("#search-result-template").clone();
for (attr in plugin) { for (attr in plugin) {
row.find("." + attr).html(plugin[attr]); row.find("." + attr).html(plugin[attr]);
} }
$("#search-results").append(row); $("#search-results").append(row);
} }
updateHandlers(); updateHandlers();
}); });
socket.on('installed-results', function (data) { socket.on('installed-results', function (data) {
$("#installed-plugins *").remove(); $("#installed-plugins *").remove();
for (plugin_name in data.results) { for (plugin_name in data.results) {
var plugin = data.results[plugin_name]; var plugin = data.results[plugin_name];
var row = $("#installed-plugin-template").clone(); var row = $("#installed-plugin-template").clone();
for (attr in plugin.package) { for (attr in plugin.package) {
row.find("." + attr).html(plugin.package[attr]); row.find("." + attr).html(plugin.package[attr]);
} }
$("#installed-plugins").append(row); $("#installed-plugins").append(row);
} }
updateHandlers(); updateHandlers();
}); });
socket.emit("load"); socket.emit("load");
}); });
</script> </script>
</head> </head>
<body> <body>
<div id="wrapper"> <div id="wrapper">
<h1>Etherpad Lite</h1> <% if (errors.length) { %>
<div class="errors">
<div class="seperator"></div> <% errors.forEach(function (item) { %>
<div class="error"><%= item.toString() %></div>
<% if (errors.length) { %> <% }) %>
<div class="errors"> </div>
<% errors.forEach(function (item) { %> <% } %>
<div class="error"><%= item.toString() %></div>
<% }) %>
</div> <h1>Installed plugins</h1>
<% } %> <table>
<thead>
<tr>
<h2>Installed plugins</h2> <th>Name</th>
<table> <th>Description</th>
<thead> <td></td>
<tr> </tr>
<th>Name</th> </thead>
<th>Description</th> <tbody class="template">
<td></td> <tr id="installed-plugin-template">
</tr> <td class="name"></td>
</thead> <td class="description"></td>
<tbody class="template"> <td class="actions">
<tr id="installed-plugin-template"> <input type="button" value="Uninstall" class="do-uninstall">
<td class="name"></td> </td>
<td class="description"></td> </tr>
<td class="actions"> </tbody>
<input type="button" value="Uninstall" class="do-uninstall"> <tbody id="installed-plugins">
</td> </tbody>
</tr> </table>
</tbody>
<tbody id="installed-plugins"> <h1>Search for plugins to install</h1>
</tbody> <form>
</table> <input type="text" name="search" value="" id="search-query">
<div class="seperator"></div> <input type="button" value="Search" id="do-search">
<h2>Search for plugins to install</h2> </form>
<form> <table>
<input type="text" name="search" placeholder="Search term" id="search-query"> <thead>
<input type="button" value="Search" id="do-search"> <tr>
</form> <th>Name</th>
<table> <th>Description</th>
<thead> <td></td>
<tr> </tr>
<th>Name</th> </thead>
<th>Description</th> <tbody class="template">
<td></td> <tr id="search-result-template">
</tr> <td class="name"></td>
</thead> <td class="description"></td>
<tbody class="template"> <td class="actions">
<tr id="search-result-template"> <input type="button" value="Install" class="do-install">
<td class="name"></td> </td>
<td class="description"></td> </tr>
<td class="actions"> </tbody>
<input type="button" value="Install" class="do-install"> <tbody id="search-results">
</td> </tbody>
</tr> </table>
</tbody>
<tbody id="search-results"> <div id="progress" class="dialog">
</tbody> <h1 class="title">
</table> Please wait: <span class="message"></span>
<input type="button" class="close" value="Close">
<div id="progress" class="dialog"> </h1>
<h1 class="title"> <div class="history"></div>
Please wait: <span class="message"></span> </div>
<input type="button" class="close" value="Close"> </div>
</h1> </body>
<div class="history"></div> </html>
</div>
</div>
</body>
</html>