// reference local blank image Ext.BLANK_IMAGE_URL = '/static/ria/ext/images/default/s.gif;jsessionid=995D6C405A076B5F582373E0E33D2AE2'; // create namespace Ext.namespace('curvefamily'); // set global cookieStateProvider Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); /** Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); **/ Ext.QuickTips.init(); /** * curvefamily ria-application */ Ext.get("load-status").update("Login wird vorbereitet..."); // create application curvefamily.application = function() { // do NOT access DOM from here; elements don't exist yet function doLogin() { Ext.getCmp('status').getEl().update(''); loginForm.getForm().submit({ method: 'POST', params: {ria_login: 'true'}, waitTitle: ' ', waitMsg: 'Anmeldung läuft...', success: function(){ var redirect = '/index.html;jsessionid=995D6C405A076B5F582373E0E33D2AE2'; window.location = redirect; }, failure:function(form, action){ if (action.failureType == 'server'){ obj = Ext.util.JSON.decode(action.response.responseText); Ext.getCmp('status').getEl().update(obj.errors.message); } loginForm.getForm().reset(); } }) } var textUserName = new Ext.form.TextField({ fieldLabel: 'Benutzername', id: 'j_username', name: 'j_username', width: 200, allowBlank: false }); var textPassword = new Ext.form.TextField({ fieldLabel: 'Passwort', inputType: 'password', name: 'j_password', width: 200, enableKeyEvents: true, allowBlank: false }); textPassword.on('keydown', function(text, e){ if (e.getKey() == e.ENTER){ doLogin(); } }); // private variables var loginForm = new Ext.FormPanel({ url: '/login.html;jsessionid=995D6C405A076B5F582373E0E33D2AE2', labelWidth: 100, border : false, autoWidth: true, autoHeight: true, bodyStyle: 'padding: 5px', defaultType: 'textfield', monitorValid: true, buttonAlign: 'right', items: [textUserName, textPassword, { xtype: 'label', id: 'status', cls: 'formError', name: 'status', width: 200 },{xtype : 'hidden', name : 'lang', value : 'de'}], buttons: [{ text: 'anmelden', formBind: true, handler: doLogin }] }); var loginDialog = new Ext.Window({ title: 'Anmeldung', layout: 'fit', bodyBorder : false, hideBorders : true, animate: true, animateTarget: 'foo', width: 340, autoHeight: true, closable: false, draggable: false, tbar : [{ text: '', iconCls : 'core_flags_de', handler: function(){ var redirect = '/index.html;jsessionid=995D6C405A076B5F582373E0E33D2AE2'; window.location = redirect + '?lang=de'; } },{ text: '', iconCls : 'core_flags_us', handler: function(){ var redirect = '/index.html;jsessionid=995D6C405A076B5F582373E0E33D2AE2'; window.location = redirect + '?lang=en'; } }], items: [ loginForm ] }); // private functions // public space return { // public properties, e.g. strings to translate // public methods init: function() { loginDialog.show(); textUserName.focus(false, 500); Ext.get("loading").remove(); Ext.get("loading-mask").remove(); } }; }(); // end of app // end of file