Add support for embedding read only etc.

This commit is contained in:
John McLear 2011-11-23 15:46:34 +00:00
parent 2db81050f1
commit dedd604125
2 changed files with 24 additions and 12 deletions

View file

@ -102,8 +102,15 @@ var padeditbar = (function()
{ {
var padurl = window.location.href.split("?")[0]; var padurl = window.location.href.split("?")[0];
$('#embedinput').val("<iframe src='" + padurl + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>"); $('#embedinput').val("<iframe src='" + padurl + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
self.toogleDropDown("embed"); $('#linkinput').val(padurl);
var basePath = document.location.href.substring(0, document.location.href.indexOf("/p/"));
var readonlyLink = basePath + "/ro/" + clientVars.readOnlyId;
$('#roembedinput').val("<iframe src='" + readonlyLink + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
$('#rolinkinput').val(readonlyLink);
$('#readonlyImage').attr("src","https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=H|0&chl=" + readonlyLink);
$('#readonlyInput').val(readonlyLink);
$('#embedinput').focus().select(); $('#embedinput').focus().select();
self.toogleDropDown("embed");
} }
else if (cmd == 'import_export') else if (cmd == 'import_export')
{ {

View file

@ -217,17 +217,22 @@
<!-- the embed code --> <!-- the embed code -->
<div id="embed"> <div id="embed">
<div id="embedcode"> Share editable versions:
Embed code:<input id="embedinput" type="text" value=""> <br/>
</div> <div id="linkcode">
</div> Link:<input id="linkinput" type="text" value="">
</div>
<!-- the embed code --> <div id="embedcode">
<div id="readonly"> Embed code:<input id="embedinput" type="text" value="">
<div id="readonlyUrl"> </div>
Use this link to share a read-only version of your pad:<input id="readonlyInput" type="text" value=""> <br/><hr><br/>
<img id="readonlyImage" src="" alt="" style="margin: 10px 90px"> Share non-editable versions:(Read only)
</div> <div id="linkcode">
Read only Link:<input id="rolinkinput" type="text" value="">
</div>
<div id="embedcode">
Read only Embed code:<input id="roembedinput" type="text" value="">
</div>
</div> </div>
<div id="chatthrob"> <div id="chatthrob">