diff --git a/content/treestyletab/windowHelperHacks.js b/content/treestyletab/windowHelperHacks.js index 1d5762a1..21be2cf6 100644 --- a/content/treestyletab/windowHelperHacks.js +++ b/content/treestyletab/windowHelperHacks.js @@ -1,3 +1,5 @@ +Components.utils.import('resource://gre/modules/Services.jsm'); + TreeStyleTabWindowHelper.extraProperties = [ TreeStyleTabService.kID, TreeStyleTabService.kCOLLAPSED, @@ -1051,12 +1053,12 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove sv.getPref('extensions.stm.newTabPosition') != 0 ) { let checked = { value : false }; - if (sv.PromptService.confirmEx( + if (Services.prompt.confirmEx( null, sv.treeBundle.getString('compatibility_STM_warning_title'), sv.treeBundle.getString('compatibility_STM_warning_text'), - (sv.PromptService.BUTTON_TITLE_IS_STRING * sv.PromptService.BUTTON_POS_0) + - (sv.PromptService.BUTTON_TITLE_IS_STRING * sv.PromptService.BUTTON_POS_1), + (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0) + + (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1), sv.treeBundle.getString('compatibility_STM_warning_use_TST'), sv.treeBundle.getString('compatibility_STM_warning_use_STM'), null, diff --git a/modules/utils.js b/modules/utils.js index ff725914..fb6b9cfb 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -277,15 +277,6 @@ var TreeStyleTabUtils = { }, _SessionStore : null, - get PromptService() - { - if (!this._PromptService) { - this._PromptService = Services.prompt; - } - return this._PromptService; - }, - _PromptService : null, - get FocusManager() { if (!this._FocusManager) { @@ -678,11 +669,11 @@ var TreeStyleTabUtils = { if (behavior & this.kDROPLINK_FIXED) return behavior; var checked = { value : false }; - var newChildTab = this.PromptService.confirmEx(this.browserWindow, + var newChildTab = Services.prompt.confirmEx(this.browserWindow, this.treeBundle.getString('dropLinkOnTab.title'), this.treeBundle.getString('dropLinkOnTab.text'), - (this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_0) + - (this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_1), + (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0) + + (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1), this.treeBundle.getString('dropLinkOnTab.openNewChildTab'), this.treeBundle.getString('dropLinkOnTab.loadInTheTab'), null, @@ -709,12 +700,12 @@ var TreeStyleTabUtils = { var dummyTabFlag = behavior & this.kGROUP_BOOKMARK_USE_DUMMY; var checked = { value : false }; - var button = this.PromptService.confirmEx(this.browserWindow, + var button = Services.prompt.confirmEx(this.browserWindow, this.treeBundle.getString('openGroupBookmarkBehavior.title'), this.treeBundle.getString('openGroupBookmarkBehavior.text'), - (this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_0) + - (this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_1) + - (this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_2), + (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0) + + (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1) + + (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_2), this.treeBundle.getString('openGroupBookmarkBehavior.subTree'), this.treeBundle.getString('openGroupBookmarkBehavior.separate'), this.treeBundle.getString('openGroupBookmarkBehavior.replace'), @@ -752,11 +743,11 @@ var TreeStyleTabUtils = { if (behavior & this.kBOOKMARK_DROPPED_TABS_FIXED) return behavior; var checked = { value : false }; - var button = this.PromptService.confirmEx(this.browserWindow, + var button = Services.prompt.confirmEx(this.browserWindow, this.treeBundle.getString('bookmarkDroppedTabs.title'), this.treeBundle.getString('bookmarkDroppedTabs.text'), - (this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_0) + - (this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_1), + (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0) + + (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1), this.treeBundle.getString('bookmarkDroppedTabs.bookmarkAll'), this.treeBundle.getString('bookmarkDroppedTabs.bookmarkOnlyParent'), null, diff --git a/modules/window.js b/modules/window.js index 8715c1a6..86305118 100644 --- a/modules/window.js +++ b/modules/window.js @@ -1388,11 +1388,11 @@ TreeStyleTabWindow.prototype = { var checked = { value:true }; var w = this.window; w.focus(); - var shouldClose = this.PromptService.confirmEx(w, + var shouldClose = Services.prompt.confirmEx(w, this.tabbrowserBundle.getString('tabs.closeWarningTitle'), this.tabbrowserBundle.getFormattedString('tabs.closeWarningMultipleTabs', [aTabsCount]), - (this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_0) + - (this.PromptService.BUTTON_TITLE_CANCEL * this.PromptService.BUTTON_POS_1), + (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0) + + (Services.prompt.BUTTON_TITLE_CANCEL * Services.prompt.BUTTON_POS_1), this.tabbrowserBundle.getString('tabs.closeButtonMultiple'), null, null, this.tabbrowserBundle.getString('tabs.closeWarningPromptMe'),