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

Delta Between Two Patch Sets: lib/subscriptionClasses.js

Issue 6305806509146112: Issue 427 - Remove non-standard function and getter syntax (Closed)
Left Patch Set: Created May 5, 2014, 12:18 p.m.
Right Patch Set: Wow sorry for those wrong braces, I am so used to a different style that I didn't even realize what… Created May 18, 2014, 10:51 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/requestNotifier.js ('k') | lib/sync.js » ('j') | 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-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 filters: null, 61 filters: null,
62 62
63 _title: null, 63 _title: null,
64 _fixedTitle: false, 64 _fixedTitle: false,
65 _disabled: false, 65 _disabled: false,
66 66
67 /** 67 /**
68 * Title of the filter subscription 68 * Title of the filter subscription
69 * @type String 69 * @type String
70 */ 70 */
71 get title() { return this._title; }, 71 get title()
72 {
73 return this._title;
74 },
72 set title(value) 75 set title(value)
73 { 76 {
74 if (value != this._title) 77 if (value != this._title)
75 { 78 {
76 let oldValue = this._title; 79 let oldValue = this._title;
77 this._title = value; 80 this._title = value;
78 FilterNotifier.triggerListeners("subscription.title", this, value, oldValu e); 81 FilterNotifier.triggerListeners("subscription.title", this, value, oldValu e);
79 } 82 }
80 return this._title; 83 return this._title;
81 }, 84 },
82 85
83 /** 86 /**
84 * Determines whether the title should be editable 87 * Determines whether the title should be editable
85 * @type Boolean 88 * @type Boolean
86 */ 89 */
87 get fixedTitle() { return this._fixedTitle; }, 90 get fixedTitle()
91 {
92 return this._fixedTitle;
93 },
88 set fixedTitle(value) 94 set fixedTitle(value)
89 { 95 {
90 if (value != this._fixedTitle) 96 if (value != this._fixedTitle)
91 { 97 {
92 let oldValue = this._fixedTitle; 98 let oldValue = this._fixedTitle;
93 this._fixedTitle = value; 99 this._fixedTitle = value;
94 FilterNotifier.triggerListeners("subscription.fixedTitle", this, value, ol dValue); 100 FilterNotifier.triggerListeners("subscription.fixedTitle", this, value, ol dValue);
95 } 101 }
96 return this._fixedTitle; 102 return this._fixedTitle;
97 }, 103 },
98 104
99 /** 105 /**
100 * Defines whether the filters in the subscription should be disabled 106 * Defines whether the filters in the subscription should be disabled
101 * @type Boolean 107 * @type Boolean
102 */ 108 */
103 get disabled() { return this._disabled; }, 109 get disabled()
110 {
111 return this._disabled;
112 },
104 set disabled(value) 113 set disabled(value)
105 { 114 {
106 if (value != this._disabled) 115 if (value != this._disabled)
107 { 116 {
108 let oldValue = this._disabled; 117 let oldValue = this._disabled;
109 this._disabled = value; 118 this._disabled = value;
110 FilterNotifier.triggerListeners("subscription.disabled", this, value, oldV alue); 119 FilterNotifier.triggerListeners("subscription.disabled", this, value, oldV alue);
111 } 120 }
112 return this._disabled; 121 return this._disabled;
113 }, 122 },
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 return false; 295 return false;
287 }, 296 },
288 297
289 /** 298 /**
290 * See Subscription.serialize() 299 * See Subscription.serialize()
291 */ 300 */
292 serialize: function(buffer) 301 serialize: function(buffer)
293 { 302 {
294 Subscription.prototype.serialize.call(this, buffer); 303 Subscription.prototype.serialize.call(this, buffer);
295 if (this.defaults && this.defaults.length) 304 if (this.defaults && this.defaults.length)
296 buffer.push("defaults=" + this.defaults.filter(function(type) { 305 buffer.push("defaults=" + this.defaults.filter((type) => type in SpecialSu bscription.defaultsMap).join(" "));
297 return (type in SpecialSubscription.defaultsMap);
298 }).join(" "));
299 if (this._lastDownload) 306 if (this._lastDownload)
300 buffer.push("lastDownload=" + this._lastDownload); 307 buffer.push("lastDownload=" + this._lastDownload);
301 } 308 }
302 }; 309 };
303 310
304 SpecialSubscription.defaultsMap = { 311 SpecialSubscription.defaultsMap = {
305 __proto__: null, 312 __proto__: null,
306 "whitelist": WhitelistFilter, 313 "whitelist": WhitelistFilter,
307 "blocking": BlockingFilter, 314 "blocking": BlockingFilter,
308 "elemhide": ElemHideBase 315 "elemhide": ElemHideBase
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 { 368 {
362 __proto__: Subscription.prototype, 369 __proto__: Subscription.prototype,
363 370
364 _homepage: null, 371 _homepage: null,
365 _lastDownload: 0, 372 _lastDownload: 0,
366 373
367 /** 374 /**
368 * Filter subscription homepage if known 375 * Filter subscription homepage if known
369 * @type String 376 * @type String
370 */ 377 */
371 get homepage() { return this._homepage; }, 378 get homepage()
379 {
380 return this._homepage;
381 },
372 set homepage(value) 382 set homepage(value)
373 { 383 {
374 if (value != this._homepage) 384 if (value != this._homepage)
375 { 385 {
376 let oldValue = this._homepage; 386 let oldValue = this._homepage;
377 this._homepage = value; 387 this._homepage = value;
378 FilterNotifier.triggerListeners("subscription.homepage", this, value, oldV alue); 388 FilterNotifier.triggerListeners("subscription.homepage", this, value, oldV alue);
379 } 389 }
380 return this._homepage; 390 return this._homepage;
381 }, 391 },
382 392
383 /** 393 /**
384 * Time of the last subscription download (in seconds since the beginning of t he epoch) 394 * Time of the last subscription download (in seconds since the beginning of t he epoch)
385 * @type Number 395 * @type Number
386 */ 396 */
387 get lastDownload() { return this._lastDownload; }, 397 get lastDownload()
398 {
399 return this._lastDownload;
400 },
388 set lastDownload(value) 401 set lastDownload(value)
389 { 402 {
390 if (value != this._lastDownload) 403 if (value != this._lastDownload)
391 { 404 {
392 let oldValue = this._lastDownload; 405 let oldValue = this._lastDownload;
393 this._lastDownload = value; 406 this._lastDownload = value;
394 FilterNotifier.triggerListeners("subscription.lastDownload", this, value, oldValue); 407 FilterNotifier.triggerListeners("subscription.lastDownload", this, value, oldValue);
395 } 408 }
396 return this._lastDownload; 409 return this._lastDownload;
397 }, 410 },
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 __proto__: RegularSubscription.prototype, 466 __proto__: RegularSubscription.prototype,
454 467
455 _downloadStatus: null, 468 _downloadStatus: null,
456 _lastCheck: 0, 469 _lastCheck: 0,
457 _errors: 0, 470 _errors: 0,
458 471
459 /** 472 /**
460 * Status of the last download (ID of a string) 473 * Status of the last download (ID of a string)
461 * @type String 474 * @type String
462 */ 475 */
463 get downloadStatus() { return this._downloadStatus; }, 476 get downloadStatus()
477 {
478 return this._downloadStatus;
479 },
464 set downloadStatus(value) 480 set downloadStatus(value)
465 { 481 {
466 let oldValue = this._downloadStatus; 482 let oldValue = this._downloadStatus;
467 this._downloadStatus = value; 483 this._downloadStatus = value;
468 FilterNotifier.triggerListeners("subscription.downloadStatus", this, value, oldValue); 484 FilterNotifier.triggerListeners("subscription.downloadStatus", this, value, oldValue);
469 return this._downloadStatus; 485 return this._downloadStatus;
470 }, 486 },
471 487
472 /** 488 /**
473 * Time of the last successful download (in seconds since the beginning of the 489 * Time of the last successful download (in seconds since the beginning of the
474 * epoch). 490 * epoch).
475 */ 491 */
476 lastSuccess: 0, 492 lastSuccess: 0,
477 493
478 /** 494 /**
479 * Time when the subscription was considered for an update last time (in secon ds 495 * Time when the subscription was considered for an update last time (in secon ds
480 * since the beginning of the epoch). This will be used to increase softExpira tion 496 * since the beginning of the epoch). This will be used to increase softExpira tion
481 * if the user doesn't use Adblock Plus for some time. 497 * if the user doesn't use Adblock Plus for some time.
482 * @type Number 498 * @type Number
483 */ 499 */
484 get lastCheck() { return this._lastCheck; }, 500 get lastCheck()
501 {
502 return this._lastCheck;
503 },
485 set lastCheck(value) 504 set lastCheck(value)
486 { 505 {
487 if (value != this._lastCheck) 506 if (value != this._lastCheck)
488 { 507 {
489 let oldValue = this._lastCheck; 508 let oldValue = this._lastCheck;
490 this._lastCheck = value; 509 this._lastCheck = value;
491 FilterNotifier.triggerListeners("subscription.lastCheck", this, value, old Value); 510 FilterNotifier.triggerListeners("subscription.lastCheck", this, value, old Value);
492 } 511 }
493 return this._lastCheck; 512 return this._lastCheck;
494 }, 513 },
495 514
496 /** 515 /**
497 * Hard expiration time of the filter subscription (in seconds since the begin ning of the epoch) 516 * Hard expiration time of the filter subscription (in seconds since the begin ning of the epoch)
498 * @type Number 517 * @type Number
499 */ 518 */
500 expires: 0, 519 expires: 0,
501 520
502 /** 521 /**
503 * Soft expiration time of the filter subscription (in seconds since the begin ning of the epoch) 522 * Soft expiration time of the filter subscription (in seconds since the begin ning of the epoch)
504 * @type Number 523 * @type Number
505 */ 524 */
506 softExpiration: 0, 525 softExpiration: 0,
507 526
508 /** 527 /**
509 * Number of download failures since last success 528 * Number of download failures since last success
510 * @type Number 529 * @type Number
511 */ 530 */
512 get errors() { return this._errors; }, 531 get errors()
532 {
533 return this._errors;
534 },
513 set errors(value) 535 set errors(value)
514 { 536 {
515 if (value != this._errors) 537 if (value != this._errors)
516 { 538 {
517 let oldValue = this._errors; 539 let oldValue = this._errors;
518 this._errors = value; 540 this._errors = value;
519 FilterNotifier.triggerListeners("subscription.errors", this, value, oldVal ue); 541 FilterNotifier.triggerListeners("subscription.errors", this, value, oldVal ue);
520 } 542 }
521 return this._errors; 543 return this._errors;
522 }, 544 },
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 if (this.softExpiration) 578 if (this.softExpiration)
557 buffer.push("softExpiration=" + this.softExpiration); 579 buffer.push("softExpiration=" + this.softExpiration);
558 if (this.errors) 580 if (this.errors)
559 buffer.push("errors=" + this.errors); 581 buffer.push("errors=" + this.errors);
560 if (this.version) 582 if (this.version)
561 buffer.push("version=" + this.version); 583 buffer.push("version=" + this.version);
562 if (this.requiredVersion) 584 if (this.requiredVersion)
563 buffer.push("requiredVersion=" + this.requiredVersion); 585 buffer.push("requiredVersion=" + this.requiredVersion);
564 } 586 }
565 }; 587 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld