formize 0.0.25 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.25
1
+ 0.0.26
@@ -66,7 +66,7 @@ $.datepicker.regional['zh-TW'] = { closeText: '關閉', prevText: '<上月'
66
66
  for (var i = 0; i < events.length; i += 1) {
67
67
  var event = events[i];
68
68
  if (event === "load") {
69
- var index = $.behavioursCount; $.behavioursCount += 1;
69
+ var index = $.behavioursCount; $.behavioursCount += 1;
70
70
  $.behaviours.push({selector: selector, handler: handler, index: index});
71
71
  $(document).ready(function(event) {
72
72
  $(selector).each(handler);
@@ -97,8 +97,8 @@ $.datepicker.regional['zh-TW'] = { closeText: '關閉', prevText: '&#x3c;上月'
97
97
  var frame_id = "dialog-" + $.ajaxDialogCount, width = $(document).width();
98
98
  var defaultSettings = {
99
99
  header: "X-Return-Code",
100
- width: 0.6,
101
- height: 0.8
100
+ width: 0.6,
101
+ height: 0.8
102
102
  };
103
103
  if (settings === null || settings === undefined) { settings = {}; }
104
104
  settings = $.extend({}, defaultSettings, settings);
@@ -110,20 +110,20 @@ $.datepicker.regional['zh-TW'] = { closeText: '關閉', prevText: '&#x3c;上月'
110
110
  $('body').append(frame);
111
111
  frame.html(data);
112
112
  frame.prop("dialogSettings", settings);
113
- if (settings.width === 0) {
114
- width = 'auto';
115
- } else if (settings.width < 1) {
116
- width = $(window).width() * settings.width;
117
- } else {
118
- width = settings.width;
119
- }
120
- if (settings.height === 0) {
121
- height = 'auto';
122
- } else if (settings.height < 1) {
123
- height = $(window).height() * settings.height;
124
- } else {
125
- height = settings.height;
126
- }
113
+ if (settings.width === 0) {
114
+ width = 'auto';
115
+ } else if (settings.width < 1) {
116
+ width = $(window).width() * settings.width;
117
+ } else {
118
+ width = settings.width;
119
+ }
120
+ if (settings.height === 0) {
121
+ height = 'auto';
122
+ } else if (settings.height < 1) {
123
+ height = $(window).height() * settings.height;
124
+ } else {
125
+ height = settings.height;
126
+ }
127
127
  frame.dialog({
128
128
  autoOpen: false,
129
129
  show: 'fade',
@@ -304,18 +304,22 @@ $.behave('input[data-datepicker]', "load", function() {
304
304
  var locale = element.data("locale");
305
305
  var options = $.datepicker.regional[locale];
306
306
  if (options === null || options === undefined) {
307
- options = $.datepicker.regional["en"];
307
+ options = $.datepicker.regional["en"];
308
308
  }
309
309
  if (element.data("date-format") !== null) {
310
310
  options['dateFormat'] = element.data("date-format");
311
311
  }
312
+ triggered = $('#'+element.data("datepicker"))
312
313
  options['altField'] = '#'+element.data("datepicker");
313
314
  options['altFormat'] = 'yy-mm-dd';
314
315
  options['defaultDate'] = element.val();
315
- options['onSelect'] = function (dateText, inst) {
316
- element.trigger("emulated:change");
316
+ options['onSelect'] = function (dateText) {
317
+ triggered.trigger("emulated:change");
317
318
  };
318
319
  element.datepicker(options);
320
+ element.keyup(function() {
321
+ triggered.trigger("emulated:change");
322
+ });
319
323
  });
320
324
 
321
325
 
@@ -392,7 +396,6 @@ $.behave("input[data-autocompletion]", "load", function () {
392
396
 
393
397
  // Refresh dependents on changes
394
398
  $.behave("*[data-dependents]", "change emulated:change", Formize.refreshDependents);
395
- // $.behave("*[data-dependents]", "emulated:change", Formize.refreshDependents);
396
399
  // Compensate for changes made with keyboard
397
400
  $.behave("select[data-dependents]", "keypress", Formize.refreshDependents);
398
401
 
@@ -401,8 +404,4 @@ $.behave("input[type='checkbox'][data-show], input[type='checkbox'][data-hide]",
401
404
  $.behave("input[type='checkbox'][data-show], input[type='checkbox'][data-hide]", "change", Formize.toggleCheckboxes)
402
405
  $.behave("input[type='radio'][data-show], input[type='radio'][data-hide]", "load", Formize.toggleCheckboxes);
403
406
  $.behave("input[type='radio'][data-show], input[type='radio'][data-hide]", "change", Formize.toggleRadios)
404
- // $.behave("input[data-show], input[data-hide]", "load", Formize.Toggles.ifChecked);
405
- // $.behave("input[data-show], input[data-hide]", "change", Formize.Toggles.ifChecked);
406
- //$.behave("input[type='checkbox'], input[type='radio']", "load", Formize.toggleCheckables);
407
- //$.behave("input[type='checkbox'], input[type='radio']", "change", Formize.toggleCheckables);
408
407
 
@@ -10,7 +10,7 @@
10
10
  for (var i = 0; i < events.length; i += 1) {
11
11
  var event = events[i];
12
12
  if (event === "load") {
13
- var index = $.behavioursCount; $.behavioursCount += 1;
13
+ var index = $.behavioursCount; $.behavioursCount += 1;
14
14
  $.behaviours.push({selector: selector, handler: handler, index: index});
15
15
  $(document).ready(function(event) {
16
16
  $(selector).each(handler);
@@ -41,8 +41,8 @@
41
41
  var frame_id = "dialog-" + $.ajaxDialogCount, width = $(document).width();
42
42
  var defaultSettings = {
43
43
  header: "X-Return-Code",
44
- width: 0.6,
45
- height: 0.8
44
+ width: 0.6,
45
+ height: 0.8
46
46
  };
47
47
  if (settings === null || settings === undefined) { settings = {}; }
48
48
  settings = $.extend({}, defaultSettings, settings);
@@ -54,20 +54,20 @@
54
54
  $('body').append(frame);
55
55
  frame.html(data);
56
56
  frame.prop("dialogSettings", settings);
57
- if (settings.width === 0) {
58
- width = 'auto';
59
- } else if (settings.width < 1) {
60
- width = $(window).width() * settings.width;
61
- } else {
62
- width = settings.width;
63
- }
64
- if (settings.height === 0) {
65
- height = 'auto';
66
- } else if (settings.height < 1) {
67
- height = $(window).height() * settings.height;
68
- } else {
69
- height = settings.height;
70
- }
57
+ if (settings.width === 0) {
58
+ width = 'auto';
59
+ } else if (settings.width < 1) {
60
+ width = $(window).width() * settings.width;
61
+ } else {
62
+ width = settings.width;
63
+ }
64
+ if (settings.height === 0) {
65
+ height = 'auto';
66
+ } else if (settings.height < 1) {
67
+ height = $(window).height() * settings.height;
68
+ } else {
69
+ height = settings.height;
70
+ }
71
71
  frame.dialog({
72
72
  autoOpen: false,
73
73
  show: 'fade',
@@ -248,18 +248,22 @@ $.behave('input[data-datepicker]', "load", function() {
248
248
  var locale = element.data("locale");
249
249
  var options = $.datepicker.regional[locale];
250
250
  if (options === null || options === undefined) {
251
- options = $.datepicker.regional["en"];
251
+ options = $.datepicker.regional["en"];
252
252
  }
253
253
  if (element.data("date-format") !== null) {
254
254
  options['dateFormat'] = element.data("date-format");
255
255
  }
256
+ triggered = $('#'+element.data("datepicker"))
256
257
  options['altField'] = '#'+element.data("datepicker");
257
258
  options['altFormat'] = 'yy-mm-dd';
258
259
  options['defaultDate'] = element.val();
259
- options['onSelect'] = function (dateText, inst) {
260
- element.trigger("emulated:change");
260
+ options['onSelect'] = function (dateText) {
261
+ triggered.trigger("emulated:change");
261
262
  };
262
263
  element.datepicker(options);
264
+ element.keyup(function() {
265
+ triggered.trigger("emulated:change");
266
+ });
263
267
  });
264
268
 
265
269
 
@@ -336,7 +340,6 @@ $.behave("input[data-autocompletion]", "load", function () {
336
340
 
337
341
  // Refresh dependents on changes
338
342
  $.behave("*[data-dependents]", "change emulated:change", Formize.refreshDependents);
339
- // $.behave("*[data-dependents]", "emulated:change", Formize.refreshDependents);
340
343
  // Compensate for changes made with keyboard
341
344
  $.behave("select[data-dependents]", "keypress", Formize.refreshDependents);
342
345
 
@@ -345,7 +348,3 @@ $.behave("input[type='checkbox'][data-show], input[type='checkbox'][data-hide]",
345
348
  $.behave("input[type='checkbox'][data-show], input[type='checkbox'][data-hide]", "change", Formize.toggleCheckboxes)
346
349
  $.behave("input[type='radio'][data-show], input[type='radio'][data-hide]", "load", Formize.toggleCheckboxes);
347
350
  $.behave("input[type='radio'][data-show], input[type='radio'][data-hide]", "change", Formize.toggleRadios)
348
- // $.behave("input[data-show], input[data-hide]", "load", Formize.Toggles.ifChecked);
349
- // $.behave("input[data-show], input[data-hide]", "change", Formize.Toggles.ifChecked);
350
- //$.behave("input[type='checkbox'], input[type='radio']", "load", Formize.toggleCheckables);
351
- //$.behave("input[type='checkbox'], input[type='radio']", "change", Formize.toggleCheckables);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.26
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-09 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &21097040 !ruby/object:Gem::Requirement
16
+ requirement: &25166340 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *21097040
24
+ version_requirements: *25166340
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: jquery-rails
27
- requirement: &21096400 !ruby/object:Gem::Requirement
27
+ requirement: &25165740 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *21096400
35
+ version_requirements: *25165740
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jeweler
38
- requirement: &20936740 !ruby/object:Gem::Requirement
38
+ requirement: &25165140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *20936740
46
+ version_requirements: *25165140
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rdoc
49
- requirement: &20936160 !ruby/object:Gem::Requirement
49
+ requirement: &25164540 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 2.4.2
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *20936160
57
+ version_requirements: *25164540
58
58
  description: Like simple_form or formtastic, it aims to handle easily forms but taking
59
59
  in account AJAX and HTML5 on depending fields mainly.
60
60
  email: brice.texier@ekylibre.org
@@ -187,7 +187,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
187
187
  version: '0'
188
188
  segments:
189
189
  - 0
190
- hash: 1125493280864585186
190
+ hash: 3583729754468145096
191
191
  required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  none: false
193
193
  requirements: