diff --git a/Asset/AssetManager.js b/Asset/AssetManager.js index b7661f4..bbbaabf 100644 --- a/Asset/AssetManager.js +++ b/Asset/AssetManager.js @@ -89,10 +89,6 @@ export class AssetManager /** global: Image */ this.assets[hash] = new Image(); this.assets[hash].src = path; - } else if (filetype === 'audio') { - // TODO: implement audio asset - } else if (filetype === 'video') { - // TODO: implement video asset } if (callback) { diff --git a/Chart/CalendarChart.js b/Chart/CalendarChart.js index 7e32230..fbd627f 100644 --- a/Chart/CalendarChart.js +++ b/Chart/CalendarChart.js @@ -81,7 +81,6 @@ + "H" + (w0 + 1) * self.chart.cellSize + "Z"; }); - // todo: fix the following data filter etc. this is way to much work and slow rect.filter(function(d) { let year = d.split('-')[0], length = self.chart.dataset.length; diff --git a/Chart/ChartAbstract.js b/Chart/ChartAbstract.js index c92ebb8..9f28123 100644 --- a/Chart/ChartAbstract.js +++ b/Chart/ChartAbstract.js @@ -324,7 +324,6 @@ let div = this.chartSelect.append("div").attr("class", "charttooltip").style("opacity", 0); div.html(self.axis.x.label.text + ': ' + 100 + "
" + self.axis.y.label.text + ': ' + 100); - /* todo: allow also hover on charts without marker... not possible since hover only on marker and not on point? */ temp.on("mouseover", function (d) { let dim = div.node().getBoundingClientRect(); @@ -396,7 +395,6 @@ // if no x axis available an element less will be drawn and the footer // will be out of bounds. - // todo: fix this hacky solution!!! if (typeof this.axis.x === 'undefined') { spacer = -this.margin.top; } diff --git a/Chart/ColumnChart.js b/Chart/ColumnChart.js index 97c7905..c1c6981 100644 --- a/Chart/ColumnChart.js +++ b/Chart/ColumnChart.js @@ -208,7 +208,6 @@ { y.domain([yMin, yMax]); - // todo: n is undefined !!!! rect.transition() .duration(500) .delay(function (d, i) diff --git a/Chart/PieChart.js b/Chart/PieChart.js index a439d9d..b2e7229 100644 --- a/Chart/PieChart.js +++ b/Chart/PieChart.js @@ -40,7 +40,6 @@ dataPointEnter = temp[0]; dataPoint = temp[1]; - // todo: create own legend drawing this.chart.drawLegend(svg, dataPointEnter, dataPoint); this.chart.drawText(svg); diff --git a/Chart/PyramidChart.js b/Chart/PyramidChart.js index e701e27..d7f7af8 100644 --- a/Chart/PyramidChart.js +++ b/Chart/PyramidChart.js @@ -68,7 +68,6 @@ length = data.length, add = 0; - // todo: remove value since positive and negative can be checked by looking at the diff of y-y0 for (let i = 0; i < length - 1; ++i) { dataset[0].points[i] = { name: data[i].name, y0: add, y: data[i].value + add }; add += data[i].value; diff --git a/Chart/VWaterfallChart.js b/Chart/VWaterfallChart.js index d077e34..584d14f 100644 --- a/Chart/VWaterfallChart.js +++ b/Chart/VWaterfallChart.js @@ -69,7 +69,6 @@ length = data.length, add = 0; - // todo: remove value since positive and negative can be checked by looking at the diff of y-y0 for (let i = 0; i < length - 1; ++i) { dataset[0].points[i] = { name: data[i].name, y0: add, y: data[i].value + add }; add += data[i].value; diff --git a/Chart/WaterfallChart.js b/Chart/WaterfallChart.js index c57d424..f19ba7a 100644 --- a/Chart/WaterfallChart.js +++ b/Chart/WaterfallChart.js @@ -69,7 +69,6 @@ length = data.length, add = 0; - // todo: remove value since positive and negative can be checked by looking at the diff of y-y0 for (let i = 0; i < length - 1; ++i) { dataset[0].points[i] = { name: data[i].name, y0: add, y: data[i].value + add }; add += data[i].value; diff --git a/Event/EventManager.js b/Event/EventManager.js index b681546..3245be0 100644 --- a/Event/EventManager.js +++ b/Event/EventManager.js @@ -241,6 +241,20 @@ export class EventManager return true; }; + /** + * Is a certain group allready attached + * + * @param {string|int} group Group id + * + * @return {boolean} + * + * @since 1.0.0 + */ + isAttached (group) + { + return this.callbacks.hasOwnProperty(group); + }; + /** * Count events * diff --git a/Log/Logger.js b/Log/Logger.js index 90f20bd..b2fe93f 100644 --- a/Log/Logger.js +++ b/Log/Logger.js @@ -115,7 +115,11 @@ export class Logger } if (this.ui) { - // todo: fill log box, set class and initiate animation + /** + * @todo Orange-Management/jsOMS#67 + * Implement UI logging + * Create a dom element with inline css for UI logging. + */ } if (this.remote) { diff --git a/Message/Notification/App/AppNotification.js b/Message/Notification/App/AppNotification.js index 77c5a74..a35727e 100644 --- a/Message/Notification/App/AppNotification.js +++ b/Message/Notification/App/AppNotification.js @@ -55,6 +55,7 @@ export class AppNotification output.querySelector('.log-msg-content').innerHTML = msg.message; tpl.parentNode.appendChild(output); + window.navigator.vibrate(meg.vibrate ? 200 : 0); setTimeout(function () { diff --git a/Message/Notification/Browser/BrowserNotification.js b/Message/Notification/Browser/BrowserNotification.js index 8dbb631..f68080b 100644 --- a/Message/Notification/Browser/BrowserNotification.js +++ b/Message/Notification/Browser/BrowserNotification.js @@ -41,17 +41,9 @@ export class BrowserNotification */ requestPermission () { - const self = this; - /** global: Notification */ if (Notification.permission !== 'granted' && Notification.permission !== 'denied') { - Notification.requestPermission(function(permission) { - if (permission === 'granted') { - let msg = new jsOMS.Message.Notification.NotificationMessage(); - - self.send(msg); - } - }); + Notification.requestPermission().then(function(permission) { }); } }; @@ -66,8 +58,11 @@ export class BrowserNotification */ send (msg) { - // todo: implement /** global: Notification */ - let n = new Notification(/* ... */); + if (Notification.permission === "granted") { + let notification = new Notification(msg.title, { body: msg.message, vibrate: [msg.vibrate ? 200 : 0] }); + + setTimeout(notification.close.bind(notification), 4000); + } }; }; \ No newline at end of file diff --git a/Message/Notification/NotificationMessage.js b/Message/Notification/NotificationMessage.js index ede034c..1a4a9bb 100644 --- a/Message/Notification/NotificationMessage.js +++ b/Message/Notification/NotificationMessage.js @@ -11,16 +11,18 @@ export class NotificationMessage /** * @constructor * - * @param {string} status Message status - * @param {string} title Message title - * @param {string} message Message content + * @param {string} status Message status + * @param {string} title Message title + * @param {string} message Message content + * @param {bool} [vibrate] Vibrate * * @since 1.0.0 */ - constructor(status, title, message) + constructor(status, title, message, vibrate = false) { this.status = status; this.title = title; this.message = message; + this.vibrate = vibrate }; }; \ No newline at end of file diff --git a/Route/Route.js b/Route/Route.js index 445e009..e59d610 100644 --- a/Route/Route.js +++ b/Route/Route.js @@ -4,18 +4,15 @@ jsOMS.Autoloader.defineNamespace('jsOMS.Route'); jsOMS.Route.Route = class { - // TODO: create comments constructor () { this.routes = null; }; - // TODO: create comments add (path, callback, exact) { exact = typeof exact !== 'undefined' ? exact : true; - // todo: create array key path like i did for php }; } }(window.jsOMS = window.jsOMS || {})); diff --git a/UI/Component/Form.js b/UI/Component/Form.js index 8a508f5..071e59d 100644 --- a/UI/Component/Form.js +++ b/UI/Component/Form.js @@ -232,12 +232,9 @@ export class Form */ unbindForm (id) { - // todo: do i need the findex? can't i just use id? - let findex = 0; - if ((findex = this.forms[id]) !== 'undefined') { this.forms[id].unbind(); - this.forms.splice(findex, 1); + this.forms.splice(id, 1); return true; } @@ -266,12 +263,13 @@ export class Form injects = form.getSubmitInjects(); let counter = 0; - // todo: test if attach necessary (maybe already attached in event manager) // Register normal form behavior - this.app.eventManager.attach(form.getId(), function () - { - self.submitForm(form, action); - }, true); + if (!this.app.eventManager.isAttached(form.getId())) { + this.app.eventManager.attach(form.getId(), function () + { + self.submitForm(form, action); + }, true); + } // Run all injects first for (let property in injects) { diff --git a/Utils/Parser/Markdown.js b/Utils/Parser/Markdown.js index 9d0f37e..396d284 100644 --- a/Utils/Parser/Markdown.js +++ b/Utils/Parser/Markdown.js @@ -2558,7 +2558,7 @@ clean(doc); // some stuff, like accidental reference links must now be escaped - // TODO + // todo // doc.innerHTML = doc.innerHTML.replace(/\[[\S\t ]]/); var nodes = doc.childNodes, diff --git a/Utils/UiUtils.js b/Utils/UiUtils.js index c18e03e..dd2b624 100644 --- a/Utils/UiUtils.js +++ b/Utils/UiUtils.js @@ -133,7 +133,7 @@ */ jsOMS.ready = function (func) { - // TODO: IE problems? + Maybe interactive + loaded can cause problems since elements might not be loaded yet?!!?!!?! + // todo: IE problems? + Maybe interactive + loaded can cause problems since elements might not be loaded yet?!!?!!?! if (document.readyState === 'complete' || document.readyState === 'loaded' || document.readyState === 'interactive' diff --git a/Utils/oLib.js b/Utils/oLib.js index 3333e6d..ba72966 100644 --- a/Utils/oLib.js +++ b/Utils/oLib.js @@ -276,7 +276,7 @@ */ jsOMS.ready = function (func) { - // TODO: IE problems? + Maybe interactive + loaded can cause problems since elements might not be loaded yet?!!?!!?! + // todo: IE problems? + Maybe interactive + loaded can cause problems since elements might not be loaded yet?!!?!!?! if (document.readyState === 'complete' || document.readyState === 'loaded' || document.readyState === 'interactive') { func(); } else { diff --git a/Views/FormView.js b/Views/FormView.js index 4f56265..3069423 100644 --- a/Views/FormView.js +++ b/Views/FormView.js @@ -115,7 +115,6 @@ export class FormView */ getSubmit () { - // todo: question, exclude save/remove button? maybe not because they also submit data right? return document.querySelectorAll( '#' + this.id + ' input[type=submit], ' + 'button[form=' + this.id + '][type=submit], ' @@ -133,7 +132,6 @@ export class FormView * @since 1.0.0 */ getImagePreviews() { - // todo: question, exclude save/remove button? maybe not because they also submit data right? return document.querySelectorAll( '#' + this.id + ' input[type=file].preview' ); @@ -397,7 +395,15 @@ export class FormView } // Create FormData - /* todo: implement once we know how to handle this in the backend/php + /** + * @todo Orange-Management/Modules#202 + * Consider to use FormData + * Form data is currently submitted in two steps if it contains media files. + * 1. Upload media data + * 2. Submit form data + * Consider to use `FormData` in order to submit media files and form data at the same time. + */ + /* const formData = new FormData(), dataLength = data.length;