]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
added Mozilla Social API Sharing method - better late than ever
authorThomas Citharel <tcit@tcit.fr>
Tue, 12 May 2015 13:46:39 +0000 (15:46 +0200)
committerThomas Citharel <tcit@tcit.fr>
Tue, 12 May 2015 13:46:39 +0000 (15:46 +0200)
themes/baggy/_head.twig
themes/baggy/config.twig

index b9f1e5d9d5c65d7b58a04153721b9815f3656525..1546a7b91d88101ea35bf8a5ff4ca75a9f2f950c 100755 (executable)
         <script src="{{ poche_url }}themes/_global/js/popupForm.js"></script>
         <script src="{{ poche_url }}themes/_global/js/keyboard.js"></script>
         <script src="{{ poche_url }}themes/{{theme}}/js/closeMessage.js"></script>
+        <!-- Enable Firefox Social Services
+        script put there because of the call to poche_url -->
+
+        <script>
+        var baseurl = "{{ poche_url }}";
+        console.log(baseurl);
+        var data = {
+
+                "name": "wallabag",
+                "iconURL": baseurl + "/themes/_global/img/appicon/firefox-service-icon-16.png",
+                "icon32URL": baseurl + "/themes/_global/img/appicon/firefox-service-icon-32.png",
+                "icon64URL": baseurl + "/themes/_global/img/appicon/firefox-service-icon-64.png",
+
+                "shareURL": baseurl + "/index.php?action=add&plainurl=%{url}",
+
+                "description": "wallabag Extension for Firefox - The (soon to become) best way to save articles, videos and more",
+                "author": "Thomas Citharel",
+                "homepageURL": "https://wallabag.org",
+                "origin": "https://wallabag.org",
+                "postActivationURL": "https://wallabag.org",
+
+                "version": "0.1"
+        };
+        function activateSocialFeature(node) {
+                var event = new CustomEvent("ActivateSocialFeature");
+                node.setAttribute("data-service", JSON.stringify(data));
+                node.dispatchEvent(event);
+        }
+        </script>
index b4765602e7877554d33eb825f6d95a6b5020313f..8562f1337b6699de60dcae0c4e920ff5f1a851e9 100755 (executable)
@@ -16,7 +16,8 @@
             </p>
             <h3>{% trans "Browser Addons" %}</h3>
             <ul>
-                <li><a href="https://addons.mozilla.org/firefox/addon/wallabag/" target="_blank">{% trans "Firefox Add-On" %}</a></li>
+                <li><a href="https://addons.mozilla.org/firefox/addon/wallabag/" target="_blank">{% trans "Standard Firefox Add-On" %}</a></li>
+                <li><button onclick="activateSocialFeature(this)">Mozilla Services Social API Extension</button>
                 <li><a href="https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj" target="_blank">{% trans "Chrome Extension" %}</a></li>
             </ul>
             <h3>{% trans "Mobile Apps" %}</h3>