Firefox Social support has been dropped in Firefox 57.
Related to #1023
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.
*
});
});
- /**
- * 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) {
</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">
</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}
<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;