mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
Show a read only link on the pad
This commit is contained in:
parent
7915390b83
commit
1c1e035bf1
5 changed files with 111 additions and 7 deletions
|
@ -101,10 +101,18 @@ var padeditbar = (function()
|
|||
else if (cmd == 'embed')
|
||||
{
|
||||
var padurl = document.location;
|
||||
$('#embed').html('<div id="embedcode">Embed code:<input id="embedinput" type="text" value="<iframe src="' + padurl + '" width=500 height=400>"</iframe></div>');
|
||||
$('#embedinput').val("<iframe src='" + padurl + "' width=500 height=400>");
|
||||
self.toogleDropDown("embed");
|
||||
$('#embedinput').focus().select();
|
||||
}
|
||||
else if (cmd == 'readonly')
|
||||
{
|
||||
var basePath = document.location.href.substring(0, document.location.href.indexOf("/p/"));
|
||||
var readonlyLink = basePath + "/ro/" + clientVars.readOnlyId;
|
||||
$('#readonlyInput').val(readonlyLink);
|
||||
self.toogleDropDown("readonly");
|
||||
$('#readonlyInput').focus().select();
|
||||
}
|
||||
else if (cmd == 'save')
|
||||
{
|
||||
padsavedrevs.saveNow();
|
||||
|
@ -150,7 +158,7 @@ var padeditbar = (function()
|
|||
},
|
||||
toogleDropDown: function(moduleName)
|
||||
{
|
||||
var modules = ["embed", "users"];
|
||||
var modules = ["embed", "users", "readonly"];
|
||||
|
||||
//hide all modules
|
||||
if(moduleName == "none")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue