]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Remove Firefox Social API shaare 1026/head
authorArthurHoaro <arthur@hoa.ro>
Fri, 17 Nov 2017 18:09:49 +0000 (19:09 +0100)
committerArthurHoaro <arthur@hoa.ro>
Sat, 28 Jul 2018 09:26:12 +0000 (11:26 +0200)
Firefox Social support has been dropped in Firefox 57.

Related to #1023

assets/default/js/base.js
tpl/default/tools.html
tpl/vintage/tools.html

index 5cf037c2c99a6ad620a86bee4a88447d1c0a6b12..8bf79d3e4c612efac7e815ca421b3c2acff14023 100644 (file)
@@ -98,29 +98,6 @@ function htmlEntities(str) {
   return str.replace(/[\u00A0-\u9999<>&]/gim, i => `&#${i.charCodeAt(0)};`);
 }
 
-function activateFirefoxSocial(node) {
-  const loc = location.href;
-  const baseURL = loc.substring(0, loc.lastIndexOf('/') + 1);
-
-  const data = {
-    name: document.title,
-    description: document.getElementById('translation-delete-link').innerHTML,
-    author: 'Shaarli',
-    version: '1.0.0',
-
-    iconURL: `${baseURL}/images/favicon.ico`,
-    icon32URL: `${baseURL}/images/favicon.ico`,
-    icon64URL: `${baseURL}/images/favicon.ico`,
-
-    shareURL: `${baseURL}?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi`,
-    homepageURL: baseURL,
-  };
-  node.setAttribute('data-service', JSON.stringify(data));
-
-  const activate = new CustomEvent('ActivateSocialFeature');
-  node.dispatchEvent(activate);
-}
-
 /**
  * Add the class 'hidden' to city options not attached to the current selected continent.
  *
@@ -433,16 +410,6 @@ function init(description) {
     });
   });
 
-  /**
-   * Firefox Social
-   */
-  const ffButton = document.getElementById('ff-social-button');
-  if (ffButton != null) {
-    ffButton.addEventListener('click', (event) => {
-      activateFirefoxSocial(event.target);
-    });
-  }
-
   const continent = document.getElementById('continent');
   const city = document.getElementById('city');
   if (continent != null && city != null) {
index 20060994452eafce857378cbff0687dbff8cccdb..6b4d7bec6ad0b3b79d1c805fb715ff01942617d0 100644 (file)
   </div>
 </div>
 
-{if="$sslenabled"}
-  <div class="pure-g">
-    <div class="pure-u-lg-1-3 pure-u-1-24"></div>
-    <div class="pure-u-lg-1-3 pure-u-22-24 page-form page-form-light">
-      <h2 class="window-title">Firefox Social API</h2>
-      <p>{'You need to browse your Shaarli over <strong>HTTPS</strong> to use this functionality.'|t}</p>
-
-      <div class="tools-item">
-        <a title="{'Click on this button to add Shaarli to the 'Share this page' button in Firefox"
-           id="ff-social-button">
-        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ {'Add to'|t} Firefox Social</span>
-        </a>
-      </div>
-    </div>
-  </div>
-{/if}
-
 <div class="pure-g">
   <div class="pure-u-lg-1-3 pure-u-1-24"></div>
   <div class="pure-u-lg-1-3 pure-u-22-24 page-form page-form-light">
index 3194844adfb6a49379b95b559691c9ed204c0f7e..1cef726eef357aedd4a27779dcb85990b2effe55 100644 (file)
                        </span>
                </a><br><br>
 
-               {if="$sslenabled"}
-               <a class="smallbutton" onclick="activateFirefoxSocial(this)"><b>✚Add to Firefox social</b></a>
-               <a href="#">
-                       <span>&#x21D0; Click on this button to add Shaarli to the "Share this page" button in Firefox.</span>
-               </a><br><br>
-               {/if}
-
                {loop="$tools_plugin"}
             {$value}
         {/loop}
                <div class="clear"></div>
 
                <script>
-                       {if="$sslenabled"}
-                       function activateFirefoxSocial(node) {
-                               var loc = location.href;
-                               var baseURL = loc.substring(0, loc.lastIndexOf("/"));
-
-                               // Keeping the data separated (ie. not in the DOM) so that it's maintainable and diffable.
-                               var data = {
-                                       name: "{$shaarlititle}",
-                                       description: "The personal, minimalist, super-fast, no-database delicious clone.",
-                                       author: "Shaarli",
-                                       version: "1.0.0",
-
-                                       iconURL: baseURL + "/img/favicon.ico",
-                                       icon32URL: baseURL + "/img/favicon.ico",
-                                       icon64URL: baseURL + "/img/favicon.ico",
-
-                                       shareURL: baseURL + "{noparse}?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi{/noparse}",
-                                       homepageURL: baseURL
-                               };
-                               node.setAttribute("data-service", JSON.stringify(data));
-
-                               var activate = new CustomEvent("ActivateSocialFeature");
-                               node.dispatchEvent(activate);
-                       }
-                       {/if}
                        function alertBookmarklet() {
                                alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...');
                                return false;