From 16cda6aa866d07473c8b2d891c00be00549e0626 Mon Sep 17 00:00:00 2001 From: Jason Denney Date: Sun, 3 Nov 2013 08:42:30 -0500 Subject: [PATCH] Remove unused code, add comment --- .../javascripts/custom_netzke_helpers.js | 133 +----------------- 1 file changed, 1 insertion(+), 132 deletions(-) diff --git a/app/assets/javascripts/custom_netzke_helpers.js b/app/assets/javascripts/custom_netzke_helpers.js index cd5bd34..22c27c1 100644 --- a/app/assets/javascripts/custom_netzke_helpers.js +++ b/app/assets/javascripts/custom_netzke_helpers.js @@ -3,138 +3,7 @@ Ext.Ajax.on('requestexception', function(conn, response, options) { if (response.status === 401) { window.location = '/users/sign_in'; } }, this); - -Ext.define('app.view.form.field.TimeField', { - extend:'Ext.form.FieldContainer', - mixins:{ - field:'Ext.form.field.Field' - }, - alias: 'widget.xampmtime', - - layout: 'hbox', - format: 'H:i:s', - submitFormat: 'H:i:s', - - hourField: null, - minuteField: null, - ampmField: null, - - /* custom configs & callbacks */ - - getValue: function(v){ - hour = this.hourField.getValue(); - minute = this.minuteField.getValue(); - ampm = this.ampmField.getValue(); - value = Ext.Date.parse(hour + " " + minute + " " + ampm, 'g i A'); - value = Ext.Date.format(value, this.submitFormat); - return value; - }, - - getSubmitValue: function(value){ - /* override function getValue() */ - return this.getValue(value); - }, - - setValue: function(value){ - if (Ext.isString(value) || Ext.isDate(value) ){ - var dt = null; - - if( Ext.isString ) { - dt = new Date(value); - }else{ - dt = value; - } - - hour = Ext.Date.format(dt, 'g'); - minute = Ext.Date.format(dt, 'i'); - ampm = Ext.Date.format(dt, 'A'); - - this.hourField.setValue(hour); - this.minuteField.setRawValue(minute); - this.ampmField.setValue(ampm); - } - - /* override function setValue() */ - }, - - initComponent: function(){ - /* further code on event initComponent */ - var me = this - me.items = me.items || []; - - me.hourField = Ext.create('Ext.form.field.Number', { - // maxWidth: 20, - allowBlank: false, - allowOnlyWhitespace: false, - blankText: "Hour cannot be blank.", - allowDecimals: false, - maxValue: 12, - minValue: 1, - maxLength: 2, - enforceMaxLength: 2, - hideTrigger: true, - submitValue:false, - flex:1, - //fieldStyle: "text-align:right;", - isFormField:false, //exclude from field query's - }); - me.items.push(me.hourField); - - me.colon = Ext.create('Ext.draw.Text', { - text: ':', - padding: '3 3 0 3' - }); - me.items.push(me.colon); - - me.minuteField = Ext.create('Ext.form.field.Number', { - // maxWidth: 20, - allowBlank: false, - allowOnlyWhitespace: false, - blankText: "Minutes cannot be blank.", - allowDecimals: false, - maxValue: 59, - minValue: 0, - maxLength: 2, - enforceMaxLength: 2, - hideTrigger: true, - submitValue:false, - flex:1, - isFormField:false, //exclude from field query's - }); - me.items.push(me.minuteField); - - - me.ampmField = Ext.create('Ext.form.ComboBox', { - //maxWidth: 25, - value: 'PM', - store: ['AM', 'PM'], - forceSelection: true, - flex:1, - editable: false - }); - - me.items.push(me.ampmField); - - me.callParent(); - - // this dummy is necessary because Ext.Editor will not check whether an inputEl is present or not - this.inputEl = { - dom: document.createElement('div'), - swallowEvent:function(){} - }; - - me.initField(); - }, - - focus:function(){ - this.callParent(arguments); - this.hourField.focus(); - }, -}); - - - - +//Override default netzke time entry field Ext.define('Ext.ux.form.field.DateTime', { extend:'Ext.form.FieldContainer', mixins:{