diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9c15f84..85b24d5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,11 +16,13 @@ Feel free to grab any open issue implement it and create a new pull request. Mos ```js /** - * @todo Orange-Management/jsOMS#ISSUE_NUMBER + * @todo Orange-Management/Orange-Management#ISSUE_NUMBER [d:difficulty] * Description for the issue */ ``` +The issue information can be used to provide additional information such as priority, difficulty and type. For your first issue try to find a issue marked `[d:first]` or `[d:beginner]`. + ### Code Style Not always are the defined coding style standards upheld, if you notice that simply create a new pull request with the fix. diff --git a/UI/Component/Form.js b/UI/Component/Form.js index 070cdef..aad6815 100644 --- a/UI/Component/Form.js +++ b/UI/Component/Form.js @@ -169,6 +169,8 @@ export class Form this.bindSaveInline(save[i], id); } + // @todo implement bindSaveExternal ??? + if (document.getElementById(id).getAttribute('data-ui-form') !== null) { this.bindAddExternal(id); } @@ -901,7 +903,9 @@ export class Form const parentTplName = selector.length === 0 ? closest : closest + subSelector; if (!parentsTpl.hasOwnProperty(parentTplName)) { - parentsTpl[parentTplName] = selector.length === 0 ? this.closest(closest) : this.closest(closest).querySelector(subSelector); + parentsTpl[parentTplName] = selector.length === 0 + ? this.closest(closest) + : this.closest(closest).querySelector(subSelector); /* @todo: parentNode because of media edit. maybe I need a data-ui-parent element? */ } @@ -918,15 +922,21 @@ export class Form const parentContentName = selector.length === 0 ? closest : closest + subSelector; if (!parentsContent.hasOwnProperty(parentContentName)) { - parentsContent[parentContentName] = selector.length === 0 ? this.closest(closest) : this.closest(closest).querySelector(subSelector).parentNode; + parentsContent[parentContentName] = selector.length === 0 + ? this.closest(closest) + : this.closest(closest).querySelector(subSelector).parentNode; /* @todo: parentNode because of media edit. maybe I need a data-ui-parent element? */ } values = values.concat( - parentsTpl[parentTplName].hasAttribute('data-tpl-value') ? parentsTpl[parentTplName] : Array.prototype.slice.call(parentsTpl[parentTplName].querySelectorAll('[data-tpl-value]')) + parentsTpl[parentTplName].hasAttribute('data-tpl-value') + ? parentsTpl[parentTplName] + : Array.prototype.slice.call(parentsTpl[parentTplName].querySelectorAll('[data-tpl-value]')) ); text = text.concat( - parentsContent[parentContentName].hasAttribute('data-tpl-text') ? parentsContent[parentContentName] : Array.prototype.slice.call(parentsContent[parentContentName].querySelectorAll('[data-tpl-text]')) + parentsContent[parentContentName].hasAttribute('data-tpl-text') + ? parentsContent[parentContentName] + : Array.prototype.slice.call(parentsContent[parentContentName].querySelectorAll('[data-tpl-text]')) ); } @@ -1185,7 +1195,10 @@ export class Form const matches = document.getElementById(formId).querySelectorAll('[data-tpl-text="' + text[i].getAttribute('data-tpl-text') + '"'); const path = text[i].hasAttribute('data-tpl-text-path') ? text[i].getAttribute('data-tpl-text-path') : null; - // todo: consider pulling this out because it exists like 3x2 = 6 times in a similar way or at least 3 times very similarly + /** + * @todo Orange-Management/jsOMS#??? [t:question] [p:low] [d:medium] + * Consider pulling this out because it exists like 3x2 = 6 times in a similar way or at least 3 times very similarly + */ const matchLength = matches.length; for (let c = 0; c < matchLength; ++c) { if (text[i].getAttribute('data-tpl-text').startsWith('http') diff --git a/UI/DragNDrop.js b/UI/DragNDrop.js index e9df55a..58910dd 100644 --- a/UI/DragNDrop.js +++ b/UI/DragNDrop.js @@ -61,7 +61,7 @@ export class DragNDrop }; /** - * Bind DOM elment + * Bind DOM element * * @param {string} id DOM element * @@ -87,7 +87,10 @@ export class DragNDrop }, false); element.addEventListener('dragenter', function(e) { - // todo: highlight + /** + * @todo Orange-Management/jsOMS#??? [t:feature] [p:low] [d:medium] + * Highlight the drop area + */ }, false); element.addEventListener('dragover', function(e) { @@ -99,16 +102,21 @@ export class DragNDrop element.addEventListener('dragleave', function(e) { e.preventDefault(); - // todo: don't highlight + /** + * @todo Orange-Management/jsOMS#??? [t:feature] [p:low] [d:medium] + * Stop highlighting the drop area + */ }, false); element.addEventListener('dragend', function(e) { e.preventDefault(); - // todo: reset all changes + /** + * @todo Orange-Management/jsOMS#??? [t:feature] [p:low] [d:medium] + * Reset all UI states + */ }, false); - //element.addEventListener('drag', function(e) {}); element.addEventListener('drop', function(e) { e.stopPropagation(); e.preventDefault(); @@ -120,8 +128,10 @@ export class DragNDrop self.dragging.innerHTML = this.innerHTML; this.innerHTML = e.dataTransfer.getData('text/html'); - // todo: add to now destination - // todo: remove from old destination + /** + * @todo Orange-Management/jsOMS#??? [t:feature] [p:low] [d:medium] + * Remove from old destination if UI element and add to new destination + */ self.dragging = null; }, false); diff --git a/UI/GeneralUI.js b/UI/GeneralUI.js index 6396f4b..fe53c75 100644 --- a/UI/GeneralUI.js +++ b/UI/GeneralUI.js @@ -66,11 +66,8 @@ export class GeneralUI continue; } - e[i].addEventListener('mouseup', function(event) { - if (event.button !== 0 && event.button !== 1) { - return; - } - + // @todo: implement middle mouse click + e[i].addEventListener('click', function(event) { jsOMS.preventAll(event); history.pushState(null, null, window.location);