]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #896 from ArthurHoaro/hotfix/firefox-social-subdir
authorVirtualTam <virtualtam+github@flibidi.net>
Sun, 23 Jul 2017 17:09:06 +0000 (19:09 +0200)
committerGitHub <noreply@github.com>
Sun, 23 Jul 2017 17:09:06 +0000 (19:09 +0200)
Fix Firefox Social button in the default theme

tpl/default/js/shaarli.js

index b120c91e04841521606b9f3cb054c732373b6cfa..4f49affa3321226024bae670117d7851ba385141 100644 (file)
@@ -606,7 +606,7 @@ function htmlEntities(str)
 
 function activateFirefoxSocial(node) {
     var loc = location.href;
-    var baseURL = loc.substring(0, loc.lastIndexOf("/"));
+    var baseURL = loc.substring(0, loc.lastIndexOf("/") + 1);
 
     // Keeping the data separated (ie. not in the DOM) so that it's maintainable and diffable.
     var data = {
@@ -619,7 +619,7 @@ function activateFirefoxSocial(node) {
         icon32URL: baseURL + "/images/favicon.ico",
         icon64URL: baseURL + "/images/favicon.ico",
 
-        shareURL: baseURL + "{noparse}?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi{/noparse}",
+        shareURL: baseURL + "?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi",
         homepageURL: baseURL
     };
     node.setAttribute("data-service", JSON.stringify(data));