mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-26 02:16: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
|
@ -1088,7 +1088,7 @@ a#topbarmaximize {
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
#embed{
|
||||
#embed, #readonly {
|
||||
display:none;
|
||||
position:absolute;
|
||||
top:40px;
|
||||
|
@ -1105,11 +1105,11 @@ padding: 10px;
|
|||
border-radius: 6px;
|
||||
}
|
||||
|
||||
#embedcode{
|
||||
#embedcode, #readonlyUrl {
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
#embedinput{
|
||||
#embedinput, #readonlyInput{
|
||||
width:375px;
|
||||
height:24px;
|
||||
display:inline;
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -200,8 +200,19 @@ We removed this feature cause its not worth the space it needs in the editbar
|
|||
|
||||
</div>
|
||||
|
||||
<!-- needed? -->
|
||||
<div id="embed"></div>
|
||||
<!-- the embed code -->
|
||||
<div id="embed">
|
||||
<div id="embedcode">
|
||||
Embed code:<input id="embedinput" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- the embed code -->
|
||||
<div id="readonly">
|
||||
<div id="readonlyUrl">
|
||||
Use this link to share a read-only version of your pad:<input id="readonlyInput" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- /padeditor -->
|
||||
<div id="modaloverlay">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue