sproutcore 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/frameworks/sproutcore/CHANGELOG.md +212 -11
- data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +17 -17
- data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/request.js +103 -86
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/bootstrap/tests/system/browser.js +33 -21
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +3 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +7 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +5 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +7 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +36 -30
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +84 -42
- data/lib/frameworks/sproutcore/frameworks/desktop/{resources/debug → debug/resources}/a_sample_image.jpg +0 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/{resources/debug → debug/resources}/iframe.html +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/responder.js +68 -68
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/list_item.css +1 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/menu_item_view.css +1 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/slider.css +6 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +45 -36
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/{gestureable.js → gesturable.js} +0 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/label.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/benchmark.css +1 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +13 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/views/inline_text_field.js +4 -33
- data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +31 -17
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +59 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
- data/lib/frameworks/sproutcore/themes/ace/resources/master-detail/master-detail.css +4 -0
- data/lib/gen/app/templates/apps/@target_name@/Buildfile +3 -1
- data/lib/gen/app/templates/apps/@target_name@/core.js +3 -3
- data/lib/gen/app/templates/apps/@target_name@/main.js +7 -5
- data/lib/gen/app/templates/apps/@target_name@/resources/main_page.css +20 -0
- data/lib/gen/app/templates/apps/@target_name@/resources/main_page.js +7 -7
- data/lib/gen/controller/templates/controllers/@filename@_controller.js +2 -2
- data/lib/gen/data-source/templates/data_sources/@filename@_data_source.js +21 -21
- data/lib/gen/design/templates/resources/@filename@.css +12 -0
- data/lib/gen/framework/templates/frameworks/@target_name@/core.js +3 -3
- data/lib/gen/framework/templates/frameworks/@target_name@/english.lproj/strings.js +1 -1
- data/lib/gen/language/templates/@filename@/strings.js +1 -1
- data/lib/gen/model/templates/models/@filename@_model.js +1 -1
- data/lib/gen/page/templates/pages/@target_name@/core.js +3 -3
- data/lib/gen/project/templates/@filename@/Buildfile +29 -5
- data/lib/gen/{responder → state}/Buildfile +3 -2
- data/lib/gen/state/README +1 -0
- data/lib/gen/state/USAGE +15 -0
- data/lib/gen/state/templates/states/@filename@_state.js +24 -0
- data/lib/gen/state/templates/tests/states/@filename@_test.js +12 -0
- data/lib/gen/statechart_app/templates/apps/@target_name@/Buildfile +3 -1
- data/lib/gen/statechart_app/templates/apps/@target_name@/core.js +3 -3
- data/lib/gen/statechart_app/templates/apps/@target_name@/main.js +3 -10
- data/lib/gen/statechart_app/templates/apps/@target_name@/resources/main_page.css +20 -0
- data/lib/gen/statechart_app/templates/apps/@target_name@/resources/main_page.js +7 -7
- data/lib/gen/statechart_app/templates/apps/@target_name@/statechart.js +3 -3
- data/lib/sproutcore/models/generator.rb +1 -1
- data/spec/lib/models/generator/snake_case_spec.rb +26 -0
- data/sproutcore.gemspec +16 -16
- data/vendor/chance/lib/chance/instance/spriting.rb +32 -30
- metadata +30 -26
- data/lib/frameworks/sproutcore/frameworks/desktop/resources/debug/apple-logo1.jpeg +0 -0
- data/lib/gen/responder/README +0 -1
- data/lib/gen/responder/USAGE +0 -15
- data/lib/gen/responder/templates/states/@filename@_state.js +0 -36
@@ -557,7 +557,7 @@ SC.TextFieldView = SC.FieldView.extend(SC.StaticLayout, SC.Editable,
|
|
557
557
|
// right-justify the view.
|
558
558
|
if (!layout.right) layout.right = 0 ;
|
559
559
|
|
560
|
-
rightAccessoryView.adjust(
|
560
|
+
rightAccessoryView.adjust(layout) ;
|
561
561
|
}
|
562
562
|
}
|
563
563
|
}
|
@@ -1181,6 +1181,64 @@ SC.TextFieldView = SC.FieldView.extend(SC.StaticLayout, SC.Editable,
|
|
1181
1181
|
return YES ; // handled
|
1182
1182
|
},
|
1183
1183
|
|
1184
|
+
// If this is a multi-line field, then allow the new line to proceed.
|
1185
|
+
/** @private */
|
1186
|
+
insertNewline: function(evt) {
|
1187
|
+
if (this.get('isTextArea')) {
|
1188
|
+
evt.allowDefault();
|
1189
|
+
return YES; // handled
|
1190
|
+
}
|
1191
|
+
return NO;
|
1192
|
+
},
|
1193
|
+
|
1194
|
+
/** @private */
|
1195
|
+
deleteForward: function(evt) {
|
1196
|
+
evt.allowDefault();
|
1197
|
+
return YES;
|
1198
|
+
},
|
1199
|
+
|
1200
|
+
/** @private */
|
1201
|
+
deleteBackward: function(evt) {
|
1202
|
+
evt.allowDefault();
|
1203
|
+
return YES;
|
1204
|
+
},
|
1205
|
+
|
1206
|
+
/** @private */
|
1207
|
+
moveLeft: function(evt) {
|
1208
|
+
evt.allowDefault();
|
1209
|
+
return YES;
|
1210
|
+
},
|
1211
|
+
|
1212
|
+
/** @private */
|
1213
|
+
moveRight: function(evt) {
|
1214
|
+
evt.allowDefault();
|
1215
|
+
return YES;
|
1216
|
+
},
|
1217
|
+
|
1218
|
+
/** @private */
|
1219
|
+
selectAll: function(evt) {
|
1220
|
+
evt.allowDefault();
|
1221
|
+
return YES;
|
1222
|
+
},
|
1223
|
+
|
1224
|
+
/** @private */
|
1225
|
+
moveUp: function(evt) {
|
1226
|
+
if (this.get('isTextArea')) {
|
1227
|
+
evt.allowDefault();
|
1228
|
+
return YES;
|
1229
|
+
}
|
1230
|
+
return NO;
|
1231
|
+
},
|
1232
|
+
|
1233
|
+
/** @private */
|
1234
|
+
moveDown: function(evt) {
|
1235
|
+
if (this.get('isTextArea')) {
|
1236
|
+
evt.allowDefault();
|
1237
|
+
return YES;
|
1238
|
+
}
|
1239
|
+
return NO;
|
1240
|
+
},
|
1241
|
+
|
1184
1242
|
keyUp: function (evt) {
|
1185
1243
|
if (SC.browser.isMozilla &&
|
1186
1244
|
evt.keyCode === SC.Event.KEY_RETURN) { this.fieldValueDidChange(); }
|
@@ -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.9.
|
42
|
+
@version 1.9.2
|
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.9.
|
62
|
+
SC.VERSION = '1.9.2';
|
63
63
|
|
64
64
|
/**
|
65
65
|
@private
|
@@ -2,6 +2,8 @@ $theme.master-detail {
|
|
2
2
|
background: #333;
|
3
3
|
|
4
4
|
&.round-toolbars $theme.toolbar {
|
5
|
+
border-top-left-radius: 10px;
|
6
|
+
border-top-right-radius: 10px;
|
5
7
|
-webkit-border-top-left-radius: 10px;
|
6
8
|
-webkit-border-top-right-radius: 10px;
|
7
9
|
-moz-border-radius-topleft: 10px;
|
@@ -19,6 +21,8 @@ $theme.master-detail {
|
|
19
21
|
}
|
20
22
|
|
21
23
|
&.round-toolbars > .sc-view {
|
24
|
+
border-top-left-radius: 10px;
|
25
|
+
border-top-right-radius: 10px;
|
22
26
|
-webkit-border-top-left-radius: 10px;
|
23
27
|
-webkit-border-top-right-radius: 10px;
|
24
28
|
-moz-border-radius-topleft: 10px;
|
@@ -3,7 +3,9 @@
|
|
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
|
+
# To learn more about configuring the Buildfile, please visit
|
8
|
+
# http://guides.sproutcore.com/build_tools.html.
|
6
9
|
|
7
10
|
# It is better to add :required targets here than in the global Buildfile.
|
8
11
|
config :<%= target_name %>, :required => :sproutcore
|
9
|
-
|
@@ -4,7 +4,7 @@
|
|
4
4
|
/** @namespace
|
5
5
|
|
6
6
|
My cool new app. Describe your application.
|
7
|
-
|
7
|
+
|
8
8
|
@extends SC.Object
|
9
9
|
*/
|
10
10
|
<%= namespace %> = SC.Application.create(
|
@@ -18,7 +18,7 @@
|
|
18
18
|
// connect to a backend server. The default setup below connects the store
|
19
19
|
// to any fixtures you define.
|
20
20
|
store: SC.Store.create().from(SC.Record.fixtures)
|
21
|
-
|
21
|
+
|
22
22
|
// TODO: Add global constants or singleton objects needed by your app here.
|
23
23
|
|
24
|
-
})
|
24
|
+
});
|
@@ -12,16 +12,18 @@
|
|
12
12
|
|
13
13
|
// Step 1: Instantiate Your Views
|
14
14
|
// The default code here will make the mainPane for your application visible
|
15
|
-
// on screen. If you app gets any level of complexity, you will probably
|
16
|
-
// create multiple pages and panes.
|
15
|
+
// on screen. If you app gets any level of complexity, you will probably
|
16
|
+
// create multiple pages and panes.
|
17
17
|
<%= namespace %>.getPath('mainPage.mainPane').append() ;
|
18
18
|
|
19
19
|
// Step 2. Set the content property on your primary controller.
|
20
20
|
// This will make your app come alive!
|
21
|
+
//
|
22
|
+
// ex.
|
23
|
+
// var content = <%= namespace %>.store.find(<%= namespace %>.Group);
|
24
|
+
// <%= namespace %>.groupsController.set('content', content);
|
21
25
|
|
22
|
-
|
23
|
-
// ex: <%= namespace %>.contactsController.set('content',<%= namespace %>.contacts);
|
26
|
+
};
|
24
27
|
|
25
|
-
} ;
|
26
28
|
|
27
29
|
function main() { <%= namespace %>.main(); }
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// Add your custom CSS styles here.
|
2
|
+
//
|
3
|
+
// You may want to create additional stylesheet files for every page or pane
|
4
|
+
// within your application rather than placing all your CSS in here. In any
|
5
|
+
// case, all stylesheet files will be combined into a single stylesheet on
|
6
|
+
// build to let it load super fast.
|
7
|
+
//
|
8
|
+
// Remember, Compass (http://compass-style.org) is built in and you can use
|
9
|
+
// SCSS syntax (http://sass-lang.com/) even though stylesheet files should end
|
10
|
+
// with the .css extension.
|
11
|
+
//
|
12
|
+
// Learn more on styling your app here: http://sproutcore.com/guides/chance.html
|
13
|
+
|
14
|
+
// Example. This style is applied to the labelView child view.
|
15
|
+
$theme.sc-label-view.welcome-label {
|
16
|
+
font-size: 16px;
|
17
|
+
line-height: 24px;
|
18
|
+
text-align: center;
|
19
|
+
text-shadow: rgba(255, 255, 255, 0.5) 0 1px 1px;
|
20
|
+
}
|
@@ -1,19 +1,19 @@
|
|
1
1
|
<%= copyright_block("#{namespace} - mainPage") %>
|
2
2
|
/*globals <%= namespace %> */
|
3
3
|
|
4
|
-
// This page describes the main user interface for your application.
|
4
|
+
// This page describes the main user interface for your application.
|
5
5
|
<%= namespace %>.mainPage = SC.Page.design({
|
6
6
|
|
7
7
|
// The main pane is made visible on screen as soon as your app is loaded.
|
8
|
-
// Add childViews to this pane for views to display immediately on page
|
8
|
+
// Add childViews to this pane for views to display immediately on page
|
9
9
|
// load.
|
10
10
|
mainPane: SC.MainPane.design({
|
11
|
-
childViews: 'labelView'
|
12
|
-
|
11
|
+
childViews: ['labelView'],
|
12
|
+
|
13
13
|
labelView: SC.LabelView.design({
|
14
|
-
|
15
|
-
|
16
|
-
tagName: "h1",
|
14
|
+
classNames: ['welcome-label'],
|
15
|
+
layout: { centerX: 0, centerY: 0, width: 300, height: 24 },
|
16
|
+
tagName: "h1",
|
17
17
|
value: "Welcome to SproutCore!"
|
18
18
|
})
|
19
19
|
})
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
(Document Your Controller Here)
|
7
7
|
|
8
|
-
@extends <%= base_class_name || 'SC.
|
8
|
+
@extends <%= base_class_name || 'SC.ObjectController' %>
|
9
9
|
*/
|
10
10
|
<%= namespace_instance_name %> = <%= base_class_name || 'SC.ObjectController' %>.create(
|
11
11
|
/** @scope <%= namespace_instance_name %>.prototype */ {
|
12
12
|
|
13
13
|
// TODO: Add your own code here.
|
14
14
|
|
15
|
-
})
|
15
|
+
});
|
@@ -12,50 +12,50 @@
|
|
12
12
|
|
13
13
|
// ..........................................................
|
14
14
|
// QUERY SUPPORT
|
15
|
-
//
|
15
|
+
//
|
16
16
|
|
17
17
|
fetch: function(store, query) {
|
18
18
|
|
19
|
-
// TODO: Add handlers to fetch data for specific queries.
|
19
|
+
// TODO: Add handlers to fetch data for specific queries.
|
20
20
|
// call store.dataSourceDidFetchQuery(query) when done.
|
21
21
|
|
22
|
-
return NO
|
22
|
+
return NO; // return YES if you handled the query
|
23
23
|
},
|
24
24
|
|
25
25
|
// ..........................................................
|
26
26
|
// RECORD SUPPORT
|
27
|
-
//
|
28
|
-
|
27
|
+
//
|
28
|
+
|
29
29
|
retrieveRecord: function(store, storeKey) {
|
30
|
-
|
30
|
+
|
31
31
|
// TODO: Add handlers to retrieve an individual record's contents
|
32
32
|
// call store.dataSourceDidComplete(storeKey) when done.
|
33
|
-
|
34
|
-
return NO
|
33
|
+
|
34
|
+
return NO; // return YES if you handled the storeKey
|
35
35
|
},
|
36
|
-
|
36
|
+
|
37
37
|
createRecord: function(store, storeKey) {
|
38
|
-
|
38
|
+
|
39
39
|
// TODO: Add handlers to submit new records to the data source.
|
40
40
|
// call store.dataSourceDidComplete(storeKey) when done.
|
41
|
-
|
42
|
-
return NO
|
41
|
+
|
42
|
+
return NO; // return YES if you handled the storeKey
|
43
43
|
},
|
44
|
-
|
44
|
+
|
45
45
|
updateRecord: function(store, storeKey) {
|
46
|
-
|
46
|
+
|
47
47
|
// TODO: Add handlers to submit modified record to the data source
|
48
48
|
// call store.dataSourceDidComplete(storeKey) when done.
|
49
49
|
|
50
|
-
return NO
|
50
|
+
return NO; // return YES if you handled the storeKey
|
51
51
|
},
|
52
|
-
|
52
|
+
|
53
53
|
destroyRecord: function(store, storeKey) {
|
54
|
-
|
54
|
+
|
55
55
|
// TODO: Add handlers to destroy records on the data source.
|
56
56
|
// call store.dataSourceDidDestroy(storeKey) when done
|
57
|
-
|
58
|
-
return NO
|
57
|
+
|
58
|
+
return NO; // return YES if you handled the storeKey
|
59
59
|
}
|
60
|
-
|
61
|
-
})
|
60
|
+
|
61
|
+
});
|
@@ -0,0 +1,12 @@
|
|
1
|
+
// Add your custom CSS styles here.
|
2
|
+
//
|
3
|
+
// You may want to create additional stylesheet files for every page or pane
|
4
|
+
// within your application rather than placing all your CSS in here. In any
|
5
|
+
// case, all stylesheet files will be combined into a single stylesheet on
|
6
|
+
// build to let it load super fast.
|
7
|
+
//
|
8
|
+
// Remember, Compass (http://compass-style.org) is built in and you can use
|
9
|
+
// SCSS syntax (http://sass-lang.com/) even though stylesheet files should end
|
10
|
+
// with the .css extension.
|
11
|
+
//
|
12
|
+
// Learn more on styling your app here: http://sproutcore.com/guides/chance.html
|
@@ -4,15 +4,15 @@
|
|
4
4
|
/** @namespace
|
5
5
|
|
6
6
|
My cool new framework. Describe your framework.
|
7
|
-
|
7
|
+
|
8
8
|
@extends SC.Object
|
9
9
|
*/
|
10
10
|
<%= namespace %> = SC.Object.create(
|
11
11
|
/** @scope <%= namespace %>.prototype */ {
|
12
12
|
|
13
13
|
NAMESPACE: '<%= namespace %>',
|
14
|
-
VERSION: '0.1.0'
|
14
|
+
VERSION: '0.1.0'
|
15
15
|
|
16
16
|
// TODO: Add global constants or singleton objects needed by your app here.
|
17
17
|
|
18
|
-
})
|
18
|
+
});
|
@@ -4,7 +4,7 @@
|
|
4
4
|
/** @namespace
|
5
5
|
|
6
6
|
Static page JavaScript
|
7
|
-
|
7
|
+
|
8
8
|
@extends SC.Object
|
9
9
|
*/
|
10
10
|
<%= namespace %> = SC.Object.create(
|
@@ -12,8 +12,8 @@
|
|
12
12
|
|
13
13
|
NAMESPACE: '<%= namespace %>',
|
14
14
|
VERSION: '0.1.0'
|
15
|
-
|
15
|
+
|
16
16
|
// TODO: You can place any JavaScript you need on your page here. If you
|
17
17
|
// don't want any JavaScript, just delete this file.
|
18
18
|
|
19
|
-
})
|
19
|
+
});
|
@@ -1,9 +1,33 @@
|
|
1
1
|
<%= copyright_block(namespace, :ruby) %>
|
2
2
|
|
3
|
-
# This is your Buildfile, which
|
4
|
-
#
|
5
|
-
#
|
3
|
+
# This is your Buildfile, which determines how your project is built.
|
4
|
+
# In addition to this Buildfile, each of your apps and frameworks may have its
|
5
|
+
# own Buildfile with settings specific to each.
|
6
|
+
|
7
|
+
# General configuration.
|
6
8
|
config :all, :required => :sproutcore
|
7
9
|
|
8
|
-
#
|
9
|
-
|
10
|
+
# Development (debug) mode configuration.
|
11
|
+
mode :debug do
|
12
|
+
end
|
13
|
+
|
14
|
+
# Production (build) mode configuration.
|
15
|
+
mode :production do
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
# Proxying.
|
21
|
+
# When running the app locally, same-origin policy prevents the app (at localhost)
|
22
|
+
# from accessing other domains. One of the major roles of the SproutCore
|
23
|
+
# development server is to proxy local requests for remote resources so that
|
24
|
+
# the browser believes they are coming from the same domain.
|
25
|
+
#
|
26
|
+
# You should place all your proxy directives in this Buildfile.
|
27
|
+
#
|
28
|
+
# For example, proxy all requests for '/users' to 'https://my-domain.com/people'.
|
29
|
+
# proxy "/users", :to => "my-domain.com", :secure => true, :url => "/people"
|
30
|
+
|
31
|
+
|
32
|
+
# To learn more about configuring the Buildfile, please visit
|
33
|
+
# http://guides.sproutcore.com/build_tools.html.
|
@@ -8,11 +8,12 @@ namespace :generator do
|
|
8
8
|
|
9
9
|
# - Verify required properties are present
|
10
10
|
# - Accept second argument as base class
|
11
|
+
# - If file name ends in "_state", strip it off
|
11
12
|
|
12
13
|
task :prepare do
|
13
14
|
GENERATOR.requires! :target_project, :target, :namespace, :class_name
|
14
|
-
GENERATOR.class_name = GENERATOR.class_name.upcase
|
15
15
|
GENERATOR.base_class_name ||= GENERATOR.arguments[2]
|
16
|
+
GENERATOR.filename = GENERATOR.filename.sub(/_state$/,'')
|
16
17
|
end
|
17
|
-
|
18
|
+
|
18
19
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Your state is ready to use! Fill in the missing methods in the new file.
|
data/lib/gen/state/USAGE
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
state - Create a new State class to use in your statecharts.
|
2
|
+
|
3
|
+
USAGE:
|
4
|
+
|
5
|
+
sc-gen state AppName.StateName [--filename=FILENAME] [--target=TARGET_NAME]
|
6
|
+
|
7
|
+
DISCUSSION:
|
8
|
+
|
9
|
+
This generator will create a new SproutCore State template file in your
|
10
|
+
app. You should pass as the first parameter your AppName.StateName combination you want to create. For example:
|
11
|
+
|
12
|
+
sc-gen responder Todos.LoadingState
|
13
|
+
|
14
|
+
defines a new class called Todos.LoadingState in the file apps/todos/states/loading_state.js.
|
15
|
+
|