44 dump(
"*** " +
str +
"\n");
47 var
Ci = Components.interfaces;
48 var
Cc = Components.classes;
49 var
Cr = Components.results;
52 delete this.PlacesUtils
54 Components.utils.import(
"resource://gre/modules/utils.js", tmpScope);
55 return this.PlacesUtils = tmpScope.PlacesUtils;
78 return aNode.QueryInterface(aIID);
89 get microsummaries() {
90 delete this.microsummaries;
91 return this.microsummaries =
Cc[
"@mozilla.org/microsummary/service;1"].
97 return this.RDF =
Cc[
"@mozilla.org/rdf/rdf-service;1"].
102 delete this.localStore;
103 return this.localStore = this.RDF.GetDataSource(
"rdf:local-store");
108 return this.ptm =
Cc[
"@mozilla.org/browser/placesTransactionsService;1"].
113 delete this.clipboard;
114 return this.clipboard =
Cc[
"@mozilla.org/widget/clipboard;1"].
119 delete this.URIFixup;
120 return this.URIFixup =
Cc[
"@mozilla.org/docshell/urifixup;1"].
125 delete this.ellipsis;
126 var
pref =
Cc[
"@mozilla.org/preferences-service;1"].
128 return this.ellipsis = pref.getComplexValue(
"intl.ellipsis",
129 Ci.nsIPrefLocalizedString).data;
132 get privateBrowsing() {
133 delete this.privateBrowsing;
134 return this.privateBrowsing =
Cc[
"@mozilla.org/privatebrowsing;1"].
144 createFixedURI:
function PU_createFixedURI(aSpec) {
145 return this.URIFixup.createFixupURI(aSpec, 0);
154 _wrapString:
function PU__wrapString(aString) {
155 var s =
Cc[
"@mozilla.org/supports-string;1"].
165 const PLACES_STRING_BUNDLE_URI =
166 "chrome://browser/locale/places/places.properties";
168 return this._bundle =
Cc[
"@mozilla.org/intl/stringbundle;1"].
170 createBundle(PLACES_STRING_BUNDLE_URI);
173 getFormattedString:
function PU_getFormattedString(
key, params) {
174 return this._bundle.formatStringFromName(
key, params, params.length);
177 getString:
function PU_getString(
key) {
178 return this._bundle.GetStringFromName(
key);
192 _getURIItemCopyTransaction:
function (
aData, aContainer, aIndex) {
193 return this.ptm.createItem(PlacesUtils._uri(
aData.uri), aContainer, aIndex,
211 _getBookmarkItemCopyTransaction:
212 function PU__getBookmarkItemCopyTransaction(
aData, aContainer, aIndex,
213 aExcludeAnnotations) {
214 var itemURL = PlacesUtils._uri(
aData.uri);
215 var itemTitle =
aData.title;
217 var annos =
aData.annos || [];
220 if (aExcludeAnnotations)
221 excludeAnnos = excludeAnnos.concat(aExcludeAnnotations);
222 annos = annos.filter(
function(
aValue, aIndex, aArray) {
223 return excludeAnnos.indexOf(
aValue.name) == -1;
227 childTxns.push(this.ptm.editItemDateAdded(
null,
aData.dateAdded));
228 if (
aData.lastModified)
229 childTxns.push(this.ptm.editItemLastModified(
null,
aData.lastModified));
231 var tags =
aData.tags.split(
", ");
234 var storedTags = PlacesUtils.tagging.getTagsForURI(itemURL, {});
235 tags = tags.filter(
function (aTag) {
236 return (storedTags.indexOf(aTag) == -1);
239 childTxns.push(this.ptm.tagURI(itemURL, tags));
242 return this.ptm.createItem(itemURL, aContainer, aIndex, itemTitle, keyword,
258 _getFolderCopyTransaction:
259 function PU__getFolderCopyTransaction(
aData, aContainer, aIndex) {
261 function getChildItemsTransactions(aChildren) {
262 var childItemsTransactions = [];
263 var cc = aChildren.length;
265 for (var
i = 0;
i < cc; ++
i) {
267 var
node = aChildren[
i];
272 if (aIndex != PlacesUtils.bookmarks.DEFAULT_INDEX)
275 if (node.type == PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER) {
276 if (node.livemark && node.annos)
277 txn =
self._getLivemarkCopyTransaction(node, aContainer, index);
279 txn =
self._getFolderCopyTransaction(node, aContainer, index);
281 else if (node.type == PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR)
282 txn =
self.ptm.createSeparator(-1, index);
283 else if (node.type == PlacesUtils.TYPE_X_MOZ_PLACE)
284 txn =
self._getBookmarkItemCopyTransaction(node, -1, index);
286 NS_ASSERT(txn,
"Unexpected item under a bookmarks folder");
288 childItemsTransactions.push(txn);
290 return childItemsTransactions;
294 if (aContainer == PlacesUtils.tagsFolderId) {
296 if (
aData.children) {
297 aData.children.forEach(
function(aChild) {
298 txns.push(this.ptm.tagURI(PlacesUtils._uri(aChild.uri), [
aData.title]));
301 return this.ptm.aggregateTransactions(
"addTags", txns);
305 return this._getLivemarkCopyTransaction(
aData, aContainer, aIndex);
308 var childItems = getChildItemsTransactions(
aData.children);
310 childItems.push(this.ptm.editItemDateAdded(
null,
aData.dateAdded));
311 if (
aData.lastModified)
312 childItems.push(this.ptm.editItemLastModified(
null,
aData.lastModified));
314 var annos =
aData.annos || [];
315 annos = annos.filter(
function(aAnno) {
319 return this.ptm.createFolder(
aData.title, aContainer, aIndex, annos, childItems);
323 _getLivemarkCopyTransaction:
324 function PU__getLivemarkCopyTransaction(
aData, aContainer, aIndex) {
329 aData.annos =
aData.annos.filter(
function(aAnno) {
331 feedURI = PlacesUtils._uri(aAnno.value);
335 siteURI = PlacesUtils._uri(aAnno.value);
341 return this.ptm.createLivemark(feedURI, siteURI,
aData.title, aContainer,
342 aIndex,
aData.annos);
361 makeTransaction:
function PU_makeTransaction(
data, type, container,
364 case PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER:
366 return this._getFolderCopyTransaction(
data, container, index);
368 return this.ptm.moveItem(
data.id, container, index);
370 case PlacesUtils.TYPE_X_MOZ_PLACE:
372 return this._getURIItemCopyTransaction(
data, container, index);
375 return this._getBookmarkItemCopyTransaction(
data, container, index);
377 return this.ptm.moveItem(
data.id, container, index);
379 case PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR:
383 return this.ptm.createSeparator(container, index);
385 return this.ptm.moveItem(
data.id, container, index);
388 if (type == PlacesUtils.TYPE_X_MOZ_URL ||
389 type == PlacesUtils.TYPE_UNICODE ||
391 var title = (type != PlacesUtils.TYPE_UNICODE) ?
data.title :
393 return this.ptm.createItem(PlacesUtils._uri(
data.uri),
394 container, index, title);
444 showAddBookmarkUI:
function PU_showAddBookmarkUI(aURI,
447 aDefaultInsertionPoint,
462 if (typeof(aTitle) ==
"string")
466 info.description = aDescription;
468 if (aDefaultInsertionPoint) {
469 info.defaultInsertionPoint = aDefaultInsertionPoint;
471 info.hiddenRows = [
"folderPicker"];
475 info.loadBookmarkInSidebar =
true;
477 if (typeof(aKeyword) ==
"string") {
478 info.keyword = aKeyword;
479 if (typeof(aPostData) ==
"string")
480 info.postData = aPostData;
481 if (typeof(aCharSet) ==
"string")
482 info.charSet = aCharSet;
485 return this._showBookmarkDialog(info);
499 showMinimalAddBookmarkUI:
500 function PU_showMinimalAddBookmarkUI(aURI, aTitle, aDescription,
501 aDefaultInsertionPoint, aShowPicker,
502 aLoadInSidebar, aKeyword, aPostData,
507 hiddenRows: [
"description"]
513 if (typeof(aTitle) ==
"string")
517 info.description = aDescription;
519 if (aDefaultInsertionPoint) {
520 info.defaultInsertionPoint = aDefaultInsertionPoint;
522 info.hiddenRows.push(
"folderPicker");
526 info.loadBookmarkInSidebar =
true;
528 info.hiddenRows = info.hiddenRows.concat([
"location",
"loadInSidebar"]);
530 if (typeof(aKeyword) ==
"string") {
531 info.keyword = aKeyword;
533 info.hiddenRows.push(
"tags");
535 if (typeof(aPostData) ==
"string")
536 info.postData = aPostData;
537 if (typeof(aCharSet) ==
"string")
538 info.charSet = aCharSet;
541 info.hiddenRows.push(
"keyword");
543 this._showBookmarkDialog(info,
true);
568 showAddLivemarkUI:
function PU_showAddLivemarkURI(aFeedURI,
572 aDefaultInsertionPoint,
580 info.feedURI = aFeedURI;
582 info.siteURI = aSiteURI;
585 if (typeof(aTitle) ==
"string")
589 info.description = aDescription;
591 if (aDefaultInsertionPoint) {
592 info.defaultInsertionPoint = aDefaultInsertionPoint;
594 info.hiddenRows = [
"folderPicker"];
596 return this._showBookmarkDialog(info);
607 showMinimalAddLivemarkUI:
608 function PU_showMinimalAddLivemarkURI(aFeedURI, aSiteURI, aTitle,
609 aDescription, aDefaultInsertionPoint,
614 hiddenRows: [
"feedLocation",
"siteLocation",
"description"]
618 info.feedURI = aFeedURI;
620 info.siteURI = aSiteURI;
623 if (typeof(aTitle) ==
"string")
627 info.description = aDescription;
629 if (aDefaultInsertionPoint) {
630 info.defaultInsertionPoint = aDefaultInsertionPoint;
632 info.hiddenRows.push(
"folderPicker");
634 this._showBookmarkDialog(info,
true);
646 showMinimalAddMultiBookmarkUI:
function PU_showAddMultiBookmarkUI(aURIList) {
648 "showAddMultiBookmarkUI expects a list of nsIURI objects");
652 hiddenRows: [
"description"],
655 this._showBookmarkDialog(info,
true);
669 showItemProperties:
function PU_showItemProperties(aItemId, aType, aReadOnly) {
676 return this._showBookmarkDialog(info);
694 function PU_showAddFolderUI(aTitle, aDefaultInsertionPoint, aShowPicker) {
702 if (typeof(aTitle) ==
"string")
705 if (aDefaultInsertionPoint) {
706 info.defaultInsertionPoint = aDefaultInsertionPoint;
708 info.hiddenRows.push(
"folderPicker");
710 return this._showBookmarkDialog(info);
725 _showBookmarkDialog:
function PU__showBookmarkDialog(aInfo, aMinimalUI) {
726 var dialogURL = aMinimalUI ?
727 "chrome://browser/content/places/bookmarkProperties2.xul" :
728 "chrome://browser/content/places/bookmarkProperties.xul";
732 features =
"centerscreen,chrome,dialog,resizable,modal";
734 features =
"centerscreen,chrome,modal,resizable=no";
735 window.openDialog(dialogURL,
"", features, aInfo);
736 return (
"performed" in aInfo && aInfo.performed);
745 getViewForNode:
function PU_getViewForNode(aNode) {
750 if (node.localName ==
"menu" && !node.node &&
751 node.firstChild.getAttribute(
"type") ==
"places")
752 return node.firstChild;
756 if (node.getAttribute(
"type") ==
"places")
759 node = node.parentNode;
773 markPageAsTyped:
function PU_markPageAsTyped(aURL) {
774 PlacesUtils.history.QueryInterface(
Ci.nsIBrowserHistory)
775 .markPageAsTyped(this.createFixedURI(aURL));
785 markPageAsFollowedBookmark:
function PU_markPageAsFollowedBookmark(aURL) {
786 PlacesUtils.history.markPageAsFollowedBookmark(this.createFixedURI(aURL));
797 checkURLSecurity:
function PU_checkURLSecurity(aURINode) {
798 if (!PlacesUtils.nodeIsBookmark(aURINode)) {
799 var
uri = PlacesUtils._uri(aURINode.uri);
800 if (uri.schemeIs(
"javascript") || uri.schemeIs(
"data")) {
801 const BRANDING_BUNDLE_URI =
"chrome://branding/locale/brand.properties";
802 var brandShortName =
Cc[
"@mozilla.org/intl/stringbundle;1"].
804 createBundle(BRANDING_BUNDLE_URI).
805 GetStringFromName(
"brandShortName");
809 var errorStr = this.getString(
"load-js-data-url-error");
810 promptService.alert(
window, brandShortName, errorStr);
825 getDescriptionFromDocument:
function PU_getDescriptionFromDocument(
doc) {
826 var metaElements =
doc.getElementsByTagName(
"META");
827 for (var
i = 0;
i < metaElements.length; ++
i) {
828 if (metaElements[
i].
name.toLowerCase() ==
"description" ||
829 metaElements[
i].httpEquiv.toLowerCase() ==
"description") {
830 return metaElements[
i].content;
843 getItemDescription:
function PU_getItemDescription(aItemId) {
845 return PlacesUtils.annotations.getItemAnnotation(aItemId,
DESCRIPTION_ANNO);
852 _confirmOpenInTabs:
function PU__confirmOpenInTabs(numTabsToOpen) {
853 var
pref =
Cc[
"@mozilla.org/preferences-service;1"].
856 const kWarnOnOpenPref =
"browser.tabs.warnOnOpen";
857 var reallyOpen =
true;
858 if (pref.getBoolPref(kWarnOnOpenPref)) {
859 if (numTabsToOpen >= pref.getIntPref(
"browser.tabs.maxOpenBeforeWarn")) {
864 var warnOnOpen = {
value:
true };
866 var messageKey =
"tabs.openWarningMultipleBranded";
867 var openKey =
"tabs.openButtonMultiple";
868 const BRANDING_BUNDLE_URI =
"chrome://branding/locale/brand.properties";
869 var brandShortName =
Cc[
"@mozilla.org/intl/stringbundle;1"].
871 createBundle(BRANDING_BUNDLE_URI).
872 GetStringFromName(
"brandShortName");
874 var buttonPressed = promptService.confirmEx(
window,
875 this.getString(
"tabs.openWarningTitle"),
876 this.getFormattedString(messageKey, [numTabsToOpen, brandShortName]),
877 (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0)
878 + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1),
879 this.getString(openKey),
null,
null,
880 this.getFormattedString(
"tabs.openWarningPromptMeBranded",
881 [brandShortName]), warnOnOpen);
883 reallyOpen = (buttonPressed == 0);
885 if (reallyOpen && !warnOnOpen.value)
886 pref.setBoolPref(kWarnOnOpenPref,
false);
895 _openTabset:
function PU__openTabset(aItemsToOpen, aEvent) {
896 if (!aItemsToOpen.length)
900 for (var
i = 0;
i < aItemsToOpen.length;
i++) {
901 var item = aItemsToOpen[
i];
903 this.markPageAsFollowedBookmark(item.uri);
905 this.markPageAsTyped(item.uri);
911 var where = browserWindow ?
913 if (where ==
"window") {
915 "chrome,all,dialog=no", urls.join(
"|"));
919 var loadInBackground = where ==
"tabshifted" ?
true :
false;
920 var replaceCurrentTab = where ==
"tab" ?
false :
true;
921 browserWindow.getBrowser().loadTabs(urls, loadInBackground,
925 openContainerNodeInTabs:
function PU_openContainerInTabs(aNode, aEvent) {
926 var urlsToOpen = PlacesUtils.getURLsForContainerNode(aNode);
927 if (!this._confirmOpenInTabs(urlsToOpen.length))
930 this._openTabset(urlsToOpen, aEvent);
933 openURINodesInTabs:
function PU_openURINodesInTabs(aNodes, aEvent) {
935 for (var
i=0;
i < aNodes.length;
i++) {
937 if (PlacesUtils.nodeIsURI(aNodes[
i]))
938 urlsToOpen.push({uri: aNodes[i].uri, isBookmark: PlacesUtils.nodeIsBookmark(aNodes[i])});
940 this._openTabset(urlsToOpen, aEvent);
953 openNodeWithEvent:
function PU_openNodeWithEvent(aNode, aEvent) {
962 openNodeIn:
function PU_openNodeIn(aNode, aWhere) {
963 if (aNode && PlacesUtils.nodeIsURI(aNode) &&
964 this.checkURLSecurity(aNode)) {
965 var isBookmark = PlacesUtils.nodeIsBookmark(aNode);
968 this.markPageAsFollowedBookmark(aNode.uri);
970 this.markPageAsTyped(aNode.uri);
974 if (aWhere ==
"current" && isBookmark) {
975 if (PlacesUtils.annotations
979 w.openWebPanel(aNode.title, aNode.uri);
998 guessUrlSchemeForUI:
function PUU_guessUrlSchemeForUI(aUrlString) {
999 return aUrlString.substr(0, aUrlString.indexOf(
":"));
1005 createMenuItemForNode:
1006 function PUU_createMenuItemForNode(aNode) {
1008 var type = aNode.type;
1009 if (type ==
Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR)
1010 element = document.createElement(
"menuseparator");
1012 if (PlacesUtils.uriTypes.indexOf(type) != -1) {
1013 element = document.createElement(
"menuitem");
1014 element.className =
"menuitem-iconic bookmark-item";
1015 element.setAttribute(
"scheme", this.guessUrlSchemeForUI(aNode.uri));
1017 else if (PlacesUtils.containerTypes.indexOf(type) != -1) {
1018 element = document.createElement(
"menu");
1019 element.setAttribute(
"container",
"true");
1021 if (aNode.type ==
Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY) {
1022 element.setAttribute(
"query",
"true");
1023 if (PlacesUtils.nodeIsTagQuery(aNode))
1024 element.setAttribute(
"tagContainer",
"true");
1025 else if (PlacesUtils.nodeIsDay(aNode))
1026 element.setAttribute(
"dayContainer",
"true");
1027 else if (PlacesUtils.nodeIsHost(aNode))
1028 element.setAttribute(
"hostContainer",
"true");
1030 else if (aNode.itemId != -1) {
1031 if (PlacesUtils.nodeIsLivemarkContainer(aNode))
1032 element.setAttribute(
"livemark",
"true");
1035 var popup = document.createElement(
"menupopup");
1036 popup.setAttribute(
"placespopup",
"true");
1043 popup._startMarker = -1;
1044 popup._endMarker = -1;
1047 popup.setAttribute(
"context",
"placesContext");
1049 element.appendChild(popup);
1050 element.className =
"menu-iconic bookmark-item";
1053 throw "Unexpected node";
1055 element.setAttribute(
"label", this.getBestTitle(aNode));
1057 var icon = aNode.icon;
1059 element.setAttribute(
"image", icon);
1061 element.node = aNode;
1062 element.node._DOMElement =
element;
1067 cleanPlacesPopup:
function PU_cleanPlacesPopup(aPopup) {
1070 var
start = aPopup._startMarker != -1 ? aPopup._startMarker + 1 : 0;
1071 var end = aPopup._endMarker != -1 ? aPopup._endMarker :
1072 aPopup.childNodes.length;
1074 var placesNodeFound =
false;
1075 for (var
i = start;
i < end; ++
i) {
1076 var item = aPopup.childNodes[
i];
1077 if (item.getAttribute(
"builder") ==
"end") {
1081 aPopup._endMarker =
i;
1086 placesNodeFound =
true;
1090 if (!placesNodeFound)
1093 aPopup._startMarker++;
1096 aPopup._endMarker =
i;
1102 for (var
i = 0;
i < items.length; ++
i) {
1103 aPopup.removeChild(items[
i]);
1104 if (aPopup._endMarker != -1)
1105 aPopup._endMarker--;
1109 getBestTitle:
function PU_getBestTitle(aNode) {
1111 if (!aNode.title && PlacesUtils.uriTypes.indexOf(aNode.type) != -1) {
1115 var uri = PlacesUtils._uri(aNode.uri);
1116 var host = uri.host;
1117 var fileName = uri.QueryInterface(
Ci.nsIURL).fileName;
1119 title = host + (fileName ?
1120 (host ?
"/" + this.ellipsis +
"/" :
"") + fileName :
1129 title = aNode.title;
1131 return title || this.getString(
"noTitle");
1136 this.leftPaneFolderId;
1141 get leftPaneFolderId() {
1142 var leftPaneRoot = -1;
1146 var
bs = PlacesUtils.bookmarks;
1147 var
as = PlacesUtils.annotations;
1152 if (items.length > 1) {
1155 items.forEach(bs.removeItem);
1157 else if (items.length == 1 && items[0] != -1) {
1158 leftPaneRoot = items[0];
1163 bs.removeItem(leftPaneRoot);
1168 var queriesTitles = {
1170 "History": this.getString(
"OrganizerQueryHistory"),
1172 "Tags": bs.getItemTitle(PlacesUtils.tagsFolderId),
1173 "AllBookmarks": this.getString(
"OrganizerQueryAllBookmarks"),
1174 "Downloads": this.getString(
"OrganizerQueryDownloads"),
1175 "BookmarksToolbar":
null,
1176 "BookmarksMenu":
null,
1177 "UnfiledBookmarks":
null
1180 if (leftPaneRoot != -1) {
1188 for (var
i = 0;
i < items.length;
i++) {
1193 if (bs.getItemTitle(items[i]) != queriesTitles[queryName])
1194 bs.setItemTitle(items[i], queriesTitles[queryName]);
1196 delete this.leftPaneFolderId;
1197 return this.leftPaneFolderId = leftPaneRoot;
1203 create_query:
function CB_create_query(aQueryName, aParentId, aQueryUrl) {
1204 let itemId = bs.insertBookmark(aParentId,
1205 PlacesUtils._uri(aQueryUrl),
1207 queriesTitles[aQueryName]);
1210 0, as.EXPIRE_NEVER);
1213 0, as.EXPIRE_NEVER);
1215 self.leftPaneQueries[aQueryName] = itemId;
1220 create_folder:
function CB_create_folder(aFolderName, aParentId, aIsRoot) {
1222 let folderId = bs.createFolder(aParentId,
1223 queriesTitles[aFolderName],
1227 0, as.EXPIRE_NEVER);
1229 bs.setFolderReadonly(folderId,
true);
1235 0, as.EXPIRE_NEVER);
1240 0, as.EXPIRE_NEVER);
1241 self.leftPaneQueries[aFolderName] = folderId;
1246 runBatched:
function CB_runBatched(aUserData) {
1247 delete self.leftPaneQueries;
1248 self.leftPaneQueries = { };
1251 leftPaneRoot = this.create_folder(
"PlacesRoot", bs.placesRoot,
true);
1254 this.create_query(
"History", leftPaneRoot,
1256 Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY +
1258 Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING);
1263 this.create_query(
"Tags", leftPaneRoot,
1265 Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_QUERY +
1267 Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_ASCENDING);
1270 allBookmarksId = this.create_folder(
"AllBookmarks", leftPaneRoot,
false);
1273 this.create_query(
"BookmarksToolbar", allBookmarksId,
1274 "place:folder=TOOLBAR");
1277 this.create_query(
"BookmarksMenu", allBookmarksId,
1278 "place:folder=BOOKMARKS_MENU");
1281 this.create_query(
"UnfiledBookmarks", allBookmarksId,
1282 "place:folder=UNFILED_BOOKMARKS");
1285 bs.runInBatchMode(callback,
null);
1287 delete this.leftPaneFolderId;
1288 return this.leftPaneFolderId = leftPaneRoot;
1294 get allBookmarksFolderId() {
1296 this.leftPaneFolderId;
1297 delete this.allBookmarksFolderId;
1298 return this.allBookmarksFolderId = this.
leftPaneQueries[
"AllBookmarks"];
1308 getLeftPaneQueryNameFromId:
function PU_getLeftPaneQueryNameFromId(aItemId) {
1312 if (this.__lookupGetter__(
"leftPaneFolderId")) {
1314 queryName = PlacesUtils.annotations.
1338 ensureLivemarkStatusMenuItem:
1339 function PU_ensureLivemarkStatusMenuItem(aPopup) {
1340 var itemId = aPopup._resultNode.itemId;
1342 var lmStatus =
null;
1343 if (PlacesUtils.annotations
1344 .itemHasAnnotation(itemId,
"livemark/loadfailed"))
1345 lmStatus =
"bookmarksLivemarkFailed";
1346 else if (PlacesUtils.annotations
1347 .itemHasAnnotation(itemId,
"livemark/loading"))
1348 lmStatus =
"bookmarksLivemarkLoading";
1350 if (lmStatus && !aPopup._lmStatusMenuItem) {
1352 aPopup._lmStatusMenuItem = document.createElement(
"menuitem");
1353 aPopup._lmStatusMenuItem.setAttribute(
"lmStatus", lmStatus);
1354 aPopup._lmStatusMenuItem.setAttribute(
"label", this.getString(lmStatus));
1355 aPopup._lmStatusMenuItem.setAttribute(
"disabled",
true);
1356 aPopup.insertBefore(aPopup._lmStatusMenuItem,
1357 aPopup.childNodes.item(aPopup._startMarker + 1));
1358 aPopup._startMarker++;
1360 else if (lmStatus &&
1361 aPopup._lmStatusMenuItem.getAttribute(
"lmStatus") != lmStatus) {
1363 aPopup._lmStatusMenuItem.setAttribute(
"label",
1364 this.getString(lmStatus));
1366 else if (!lmStatus && aPopup._lmStatusMenuItem){
1368 aPopup.removeChild(aPopup._lmStatusMenuItem);
1369 aPopup._lmStatusMenuItem =
null;
1370 aPopup._startMarker--;
const ORGANIZER_QUERY_ANNO
const ORGANIZER_LEFTPANE_VERSION
function openUILinkIn(url, where, allowThirdPartyFixup, postData, referrerUrl)
function doc() browser.contentDocument
while((node=formNodes.iterateNext()))
function asFullVisit(aNode)
const LOAD_IN_SIDEBAR_ANNO
getService(Ci.sbIFaceplateManager)
function QI_node(aNode, aIID)
const ORGANIZER_FOLDER_ANNO
function whereToOpenLink(e, ignoreButton, ignoreAlt)
function NS_ASSERT(cond, msg)
const EXCLUDE_FROM_BACKUP_ANNO
_getSelectedPageStyle s i
function asContainer(aNode)
__defineGetter__("PlacesUtils", function(){delete this.PlacesUtils var tmpScope={};Components.utils.import("resource://gre/modules/utils.js", tmpScope);return this.PlacesUtils=tmpScope.PlacesUtils;})
_updateTextAndScrollDataForFrame aData