sproutcore 1.4.0.rc.4 → 1.4.0.rc.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 4
4
- :patch: 0.rc.4
4
+ :patch: 0.rc.5
5
5
  :digest: e038ba5746bb757cd0ff2391828c5f03496fbb64
6
6
  :dist:
7
7
  frameworks/sproutcore: 7174adeb47aa0930c95ddae79e2c9cf042fded45
@@ -900,6 +900,12 @@ SC.CollectionView = SC.View.extend(
900
900
  // we'll destroy the layer now.
901
901
  existing.destroyLayer();
902
902
  }
903
+
904
+ // We don't want the old layer hanging around, even if we are going
905
+ // to reuse it.
906
+ // (Charles Jolley personally guarantees this code)
907
+ layer = existing.get('layer');
908
+ layer.parentNode.removeChild(layer);
903
909
 
904
910
  containerView.removeChild(existing);
905
911
  }
@@ -346,7 +346,11 @@ module SC
346
346
 
347
347
  # read cache from disk if needed
348
348
  if @file_attr_cache.nil? && File.exists?(file_attr_cache_path)
349
- @file_attr_cache = JSON.parse File.read(file_attr_cache_path)
349
+ begin
350
+ @file_attr_cache = JSON.parse File.read(file_attr_cache_path)
351
+ rescue JSON::ParserError
352
+ # Unparseable, will be handled by the following conditional
353
+ end
350
354
 
351
355
  # Sometimes the file is corrupted, in this case, clear the cache
352
356
  File.delete file_attr_cache_path unless @file_attr_cache
metadata CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
7
7
  - 4
8
8
  - 0
9
9
  - rc
10
- - 4
11
- version: 1.4.0.rc.4
10
+ - 5
11
+ version: 1.4.0.rc.5
12
12
  platform: ruby
13
13
  authors:
14
14
  - Sprout Systems, Inc. Apple Inc. and contributors
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-09-14 00:00:00 -07:00
19
+ date: 2010-09-15 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -1656,11 +1656,6 @@ files:
1656
1656
  - lib/frameworks/sproutcore/frameworks/media/views/simple_controls.js
1657
1657
  - lib/frameworks/sproutcore/frameworks/media/views/video.js
1658
1658
  - lib/frameworks/sproutcore/frameworks/mini/license.js
1659
- - lib/frameworks/sproutcore/frameworks/mobile/english.lproj/core.css
1660
- - lib/frameworks/sproutcore/frameworks/mobile/lib/index.rhtml
1661
- - lib/frameworks/sproutcore/frameworks/mobile/system/root_responder.js
1662
- - lib/frameworks/sproutcore/frameworks/mobile/tests/views/button/ui.js
1663
- - lib/frameworks/sproutcore/frameworks/mobile/views/button.js
1664
1659
  - lib/frameworks/sproutcore/frameworks/runtime/core.js
1665
1660
  - lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js
1666
1661
  - lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/indexOf.js
@@ -1,12 +0,0 @@
1
- /* Core styles needed for iphone apps to operate correctly. */
2
-
3
- body
4
- {
5
- margin: 0px;
6
- padding: 0px;
7
- background-color: #fff;
8
-
9
- /* Turn off font resizing */
10
- -webkit-text-size-adjust: none;
11
- }
12
-
@@ -1,125 +0,0 @@
1
- <% # SPROUTCORE MOBILE INDEX TEMPLATE
2
- # This template provide provides a basic wrapper for a mobile SproutCore
3
- # client. It provides much of the same functionality found in the
4
- # default template except that it also includes necessary configs needed
5
- # for loading your page on the iPhone.
6
- #
7
- # Most of the time, it will be sufficient for your own needs. However, if
8
- # you need to create your own template, you can do so by copying this file
9
- # into your client, naming it 'index.rhtml' and then adding the options
10
- # :layout => 'lib/index' to your Buildfile.
11
- #
12
- # See the comments in this file for more information on what you can
13
- # change.
14
- -%>
15
- <!DOCTYPE html>
16
- <html>
17
- <head>
18
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
19
- <meta name="apple-mobile-web-app-capable" content="yes" />
20
- <meta name="apple-mobile-web-app-status-bar-style" content="black" />
21
- <meta name = "viewport" content = "width = device-width, height = device-height, user-scalable = no" />
22
-
23
- <% # Set the 'title' in your config to alter this setting %>
24
- <title><%= title %></title>
25
- <% #
26
- # You may choose to load one or more bootstrap resources. These are
27
- # JS targets that you would like to load at the top of the page. Specify
28
- # these in your Buildfile with the 'bootstrap' config.
29
- -%>
30
- <% if config.bootstrap %>
31
- <script src="<%= static_url(config.bootstrap) %>" type="text/javascript"></script>
32
- <% end -%>
33
- <% #
34
- # Bootstrap code is loaded at the top of your page to do any early setup
35
- # you might need, including basic browser detection. The default
36
- # bootstrap code provided by SproutCore simply detects your browser
37
- # platform. Add more by including templates targeting the bootstrap
38
- -%>
39
- <% if @content_for_bootstrap %>
40
- <script type="text/javascript">
41
- <%= @content_for_bootstrap %>
42
- </script>
43
- <% end -%>
44
- <% #
45
- # This line should appear in your head area to include the stylesheets
46
- # generated by your client. If you need to include your own
47
- # stylesheets, you don't need to change it here. Instead use the
48
- # required option in your config.
49
- -%>
50
- <%= stylesheets_for_client %>
51
- <%= @content_for_page_styles %>
52
- </head>
53
-
54
- <% # The theme CSS class is added automatically based on your chosen theme.
55
- # If you need to specify a custom theme name, use CONFIG.theme_name
56
- -%>
57
- <body class="<%= [theme_name(:default => 'sc-theme'), 'focus'].compact.join(' ') %>">
58
- <% # This section is used to setup additional optional class names on the
59
- # body content based on JS-selected conditions. Use this to make sure you
60
- # show the proper CSS as soon as the page appears.
61
- -%>
62
- <% unless @content_for_setup_body_class_names.blank? %>
63
- <script type="text/javascript">
64
- <%= @content_for_setup_body_class_names %>
65
- </script>
66
- <% end -%>
67
- <% #
68
- # This is where you root body element will appear. To cause your
69
- # content to appear here, just declare content_for('body') in one of
70
- # your partials.
71
- -%>
72
- <%= @content_for_body %>
73
- <% #
74
- # This is where your loading screen will appear. To add a loading screen
75
- # just declare content_for('loading') in one of your partials.
76
- -%>
77
- <% unless @content_for_loading.blank? %>
78
- <div id="loading">
79
- <%= @content_for_loading %>
80
- </div>
81
- <% end -%>
82
- <% #
83
- # This is where the resources you declare will appear. By default anything
84
- # you add to partials will be added to this section unless you specify
85
- # otherwise. Note that resources are initially hidden so you can pull them
86
- # apart as needed on page load.
87
- -%>
88
- <% unless @content_for_resources.blank? %>
89
- <!-- Resources to be removed from DOM on page load -->
90
- <div id="resources" style="display:none; visibility: hidden;">
91
- <%= @content_for_resources -%>
92
- </div>
93
- <% end -%>
94
- <% #
95
- # This line should appear at the bottom of your page to include your
96
- # generated JavaScript and any libraries you reference. If you need
97
- # to include other javascripts, add them to the :requires option of
98
- # your client in routes.rb instead of changing it here.
99
- -%>
100
- <%= javascripts_for_client %>
101
- <% unless @content_for_page_javascript.blank? %>
102
- <%= @content_for_page_javascript %>
103
- <% end -%>
104
- <% #
105
- # If you use old-style view helpers in your page, this method must be
106
- # called to actually add the page views to your HTML. Normally this will
107
- # not generate any content.
108
- -%>
109
- <% #render_page_views -%>
110
- <% # Older SproutCore applications need SC.didLoad to be called after onload.
111
- # This is no longer required by SproutCore so it is off by default. To
112
- # reenable set use_window_onload = true in yur config.
113
- -%>
114
- <% if config.use_window_onload %>
115
- <!-- Start SproutCore on Page Load -->
116
- <script type="text/javascript">window.onload = SC.didLoad;</script>
117
- <% end -%>
118
- <% #
119
- # The final content section can be used to add any last minute setup you
120
- # need to do before the page ends. This is required for loading unit
121
- # tests among other things.
122
- -%>
123
- <%= @content_for_final -%>
124
- </body>
125
- </html>
@@ -1,12 +0,0 @@
1
- // ========================================================================
2
- // SproutCore -- JavaScript Application Framework
3
- // Copyright ©2006-2008, Sprout Systems, Inc. and contributors.
4
- // Portions copyright ©2008 Apple Inc. All rights reserved.
5
- // ========================================================================
6
-
7
- // Swap in platform-specific subclass. Class-cluster FTW!
8
- SC.RootResponder = SC.RootResponder.extend({
9
-
10
- platform: 'mobile',
11
-
12
- }) ;
@@ -1,9 +0,0 @@
1
- // ==========================================================================
2
- // Project: SproutCore - JavaScript Application Framework
3
- // Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
4
- // portions copyright @2009 Apple Inc.
5
- // License: Licensed under MIT license (see license.js)
6
- // ==========================================================================
7
-
8
- /*global module test htmlbody ok equals same stop start */
9
-
@@ -1,191 +0,0 @@
1
- // ==========================================================================
2
- // Project: SproutCore - JavaScript Application Framework
3
- // Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
4
- // Portions ©2008-2009 Apple Inc. All rights reserved.
5
- // License: Licensed under MIT license (see license.js)
6
- // ==========================================================================
7
-
8
- /** @class
9
-
10
- Implements a push-button-style button. This class is used to implement
11
- both standard push buttons and tab-style controls.
12
-
13
- @extends SC.View
14
- @extends SC.Control
15
- @extends SC.Button
16
- @since SproutCore 1.0
17
- */
18
- SC.ButtonView = SC.View.extend(SC.Control, SC.Button,
19
- /** @scope SC.ButtonView.prototype */ {
20
-
21
- tagName: 'a',
22
- classNames: ['sc-button-view'],
23
-
24
- /**
25
- optionally set this to the theme you want this button to have.
26
-
27
- This is used to determine the type of button this is. You generally
28
- should set a class name on the HTML with the same value to allow CSS
29
- styling.
30
-
31
- The default SproutCore theme supports "regular", "checkbox", and "radio"
32
- */
33
- theme: 'square',
34
-
35
- /**
36
- The button href value. This can be used to create localized button href values. Setting an empty or null href will set it to javascript:;
37
- */
38
- href: '',
39
-
40
- /**
41
- The name of the action you want triggered when the button is pressed.
42
-
43
- This property is used in conjunction with the target property to execute
44
- a method when a regular button is pressed. These properties are not
45
- relevant when the button is used in toggle mode.
46
-
47
- If you do not set a target, then pressing a button will cause the
48
- responder chain to search for a view that implements the action you name
49
- here. If you set a target, then the button will try to call the method
50
- on the target itself.
51
-
52
- For legacy support, you can also set the action property to a function.
53
- Doing so will cause the function itself to be called when the button is
54
- clicked. It is generally better to use the target/action approach and
55
- to implement your code in a controller of some type.
56
-
57
- @type String
58
- */
59
- action: null,
60
-
61
- /**
62
- The target object to invoke the action on when the button is pressed.
63
-
64
- If you set this target, the action will be called on the target object
65
- directly when the button is clicked. If you leave this property set to
66
- null, then the button will search the responder chain for a view that
67
- implements the action when the button is pressed instead.
68
-
69
- @type Object
70
- */
71
- target: null,
72
-
73
- /**
74
- fakes a click... evt is optional.
75
-
76
- Temporarily highlights the button to show that it is being triggered.
77
- Does nothing if the button is disabled.
78
-
79
- @returns {bool} success/failure of the request
80
- */
81
- triggerAction: function(evt) {
82
- if (!this.get('isEnabled')) return false;
83
- this.set('isActive', YES);
84
- this._action(evt);
85
- this.invokeLater('set', 200, 'isActive', NO);
86
- return true;
87
- },
88
-
89
- // ................................................................
90
- // INTERNAL SUPPORT
91
-
92
- _TEMPORARY_CLASS_HASH: {},
93
-
94
- // display properties that should automatically cause a refresh.
95
- // isCancel and isDefault also cause a refresh but this is implemented as
96
- // a separate observer (see below)
97
- displayProperties: 'href icon title value'.w(),
98
-
99
- render: function(context, firstTime) {
100
- // add href attr if tagName is anchor...
101
- if (this.get('tagName') === 'a') {
102
- var href = this.get('href');
103
- if (!href || (href.length === 0)) href = "javascript"+":;";
104
- context.attr('href', href);
105
- }
106
-
107
- // add some standard attributes & classes.
108
- var classes = this._TEMPORARY_CLASS_HASH, icon = this.get('icon');
109
- classes.def = this.get('isDefault');
110
- classes.cancel = this.get('isCancel');
111
- classes.icon = !!icon;
112
- var theme = this.get('theme');
113
- if(theme) classes[theme] = YES;
114
- context.attr('role', 'button').setClass(classes);
115
-
116
- // don't reset the content if the touch is down because we don't want to
117
- // regenerate the event.
118
- if (!this._isTouchActive) {
119
- context = context.begin('span').addClass('sc-button-inner');
120
- this.renderTitle(context, firstTime) ; // from button mixin
121
- context = context.end();
122
- }
123
- },
124
-
125
- _isTouchActive: NO,
126
-
127
- /** @private
128
- On touch start, set active only if enabled.
129
- */
130
- touchStart: function(evt) {
131
- if (!this.get('isEnabled')) return YES ; // handled event, but do nothing
132
- this.set('isActive', YES);
133
- this._isTouchActive = YES;
134
- return YES ;
135
- },
136
-
137
- /** @private
138
- Remove the active class on touchExited if mouse is down.
139
- */
140
- touchExited: function(evt) {
141
- if (this._isTouchActive) this.set('isActive', NO);
142
- return YES;
143
- },
144
-
145
- /** @private
146
- If mouse was down and we renter the button area, set the active state again.
147
- */
148
- touchEntered: function(evt) {
149
- this.set('isActive', this._isTouchActive);
150
- return YES;
151
- },
152
-
153
- /** @private
154
- ON mouse up, trigger the action only if we are enabled and the mouse was released inside of the view.
155
- */
156
- touchEnd: function(evt) {
157
- // track independently in case isEnabled has changed
158
- if (this._isTouchActive) this.set('isActive', NO);
159
- this._isTouchActive = false;
160
-
161
- // trigger action if final touch was inside of button frame.
162
- // if touch event was cancelled, do not trigger action
163
- var inside, touchPoint, rect, changed;
164
- if (evt.changedTouches.length > 0) {
165
- changed = evt.changedTouches[0];
166
- touchPoint = { x: changed.pageX, y: changed.pageY };
167
- rect = this.convertFrameToView(this.get('frame'), null);
168
- inside = SC.pointInRect(touchPoint, rect);
169
- } else inside = YES ;
170
- if (!evt.cancel && inside && this.get('isEnabled')) this._action(evt) ;
171
- return true ;
172
- },
173
-
174
- /** @private Perform an action based on the behavior of the button.
175
-
176
- - toggle behavior: switch to on/off state
177
- - on behavior: turn on.
178
- - off behavior: turn off.
179
- - otherwise: invoke target/action
180
- */
181
- _action: function(evt) {
182
- console.log('action!');
183
- var action = this.get('action');
184
- var target = this.get('target') || null;
185
- var pane = this.get('pane');
186
- var responder = pane ? pane.get('rootResponder') : null ;
187
- if (responder) responder.sendAction(action, target, this, pane);
188
- }
189
-
190
- }) ;
191
-