summaryrefslogtreecommitdiffstats
path: root/pages
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-06-12 13:46:01 -0700
committerPatrick Davison <snapwilliam@gmail.com>2013-06-12 13:46:01 -0700
commit6200fe3fad7e3630410ed1e6d18203a9ec80a155 (patch)
tree0fc699438017439a1da987ff1780d16876c35e12 /pages
parent07e94c2eb5f36fd295204f4e4e81ce813c1f2150 (diff)
parent3a65ace8a32fa2c584adee4e75a0eccc9ee37208 (diff)
downloadpathery-6200fe3fad7e3630410ed1e6d18203a9ec80a155.tar.xz
Merge branch 'HEAD' of ssh://git@git.raylu.net/pathery
Diffstat (limited to 'pages')
-rw-r--r--pages/chat.php9
-rw-r--r--pages/mapeditor.php2
2 files changed, 7 insertions, 4 deletions
diff --git a/pages/chat.php b/pages/chat.php
index 4a14a8d..f55476f 100644
--- a/pages/chat.php
+++ b/pages/chat.php
@@ -177,11 +177,12 @@ function chatReplaceAndEncode(chat) {
//Surround all URLs with a <a> link
var URLexp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
- chat = chat.replace(URLexp, "<a href='redirect?to=$1' target='_blank' onclick='return doNothingWhenClickingLinks();'>$1</a>");
+ chat = chat.replace(URLexp, "<a href='redirect?to=$1' target='_blank' onclick='return doNothingWhenClickingLinks(this);'>$1</a>");
- //Replace # in the URL with %23
+ //Replace # with %23, & with %26, ? with %3F
chat = chat.replace(/<a href='redirect\?to=(.*?)(#)(.*?)' target='_blank'/ig, "<a href='redirect?to=$1%23$3' target='_blank'");
chat = chat.replace(/<a href='redirect\?to=(.*?)(&amp;)(.*?)' target='_blank'/ig, "<a href='redirect?to=$1%26$3' target='_blank'");
+ chat = chat.replace(/<a href='redirect\?to=(.*?)(\?)(.*?)' target='_blank'/ig, "<a href='redirect?to=$1%3F$3' target='_blank'");
//Making the bet that not all browsers do the same:
chat = chat.replace(/<a href='redirect\?to=(.*?)(&)(.*?)' target='_blank'/ig, "<a href='redirect?to=$1%26$3' target='_blank'");
@@ -284,9 +285,9 @@ function htmlEncode(value){
}
}
-function doNothingWhenClickingLinks()
+function doNothingWhenClickingLinks(self)
{
- return false;
+ return !$(self).closest('.spoiler').length;
}
//Code for checking if the window is currently visible or not
diff --git a/pages/mapeditor.php b/pages/mapeditor.php
index b86aa14..9e1e57c 100644
--- a/pages/mapeditor.php
+++ b/pages/mapeditor.php
@@ -180,6 +180,8 @@ function updateName() {
}
function changeDimensions(width, height) {
+ width = Math.Min(width, 50);
+ height = Math.Min(height, 50);
testMap.tiles = constructTiles(width, height, testMap);
//testMap.tiles[0][3] = Array('s');