diff options
author | Peter 'Pita' Martischka <petermartischka@googlemail.com> | 2011-07-08 17:42:07 +0100 |
---|---|---|
committer | Peter 'Pita' Martischka <petermartischka@googlemail.com> | 2011-07-08 17:42:07 +0100 |
commit | 1c1e035bf1a2190be97cc6dc75074072fb596c8f (patch) | |
tree | 38b49807b3cc2380bf4711b4d968307665632615 /static/js/pad_editbar.js | |
parent | 7915390b839d7182dc5a76d1261217d5decc13ab (diff) | |
download | etherpad-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.js | 12 |
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="' + 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") |