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

Side by Side Diff: chrome/content/ui/filters-backup.js

Issue 29340533: Issue 3955 - Set required ABP version properly when exporting filter lists with CSS property filters (Closed)
Patch Set: Created April 19, 2016, 12:36 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
« no previous file with comments | « no previous file | chrome/content/ui/utils.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 continue; 308 continue;
309 // Skip group headers 309 // Skip group headers
310 if (filter instanceof CommentFilter && this.GROUPTITLE_REGEXP.test(filte r.text)) 310 if (filter instanceof CommentFilter && this.GROUPTITLE_REGEXP.test(filte r.text))
311 continue; 311 continue;
312 list.push(filter.text); 312 list.push(filter.text);
313 313
314 if (filter instanceof ElemHideException && Services.vc.compare(minVersio n, "2.1") < 0) 314 if (filter instanceof ElemHideException && Services.vc.compare(minVersio n, "2.1") < 0)
315 minVersion = "2.1"; 315 minVersion = "2.1";
316 316
317 if (filter instanceof RegExpFilter && filter.contentType & (RegExpFilter .typeMap.GENERICHIDE | RegExpFilter.typeMap.GENERICBLOCK) && Services.vc.compare (minVersion, "2.6.12") < 0) 317 if (filter instanceof RegExpFilter && filter.contentType & (RegExpFilter .typeMap.GENERICHIDE | RegExpFilter.typeMap.GENERICBLOCK) && Services.vc.compare (minVersion, "2.6.12") < 0)
318 minVersion = "2.6.12"; 318 minVersion = "2.6.12";
319
320 if (filter instanceof CSSPropertyFilter && Services.vc.compare(minVersio n, "2.7.3") < 0)
321 minVersion = "2.7.3";
319 } 322 }
320 } 323 }
321 list.unshift("[Adblock Plus " + minVersion + "]"); 324 list.unshift("[Adblock Plus " + minVersion + "]");
322 325
323 // Insert checksum. Have to add an empty line to the end of the list to 326 // Insert checksum. Have to add an empty line to the end of the list to
324 // account for the trailing newline in the file. 327 // account for the trailing newline in the file.
325 list.push(""); 328 list.push("");
326 let checksum = Utils.generateChecksum(list); 329 let checksum = Utils.generateChecksum(list);
327 list.pop(); 330 list.pop();
328 if (checksum) 331 if (checksum)
329 list.splice(1, 0, "! Checksum: " + checksum); 332 list.splice(1, 0, "! Checksum: " + checksum);
330 333
331 IO.writeToFile(file, list, function(e) 334 IO.writeToFile(file, list, function(e)
332 { 335 {
333 if (e) 336 if (e)
334 { 337 {
335 Cu.reportError(e); 338 Cu.reportError(e);
336 Utils.alert(window, E("backupButton").getAttribute("_backupError"), E("b ackupButton").getAttribute("_backupDialogTitle")); 339 Utils.alert(window, E("backupButton").getAttribute("_backupError"), E("b ackupButton").getAttribute("_backupDialogTitle"));
337 } 340 }
338 }); 341 });
339 } 342 }
340 }; 343 };
341 344
342 window.addEventListener("load", function() 345 window.addEventListener("load", function()
343 { 346 {
344 Backup.init(); 347 Backup.init();
345 }, false); 348 }, false);
OLDNEW
« no previous file with comments | « no previous file | chrome/content/ui/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld