mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
use a downloaded jQuery instead of using googles CDN, and fixed btw a bug that let pad.js fails randomly
This commit is contained in:
parent
c98db5a4c1
commit
95b47b4940
5 changed files with 21 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
node_modules
|
node_modules
|
||||||
settings.json
|
settings.json
|
||||||
|
static/js/jquery.min.js
|
15
bin/run.sh
15
bin/run.sh
|
@ -37,6 +37,21 @@ fi
|
||||||
echo "Ensure that all dependencies are up to date..."
|
echo "Ensure that all dependencies are up to date..."
|
||||||
npm install
|
npm install
|
||||||
|
|
||||||
|
echo "Ensure jQuery is downloaded and up to date..."
|
||||||
|
DOWNLOAD_JQUERY="true"
|
||||||
|
NEEDED_VERSION="1.6.1"
|
||||||
|
if [ -f "static/js/jquery.min.js" ]; then
|
||||||
|
VERSION=$(cat static/js/jquery.min.js | head -n 2 | tail -n 1 | grep -o "v[0-9]*\.[0-9]*\.[0-9]*");
|
||||||
|
|
||||||
|
if [[ ${VERSION:1} = $NEEDED_VERSION ]]; then
|
||||||
|
DOWNLOAD_JQUERY="false"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $DOWNLOAD_JQUERY = "true" ]]; then
|
||||||
|
wget -O static/js/jquery.min.js http://code.jquery.com/jquery-$NEEDED_VERSION.min.js
|
||||||
|
fi
|
||||||
|
|
||||||
#Remove all minified data to force node creating it new
|
#Remove all minified data to force node creating it new
|
||||||
echo "Clear minfified cache..."
|
echo "Clear minfified cache..."
|
||||||
rm var/minified* 2> /dev/null
|
rm var/minified* 2> /dev/null
|
||||||
|
|
|
@ -39,7 +39,7 @@ exports.padJS = function(req, res)
|
||||||
{
|
{
|
||||||
res.header("Content-Type","text/javascript");
|
res.header("Content-Type","text/javascript");
|
||||||
|
|
||||||
var jsFiles = ["plugins.js", "undo-xpopup.js", "json2.js", "pad_utils.js", "pad_cookie.js", "pad_editor.js", "pad_editbar.js", "pad_docbar.js", "pad_modals.js", "ace.js", "collab_client.js", "pad_userlist.js", "pad_impexp.js", "pad_savedrevs.js", "pad_connectionstatus.js", "pad2.js"];
|
var jsFiles = ["jquery.min.js", "plugins.js", "undo-xpopup.js", "json2.js", "pad_utils.js", "pad_cookie.js", "pad_editor.js", "pad_editbar.js", "pad_docbar.js", "pad_modals.js", "ace.js", "collab_client.js", "pad_userlist.js", "pad_impexp.js", "pad_savedrevs.js", "pad_connectionstatus.js", "pad2.js"];
|
||||||
|
|
||||||
//minifying is enabled
|
//minifying is enabled
|
||||||
if(settings.minify)
|
if(settings.minify)
|
||||||
|
@ -182,9 +182,9 @@ exports.padJS = function(req, res)
|
||||||
{
|
{
|
||||||
//put all javascript files in an array
|
//put all javascript files in an array
|
||||||
var values = [];
|
var values = [];
|
||||||
for(var i in fileValues)
|
for(var i in jsFiles)
|
||||||
{
|
{
|
||||||
values.push(fileValues[i]);
|
values.push(fileValues[jsFiles[i]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//minify all javascript files to one
|
//minify all javascript files to one
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
var clientVars = {}; // ]]>
|
var clientVars = {}; // ]]>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
|
|
||||||
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
|
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
|
||||||
|
|
||||||
<!--<script type="text/javascript" src="/static/js/plugins.js"></script>
|
<!--<script type="text/javascript" src="/static/js/plugins.js"></script>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<link href="/static/css/pad_lite.css" rel="stylesheet" type="text/css" />
|
<link href="/static/css/pad_lite.css" rel="stylesheet" type="text/css" />
|
||||||
<link href="/static/css/broadcast.css" rel="stylesheet" type="text/css" />
|
<link href="/static/css/broadcast.css" rel="stylesheet" type="text/css" />
|
||||||
<style type="text/css" title="dynamicsyntax"></style>
|
<style type="text/css" title="dynamicsyntax"></style>
|
||||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
|
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
// <![CDATA[
|
// <![CDATA[
|
||||||
var clientVars = {};
|
var clientVars = {};
|
||||||
|
|
Loading…
Reference in a new issue