Merge pull request #3059 from paper-pauper/librejs

Added LibreJS support
This commit is contained in:
John McLear 2016-09-28 23:02:40 +01:00 committed by GitHub
commit f289611ba9
10 changed files with 111 additions and 17 deletions

View File

@ -16,6 +16,13 @@ exports.expressCreateServer = function (hook_name, args, cb) {
res.send(eejs.require("ep_etherpad-lite/templates/index.html")); res.send(eejs.require("ep_etherpad-lite/templates/index.html"));
}); });
//serve javascript.html
args.app.get('/javascript', function(req, res)
{
res.send(eejs.require("ep_etherpad-lite/templates/javascript.html"));
});
//serve robots.txt //serve robots.txt
args.app.get('/robots.txt', function(req, res) args.app.get('/robots.txt', function(req, res)
{ {

View File

@ -20,5 +20,6 @@
</ul> </ul>
</div> </div>
</div> </div>
<div style="display:none"><a href="/javascript" data-jslicense="1">JavaScript license information</a></div>
</body> </body>
</html> </html>

View File

@ -41,5 +41,6 @@
</div> </div>
</div> </div>
<div style="display:none"><a href="/javascript" data-jslicense="1">JavaScript license information</a></div>
</body> </body>
</html> </html>

View File

@ -112,5 +112,6 @@
</div> </div>
</div> </div>
<div style="display:none"><a href="/javascript" data-jslicense="1">JavaScript license information</a></div>
</body> </body>
</html> </html>

View File

@ -50,5 +50,6 @@
</div> </div>
</div> </div>
<div style="display:none"><a href="/javascript" data-jslicense="1">JavaScript license information</a></div>
</body> </body>
</html> </html>

View File

@ -139,5 +139,6 @@ ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol {
</head> </head>
<body> <body>
<%- body %> <%- body %>
<div style="display:none"><a href="/javascript" data-jslicense="1">JavaScript license information</a></div>
</body> </body>
</html> </html>

View File

@ -29,7 +29,7 @@
*/ */
</script> </script>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<link rel="shortcut icon" href="<%=settings.favicon%>"> <link rel="shortcut icon" href="<%=settings.favicon%>">
@ -121,7 +121,7 @@
input[type="text"] { input[type="text"] {
border-radius: 3px; border-radius: 3px;
box-sizing: border-box; box-sizing: border-box;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
line-height:36px; /* IE8 hack */ line-height:36px; /* IE8 hack */
padding: 0px 45px 0 10px; padding: 0px 45px 0 10px;
*padding: 0; /* IE7 hack */ *padding: 0; /* IE7 hack */
@ -148,22 +148,22 @@
margin-top: 0; margin-top: 0;
} }
#inner { #inner {
width: 95%; width: 95%;
} }
#label { #label {
text-align: center; text-align: center;
} }
} }
</style> </style>
<link href="static/custom/index.css" rel="stylesheet"> <link href="static/custom/index.css" rel="stylesheet">
<div id="wrapper"> <div id="wrapper">
<% e.begin_block("indexWrapper"); %> <% e.begin_block("indexWrapper"); %>
<div id="inner"> <div id="inner">
<buttOn id="button" onclick="go2Random()" data-l10n-id="index.newPad"></button> <buttOn id="button" onclick="go2Random()" data-l10n-id="index.newPad"></button>
<label id="label" for="padname" data-l10n-id="index.createOpenPad"></label> <label id="label" for="padname" data-l10n-id="index.createOpenPad"></label>
<form action="#" onsubmit="go2Name();return false;"> <form action="#" onsubmit="go2Name();return false;">
<input type="text" id="padname" maxlength="50" autofocus x-webkit-speech> <input type="text" id="padname" maxlength="50" autofocus x-webkit-speech>
<button type="submit">OK</button> <button type="submit">OK</button>
</form> </form>
</div> </div>
@ -171,33 +171,35 @@
</div> </div>
<script src="static/custom/index.js"></script> <script src="static/custom/index.js"></script>
<script> <script>
// @license magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt
function go2Name() function go2Name()
{ {
var padname = document.getElementById("padname").value; var padname = document.getElementById("padname").value;
padname.length > 0 ? window.location = "p/" + padname : alert("Please enter a name") padname.length > 0 ? window.location = "p/" + padname : alert("Please enter a name")
} }
function go2Random() function go2Random()
{ {
window.location = "p/" + randomPadName(); window.location = "p/" + randomPadName();
} }
function randomPadName() function randomPadName()
{ {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var string_length = 10; var string_length = 10;
var randomstring = ''; var randomstring = '';
for (var i = 0; i < string_length; i++) for (var i = 0; i < string_length; i++)
{ {
var rnum = Math.floor(Math.random() * chars.length); var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum, rnum + 1); randomstring += chars.substring(rnum, rnum + 1);
} }
return randomstring; return randomstring;
} }
// start the custom js // start the custom js
if (typeof customStart == "function") customStart(); if (typeof customStart == "function") customStart();
// @license-end
</script> </script>
<div style="display:none"><a href="/javascript" data-jslicense="1">JavaScript license information</a></div>
</html> </html>

View File

@ -0,0 +1,73 @@
<!doctype html>
<html>
<head>
<title>JavaScript license information</title>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
</head>
<body>
<table id="jslicense-labels1">
<tr>
<td><a href="/static/js/jquery-2.1.1.min.js">jquery-2.1.1.min.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/static/js/jquery.js">jquery.js</a></td>
</tr>
<tr>
<td><a href="/static/js/html10n.js">html10n.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/static/js/html10n.js">html10n.js</a></td>
</tr>
<tr>
<td><a href="/static/js/l10n.js">l10n.js</a></td>
<td><a href="http://www.apache.org/licenses/LICENSE-2.0">Apache-2.0-only</a></td>
<td><a href="/static/js/l10n.js">l10n.js</a></td>
</tr>
<tr>
<td><a href="/static/js/socket.io.js">socket.io.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/static/js/socket.io.js">socket.io.js</a></td>
</tr>
<tr>
<td><a href="/static/js/require-kernel.js">require-kernel.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/static/js/require-kernel.js">require-kernel.js</a></td>
</tr>
<tr>
<td><a href="/static/custom/index.js">index.js</a></td>
<td><a href="http://www.apache.org/licenses/LICENSE-2.0">Apache-2.0-only</a></td>
<td><a href="/static/custom/index.js">index.js</a></td>
</tr>
<tr>
<td><a href="/static/custom/timeslider.js">timeslider.js</a></td>
<td><a href="http://www.apache.org/licenses/LICENSE-2.0">Apache-2.0-only</a></td>
<td><a href="/static/custom/timeslider.js">timeslider.js</a></td>
</tr>
<tr>
<td><a href="/static/custom/pad.js">pad.js</a></td>
<td><a href="http://www.apache.org/licenses/LICENSE-2.0">Apache-2.0-only</a></td>
<td><a href="/static/custom/pad.js">pad.js</a></td>
</tr>
<tr>
<td><a href="/static/js/admin/plugins.js">plugins.js</a></td>
<td><a href="http://www.apache.org/licenses/LICENSE-2.0">Apache-2.0-only</a></td>
<td><a href="/static/js/admin/plugins.js">plugins.js</a></td>
</tr>
<tr>
<td><a href="/static/js/admin/minify.json.js">minify.json.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/static/js/admin/minify.json.js">minify.json.js</a></td>
</tr>
<tr>
<td><a href="/static/js/admin/settings.js">settings.js</a></td>
<td><a href="http://www.apache.org/licenses/LICENSE-2.0">Apache-2.0-only</a></td>
<td><a href="/static/js/admin/settings.js">settings.js</a></td>
</tr>
<tr>
<td><a href="/static/js/admin/jquery.autosize.js">jquery.autosize.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/static/js/admin/jquery.autosize.js">jquery.autosize.js</a></td>
</tr>
</table>
</body>
</html>

View File

@ -350,6 +350,7 @@
<% e.begin_block("scripts"); %> <% e.begin_block("scripts"); %>
<script type="text/javascript"> <script type="text/javascript">
// @license magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt
(function() { (function() {
// Display errors on page load to the user // Display errors on page load to the user
// (Gets overridden by padutils.setupGlobalExceptionHandler) // (Gets overridden by padutils.setupGlobalExceptionHandler)
@ -363,6 +364,7 @@
if(typeof(originalHandler) == 'function') originalHandler.call(null, arguments); if(typeof(originalHandler) == 'function') originalHandler.call(null, arguments);
}; };
})(); })();
// @license-end
</script> </script>
<script type="text/javascript" src="../static/js/require-kernel.js"></script> <script type="text/javascript" src="../static/js/require-kernel.js"></script>
@ -378,6 +380,7 @@
<!-- Bootstrap page --> <!-- Bootstrap page -->
<script type="text/javascript"> <script type="text/javascript">
// @license magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt
var clientVars = {}; var clientVars = {};
(function () { (function () {
var pathComponents = location.pathname.split('/'); var pathComponents = location.pathname.split('/');
@ -415,6 +418,8 @@
padeditbar = require('ep_etherpad-lite/static/js/pad_editbar').padeditbar; padeditbar = require('ep_etherpad-lite/static/js/pad_editbar').padeditbar;
padimpexp = require('ep_etherpad-lite/static/js/pad_impexp').padimpexp; padimpexp = require('ep_etherpad-lite/static/js/pad_impexp').padimpexp;
}()); }());
// @license-end
</script> </script>
<div style="display:none"><a href="/javascript" data-jslicense="1">JavaScript license information</a></div>
<% e.end_block(); %> <% e.end_block(); %>
</html> </html>

View File

@ -230,6 +230,7 @@
<!-- Bootstrap --> <!-- Bootstrap -->
<script type="text/javascript" > <script type="text/javascript" >
// @license magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt
var clientVars = {}; var clientVars = {};
var BroadcastSlider; var BroadcastSlider;
(function () { (function () {
@ -266,8 +267,9 @@
padeditbar.init() padeditbar.init()
}); });
})(); })();
// @license-end
</script> </script>
<% e.end_block(); %> <% e.end_block(); %>
<div style="display:none"><a href="/javascript" data-jslicense="1">JavaScript license information</a></div>
</body> </body>
</html> </html>