Skip to content

Commit

Permalink
Add prompt to help old-Thunderbird users find open-options menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-p committed Sep 12, 2018
1 parent cade5ea commit d16a0d9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,12 @@ See the [Compatibility wiki page](https://github.com/adam-p/markdown-here/wiki/C

## Building the Extension Bundles

"Building" is really just zipping. Create all archives relative to the `src` directory.

Before zipping, delete the `src/common/test` directory. This will prevent the autotests from ending up in the release.

An important preparatory step is to remove any system-generated hidden files that shouldn't be included in the release file (like Windows' `desktop.ini` and OS X's `.DS_Store`, etc.). This shell command will delete those unwanted files:

```
find . -name "desktop.ini" -or -name ".*" -and -not -name "." -and -not -name ".git*" -print0 | xargs -0 rm -rf
cd utils
node build.js
```


### Chrome and Opera extension

Create a file with a `.zip` extension containing these files and directories:
Expand Down
14 changes: 14 additions & 0 deletions src/common/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function onLoad() {
// Restore previously set options (asynchronously)
//

var optionsGetSuccessful = false;
OptionsStore.get(function(prefs) {
cssEdit.value = prefs['main-css'];
cssSyntaxEdit.value = prefs['syntax-css'];
Expand All @@ -93,6 +94,8 @@ function onLoad() {

// Start watching for changes to the styles.
setInterval(checkChange, 100);

optionsGetSuccessful = true;
});

// Load the changelist section
Expand Down Expand Up @@ -125,6 +128,17 @@ function onLoad() {
}
});

// Older Thunderbird may try to open this options page in a new ChromeWindow, and it
// won't work. So in that case we need to tell the user how they can actually open the
// options page. This is pretty ungraceful, but few users will encouter it, and fewer as
// time goes on.
setTimeout(function() {
if (!optionsGetSuccessful) {
alert('It looks like you are running an older version of Thunderird.\nOpen the Markdown Here Options via the message window Tools menu.');
window.close();
}
}, 500);

loaded = true;
}
document.addEventListener('DOMContentLoaded', onLoad, false);
Expand Down

0 comments on commit d16a0d9

Please sign in to comment.