allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/2] allura git commit: [#8010] ticket:876 Fix link hash escaping for nested comments
Date Wed, 06 Jan 2016 15:12:44 GMT
[#8010] ticket:876 Fix link hash escaping for nested comments


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/904ca25f
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/904ca25f
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/904ca25f

Branch: refs/heads/master
Commit: 904ca25f7a3c86a456f38a5b8286efa72a90fa6b
Parents: 996d82b
Author: DeV1doR <dev1dor@ukr.net>
Authored: Fri Dec 11 17:21:53 2015 +0200
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Wed Jan 6 10:12:16 2016 -0500

----------------------------------------------------------------------
 Allura/allura/public/nf/js/allura-base.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/904ca25f/Allura/allura/public/nf/js/allura-base.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/allura-base.js b/Allura/allura/public/nf/js/allura-base.js
index 3f6d45e..573448d 100644
--- a/Allura/allura/public/nf/js/allura-base.js
+++ b/Allura/allura/public/nf/js/allura-base.js
@@ -30,7 +30,16 @@
     });
     if(window.location.hash) {
         // Nested comment (reply) hash link contains a /, which must be escaped
-        $(window.location.hash.replace('/', '\\/') + '.title-pane').removeClass('closed');
+        var splited_link = window.location.hash.split('/'),
+            united_link = "";
+        for (var i = 0; i < splited_link.length; i++) {
+            if (i == 0) {
+                united_link += splited_link[i];
+            } else {
+                united_link += "\\/" + splited_link[i];
+            }
+        }
+        $(united_link + '.title-pane').removeClass('closed');
     }
 
     // Setup editable widgets


Mime
View raw message