sproutcore 1.5.0.rc.1 → 1.5.0.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/VERSION.yml +1 -1
- data/lib/frameworks/sproutcore/Buildfile +9 -4
- data/lib/frameworks/sproutcore/README.md +1 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/QuickLook/Preview.pdf +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/QuickLook/Thumbnail.tiff +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/data.plist +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image10.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image11.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image13.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image15.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image16.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image17.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image18.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image19.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image22.tiff +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image23.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image24.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image25.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image30.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image31.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image8.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image9.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/animation/core.js +23 -25
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +160 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +73 -82
- data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/bind.js +110 -7
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/collection.js +10 -7
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/localization.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/view.js +4 -2
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions.js → core_foundation/ext/handlebars.js} +0 -57
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/object.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +11 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/main.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/application.js +14 -16
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/builder.js +29 -37
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/datetime.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +71 -19
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +3 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/page.js +5 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +4 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/timer.js +21 -27
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +3 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/single_enumerable_case.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +93 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertLayouts.js +13 -11
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layer.js +2 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/theme.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template.js +6 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +87 -32
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +21 -25
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +15 -19
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +114 -167
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +4 -6
- data/lib/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +18 -20
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +74 -72
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +36 -29
- data/lib/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +97 -78
- data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +117 -97
- data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +13 -13
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +111 -108
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +231 -198
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +146 -145
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +21 -21
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +49 -50
- data/lib/frameworks/sproutcore/frameworks/datetime/{system → frameworks/core/system}/datetime.js +122 -171
- data/lib/frameworks/sproutcore/frameworks/datetime/{tests → frameworks/core/tests}/system/datetime.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/{resources → frameworks/localized/resources}/strings.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +91 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/core.js +18 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +23 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +56 -45
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +5 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +21 -19
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +82 -77
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/navigation_builder.js +18 -12
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +29 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +148 -107
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +31 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/modal.js +16 -13
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/palette.js +38 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +37 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +247 -144
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +155 -100
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +39 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +9 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +18 -22
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +27 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +77 -44
- data/lib/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +68 -33
- data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +168 -110
- data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +37 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +187 -123
- data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +73 -49
- data/lib/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +34 -9
- data/lib/frameworks/sproutcore/frameworks/desktop/views/file.js +51 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/views/grid.js +38 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js +15 -9
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +54 -34
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +113 -42
- data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +84 -28
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +67 -51
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +122 -35
- data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation.js +40 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation_bar.js +28 -18
- data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +27 -31
- data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +118 -68
- data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +117 -61
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scene.js +23 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +241 -77
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +134 -69
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segment.js +107 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +125 -48
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +165 -69
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +73 -24
- data/lib/frameworks/sproutcore/frameworks/desktop/views/separator.js +19 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list.js +16 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +14 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +43 -37
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +8 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/stacked.js +14 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +16 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +99 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js +13 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +58 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +34 -18
- data/lib/frameworks/sproutcore/frameworks/desktop/views/well.js +25 -9
- data/lib/frameworks/sproutcore/frameworks/desktop/views/workspace.js +70 -36
- data/lib/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +10 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +28 -17
- data/lib/frameworks/sproutcore/frameworks/foundation/delegates/inline_text_field.js +41 -43
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/pinch.js +42 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/swipe.js +94 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/tap.js +41 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +18 -9
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +7 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +7 -8
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +34 -24
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/control.js +48 -18
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/misc.js +1 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/tasks/preload_bundle.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +0 -11
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/date_time.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +8 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/README.md +24 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/package.json +21 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.css +215 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.js +1442 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/headless.html +24 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/index.html +18 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.html +17 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.js +150 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/same.js +1421 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/test.js +314 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +369 -60
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +2 -405
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +3 -9
- data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +50 -45
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +20 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +0 -9
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +36 -14
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable.js +0 -34
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable_observers.js +50 -61
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +45 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +5 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/enhance.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/testing/core.js +3 -0
- data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +0 -1
- data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +0 -1
- data/lib/gen/html_app/templates/apps/@target_name@/@target_name@.js +1 -1
- data/vendor/chance/lib/chance/instance.rb +8 -6
- metadata +41 -31
- data/lib/frameworks/sproutcore/frameworks/testing/jquery.js +0 -3559
- data/lib/frameworks/sproutcore/frameworks/testing/qunit.js +0 -827
data/CHANGELOG
CHANGED
data/VERSION.yml
CHANGED
@@ -27,12 +27,14 @@ end
|
|
27
27
|
# CORE FRAMEWORKS
|
28
28
|
config :bootstrap, :required => [], :use_modules => false
|
29
29
|
|
30
|
-
config :jquery, :required => []
|
30
|
+
config :jquery, :required => [], :test_required => [], :debug_required => []
|
31
31
|
config :handlebars, :required => []
|
32
32
|
config :runtime, :required => [:jquery]
|
33
|
-
config :datetime,
|
33
|
+
config :'datetime/core', :required => [:runtime]
|
34
|
+
config :datetime, :required => [:'datetime/core']
|
34
35
|
config :core_foundation, :required => [:runtime, :handlebars]
|
35
|
-
config :
|
36
|
+
config :'datetime/localized', :required => [:core_foundation]
|
37
|
+
config :foundation, :required => [:core_foundation, :datetime, :'datetime/localized']
|
36
38
|
config :datastore, :required => [:runtime, :datetime]
|
37
39
|
config :desktop, :required => [:foundation]
|
38
40
|
config :media, :required => [:desktop]
|
@@ -54,9 +56,12 @@ config :mini, :required => [:runtime, :datastore]
|
|
54
56
|
config :animation, :required => :foundation
|
55
57
|
config :forms, :required => :desktop
|
56
58
|
|
59
|
+
config :qunit, :required => []
|
60
|
+
config :testing, :required => [:jquery], :test_required => [], :debug_required => []
|
61
|
+
|
57
62
|
# SPECIAL FRAMEWORKS AND THEMES
|
58
63
|
# These do not require any of the built-in SproutCore frameworks
|
59
|
-
%w(
|
64
|
+
%w(debug legacy_theme empty_theme).each do |target_name|
|
60
65
|
config target_name,
|
61
66
|
:required => [], :test_required => [], :debug_required => []
|
62
67
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -8,31 +8,29 @@
|
|
8
8
|
/*globals */
|
9
9
|
|
10
10
|
/** @namespace
|
11
|
-
A simple mixin called Animatable is provided. What does it do?
|
12
|
-
It makes CSS transitions for you, and if they aren't available,
|
13
|
-
implements them in JavaScript.
|
14
|
-
|
15
|
-
Animatable things:
|
16
|
-
|
17
|
-
-
|
18
|
-
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
aView: SC.LabelView.design(SC.Animatable, {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
})
|
34
|
-
}}}
|
35
|
-
@extends SC.Object
|
11
|
+
A simple mixin called Animatable is provided. What does it do?
|
12
|
+
It makes CSS transitions for you, and if they aren't available,
|
13
|
+
implements them in JavaScript.
|
14
|
+
|
15
|
+
## Animatable things:
|
16
|
+
|
17
|
+
- layout. You can animate any layout property, even centerX and centerY
|
18
|
+
- opacity.
|
19
|
+
- display, in a way. All animating display does is delay setting display:none
|
20
|
+
until <em>after</em> the transition duration has passed. This allows you
|
21
|
+
to set display:none after fading out. If mixing with CSS transitions, you will
|
22
|
+
need to set the delay a tad longer to accomodate any delays in beginning the
|
23
|
+
transition.
|
24
|
+
|
25
|
+
## Example Usage:
|
26
|
+
|
27
|
+
aView: SC.LabelView.design(SC.Animatable, {
|
28
|
+
transitions: {
|
29
|
+
left: {duration: .25},
|
30
|
+
top: .25, // only possible during design; otherwise you must use long form.
|
31
|
+
width: {duration: .25, timing: SC.Animatable.TRANSITION_EASE_IN_OUT }
|
32
|
+
}
|
33
|
+
})
|
36
34
|
*/
|
37
35
|
SC.Animatable = {
|
38
36
|
/** @scope SC.Animatable.prototype */
|
@@ -17,49 +17,209 @@ SC._detectBrowser = function(userAgent, language) {
|
|
17
17
|
version = browser.version = (userAgent.match( /.*(?:rv|chrome|webkit|opera|ie)[\/: ](.+?)([ \);]|$)/ ) || [])[1];
|
18
18
|
webkitVersion = (userAgent.match( /webkit\/(.+?) / ) || [])[1];
|
19
19
|
|
20
|
+
/**
|
21
|
+
@name SC.browser.isWindows
|
22
|
+
@type Boolean
|
23
|
+
*/
|
20
24
|
browser.windows = browser.isWindows = !!/windows/.test(userAgent);
|
25
|
+
|
26
|
+
/**
|
27
|
+
@name SC.browser.isMac
|
28
|
+
@type Boolean
|
29
|
+
*/
|
21
30
|
browser.mac = browser.isMac = !!/macintosh/.test(userAgent) || (/mac os x/.test(userAgent) && !/like mac os x/.test(userAgent));
|
31
|
+
|
32
|
+
/**
|
33
|
+
@name SC.browser.isiPhone
|
34
|
+
@type Boolean
|
35
|
+
*/
|
22
36
|
browser.iPhone = browser.isiPhone = !!/iphone/.test(userAgent);
|
37
|
+
|
38
|
+
/**
|
39
|
+
@name SC.browser.isiPod
|
40
|
+
@type Boolean
|
41
|
+
*/
|
23
42
|
browser.iPod = browser.isiPod = !!/ipod/.test(userAgent);
|
43
|
+
|
44
|
+
/**
|
45
|
+
@name SC.browser.isiPad
|
46
|
+
@type Boolean
|
47
|
+
*/
|
24
48
|
browser.iPad = browser.isiPad = !!/ipad/.test(userAgent);
|
49
|
+
|
50
|
+
/**
|
51
|
+
@name SC.browser.isiOS
|
52
|
+
@type Boolean
|
53
|
+
*/
|
25
54
|
browser.iOS = browser.isiOS = browser.iPhone || browser.iPod || browser.iPad;
|
55
|
+
|
56
|
+
/**
|
57
|
+
@name SC.browser.isAndroid
|
58
|
+
@type Boolean
|
59
|
+
*/
|
26
60
|
browser.android = browser.isAndroid = !!/android/.test(userAgent);
|
27
61
|
|
62
|
+
/**
|
63
|
+
@name SC.browser.opera
|
64
|
+
@type String
|
65
|
+
*/
|
28
66
|
browser.opera = /opera/.test(userAgent) ? version : 0;
|
67
|
+
|
68
|
+
/**
|
69
|
+
@name SC.browser.isOpera
|
70
|
+
@type Boolean
|
71
|
+
*/
|
29
72
|
browser.isOpera = !!browser.opera;
|
30
73
|
|
74
|
+
/**
|
75
|
+
@name SC.browser.msie
|
76
|
+
@type String
|
77
|
+
*/
|
31
78
|
browser.msie = /msie/.test(userAgent) && !browser.opera ? version : 0;
|
79
|
+
|
80
|
+
/**
|
81
|
+
@name SC.browser.isIE
|
82
|
+
@type Boolean
|
83
|
+
*/
|
32
84
|
browser.isIE = !!browser.msie;
|
85
|
+
|
86
|
+
/**
|
87
|
+
@name SC.browser.isIE8OrLower
|
88
|
+
@type Boolean
|
89
|
+
*/
|
33
90
|
browser.isIE8OrLower = !!(browser.msie && parseInt(browser.msie, 10) <= 8);
|
34
91
|
|
92
|
+
/**
|
93
|
+
@name SC.browser.mozilla
|
94
|
+
@type String
|
95
|
+
*/
|
35
96
|
browser.mozilla = /mozilla/.test(userAgent) && !/(compatible|webkit|msie)/.test(userAgent) ? version : 0;
|
97
|
+
|
98
|
+
/**
|
99
|
+
@name SC.browser.isMozilla
|
100
|
+
@type Boolean
|
101
|
+
*/
|
36
102
|
browser.isMozilla = !!browser.mozilla;
|
37
103
|
|
104
|
+
/**
|
105
|
+
@name SC.browser.webkit
|
106
|
+
@type String
|
107
|
+
*/
|
38
108
|
browser.webkit = /webkit/.test(userAgent) ? webkitVersion : 0;
|
109
|
+
|
110
|
+
/**
|
111
|
+
@name SC.browser.isWebkit
|
112
|
+
@type Boolean
|
113
|
+
*/
|
39
114
|
browser.isWebkit = !!browser.webkit;
|
40
115
|
|
116
|
+
/**
|
117
|
+
@name SC.browser.chrome
|
118
|
+
@type String
|
119
|
+
*/
|
41
120
|
browser.chrome = /chrome/.test(userAgent) ? version: 0;
|
121
|
+
|
122
|
+
/**
|
123
|
+
@name SC.browser.isChrome
|
124
|
+
@type Boolean
|
125
|
+
*/
|
42
126
|
browser.isChrome = !!browser.chrome;
|
43
127
|
|
128
|
+
/**
|
129
|
+
@name SC.browser.mobileSafari
|
130
|
+
@type String
|
131
|
+
*/
|
44
132
|
browser.mobileSafari = /apple.*mobile.*safari/.test(userAgent) && browser.iOS ? webkitVersion : 0;
|
133
|
+
|
134
|
+
/**
|
135
|
+
@name SC.browser.isMobileSafari
|
136
|
+
@type Boolean
|
137
|
+
*/
|
45
138
|
browser.isMobileSafari = !!browser.mobileSafari;
|
46
139
|
|
140
|
+
/**
|
141
|
+
@name SC.browser.iPadSafari
|
142
|
+
@type String
|
143
|
+
*/
|
47
144
|
browser.iPadSafari = browser.iPad && browser.isMobileSafari ? webkitVersion : 0;
|
145
|
+
|
146
|
+
/**
|
147
|
+
@name SC.browser.isiPadSafari
|
148
|
+
@type Boolean
|
149
|
+
*/
|
48
150
|
browser.isiPadSafari = !!browser.iPadSafari;
|
49
151
|
|
152
|
+
/**
|
153
|
+
@name SC.browser.iPhoneSafari
|
154
|
+
@type String
|
155
|
+
*/
|
50
156
|
browser.iPhoneSafari = browser.iPhone && browser.isMobileSafari ? webkitVersion : 0;
|
157
|
+
|
158
|
+
/**
|
159
|
+
@name SC.browser.isiPhoneSafari
|
160
|
+
@type Boolean
|
161
|
+
*/
|
51
162
|
browser.isiPhoneSafari = !!browser.iphoneSafari;
|
52
163
|
|
164
|
+
/**
|
165
|
+
@name SC.browser.iPodSafari
|
166
|
+
@type String
|
167
|
+
*/
|
53
168
|
browser.iPodSafari = browser.iPod && browser.isMobileSafari ? webkitVersion : 0;
|
169
|
+
|
170
|
+
/**
|
171
|
+
@name SC.browser.isiPodSafari
|
172
|
+
@type Boolean
|
173
|
+
*/
|
54
174
|
browser.isiPodSafari = !!browser.iPodSafari;
|
55
175
|
|
176
|
+
/**
|
177
|
+
@name SC.browser.safari
|
178
|
+
@type String
|
179
|
+
*/
|
56
180
|
browser.safari = browser.webkit && !browser.chrome && !browser.iOS && !browser.android ? webkitVersion : 0;
|
181
|
+
|
182
|
+
/**
|
183
|
+
@name SC.browser.isSafari
|
184
|
+
@type Boolean
|
185
|
+
*/
|
57
186
|
browser.isSafari = !!browser.safari;
|
58
187
|
|
188
|
+
/**
|
189
|
+
@name SC.browser.language
|
190
|
+
@type String
|
191
|
+
*/
|
59
192
|
browser.language = language.split('-', 1)[0];
|
60
193
|
|
194
|
+
/**
|
195
|
+
Possible values:
|
196
|
+
|
197
|
+
- 'msie'
|
198
|
+
- 'mozilla'
|
199
|
+
- 'chrome'
|
200
|
+
- 'safari'
|
201
|
+
- 'opera'
|
202
|
+
- 'mobile-safari'
|
203
|
+
- 'unknown'
|
204
|
+
|
205
|
+
@name SC.browser.current
|
206
|
+
@type String
|
207
|
+
@default 'unknown'
|
208
|
+
*/
|
61
209
|
browser.current = browser.msie ? 'msie' : browser.mozilla ? 'mozilla' : browser.chrome ? 'chrome' : browser.safari ? 'safari' : browser.opera ? 'opera' : browser.mobileSafari ? 'mobile-safari' : 'unknown';
|
62
210
|
return browser;
|
63
211
|
};
|
64
212
|
|
213
|
+
|
214
|
+
/** @class
|
215
|
+
|
216
|
+
Contains information about the browser environment that SproutCore
|
217
|
+
is running in. String properties, such as `SC.browser.webkit` or
|
218
|
+
`SC.browser.msie`, will have a value that represents the browser build
|
219
|
+
number if that browser is being used. Otherwise, they will have a
|
220
|
+
falsey value. For convenience, Boolean counterparts for all of the
|
221
|
+
versioned properties are provided.
|
222
|
+
|
223
|
+
@since SproutCore 1.0
|
224
|
+
*/
|
65
225
|
SC.browser = SC._detectBrowser();
|
@@ -293,7 +293,8 @@ SC.ArrayController = SC.Controller.extend(SC.Array, SC.SelectionSupport,
|
|
293
293
|
}
|
294
294
|
}
|
295
295
|
|
296
|
-
if (content) content.replace(start, amt, objects);
|
296
|
+
if (content) { content.replace(start, amt, objects); }
|
297
|
+
|
297
298
|
for(i=0, objsLen = objsToDestroy.length; i<objsLen; i++){
|
298
299
|
|
299
300
|
objsToDestroy[i].destroy();
|
@@ -392,6 +393,27 @@ SC.ArrayController = SC.Controller.extend(SC.Array, SC.SelectionSupport,
|
|
392
393
|
return (this._scac_cached = content.toArray().sort(func)) ;
|
393
394
|
},
|
394
395
|
|
396
|
+
propertyWillChange: function(key) {
|
397
|
+
if (key === 'content') {
|
398
|
+
this.arrayContentWillChange(0, this.get('length'), 0);
|
399
|
+
} else {
|
400
|
+
return sc_super();
|
401
|
+
}
|
402
|
+
},
|
403
|
+
|
404
|
+
_scac_arrayContentWillChange: function(start, removed, added) {
|
405
|
+
this.arrayContentWillChange(start, removed, added);
|
406
|
+
var removedObjects = this.slice(start, start+removed);
|
407
|
+
this.teardownEnumerablePropertyChains(removedObjects);
|
408
|
+
},
|
409
|
+
|
410
|
+
_scac_arrayContentDidChange: function(start, removed, added) {
|
411
|
+
this.arrayContentDidChange(start, removed, added);
|
412
|
+
var addedObjects = this.slice(start, start+added);
|
413
|
+
this.setupEnumerablePropertyChains(addedObjects);
|
414
|
+
this.updateSelectionAfterContentChange();
|
415
|
+
},
|
416
|
+
|
395
417
|
/** @private
|
396
418
|
Whenever content changes, setup and teardown observers on the content
|
397
419
|
as needed.
|
@@ -400,81 +422,74 @@ SC.ArrayController = SC.Controller.extend(SC.Array, SC.SelectionSupport,
|
|
400
422
|
|
401
423
|
this._scac_cached = NO; // invalidate observable content
|
402
424
|
|
403
|
-
var
|
404
|
-
orders
|
405
|
-
|
406
|
-
oldlen
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
ro = this._scac_rangeObserver,
|
425
|
+
var content = this.get('content'),
|
426
|
+
orders = !!this.get('orderBy'),
|
427
|
+
lastContent = this._scac_content,
|
428
|
+
oldlen = this._scac_length || 0,
|
429
|
+
didChange = this._scac_arrayContentDidChange,
|
430
|
+
willChange = this._scac_arrayContentWillChange,
|
431
|
+
sfunc = this._scac_contentStatusDidChange,
|
432
|
+
efunc = this._scac_enumerableDidChange,
|
412
433
|
newlen;
|
413
434
|
|
414
|
-
if (
|
435
|
+
if (content === lastContent) { return this; } // nothing to do
|
415
436
|
|
416
437
|
// teardown old observer
|
417
|
-
if (
|
418
|
-
if (
|
419
|
-
|
420
|
-
|
438
|
+
if (lastContent) {
|
439
|
+
if (lastContent.isSCArray) {
|
440
|
+
lastContent.removeArrayObservers({
|
441
|
+
target: this,
|
442
|
+
didChange: didChange,
|
443
|
+
willChange: willChange
|
444
|
+
});
|
445
|
+
} else if (lastContent.isEnumerable) {
|
446
|
+
lastContent.removeObserver('[]', this, efunc);
|
421
447
|
}
|
422
|
-
else if (last.isEnumerable) { last.removeObserver('[]', this, efunc); }
|
423
|
-
last.removeObserver('status', this, sfunc);
|
424
|
-
}
|
425
448
|
|
426
|
-
|
449
|
+
lastContent.removeObserver('status', this, sfunc);
|
450
|
+
}
|
427
451
|
|
428
452
|
// save new cached values
|
429
453
|
this._scac_cached = NO;
|
430
|
-
this._scac_content =
|
454
|
+
this._scac_content = content ;
|
431
455
|
|
432
|
-
// setup new
|
456
|
+
// setup new observer
|
433
457
|
// also, calculate new length. do it manually instead of using
|
434
458
|
// get(length) because we want to avoid computed an ordered array.
|
435
|
-
if (
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
459
|
+
if (content) {
|
460
|
+
// Content is an enumerable, so listen for changes to its
|
461
|
+
// content, and get its length.
|
462
|
+
if (content.isSCArray) {
|
463
|
+
content.addArrayObservers({
|
464
|
+
target: this,
|
465
|
+
didChange: didChange,
|
466
|
+
willChange: willChange
|
467
|
+
});
|
468
|
+
|
469
|
+
newlen = content.get('length');
|
470
|
+
} else if (content.isEnumerable) {
|
471
|
+
content.addObserver('[]', this, efunc);
|
472
|
+
newlen = content.get('length');
|
473
|
+
} else {
|
474
|
+
// Assume that someone has set a non-enumerable as the content, and
|
475
|
+
// treat it as the sole member of an array.
|
476
|
+
newlen = 1;
|
477
|
+
}
|
441
478
|
|
479
|
+
// Observer for changes to the status property, in case this is an
|
480
|
+
// SC.Record or SC.RecordArray.
|
481
|
+
content.addObserver('status', this, sfunc);
|
442
482
|
} else {
|
443
|
-
newlen = SC.none(
|
483
|
+
newlen = SC.none(content) ? 0 : 1;
|
444
484
|
}
|
445
485
|
|
446
|
-
this._scac_rangeObserver = ro;
|
447
|
-
|
448
486
|
// finally, notify enumerable content has changed.
|
449
487
|
this._scac_length = newlen;
|
450
488
|
this._scac_contentStatusDidChange();
|
451
|
-
this.
|
489
|
+
this.arrayContentDidChange(0, 0, newlen);
|
452
490
|
this.updateSelectionAfterContentChange();
|
453
491
|
}.observes('content'),
|
454
492
|
|
455
|
-
/** @private
|
456
|
-
Whenever array content changes, need to simply forward notification.
|
457
|
-
|
458
|
-
Assumes that content is not null and is SC.Array.
|
459
|
-
*/
|
460
|
-
_scac_rangeDidChange: function(array, objects, key, indexes) {
|
461
|
-
if (key !== '[]') { return ; } // nothing to do
|
462
|
-
|
463
|
-
var content = this.get('content');
|
464
|
-
this._scac_length = content.get('length');
|
465
|
-
this._scac_cached = NO; // invalidate
|
466
|
-
|
467
|
-
// if array length has changed, just notify every index from min up
|
468
|
-
if (indexes) {
|
469
|
-
this.beginPropertyChanges();
|
470
|
-
indexes.forEachRange(function(start, length) {
|
471
|
-
this.enumerableContentDidChange(start, length, 0);
|
472
|
-
}, this);
|
473
|
-
this.endPropertyChanges();
|
474
|
-
this.updateSelectionAfterContentChange();
|
475
|
-
}
|
476
|
-
},
|
477
|
-
|
478
493
|
/**
|
479
494
|
@private
|
480
495
|
|
@@ -490,33 +505,6 @@ SC.ArrayController = SC.Controller.extend(SC.Array, SC.SelectionSupport,
|
|
490
505
|
@param {Number} start the index at which the positions occurred
|
491
506
|
*/
|
492
507
|
_scac_enumerableContentDidChange: function(addedObjects, removedObjects, start) {
|
493
|
-
var enumerableChanges = this._scac_enumerableChanges || [];
|
494
|
-
|
495
|
-
enumerableChanges.push([addedObjects, removedObjects, start]);
|
496
|
-
|
497
|
-
this._scac_enumerableChanges = enumerableChanges;
|
498
|
-
this.invokeOnce(this._scac_propagateEnumerableObservers);
|
499
|
-
|
500
|
-
this.setupPropertyChainsForEnumerableContent(addedObjects, removedObjects);
|
501
|
-
},
|
502
|
-
|
503
|
-
/**
|
504
|
-
@private
|
505
|
-
|
506
|
-
At the end of the run loop, notifies enumerable observers on this array
|
507
|
-
controller of changes we received from the content object.
|
508
|
-
*/
|
509
|
-
_scac_propagateEnumerableObservers: function() {
|
510
|
-
var enumerableChanges = this._scac_enumerableChanges;
|
511
|
-
var idx, len, change;
|
512
|
-
|
513
|
-
len = enumerableChanges.get('length');
|
514
|
-
for (idx = 0; idx < len; idx++) {
|
515
|
-
change = enumerableChanges[idx];
|
516
|
-
this._notifyEnumerableObservers(change[0], change[1], change[2]);
|
517
|
-
}
|
518
|
-
|
519
|
-
this._scac_enumerableChanges = null;
|
520
508
|
},
|
521
509
|
|
522
510
|
/** @private
|
@@ -534,7 +522,10 @@ SC.ArrayController = SC.Controller.extend(SC.Array, SC.SelectionSupport,
|
|
534
522
|
this._scac_length = newlen;
|
535
523
|
this.beginPropertyChanges();
|
536
524
|
this._scac_cached = NO; // invalidate
|
537
|
-
this
|
525
|
+
// If this is an unordered enumerable, we have no way
|
526
|
+
// of knowing which indices changed. Instead, we just
|
527
|
+
// invalidate the whole array.
|
528
|
+
this.arrayContentDidChange(0, oldlen, newlen);
|
538
529
|
this.endPropertyChanges();
|
539
530
|
this.updateSelectionAfterContentChange();
|
540
531
|
}.observes('orderBy'),
|
@@ -175,9 +175,7 @@ SC.mixin(Function.prototype, /** @scope Function.prototype */ {
|
|
175
175
|
to the function as well. Otherwise the function should have the
|
176
176
|
signature:
|
177
177
|
|
178
|
-
|
179
|
-
function functionName(timer)
|
180
|
-
}}}
|
178
|
+
function functionName(timer)
|
181
179
|
|
182
180
|
@param target {Object} optional target object to use as this
|
183
181
|
@param interval {Number} the time to wait, in msec
|