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

Unified Diff: chrome/content/ui/utils.js

Issue 29338626: Issue 3835 - Update dependency on adblockpluscore to revision 2d4888611240 (Closed)
Patch Set: Fixed updateRequired replacement Created March 19, 2016, 6:57 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/content/ui/sidebar.js ('k') | dependencies » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/utils.js
===================================================================
--- a/chrome/content/ui/utils.js
+++ b/chrome/content/ui/utils.js
@@ -52,15 +52,34 @@ var {Utils} = require("utils");
* Shortcut for document.getElementById(id)
*/
function E(id)
{
return document.getElementById(id);
}
/**
+ * Determines subscription's title as it should be displayed in the UI.
+ * @return {String}
+ * subscription's title or an appropriate default title if none present
+ */
+function getSubscriptionTitle(/**Subscription*/ subscription)
+{
+ if (subscription.title)
+ return subscription.title;
+
+ if (subscription instanceof DownloadableSubscription)
+ return subscription.url;
+
+ if (subscription instanceof SpecialSubscription && subscription.defaults)
+ return Utils.getString(subscription.defaults + "Group_title");
+
+ return Utils.getString("newGroup_title");
+}
+
+/**
* Split up all labels into the label and access key portions.
*/
document.addEventListener("DOMContentLoaded", function splitAllLabelsHandler()
{
document.removeEventListener("DOMContentLoaded", splitAllLabelsHandler, false);
Utils.splitAllLabels(document);
}, false);
« no previous file with comments | « chrome/content/ui/sidebar.js ('k') | dependencies » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld