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];
$('#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();
self.toogleDropDown("embed");
}
else if (cmd == 'import_export')
{

View file

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