diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index 658c33eb5..accc9fe6b 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -20,6 +20,7 @@ * limitations under the License. */ +var readCookie = require('./pad_utils').readCookie; var padutils = require('./pad_utils').padutils; var padeditor = require('./pad_editor').padeditor; var padsavedrevs = require('./pad_savedrevs'); @@ -234,22 +235,35 @@ var padeditbar = (function() }, setEmbedLinks: function() { - var padPath = window.parent ? window.parent.location.href : document.location.href; if ($('#readonlyinput').is(':checked')) { - var basePath = padPath.substring(0, padPath.indexOf("/p/")); - var readonlyLink = basePath + "/ro/" + clientVars.readOnlyId; - $('#embedinput').val("