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

Side by Side Diff: new-options.js

Issue 29338983: issue 3741 - Add "remove" option to list items in new options page (Closed)
Patch Set: Rebase to changeset #83 Created May 10, 2016, 2:17 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 { 326 {
327 id: "recommend-list-table", 327 id: "recommend-list-table",
328 onClick: toggleRemoveSubscription 328 onClick: toggleRemoveSubscription
329 } 329 }
330 ]); 330 ]);
331 collections.langs = new Collection( 331 collections.langs = new Collection(
332 [ 332 [
333 { 333 {
334 id: "blocking-languages-table", 334 id: "blocking-languages-table",
335 emptyText: "options_dialog_language_added_empty", 335 emptyText: "options_dialog_language_added_empty",
336 onClick: toggleRemoveSubscription 336 onClick: toggleDisableSubscription
337 }, 337 },
338 { 338 {
339 id: "blocking-languages-dialog-table", 339 id: "blocking-languages-dialog-table",
340 emptyText: "options_dialog_language_added_empty" 340 emptyText: "options_dialog_language_added_empty"
341 } 341 }
342 ]); 342 ]);
343 collections.allLangs = new Collection( 343 collections.allLangs = new Collection(
344 [ 344 [
345 { 345 {
346 id: "all-lang-table", 346 id: "all-lang-table",
347 emptyText: "options_dialog_language_other_empty", 347 emptyText: "options_dialog_language_other_empty",
348 onClick: onAddLanguageSubscriptionClick 348 onClick: onAddLanguageSubscriptionClick
349 } 349 }
350 ]); 350 ]);
351 collections.acceptableAds = new Collection( 351 collections.acceptableAds = new Collection(
352 [ 352 [
353 { 353 {
354 id: "acceptableads-table", 354 id: "acceptableads-table",
355 onClick: toggleRemoveSubscription 355 onClick: toggleRemoveSubscription
356 } 356 }
357 ]); 357 ]);
358 collections.custom = new Collection( 358 collections.custom = new Collection(
359 [ 359 [
360 { 360 {
361 id: "custom-list-table", 361 id: "custom-list-table",
362 onClick: toggleRemoveSubscription 362 onClick: toggleDisableSubscription
363 } 363 }
364 ]); 364 ]);
365 collections.whitelist = new Collection( 365 collections.whitelist = new Collection(
366 [ 366 [
367 { 367 {
368 id: "whitelisting-table", 368 id: "whitelisting-table",
369 emptyText: "options_whitelisted_empty", 369 emptyText: "options_whitelisted_empty",
370 onClick: onRemoveFilterClick 370 onClick: onRemoveFilterClick
371 } 371 }
372 ]); 372 ]);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 { 469 {
470 var list = document.getElementById("subscriptionSelector"); 470 var list = document.getElementById("subscriptionSelector");
471 var doc = new DOMParser().parseFromString(text, "application/xml"); 471 var doc = new DOMParser().parseFromString(text, "application/xml");
472 var elements = doc.documentElement.getElementsByTagName("subscription"); 472 var elements = doc.documentElement.getElementsByTagName("subscription");
473 for (var i = 0; i < elements.length; i++) 473 for (var i = 0; i < elements.length; i++)
474 { 474 {
475 var element = elements[i]; 475 var element = elements[i];
476 var subscription = Object.create(null); 476 var subscription = Object.create(null);
477 subscription.originalTitle = element.getAttribute("title"); 477 subscription.originalTitle = element.getAttribute("title");
478 subscription.url = element.getAttribute("url"); 478 subscription.url = element.getAttribute("url");
479 subscription.disabled = null; 479 subscription.disabled = true;
480 subscription.downloadStatus = null; 480 subscription.downloadStatus = null;
481 subscription.homepage = null; 481 subscription.homepage = null;
482 var recommendation = Object.create(null); 482 var recommendation = Object.create(null);
483 recommendation.type = element.getAttribute("type"); 483 recommendation.type = element.getAttribute("type");
484 var prefix = element.getAttribute("prefixes"); 484 var prefix = element.getAttribute("prefixes");
485 if (prefix) 485 if (prefix)
486 { 486 {
487 prefix = prefix.replace(/\W/g, "_"); 487 prefix = prefix.replace(/\W/g, "_");
488 subscription.title = getMessage("options_language_" + prefix); 488 subscription.title = getMessage("options_language_" + prefix);
489 } 489 }
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 }); 1117 });
1118 ext.backgroundPage.sendMessage( 1118 ext.backgroundPage.sendMessage(
1119 { 1119 {
1120 type: "subscriptions.listen", 1120 type: "subscriptions.listen",
1121 filter: ["added", "disabled", "homepage", "lastDownload", "removed", 1121 filter: ["added", "disabled", "homepage", "lastDownload", "removed",
1122 "title", "downloadStatus", "downloading"] 1122 "title", "downloadStatus", "downloading"]
1123 }); 1123 });
1124 1124
1125 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 1125 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
1126 })(); 1126 })();
OLDNEW

Powered by Google App Engine
This is Rietveld