Skip to content

Commit

Permalink
about-tab
Browse files Browse the repository at this point in the history
  • Loading branch information
4ch1m committed Sep 26, 2018
1 parent 6e45fd0 commit 74f268e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
34 changes: 34 additions & 0 deletions app/hbs/about.hbs
@@ -0,0 +1,34 @@
<div class="jumbotron">

<h2>{{I18n 'app-name'}} <span class="badge badge-secondary">{{I18n 'app-version'}}</span></h2>

<hr class="my-4">

<button id="external_source" class="btn btn-lg btn-primary">
<i class="fab fa-github-alt"></i> Source
<script>
$('#external_source').click(function(e) {
huE_common.openExternal(e, "https://github.com/4ch1m/huElectron");
});
</script>
</button>

<button id="external_releases" class="btn btn-lg bg-warning">
<i class="fas fa-file-archive"></i> Releases
<script>
$('#external_releases').click(function(e) {
huE_common.openExternal(e, "https://github.com/4ch1m/huElectron/releases");
});
</script>
</button>

<button id="external_email" class="btn btn-lg btn-success">
<i class="fas fa-envelope"></i> eMail
<script>
$('#external_email').click(function(e) {
huE_common.openExternal(e, "mailto:contact@huelectron.achimonline.de");
});
</script>
</button>

</div>
4 changes: 4 additions & 0 deletions app/i18n/en.json
@@ -1,4 +1,7 @@
{
"app-name": "huElectron",
"app-version": "0.3.0",

"info": "Info",
"close": "Close",
"yes": "Yes",
Expand All @@ -11,6 +14,7 @@
"tabs-groups": "Groups",
"tabs-scenes": "Scenes",
"tabs-sensors": "Sensors",
"tabs-about": "About",

"bridges-loading": "Loading Bridges ...",
"bridges-discovering": "Discovering Bridges ...",
Expand Down
4 changes: 3 additions & 1 deletion app/index.html
Expand Up @@ -45,6 +45,7 @@
<script src="js/groups.js"></script>
<script src="js/scenes.js"></script>
<script src="js/sensors.js"></script>
<script src="js/about.js"></script>
<!-- *** -->
<script>
$(document).ready(function() {
Expand All @@ -55,7 +56,8 @@
{id: 'lights', label: $.i18n('tabs-lights'), iconClass: 'fa fa-lightbulb', on_show: 'huE_lights.get()' },
{id: 'groups', label: $.i18n('tabs-groups'), iconClass: 'fa fa-align-justify', on_show: 'huE_groups.get()' },
{id: 'scenes', label: $.i18n('tabs-scenes'), iconClass: 'fa fa-palette', on_show: 'huE_scenes.get()' },
{id: 'sensors', label: $.i18n('tabs-sensors'), iconClass: 'fa fa-thermometer-half', on_show: 'huE_sensors.get()' }
{id: 'sensors', label: $.i18n('tabs-sensors'), iconClass: 'fa fa-thermometer-half', on_show: 'huE_sensors.get()' },
{id: 'about', label: $.i18n('tabs-about'), iconClass: 'fa fa-info', on_show: 'huE_about.get()' }
];

$('#main-content-tabs').html(Handlebars.compile(Handlebars.partials.navigation_tabs)({items: tabItems}));
Expand Down
7 changes: 7 additions & 0 deletions app/js/about.js
@@ -0,0 +1,7 @@
let huE_about = {

get() {
huE_common.setTemplate($('#about-tab-content'), 'hbs/about.hbs');
}

};
6 changes: 6 additions & 0 deletions app/js/common.js
Expand Up @@ -85,5 +85,11 @@ let huE_common = {
let xyPoint = huE_common.hueHackingColors.getCIEColor(hexValue);

return [xyPoint.x, xyPoint.y];
},

openExternal(event, link) {
event.preventDefault();
require("electron").shell.openExternal(link);
return false;
}
};

0 comments on commit 74f268e

Please sign in to comment.