Show a read only link on the pad

This commit is contained in:
Peter 'Pita' Martischka 2011-07-08 17:42:07 +01:00
parent 7915390b83
commit 1c1e035bf1
5 changed files with 111 additions and 7 deletions

View file

@ -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;

View file

@ -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=&quot;' + padurl + '&quot; 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")

View file

@ -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">