OLD | NEW |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 /** | 51 /** |
52 * Shortcut for document.getElementById(id) | 52 * Shortcut for document.getElementById(id) |
53 */ | 53 */ |
54 function E(id) | 54 function E(id) |
55 { | 55 { |
56 return document.getElementById(id); | 56 return document.getElementById(id); |
57 } | 57 } |
58 | 58 |
59 /** | 59 /** |
| 60 * Determines subscription's title as it should be displayed in the UI. |
| 61 * @return {String} |
| 62 * subscription's title or an appropriate default title if none present |
| 63 */ |
| 64 function getSubscriptionTitle(/**Subscription*/ subscription) |
| 65 { |
| 66 if (subscription.title) |
| 67 return subscription.title; |
| 68 |
| 69 if (subscription instanceof DownloadableSubscription) |
| 70 return subscription.url; |
| 71 |
| 72 if (subscription instanceof SpecialSubscription && subscription.defaults) |
| 73 return Utils.getString(subscription.defaults + "Group_title"); |
| 74 |
| 75 return Utils.getString("newGroup_title"); |
| 76 } |
| 77 |
| 78 /** |
60 * Split up all labels into the label and access key portions. | 79 * Split up all labels into the label and access key portions. |
61 */ | 80 */ |
62 document.addEventListener("DOMContentLoaded", function splitAllLabelsHandler() | 81 document.addEventListener("DOMContentLoaded", function splitAllLabelsHandler() |
63 { | 82 { |
64 document.removeEventListener("DOMContentLoaded", splitAllLabelsHandler, false)
; | 83 document.removeEventListener("DOMContentLoaded", splitAllLabelsHandler, false)
; |
65 Utils.splitAllLabels(document); | 84 Utils.splitAllLabels(document); |
66 }, false); | 85 }, false); |
OLD | NEW |