Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: popup.js

Issue 29692555: Issue 5613 - Removal of social media: Share this number (Closed)
Patch Set: Addressed Manvel and Dave's feedback Created Feb. 19, 2018, 9:52 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « popup.html ('k') | skin/popup.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: popup.js
===================================================================
--- a/popup.js
+++ b/popup.js
@@ -17,33 +17,6 @@
"use strict";
-const shareURL = "https://adblockplus.org/";
-const messageMark = {};
-
-const shareLinks = {
- facebook: ["https://www.facebook.com/dialog/feed", {
- app_id: "475542399197328",
- link: shareURL,
- redirect_uri: "https://www.facebook.com/",
- ref: "adcounter",
- name: messageMark,
- actions: JSON.stringify([
- {
- name: browser.i18n.getMessage("stats_share_download"),
- link: shareURL
- }
- ])
- }],
- gplus: ["https://plus.google.com/share", {
- url: shareURL
- }],
- twitter: ["https://twitter.com/intent/tweet", {
- text: messageMark,
- url: shareURL,
- via: "AdblockPlus"
- }]
-};
-
let tab = null;
function getPref(key, callback)
@@ -191,24 +164,6 @@
insertMessage(element, after, links);
}
-function createShareLink(network, blockedCount)
-{
- let url = shareLinks[network][0];
- let params = shareLinks[network][1];
-
- let querystring = [];
- for (let key in params)
- {
- let value = params[key];
- if (value == messageMark)
- value = browser.i18n.getMessage("stats_share_message", blockedCount);
- querystring.push(
- encodeURIComponent(key) + "=" + encodeURIComponent(value)
- );
- }
- return url + "?" + querystring.join("&");
-}
-
function updateStats()
{
let statsPage = document.getElementById("stats-page");
@@ -230,27 +185,6 @@
});
}
-function share(event)
-{
- getPref("blocked_total", blockedTotal =>
- {
- // Easter Egg
- if (blockedTotal <= 9000 || blockedTotal >= 10000)
- {
- blockedTotal = blockedTotal.toLocaleString();
- }
- else
- {
- blockedTotal = browser.i18n.getMessage("stats_over",
- (9000).toLocaleString());
- }
-
- browser.tabs.create({
- url: createShareLink(event.target.dataset.social, blockedTotal)
- });
- });
-}
-
function toggleIconNumber()
{
togglePref("show_statsinicon", showStatsInIcon =>
@@ -343,7 +277,6 @@
});
}
- document.getElementById("share-box").addEventListener("click", share);
let showIconNumber = document.getElementById("show-iconnumber");
getPref("show_statsinicon", showStatsInIcon =>
{
« no previous file with comments | « popup.html ('k') | skin/popup.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld