sproutcore 1.6.0.1 → 1.7.1.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +21 -0
- data/Gemfile +5 -0
- data/Rakefile +26 -13
- data/VERSION.yml +2 -2
- data/lib/Buildfile +43 -4
- data/lib/buildtasks/build.rake +10 -0
- data/lib/buildtasks/helpers/file_rule.rb +22 -0
- data/lib/buildtasks/helpers/file_rule_list.rb +137 -0
- data/lib/buildtasks/manifest.rake +133 -122
- data/lib/frameworks/sproutcore/CHANGELOG.md +69 -2
- data/lib/frameworks/sproutcore/apps/tests/english.lproj/strings.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +28 -22
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +9 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/controller.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controls/button.js +18 -13
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/bind.js +5 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/collection.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/action_support.js +80 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +84 -116
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +8 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +157 -157
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +5 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +10 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/action_support.js +106 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +71 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/attribute_bindings_test.js +38 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/class_name_bindings_test.js +47 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutChildViews.js +18 -18
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +42 -10
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/keyboard.js +26 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +14 -8
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +158 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +15 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +108 -108
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/error_methods.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +26 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +7 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +4 -1
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/tests/system/datetime.js +6 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +26 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +97 -96
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +4 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +17 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +7 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +12 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +23 -14
- data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +5 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/render_delegates/menu_scroller.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/tests/menu/scroll.js +235 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/views/menu/scroll.js +363 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/views/menu/scroller.js +250 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/desktop_scroller.js +92 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/native_scroll.js +25 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js +33 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/touch_scroller.js +76 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/integration.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/methods.js +143 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/ui.js +258 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/core_scroll.js +1164 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/core_scroller.js +332 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/desktop/scroll.js +236 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/desktop/scroller.js +347 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/scroll.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/scroller.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/touch/scroll.js +804 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/touch/scroller.js +133 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/text_field.css +3 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/number.js +3 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/media/views/audio.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/media/views/controls.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/media/views/media_slider.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/media/views/mini_controls.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/media/views/simple_controls.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/media/views/video.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/routing/system/routes.js +29 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/replace.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +1 -1
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list_item.css +2 -2
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/segmented.css +1 -1
- data/lib/gen/app/templates/apps/@target_name@/Buildfile +3 -5
- data/lib/gen/app/templates/apps/@target_name@/resources/_theme.css +18 -0
- data/lib/gen/project/templates/@filename@/Buildfile +2 -2
- data/lib/sproutcore/builders/chance_file.rb +9 -16
- data/lib/sproutcore/builders/html.rb +2 -1
- data/lib/sproutcore/builders/minify.rb +4 -35
- data/lib/sproutcore/builders/module.rb +38 -1
- data/lib/sproutcore/builders/split.rb +63 -0
- data/lib/sproutcore/builders/strings.rb +7 -1
- data/lib/sproutcore/builders.rb +1 -0
- data/lib/sproutcore/helpers/css_split.rb +190 -0
- data/lib/sproutcore/helpers/entry_sorter.rb +2 -0
- data/lib/sproutcore/helpers/minifier.rb +40 -16
- data/lib/sproutcore/helpers/static_helper.rb +35 -17
- data/lib/sproutcore/helpers.rb +1 -1
- data/lib/sproutcore/models/manifest.rb +26 -0
- data/lib/sproutcore/models/target.rb +12 -1
- data/lib/sproutcore/rack/proxy.rb +244 -225
- data/lib/sproutcore/rack/restrict_ip.rb +67 -0
- data/lib/sproutcore/rack/service.rb +8 -2
- data/lib/sproutcore/rack.rb +1 -0
- data/lib/sproutcore/tools/build.rb +91 -43
- data/lib/sproutcore/tools/gen.rb +2 -3
- data/lib/sproutcore/tools/manifest.rb +22 -16
- data/lib/sproutcore/tools/server.rb +21 -0
- data/lib/sproutcore/tools.rb +102 -46
- data/lib/sproutcore.rb +30 -5
- data/spec/buildtasks/helpers/accept_list +22 -0
- data/spec/buildtasks/helpers/accept_list.rb +128 -0
- data/spec/buildtasks/helpers/list.json +11 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/chance_2x_spec.rb +1 -39
- data/spec/buildtasks/manifest/prepare_build_tasks/chance_spec.rb +0 -38
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +4 -4
- data/spec/buildtasks/manifest/prepare_build_tasks/module_spec.rb +2 -2
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_2x_indirect_spec.rb +7 -16
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_2x_spec.rb +7 -17
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +11 -6
- data/spec/fixtures/builder_tests/Buildfile +2 -1
- data/spec/fixtures/builder_tests/apps/module_test/modules/required_module/core.js +0 -0
- data/spec/lib/builders/module_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/sproutcore.gemspec +4 -9
- data/vendor/chance/lib/chance/factory.rb +45 -0
- data/vendor/chance/lib/chance/instance/data_url.rb +0 -29
- data/vendor/chance/lib/chance/instance/slicing.rb +57 -4
- data/vendor/chance/lib/chance/instance/spriting.rb +112 -21
- data/vendor/chance/lib/chance/instance.rb +173 -28
- data/vendor/chance/lib/chance/parser.rb +80 -52
- data/vendor/chance/lib/chance.rb +25 -6
- data/vendor/sproutcore/SCCompiler.jar +0 -0
- data/vendor/sproutcore/lib/args4j-2.0.12.jar +0 -0
- data/vendor/sproutcore/lib/yuicompressor-2.4.2.jar +0 -0
- metadata +97 -38
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// ==========================================================================
|
|
2
|
+
// Project: SproutCore - JavaScript Application Framework
|
|
3
|
+
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
|
4
|
+
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
|
5
|
+
// License: Licensed under MIT license (see license.js)
|
|
6
|
+
// ==========================================================================
|
|
7
|
+
sc_require('views/core_scroller');
|
|
8
|
+
|
|
9
|
+
/** @class
|
|
10
|
+
Implementation of a touch scroller view to be used in tandem with
|
|
11
|
+
`SC.TouchScrollView`.
|
|
12
|
+
|
|
13
|
+
To style the touch scroller view, implement your own render delegate.
|
|
14
|
+
|
|
15
|
+
@extends SC.CoreScrollerView
|
|
16
|
+
*/
|
|
17
|
+
SC.TouchScrollerView = SC.CoreScrollerView.extend(
|
|
18
|
+
/** @scope SC.TouchScrollerView.prototype */{
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
@type Array
|
|
22
|
+
@default ['sc-touch-scroller-view']
|
|
23
|
+
@see SC.View#classNames
|
|
24
|
+
*/
|
|
25
|
+
classNames: ['sc-touch-scroller-view'],
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
@type Array
|
|
29
|
+
@default ['displayThumbPosition', 'displayThumbLength']
|
|
30
|
+
@see SC.View#displayProperties
|
|
31
|
+
*/
|
|
32
|
+
displayProperties: ['displayThumbPosition', 'displayThumbLength'],
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
@type Number
|
|
36
|
+
@default 12
|
|
37
|
+
*/
|
|
38
|
+
scrollbarThickness: 12,
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
@type Boolean
|
|
42
|
+
@default YES
|
|
43
|
+
*/
|
|
44
|
+
isTranslucent: YES,
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
@type Number
|
|
48
|
+
@default 5
|
|
49
|
+
*/
|
|
50
|
+
capLength: 5,
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
@type Number
|
|
54
|
+
@default 0
|
|
55
|
+
*/
|
|
56
|
+
capOverlap: 0,
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
@type Boolean
|
|
60
|
+
@default NO
|
|
61
|
+
*/
|
|
62
|
+
hasButtons: NO,
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
@type Number
|
|
66
|
+
@default 36
|
|
67
|
+
*/
|
|
68
|
+
buttonOverlap: 36,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
@type String
|
|
72
|
+
@default 'touchScrollerRenderDelegate'
|
|
73
|
+
*/
|
|
74
|
+
renderDelegateName: 'touchScrollerRenderDelegate',
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
@type Number
|
|
78
|
+
@observes value
|
|
79
|
+
@observes _touchScrollValue
|
|
80
|
+
*/
|
|
81
|
+
displayValue: function () {
|
|
82
|
+
var touchValue = this.get('_touchScrollValue');
|
|
83
|
+
return !SC.none(touchValue) ? touchValue : this.get('value');
|
|
84
|
+
}.property("value", "_touchScrollValue").cacheable(),
|
|
85
|
+
|
|
86
|
+
// ..........................................................
|
|
87
|
+
// INTERNAL SUPPORT
|
|
88
|
+
//
|
|
89
|
+
|
|
90
|
+
/** @private */
|
|
91
|
+
touchScrollDidStart: function (value) {
|
|
92
|
+
this.set("_touchScrollValue", value);
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
/** @private */
|
|
96
|
+
touchScrollDidEnd: function (value) {
|
|
97
|
+
this.set("_touchScrollValue", null);
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
/** @private */
|
|
101
|
+
touchScrollDidChange: function (value) {
|
|
102
|
+
this.set("_touchScrollValue", value);
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
/** @private
|
|
106
|
+
Updates the thumb display length and position to reflect
|
|
107
|
+
the ability for touch scroll views to go out of bounds.
|
|
108
|
+
|
|
109
|
+
This makes the scroller shrink when scrolling out of the
|
|
110
|
+
bounds of the view, while ensuring that the scroller doesn't
|
|
111
|
+
go past it's minimum bounds.
|
|
112
|
+
*/
|
|
113
|
+
_sctcv_updateThumbDisplay: function () {
|
|
114
|
+
var max = this.get("scrollerLength") - this.get('capLength'),
|
|
115
|
+
min = this.get("minimum") + this.get('capLength'),
|
|
116
|
+
position = this.get('thumbPosition'),
|
|
117
|
+
length = this.get('thumbLength');
|
|
118
|
+
|
|
119
|
+
if (position + length > max) {
|
|
120
|
+
position = Math.min(max - 20, position);
|
|
121
|
+
length = max - position;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (position < min) {
|
|
125
|
+
length -= min - position;
|
|
126
|
+
position = min;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
this.setIfChanged('displayThumbPosition', position);
|
|
130
|
+
this.setIfChanged('displayThumbLength', Math.round(length - 1044));
|
|
131
|
+
}.observes('thumbPosition', 'thumbLength', 'scrollerLength', 'capLength', 'minimum')
|
|
132
|
+
|
|
133
|
+
});
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
top: 0px;
|
|
28
28
|
left: 0px;
|
|
29
29
|
width: 100%;
|
|
30
|
-
|
|
31
|
-
right: 0px;
|
|
30
|
+
height: 100%;
|
|
32
31
|
display: block;
|
|
33
32
|
background: transparent;
|
|
34
33
|
vertical-align: middle;
|
|
@@ -36,7 +35,7 @@
|
|
|
36
35
|
outline: none;
|
|
37
36
|
-webkit-appearance:none;
|
|
38
37
|
}
|
|
39
|
-
|
|
38
|
+
|
|
40
39
|
textarea {
|
|
41
40
|
position: absolute;
|
|
42
41
|
top: 0px;
|
|
@@ -44,6 +43,7 @@
|
|
|
44
43
|
width:100%;
|
|
45
44
|
bottom: 0px;
|
|
46
45
|
right: 0px;
|
|
46
|
+
padding-top: 10px;
|
|
47
47
|
display: block;
|
|
48
48
|
background: transparent;
|
|
49
49
|
vertical-align: middle;
|
|
@@ -51,7 +51,7 @@ SC.Validator.Number = SC.Validator.extend(
|
|
|
51
51
|
} else if (this.get('places') > 0) {
|
|
52
52
|
value = parseFloat(value) ;
|
|
53
53
|
} else {
|
|
54
|
-
if(value.length
|
|
54
|
+
if(value.length===1 && value.match(/-/)) value = null;
|
|
55
55
|
else {
|
|
56
56
|
result = parseInt(value,0) ;
|
|
57
57
|
if(isNaN(result)){
|
|
@@ -84,9 +84,11 @@ SC.Validator.Number = SC.Validator.extend(
|
|
|
84
84
|
Allow only numbers, dashes, period, and commas
|
|
85
85
|
*/
|
|
86
86
|
validateKeyDown: function(form, field, charStr) {
|
|
87
|
+
if(!charStr) charStr = "";
|
|
87
88
|
var text = field.$input().val();
|
|
88
89
|
if (!text) text='';
|
|
89
90
|
text+=charStr;
|
|
91
|
+
|
|
90
92
|
if(this.get('places')===0){
|
|
91
93
|
if(charStr.length===0) return true;
|
|
92
94
|
else return text.match(/^[\-{0,1}]?[0-9,\0]*/)[0]===text;
|
|
@@ -961,9 +961,9 @@ SC.TextFieldView = SC.FieldView.extend(SC.StaticLayout, SC.Editable,
|
|
|
961
961
|
the hint text if needed.
|
|
962
962
|
*/
|
|
963
963
|
didLoseKeyResponderTo: function(keyView) {
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
964
|
+
SC.RunLoop.begin();
|
|
965
|
+
this.fieldDidBlur();
|
|
966
|
+
SC.RunLoop.end();
|
|
967
967
|
this.invokeLater("scrollToOriginIfNeeded", 100);
|
|
968
968
|
},
|
|
969
969
|
|
|
@@ -8,12 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
sc_require('views/media_slider');
|
|
10
10
|
/** @class
|
|
11
|
-
|
|
12
|
-
(Document Your View Here)
|
|
13
|
-
|
|
14
11
|
@extends SC.View
|
|
15
12
|
*/
|
|
16
|
-
SC.MiniMediaControlsView = SC.View.extend(
|
|
13
|
+
SC.MiniMediaControlsView = SC.View.extend(
|
|
14
|
+
/** @scope SC.MiniMediaControlsView.prototype */{
|
|
17
15
|
|
|
18
16
|
target: null,
|
|
19
17
|
|
|
@@ -8,12 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
sc_require('views/media_slider');
|
|
10
10
|
/** @class
|
|
11
|
-
|
|
12
|
-
(Document Your View Here)
|
|
13
|
-
|
|
14
11
|
@extends SC.View
|
|
15
12
|
*/
|
|
16
|
-
SC.SimpleMediaControlsView = SC.View.extend(
|
|
13
|
+
SC.SimpleMediaControlsView = SC.View.extend(
|
|
14
|
+
/** @scope SC.SimpleMediaControlsView.prototype */{
|
|
17
15
|
|
|
18
16
|
target: null,
|
|
19
17
|
|
|
@@ -214,6 +214,30 @@ SC.routes = SC.Object.create(
|
|
|
214
214
|
@type {String}
|
|
215
215
|
*/
|
|
216
216
|
location: function(key, value) {
|
|
217
|
+
this._skipRoute = NO;
|
|
218
|
+
return this._extractLocation(key, value);
|
|
219
|
+
}.property(),
|
|
220
|
+
|
|
221
|
+
/*
|
|
222
|
+
Works exactly like 'location' but you usee this property only when
|
|
223
|
+
you want to just change the location w/out triggering the routes
|
|
224
|
+
*/
|
|
225
|
+
informLocation: function(key, value){
|
|
226
|
+
this._skipRoute = YES;
|
|
227
|
+
// This is a very special case where this property
|
|
228
|
+
// has a very heavy influence on the 'location' property
|
|
229
|
+
// this is a case where you might want to use idempotent
|
|
230
|
+
// but you would take a performance hit because it is possible
|
|
231
|
+
// call set() multiple time and we don't want to take the extra
|
|
232
|
+
// cost, so we just invalidate the cached set() value ourselves
|
|
233
|
+
// you shouldn't do this in your own code unless you REALLY
|
|
234
|
+
// know what you are doing.
|
|
235
|
+
var lsk = this.location.lastSetValueKey;
|
|
236
|
+
if (lsk && this._kvo_cache) this._kvo_cache[lsk] = value;
|
|
237
|
+
return this._extractLocation(key, value);
|
|
238
|
+
}.property(),
|
|
239
|
+
|
|
240
|
+
_extractLocation: function(key, value) {
|
|
217
241
|
var crumbs, encodedValue;
|
|
218
242
|
|
|
219
243
|
if (value !== undefined) {
|
|
@@ -243,7 +267,7 @@ SC.routes = SC.Object.create(
|
|
|
243
267
|
}
|
|
244
268
|
|
|
245
269
|
return this._location;
|
|
246
|
-
}
|
|
270
|
+
},
|
|
247
271
|
|
|
248
272
|
/**
|
|
249
273
|
You usually don't need to call this method. It is done automatically after
|
|
@@ -300,11 +324,12 @@ SC.routes = SC.Object.create(
|
|
|
300
324
|
loc = decodeURI(loc);
|
|
301
325
|
}
|
|
302
326
|
|
|
303
|
-
if (this.get('location') !== loc) {
|
|
327
|
+
if (this.get('location') !== loc && !this._skipRoute) {
|
|
304
328
|
SC.run(function() {
|
|
305
329
|
this.set('location', loc);
|
|
306
330
|
}, this);
|
|
307
331
|
}
|
|
332
|
+
this._skipRoute = false;
|
|
308
333
|
},
|
|
309
334
|
|
|
310
335
|
popState: function(event) {
|
|
@@ -316,12 +341,13 @@ SC.routes = SC.Object.create(
|
|
|
316
341
|
// Remove the base prefix and the extra '/'
|
|
317
342
|
loc = loc.slice(base.length + 1, loc.length);
|
|
318
343
|
|
|
319
|
-
if (this.get('location') !== loc) {
|
|
344
|
+
if (this.get('location') !== loc && !this._skipRoute) {
|
|
320
345
|
SC.run(function() {
|
|
321
346
|
this.set('location', loc);
|
|
322
347
|
}, this);
|
|
323
348
|
}
|
|
324
349
|
}
|
|
350
|
+
this._skipRoute = false;
|
|
325
351
|
},
|
|
326
352
|
|
|
327
353
|
/**
|
|
@@ -39,7 +39,7 @@ window.SproutCore = window.SproutCore || SC ;
|
|
|
39
39
|
// rest of the methods go into the mixin defined below.
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
@version 1.
|
|
42
|
+
@version 1.7.1.beta
|
|
43
43
|
@namespace
|
|
44
44
|
|
|
45
45
|
All SproutCore methods and functions are defined
|
|
@@ -59,7 +59,7 @@ window.SproutCore = window.SproutCore || SC ;
|
|
|
59
59
|
*/
|
|
60
60
|
SC = window.SC; // This is dumb but necessary for jsdoc to get it right
|
|
61
61
|
|
|
62
|
-
SC.VERSION = '1.
|
|
62
|
+
SC.VERSION = '1.7.1.beta';
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
@private
|
|
@@ -437,7 +437,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
|
437
437
|
/**
|
|
438
438
|
Invoked whenever the value of the "from" property changes. This will mark
|
|
439
439
|
the binding as dirty if the value has changed.
|
|
440
|
-
|
|
440
|
+
|
|
441
441
|
@param {Object} target The object that contains the key
|
|
442
442
|
@param {String} key The name of the property which changed
|
|
443
443
|
*/
|
|
@@ -467,7 +467,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
|
467
467
|
|
|
468
468
|
if the value does not match the transformedBindingValue, then it will
|
|
469
469
|
become the new bindingValue.
|
|
470
|
-
|
|
470
|
+
|
|
471
471
|
@param {Object} target The object that contains the key
|
|
472
472
|
@param {String} key The name of the property which changed
|
|
473
473
|
*/
|
|
@@ -983,7 +983,7 @@ SC.Binding = /** @scope SC.Binding.prototype */{
|
|
|
983
983
|
|
|
984
984
|
/**
|
|
985
985
|
Adds a transform that will return YES if the value is null or undefined, NO otherwise.
|
|
986
|
-
|
|
986
|
+
|
|
987
987
|
@param {String} [fromPath]
|
|
988
988
|
@returns {SC.Binding} this
|
|
989
989
|
*/
|
|
@@ -380,8 +380,8 @@ SC.IndexSet = SC.mixin({},
|
|
|
380
380
|
.set('max', start.max)
|
|
381
381
|
.set('length', start.length)
|
|
382
382
|
.set('source', start.source)
|
|
383
|
-
.enumerableContentDidChange()
|
|
384
|
-
.endPropertyChanges();
|
|
383
|
+
.enumerableContentDidChange();
|
|
384
|
+
this.endPropertyChanges();
|
|
385
385
|
return this ;
|
|
386
386
|
|
|
387
387
|
} else {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
background: static_url('images/sc-theme-repeat-x.png') no-repeat left -789px;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
.sc-theme .sc-segmented-view .sc-segment label {
|
|
82
|
+
.sc-theme .sc-segmented-view .sc-segment-view label {
|
|
83
83
|
background: static_url('images/sc-theme-repeat-x.png') repeat-x left -764px;
|
|
84
84
|
text-shadow: #fff 0px 1px 0px;
|
|
85
85
|
}
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
# This is your Buildfile for your app, <%= namespace %>. This tells SproutCore
|
|
4
4
|
# how to build your app. These settings override those in your project
|
|
5
5
|
# Buildfile, which contains default settings for all apps in your project.
|
|
6
|
-
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
# Ace theme (named 'ace'), it is set to 'ace.<%= css_name %>'.
|
|
10
|
-
config :<%= target_name %>, :css_theme => 'ace.<%= css_name %>'
|
|
6
|
+
|
|
7
|
+
# It is better to add :required targets here than in the global Buildfile.
|
|
8
|
+
config :<%= target_name %>, :required => :sproutcore
|
|
11
9
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This defines the global $theme variable for use inside your CSS.
|
|
3
|
+
The $theme variable holds the CSS class names for your theme.
|
|
4
|
+
|
|
5
|
+
You can then theme your app by using CSS like this:
|
|
6
|
+
|
|
7
|
+
$theme.button {
|
|
8
|
+
color: blue;
|
|
9
|
+
@include slices('white-button.png', $left: 3, $right: 3);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
Any _theme.css file is prepended to all files inside its directory,
|
|
13
|
+
and any subdirectories that don't define their own _theme.css file.
|
|
14
|
+
|
|
15
|
+
This allows you to give different directories different values for
|
|
16
|
+
$theme if you wish.
|
|
17
|
+
*/
|
|
18
|
+
$theme: '.ace.<%= css_name %>';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<%= copyright_block(namespace, :ruby) %>
|
|
2
2
|
|
|
3
3
|
# This is your Buildfile, which sets build settings for your project.
|
|
4
|
-
# For example, this tells SproutCore's build tools that
|
|
5
|
-
# the SproutCore framework.
|
|
4
|
+
# For example, this tells SproutCore's build tools that EVERYTHING
|
|
5
|
+
# requires the SproutCore framework.
|
|
6
6
|
config :all, :required => :sproutcore
|
|
7
7
|
|
|
8
8
|
# In addition to this Buildfile, which gives settings for your entire project,
|
|
@@ -9,13 +9,18 @@ module SC
|
|
|
9
9
|
def build(dst_path)
|
|
10
10
|
instances = entry[:chance_instances] || [entry[:chance_instance]]
|
|
11
11
|
|
|
12
|
-
# Ensure all entries are staged.
|
|
13
|
-
#
|
|
14
|
-
|
|
12
|
+
# Ensure all entries are staged. When Abbot updates, it may skip regenerating
|
|
13
|
+
# the manifest and just run us, in which case, the previous staged version
|
|
14
|
+
# will be out-of-date.
|
|
15
|
+
entry[:source_entries].each {|e| e.stage! if entry[:build_required] }
|
|
15
16
|
|
|
16
17
|
chance_file = entry[:chance_file]
|
|
17
18
|
|
|
18
19
|
src = instances.map {|chance|
|
|
20
|
+
# Because files were restaged, they could be out-of-date.
|
|
21
|
+
# Let's double-check them all.
|
|
22
|
+
chance.check_all_files
|
|
23
|
+
|
|
19
24
|
|
|
20
25
|
src = ""
|
|
21
26
|
src = chance.output_for chance_file unless chance.nil?
|
|
@@ -40,19 +45,6 @@ module SC
|
|
|
40
45
|
#
|
|
41
46
|
# The default will rewrite calls to static_url().
|
|
42
47
|
def rewrite_inline_code(code)
|
|
43
|
-
# look for sc_require, require or sc_resource. wrap in comment
|
|
44
|
-
code.gsub!(/url\s*\(\s*["']mhtml\:chance-mhtml\.txt!(.+?)["']\s*\)/) {|mhtml|
|
|
45
|
-
static_entry = entry.manifest.find_entry("__sc_chance_mhtml.txt")
|
|
46
|
-
|
|
47
|
-
if !static_entry
|
|
48
|
-
url = ''
|
|
49
|
-
else
|
|
50
|
-
url = static_entry.cacheable_url
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
"expression('url(\"mhtml:' + document.location.protocol + '//' + document.location.host + '" + url + "!" + $1 + "' + '\")')"
|
|
54
|
-
}
|
|
55
|
-
|
|
56
48
|
# chance_files refer, usually, to sprites.
|
|
57
49
|
code.gsub!(/chance_file\(["'](.*?)['"]\)/) {|match|
|
|
58
50
|
path = entry[:resource_name] + "-" + $1
|
|
@@ -63,6 +55,7 @@ module SC
|
|
|
63
55
|
"static_url('#{$1}')"
|
|
64
56
|
}
|
|
65
57
|
|
|
58
|
+
# look for sc_require, require or sc_resource. wrap in comment
|
|
66
59
|
code.gsub!(/((sc_require|require|sc_resource)\(\s*['"].*["']\s*\)\s*\;)/, '/* \1 */')
|
|
67
60
|
replace_static_url(code)
|
|
68
61
|
code
|
|
@@ -112,7 +112,8 @@ module SC
|
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
def build(dst_path)
|
|
115
|
-
|
|
115
|
+
# WE ARE DISABLING HTML5 MANIFEST FOR NOW. Because it doesn't work.
|
|
116
|
+
if false and CONFIG[:html5_manifest]
|
|
116
117
|
$to_html5_manifest << dst_path
|
|
117
118
|
$to_html5_manifest_networks = CONFIG[:html5_manifest_networks]
|
|
118
119
|
@content_for_html5_manifest = true
|
|
@@ -32,26 +32,6 @@ module SC
|
|
|
32
32
|
send("build_#{@kind}".to_sym, dst_path)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
def build_css(dst_path)
|
|
36
|
-
a = Regexp.new('^'+MANIFEST.build_root)
|
|
37
|
-
if dst_path =~ a
|
|
38
|
-
# $to_minify << dst_path
|
|
39
|
-
FileUtils.mkdir_p(File.dirname(dst_path))
|
|
40
|
-
FileUtils.copy(entry.source_path, dst_path)
|
|
41
|
-
else
|
|
42
|
-
FileUtils.mkdir_p(File.dirname(dst_path)) # make sure loc exists...
|
|
43
|
-
filecompress = "java -Xmx128m -jar \"" + SC.yui_jar + "\" --type css --charset utf-8 --line-break 0 --nomunge --preserve-semi --disable-optimizations \"" + entry.source_path + "\" -o \"" + dst_path + "\" 2>&1"
|
|
44
|
-
SC.logger.info 'Compressing CSS with YUI .... '+ dst_path
|
|
45
|
-
SC.logger.debug `#{filecompress}`
|
|
46
|
-
|
|
47
|
-
if $?.exitstatus != 0
|
|
48
|
-
_report_error(output, entry.filename, entry.source_path)
|
|
49
|
-
SC.logger.fatal("!!!!YUI compressor failed, please check that your css code is valid.")
|
|
50
|
-
SC.logger.fatal("!!!!Failed compressing CSS... "+ dst_path)
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
55
35
|
# Minify some javascript by invoking the YUI compressor.
|
|
56
36
|
def build_javascript(dst_path)
|
|
57
37
|
entry.source_entry.build!
|
|
@@ -63,21 +43,10 @@ module SC
|
|
|
63
43
|
SC::Helpers::Minifier << dst_path
|
|
64
44
|
end
|
|
65
45
|
end
|
|
66
|
-
|
|
67
|
-
def
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
filecompress = "java -Xmx128m -jar \"" + SC.yui_jar + "\" --type js \"" + entry.source_path + "\" -o \"" + dst_path + "\" 2>&1"
|
|
71
|
-
SC.logger.info 'Compiling with YUI: '+ filecompress + "..."
|
|
72
|
-
|
|
73
|
-
output = `#{filecompress}` # It'd be nice to just read STDERR, but
|
|
74
|
-
# I can't find a reasonable, commonly-
|
|
75
|
-
# installed, works-on-all-OSes solution.
|
|
76
|
-
if $?.exitstatus != 0
|
|
77
|
-
_report_error(output, entry.filename, entry.source_path)
|
|
78
|
-
SC.logger.fatal("!!!!YUI compiler failed, please check that your js code is valid")
|
|
79
|
-
SC.logger.fatal("!!!!Failed compiling ... "+ dst_path)
|
|
80
|
-
end
|
|
46
|
+
|
|
47
|
+
def build_html(dst_path)
|
|
48
|
+
entry.source_entry.build!
|
|
49
|
+
SC::Helpers::Minifier << dst_path
|
|
81
50
|
end
|
|
82
51
|
|
|
83
52
|
private
|