sproutcore 1.10.1 → 1.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG +13 -0
  3. data/VERSION.yml +1 -1
  4. data/lib/frameworks/sproutcore/CHANGELOG.md +69 -31
  5. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +14 -0
  6. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/object.js +14 -0
  7. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +7 -2
  8. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +13 -9
  9. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +57 -23
  10. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/enabled_states_test.js +24 -6
  11. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +2 -2
  12. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +63 -13
  13. data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +3 -3
  14. data/lib/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +7 -1
  15. data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +28 -5
  16. data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +15 -0
  17. data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +30 -3
  18. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +23 -1
  19. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +135 -89
  20. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +12 -0
  21. data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +18 -6
  22. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +58 -20
  23. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +1 -1
  24. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select/methods.js +15 -1
  25. data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +1 -1
  26. data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +10 -0
  27. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +1 -1
  28. data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +24 -23
  29. data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +4 -0
  30. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/popup_button.js +10 -0
  31. data/lib/frameworks/sproutcore/frameworks/foundation/delegates/inline_text_field.js +4 -4
  32. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +33 -16
  33. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +14 -6
  34. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/control.js +23 -18
  35. data/lib/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +4 -4
  36. data/lib/frameworks/sproutcore/frameworks/foundation/tests/delegates/inline_text_field/inline_text_field.js +1 -0
  37. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_mixin_tests.js +78 -0
  38. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_resize_test.js +45 -1
  39. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/content_value_support/content.js +112 -58
  40. data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/image_queue.js +2 -2
  41. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/transition_test.js +141 -0
  42. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +27 -2
  43. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +631 -593
  44. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_fade_color_transition.js +5 -0
  45. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_move_in_transition.js +5 -0
  46. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_reveal_transition.js +68 -1
  47. data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +128 -49
  48. data/lib/frameworks/sproutcore/frameworks/foundation/views/field.js +33 -8
  49. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +209 -187
  50. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
  51. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +7 -0
  52. data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +34 -4
  53. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +0 -2
  54. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +68 -9
  55. data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +2 -1
  56. data/lib/sproutcore/rack/builder.rb +45 -25
  57. data/sproutcore.gemspec +1 -0
  58. metadata +17 -2
@@ -75,7 +75,7 @@ test("isEnabled=NO isEditable=NO should add disabled attribute", function() {
75
75
  view.set('isEditable', NO);
76
76
  SC.RunLoop.end();
77
77
  ok(view.$input().attr('disabled'), 'should have disabled attribute');
78
- ok(!view.$input().attr('readOnly'), 'should not have readOnly attribute');
78
+ ok(view.$input().attr('readOnly'), 'should have readOnly attribute');
79
79
  });
80
80
 
81
81
  test("isEnabled=NO isEditable=YES should add disabled attribute", function() {
@@ -121,7 +121,6 @@ test("autoCapitalize=SC.AUTOCAPITALIZE_NONE should add autocapitalize='none'", f
121
121
  view.set('autoCapitalize', SC.AUTOCAPITALIZE_NONE);
122
122
  view.displayDidChange();
123
123
  SC.RunLoop.end();
124
- console.log(view.$input().attr('autocapitalize'))
125
124
  ok(view.$input().attr('autocapitalize') === "none", 'should have an autocapitalize attribute set to "none"');
126
125
  });
127
126
 
@@ -210,6 +209,7 @@ test("interpretKeyEvents should allow key command methods to be implemented.", f
210
209
  deleteForwardFlag = NO,
211
210
  insertNewlineFlag = NO,
212
211
  insertTabFlag = NO,
212
+ insertBacktabFlag = NO,
213
213
  moveLeftFlag = NO,
214
214
  moveRightFlag = NO,
215
215
  moveUpFlag = NO,
@@ -224,6 +224,7 @@ test("interpretKeyEvents should allow key command methods to be implemented.", f
224
224
  view1.deleteForward = function() { deleteForwardFlag = YES; return YES; };
225
225
  view1.insertNewline = function() { insertNewlineFlag = YES; return YES; };
226
226
  view1.insertTab = function() { insertTabFlag = YES; return YES; };
227
+ view1.insertBacktab = function() { insertBacktabFlag = YES; return YES; };
227
228
  view1.moveLeft = function() { moveLeftFlag = YES; return YES; };
228
229
  view1.moveRight = function() { moveRightFlag = YES; return YES; };
229
230
  view1.moveUp = function() { moveUpFlag = YES; return YES; };
@@ -239,6 +240,8 @@ test("interpretKeyEvents should allow key command methods to be implemented.", f
239
240
  view1.keyDown(evt);
240
241
  evt = SC.Event.simulateEvent(layer, 'keydown', { which: SC.Event.KEY_TAB, keyCode: SC.Event.KEY_TAB });
241
242
  view1.keyDown(evt);
243
+ evt = SC.Event.simulateEvent(layer, 'keydown', { which: SC.Event.KEY_TAB, keyCode: SC.Event.KEY_TAB, shiftKey: YES });
244
+ view1.keyDown(evt);
242
245
  evt = SC.Event.simulateEvent(layer, 'keydown', { which: SC.Event.KEY_RETURN, keyCode: SC.Event.KEY_RETURN });
243
246
  view1.keyDown(evt);
244
247
  evt = SC.Event.simulateEvent(layer, 'keydown', { which: SC.Event.KEY_ESC, keyCode: SC.Event.KEY_ESC });
@@ -268,6 +271,7 @@ test("interpretKeyEvents should allow key command methods to be implemented.", f
268
271
  // Test.
269
272
  ok(deleteBackwardFlag, 'deleteBackward should have been triggered.');
270
273
  ok(insertTabFlag, 'insertTab should have been triggered.');
274
+ ok(insertBacktabFlag, 'insertBacktab should have been triggered.');
271
275
  ok(insertNewlineFlag, 'insertNewline should have been triggered.');
272
276
  ok(cancelFlag, 'cancel should have been triggered.');
273
277
  ok(moveLeftFlag, 'moveLeft should have been triggered.');
@@ -281,6 +285,27 @@ test("interpretKeyEvents should allow key command methods to be implemented.", f
281
285
  ok(pageDownFlag, 'pageDown should have been triggered.');
282
286
  });
283
287
 
288
+ test("tab should attempt to move focus", function() {
289
+ var nextValidKeyViewFlag = NO,
290
+ previousValidKeyViewFlag = NO,
291
+ evt,
292
+ layer;
293
+
294
+ view1.nextValidKeyView = function() { nextValidKeyViewFlag = YES; return null; }.property();
295
+ view1.previousValidKeyView = function() { previousValidKeyViewFlag = YES; return null; }.property();
296
+
297
+ SC.RunLoop.begin();
298
+ layer = view1.get('layer');
299
+ evt = SC.Event.simulateEvent(layer, 'keydown', { which: SC.Event.KEY_TAB, keyCode: SC.Event.KEY_TAB });
300
+ view1.keyDown(evt);
301
+ evt = SC.Event.simulateEvent(layer, 'keydown', { which: SC.Event.KEY_TAB, keyCode: SC.Event.KEY_TAB, shiftKey: YES });
302
+ view1.keyDown(evt);
303
+ SC.RunLoop.end();
304
+
305
+ ok(nextValidKeyViewFlag, 'nextValidKeyView should have been called.');
306
+ ok(previousValidKeyViewFlag, 'previousValidKeyView should have been called.');
307
+ });
308
+
284
309
  // test("isEnabled=NO should add disabled attr to input", function() {
285
310
  // SC.RunLoop.begin();
286
311
  // view1.set('isEnabled', NO);