# HG changeset patch # User Dustin Demuth # Date 1437662450 -7200 # Node ID def27cdd0dfa261f3f840314a7587b7f0284d19b # Parent 81fc615456382993bde7667c0c23c611b23ca14f Added Documentation to Windows diff -r 81fc61545638 -r def27cdd0dfa app/view/window/About.js --- a/app/view/window/About.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/About.js Thu Jul 23 16:40:50 2015 +0200 @@ -14,6 +14,9 @@ layout: 'fit', + /** + * This function initialises the Window + */ initComponent: function() { var i18n = Lada.getApplication().bundle; @@ -70,6 +73,9 @@ this.callParent(arguments); }, + /** + * This function converts an Array into HTML-paragraphs + */ rolesToHtml: function() { var roles = ''; var r = Lada.userroles.split(','); diff -r 81fc61545638 -r def27cdd0dfa app/view/window/DeleteProbe.js --- a/app/view/window/DeleteProbe.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/DeleteProbe.js Thu Jul 23 16:40:50 2015 +0200 @@ -23,6 +23,9 @@ record: null, parentWindow: null, + /** + * This function initialises the Window + */ initComponent: function() { var i18n = Lada.getApplication().bundle; @@ -158,7 +161,7 @@ }, /** - * Init + * Inititalise Data */ initData: function() { var i18n = Lada.getApplication().bundle; @@ -176,6 +179,9 @@ return r; }, + /** + * Reload the Application + */ reload: function(btn) { if (btn === 'yes') { location.reload(); diff -r 81fc61545638 -r def27cdd0dfa app/view/window/FileUpload.js --- a/app/view/window/FileUpload.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/FileUpload.js Thu Jul 23 16:40:50 2015 +0200 @@ -7,6 +7,7 @@ */ /** + * This is a simple Fileupload Window, used to upload LAF-Files */ Ext.define('Lada.view.window.FileUpload', { extend: 'Ext.window.Window', @@ -15,6 +16,9 @@ file: null, + /** + * This function initialises the Window + */ initComponent: function() { var me = this; this.browseButton = Ext.create('Ext.ux.upload.BrowseButton', { @@ -45,11 +49,19 @@ this.callParent(arguments); }, + /** + * @private + * A handler for a Abort-Button + */ abort: function(button) { var win = button.up('window'); win.close(); }, + /** + * @private + * A handler for the Input field + */ fileSelected: function(input, file) { var item = Ext.create('Ext.ux.upload.Item', { fileApiObject: file[0] @@ -58,6 +70,10 @@ this.file = item; }, + /** + * @private + * A handler for the Upload-Button + */ uploadFile: function(button) { // TODO Error handling ? var win = button.up('window'); @@ -75,6 +91,9 @@ } }, + /** + * @private + */ uploadSuccess: function(file, response) { this.close(); var win = Ext.create('Lada.view.window.ImportResponse', { @@ -86,6 +105,9 @@ win.show(); }, + /** + * @private + */ uploadFailure: function(file, response) { // TODO handle Errors correctly, especially AuthenticationTimeouts this.close(); diff -r 81fc61545638 -r def27cdd0dfa app/view/window/GenProbenFromMessprogramm.js --- a/app/view/window/GenProbenFromMessprogramm.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/GenProbenFromMessprogramm.js Thu Jul 23 16:40:50 2015 +0200 @@ -23,6 +23,9 @@ record: null, parentWindow: null, + /** + * This function initialises the Window + */ initComponent: function() { var i18n = Lada.getApplication().bundle; @@ -177,7 +180,7 @@ }, /** - * Init + * Initiatlise the Data */ initData: function() { var i18n = Lada.getApplication().bundle; @@ -202,6 +205,9 @@ return r; }, + /** + * Reload the Application + */ reload: function(btn) { if (btn === 'yes') { location.reload(); diff -r 81fc61545638 -r def27cdd0dfa app/view/window/ImportResponse.js --- a/app/view/window/ImportResponse.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/ImportResponse.js Thu Jul 23 16:40:50 2015 +0200 @@ -1,5 +1,5 @@ /** - * + * This Window is shown, when Proben could be imported from a LAF file */ Ext.define('Lada.view.window.ImportResponse', { extend: 'Ext.window.Window', @@ -31,6 +31,11 @@ this.callParent(arguments); }, + /** + * Parse the Response + * @param msg the Lada-Erro-Code + * @param data the payload of the response + */ parseResponse: function(msg, data) { console.log(Ext.JSON.decode(data)); data = Ext.JSON.decode(data); diff -r 81fc61545638 -r def27cdd0dfa app/view/window/Messprogramm.js --- a/app/view/window/Messprogramm.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/Messprogramm.js Thu Jul 23 16:40:50 2015 +0200 @@ -29,6 +29,9 @@ record: null, + /** + * This function initialises the Window + */ initComponent: function() { var i18n = Lada.getApplication().bundle; var me = this; @@ -190,10 +193,18 @@ // there are no children.... }, + /** + * Instructs the fields / forms listed in this method to set a message. + * @param errors These Errors shall be shown + * @param warnings These Warning shall be shown + */ setMessages: function(errors, warnings) { this.down('messprogrammform').setMessages(errors, warnings); }, + /** + * Instructs the fields / forms listed in this method to clear their messages. + */ clearMessages: function() { this.down('messprogrammform').clearMessages(); } diff -r 81fc61545638 -r def27cdd0dfa app/view/window/MessprogrammOrt.js --- a/app/view/window/MessprogrammOrt.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/MessprogrammOrt.js Thu Jul 23 16:40:50 2015 +0200 @@ -29,6 +29,9 @@ parentWindow: null, record: null, + /** + * This function initialises the Window + */ initComponent: function() { var i18n = Lada.getApplication().bundle; @@ -120,6 +123,9 @@ this.callParent(arguments); }, + /** + * Initialise the Data of this Window. + */ initData: function() { //Only do this if an OrtId exists... var ortId = this.record.get('ortId'); @@ -226,10 +232,19 @@ .ortWindow = null; this.close(); }, + + /** + * Instructs the fields / forms listed in this method to set a message. + * @param errors These Errors shall be shown + * @param warnings These Warning shall be shown + */ setMessages: function(errors, warnings) { //todo this is a stub }, + /** + * Instructs the fields / forms listed in this method to clear their messages. + */ clearMessages: function() { //todo this is a stub } diff -r 81fc61545638 -r def27cdd0dfa app/view/window/MessungCreate.js --- a/app/view/window/MessungCreate.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/MessungCreate.js Thu Jul 23 16:40:50 2015 +0200 @@ -28,6 +28,9 @@ record: null, grid: null, + /** + * This function initialises the Window + */ initComponent: function() { this.probe = this.record; if (this.probe === null) { @@ -71,6 +74,9 @@ this.callParent(arguments); }, + /** + * Initialise the Data of this Window + */ initData: function() { this.clearMessages(); var messung = Ext.create('Lada.model.Messung', { @@ -79,18 +85,33 @@ this.down('messungform').setRecord(messung); }, + /** + * Instructs the fields / forms listed in this method to set a message. + * @param errors These Errors shall be shown + * @param warnings These Warning shall be shown + */ setMessages: function(errors, warnings) { //todo this is a stub }, + + /** + * Instructs the fields / forms listed in this method to clear their messages. + */ clearMessages: function() { //todo this is a stub }, + /** + * Disable the Childelements of this Window + */ disableChildren: function(){ //intentionally! return true; }, + /** + * Enable the Childelements of this Window + */ enableChildren: function(){ //intentionally! return true; diff -r 81fc61545638 -r def27cdd0dfa app/view/window/MessungEdit.js --- a/app/view/window/MessungEdit.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/MessungEdit.js Thu Jul 23 16:40:50 2015 +0200 @@ -32,6 +32,9 @@ record: null, grid: null, + /** + * This function initialises the Window + */ initComponent: function() { if (this.record === null) { Ext.Msg.alert('Keine valide Messung ausgewählt!'); @@ -119,6 +122,9 @@ this.callParent(arguments); }, + /** + * Initialise the Data of this Window + */ initData: function() { this.clearMessages(); var that = this; @@ -170,16 +176,27 @@ }); }, + /** + * Disable the Forms in this Window. + * Also disable this Windows Children + */ disableForm: function() { this.down('messungform').setReadOnly(true); this.disableChildren(); }, + /** + * Enable the Forms in this Window. + * Also enble this Windows Children + */ enableForm: function() { this.down('messungform').setReadOnly(false); this.enableChildren(); }, + /** + * Disable the Chilelements of this window + */ disableChildren: function() { this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(true); this.down('fset[name=messwerte]').down('messwertgrid').readOnly = true; @@ -189,6 +206,9 @@ this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = true; }, + /** + * Enable the Childelements of this window + */ enableChildren: function() { this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(false); this.down('fset[name=messwerte]').down('messwertgrid').readOnly = false; @@ -198,9 +218,18 @@ this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = false; }, + /** + * Instructs the fields / forms listed in this method to set a message. + * @param errors These Errors shall be shown + * @param warnings These Warning shall be shown + */ setMessages: function(errors, warnings) { this.down('messungform').setMessages(errors, warnings); }, + + /** + * Instructs the fields / forms listed in this method to clear their messages. + */ clearMessages: function() { this.down('messungform').clearMessages(); } diff -r 81fc61545638 -r def27cdd0dfa app/view/window/OrtCreate.js --- a/app/view/window/OrtCreate.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/OrtCreate.js Thu Jul 23 16:40:50 2015 +0200 @@ -28,6 +28,9 @@ record: null, grid: null, + /** + * This function initialises the Window + */ initComponent: function() { this.title = 'Ort'; this.buttons = [{ @@ -87,6 +90,9 @@ this.callParent(arguments); }, + /** + * Initialise the Data of this Window + */ initData: function() { var ort = Ext.create('Lada.model.Ort', { probeId: this.record.get('id') @@ -122,10 +128,18 @@ } }, + /** + * Instructs the fields / forms listed in this method to set a message. + * @param errors These Errors shall be shown + * @param warnings These Warning shall be shown + */ setMessages: function(errors, warnings) { //todo this is a stub }, + /** + * Instructs the fields / forms listed in this method to clear their messages. + */ clearMessages: function() { //todo this is a stub } diff -r 81fc61545638 -r def27cdd0dfa app/view/window/OrtEdit.js --- a/app/view/window/OrtEdit.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/OrtEdit.js Thu Jul 23 16:40:50 2015 +0200 @@ -30,6 +30,9 @@ record: null, grid: null, + /** + * This function initialises the Window + */ initComponent: function() { if (this.record === null) { Ext.Msg.alert('Kein valider Ort ausgewählt!'); @@ -102,6 +105,9 @@ this.callParent(arguments); }, + /** + * Initialise the Data of this Window + */ initData: function() { Ext.ClassManager.get('Lada.model.Ort').load(this.record.get('id'), { failure: function(record, action) { @@ -180,10 +186,18 @@ } }, + /** + * Instructs the fields / forms listed in this method to set a message. + * @param errors These Errors shall be shown + * @param warnings These Warning shall be shown + */ setMessages: function(errors, warnings) { //todo this is a stub }, + /** + * Instructs the fields / forms listed in this method to clear their messages. + */ clearMessages: function() { //todo this is a stub } diff -r 81fc61545638 -r def27cdd0dfa app/view/window/ProbeCreate.js --- a/app/view/window/ProbeCreate.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/ProbeCreate.js Thu Jul 23 16:40:50 2015 +0200 @@ -26,6 +26,9 @@ record: null, + /** + * This function initialises the Window + */ initComponent: function() { this.title = '§3-Probe'; this.buttons = [{ @@ -59,24 +62,41 @@ this.callParent(arguments); }, + /** + * Initialise the Data of this Window + */ initData: function() { var record = Ext.create('Lada.model.Probe'); this.down('probeform').setRecord(record); }, + /** + * Instructs the fields / forms listed in this method to set a message. + * @param errors These Errors shall be shown + * @param warnings These Warning shall be shown + */ setMessages: function(errors, warnings) { this.down('probeform').setMessages(errors, warnings); }, + /** + * Instructs the fields / forms listed in this method to clear their messages. + */ clearMessages: function() { this.down('probeform').clearMessages(); }, + /** + * Disable the Childelements of this window + */ disableChildren: function(){ //intentionally! return true; }, + /** + * Enable the Childelements of this window + */ enableChildren: function(){ //intentionally! return true; diff -r 81fc61545638 -r def27cdd0dfa app/view/window/ProbeEdit.js --- a/app/view/window/ProbeEdit.js Thu Jul 23 16:40:28 2015 +0200 +++ b/app/view/window/ProbeEdit.js Thu Jul 23 16:40:50 2015 +0200 @@ -30,6 +30,9 @@ record: null, + /** + * This function initialises the Window + */ initComponent: function() { if (this.record === null) { Ext.Msg.alert('Keine valide Probe ausgewählt!'); @@ -116,6 +119,9 @@ this.callParent(arguments); }, + /** + * Initialise the Data of this Window + */ initData: function() { this.setLoading(true); this.clearMessages(); @@ -160,10 +166,16 @@ }); }, + /** + * Enable the Messungengrid + */ enableAddMessungen: function() { this.down('fset[name=messungen]').down('messunggrid').setReadOnly(false); }, + /** + * Disable the Childelements of this window + */ disableChildren: function() { if (!this.record.get('owner')) { // Disable only when the User is not the owner of the Probe @@ -179,6 +191,9 @@ this.down('fset[name=pkommentare]').down('pkommentargrid').readOnly = true; }, + /** + * Enable the Childelements of this window + */ enableChildren: function() { this.down('fset[name=messungen]').down('messunggrid').setReadOnly(false); this.down('fset[name=messungen]').down('messunggrid').readOnly = false; @@ -190,6 +205,11 @@ this.down('fset[name=pkommentare]').down('pkommentargrid').readOnly = false; }, + /** + * Instructs the fields / forms listed in this method to set a message. + * @param errors These Errors shall be shown + * @param warnings These Warning shall be shown + */ setMessages: function(errors, warnings) { this.down('probeform').setMessages(errors, warnings); var errorOrtText = ''; @@ -230,6 +250,9 @@ errorOrtText === '' ? null : errorOrtText); }, + /** + * Instructs the fields / forms listed in this method to clear their messages. + */ clearMessages: function() { this.down('probeform').clearMessages(); this.down('fset[name=orte]').clearMessages();