43 "SBBrandedFormattedString",
44 "SBFormattedCountString",
45 "SBStringBrandShortName",
46 "SBStringGetDefaultBundle",
47 "SBStringGetBrandBundle",
58 const Cc = Components.classes;
59 const Ci = Components.interfaces;
60 const Cr = Components.results
69 var gSBStringDefaultBundle =
null;
93 function SBString(aKey, aDefault, aStringBundle) {
100 if ((typeof(aDefault) !=
"undefined") && (aDefault !==
null))
105 value = aStringBundle.GetStringFromName(aKey);
159 if ((typeof(aDefault) !=
"undefined") && (aDefault !==
null))
164 value = aStringBundle.formatStringFromName(aKey, aParams, aParams.length);
227 if (!aStringBundle) {
249 var
value = aKeyBase;
250 if ((typeof(aDefault) !=
"undefined") && (aDefault !==
null))
255 value = aStringBundle.formatStringFromName(key, params, params.length);
286 if (!gSBStringDefaultBundle)
289 return gSBStringDefaultBundle;
302 Cc[
"@mozilla.org/intl/stringbundle;1"]
303 .getService(
Ci.nsIStringBundleService)
304 .createBundle(
"chrome://branding/locale/brand.properties");
352 this._stringBundleService =
Cc[
"@mozilla.org/intl/stringbundle;1"]
353 .getService(
Ci.nsIStringBundleService);
357 aBundle =
"chrome://songbird/locale/songbird.properties";
360 this._bundleList = [];
363 this._loadBundle(aBundle);
378 _stringBundleService:
null,
393 get:
function SBStringBundle_get(aKey, aDefault) {
396 if ((typeof(aDefault) !=
"undefined") && (aDefault !==
null))
400 for (var
i = 0;
i < this._bundleList.length;
i++) {
401 var
bundle = this._bundleList[
i];
403 value = bundle.GetStringFromName(aKey);
409 value = this._applySubstitutions(value);
428 format:
function SBStringBundle_format(aKey, aParams, aDefault) {
431 if ((typeof(aDefault) !=
"undefined") && (aDefault !==
null))
435 for (var
i = 0;
i < this._bundleList.length;
i++) {
436 var
bundle = this._bundleList[
i];
438 value = bundle.formatStringFromName(aKey, aParams, aParams.length);
444 value = this._applySubstitutions(value);
470 formatCountString:
function SBStringBundle_formatCountString(aKeyBase,
489 var
value = aKeyBase;
490 if ((typeof(aDefault) !=
"undefined") && (aDefault !==
null))
494 for (var
i = 0;
i < this._bundleList.length;
i++) {
495 var
bundle = this._bundleList[
i];
497 value = bundle.formatStringFromName(key, params, params.length);
503 value = this._applySubstitutions(value);
523 _loadBundle:
function SBStringBundle__loadBundle(aBundle) {
527 if (typeof(bundle) ==
"string")
528 bundle = this._stringBundleService.createBundle(bundle);
531 this._bundleList.push(bundle);
534 var includeBundleList;
537 bundle.GetStringFromName(
"include_bundle_list").split(
",");
539 includeBundleList = [];
543 for (var
i = 0;
i < includeBundleList.length;
i++) {
544 this._loadBundle(includeBundleList[
i]);
555 _applySubstitutions:
function SBStringBundle__applySubstitutions(aString) {
558 var replaceFunc =
function(aMatch, aKey) {
561 return _this.get(aKey,
"");
565 return aString.replace(/&([^&;]*);/g, replaceFunc);
593 add:
function StringSet_add(aStringSet, aString, aDelimiter) {
595 var delimiter = aDelimiter;
601 var stringSet = aStringSet.split(delimiter);
602 if (stringSet.indexOf(aString) < 0)
603 stringSet.push(aString);
606 return stringSet.join(delimiter);
622 remove:
function StringSet_remove(aStringSet, aString, aDelimiter) {
624 var delimiter = aDelimiter;
630 var stringSet = aStringSet.split(delimiter);
631 var stringCount = stringSet.length;
632 for (var
i = stringCount - 1;
i >= 0;
i--) {
633 if (stringSet[
i] == aString)
634 stringSet.splice(
i, 1);
638 return stringSet.join(delimiter);
654 contains:
function StringSet_contains(aStringSet, aString, aDelimiter) {
656 var delimiter = aDelimiter;
662 var stringSet = aStringSet.split(delimiter);
663 return (stringSet.indexOf(aString) >= 0);
function SBBrandedString(aKey, aDefault, aStringBundle)
function SBFormattedString(aKey, aParams, aDefault, aStringBundle)
function SBStringGetDefaultBundle()
function SBBrandedFormattedString(aKey, aParams, aDefault, aStringBundle)
ui plugin add("draggable","cursor",{start:function(e, ui){var t=$('body');if(t.css("cursor")) ui.options._cursor=t.css("cursor");t.css("cursor", ui.options.cursor);}, stop:function(e, ui){if(ui.options._cursor)$('body').css("cursor", ui.options._cursor);}})
function SBStringGetBrandBundle()
function SBStringBrandShortName()
function SBString(aKey, aDefault, aStringBundle)
function SBFormattedCountString(aKeyBase, aCount, aParams, aDefault, aStringBundle)
DataRemote prototype constructor
function SBStringBundle(aBundle)
restoreHistoryPrecursor aCount
_getSelectedPageStyle s i