From 43107909ca12746a11ffd1e69ae62e9e39f6fc59 Mon Sep 17 00:00:00 2001 From: Patrick Rauscher Date: Fri, 6 Apr 2012 04:49:07 +0200 Subject: [PATCH] due to browser security-limitations, will now use cookie-values of parentUri / parentUriReadOnly if they exist. should fix issue #602 --- src/static/js/pad_editbar.js | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index 6be92c9fb..4d7ebe243 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'); @@ -233,22 +234,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("