sproutcore 1.0.1030 → 1.0.1031

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,7 +1,7 @@
1
1
  ---
2
- :patch: 1030
3
- :digest: 08480f0db0e56c32ce2c6a328444980a5010ccaf
2
+ :patch: 1031
3
+ :digest: a4a6ad7402d09a2424b632097d189cbe5249461e
4
4
  :dist:
5
- frameworks/sproutcore: f9f7fe42cbb165a4021eeb616c6990914b83079d
5
+ frameworks/sproutcore: 8c54dc5a319e402e86319e5a98c21d16744200d8
6
6
  :major: 1
7
7
  :minor: 0
@@ -187,7 +187,7 @@ SC.RootResponder = SC.Object.extend({
187
187
  // Otherwise, make the main pane the key pane (if it accepts it).
188
188
  if (!newKeyPane) {
189
189
  var mainPane = this.get('mainPane') ;
190
- if (mainPane.get('acceptsKeyPane')) newKeyPane = mainPane ;
190
+ if (mainPane && mainPane.get('acceptsKeyPane')) newKeyPane = mainPane ;
191
191
  }
192
192
 
193
193
  // now notify old and new key views of change after edit
@@ -11,44 +11,55 @@
11
11
  // note: need to test interaction with Validators here
12
12
  // possibly move Validator support to TextFieldView specifically.
13
13
 
14
- var pane, view, view1;
14
+ var pane, view, view1, view2;
15
+
15
16
  module("SC.TextFieldView",{
16
- setup: function() {
17
- SC.RunLoop.begin();
18
- pane = SC.MainPane.create({
19
- childViews: [
20
- SC.TextFieldView.extend({
21
- hint:'First Name',
22
- value:'',
23
- title:'First Name'
24
- }),
25
- SC.TextFieldView.extend({
26
- hint:'Name',
27
- value:'SproutCore',
28
- isEnabled: NO
29
- })]
30
- });
31
- pane.append(); // make sure there is a layer...
32
- SC.RunLoop.end();
33
-
34
- view = pane.childViews[0];
35
- view1= pane.childViews[1];
36
- },
37
-
38
- teardown: function() {
39
- pane.remove();
40
- pane = view = null ;
41
- }
17
+ setup: function() {
18
+ SC.RunLoop.begin();
19
+ pane = SC.MainPane.create({
20
+ childViews: [
21
+ SC.TextFieldView.extend({
22
+ hint:'First Name',
23
+ value:'',
24
+ title:'First Name'
25
+ }),
26
+ SC.TextFieldView.extend({
27
+ hint:'Name',
28
+ value:'SproutCore',
29
+ isEnabled: NO
30
+ }),
31
+ SC.TextFieldView.extend({
32
+ layerId: 'fieldWithCustomId'
33
+ })
34
+ ]
35
+ });
36
+ pane.append(); // make sure there is a layer...
37
+ SC.RunLoop.end();
38
+
39
+ view = pane.childViews[0];
40
+ view1 = pane.childViews[1];
41
+ view2 = pane.childViews[2];
42
+ },
43
+
44
+ teardown: function() {
45
+ pane.remove();
46
+ pane = view = null ;
47
+ }
42
48
  });
43
49
 
44
50
  test("renders an text field input tag with appropriate attributes", function() {
45
51
  equals(view.get('value'), '', 'value should be empty');
46
52
  equals(view1.get('value'), 'SproutCore', 'value should not be empty ');
47
- equals(view.get('isEnabled'),YES,'field enabled' );
53
+ equals(view.get('isEnabled'),YES,'field enabled' );
48
54
  equals(view1.get('isEnabled'),NO,'field not enabled' );
49
55
  var q = Q$('input', view.get('layer'));
50
56
  equals(q.attr('type'), 'text', 'should have type as text');
51
- equals(q.attr('name'), SC.guidFor(view), 'should have name as view_guid');
57
+ equals(q.attr('name'), view.get('layerId'), 'should have name as view_layerid');
58
+ });
59
+
60
+ test("renders an text field with a custom layerId with correct id and name html attributes", function() {
61
+ equals(view2.$().attr('id'), 'fieldWithCustomId', 'label html element should have the custom id');
62
+ equals(view2.$input().attr('name'), 'fieldWithCustomId', 'input html element should have the custom name');
52
63
  });
53
64
 
54
65
  test("isEnabled=NO should add disabled class", function() {
@@ -69,8 +80,8 @@ test("isEnabled=NO should add disabled class", function() {
69
80
 
70
81
  test("isEnabled and isEditable mapping", function() {
71
82
  var obj= SC.TextFieldView.create();
72
- obj.set('isEnabled',false);
73
- equals(obj.get('isEditable'),false);
74
- obj.set('isEnabled',true);
75
- equals(obj.get('isEditable'),true);
83
+ obj.set('isEnabled',false);
84
+ equals(obj.get('isEditable'),false);
85
+ obj.set('isEnabled',true);
86
+ equals(obj.get('isEditable'),true);
76
87
  });
@@ -362,7 +362,7 @@ SC.TextFieldView = SC.FieldView.extend(SC.StaticLayout, SC.Editable,
362
362
  if (firstTime || this._forceRenderFirstTime) {
363
363
  this._forceRenderFirstTime = NO;
364
364
  var disabled = this.get('isEnabled') ? '' : 'disabled="disabled"' ;
365
- var name = SC.guidFor(this) ;
365
+ var name = this.get('layerId');
366
366
 
367
367
  context.push('<span class="border"></span>');
368
368
 
@@ -277,7 +277,10 @@ module SC
277
277
  manifest = self
278
278
  filename = target_name
279
279
  else
280
- manifest = target.target_for(target_name).manifest_for(self.variation)
280
+ if (_manifest_target = target.target_for(target_name)).nil?
281
+ throw "Cannot file target #{target_name} for entry #{filename}"
282
+ end
283
+ manifest = _manifest_target.manifest_for(self.variation)
281
284
  manifest.build!
282
285
  end
283
286
 
@@ -338,6 +338,7 @@ module SC
338
338
  if is_verbose && !e.kind_of?(FatalException)
339
339
  SC.logger.fatal("BACKTRACE:\n#{e.backtrace.join("\n")}\n")
340
340
  end
341
+ exit(1)
341
342
  end
342
343
  end
343
344
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sproutcore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1030
4
+ version: 1.0.1031
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sprout Systems, Inc. Apple Inc. and contributors
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-15 00:00:00 -08:00
12
+ date: 2009-11-16 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency