Skip to content

Commit

Permalink
Clean statics & bundle more (nightscout#6745)
Browse files Browse the repository at this point in the history
* * Remove unused old version of MFB
* Bundle food, profile editor
* Clean up the static folders

* Fix tests
  • Loading branch information
sulkaharo authored and ivalkou committed Apr 8, 2021
1 parent abe6252 commit 7d4e112
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 912 deletions.
2 changes: 2 additions & 0 deletions bundle/bundle.reports.source.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ console.info('Nightscout report bundle start');
window.Nightscout.report_plugins_preinit = require('../lib/report_plugins/');
window.Nightscout.predictions = require('../lib/report/predictions');
window.Nightscout.reportclient = require('../lib/report/reportclient');
window.Nightscout.profileclient = require('../lib/profile/profileeditor');
window.Nightscout.foodclient = require('../lib/food/food');

console.info('Nightscout report bundle ready');

Expand Down
8 changes: 5 additions & 3 deletions static/food/js/food.js → lib/food/food.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict';

var init = function init () {

//for the tests window isn't the global object
var $ = window.$;
var _ = window._;
var Nightscout = window.Nightscout;
var client = Nightscout.client;

(function () {

client.init(function loaded () {
var translate = client.translate;

Expand Down Expand Up @@ -677,4 +677,6 @@ client.init(function loaded () {
}
}
});
})();
};

module.exports = init;
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(function () {
'use strict';
'use strict';

var init = function init () {
//for the tests window isn't the global object
var $ = window.$;
var _ = window._;
Expand Down Expand Up @@ -721,4 +722,6 @@
}
}
});
})();
};

module.exports = init;
3 changes: 0 additions & 3 deletions lib/report/reportclient.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// TODO:
// - bypass nightmode in reports
// - on save/delete treatment ctx.bus.emit('data-received'); is not enough. we must add something like 'data-updated'

var init = function init () {
'use strict';
Expand Down
6 changes: 6 additions & 0 deletions static/js/foodinit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

$(document).ready(function() {
console.log('Application got ready event');
window.Nightscout.foodclient();
});
6 changes: 6 additions & 0 deletions static/js/profileinit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

$(document).ready(function() {
console.log('Application got ready event');
window.Nightscout.profileclient();
});
File renamed without changes.
4 changes: 0 additions & 4 deletions static/mfb/lib/modernizr.touch.js

This file was deleted.

Loading

0 comments on commit 7d4e112

Please sign in to comment.