summaryrefslogtreecommitdiff
path: root/static/js/pad_editbar.js
diff options
context:
space:
mode:
authorPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-07-08 17:42:07 +0100
committerPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-07-08 17:42:07 +0100
commit1c1e035bf1a2190be97cc6dc75074072fb596c8f (patch)
tree38b49807b3cc2380bf4711b4d968307665632615 /static/js/pad_editbar.js
parent7915390b839d7182dc5a76d1261217d5decc13ab (diff)
downloadetherpad-lite-1c1e035bf1a2190be97cc6dc75074072fb596c8f.zip
Show a read only link on the pad
Diffstat (limited to 'static/js/pad_editbar.js')
-rw-r--r--static/js/pad_editbar.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/static/js/pad_editbar.js b/static/js/pad_editbar.js
index 29442cea..ae15bc2d 100644
--- a/static/js/pad_editbar.js
+++ b/static/js/pad_editbar.js
@@ -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")