aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-11-17 19:09:49 +0100
committerArthurHoaro <arthur@hoa.ro>2018-07-28 11:26:12 +0200
commite87f57c75890fe619e454fed3d7077a2eb63ac0d (patch)
tree7f59efe315ce08126ebe77632c55a3b16416c960
parentab6c848c86e2fa85d0ac131c31dc337a48a7d055 (diff)
downloadShaarli-e87f57c75890fe619e454fed3d7077a2eb63ac0d.tar.gz
Shaarli-e87f57c75890fe619e454fed3d7077a2eb63ac0d.tar.zst
Shaarli-e87f57c75890fe619e454fed3d7077a2eb63ac0d.zip
Remove Firefox Social API shaare
Firefox Social support has been dropped in Firefox 57. Related to #1023
-rw-r--r--assets/default/js/base.js33
-rw-r--r--tpl/default/tools.html17
-rw-r--r--tpl/vintage/tools.html32
3 files changed, 0 insertions, 82 deletions
diff --git a/assets/default/js/base.js b/assets/default/js/base.js
index 5cf037c2..8bf79d3e 100644
--- a/assets/default/js/base.js
+++ b/assets/default/js/base.js
@@ -98,29 +98,6 @@ function htmlEntities(str) {
98 return str.replace(/[\u00A0-\u9999<>&]/gim, i => `&#${i.charCodeAt(0)};`); 98 return str.replace(/[\u00A0-\u9999<>&]/gim, i => `&#${i.charCodeAt(0)};`);
99} 99}
100 100
101function activateFirefoxSocial(node) {
102 const loc = location.href;
103 const baseURL = loc.substring(0, loc.lastIndexOf('/') + 1);
104
105 const data = {
106 name: document.title,
107 description: document.getElementById('translation-delete-link').innerHTML,
108 author: 'Shaarli',
109 version: '1.0.0',
110
111 iconURL: `${baseURL}/images/favicon.ico`,
112 icon32URL: `${baseURL}/images/favicon.ico`,
113 icon64URL: `${baseURL}/images/favicon.ico`,
114
115 shareURL: `${baseURL}?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi`,
116 homepageURL: baseURL,
117 };
118 node.setAttribute('data-service', JSON.stringify(data));
119
120 const activate = new CustomEvent('ActivateSocialFeature');
121 node.dispatchEvent(activate);
122}
123
124/** 101/**
125 * Add the class 'hidden' to city options not attached to the current selected continent. 102 * Add the class 'hidden' to city options not attached to the current selected continent.
126 * 103 *
@@ -433,16 +410,6 @@ function init(description) {
433 }); 410 });
434 }); 411 });
435 412
436 /**
437 * Firefox Social
438 */
439 const ffButton = document.getElementById('ff-social-button');
440 if (ffButton != null) {
441 ffButton.addEventListener('click', (event) => {
442 activateFirefoxSocial(event.target);
443 });
444 }
445
446 const continent = document.getElementById('continent'); 413 const continent = document.getElementById('continent');
447 const city = document.getElementById('city'); 414 const city = document.getElementById('city');
448 if (continent != null && city != null) { 415 if (continent != null && city != null) {
diff --git a/tpl/default/tools.html b/tpl/default/tools.html
index 20060994..6b4d7bec 100644
--- a/tpl/default/tools.html
+++ b/tpl/default/tools.html
@@ -120,23 +120,6 @@
120 </div> 120 </div>
121</div> 121</div>
122 122
123{if="$sslenabled"}
124 <div class="pure-g">
125 <div class="pure-u-lg-1-3 pure-u-1-24"></div>
126 <div class="pure-u-lg-1-3 pure-u-22-24 page-form page-form-light">
127 <h2 class="window-title">Firefox Social API</h2>
128 <p>{'You need to browse your Shaarli over <strong>HTTPS</strong> to use this functionality.'|t}</p>
129
130 <div class="tools-item">
131 <a title="{'Click on this button to add Shaarli to the 'Share this page' button in Firefox"
132 id="ff-social-button">
133 <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ {'Add to'|t} Firefox Social</span>
134 </a>
135 </div>
136 </div>
137 </div>
138{/if}
139
140<div class="pure-g"> 123<div class="pure-g">
141 <div class="pure-u-lg-1-3 pure-u-1-24"></div> 124 <div class="pure-u-lg-1-3 pure-u-1-24"></div>
142 <div class="pure-u-lg-1-3 pure-u-22-24 page-form page-form-light"> 125 <div class="pure-u-lg-1-3 pure-u-22-24 page-form page-form-light">
diff --git a/tpl/vintage/tools.html b/tpl/vintage/tools.html
index 3194844a..1cef726e 100644
--- a/tpl/vintage/tools.html
+++ b/tpl/vintage/tools.html
@@ -55,13 +55,6 @@
55 </span> 55 </span>
56 </a><br><br> 56 </a><br><br>
57 57
58 {if="$sslenabled"}
59 <a class="smallbutton" onclick="activateFirefoxSocial(this)"><b>✚Add to Firefox social</b></a>
60 <a href="#">
61 <span>&#x21D0; Click on this button to add Shaarli to the "Share this page" button in Firefox.</span>
62 </a><br><br>
63 {/if}
64
65 {loop="$tools_plugin"} 58 {loop="$tools_plugin"}
66 {$value} 59 {$value}
67 {/loop} 60 {/loop}
@@ -69,31 +62,6 @@
69 <div class="clear"></div> 62 <div class="clear"></div>
70 63
71 <script> 64 <script>
72 {if="$sslenabled"}
73 function activateFirefoxSocial(node) {
74 var loc = location.href;
75 var baseURL = loc.substring(0, loc.lastIndexOf("/"));
76
77 // Keeping the data separated (ie. not in the DOM) so that it's maintainable and diffable.
78 var data = {
79 name: "{$shaarlititle}",
80 description: "The personal, minimalist, super-fast, no-database delicious clone.",
81 author: "Shaarli",
82 version: "1.0.0",
83
84 iconURL: baseURL + "/img/favicon.ico",
85 icon32URL: baseURL + "/img/favicon.ico",
86 icon64URL: baseURL + "/img/favicon.ico",
87
88 shareURL: baseURL + "{noparse}?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi{/noparse}",
89 homepageURL: baseURL
90 };
91 node.setAttribute("data-service", JSON.stringify(data));
92
93 var activate = new CustomEvent("ActivateSocialFeature");
94 node.dispatchEvent(activate);
95 }
96 {/if}
97 function alertBookmarklet() { 65 function alertBookmarklet() {
98 alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...'); 66 alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...');
99 return false; 67 return false;