Skip to content

Commit

Permalink
One more clock change - the SHOW_CLOCK_CLOSEBUTTON setting can now be…
Browse files Browse the repository at this point in the history
… used to disable the X from appearing in the clocks at any time. The default is to show it when the GET parameter is set, allowing bookmarking a clock without the X, but retaining it when navigating to the page
  • Loading branch information
sulkaharo committed Jul 30, 2019
1 parent 1ada478 commit 3a8f199
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `Clock` - Shows current BG, trend arrow, and time of day. Grey text on a black background.
* `Color` - Shows current BG and trend arrow. White text on a background that changes color to indicate current BG threshold (green = in range; blue = below range; yellow = above range; red = urgent below/above).
* `Simple` - Shows current BG. Grey text on a black background.
* Optional configuration: set `SHOW_CLOCK_CLOSEBUTTON` (`false`) to `true` to show the small X button to close the views at all times. For bookmarking a clock view without the Close box, remove the `showClockClosebutton=true` parameter from the clock view URL.
* Optional configuration: set `SHOW_CLOCK_CLOSEBUTTON` to `false` to never show the small X button in clock views. For bookmarking a clock view without the close box but have it appear when navigating to a clock from the Nightscout menu, don't change the settng, but remove the `showClockClosebutton=true` parameter from the clock view URL.

### Plugins

Expand Down
6 changes: 2 additions & 4 deletions lib/client/clock-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ client.render = function render (xhr) {

var queryDict = {};
location.search.substr(1).split("&").forEach(function(item) { queryDict[item.split("=")[0]] = item.split("=")[1] });

console.log(queryDict);

if (!window.serverSettings.settings.showClockClosebutton && !queryDict['showClockClosebutton']) {

if (!window.serverSettings.settings.showClockClosebutton || !queryDict['showClockClosebutton']) {
$('#close').css('display', 'none');
}

Expand Down
2 changes: 1 addition & 1 deletion lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function init () {
, secureHstsHeaderIncludeSubdomains: false
, secureHstsHeaderPreload: false
, secureCsp: false
, showClockClosebutton: false
, showClockClosebutton: true
, deNormalizeDates: false
};

Expand Down

0 comments on commit 3a8f199

Please sign in to comment.