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

4
.gitignore vendored
View File

@ -6,4 +6,6 @@ bin/abiword.exe
bin/node.exe
etherpad-lite-win.zip
var/dirty.db
bin/convertSettings.json
bin/convertSettings.json
*~
*.patch

View File

@ -76,10 +76,13 @@ function isArray(testObject)
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)
userAgent = navigator.userAgent.toLowerCase();
var browser = {
version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
safari: /webkit/.test(userAgent),

View File

@ -174,7 +174,7 @@ function handshake()
function sendClientReady(isReconnect)
{
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)
document.title = document.title + " | " + padId;

View File

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