editor: fix the wrong URL when we use etherpad without /p/ in the URL (#4070)
This commit is contained in:
parent
b1e50ab835
commit
f45d85f615
1 changed files with 7 additions and 5 deletions
|
@ -293,18 +293,20 @@ var padeditbar = (function()
|
|||
},
|
||||
setEmbedLinks: function()
|
||||
{
|
||||
var padUrl = window.location.href.split("?")[0];
|
||||
|
||||
if ($('#readonlyinput').is(':checked'))
|
||||
{
|
||||
var basePath = document.location.href.substring(0, document.location.href.indexOf("/p/"));
|
||||
var readonlyLink = basePath + "/p/" + clientVars.readOnlyId;
|
||||
var urlParts = padUrl.split("/");
|
||||
urlParts.pop();
|
||||
var readonlyLink = urlParts.join("/") + "/" + clientVars.readOnlyId;
|
||||
$('#embedinput').val('<iframe name="embed_readonly" src="' + readonlyLink + '?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false" width="100%" height="600" frameborder="0"></iframe>');
|
||||
$('#linkinput').val(readonlyLink);
|
||||
}
|
||||
else
|
||||
{
|
||||
var padurl = window.location.href.split("?")[0];
|
||||
$('#embedinput').val('<iframe name="embed_readwrite" src="' + padurl + '?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false" width="100%" height="600" frameborder="0"></iframe>');
|
||||
$('#linkinput').val(padurl);
|
||||
$('#embedinput').val('<iframe name="embed_readwrite" src="' + padUrl + '?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false" width="100%" height="600" frameborder="0"></iframe>');
|
||||
$('#linkinput').val(padUrl);
|
||||
}
|
||||
},
|
||||
checkAllIconsAreDisplayedInToolbar: function()
|
||||
|
|
Loading…
Reference in a new issue