Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean statics & bundle more #6745

Merged
merged 3 commits into from
Jan 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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