sproutcore 1.5.0.pre.4 → 1.5.0.pre.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/VERSION.yml +1 -1
- data/lib/Buildfile +1 -1
- data/lib/buildtasks/build.rake +14 -6
- data/lib/buildtasks/manifest.rake +171 -72
- data/lib/frameworks/sproutcore/Buildfile +3 -5
- data/lib/frameworks/sproutcore/CHANGELOG.md +9 -0
- data/lib/frameworks/sproutcore/apps/test_controls/resources/main_page.js +2 -1
- data/lib/frameworks/sproutcore/apps/test_controls/resources/progress_page.js +7 -17
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +7 -1
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/loader.js +14 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/browser.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +14 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template/collection.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +6 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +49 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +8 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +46 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/button.js +32 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/checkbox.js +32 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/disclosure.js +31 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/progress.js +15 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio.js +28 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segmented.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +20 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/well.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +40 -34
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +35 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +43 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +47 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +6 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +21 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +41 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +128 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/radio/ui.js +93 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +13 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroller.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +47 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +51 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/toolbar/method.js +33 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/toolbar/ui.js +29 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +9 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +148 -134
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +30 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +9 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +52 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +36 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +9 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +15 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +1 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +4 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +7 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/well.js +1 -2
- data/lib/frameworks/sproutcore/frameworks/forms/views/form.js +3 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +0 -9
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/editable.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/label.js +25 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/system/chance.js +64 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/module.js +34 -27
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/editable/ui.js +42 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/ui.js +62 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +0 -8
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +12 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +48 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/views/field.js +19 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/views/image.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +11 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +152 -74
- data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +12 -9
- data/lib/frameworks/sproutcore/frameworks/runtime/system/logger.js +1476 -176
- data/lib/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/logger.js +227 -32
- data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +11 -11
- data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +10 -0
- data/lib/frameworks/sproutcore/lib/index.rhtml +30 -8
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/18px/segmented.css +4 -4
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/24px/segmented.css +4 -4
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/30px/segmented.css +4 -4
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/44px/segmented.css +4 -4
- data/lib/frameworks/sproutcore/themes/ace/resources/segmented/segmented.css +4 -0
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/slider.css +5 -1
- data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/slider.js +11 -3
- data/lib/frameworks/sproutcore/themes/ace/resources/well/well.css +7 -8
- data/lib/frameworks/sproutcore/themes/ace/resources/well/well.js +2 -4
- data/lib/gen/app/templates/apps/@target_name@/Buildfile +14 -0
- data/lib/gen/app/templates/apps/@target_name@/theme.js +27 -0
- data/lib/gen/html_app/templates/apps/@target_name@/resources/stylesheets/@target_name@.css +4 -0
- data/lib/gen/project/templates/@filename@/Buildfile +7 -2
- data/lib/gen/theme/templates/themes/@target_name@/Buildfile +3 -0
- data/lib/gen/theme/templates/themes/@target_name@/theme.js +23 -0
- data/lib/sproutcore/builders.rb +2 -0
- data/lib/sproutcore/builders/chance.rb +64 -0
- data/lib/sproutcore/builders/chance_file.rb +59 -0
- data/lib/sproutcore/builders/combine.rb +0 -45
- data/lib/sproutcore/builders/html.rb +1 -1
- data/lib/sproutcore/builders/minify.rb +5 -17
- data/lib/sproutcore/builders/module.rb +2 -2
- data/lib/sproutcore/builders/string_wrapper.rb +13 -15
- data/lib/sproutcore/helpers.rb +1 -1
- data/lib/sproutcore/helpers/minifier.rb +56 -0
- data/lib/sproutcore/helpers/static_helper.rb +86 -40
- data/lib/sproutcore/models/generator.rb +16 -0
- data/lib/sproutcore/models/manifest_entry.rb +8 -1
- data/lib/sproutcore/models/target.rb +101 -33
- data/lib/sproutcore/tools.rb +0 -7
- data/lib/sproutcore/tools/build.rb +2 -37
- data/spec/buildtasks/manifest/prepare_build_tasks/chance_spec.rb +100 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +86 -9
- data/spec/buildtasks/manifest/prepare_build_tasks/css_spec.rb +1 -1
- data/spec/buildtasks/manifest/prepare_build_tasks/minify_spec.rb +1 -1
- data/spec/buildtasks/manifest/prepare_build_tasks/module_info_spec.rb +96 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/module_spec.rb +83 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +37 -4
- data/spec/buildtasks/manifest/spec_helper.rb +4 -0
- data/spec/fixtures/builder_tests/Buildfile +11 -9
- data/spec/fixtures/builder_tests/apps/chance_test/Buildfile +14 -0
- data/spec/fixtures/builder_tests/apps/chance_test/core.js +27 -0
- data/spec/fixtures/builder_tests/apps/chance_test/main.js +30 -0
- data/spec/fixtures/builder_tests/apps/chance_test/resources/demo.css +6 -0
- data/spec/fixtures/builder_tests/apps/chance_test/resources/last_file.css +7 -0
- data/spec/fixtures/builder_tests/apps/chance_test/resources/loading.rhtml +9 -0
- data/spec/fixtures/builder_tests/apps/chance_test/resources/main_page.js +24 -0
- data/spec/fixtures/builder_tests/apps/chance_test/resources/z_first_file.css +6 -0
- data/spec/fixtures/builder_tests/apps/chance_test/theme.js +27 -0
- data/spec/fixtures/builder_tests/apps/module_test/module.js +1 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/deferred_module/english.lproj/req_style_2.css +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/deferred_module/english.lproj/test.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/deferred_module/javascript.js +1 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/deferred_module/lib/alt_layout.rhtml +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/deferred_module/req_js_2.js +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/dynamic_req_target_1/dynamic_req_js_1.js +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/dynamic_req_target_1/english.lproj/dynamic_req_style_1.css +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/inlined_module/README +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/required_target/english.lproj/req_style_1.css +0 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/required_target/english.lproj/strings.js +4 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/required_target/english.lproj/test.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/module_test/modules/required_target/req_js_1.js +0 -0
- data/spec/fixtures/helper_tests/apps/minifier_test/core.js +8 -0
- data/spec/fixtures/real_world/Buildfile +11 -1
- data/spec/fixtures/real_world/apps/account/modules/preferences/README +0 -0
- data/spec/fixtures/real_world/apps/calendar/modules/preferences/README +0 -0
- data/spec/fixtures/real_world/apps/contacts/modules/preferences/README +0 -0
- data/spec/fixtures/real_world/apps/contacts/modules/printing/README +0 -0
- data/spec/fixtures/real_world/apps/mail/modules/preferences/README +0 -0
- data/spec/fixtures/real_world/apps/mail/modules/printing/README +0 -0
- data/spec/fixtures/real_world/apps/photos/modules/email/README +0 -0
- data/spec/fixtures/real_world/apps/photos/modules/preferences/README +0 -0
- data/spec/lib/builders/chance_file_spec.rb +63 -0
- data/spec/lib/builders/chance_spec.rb +81 -0
- data/spec/lib/builders/module_spec.rb +133 -0
- data/spec/lib/helpers/minifier.rb +31 -0
- data/spec/lib/models/project/find_targets_for_spec.rb +1 -1
- data/vendor/chance/lib/chance/imagers/data_url.rb +68 -17
- data/vendor/chance/lib/chance/instance.rb +55 -30
- data/vendor/chance/lib/chance/parser.rb +1 -1
- data/vendor/chance/lib/chance/slicing.rb +39 -3
- metadata +52 -7
- data/lib/frameworks/sproutcore/frameworks/foundation/system/logger.js +0 -163
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/logger.js +0 -44
- data/spec/buildtasks/manifest/prepare_build_tasks/bundle_spec.rb +0 -254
- data/spec/fixtures/builder_tests/apps/bundle_test/bundle.js +0 -1
- data/spec/lib/builders/bundle_spec.rb +0 -295
@@ -24,15 +24,24 @@ describe "manifest:prepare_build_tasks:packed" do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
it "should
|
27
|
+
it "should add packed entries for apps" do
|
28
28
|
@target = @project.target_for(:contacts)
|
29
29
|
@target.target_type.should == :app # precondition
|
30
30
|
|
31
31
|
@manifest = @target.manifest_for(:language => :en)
|
32
32
|
run_task
|
33
33
|
|
34
|
-
@manifest.entry_for('javascript-packed.js').
|
35
|
-
@manifest.entry_for('stylesheet-packed.css').
|
34
|
+
@manifest.entry_for('javascript-packed.js').should_not be_nil
|
35
|
+
@manifest.entry_for('stylesheet-packed.css').should_not be_nil
|
36
|
+
@manifest.entry_for('stylesheet@2x-packed.css').should_not be_nil
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should remove non-packed JS entries from apps" do
|
40
|
+
@manifest.entries.each do |entry|
|
41
|
+
if entry[:entry_type] == :javascript
|
42
|
+
entry[:filename].should eq 'javascript-packed.js'
|
43
|
+
end
|
44
|
+
end
|
36
45
|
end
|
37
46
|
|
38
47
|
it "should add packed entries for frameworks" do
|
@@ -104,10 +113,12 @@ describe "manifest:prepare_build_tasks:packed" do
|
|
104
113
|
before do
|
105
114
|
run_task
|
106
115
|
@entry = entry_for('stylesheet-packed.css')
|
116
|
+
@entry_2x = entry_for('stylesheet@2x-packed.css')
|
107
117
|
end
|
108
118
|
|
109
119
|
it "should generate a stylesheet-packed.css entry" do
|
110
120
|
@entry.should_not be_nil
|
121
|
+
@entry_2x.should_not be_nil
|
111
122
|
end
|
112
123
|
|
113
124
|
it "should include stylesheet.css entries from all required targets" do
|
@@ -115,12 +126,17 @@ describe "manifest:prepare_build_tasks:packed" do
|
|
115
126
|
@entry.source_entries.each do |entry|
|
116
127
|
entry.filename.should == 'stylesheet.css'
|
117
128
|
end
|
129
|
+
|
130
|
+
@entry_2x.source_entries.size.should > 0
|
131
|
+
@entry_2x.source_entries.each do |entry|
|
132
|
+
entry.filename.should == 'stylesheet@2x.css'
|
133
|
+
end
|
118
134
|
end
|
119
135
|
|
120
136
|
it "should include ordered_entries ordered by required target order" do
|
121
137
|
|
122
138
|
# find targets, sorted by order. remove any that don't have a
|
123
|
-
#
|
139
|
+
# stylesheet.css entry.
|
124
140
|
targets = @target.expand_required_targets + [@target]
|
125
141
|
variation = @entry.manifest.variation
|
126
142
|
targets.reject! do |t|
|
@@ -130,21 +146,38 @@ describe "manifest:prepare_build_tasks:packed" do
|
|
130
146
|
@entry.ordered_entries.each do |entry|
|
131
147
|
entry.target.should == targets.shift
|
132
148
|
end
|
149
|
+
|
150
|
+
targets = @target.expand_required_targets + [@target]
|
151
|
+
variation = @entry.manifest.variation
|
152
|
+
targets.reject! do |t|
|
153
|
+
t.manifest_for(variation).build!.entry_for('stylesheet@2x.css').nil?
|
154
|
+
end
|
155
|
+
|
156
|
+
@entry_2x.ordered_entries.each do |entry|
|
157
|
+
entry.target.should == targets.shift
|
158
|
+
end
|
159
|
+
|
133
160
|
end
|
134
161
|
|
135
162
|
it "should include the actual targets this packed version covers in the targets property (even those w no stylesheet.css)" do
|
136
163
|
targets = @target.expand_required_targets + [@target]
|
137
164
|
@entry.targets.should == targets
|
165
|
+
@entry_2x.targets.should == targets
|
138
166
|
end
|
139
167
|
|
140
168
|
it "should NOT include minified source entries" do
|
141
169
|
@entry.source_entries.each do |entry|
|
142
170
|
entry.should_not be_minified
|
143
171
|
end
|
172
|
+
|
173
|
+
@entry_2x.source_entries.each do |entry|
|
174
|
+
entry.should_not be_minified
|
175
|
+
end
|
144
176
|
end
|
145
177
|
|
146
178
|
it "should be marked as packed" do
|
147
179
|
@entry.should be_packed
|
180
|
+
@entry_2x.should be_packed
|
148
181
|
end
|
149
182
|
|
150
183
|
end
|
@@ -20,6 +20,10 @@ module SC::ManifestSpecHelpers
|
|
20
20
|
:config => @config
|
21
21
|
end
|
22
22
|
|
23
|
+
def target_for(targetname)
|
24
|
+
@target.target_for(targetname)
|
25
|
+
end
|
26
|
+
|
23
27
|
def entry_for(filename, opts={})
|
24
28
|
@manifest.entry_for(filename, opts) || @manifest.entry_for(filename, opts.merge(:hidden => true))
|
25
29
|
end
|
@@ -1,13 +1,11 @@
|
|
1
|
+
config :req_target_2, :required => [:req_target_1]
|
2
|
+
#
|
1
3
|
# needed for HTML test...
|
2
|
-
config :html_test,
|
3
|
-
:required => [
|
4
|
+
config :html_test,
|
5
|
+
:required => ['/req_target_2'],
|
4
6
|
:layout => 'lib/layout_template.rhtml',
|
5
7
|
:debug_required => [:debug],
|
6
8
|
:test_required => [:qunit]
|
7
|
-
|
8
|
-
config :req_target_2,
|
9
|
-
:required => [:req_target_1],
|
10
|
-
:deferred_modules => [:dynamic_req_target_1]
|
11
9
|
|
12
10
|
config :test_test,
|
13
11
|
:test_layout => 'lib/test_layout.rhtml',
|
@@ -15,6 +13,10 @@ config :test_test,
|
|
15
13
|
:test_required => [:qunit],
|
16
14
|
:theme => nil
|
17
15
|
|
18
|
-
config
|
19
|
-
:required => [:
|
20
|
-
|
16
|
+
config '/module_test/deferred_module',
|
17
|
+
:required => [:required_target, '/module_test/dynamic_req_target_1']
|
18
|
+
|
19
|
+
config :module_test,
|
20
|
+
:deferred_modules => [:deferred_module],
|
21
|
+
:prefetched_modules => [:required_target],
|
22
|
+
:inlined_modules => [:inlined_module]
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# ===========================================================================
|
2
|
+
# Project: ChanceTest
|
3
|
+
# Copyright: ©2011 My Company, Inc.
|
4
|
+
# ===========================================================================
|
5
|
+
|
6
|
+
# This is your Buildfile for your app, ChanceTest. This tells SproutCore
|
7
|
+
# how to build your app. These settings override those in your project
|
8
|
+
# Buildfile, which contains default settings for all apps in your project.
|
9
|
+
#
|
10
|
+
# This line tells SproutCore's CSS preprocessor what class names to target.
|
11
|
+
# Since your app has a theme named 'chance-test', and it is based on SproutCore's
|
12
|
+
# Ace theme (named 'ace'), it is set to 'ace.chance-test'.
|
13
|
+
config :chance_test, :css_theme => 'ace.chance-test'
|
14
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: ChanceTest
|
3
|
+
// Copyright: ©2011 My Company, Inc.
|
4
|
+
// ==========================================================================
|
5
|
+
/*globals ChanceTest */
|
6
|
+
|
7
|
+
/** @namespace
|
8
|
+
|
9
|
+
My cool new app. Describe your application.
|
10
|
+
|
11
|
+
@extends SC.Object
|
12
|
+
*/
|
13
|
+
ChanceTest = SC.Application.create(
|
14
|
+
/** @scope ChanceTest.prototype */ {
|
15
|
+
|
16
|
+
NAMESPACE: 'ChanceTest',
|
17
|
+
VERSION: '0.1.0',
|
18
|
+
|
19
|
+
// This is your application store. You will use this store to access all
|
20
|
+
// of your model data. You can also set a data source on this store to
|
21
|
+
// connect to a backend server. The default setup below connects the store
|
22
|
+
// to any fixtures you define.
|
23
|
+
store: SC.Store.create().from(SC.Record.fixtures)
|
24
|
+
|
25
|
+
// TODO: Add global constants or singleton objects needed by your app here.
|
26
|
+
|
27
|
+
}) ;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: ChanceTest
|
3
|
+
// Copyright: ©2011 My Company, Inc.
|
4
|
+
// ==========================================================================
|
5
|
+
/*globals ChanceTest */
|
6
|
+
|
7
|
+
// This is the function that will start your app running. The default
|
8
|
+
// implementation will load any fixtures you have created then instantiate
|
9
|
+
// your controllers and awake the elements on your page.
|
10
|
+
//
|
11
|
+
// As you develop your application you will probably want to override this.
|
12
|
+
// See comments for some pointers on what to do next.
|
13
|
+
//
|
14
|
+
ChanceTest.main = function main() {
|
15
|
+
|
16
|
+
// Step 1: Instantiate Your Views
|
17
|
+
// The default code here will make the mainPane for your application visible
|
18
|
+
// on screen. If you app gets any level of complexity, you will probably
|
19
|
+
// create multiple pages and panes.
|
20
|
+
ChanceTest.getPath('mainPage.mainPane').append() ;
|
21
|
+
|
22
|
+
// Step 2. Set the content property on your primary controller.
|
23
|
+
// This will make your app come alive!
|
24
|
+
|
25
|
+
// TODO: Set the content property on your primary controller
|
26
|
+
// ex: ChanceTest.contactsController.set('content',ChanceTest.contacts);
|
27
|
+
|
28
|
+
} ;
|
29
|
+
|
30
|
+
function main() { ChanceTest.main(); }
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% content_for :loading do %>
|
2
|
+
<% # Any HTML in this file will be visible on screen while your page loads
|
3
|
+
# its application JavaScript. SproutCore applications are optimized for
|
4
|
+
# caching and startup very fast, so your users will often only see this
|
5
|
+
# content for a brief moment on their first app load, if at all.
|
6
|
+
%>
|
7
|
+
<p class="loading">Loading...<p>
|
8
|
+
|
9
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: ChanceTest - mainPage
|
3
|
+
// Copyright: ©2011 My Company, Inc.
|
4
|
+
// ==========================================================================
|
5
|
+
/*globals ChanceTest */
|
6
|
+
|
7
|
+
// This page describes the main user interface for your application.
|
8
|
+
ChanceTest.mainPage = SC.Page.design({
|
9
|
+
|
10
|
+
// The main pane is made visible on screen as soon as your app is loaded.
|
11
|
+
// Add childViews to this pane for views to display immediately on page
|
12
|
+
// load.
|
13
|
+
mainPane: SC.MainPane.design({
|
14
|
+
childViews: 'labelView'.w(),
|
15
|
+
|
16
|
+
labelView: SC.LabelView.design({
|
17
|
+
layout: { centerX: 0, centerY: 0, width: 200, height: 18 },
|
18
|
+
textAlign: SC.ALIGN_CENTER,
|
19
|
+
tagName: "h1",
|
20
|
+
value: "Welcome to SproutCore!"
|
21
|
+
})
|
22
|
+
})
|
23
|
+
|
24
|
+
});
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: ChanceTest
|
3
|
+
// Copyright: ©2011 My Company, Inc.
|
4
|
+
// ==========================================================================
|
5
|
+
/*globals ChanceTest */
|
6
|
+
|
7
|
+
// This is the theme that defines how your app renders.
|
8
|
+
//
|
9
|
+
// Your app is given its own theme so it is easier and less
|
10
|
+
// messy for you to override specific things just for your
|
11
|
+
// app.
|
12
|
+
//
|
13
|
+
// You don't have to create the whole theme on your own, though:
|
14
|
+
// your app's theme is based on SproutCore's Ace theme.
|
15
|
+
//
|
16
|
+
// NOTE: if you want to change the theme this one is based on, don't
|
17
|
+
// forget to change the :css_theme property in your buildfile.
|
18
|
+
ChanceTest.Theme = SC.AceTheme.create({
|
19
|
+
name: 'chance-test'
|
20
|
+
});
|
21
|
+
|
22
|
+
// SproutCore needs to know that your app's theme exists
|
23
|
+
SC.Theme.addTheme(ChanceTest.Theme);
|
24
|
+
|
25
|
+
// Setting it as the default theme makes every pane SproutCore
|
26
|
+
// creates default to this theme unless otherwise specified.
|
27
|
+
SC.defaultTheme = 'chance-test';
|
@@ -0,0 +1 @@
|
|
1
|
+
alert('module_test');
|
File without changes
|
data/spec/fixtures/builder_tests/apps/module_test/modules/deferred_module/english.lproj/test.rhtml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<h1><%= %w(req_target_2 sample).join('_') %></h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
// This is a pathological case. What if the developer adds a file named javascript.js to their source. Everything should still work.
|
data/spec/fixtures/builder_tests/apps/module_test/modules/deferred_module/lib/alt_layout.rhtml
ADDED
File without changes
|
File without changes
|
data/spec/fixtures/builder_tests/apps/module_test/modules/dynamic_req_target_1/dynamic_req_js_1.js
ADDED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/fixtures/builder_tests/apps/module_test/modules/required_target/english.lproj/test.rhtml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<h1><%= %w(req_target_1 sample).join('_') %></h1>
|
File without changes
|
@@ -2,11 +2,21 @@
|
|
2
2
|
|
3
3
|
# required because this buildfile lives inside of the source dir which itself
|
4
4
|
# has a Buildfile
|
5
|
-
project!
|
5
|
+
project!
|
6
6
|
|
7
7
|
# This is the generic requirement for most apps. Of course SproutCore will
|
8
8
|
# override this for itself, so you don't have to worry about it causing
|
9
9
|
# trouble.
|
10
10
|
config :all, :required => :sproutcore
|
11
11
|
|
12
|
+
config :contacts, :deferred_modules => ['contacts/preferences']
|
13
|
+
|
14
|
+
config :mail, :deferred_modules => ['mail/preferences']
|
15
|
+
config 'mail/preferences', :required => 'mail/printing'
|
16
|
+
|
17
|
+
config :photos, :inlined_modules => ['photos/preferences'],
|
18
|
+
:deferred_modules => ['photos/email']
|
19
|
+
|
12
20
|
config :mobile_photos, :required => 'sproutcore/mobile'
|
21
|
+
|
22
|
+
config :account, :prefetched_modules => ['account/preferences'],
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require "lib/builders/spec_helper"
|
2
|
+
|
3
|
+
describe SC::Builder::Chance do
|
4
|
+
|
5
|
+
include SC::SpecHelpers
|
6
|
+
include SC::BuilderSpecHelper
|
7
|
+
|
8
|
+
before do
|
9
|
+
std_before :chance_test
|
10
|
+
end
|
11
|
+
|
12
|
+
after do
|
13
|
+
std_after
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should extract files from Chance instance sc_require statements" do
|
17
|
+
|
18
|
+
# We create our own Chance instance and add custom files in this test.
|
19
|
+
instance = Chance::Instance.new()
|
20
|
+
instance.files["test-file.css"] = ".hello { background: static_url('test.png'); }"
|
21
|
+
|
22
|
+
# First, our fake Chance entry. We are going to set it up to copy "core.js"
|
23
|
+
# to "core_copied.js" so we know it ran.
|
24
|
+
chance_entry = @manifest.add_entry "core_copied.js",
|
25
|
+
:chance => instance,
|
26
|
+
:staging_path => File.join(@target.cache_root, 'core_copied.js'),
|
27
|
+
:build_path => File.join(@target.build_root, 'core_copied.js'),
|
28
|
+
:source_path => File.join(@target.source_root, 'core.js'),
|
29
|
+
:build_task => "build:copy"
|
30
|
+
|
31
|
+
# PRECONDITION: this file should not be copied yet!
|
32
|
+
File.exist?(chance_entry[:staging_path]).should be_false
|
33
|
+
File.exist?(chance_entry[:build_path]).should be_false
|
34
|
+
|
35
|
+
# We will hand the entries over in the WRONG order, because Chance parses
|
36
|
+
# the sc_require to determine the correct order. ordered entries should be ignored
|
37
|
+
filename = "stylesheet@test.css"
|
38
|
+
entry = @manifest.add_entry filename,
|
39
|
+
:chance_entry => chance_entry,
|
40
|
+
:chance_file => "test-file.css"
|
41
|
+
|
42
|
+
dest = entry.build_path
|
43
|
+
|
44
|
+
# Build using the entry we created
|
45
|
+
SC::Builder::ChanceFile.build(entry, dest)
|
46
|
+
result = File.readlines(dest)*""
|
47
|
+
|
48
|
+
|
49
|
+
# Chance should have "built"
|
50
|
+
# It should not stage. Since it will end up building anyway, if it stages it
|
51
|
+
# will have built twice. Given that Chance is not exactly fast, this would
|
52
|
+
# be a bug.
|
53
|
+
File.exist?(chance_entry[:staging_path]).should be_false
|
54
|
+
File.exist?(chance_entry[:build_path]).should be_true
|
55
|
+
|
56
|
+
|
57
|
+
# There is a static_url; it should be replaced, but the file does not
|
58
|
+
# exist so itw ill turn into ''
|
59
|
+
result.strip.should == ".hello { background: url(''); }"
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|