mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
Merge branch 'master' of github.com:Pita/etherpad-lite
This commit is contained in:
commit
dc6d0cda68
7 changed files with 47 additions and 24 deletions
|
@ -70,7 +70,7 @@ var functions = {
|
||||||
exports.handle = function(functionName, fields, req, res)
|
exports.handle = function(functionName, fields, req, res)
|
||||||
{
|
{
|
||||||
//check the api key!
|
//check the api key!
|
||||||
if(fields["apikey"] != apikey)
|
if(fields["apikey"] != apikey.trim())
|
||||||
{
|
{
|
||||||
res.send({code: 4, message: "no or wrong API Key", data: null});
|
res.send({code: 4, message: "no or wrong API Key", data: null});
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -442,19 +442,19 @@ async.waterfall([
|
||||||
io.set('logger', {
|
io.set('logger', {
|
||||||
debug: function (str)
|
debug: function (str)
|
||||||
{
|
{
|
||||||
socketIOLogger.debug(str);
|
socketIOLogger.debug.apply(socketIOLogger, arguments);
|
||||||
},
|
},
|
||||||
info: function (str)
|
info: function (str)
|
||||||
{
|
{
|
||||||
socketIOLogger.info(str);
|
socketIOLogger.info.apply(socketIOLogger, arguments);
|
||||||
},
|
},
|
||||||
warn: function (str)
|
warn: function (str)
|
||||||
{
|
{
|
||||||
socketIOLogger.warn(str);
|
socketIOLogger.warn.apply(socketIOLogger, arguments);
|
||||||
},
|
},
|
||||||
error: function (str)
|
error: function (str)
|
||||||
{
|
{
|
||||||
socketIOLogger.error(str);
|
socketIOLogger.error.apply(socketIOLogger, arguments);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -786,11 +786,15 @@ padding: 10px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#embedcode, #readonlyUrl {
|
#embedreadonly {
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
|
||||||
|
#embedcode, #readonlyUrl, #linkcode {
|
||||||
margin-left:10px;
|
margin-left:10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#embedinput, #readonlyInput{
|
#embedinput, #readonlyInput, #linkinput {
|
||||||
width:375px;
|
width:375px;
|
||||||
height:24px;
|
height:24px;
|
||||||
display:inline;
|
display:inline;
|
||||||
|
|
|
@ -152,6 +152,10 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
|
||||||
{
|
{
|
||||||
if (href)
|
if (href)
|
||||||
{
|
{
|
||||||
|
if(!~href.indexOf("http")) // if the url doesn't include http or https etc prefix it.
|
||||||
|
{
|
||||||
|
href = "http://"+href;
|
||||||
|
}
|
||||||
extraOpenTags = extraOpenTags + '<a href="' + href.replace(/\"/g, '"') + '">';
|
extraOpenTags = extraOpenTags + '<a href="' + href.replace(/\"/g, '"') + '">';
|
||||||
extraCloseTags = '</a>' + extraCloseTags;
|
extraCloseTags = '</a>' + extraCloseTags;
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,7 +237,7 @@ linestylefilter.getRegexpFilter = function(regExp, tag)
|
||||||
|
|
||||||
linestylefilter.REGEX_WORDCHAR = /[\u0030-\u0039\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u1FFF\u3040-\u9FFF\uF900-\uFDFF\uFE70-\uFEFE\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDC]/;
|
linestylefilter.REGEX_WORDCHAR = /[\u0030-\u0039\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u1FFF\u3040-\u9FFF\uF900-\uFDFF\uFE70-\uFEFE\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDC]/;
|
||||||
linestylefilter.REGEX_URLCHAR = new RegExp('(' + /[-:@a-zA-Z0-9_.,~%+\/\\?=&#;()$]/.source + '|' + linestylefilter.REGEX_WORDCHAR.source + ')');
|
linestylefilter.REGEX_URLCHAR = new RegExp('(' + /[-:@a-zA-Z0-9_.,~%+\/\\?=&#;()$]/.source + '|' + linestylefilter.REGEX_WORDCHAR.source + ')');
|
||||||
linestylefilter.REGEX_URL = new RegExp(/(?:(?:https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt):\/\/|mailto:)/.source + linestylefilter.REGEX_URLCHAR.source + '*(?![:.,;])' + linestylefilter.REGEX_URLCHAR.source, 'g');
|
linestylefilter.REGEX_URL = new RegExp(/(?:(?:https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt):\/\/|mailto:|www\.)/.source + linestylefilter.REGEX_URLCHAR.source + '*(?![:.,;])' + linestylefilter.REGEX_URLCHAR.source, 'g');
|
||||||
linestylefilter.getURLFilter = linestylefilter.getRegexpFilter(
|
linestylefilter.getURLFilter = linestylefilter.getRegexpFilter(
|
||||||
linestylefilter.REGEX_URL, 'url');
|
linestylefilter.REGEX_URL, 'url');
|
||||||
|
|
||||||
|
|
|
@ -100,10 +100,9 @@ var padeditbar = (function()
|
||||||
}
|
}
|
||||||
else if (cmd == 'embed')
|
else if (cmd == 'embed')
|
||||||
{
|
{
|
||||||
var padurl = window.location.href.split("?")[0];
|
self.setEmbedLinks();
|
||||||
$('#embedinput').val("<iframe src='" + padurl + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
|
|
||||||
self.toogleDropDown("embed");
|
|
||||||
$('#embedinput').focus().select();
|
$('#embedinput').focus().select();
|
||||||
|
self.toogleDropDown("embed");
|
||||||
}
|
}
|
||||||
else if (cmd == 'import_export')
|
else if (cmd == 'import_export')
|
||||||
{
|
{
|
||||||
|
@ -211,6 +210,22 @@ var padeditbar = (function()
|
||||||
{
|
{
|
||||||
syncAnimation.done();
|
syncAnimation.done();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
setEmbedLinks: function()
|
||||||
|
{
|
||||||
|
if ($('#readonlyinput').is(':checked'))
|
||||||
|
{
|
||||||
|
var basePath = document.location.href.substring(0, document.location.href.indexOf("/p/"));
|
||||||
|
var readonlyLink = basePath + "/ro/" + clientVars.readOnlyId;
|
||||||
|
$('#embedinput').val("<iframe src='" + readonlyLink + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
|
||||||
|
$('#linkinput').val(readonlyLink);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var padurl = window.location.href.split("?")[0];
|
||||||
|
$('#embedinput').val("<iframe src='" + padurl + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
|
||||||
|
$('#linkinput').val(padurl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
|
|
|
@ -217,17 +217,17 @@
|
||||||
|
|
||||||
<!-- the embed code -->
|
<!-- the embed code -->
|
||||||
<div id="embed">
|
<div id="embed">
|
||||||
<div id="embedcode">
|
<div id="embedreadonly">
|
||||||
Embed code:<input id="embedinput" type="text" value="">
|
<input type="checkbox" id="readonlyinput" onClick="padeditbar.setEmbedLinks();"/><label for="readonlyinput">Read only</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
Share:
|
||||||
|
<br/>
|
||||||
<!-- the embed code -->
|
<div id="linkcode">
|
||||||
<div id="readonly">
|
Link:<input id="linkinput" type="text" value="">
|
||||||
<div id="readonlyUrl">
|
</div>
|
||||||
Use this link to share a read-only version of your pad:<input id="readonlyInput" type="text" value="">
|
<div id="embedcode">
|
||||||
<img id="readonlyImage" src="" alt="" style="margin: 10px 90px">
|
Embed code:<input id="embedinput" type="text" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="chatthrob">
|
<div id="chatthrob">
|
||||||
|
|
Loading…
Reference in a new issue