Remove read only link and place all functionality into embed option sorts issue #246

This commit is contained in:
John McLear 2011-11-27 21:04:11 +00:00
parent 19ee4865f4
commit 90d36471b1
3 changed files with 19 additions and 17 deletions

View file

@ -1151,3 +1151,12 @@ width:33px !important;
padding: 4px 1px;
}
}
#embedreadonlyqr{
padding-top:20px;
margin-left:100px;
}
#qrcode{
margin-left:10px;
}

View file

@ -109,15 +109,6 @@ var padeditbar = (function()
self.toogleDropDown("importexport");
}
else if (cmd == 'readonly')
{
var basePath = document.location.href.substring(0, document.location.href.indexOf("/p/"));
var readonlyLink = basePath + "/ro/" + clientVars.readOnlyId;
$('#readonlyImage').attr("src","https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=H|0&chl=" + readonlyLink);
$('#readonlyInput').val(readonlyLink);
self.toogleDropDown("readonly");
$('#readonlyInput').focus().select();
}
else if (cmd == 'save')
{
padsavedrevs.saveNow();
@ -215,6 +206,7 @@ var padeditbar = (function()
{
if ($('#readonlyinput').is(':checked'))
{
$('#qrcode').show();
var basePath = document.location.href.substring(0, document.location.href.indexOf("/p/"));
var readonlyLink = basePath + "/ro/" + clientVars.readOnlyId;
$('#embedinput').val("<iframe src='" + readonlyLink + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
@ -222,9 +214,11 @@ var padeditbar = (function()
}
else
{
$('#qrcode').hide();
var padurl = window.location.href.split("?")[0];
$('#embedinput').val("<iframe src='" + padurl + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
$('#linkinput').val(padurl);
$('#embedreadonlyqr').attr("src","https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=H|0&chl=" + padurl);
}
}
};

View file

@ -80,11 +80,6 @@
<ul id="menu_right">
<li onClick="window.pad&&pad.editbarClick('readonly');return false;" >
<a id="readonlylink" title="Create a readonly link for this pad">
<div class="buttonicon" style="background-position:0px -150px"></div>
</a>
</li>
<li onClick="window.pad&&pad.editbarClick('import_export');return false;">
<a id="exportlink" title="Import/Export from/to different document formats">
<div class="buttonicon" style="background-position:0px -68px"></div>
@ -223,10 +218,14 @@
Share:
<br/>
<div id="linkcode">
Link:<input id="linkinput" type="text" value="">
</div>
<label for="linkinput">Link:</label><input id="linkinput" type="text" value="">
</div><br/>
<div id="embedcode">
Embed code:<input id="embedinput" type="text" value="">
<label for="embedinput">Embed code:</label><input id="embedinput" type="text" value="">
</div><br/>
<div id="qrcode">
<label for="embedreadonlyqr">QR code:</label><br/>
<img id="embedreadonlyqr">
</div>
</div>