mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
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()
|
setEmbedLinks: function()
|
||||||
{
|
{
|
||||||
|
var padUrl = window.location.href.split("?")[0];
|
||||||
|
|
||||||
if ($('#readonlyinput').is(':checked'))
|
if ($('#readonlyinput').is(':checked'))
|
||||||
{
|
{
|
||||||
var basePath = document.location.href.substring(0, document.location.href.indexOf("/p/"));
|
var urlParts = padUrl.split("/");
|
||||||
var readonlyLink = basePath + "/p/" + clientVars.readOnlyId;
|
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>');
|
$('#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);
|
$('#linkinput').val(readonlyLink);
|
||||||
}
|
}
|
||||||
else
|
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>');
|
||||||
$('#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);
|
||||||
$('#linkinput').val(padurl);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkAllIconsAreDisplayedInToolbar: function()
|
checkAllIconsAreDisplayedInToolbar: function()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue