diff --git a/lib/gui/app.js b/lib/gui/app.js index c1415aa1..fc9cd5a4 100644 --- a/lib/gui/app.js +++ b/lib/gui/app.js @@ -143,3 +143,25 @@ app.config(($provide) => { }; }); }); + +app.controller('HeaderController', function(SelectionStateModel, OSOpenExternalService) { + + /** + * @summary Open help page + * @function + * @public + * + * @description + * This application will open either the image's support url, declared + * in the archive `manifest.json`, or the default Etcher help page. + * + * @example + * HeaderController.openHelpPage(); + */ + this.openHelpPage = () => { + const DEFAULT_SUPPORT_URL = 'https://github.com/resin-io/etcher/blob/master/SUPPORT.md'; + const supportUrl = SelectionStateModel.getImageSupportUrl() || DEFAULT_SUPPORT_URL; + OSOpenExternalService.open(supportUrl); + }; + +}); diff --git a/lib/gui/index.html b/lib/gui/index.html index 5044b074..c49fc7d7 100644 --- a/lib/gui/index.html +++ b/lib/gui/index.html @@ -18,8 +18,8 @@
-