Remove Firefox Social API shaare
Firefox Social support has been dropped in Firefox 57. Related to #1023
This commit is contained in:
parent
ab6c848c86
commit
e87f57c758
3 changed files with 0 additions and 82 deletions
|
@ -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) {
|
||||
|
|
|
@ -120,23 +120,6 @@
|
|||
</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">
|
||||
|
|
|
@ -55,13 +55,6 @@
|
|||
</span>
|
||||
</a><br><br>
|
||||
|
||||
{if="$sslenabled"}
|
||||
<a class="smallbutton" onclick="activateFirefoxSocial(this)"><b>✚Add to Firefox social</b></a>
|
||||
<a href="#">
|
||||
<span>⇐ 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}
|
||||
|
@ -69,31 +62,6 @@
|
|||
<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;
|
||||
|
|
Loading…
Reference in a new issue