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

Delta Between Two Patch Sets: lib/utils.js

Issue 29562595: Issue 2824 - Only consider ads subscriptions in chooseFilterSubscription (Closed)
Left Patch Set: Created Oct. 2, 2017, 10:18 a.m.
Right Patch Set: Fixed a typo in a comment Created Oct. 3, 2017, 10:14 a.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 | « lib/subscriptionInit.js ('k') | 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 <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 "readingDirection", 58 "readingDirection",
59 {value: direction, enumerable: true} 59 {value: direction, enumerable: true}
60 ); 60 );
61 return this.readingDirection; 61 return this.readingDirection;
62 }, 62 },
63 generateChecksum(lines) 63 generateChecksum(lines)
64 { 64 {
65 // We cannot calculate MD5 checksums yet :-( 65 // We cannot calculate MD5 checksums yet :-(
66 return null; 66 return null;
67 }, 67 },
68 checkLocalePrefixMatch(prefixes)
69 {
70 if (!prefixes)
71 return null;
72
73 for (let prefix of prefixes.split(","))
74 {
75 if (new RegExp("^" + prefix + "\\b").test(this.appLocale))
76 return prefix;
77 }
78
79 return null;
80 },
81 68
82 getDocLink(linkID) 69 getDocLink(linkID)
83 { 70 {
84 let docLink = require("prefs").Prefs.documentation_link; 71 let docLink = require("prefs").Prefs.documentation_link;
85 return docLink.replace(/%LINK%/g, linkID) 72 return docLink.replace(/%LINK%/g, linkID)
86 .replace(/%LANG%/g, Utils.appLocale); 73 .replace(/%LANG%/g, Utils.appLocale);
87 }, 74 },
88 75
89 yield() 76 yield()
90 { 77 {
91 } 78 }
92 }; 79 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld