This commit is contained in:
John McLear 2011-11-28 20:48:16 +00:00
commit c8bfd21c03
4 changed files with 15 additions and 6 deletions

2
.gitignore vendored
View File

@ -7,3 +7,5 @@ bin/node.exe
etherpad-lite-win.zip etherpad-lite-win.zip
var/dirty.db var/dirty.db
bin/convertSettings.json bin/convertSettings.json
*~
*.patch

View File

@ -76,10 +76,13 @@ function isArray(testObject)
if (typeof exports !== "undefined") if (typeof exports !== "undefined")
{ {
var navigator = {userAgent: "node-js"}; userAgent = "node-js";
}
else
{
userAgent = navigator.userAgent.toLowerCase();
} }
// Figure out what browser is being used (stolen from jquery 1.2.1) // Figure out what browser is being used (stolen from jquery 1.2.1)
userAgent = navigator.userAgent.toLowerCase();
var browser = { var browser = {
version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1], version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
safari: /webkit/.test(userAgent), safari: /webkit/.test(userAgent),

View File

@ -174,7 +174,7 @@ function handshake()
function sendClientReady(isReconnect) function sendClientReady(isReconnect)
{ {
var padId = document.location.pathname.substring(document.location.pathname.lastIndexOf("/") + 1); var padId = document.location.pathname.substring(document.location.pathname.lastIndexOf("/") + 1);
padId = unescape(padId); // unescape neccesary due to Safari and Opera interpretation of spaces padId = decodeURIComponent(padId); // unescape neccesary due to Safari and Opera interpretation of spaces
if(!isReconnect) if(!isReconnect)
document.title = document.title + " | " + padId; document.title = document.title + " | " + padId;

View File

@ -62,7 +62,7 @@
//get the padId out of the url //get the padId out of the url
var urlParts= document.location.pathname.split("/"); var urlParts= document.location.pathname.split("/");
padId = urlParts[urlParts.length-2]; padId = decodeURIComponent(urlParts[urlParts.length-2]);
//set the title //set the title
document.title = document.title + " | " + padId; document.title = document.title + " | " + padId;
@ -271,7 +271,11 @@
<!-- termporary place holder--> <!-- termporary place holder-->
<a id = "returnbutton">Return to pad</a> <a id = "returnbutton">Return to pad</a>
<script> <script>
if(document.referrer.length > 0 && document.referrer.substring(document.referrer.lastIndexOf("/")-1,document.referrer.lastIndexOf("/")) === "p") {
$("#returnbutton").attr("href", document.referrer); $("#returnbutton").attr("href", document.referrer);
} else {
$("#returnbutton").attr("href", document.location.href.substring(0,document.location.href.lastIndexOf("/")));
}
</script> </script>
</div> </div>