diff --git a/Auth/Auth.js b/Auth/Auth.js index 04d15b4..4f2d3dc 100644 --- a/Auth/Auth.js +++ b/Auth/Auth.js @@ -62,7 +62,7 @@ */ jsOMS.Auth.prototype.login = function () { - var authRequest = new jsOMS.Request(); + var authRequest = new jsOMS.Message.Request(); authRequest.setUri(this.uri); authRequest.setMethod(jsOMS.EnumRequestMethod.POST); authRequest.setResponseType(jsOMS.EnumRequestType.JSON); diff --git a/Log/Logger.js b/Log/Logger.js index e9fc6ae..2c9436a 100644 --- a/Log/Logger.js +++ b/Log/Logger.js @@ -41,8 +41,8 @@ { context['datetime'] = (new Date()).toISOString(); context['version'] = '1.0.0'; - context['os'] = jsOMS.Request.getOS(); - context['browser'] = jsOMS.Request.getBrowser(); + context['os'] = jsOMS.Message.Request.getOS(); + context['browser'] = jsOMS.Message.Request.getBrowser(); context['path'] = window.location.href; context['level'] = level; context['message'] = message; @@ -63,7 +63,7 @@ } if(this.remote) { - let request = new jsOMS.Request(), + let request = new jsOMS.Message.Request(), request.setData(context); request.setType(jsOMS.EnumResponseType.JSON); request.setUri('/{/lang}/api/log'); diff --git a/Message/Request/Request.js b/Message/Request/Request.js index fb706a9..a8904a1 100644 --- a/Message/Request/Request.js +++ b/Message/Request/Request.js @@ -9,14 +9,14 @@ */ (function (jsOMS, undefined) { - + /** * @constructor * * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request = function (uri, method, type) + jsOMS.Message.Request = function (uri, method, type) { this.uri = typeof uri !== 'undefined' ? uri : null; this.method = typeof method !== 'undefined' ? method : jsOMS.EnumRequestMethod.GET; @@ -30,7 +30,7 @@ this.xhr = new XMLHttpRequest(); }; - jsOMS.Request.getBrowser = function() + jsOMS.Message.Request.getBrowser = function() { if((!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0) { return jsOMS.EnumBrowser.OPERA; @@ -49,7 +49,7 @@ } }; - jsOMS.Request.getOS = function() + jsOMS.Message.Request.getOS = function() { for(let os in jsOMS.EnumOSType) { if(navigator.appversion.indexOf(jsOMS.EnumOSType[os]) !== -1) { @@ -70,7 +70,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.setMethod = function (method) + jsOMS.Message.Request.prototype.setMethod = function (method) { this.method = method; }; @@ -87,7 +87,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.getMethod = function () + jsOMS.Message.Request.prototype.getMethod = function () { return this.method; }; @@ -104,7 +104,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.setResponseType = function (type) + jsOMS.Message.Request.prototype.setResponseType = function (type) { this.xhr.responseType = type; }; @@ -121,7 +121,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.getResponseType = function () + jsOMS.Message.Request.prototype.getResponseType = function () { return this.responseType; }; @@ -137,7 +137,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.setRequestHeader = function (type, header) + jsOMS.Message.Request.prototype.setRequestHeader = function (type, header) { this.requestHeader[type] = header; }; @@ -152,7 +152,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.getRequestHeader = function () + jsOMS.Message.Request.prototype.getRequestHeader = function () { return this.requestHeader; }; @@ -167,7 +167,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.setUri = function (uri) + jsOMS.Message.Request.prototype.setUri = function (uri) { this.uri = uri; }; @@ -182,7 +182,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.getUri = function () + jsOMS.Message.Request.prototype.getUri = function () { return this.uri; }; @@ -197,7 +197,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.setSuccess = function (callback) + jsOMS.Message.Request.prototype.setSuccess = function (callback) { this.success = callback; }; @@ -212,7 +212,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.setData = function (data) + jsOMS.Message.Request.prototype.setData = function (data) { this.data = data; }; @@ -227,7 +227,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.getData = function () + jsOMS.Message.Request.prototype.getData = function () { return this.data }; @@ -244,7 +244,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.setType = function (type) + jsOMS.Message.Request.prototype.setType = function (type) { this.type = type; }; @@ -261,7 +261,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.getType = function () + jsOMS.Message.Request.prototype.getType = function () { return this.type; }; @@ -276,7 +276,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.queryfy = function (obj) + jsOMS.Message.Request.prototype.queryfy = function (obj) { let str = []; for (let p in obj) { @@ -297,7 +297,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.Request.prototype.send = function () + jsOMS.Message.Request.prototype.send = function () { let self = this; diff --git a/Message/Request/RequestManager.js b/Message/Request/RequestManager.js index 16002ea..809c06a 100644 --- a/Message/Request/RequestManager.js +++ b/Message/Request/RequestManager.js @@ -18,7 +18,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.RequestManager = function () + jsOMS.Message.RequestManager = function () { }; }(window.jsOMS = window.jsOMS || {})); diff --git a/Message/Response/ResponseManager.js b/Message/Response/ResponseManager.js index ff9cb1c..ce1c646 100644 --- a/Message/Response/ResponseManager.js +++ b/Message/Response/ResponseManager.js @@ -18,7 +18,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.ResponseManager = function () + jsOMS.Message.ResponseManager = function () { this.messages = {}; }; @@ -37,7 +37,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.ResponseManager.prototype.add = function (key, message, request) + jsOMS.Message.ResponseManager.prototype.add = function (key, message, request) { request = typeof request !== 'undefined' ? request : 'any'; if (typeof this.messages[key] === 'undefined') { @@ -61,7 +61,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.ResponseManager.prototype.execute = function (key, data, request) + jsOMS.Message.ResponseManager.prototype.execute = function (key, data, request) { console.log(data); if (typeof request !== 'undefined' && typeof this.messages[key][request] !== 'undefined') { diff --git a/UI/FormManager.js b/UI/FormManager.js index f373144..061b375 100644 --- a/UI/FormManager.js +++ b/UI/FormManager.js @@ -17,24 +17,24 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.FormManager = function (app) + jsOMS.UI.FormManager = function (app) { this.app = app; this.forms = {}; this.ignore = {}; }; - jsOMS.FormManager.prototype.get = function(id) + jsOMS.UI.FormManager.prototype.get = function(id) { return this.forms[id]; }; - jsOMS.FormManager.prototype.isIgnored = function(id) + jsOMS.UI.FormManager.prototype.isIgnored = function(id) { return this.ignore.indexOf(id) !== -1; }; - jsOMS.FormManager.prototype.bind = function(id) + jsOMS.UI.FormManager.prototype.bind = function(id) { if (typeof id !== 'undefined' && this.ignore.indexOf(id) === -1) { this.bindForm(id) @@ -50,7 +50,7 @@ } }; - jsOMS.FormManager.prototype.bindForm = function(id) + jsOMS.UI.FormManager.prototype.bindForm = function(id) { let self = this; @@ -66,7 +66,7 @@ }); }; - jsOMS.FormManager.prototype.unbindForm = function(id) + jsOMS.UI.FormManager.prototype.unbindForm = function(id) { // todo: do i need the findex? can't i just use id? let findex = 0; @@ -81,7 +81,7 @@ return false; }; - jsOMS.FormManager.prototype.submit = function(form) + jsOMS.UI.FormManager.prototype.submit = function(form) { /* Handle injects */ let injects = form.getSubmitInjects(); @@ -90,7 +90,7 @@ } /* Handle default submit */ - let request = new jsOMS.Request(), + let request = new jsOMS.Message.Request(), self = this; request.setData(form.getData()); @@ -127,7 +127,7 @@ request.send(); }; - jsOMS.FormManager.prototype.count = function () + jsOMS.UI.FormManager.prototype.count = function () { return this.forms.length; }; diff --git a/UI/InputElements.js b/UI/InputElements.js deleted file mode 100644 index e9aa0bc..0000000 --- a/UI/InputElements.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Form manager class. - * - * @author OMS Development Team - * @author Dennis Eichhorn - * @copyright 2013 Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 * @since 1.0.0 - */ -(function (jsOMS, undefined) -{ - "use strict"; - - /** - * @constructor - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - jsOMS.InputElements = function () - { - this.elements = []; - }; - - jsOMS.InputElements.prototype.bind = function(id) - { - - }; - - jsOMS.InputElements.prototype.bindElement = function(e) - { - switch(e.dataset.type) { - case jsOMS.InputElementsEnum.AUTOCOMPLETE: - // autocomplete with drop down returns object - // { value: , text: , data: 'could be object'} - break; - case jsOMS.InputElementsEnum.POPUP: - break; - } - }; -} \ No newline at end of file diff --git a/UI/UIManager.js b/UI/UIManager.js index 9ce31e6..186c42c 100644 --- a/UI/UIManager.js +++ b/UI/UIManager.js @@ -9,6 +9,7 @@ */ (function (jsOMS, undefined) { + jsOMS.UI = {}; /** * @constructor @@ -16,10 +17,10 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.UIManager = function (app) + jsOMS.UI.UIManager = function (app) { this.app = app; - this.formManager = new jsOMS.FormManager(this.app.responseManager); + this.formManager = new jsOMS.FormManager(this.app); this.tabManager = new jsOMS.TabManager(this.app.responseManager); this.tableManager = new jsOMS.TableManager(this.app.responseManager); }; @@ -34,7 +35,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.UIManager.prototype.bind = function (id) + jsOMS.UI.UIManager.prototype.bind = function (id) { if (typeof id === 'undefined') { this.formManager.bind(); @@ -64,7 +65,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.UIManager.prototype.getFormManager = function () + jsOMS.UI.UIManager.prototype.getFormManager = function () { return this.formManager; }; @@ -79,7 +80,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.UIManager.prototype.getTabManager = function () + jsOMS.UI.UIManager.prototype.getTabManager = function () { return this.tabManager; }; @@ -94,7 +95,7 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.UIManager.prototype.getTableManager = function () + jsOMS.UI.UIManager.prototype.getTableManager = function () { return this.tabManager; };