sproutcore 1.11.0.rc1 → 1.11.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +8 -8
  2. data/VERSION.yml +1 -1
  3. data/lib/frameworks/sproutcore/CHANGELOG.md +93 -65
  4. data/lib/frameworks/sproutcore/apps/showcase/controllers/source_tree_controller.js +17 -7
  5. data/lib/frameworks/sproutcore/apps/showcase/resources/main_page.js +22 -2
  6. data/lib/frameworks/sproutcore/apps/showcase/resources/stylesheet.css +14 -0
  7. data/lib/frameworks/sproutcore/apps/showcase/resources/views_page.js +2 -2
  8. data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +20 -8
  9. data/lib/frameworks/sproutcore/frameworks/ajax/system/websocket.js +58 -43
  10. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/action_support.js +192 -35
  11. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/delegate_support.js +7 -3
  12. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/responder_context.js +27 -7
  13. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/browser.js +20 -63
  14. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/color.js +16 -7
  15. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +279 -159
  16. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +1 -1
  17. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +21 -10
  18. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/action_support.js +32 -28
  19. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/targetForAction.js +107 -90
  20. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/touch.js +33 -25
  21. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/touch.js +23 -15
  22. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +1 -1
  23. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +12 -6
  24. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +55 -33
  25. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +7 -1
  26. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +228 -72
  27. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/touch.js +54 -100
  28. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +15 -0
  29. data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +57 -45
  30. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +9 -16
  31. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll_view.js +111 -44
  32. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +2 -0
  33. data/lib/frameworks/sproutcore/frameworks/foundation/system/module.js +51 -5
  34. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
  35. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +13 -10
  36. data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +2 -1
  37. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +28 -9
  38. data/lib/frameworks/sproutcore/frameworks/runtime/system/set.js +7 -5
  39. data/lib/frameworks/sproutcore/frameworks/statechart/ext/function.js +51 -46
  40. data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +8 -5
  41. data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +12 -3
  42. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWNkNmQyY2I1Zjk5MDE3ZDA2NDYxMmZhNjdlNDhhYzRhODFmMjdmYw==
4
+ ZDA3N2VhZDM4N2JjNjQyMzFiMzM5MWQ5OTc1MDkyZWJmNjU2OWRkMg==
5
5
  data.tar.gz: !binary |-
6
- MmYzZjBiYjExZDkyNzQ2OTVlNjk4MzljMmI5ZTUxNTkwODhjMzY2ZA==
6
+ Y2EzNWNiN2M0NzI2OTYyM2UzN2M4MDQ0ZTMyNzQ2Mzc2Y2U1OTY4Yg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OWU0OTljNTEyNDc3YWNiNzA0NzNlYWYzNWIyZTZiYTcyZWI0YjU1NmVkOGI0
10
- MGJkNjhlYzgzMGNkMTkxNDM4MDkxNDAyMGQ2YjBkYzcwNDE2NTYzN2I2MmVj
11
- MzY4YjM0YTE2ZTBkZTU4NWYwNDBjMGQ4ZTczMjM1Y2RmMmE2MzE=
9
+ YTRjNzY4ZjRkYjZiYjBiZjU0MjI2NGI4ZmE4ZTYzMzE3MDNiNjJhYzk0OWE0
10
+ NzhhN2MxNWQ5NzAwNzU3OTlhOGM1YjFlZTY0ODg2ZTE0ZTI0MTczMWQyZWVh
11
+ MThmNjc5MjMxYzBmYzVkZTE5OWZmZjNiMzhkNGZjM2UyZjQ4OWM=
12
12
  data.tar.gz: !binary |-
13
- NWI0ZmFlYjYxM2VjMmIxZDI0ZmQwZTU1OTIzZWE5NzdkZjhjMTdlNTM3MzBi
14
- NTA4NmRiMzUyNzVhZDZjODAyYWNlOWI0MjVmODZkOTRlYWMzY2RmYjlhOTJh
15
- ZGUwM2IwZDJhNjE5MTcxZjkzODg0YjM0ODRiODdhZmMwYzA3MmI=
13
+ MDc1MGQzMWM1YzljMDJhNTcyZGFlMjQwNDQxZDI5ZGMzZjg3M2FmN2UyNzZm
14
+ YjZmZGQ4YjA0NjU0OGYxMjZkOGI3ZDZjOGVhZmU5NDFmMjczMzdmOWZmNmNi
15
+ MDAwMzQ0NjJjNDEyMGNhYjc5NDhmNDIxYTBmMDhkYTBlZjMzZDE=
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 11
4
- :patch: 0.rc1
4
+ :patch: 0.rc2
@@ -1,24 +1,53 @@
1
1
  CHANGE LOG
2
2
  ==========
3
3
 
4
- 1.11.0
4
+ 1.11.0.rc2
5
5
  -----------
6
6
 
7
- ### NEW FEATURES
7
+ ### CHANGES & IMPROVEMENTS
8
+
9
+ * SC.ScrollView alignment handling has been improved for container (i.e. the scroll view) or content size changes. This change partially addresses a regression that allowed the content to appear offset incorrectly when it or the scroll view's size changed. But after some investigation, the behavior has also been improved to support the following scenarios:
10
+
11
+ 1. The scroll view is left (or top) aligned, scrolled to the maximum right (or bottom) edge and container or content changes size: the content should stick to the right (or bottom) side
12
+ 2. The scroll view is left (or top) aligned, scrolled to the minimum left (or top) edge and container or content changes size: the content should stick to the left (or top) side
13
+ 3. The scroll view is right (or bottom) aligned, scrolled to the maximum right (or bottom) edge and container or content changes size: the content should stick to the right (or bottom) side
14
+ 4. The scroll view is right (or bottom) aligned, scrolled to the minimum left (or top) edge and container or content changes size: the content should stick to the left (or top) side
15
+ 5. The scroll view is center (or middle) aligned, scrolled to the center (or middle) and container or content changes size: the content should stick to the center (or middle)
16
+
17
+ * Refactored SC.Event slightly. Most importantly, SC.Event instances are now cached per event type in order to avoid constant memory re-allocation. Previously, every DOM event was normalized into a new SC.Event object, which was later freed. In order to reduce the amount of memory churn, one SC.Event instance is cached per type of event and updated with the new DOM event as it comes in.
18
+ * Removed long deprecated method, `SC.browser.compareVersion`. This method was deprecated in version 1.7 and is not used anywhere within the framework. As the deprecation warning noted, developers should use the `SC.browser.compare` method for doing a proper comparison between version strings.
19
+ * The core methods used in SC.View layout have been slightly optimized to avoid memory re-allocation. Since SC.View layout code may run repeatedly in short order (e.g. re-positioning during scrolling), we need to ensure that no new objects are created each time. The reason for this is so that we're not quickly adding hundreds of small objects to the garbage heap that will need to be collected. Since we have no control over when garbage collection occurs, the best we can do is try to avoid it and to ensure that it completes as quickly as possible.
20
+ * The argument for the SC.ActionSupport mixin's main method `fireAction` has been changed from `action` to `context`. This allows calling-time specific information to be passed to the action + target on each call. To specify the `action` for `fireAction` to use, the existing `action` property should still be set. As part of this change, the documentation for SC.ActionSupport has been greatly extended and includes tips on supporting multiple actions or targets and for implementing actions on targets.
21
+
22
+ Along with this change, the `actionContext` property has also now been deprecated and will be removed in a future version of SproutCore.
23
+
24
+ Note: this is a backwards-compatible change. If a String is passed to `fireAction` *and* no `action` property exists, the argument will be used as the `action` (i.e. no context will be sent). When this occurs, a Developer Warning will appear in the console. Likewise, a Developer Warning will appear if `actionContext` is set prior to a view being initialized.
25
+ * SC.ButtonView and SC.CollectionView have both been altered slightly to use SC.ActionSupport. This has no affect on the use of action & target in these views.
26
+ * Moved tracing code of SC.ResponderContext and SC.Module to debug-only. This prevents the debugging code from being included in production builds, thus reducing the overall deployed file size slightly.
27
+ * Optimized use of the `arguments` object in several locations in order to avoid its instantiation. There were several occurrences of code copying the `arguments` object into an Array using `slice`; this is very costly for performance as it causes the browser to instantiate the `arguments` object in order to do the slice. Instead, these occurrences were converted to either access the arguments by index without a copy or to do a fast copy without instantiation. See http://jsperf.com/closure-with-arguments for an example of the performance difference this can make. Using slice is anywhere from ~50% to ~90% slower depending on the browser.
28
+
29
+ Affected: SC.Request, SC.WebSocket, SC.DelegateSupport, SC.Color, SC.Event, SC.Store, SC.Module, SC.Object, SC.Function, SC.State, SC.Statechart
30
+ * Named two anonymous functions: send_event & handle_event in order to aid in debugging and profiling of the core framework.
31
+
32
+ ### BUG FIXES
8
33
 
9
- * Added polymorphic record support to SC.Record. This experimental framework has been in use in a few projects and has recently been vastly improved to fix bugs and improve its performance. Includes unit tests and examples
10
- * Added new properties to SC.Request instances: allowCredentials (default true, which will indicate that credentials be included for cross-domain requests (e.g. xhr.withCredentials = true) and isSameDomain (readonly computed property, true if the protocol, domain and port match exactly).
34
+ * Fixed a very slow memory leak in SC.browser. Caching of the experimental style names for the current browser would fail intermittently since the cache key was being kept on the CSSStyleDeclaration which the browser (seen in Chrome) would occasionally drop. Caching is now done per experimental style name, which is more correct and has the added benefit of being marginally faster than using SC.guidFor.
35
+ * Fixed a deficiency in SC.RootResponder.prototype.sendAction. It failed to pass the given context argument along to the target unless the target was a ResponderContext object (i.e. SC.Pane or SC.Application).
36
+ * Fixed a memory leak in SC.WebSocket due to a set on an undeclared (i.e. global) variable.
37
+ * Fixed an issue with SC.SegmentedView that meant its frame property failed to update when its layout was changed.
38
+
39
+ 1.11.0.rc1
40
+ -----------
41
+
42
+ ### NEW FEATURES
11
43
 
12
- These new properties can be used by an SC.Response subclass to include allowing credentials for cross domain requests.
13
- * Added dragDidSucceed, dragDidCancel, source.dragSlideBackDidEnd callbacks to SC.Drag.
44
+ * Added polymorphic record support to `SC.Record`. This experimental framework has been in use in a few projects and has recently been vastly improved to fix bugs and improve its performance. Includes unit tests and examples
45
+ * Added new properties to `SC.Request` instances: `allowCredentials` (default true, which will indicate that credentials be included for cross-domain requests (e.g. xhr.withCredentials = true) and `isSameDomain` (readonly computed property, true if the protocol, domain and port match exactly).
46
+ These new properties can be used by an `SC.Response` subclass to include allowing credentials for cross domain requests.
47
+ * Added `dragDidSucceed`, `dragDidCancel`, `source.dragSlideBackDidEnd` callbacks to `SC.Drag`.
14
48
  * `SC.View.VERTICAL_STACK` & `SC.View.HORIZONTAL_STACK` have been improved to allow child views in the stack to resize to fill available space. Previously, every child view needed to have a height or width specified with the exception of the last child view which could be resized to fit the remaining space of the parent view. This option was enabled by setting `resizeToFit` to `false` in the `childViewLayoutOptions` hash. In 1.11, we can now set `resizeToFit` to `false` and have all child views without an explicit width or height respectively, resize to fill the available space. By default the available space will be shared evenly by all of these child views, but a more specific per child view weighting can be applied by specifing a `fillRatio` on the child views. For instance, to split the available space between two flexible child views as 1/3 and 2/3, the first view would have a `fillRatio` of 1 and the second view would have a `fillRatio` of 2.
15
- * Updates SC.SceneView to support the new SC.ContainerView hardware-accelerable transitions.
16
- * Adds new SC.WebSocket wrapper class with proper run loop behavior.
17
- * The last item view in a CollectionView now gets an isLast property.
18
- * In the test runner app, adds links to individual test URLs for easier access.
19
- * Adds SC.ListItemView's right icon as a click-action zone to accompany the existing left icon action support.
20
- * Many developer warnings and errors that would previously appear in production have been restricted to dev-mode only.
21
- * Binding helper methods SC.Binding.and & SC.Binding.or are now fully armed and operational, including supporting local properties.
49
+ * Adds new `SC.WebSocket` wrapper class with proper run loop behavior.
50
+ * Adds `SC.ListItemView`'s right icon as a click-action zone to accompany the existing left icon action support.
22
51
  * SC.TextFieldView now supports browser autocompletion via its boolean autoComplete property.
23
52
  * SC.ContainerView transition plugins can now specify reversable transitions.
24
53
  * The developer warnings that are logged when you try to bind to a non-bindable object (or forget a leadoff period on a local property) has been improved and clarified substantially.
@@ -31,75 +60,68 @@ These new properties can be used by an SC.Response subclass to include allowing
31
60
  * SC.Drag#slideBack now works as advertised!
32
61
  * SC.UndoManager has been refactored to allow easier undo action grouping; see documentation for details. SC.UndoManager#registerUndo has been replaced with the cleaner SC.UndoManager#registerUndoAction API, which provides support for the standard target/action pattern.
33
62
  * SC.DateFieldView now supports freeform keyboard number entry.
34
- * iOS-style Overlaid scroller bars now fade out when not in use.
35
- * SC.Color#cssText is now read/write, allowing you to bind it to a user-enterable text field. SC.Color now implements SC.Error and enters an error state when given bad input.
36
63
  * SC.MenuPane now has an escapeHTML property which it proxies to its items.
37
- * SC.Request.manager has two new methods: isPending and isInFlight.
38
- * Adds long-overdue SC.Binding.equalTo.
64
+ * `SC.Request.manager` has two new methods: `isPending` and `isInFlight`.
65
+ * Adds `SC.Binding.equalTo`.
39
66
  * Adds boolean shouldAutoResize property to SC.SegmentedView.
40
- * Added documentation and constants will make SC.PickerPane positioning and customization much easier.
41
- * Now includes "minimal-ui" viewport meta tag for awesomer Mobile Safari apps.
67
+ * Now includes "minimal-ui" viewport meta tag for Mobile Safari apps.
42
68
  * Adds stackNextTouchResponder and stackCandidateTouchResponder methods to SC.Touch to make it easier to pass touch respondership between views.
43
- * SC.ListView can now be horizontal as well as vertical with new layoutDirection property. Renames all rowHeight properties to rowSize.
44
- * Adds new opt-in API (SC.Store#chainAutonomousStore) for nested stores which can interact with the data source. This allows you to commit nested store changes to the server before committing successful updates to the parent store with SC.NestedStore#commitSuccessfulChanges.
45
- * Setting SC.ScrollView#delaysContentTouches will now give your content views full control over touch events in question. As a side effect, native touch handling is now possible inside scroll views.
46
- * SC.ScrollView#scale now works as advertised!
47
- * Scale is now a first-class layout function, correctly impacting frame and clippingFrame. As a result, scaled content within a CollectionView will now correctly calculate which item views should be currently visible.
48
- * Adds official SC.Scalable protocol.
49
- * SC.SliderView has a new markSteps property, which draws a mark element for each step. It also gains an updateOnScroll property, which allows you to prevent it from handling mouseWheel events (in a scroll view for example).
50
- * The improved documentation for SC.Object's stupendously useful didChangeFor method will hopefully encourage its use.
51
- * Use SC.ScrollView's horizontalAlign and verticalAlign properties to align fixed-width or -height content.
52
- * Adds support for calculated properties to String.fmt.
53
- * Adds toolTip to SC.MenuItemView, and the corresponding itemToolTipKey to SC.MenuView.
69
+ * Adds horizontal layout for `SC.ListView` using `layoutDirection` property.
70
+ * Adds new opt-in API (`SC.Store.prototype.chainAutonomousStore`) for nested stores which can interact with the data source. This allows you to commit nested store changes to the server before committing successful updates to the parent store with `SC.NestedStore.prototype.commitSuccessfulChanges`.
71
+ * Setting `SC.ScrollView.prototype.delaysContentTouches` will now give your content views full control over touch events in question. As a side effect, native touch handling is now possible inside scroll views.
72
+ * `SC.SliderView` has a new `markSteps` property, which draws a mark element for each step. It also gains an `updateOnScroll` property, which allows you to prevent it from handling `mouseWheel` events (in a scroll view for example).
73
+ * Adds support for calculated properties to `String.fmt`.
74
+ * Adds `toolTip` property to `SC.MenuItemView`, and the corresponding `itemToolTipKey` to `SC.MenuView`.
54
75
 
55
76
  ### CHANGES & IMPROVEMENTS
56
77
 
78
+ * Scale is now a first-class layout function, correctly impacting frame and clippingFrame. As a result, scaled content within a CollectionView will now correctly calculate which item views should be currently visible.
57
79
  * SC.ScrollView complete refactor:
58
-
59
- ** Ensures that scaling the view maintains the visual center.
60
- ** Improves touch support significantly. Including centered zooming for pinch gestures, smoother bounce-back overdrag past the boundaries.
61
- ** Improves gesture animation performance and feel with requestAnimationFrame.
62
- ** Supports flexible sized GPU accelerated content. When the content of the view has an undefined width or height, SC.ScrollView will fix the size of the content to fit the container so that it may be positioned using translateX & translateY.
63
- ** Uses shared objects for adjusting the content & container views of SC.ScrollView. This prevents repeated memory allocs while scrolling, which must eventually be garbage collected (a painful occurrence in JavaScript).
64
-
80
+ * If `horizontalOverlay` or `verticalOverlay` is true, it will use `SC.OverlayScrollerView` by default. It's no longer necessary to also set `horizontalScrollerView: SC.OverlayScrollerView` in order to get overlaid scrollers.
81
+ * Use SC.ScrollView's horizontalAlign and verticalAlign properties to align fixed-width or -height content.
82
+ * SC.ScrollView#scale now works as advertised!
83
+ * iOS-style Overlaid scroller bars now fade out when not in use.
84
+ * Ensures that scaling the view maintains the visual center.
85
+ * Improves touch support significantly. Including centered zooming for pinch gestures, smoother bounce-back overdrag past the boundaries.
86
+ * Improves gesture animation performance and feel with requestAnimationFrame.
87
+ * Supports flexible sized GPU accelerated content. When the content of the view has an undefined width or height in its layout and has `wantsAcceleratedLayer` set to `true`, `SC.ScrollView` will fix the undefined size (width or height) of the content to *fit* the container so that the content may be scrolled using `translateX` & `translateY`.
88
+ * Uses shared objects for adjusting the content & container views of SC.ScrollView. This prevents repeated memory allocs while scrolling, which must eventually be garbage collected (a painful occurrence in JavaScript).
65
89
  * Improves SC.Touch documentation.
90
+ * The improved documentation for SC.Object's didChangeFor method will hopefully encourage its use.
91
+ * The last item view in a CollectionView now gets an isLast property.
66
92
  * Removes an extra Object instantiation in `SC.View.prototype.computeParentDimensions` (if frame wasn't given, an empty Object was instantiated for no real use). Also removes pre-obfuscation of variables.
67
93
  * Speeds up and slims down the `SC.View.prototype.adjust` method. When a single key is passed to `adjust()` it no longer creates an Object just to iterate the single key. Likewise, the resulting call to `_checkForResize()` on layout changes is improved by removing the creation of two Objects used for testing and by removing the over achieving test (the test covered the case of concurrent effective border and size changes, which are very rare and not critical to fail the test).
68
94
  * Cleaned up the SC.Pane unit tests (were leaving panes attached, missing run loops, etc.) and fixed the situation where calling destroy on a building out view would fail to remove the view's layer immediately.
69
95
  * Improves the SC.View cancel animation method to work with centerX/centerY animations. Disabled the rotation decompositions on X & Y axes, since they don't work in all cases.
70
96
  * Changed SC.GridView to provide its own height rather than minHeight. Note: We use height, because this allows the list view to be positioned with translateX, translateY.
71
97
  * Refactored SC.MenuScrollView.
72
-
73
- ** Reduced code by removing duplicate properties from its superclass SC.ScrollView.
74
- ** Renamed verticalScrollerView & verticalScrollerView2 to topScrollerView & bottomScrollerView respectively to make it clearer which they are and to avoid confusion with the verticalScrollerView property of SC.ScrollView.
75
- ** Removed four (!) extra observers (one which was totally useless on the non-existant horizontal scroller visibility).
76
- ** Tidied up the createChildViews code to be more readable and not make excess calls to reposition the scrollers.
77
- ** Improved the appearance/disappearance of the scrollers. It now shifts the content view at the same time that the container view adjusts to show/hide scrollers so that the content view never appears to jump, which also ensures that there is no extra space at the bottom of the container view.
78
-
98
+ * Reduced code by removing duplicate properties from its superclass SC.ScrollView.
99
+ * Renamed verticalScrollerView & verticalScrollerView2 to topScrollerView & bottomScrollerView respectively to make it clearer which they are and to avoid confusion with the verticalScrollerView property of SC.ScrollView.
100
+ * Removed four (!) extra observers (one which was totally useless on the non-existant horizontal scroller visibility).
101
+ * Tidied up the createChildViews code to be more readable and not make excess calls to reposition the scrollers.
102
+ * Improved the appearance/disappearance of the scrollers. It now shifts the content view at the same time that the container view adjusts to show/hide scrollers so that the content view never appears to jump, which also ensures that there is no extra space at the bottom of the container view.
79
103
  * Pulled SC.MenuScrollerView into its own file and refactors it slightly.
80
-
81
- ** Reduced the amount of code by removing duplicate properties from its superclass SC.ScrollerView.
82
- ** Removed unused code (ownerScrollValueKey computed property & _sc_scroller_valueDidChange observer(!)).
83
- ** Improved the readability of the _scrollMenu method.
84
-
104
+ * Reduced the amount of code by removing duplicate properties from its superclass SC.ScrollerView.
105
+ * Removed unused code (ownerScrollValueKey computed property & _sc_scroller_valueDidChange observer(!)).
106
+ * Improved the readability of the _scrollMenu method.
85
107
  * Refactored SC.MenuPane slightly:
86
-
87
- ** Fixed a problem where the items array was not observed for content changes when it was set on create (includes unit test).
88
- ** Removed an unnecessary layout change in createChildViews, which also meant that creating a menu pane as a singleton (i.e. with no run loop) would throw warnings.
89
- ** Slightly simplified the code by removing duplicated properties from the superclass SC.PickerPane and reusing the items observer code for initialization.
108
+ * Fixed a problem where the items array was not observed for content changes when it was set on create (includes unit test).
109
+ * Removed an unnecessary layout change in createChildViews, which also meant that creating a menu pane as a singleton (i.e. with no run loop) would throw warnings.
110
+ * Slightly simplified the code by removing duplicated properties from the superclass SC.PickerPane and reusing the items observer code for initialization.
90
111
  * Changed the default maximum of SC.ScrollerView to be 0. It was 100 previously, which is arbitrary and incorrect.
91
112
  * Removed an extra call to SC.RootResponder's computeWindowSize() each time that a pane is appended. This is unnecessary, since the root responder recomputes its window size property whenever the window actually resizes.
92
113
  * Changed SC.MenuItemView's handling of submenus. Previously if the item's submenu was visible and the mouse exited back onto the menu item view, it tried to re-append the same submenu. Instead, it now checks to see if its submenu is already attached before attempting to enter it again.
93
114
  * Allows for optimization of SC.RenderContext's setStyle method (Removes V8 "ForIn is not fast case" warning, see http://commondatastorage.googleapis.com/io-2013/presentations/223.pdf).
94
- * Improved performance of core SC methods: SC.mixin, SC.supplement as well as SC.Function.enhance. SC.mixin and SC.supplement iterated the arguments object to insert a boolean flag to pass to a private function that then iterated its arguments in order to ignore the flag argument, which is totally unnecessary. Instead, SC.mixin and SC.supplement iterate the arguments once and pass the new Array to the private function as a second argument, removing the need for a second iteration.
95
-
96
- As well, these three areas all accessed the arguments object to copy it, which requires the browser to instantiate it, which is costly. Instead, we now do a fast copy (similar to this: http://jsperf.com/closure-with-arguments) without instantiating the arguments object.
97
-
98
- Finally, by doing a fast copy of arguments these functions are now optimizable by V8, whereas they weren't previously.
99
-
100
- Benchmark: SC.mixin & SC.supplement ~ 58% faster
101
- * Calls adjustLayout on initialization of SC.CollectionView.
102
-
115
+ * Many developer warnings and errors that would previously appear in production have been restricted to dev-mode only.
116
+ * Improved performance of core SC methods: SC.mixin, SC.supplement as well as SC.Function.enhance. SC.mixin and SC.supplement iterated the arguments object to insert a boolean flag to pass to a private function that then iterated its arguments in order to ignore the flag argument, which is totally unnecessary. Instead, SC.mixin and SC.supplement iterate the arguments once and pass the new Array to the private function as a second argument, removing the need for a second iteration.
117
+
118
+ As well, these three areas all accessed the arguments object to copy it, which requires the browser to instantiate it, which is costly. Instead, we now do a fast copy (similar to this: http://jsperf.com/closure-with-arguments) without instantiating the arguments object.
119
+
120
+ Finally, by doing a fast copy of arguments these functions are now optimizable by V8, whereas they weren't previously.
121
+
122
+ Benchmark: `SC.mixin` & `SC.supplement` ~ 58% faster
123
+ * Calls adjustLayout on initialization of SC.CollectionView.
124
+
103
125
  Certain containing views, transitions and specialized layout engines need to know what type of layout their child views will have in order to make the proper adjustments. SC.CollectionView subclasses typically set a width or a height themselves, but when this happens late, the actual layout style of the collection is misunderstood at initialization to be something different.
104
126
  * Improved the management of the content view for SC.ContainerView.
105
127
  * Improved the default styling of overlay scroller views. Making them look more like natural overlay scrollers in OS X/iOS and making them visible on dark backgrounds.
@@ -109,15 +131,19 @@ Certain containing views, transitions and specialized layout engines need to kno
109
131
 
110
132
  SC.State had two `observes` helper functions used to be notified when its `enteredSubstates` and `currentSubstates` arrays change. Since these arrays are modified by the owner statechart, the observers needed to be chained enumerable observers. However, this resulted in slower object initialization for each state object and excess observer firing as the entered and current substates change. Instead, we simply notify the target state directly each time that the statechart makes a change to its `enteredSubstates` and `currentSubstates`.
111
133
  * Improved SC.ScrollView performance a tiny bit by removing the unnecessary chained binding back from the scrollers to their owner. Scrollers are created automatically by the SC.ScrollView and are not moved between different owners.
134
+ * Added documentation and constants will make SC.PickerPane positioning and customization much easier.
112
135
  * Significantly improved performance of SC.PickerPanes attached to element's within an SC.ScrollView.
113
136
 
114
137
  There were a couple of issues hampering performance for SC.PickerPanes within SC.ScrollViews. The first was that the scroll view observers were too greedy observing (the unfortunately noisy) horizontalScrollOffset and verticalScrollOffset of the scroll view for changes and repositioning on each change. What this meant was that an SC.PickerPane could reposition itself up to 6 times in a single run loop as the content of the scroll view changed even thought the scroll offsets may not have changed at all. Instead, the proper pattern for observing multiple properties (or noisy properties) is to filter the input through an invokeX (i.e. so even though 6 calls to the observer function occur, we only call positionPane once, via invokeOnce). Additionally, we no longer observe the offsets if the scroll view can't even scroll (in either direction). And finally, to ensure that the anchor element is in its new position before we re-position, we actually use invokeNext as our input filter.
115
138
  * Fixed several inconsistencies in property referencing within SC.PickerPane. There were multiple places where '.' notation was used instead of get/set. Also tidies up some unclear code.
116
139
  * Removed the enabling of run loop logging when SC.LOG_BINDINGS is set. The run loop logs are very noisy and make it harder to follow the binding changes. Also forced some of the logging code into debug builds only.
117
140
  * Cancels active transitions of SC.ContainerView when transitionSwap is altered mid-transition. This includes a developer warning.
141
+ * Renamed all `rowHeight` properties to `rowSize` for `SC.CollectionRowDelegate`.
118
142
  * Added retina version images for SC.SliderView in Ace.
119
143
  * Removed several lines of debugging code from production builds of SC.Observable using @if(debug).
120
144
  * Updates to jQuery 1.11.1. Notably, there was a serious memory leak in jQuery 1.8 where the tokenCache grew continuously (because keys in the cache have a " " appended to them and the code tried to delete keys without taking the " " into account).
145
+ * Updates SC.SceneView to support the new SC.ContainerView hardware-accelerable transitions.
146
+ * SC.Color#cssText is now read/write, allowing you to bind it to a user-enterable text field. SC.Color now implements SC.Error and enters an error state when given bad input.
121
147
  * Fixed memory leaks in SC.ListView and SC.CollectionView. Since these views add observers to their related objects, they need to also properly remove those observers again when the views themselves are destroyed. Otherwise, when collection views are removed, the observers on the related objects become stranded.
122
148
  * SC.Query's internal token tree is now a proper SC.Error when in an error state.
123
149
  * Removed all uses of `enhance` within the SC.View `reopen`s in core_foundation. The `_enhance` function is inordinately slow in Firefox (version 31 on OS X). Benchmarks of creating 100 views in a loop takes ~1800ms with the enhance's and only ~38ms without any in Firefox on OS X. In Chrome and Safari on OS X, the difference is negligible.
@@ -147,13 +173,13 @@ cross-platform compatible.
147
173
  * Fixes up some bad overrides of interpretKeyEvents. Make sure to use, rather than override, this method in your own code.
148
174
  * SC.TextFieldView now supports selection direction when the browser allows.
149
175
  * Many webkit-specific properties under the hood – for example, transform CSS – have been replaced with correctly browser-detected versions.
150
- * VERTICAL_STACK and HORIZONTAL_STACK child layout plugins now support the use of minHeight and minWidth.
176
+ * `SC.View.VERTICAL_STACK` and `SC.View.HORIZONTAL_STACK` child layout plugins now support the use of `minHeight` and `minWidth`.
151
177
  * CoreTest, our QUnit like testing suite, now includes a "warn" method to explicitly create a warning.
152
178
  * SC.MenuPane will ignore the first item if it is a separator.
153
179
  * A number of improvements and backwards-compatibility fixes have been made to the SC.SelectView replacement class found in the experimental frameworks.
154
180
  * You can now customize your SC.AlertPane's buttons' isDefault, isCancel, tooltips, layerId and localize properties.
155
- * Adds developer warning when calling SC.PickerPane#append. You should use SC.PickerPane#popup instead.
156
- * Adds a layout orientation class to SC.SplitDividerView.
181
+ * Adds developer warning when calling `SC.PickerPane.prototype.append`. A developer should always use `SC.PickerPane.prototype.popup` to display a picker pane.
182
+ * Adds a layout orientation class to `SC.SplitDividerView`.
157
183
  * Adds SC.String#escapeCssIdForSelector method to handle '.' and ':' characters, which are valid in CSS IDs but which must be escaped for use in jQuery selectors.
158
184
  * In development mode, SC.ChildArray (nested toMany attribute) now has a helpfully verbose toString method.
159
185
  * runtime framework no longer requires jQuery. jQuery requirement moved to core_foundation.
@@ -173,6 +199,8 @@ cross-platform compatible.
173
199
  * Adds a Developer Error when setting up a nested record attribute with an inverse property (via toOne or toMany).
174
200
  * SC.TextFieldView's maxLength property can now be updated live.
175
201
  * SC.ContainerView can now take local property paths (e.g. '.localPage.view') as nowShowing.
202
+ * Binding helper methods `SC.Binding.and` and `SC.Binding.or` are now fully operational, including supporting local properties.
203
+ * In the test runner app, adds links to individual test URLs for easier access.
176
204
 
177
205
  ### DEPRECATIONS & REMOVALS
178
206
 
@@ -28,24 +28,34 @@ Showcase.sources = SC.Object.create(SC.CollectionContent, SC.TreeItemContent, {
28
28
  name: "Automatic Image Scaling",
29
29
  view: 'Showcase.mainPage.demoView'
30
30
  }),
31
+ SC.Object.create({
32
+ appPath: 'http://demos.sproutcore.com/big_data_demo',
33
+ name: "Big Data Lists",
34
+ view: 'Showcase.mainPage.demoView'
35
+ }),
31
36
  SC.Object.create({
32
37
  appPath: 'http://demos.sproutcore.com/child_view_layout_demo',
33
- name: "Child View Layouts",
38
+ name: "Child View Layout Plugins",
34
39
  view: 'Showcase.mainPage.demoView'
35
40
  }),
36
41
  SC.Object.create({
37
- appPath: 'http://demos.sproutcore.com/big_data_demo',
38
- name: "Displaying Big Data",
42
+ appPath: 'http://demos.sproutcore.com/data_drag_demo',
43
+ name: "Dragging Things In",
39
44
  view: 'Showcase.mainPage.demoView'
40
45
  }),
41
46
  SC.Object.create({
42
47
  appPath: 'http://demos.sproutcore.com/flot_demo',
43
- name: "Flot (or other) Integration",
48
+ name: "Flot (or other 3rd Party) Integration",
49
+ view: 'Showcase.mainPage.demoView'
50
+ }),
51
+ SC.Object.create({
52
+ appPath: 'http://demos.sproutcore.com/design_mode_demo',
53
+ name: "Responsive Design",
44
54
  view: 'Showcase.mainPage.demoView'
45
55
  }),
46
56
  SC.Object.create({
47
57
  appPath: 'http://demos.sproutcore.com/lively_view_demo',
48
- name: "Transition Plugins",
58
+ name: "Transition Animation Plugins",
49
59
  view: 'Showcase.mainPage.demoView'
50
60
  }),
51
61
  SC.Object.create({
@@ -207,7 +217,7 @@ Showcase.sourceTreeController = SC.TreeController.create({
207
217
  allowsEmptySelection: YES,
208
218
 
209
219
  /** Update the URL to match the selection. */
210
- selectionDidChange: function() {
220
+ selectionDidChange: function () {
211
221
  var content = this.get('content'),
212
222
  selection = this.get('selection');
213
223
 
@@ -216,7 +226,7 @@ Showcase.sourceTreeController = SC.TreeController.create({
216
226
  section;
217
227
 
218
228
  // Determine which group the selection belongs to.
219
- content.get('treeItemChildren').forEach(function(group) {
229
+ content.get('treeItemChildren').forEach(function (group) {
220
230
  if (group.get('treeItemChildren').indexOf(object) >= 0) {
221
231
  section = group;
222
232
  }
@@ -18,7 +18,7 @@ Showcase.mainPage = SC.Page.design({
18
18
  header: SC.View.design({
19
19
  layout: { borderBottom: 1, height: 50, zIndex: 999 },
20
20
  tagName: 'header',
21
- render: function(context, firstTime) {
21
+ render: function (context, firstTime) {
22
22
  context.setAttr('role', 'banner');
23
23
  context.push('<div class="container"><h1 id="logo"><a href="http://www.sproutcore.com"><img src="' + sc_static('images/logo.png') + '" alt="SproutCore"></a></h1><nav role="navigation"><ul><li><a href="http://www.sproutcore.com/about/">About</a></li><li class="active"><a href="/">Showcase</a></li><li><a href="http://guides.sproutcore.com">Guides</a></li><li><a href="http://docs.sproutcore.com">Docs</a></li><li><a href="http://www.sproutcore.com/community/">Community</a></li><li><a href="http://blog.sproutcore.com">Blog</a></li></ul></nav></div>');
24
24
  }
@@ -59,7 +59,27 @@ Showcase.mainPage = SC.Page.design({
59
59
  }),
60
60
 
61
61
  demoView: SC.WebView.design({
62
- valueBinding: SC.Binding.oneWay('Showcase.sourceController.appPath')
62
+ classNames: ['demo-view'],
63
+ valueBinding: SC.Binding.oneWay('Showcase.sourceController.appPath'),
64
+ childViews: ['loading'],
65
+
66
+ iframeDidLoad: function () {
67
+ sc_super();
68
+
69
+ this.set('isLoading', false);
70
+ },
71
+
72
+ valueDidChange: function () {
73
+ this.set('isLoading', true);
74
+ }.observes('value'),
75
+
76
+ loading: SC.LabelView.extend({
77
+ classNames: ['loading-label'],
78
+ layout: { centerX: 0, centerY: 0, height: 150, width: 250 },
79
+ escapeHTML: false,
80
+ isVisibleBinding: SC.Binding.oneWay('.parentView.isLoading'),
81
+ value: "Loading Demo Application&hellip;"
82
+ })
63
83
  })
64
84
 
65
85
  });
@@ -71,6 +71,20 @@ $theme.views-item-view {
71
71
  }
72
72
  }
73
73
 
74
+ $theme.demo-view {
75
+ @include background-image(sc_static('cross.png'), sc_static('pixels.png'), linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255,0.5)));
76
+ background-color: #3a9bee;
77
+
78
+ .sc-label-view {
79
+ &.loading-label {
80
+ color: white;
81
+ text-shadow: rgba(0,0,0,0.5) 0 1px 2px;
82
+ line-height: 45px;
83
+ font-size: 38px;
84
+ text-align: center;
85
+ }
86
+ }
87
+ }
74
88
 
75
89
  $theme.welcome-view {
76
90
  @include slice('images/pixels.png', $repeat: repeat);
@@ -145,12 +145,12 @@ Showcase.viewsPage = SC.Page.create({
145
145
  content: [
146
146
  Showcase.ViewsItemContent.create({
147
147
  title: 'Regular',
148
- example: "SC.GridView.extend({ columnWidth: 120, rowHeight: 58, contentBinding: SC.Binding.oneWay('Showcase.collectionItems'), layout: { left: 20, right: 20, top: 20, bottom: 20 }, exampleView: SC.View.extend(SC.Control, { classNames: ['grid-example-view'], childViews: ['image', 'title'], image: SC.ImageView.extend({ layout: { centerX: 0, centerY: 0, height: 24, width: 24 }, valueBinding: SC.Binding.oneWay('.parentView.content.icon') }), title: SC.LabelView.extend({ layout: { centerX: 0, bottom: 0, height: 18, width: 120 }, valueBinding: SC.Binding.oneWay('.parentView.content.title') }) }) })"
148
+ example: "SC.GridView.extend({ columnWidth: 120, rowHeight: 58, contentBinding: SC.Binding.oneWay('Showcase.collectionItems'), layout: { left: 20, right: 20, top: 20, bottom: 20 }, exampleView: SC.View.extend(SC.Control, { classNames: ['grid-example-view'], childViews: ['image', 'title'], image: SC.ImageView.extend({ layout: { centerX: 0, centerY: 0, height: 24, width: 24 }, valueBinding: SC.Binding.oneWay('.parentView*content.icon') }), title: SC.LabelView.extend({ layout: { centerX: 0, bottom: 0, height: 18, width: 120 }, valueBinding: SC.Binding.oneWay('.parentView*content.title') }) }) })"
149
149
  }),
150
150
 
151
151
  Showcase.ViewsItemContent.create({
152
152
  title: 'Scrollable with Minimum Width',
153
- example: "SC.ScrollView.extend({ layout: { left: 20, right: 20, top: 20, bottom: 20 }, contentView: SC.GridView.extend({ columnWidth: 200, rowHeight: 200, layout: { minWidth: 600 }, contentBinding: SC.Binding.oneWay('Showcase.collectionItems'), exampleView: SC.View.extend(SC.Control, { classNames: ['grid-example-view'], childViews: ['image', 'title'], image: SC.ImageView.extend({ layout: { centerX: 0, centerY: 0, height: 24, width: 24 }, valueBinding: SC.Binding.oneWay('.parentView.content.icon') }), title: SC.LabelView.extend({ layout: { centerX: 0, bottom: 0, height: 18, width: 120 }, valueBinding: SC.Binding.oneWay('.parentView.content.title') }) }) }) })"
153
+ example: "SC.ScrollView.extend({ layout: { left: 20, right: 20, top: 20, bottom: 20 }, contentView: SC.GridView.extend({ columnWidth: 200, rowHeight: 200, layout: { minWidth: 600 }, contentBinding: SC.Binding.oneWay('Showcase.collectionItems'), exampleView: SC.View.extend(SC.Control, { classNames: ['grid-example-view'], childViews: ['image', 'title'], image: SC.ImageView.extend({ layout: { centerX: 0, centerY: 0, height: 24, width: 24 }, valueBinding: SC.Binding.oneWay('.parentView*content.icon') }), title: SC.LabelView.extend({ layout: { centerX: 0, bottom: 0, height: 18, width: 120 }, valueBinding: SC.Binding.oneWay('.parentView*content.title') }) }) }) })"
154
154
  })
155
155
  ],
156
156
  exampleHeight: 360
@@ -115,7 +115,7 @@ SC.Request = SC.Object.extend(SC.Copyable, SC.Freezable,
115
115
 
116
116
  // This pattern matching strategy was taken from jQuery.
117
117
  parts = urlRegex.exec( address.toLowerCase() );
118
- originParts = urlRegex.exec( window.location.href.toLowerCase() );
118
+ originParts = urlRegex.exec( location.href.toLowerCase() );
119
119
 
120
120
  return SC.none(parts) ||
121
121
  (parts[1] === originParts[1] && // protocol
@@ -174,7 +174,7 @@ SC.Request = SC.Object.extend(SC.Copyable, SC.Freezable,
174
174
  timeout: null,
175
175
 
176
176
  /**
177
- The body of the request. May be an object is isJSON or isXML is set,
177
+ The body of the request. May be an object if isJSON or isXML is set,
178
178
  otherwise should be a string.
179
179
 
180
180
  @type Object|String
@@ -270,7 +270,7 @@ SC.Request = SC.Object.extend(SC.Copyable, SC.Freezable,
270
270
  var ret = {},
271
271
  keys = this.COPY_KEYS,
272
272
  loc = keys.length,
273
- key, listeners, headers;
273
+ key;
274
274
 
275
275
  while(--loc >= 0) {
276
276
  key = keys[loc];
@@ -524,7 +524,8 @@ SC.Request = SC.Object.extend(SC.Copyable, SC.Freezable,
524
524
  @returns {SC.Request} The SC.Request object.
525
525
  */
526
526
  notify: function(statusOrEvent, target, action) {
527
- var args;
527
+ var args,
528
+ i, len;
528
529
 
529
530
  //@if (debug)
530
531
  if (statusOrEvent === 'loadend' && SC.Request.WARN_ON_LOADEND) {
@@ -535,7 +536,11 @@ SC.Request = SC.Object.extend(SC.Copyable, SC.Freezable,
535
536
  // Normalize arguments
536
537
  if (SC.typeOf(statusOrEvent) !== SC.T_NUMBER && SC.typeOf(statusOrEvent) !== SC.T_STRING) {
537
538
  // Accept multiple additional arguments (Do so before shifting the arguments!)
538
- args = SC.A(arguments).slice(2);
539
+
540
+ // Fast arguments access.
541
+ // Accessing `arguments.length` is just a Number and doesn't materialize the `arguments` object, which is costly.
542
+ args = new Array(arguments.length - 2); // SC.A(arguments).slice(2)
543
+ for (i = 0, len = args.length; i < len; i++) { args[i] = arguments[i + 2]; }
539
544
 
540
545
  // Shift the arguments
541
546
  action = target;
@@ -543,7 +548,15 @@ SC.Request = SC.Object.extend(SC.Copyable, SC.Freezable,
543
548
  statusOrEvent = 0;
544
549
  } else {
545
550
  // Accept multiple additional arguments.
546
- args = SC.A(arguments).slice(3);
551
+
552
+ if (arguments.length > 3) {
553
+ // Fast arguments access.
554
+ // Accessing `arguments.length` is just a Number and doesn't materialize the `arguments` object, which is costly.
555
+ args = new Array(arguments.length - 3); // SC.A(arguments).slice(3)
556
+ for (i = 0, len = args.length; i < len; i++) { args[i] = arguments[i + 3]; }
557
+ } else {
558
+ args = [];
559
+ }
547
560
  }
548
561
 
549
562
  // Prepare listeners for this object and notification target.
@@ -699,8 +712,7 @@ SC.Request.manager = SC.Object.create(
699
712
  */
700
713
  cancel: function(response) {
701
714
  var pending = this.get('pending'),
702
- inflight = this.get('inflight'),
703
- idx;
715
+ inflight = this.get('inflight');
704
716
 
705
717
  if (pending.indexOf(response) >= 0) {
706
718
  this.propertyWillChange('pending');