sproutcore 1.10.1 → 1.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG +13 -0
- data/VERSION.yml +1 -1
- data/lib/frameworks/sproutcore/CHANGELOG.md +69 -31
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +14 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/object.js +14 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +7 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +13 -9
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +57 -23
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/enabled_states_test.js +24 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +63 -13
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +7 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +28 -5
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +30 -3
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +23 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +135 -89
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +12 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +18 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +58 -20
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select/methods.js +15 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +24 -23
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +4 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/popup_button.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/delegates/inline_text_field.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +33 -16
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +14 -6
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/control.js +23 -18
- data/lib/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/delegates/inline_text_field/inline_text_field.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_mixin_tests.js +78 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_resize_test.js +45 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/content_value_support/content.js +112 -58
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/image_queue.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/transition_test.js +141 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +27 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +631 -593
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_fade_color_transition.js +5 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_move_in_transition.js +5 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_reveal_transition.js +68 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +128 -49
- data/lib/frameworks/sproutcore/frameworks/foundation/views/field.js +33 -8
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +209 -187
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +7 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +34 -4
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +68 -9
- data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +2 -1
- data/lib/sproutcore/rack/builder.rb +45 -25
- data/sproutcore.gemspec +1 -0
- 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(
|
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);
|