Index: lib/utils.js |
diff --git a/lib/utils.js b/lib/utils.js |
index e218dab6258ccbecc283e62c3d27c155cf973774..04327602e3708010fd4d04816b005d4af5eb5cd3 100644 |
--- a/lib/utils.js |
+++ b/lib/utils.js |
@@ -65,59 +65,6 @@ let Utils = exports.Utils = { |
// We cannot calculate MD5 checksums yet :-( |
return null; |
}, |
- checkLocalePrefixMatch(prefixes) |
- { |
- if (!prefixes) |
- return null; |
- |
- for (let prefix of prefixes.split(",")) |
- { |
- if (new RegExp("^" + prefix + "\\b").test(this.appLocale)) |
- return prefix; |
- } |
- |
- return null; |
- }, |
- |
- chooseFilterSubscription(subscriptions) |
- { |
- let selectedItem = null; |
- let selectedPrefix = null; |
- let matchCount = 0; |
- for (let subscription of subscriptions) |
- { |
- if (!selectedItem) |
- selectedItem = subscription; |
- |
- let prefix = Utils.checkLocalePrefixMatch( |
- subscription.getAttribute("prefixes") |
- ); |
- if (prefix) |
- { |
- if (!selectedPrefix || selectedPrefix.length < prefix.length) |
- { |
- selectedItem = subscription; |
- selectedPrefix = prefix; |
- matchCount = 1; |
- } |
- else if (selectedPrefix && selectedPrefix.length == prefix.length) |
- { |
- matchCount++; |
- |
- // If multiple items have a matching prefix of the same length: |
- // Select one of the items randomly, probability should be the same |
- // for all items. So we replace the previous match here with |
- // probability 1/N (N being the number of matches). |
- if (Math.random() * matchCount < 1) |
- { |
- selectedItem = subscription; |
- selectedPrefix = prefix; |
- } |
- } |
- } |
- } |
- return selectedItem; |
- }, |
getDocLink(linkID) |
{ |