issue #602 - will now take browsers position instead of iframe-source. will fail in cascaded framesets

This commit is contained in:
Patrick Rauscher 2012-04-06 01:32:44 +00:00
parent 2435003403
commit a538cf13e7

View file

@ -236,7 +236,7 @@ var padeditbar = (function()
{ {
if ($('#readonlyinput').is(':checked')) if ($('#readonlyinput').is(':checked'))
{ {
var basePath = document.location.href.substring(0, document.location.href.indexOf("/p/")); var basePath = top.location.href.substring(0, top.location.href.indexOf("/p/"));
var readonlyLink = basePath + "/ro/" + clientVars.readOnlyId; var readonlyLink = basePath + "/ro/" + clientVars.readOnlyId;
$('#embedinput').val("<iframe name='embed_readonly' src='" + readonlyLink + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>"); $('#embedinput').val("<iframe name='embed_readonly' src='" + readonlyLink + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
$('#linkinput').val(readonlyLink); $('#linkinput').val(readonlyLink);
@ -244,7 +244,7 @@ var padeditbar = (function()
} }
else else
{ {
var padurl = window.location.href.split("?")[0]; var padurl = top.location.href.split("?")[0];
$('#embedinput').val("<iframe name='embed_readwrite' src='" + padurl + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>"); $('#embedinput').val("<iframe name='embed_readwrite' src='" + padurl + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
$('#linkinput').val(padurl); $('#linkinput').val(padurl);
$('#embedreadonlyqr').attr("src","https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=|0&chl=" + padurl); $('#embedreadonlyqr').attr("src","https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=|0&chl=" + padurl);