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

Delta Between Two Patch Sets: include.postload.js

Issue 5960705870135296: Fixed genrated filter rules for elements with CSS class (Closed)
Left Patch Set: Created Jan. 24, 2014, 2:40 p.m.
Right Patch Set: Removed console.log() and simplified regex Created Jan. 24, 2014, 2:52 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 selectorList = new Array(); 296 selectorList = new Array();
297 if (elementId) 297 if (elementId)
298 { 298 {
299 clickHideFilters.push(document.domain + "###" + elementId); 299 clickHideFilters.push(document.domain + "###" + elementId);
300 selectorList.push("#" + elementId); 300 selectorList.push("#" + elementId);
301 } 301 }
302 if (elementClasses && elementClasses.length > 0) 302 if (elementClasses && elementClasses.length > 0)
303 { 303 {
304 var selector = elementClasses.map(function(elClass) 304 var selector = elementClasses.map(function(elClass)
305 { 305 {
306 return "." + elClass.replace(/([^a-z0-9_-])/i, "\\$1"); 306 return "." + elClass.replace(/([^\w-])/, "\\$1");
307 }).join(""); 307 }).join("");
308 308
309 clickHideFilters.push(document.domain + "##" + selector); 309 clickHideFilters.push(document.domain + "##" + selector);
310 selectorList.push(selector); 310 selectorList.push(selector);
311 console.log(selector);
312 } 311 }
313 if (url) 312 if (url)
314 { 313 {
315 clickHideFilters.push(relativeToAbsoluteUrl(url)); 314 clickHideFilters.push(relativeToAbsoluteUrl(url));
316 selectorList.push(elt.localName + '[src="' + url + '"]'); 315 selectorList.push(elt.localName + '[src="' + url + '"]');
317 } 316 }
318 317
319 // Show popup 318 // Show popup
320 clickHide_showDialog(e.clientX, e.clientY, clickHideFilters); 319 clickHide_showDialog(e.clientX, e.clientY, clickHideFilters);
321 320
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 585
587 clickHide_deactivate(); 586 clickHide_deactivate();
588 } 587 }
589 break; 588 break;
590 default: 589 default:
591 sendResponse({}); 590 sendResponse({});
592 break; 591 break;
593 } 592 }
594 }); 593 });
595 } 594 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld