Merge branch 'master' of git://github.com/Pita/etherpad-lite

pull/231/merge
Peter 'Pita' Martischka 2011-11-28 11:16:33 -08:00
commit a2d3c6ddb2
4 changed files with 29 additions and 21 deletions

View File

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

View File

@ -16,6 +16,8 @@
var chat = (function() var chat = (function()
{ {
var chatMentions = 0;
var title = document.title;
var self = { var self = {
show: function () show: function ()
{ {
@ -43,6 +45,8 @@ var chat = (function()
} }
}); });
}); });
chatMentions = 0;
document.title = title;
}, },
hide: function () hide: function ()
{ {
@ -54,8 +58,6 @@ var chat = (function()
}, },
scrollDown: function() scrollDown: function()
{ {
//console.log($('#chatbox').css("display"));
if($('#chatbox').css("display") != "none") if($('#chatbox').css("display") != "none")
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow"); $('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
}, },
@ -112,9 +114,13 @@ var chat = (function()
// chat throb stuff -- Just make it throw for twice as long // chat throb stuff -- Just make it throw for twice as long
if(wasMentioned) if(wasMentioned)
{ // If the user was mentioned show for twice as long and flash the browser window { // If the user was mentioned show for twice as long and flash the browser window
if (chatMentions == 0){
title = document.title;
}
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text); $('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text);
$('#chatthrob').effect("pulsate", {times:1,mode:"hide"},4000); $('#chatthrob').effect("pulsate", {times:1,mode:"hide"},4000);
document.title = "You were mentioned in a chat: " + document.title; chatMentions++;
document.title = "("+chatMentions+") " + title;
} }
else else
{ {

View File

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

View File

@ -80,18 +80,13 @@
<ul id="menu_right"> <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;"> <li onClick="window.pad&&pad.editbarClick('import_export');return false;">
<a id="exportlink" title="Import/Export from/to different document formats"> <a id="exportlink" title="Import/Export from/to different document formats">
<div class="buttonicon" style="background-position:0px -68px"></div> <div class="buttonicon" style="background-position:0px -68px"></div>
</a> </a>
</li> </li>
<li onClick="window.pad&&pad.editbarClick('embed');return false;" > <li onClick="window.pad&&pad.editbarClick('embed');return false;" >
<a id="embedlink" title="Embed this pad"> <a id="embedlink" title="Share and Embed this pad">
<div class="buttonicon" style="background-position:0px -18px"></div> <div class="buttonicon" style="background-position:0px -18px"></div>
</a> </a>
</li> </li>
@ -223,10 +218,14 @@
Share: Share:
<br/> <br/>
<div id="linkcode"> <div id="linkcode">
Link:<input id="linkinput" type="text" value=""> <label for="linkinput">Link:</label><input id="linkinput" type="text" value="">
</div> </div><br/>
<div id="embedcode"> <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>
</div> </div>