forked from adam-p/markdown-here
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
78 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE overlay SYSTEM "chrome://markdown_here/locale/strings.dtd"> | ||
|
||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> | ||
|
||
<prefwindow id="markdown-here-options-intermediate" | ||
title="&moz_options_dlg_title;" | ||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" | ||
buttons="accept" | ||
ondialogaccept="openOptionsTab()"> | ||
|
||
<script> | ||
function openOptionsTab() { | ||
var optionsUrl = 'resource://markdown_here_common/options.html'; | ||
var windowMediator = Components.classes['@mozilla.org/appshell/window-mediator;1'] | ||
.getService(Components.interfaces.nsIWindowMediator); | ||
|
||
if (navigator.userAgent.indexOf('Thunderbird') >= 0 || | ||
navigator.userAgent.indexOf('Icedove') >= 0) { | ||
windowMediator.getMostRecentWindow('mail:3pane') | ||
.document.getElementById('tabmail') | ||
.openTab('contentTab', {contentPage: optionsUrl}); | ||
} | ||
else if (navigator.userAgent.indexOf('Postbox') >= 0) { | ||
/* Haven't yet figured out how to open a tab in Postbox */ | ||
var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] | ||
.getService(Components.interfaces.nsIPromptService); | ||
prompts.alert(null, 'Markdown Here', 'Sorry, the options page is not supported for Postbox.'); | ||
} | ||
else if (navigator.userAgent.indexOf('Zotero') >= 0) { | ||
var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] | ||
.getService(Components.interfaces.nsIPromptService); | ||
prompts.alert(null, 'Markdown Here', 'Sorry, the options page is not supported for Zotero.'); | ||
|
||
/* This code does open the options page in a separate window, | ||
but the page can't communicate with the background services | ||
to get and set the options, so it's effectively unsupported. */ | ||
/* | ||
var win = windowMediator.getMostRecentWindow('navigator:browser'); | ||
win.open(optionsUrl, "Markdown-Here-Options"); | ||
*/ | ||
} | ||
else { | ||
var win = windowMediator.getMostRecentWindow('navigator:browser'); | ||
win.gBrowser.selectedTab = win.gBrowser.addTab(optionsUrl); | ||
} | ||
} | ||
</script> | ||
|
||
<prefpane> | ||
<hbox align="center"> | ||
<text value="&moz_options_dlg_instruction;" | ||
style="font-weight:bold"/> | ||
</hbox> | ||
</prefpane> | ||
|
||
</prefwindow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters