Skip to content

Commit

Permalink
fixed stats page not showing correct temperature unit; added about po…
Browse files Browse the repository at this point in the history
…pup with hg plus link
  • Loading branch information
genemars committed Nov 7, 2015
1 parent 3970a20 commit dd05aa8
Show file tree
Hide file tree
Showing 10 changed files with 252 additions and 178 deletions.
34 changes: 31 additions & 3 deletions BaseFiles/Common/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,9 @@ <h4 data-ui-field="namelabel"></h4>
<li><a class="ui-btn ui-btn-icon-left ui-icon-gear" data-locale-id="home_menu_settings" href="#page_configure_interfaces" data-transition="none">Settings</a></li>
<li><a class="ui-btn ui-btn-icon-left ui-icon-check" data-locale-id="home_menu_maintenance" href="#page_configure_maintenance" data-transition="none">Maintenance</a></li>
<li data-locale-id="home_menu_about" data-role="list-divider">About</li>
<li><a class="ui-btn ui-icon-carat-r ui-btn-icon-left" href="javascript:HG.System.UpdateManager.UpdateCheck()"><span data-locale-id="home_menu_about_version">Version</span> <span id="systemversion" style="font-weight:bold">?</span></a></li>
<li><a class="ui-btn ui-icon-info ui-btn-icon-left" data-locale-id="home_menu_about_userguide" target="_blank" href="http://www.homegenie.it/docs/quickstart.php">Users Guide</a></li>
<li><a class="ui-btn ui-icon-info ui-btn-icon-left" data-locale-id="home_menu_about_programming" target="_blank" href="http://genielabs.github.io/HomeGenie">Programming Guide</a></li>
<li><a class="ui-btn ui-icon-info ui-btn-icon-left" href="#homegenie_about" data-rel="popup">About HomeGenie</a></li>
<li><a class="ui-btn ui-icon-bars ui-btn-icon-left" data-locale-id="home_menu_about_userguide" target="_blank" href="http://www.homegenie.it/docs/quickstart.php">Users Guide</a></li>
<li><a class="ui-btn ui-icon-bars ui-btn-icon-left" data-locale-id="home_menu_about_programming" target="_blank" href="http://genielabs.github.io/HomeGenie">Programming Guide</a></li>
<li><a class="ui-btn ui-icon-comment ui-btn-icon-left" data-locale-id="home_menu_about_forum" target="_blank" href="http://www.homegenie.it/forum">Users Forum</a></li>
<li><a class="ui-btn ui-btn-icon-left ui-icon-heart" data-locale-id="home_menu_about_support" target="_blank" href="http://www.homegenie.it/keepuphg.php">Keep HomeGenie Up!</a></li>
</ul>
Expand All @@ -496,5 +496,33 @@ <h4 data-ui-field="namelabel"></h4>

<!--- END HomeGenie Overlay -->

<!--- HomeGenie about popup -->
<div id="homegenie_about" class="ui-corner-all hg-popup-a" data-role="popup" data-dismissible="false" data-theme="a" data-overlay-theme="b" data-position-to="window" data-transition="slidedown">
<div data-role="header" class="ui-corner-top">
<h2 data-locale-id="home_menu_about">About</h2>
</div>
<div class="ui-content ui-corner-bottom">
<p align="center">HomeGenie <span data-locale-id="home_menu_about_version">Version</span> <span id="systemversion" style="font-weight:bold">?</span></p>
<hr />
<p style="font-weight:bold">What's hot</p>
<p>
Don't miss the new client for Android!
</p>
<div data-role="controlgroup" data-theme="d" data-mini="true">
<a class="ui-btn ui-btn-b ui-corner-all ui-icon-action ui-btn-icon-left" href="http://genielabs.github.io/HomeGenie/clients.html#HomeGeniePlus" target="_blank">HomeGenie Plus</a>
</div>
</div>
<div class="ui-grid-a ui-footer ui-bar-inherit">
<div class="ui-block-a" style="width:20%">
<a class="ui-btn ui-shadow ui-corner-all ui-icon-delete ui-btn-icon-left" data-locale-id="configure_popupfilter_optclose" data-rel="back">Close</a>
</div>
<div class="ui-block-b" style="width:80%" align="right">
<a class="ui-btn ui-corner-all ui-icon-recycle ui-btn-icon-right" id="about_popup_updatebutton" data-locale-id="configure_system_updatemanager_updatecheck" data-mini="true" href="#">Update Check</a>
</div>
</div>

</div>


</body>
</html>
28 changes: 28 additions & 0 deletions BaseFiles/Common/html/js/api/homegenie.webapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ HG.WebApp.InitializePage = function ()
HG.WebApp.Locales.Localize(document, './locales/' + userLang.toLowerCase().substring(0, 2) + '.json', function(success){
HG.WebApp.Locales.Localize(document, './locales/' + userLang.toLowerCase().substring(0, 2) + '.programs.json', function(success){
$('#homegenie_overlay').fadeOut(200);
// Show about popup
if (!dataStore.get('UI.AboutPopupShown')) {
dataStore.set('UI.AboutPopupShown', true);
setTimeout(HG.WebApp.Home.About, 3000);
}
});
});
HG.VoiceControl.Initialize();
Expand Down Expand Up @@ -224,9 +229,16 @@ HG.WebApp.InitializePage = function ()
element.enhanceWithin().popup();
HG.Ui.Popup.CronWizard = handler;
});

$('#homegenie_about').enhanceWithin().popup();
$('#about_popup_updatebutton').on('click', function(){
HG.System.UpdateManager.UpdateCheck();
$('#homegenie_about').popup('close');
});
};



//
// namespace : HG.WebApp.Events
// info : -
Expand Down Expand Up @@ -298,6 +310,11 @@ HG.WebApp.InitializePage = function ()
// info : -
//
HG.WebApp.Home = HG.WebApp.Home || {};
HG.WebApp.Home.About = function()
{
$('#homegenie_about').popup('open');
};
//
HG.WebApp.Home.UpdateHeaderStatus = function()
{
HG.WebApp.Home.UpdateInterfacesStatus();
Expand Down Expand Up @@ -572,6 +589,17 @@ HG.WebApp.Utility.GetCommandFromEvent = function (module, event)
return commandobj;
};

HG.WebApp.Utility.GetLocaleTemperature = function (temp) {
var temperatureUnit = dataStore.get('UI.TemperatureUnit');
if (temperatureUnit != 'C' && (temperatureUnit == 'F' || HG.WebApp.Locales.GetDateEndianType() == 'M')) {
// display as Fahrenheit
temp = Math.round((temp * 1.8 + 32) * 10) / 10;
} else {
// display as Celsius
temp = Math.round(temp * 10) / 10;
}
return (temp * 1).toFixed(2);
};
HG.WebApp.Utility.FormatTemperature = function (temp) {
var displayvalue = '';
var temperatureUnit = dataStore.get('UI.TemperatureUnit');
Expand Down
Loading

0 comments on commit dd05aa8

Please sign in to comment.