ruby-extjs 1.0.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,108 +0,0 @@
1
- /**
2
- * @Autor: Maciel Sousa
3
- * @Email: macielcr7@gmail.com
4
- **/
5
-
6
- Ext.define('Abstract.util.List', {
7
- extend: 'Ext.grid.Panel',
8
- enableColumnHide: false,
9
-
10
- modulo : false,
11
- dockedItems : false,
12
- columns : false,
13
-
14
- button_add : true,
15
- button_edit : true,
16
- button_del : true,
17
- button_filter : true,
18
- button_pdf : true,
19
- hidden_buttons : false,
20
-
21
- store : false,
22
-
23
- initComponent: function() {
24
- var me = this;
25
-
26
- var options = {
27
- viewConfig: {
28
- autoScroll: true
29
- }
30
- };
31
-
32
-
33
- if(!me.dockedItems){
34
- var bt_items = [];
35
-
36
- if(me.button_add){
37
- bt_items.push({
38
- xtype: 'button',
39
- id: 'button_add_'+me.modulo,
40
- iconCls: 'bt_add',
41
- hidden: me.hidden_buttons,
42
- action: 'adicionar',
43
- text: 'Adicionar'
44
- });
45
- }
46
- if(me.button_edit){
47
- bt_items.push({
48
- xtype: 'button',
49
- id: 'button_edit_'+me.modulo,
50
- iconCls: 'bt_edit',
51
- hidden: me.hidden_buttons,
52
- action: 'editar',
53
- text: 'Editar'
54
- });
55
- }
56
- if(me.button_del){
57
- bt_items.push({
58
- xtype: 'button',
59
- id: 'button_del_'+me.modulo,
60
- iconCls: 'bt_del',
61
- hidden: me.hidden_buttons,
62
- action: 'deletar',
63
- text: 'Deletar'
64
- });
65
- }
66
- if(me.button_filter){
67
- bt_items.push({
68
- xtype: 'button',
69
- id: 'button_filter_'+me.modulo,
70
- iconCls: 'bt_lupa',
71
- action: 'filtrar',
72
- text: 'Filtrar'
73
- });
74
- }
75
- if(me.button_pdf){
76
- bt_items.push({
77
- xtype: 'button',
78
- id: 'button_pdf_'+me.modulo,
79
- iconCls: 'bt_pdf',
80
- action: 'gerar_pdf',
81
- text: 'Gerar PDF'
82
- });
83
- }
84
-
85
- options.dockedItems = [
86
- {
87
- xtype: 'pagingtoolbar',
88
- displayInfo: true,
89
- store: me.store,
90
- dock: 'bottom'
91
- },
92
- {
93
- xtype: 'toolbar',
94
- dock: 'top',
95
- items: bt_items
96
- }
97
- ];
98
- }
99
- else{
100
- options.dockedItems = me.dockedItems;
101
- }
102
-
103
- Ext.apply(me, options);
104
-
105
- me.callParent(arguments);
106
- }
107
-
108
- });
@@ -1,392 +0,0 @@
1
- Ext.define('Ext.plugins.Notification', {
2
- extend : 'Ext.window.Window',
3
- alias : 'widget.uxNotification',
4
-
5
- cls : 'ux-notification-window',
6
- autoHide : true,
7
- modal : false,
8
- autoHeight : true,
9
- plain : false,
10
- draggable : false,
11
- shadow : false,
12
- focus : Ext.emptyFn,
13
- manager : null,
14
- useXAxis : false,
15
- position : 'br',
16
- spacing : 6,
17
- paddingX : 30,
18
- paddingY : 10,
19
- slideInAnimation : 'easeIn',
20
- slideBackAnimation : 'bounceOut',
21
- slideInDuration : 800,
22
- slideBackDuration : 1000,
23
- hideDuration : 500,
24
- autoHideDelay : 7000,
25
- stickOnClick : true,
26
- stickWhileHover : true,
27
- isHiding : false,
28
- readyToHide : false,
29
- xPos : 0,
30
- yPos : 0,
31
-
32
- statics : {
33
- defaultManager : {
34
- el : null
35
- }
36
- },
37
-
38
- getXposAlignedToManager : function () {
39
- var me = this;
40
- var xPos = 0;
41
- if (me.manager && me.manager.el && me.manager.el.dom) {
42
- if (!me.useXAxis) {
43
- return me.el.getLeft();
44
- } else {
45
- if (me.position == 'br' || me.position == 'tr' || me.position == 'r') {
46
- xPos += me.manager.el.getAnchorXY('r')[0];
47
- xPos -= (me.el.getWidth() + me.paddingX);
48
- } else {
49
- xPos += me.manager.el.getAnchorXY('l')[0];
50
- xPos += me.paddingX;
51
- }
52
- }
53
- }
54
-
55
- return xPos;
56
- },
57
-
58
- getYposAlignedToManager : function () {
59
- var me = this;
60
- var yPos = 0;
61
- if (me.manager && me.manager.el && me.manager.el.dom) {
62
- if (me.useXAxis) {
63
- return me.el.getTop();
64
- } else {
65
- if (me.position == 'br' || me.position == 'bl' || me.position == 'b') {
66
- yPos += me.manager.el.getAnchorXY('b')[1];
67
- yPos -= (me.el.getHeight() + me.paddingY);
68
- } else {
69
- yPos += me.manager.el.getAnchorXY('t')[1];
70
- yPos += me.paddingY;
71
- }
72
- }
73
- }
74
-
75
- return yPos;
76
- },
77
-
78
- getXposAlignedToSibling : function (sibling) {
79
- var me = this;
80
-
81
- if (me.useXAxis) {
82
- if (me.position == 'tl' || me.position == 'bl' || me.position == 'l') {
83
- return (sibling.xPos + sibling.el.getWidth() + sibling.spacing);
84
- } else {
85
- return (sibling.xPos - me.el.getWidth() - me.spacing);
86
- }
87
- } else {
88
- return me.el.getLeft();
89
- }
90
-
91
- },
92
-
93
- getYposAlignedToSibling : function (sibling) {
94
- var me = this;
95
-
96
- if (me.useXAxis) {
97
- return me.el.getTop();
98
- } else {
99
- if (me.position == 'tr' || me.position == 'tl' || me.position == 't') {
100
- return (sibling.yPos + sibling.el.getHeight() + sibling.spacing);
101
- } else {
102
- return (sibling.yPos - me.el.getHeight() - sibling.spacing);
103
- }
104
- }
105
- },
106
-
107
- getNotifications : function (alignment) {
108
- var me = this;
109
-
110
- if (!me.manager.notifications[alignment]) {
111
- me.manager.notifications[alignment] = [];
112
- }
113
-
114
- return me.manager.notifications[alignment];
115
- },
116
-
117
- beforeShow : function () {
118
- var me = this;
119
- if (Ext.isDefined(me.corner)) {
120
- me.position = me.corner;
121
- }
122
- if (Ext.isDefined(me.slideDownAnimation)) {
123
- me.slideBackAnimation = me.slideDownAnimation;
124
- }
125
- if (Ext.isDefined(me.autoDestroyDelay)) {
126
- me.autoHideDelay = me.autoDestroyDelay;
127
- }
128
- if (Ext.isDefined(me.slideInDelay)) {
129
- me.slideInDuration = me.slideInDelay;
130
- }
131
- if (Ext.isDefined(me.slideDownDelay)) {
132
- me.slideBackDuration = me.slideDownDelay;
133
- }
134
- if (Ext.isDefined(me.fadeDelay)) {
135
- me.hideDuration = me.fadeDelay;
136
- }
137
- me.position = me.position.replace(/c/, '');
138
-
139
- switch (me.position) {
140
- case 'br':
141
- me.paddingFactorX = -1;
142
- me.paddingFactorY = -1;
143
- me.siblingAlignment = "br-br";
144
- if (me.useXAxis) {
145
- me.managerAlignment = "bl-br";
146
- } else {
147
- me.managerAlignment = "tr-br";
148
- }
149
- break;
150
- case 'bl':
151
- me.paddingFactorX = 1;
152
- me.paddingFactorY = -1;
153
- me.siblingAlignment = "bl-bl";
154
- if (me.useXAxis) {
155
- me.managerAlignment = "br-bl";
156
- } else {
157
- me.managerAlignment = "tl-bl";
158
- }
159
- break;
160
- case 'tr':
161
- me.paddingFactorX = -1;
162
- me.paddingFactorY = 1;
163
- me.siblingAlignment = "tr-tr";
164
- if (me.useXAxis) {
165
- me.managerAlignment = "tl-tr";
166
- } else {
167
- me.managerAlignment = "br-tr";
168
- }
169
- break;
170
- case 'tl':
171
- me.paddingFactorX = 1;
172
- me.paddingFactorY = 1;
173
- me.siblingAlignment = "tl-tl";
174
- if (me.useXAxis) {
175
- me.managerAlignment = "tr-tl";
176
- } else {
177
- me.managerAlignment = "bl-tl";
178
- }
179
- break;
180
- case 'b':
181
- me.paddingFactorX = 0;
182
- me.paddingFactorY = -1;
183
- me.siblingAlignment = "b-b";
184
- me.useXAxis = 0;
185
- me.managerAlignment = "t-b";
186
- break;
187
- case 't':
188
- me.paddingFactorX = 0;
189
- me.paddingFactorY = 1;
190
- me.siblingAlignment = "t-t";
191
- me.useXAxis = 0;
192
- me.managerAlignment = "b-t";
193
- break;
194
- case 'l':
195
- me.paddingFactorX = 1;
196
- me.paddingFactorY = 0;
197
- me.siblingAlignment = "l-l";
198
- me.useXAxis = 1;
199
- me.managerAlignment = "r-l";
200
- break;
201
- case 'r':
202
- me.paddingFactorX = -1;
203
- me.paddingFactorY = 0;
204
- me.siblingAlignment = "r-r";
205
- me.useXAxis = 1;
206
- me.managerAlignment = "l-r";
207
- break;
208
- }
209
-
210
- if (typeof me.manager == 'string') {
211
- me.manager = Ext.getCmp(me.manager);
212
- }
213
- if (!me.manager) {
214
- me.manager = me.statics().defaultManager;
215
-
216
- if (!me.manager.el) {
217
- me.manager.el = Ext.getBody();
218
- }
219
- }
220
-
221
- if (typeof me.manager.notifications == 'undefined') {
222
- me.manager.notifications = {};
223
- }
224
-
225
- if (me.stickOnClick) {
226
- if (me.body && me.body.dom) {
227
- Ext.fly(me.body.dom).on('click', function () {
228
- me.cancelAutoHide();
229
- me.addCls('notification-fixed');
230
- }, me);
231
- }
232
- }
233
-
234
- me.el.hover(
235
- function () {
236
- me.mouseIsOver = true;
237
- },
238
- function () {
239
- me.mouseIsOver = false;
240
- },
241
- me);
242
-
243
- if (me.autoHide) {
244
- me.task = new Ext.util.DelayedTask(me.doAutoHide, me);
245
- me.task.delay(me.autoHideDelay);
246
- }
247
-
248
- var notifications = me.getNotifications(me.managerAlignment);
249
-
250
- if (notifications.length) {
251
- me.el.alignTo(notifications[notifications.length - 1].el, me.siblingAlignment, [0, 0]);
252
- me.xPos = me.getXposAlignedToSibling(notifications[notifications.length - 1]);
253
- me.yPos = me.getYposAlignedToSibling(notifications[notifications.length - 1]);
254
- } else {
255
- me.el.alignTo(me.manager.el, me.managerAlignment, [(me.paddingX * me.paddingFactorX), (me.paddingY * me.paddingFactorY)]);
256
- me.xPos = me.getXposAlignedToManager();
257
- me.yPos = me.getYposAlignedToManager();
258
- }
259
-
260
- Ext.Array.include(notifications, me);
261
-
262
- me.stopAnimation();
263
-
264
- me.el.animate({
265
- to : {
266
- x : me.xPos,
267
- y : me.yPos,
268
- opacity : 1
269
- },
270
- easing : me.slideInAnimation,
271
- duration : me.slideInDuration,
272
- dynamic : true
273
- });
274
-
275
- },
276
-
277
- slideBack : function () {
278
- var me = this;
279
-
280
- var notifications = me.getNotifications(me.managerAlignment);
281
- var index = Ext.Array.indexOf(notifications, me)
282
-
283
- if (!me.isHiding && me.el && me.manager && me.manager.el && me.manager.el.dom && me.manager.el.isVisible()) {
284
-
285
- if (index) {
286
- me.xPos = me.getXposAlignedToSibling(notifications[index - 1]);
287
- me.yPos = me.getYposAlignedToSibling(notifications[index - 1]);
288
- } else {
289
- me.xPos = me.getXposAlignedToManager();
290
- me.yPos = me.getYposAlignedToManager();
291
- }
292
-
293
- me.stopAnimation();
294
-
295
- me.el.animate({
296
- to : {
297
- x : me.xPos,
298
- y : me.yPos
299
- },
300
- easing : me.slideBackAnimation,
301
- duration : me.slideBackDuration,
302
- dynamic : true
303
- });
304
- }
305
- },
306
-
307
- cancelAutoHide : function () {
308
- var me = this;
309
-
310
- if (me.autoHide) {
311
- me.task.cancel();
312
- me.autoHide = false;
313
- }
314
- },
315
-
316
- doAutoHide : function () {
317
- var me = this;
318
- me.el.hover(
319
- function () {},
320
- function () {
321
- me.hide();
322
- },
323
- me);
324
-
325
- if (!(me.stickWhileHover && me.mouseIsOver)) {
326
- me.hide();
327
- }
328
- },
329
-
330
- hide : function () {
331
- var me = this;
332
- if (!me.isHiding && me.el) {
333
-
334
- me.isHiding = true;
335
-
336
- me.cancelAutoHide();
337
- me.stopAnimation();
338
-
339
- me.el.animate({
340
- to : {
341
- opacity : 0
342
- },
343
- easing : 'easeIn',
344
- duration : me.hideDuration,
345
- dynamic : false,
346
- listeners : {
347
- afteranimate : function () {
348
- if (me.manager) {
349
- var notifications = me.getNotifications(me.managerAlignment);
350
- var index = Ext.Array.indexOf(notifications, me);
351
- if (index != -1) {
352
- Ext.Array.erase(notifications, index, 1);
353
- for (; index < notifications.length; index++) {
354
- notifications[index].slideBack();
355
- }
356
- }
357
- }
358
-
359
- me.readyToHide = true;
360
- me.hide();
361
- }
362
- }
363
- });
364
- }
365
-
366
- if (me.readyToHide) {
367
- me.isHiding = false;
368
- me.readyToHide = false;
369
- me.removeCls('notification-fixed');
370
- this.callParent(arguments);
371
- }
372
- }
373
-
374
- });
375
-
376
- function info(title, msg) {
377
- var msg2 = 'Erro Inesperado';
378
-
379
- var s = Ext.create('widget.uxNotification', {
380
- title : title || 'Aviso!',
381
- position : 'br',
382
- manager : 'demo1',
383
- iconCls : 'information',
384
- width : 350,
385
- autoHideDelay : 5000,
386
- bodyPadding : 10,
387
- html : msg || msg2
388
- }).show();
389
-
390
- s.getEl().setStyle('z-index', '80000');
391
- return s;
392
- };
@@ -1,165 +0,0 @@
1
- /**
2
- * Modifica��es no Combo
3
- * */
4
-
5
- Ext.override(Ext.form.field.ComboBox, {
6
- forceSelection: true,
7
- editable: true,
8
- displayField: 'descricao',
9
- queryMode: 'local',
10
- valueField: 'id',
11
- typeAhead: true,
12
- triggerAction: 'all',
13
- lazyRender: true,
14
-
15
- initComponent: function () {
16
- this.callParent();
17
- }
18
- });
19
-
20
- /**
21
- * Modifica��es no Window
22
- * */
23
-
24
- Ext.override(Ext.window.Window, {
25
- modal: true,
26
- autoHeight: true,
27
- resizable: false,
28
- width: 260,
29
- stateful: false,
30
- isWindow: true,
31
- constrainHeader: true,
32
- border: false,
33
-
34
- initComponent: function () {
35
- this.callParent();
36
- }
37
- });
38
-
39
- /**
40
- * Modifica��es no FormPanel
41
- * */
42
- Ext.override(Ext.form.Panel, {
43
- border: false,
44
- bodyPadding: 10,
45
- autoScroll: true,
46
- method: 'POST',
47
-
48
- initComponent: function () {
49
- this.callParent();
50
- }
51
- });
52
-
53
- /**
54
- * Modifica��es no Store
55
- * */
56
-
57
- Ext.override(Ext.data.Store, {
58
- listeners: {
59
- beforeload: function(store){
60
- store.clearFilter();
61
- }
62
- },
63
- initComponent: function () {
64
- this.callParent();
65
-
66
- }
67
- });
68
-
69
-
70
- Ext.override(Ext.form.field.Number, {
71
- minValue: 0,
72
- allowBlank: false,
73
- decimalPrecision: 12,
74
-
75
- initComponent: function () {
76
- this.callParent();
77
- }
78
- });
79
-
80
- /**
81
- * Modifica��es no Field
82
- * */
83
-
84
- Ext.override(Ext.form.field.Text, {
85
- labelAlign: 'top',
86
- allowBlank: false,
87
- labelStyle: 'font-weight: bold;font-size: 11px;',
88
-
89
- initComponent: function () {
90
- this.callParent();
91
- }
92
- });
93
-
94
- Ext.override(Ext.form.RadioGroup, {
95
- labelAlign: 'top',
96
- columns: 2,
97
- labelStyle: 'font-weight: bold;font-size: 11px;',
98
-
99
- initComponent: function () {
100
- this.callParent();
101
- }
102
- });
103
-
104
- Ext.override(Ext.form.Labelable, {
105
- labelAlign: 'top',
106
- labelStyle: 'font-weight: bold;font-size: 11px;',
107
-
108
- initComponent: function () {
109
- this.callParent();
110
- }
111
- });
112
-
113
- Ext.form.field.Base.override({
114
- setLabel: function (text) {
115
- if (this.rendered) {
116
- Ext.get(this.labelEl.id).update(text);
117
- }
118
- this.fieldLabel = text;
119
- }
120
- });
121
-
122
-
123
- /**
124
- * Modifica��es no MessageBox
125
- * */
126
-
127
- Ext.override(Ext.MessageBox, {
128
- draggable: true,
129
-
130
- initComponent: function () {
131
- this.callParent();
132
- }
133
- });
134
-
135
-
136
- Ext.override(Ext.data.proxy.Proxy, {
137
- reader: {
138
- type: 'json',
139
- messageProperty: 'logout',
140
- root: 'dados'
141
- },
142
- writer: {
143
- type: 'json',
144
- messageProperty: 'message',
145
- writeAllFields: false
146
- },
147
- listeners: {
148
- exception: function(proxy, response, operation){
149
- var dados = Ext.decode(response.responseText, true);
150
- if(dados==null){
151
- Ext.Msg.alert('Erro!', response.responseText);
152
- }
153
- else if(dados.logout==true){
154
- window.location = 'login.php';
155
- }
156
- else if(dados.msg){
157
- Ext.Msg.alert('Aviso!', dados.msg);
158
- }
159
- }
160
- },
161
-
162
- initComponent: function () {
163
- this.callParent();
164
- }
165
- });